/* ==========================================================================
   dealium: styles

   Sections
     1. Design tokens (colors, shared values)
     2. Page basics
     3. Countdowns (Steam sale, Humble Choice)
     4. Game tiles (shared)  +  Steam tiles  +  Humble tiles
     5. Extra deal groups (70%, 50%, historical)
     6. Stores
     7. Footer bar
     8. Currency switch
     9. Small screens and reduced motion
    10. Game page (game.html)

   Class names follow what they are: "steam-price" is the price on a Steam
   tile, "humble-genre" is the genre line on a Humble tile, and so on.
   ========================================================================== */


/* 1. Design tokens ------------------------------------------------------ */

:root {
  --bg: #000000;
  --text: #f2f2f2;
  --text-soft: #a8a8a8;
  --text-muted: #6b6b6b;

  --line: #222222;          /* thin borders */
  --line-hover: #4a4a4a;    /* borders when hovered */
  --tile-bg: #050505;
  --tile-bg-hover: #0b0b0b;

  --tile-price: #d4d4d4;    /* .steam-price */
  --tile-genre: #c4c4c4;    /* .steam-genre, .humble-genre */
  --footer-link: #4f4f4f;
  --footer-credit: #5f5f5f;
  --footer-separator: #262626;
  --switch-active: #161616; /* selected currency button */
  --note-underline: #333333;
  --review-star: #f2f2f2;        /* filled part of the review stars */
  --review-star-empty: #4a4a4a;  /* the rest */
  --ends-soon: #ff4d4d;          /* "ends in" tag in the last 24 hours (red) */
  --new-dot: #3ddc84;            /* "new since your last visit" dot (green) */
  --deck-verified: #59bf40;      /* Steam Deck Verified icon (green check) */
  --lowest-ever: #f5c542;        /* "lowest ever" under a Steam price (gold) */

  --content-width: 76rem;
  --tile-gap: 0.7rem;       /* space between game tiles */
  --column-split: 2.5rem;   /* gap between the Steam 90% and Humble Choice columns */

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: inherit; }


/* 2. Page basics -------------------------------------------------------- */

html {
  height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  padding: 4.25rem 1.5rem 1.5rem;   /* top space keeps the currency switch clear */
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Geom", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(3rem, 8vh, 5rem);
}

/* Text for screen readers only (the page title nobody needs to see). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Section headings and small notes, used all over the page. */
.section-title { margin: 2.5rem 0 1rem; color: var(--text-soft); font-size: 1rem; }
.section-about { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.8125rem; }
.section-note  { margin: 1rem 0 0; color: var(--text-muted); font-size: 0.8rem; }
.humble-value strong { color: var(--text); font-weight: 600; }   /* the total under the Humble list */


/* 3. Countdowns --------------------------------------------------------- */

.countdowns {
  width: min(100%, var(--content-width));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 3.5rem var(--column-split);
}

.column { min-width: 0; }

/* The countdowns themselves keep the wider space between them. */
.column:first-child > .countdown,
.column:first-child > .timezone-row {
  margin-right: max(0px, calc(clamp(2.5rem, 7vw, 6rem) - var(--column-split)));
}

/* The big clickable countdown card. */
.countdown {
  position: relative;
  display: block;
  padding-bottom: 1.75rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  outline: none;
}

/* White line that draws across the bottom on hover. */
.countdown::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.countdown:hover::after,
.countdown:focus-visible::after { transform: scaleX(1); }
.countdown:focus-visible { outline: 1px solid var(--text-soft); outline-offset: 8px; }

.countdown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.countdown-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.countdown-name img {
  width: 1.4rem;
  height: 1.4rem;
  object-fit: contain;
  flex: none;
}

.countdown-state {
  color: var(--text-muted);
  font-size: 0.9375rem;
  transition: color 0.3s;
}
.countdown:hover .countdown-state,
.countdown:focus-visible .countdown-state { color: var(--text-soft); }

/* Days : hours : minutes : seconds, close together. The colons sit in their own narrow columns.
   Sizes are in em of the digit size set here, so everything scales together. */
.countdown-units {
  display: grid;
  grid-template-columns: repeat(7, auto);   /* 4 numbers + 3 colons */
  justify-content: start;
  align-items: start;
  gap: 0 0.08em;                            /* space on each side of a colon */
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
  font-size: clamp(2.75rem, 6.5vw, 5.25rem);   /* the digit size */
}
.unit-colon {
  width: 0.3em;
  color: var(--text-muted);
  font-size: 1em;
  font-weight: 300;
  line-height: 1;
  text-align: center;
  transform: translateY(-0.06em);               /* optically centred on the digits */
}
.unit { display: block; }

.unit-number {
  display: block;
  color: #ffffff;
  font-size: 1em;
  font-weight: 300;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.3s;
}
.unit-number--days { font-weight: 600; }   /* only the days are bold */

/* One box per digit, all the same width, digit centred in it: the numbers never shift while ticking. */
.digit {
  display: inline-block;
  width: 0.62em;                 /* the widest Geom digit ("8") is about 0.64em at this weight */
  text-align: center;
}
.unit-number--days .digit { width: 0.66em; }   /* bold digits are wider (about 0.67em) */

.unit-label {
  display: block;
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* "Thu, Dec 17, 06:00 PM UTC" plus the time zone picker, under each countdown. */
.timezone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}
.target-time {
  display: block;
  min-height: 1.2em;
  color: var(--text-soft);
  font-size: 0.875rem;
}
/* "Add to calendar" and the time zone picker, side by side on the right. */
.timezone-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}
.calendar { position: relative; }
.calendar-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--tile-bg);
  color: var(--text-soft);
  font-size: 0.8125rem;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
.calendar-button::-webkit-details-marker { display: none; }
.calendar-button svg { display: block; flex: none; }
.calendar-button:hover,
.calendar[open] .calendar-button,
.calendar-button:focus-visible {
  border-color: var(--line-hover);
  color: var(--text);
  outline: none;
}
.calendar-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  z-index: 4;
  display: grid;
  min-width: 11rem;
  padding: 0.3rem;
  border: 1px solid var(--line-hover);
  border-radius: 0.5rem;
  background: #050505;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
}
.calendar-item {
  display: block;
  padding: 0.4rem 0.55rem;
  border: 0;
  border-radius: 0.35rem;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.calendar-item:hover,
.calendar-item:focus-visible { background: var(--switch-active); color: var(--text); outline: none; }
.calendar-empty { padding: 0.4rem 0.55rem; color: var(--text-muted); font-size: 0.8125rem; }

.timezone-select {
  max-width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--tile-bg);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
.timezone-select:hover,
.timezone-select:focus-visible {
  border-color: var(--line-hover);
  color: var(--text);
  outline: none;
}


/* 4. Game tiles --------------------------------------------------------- */

/* Under the countdowns: two tiles per row, or one when two would be too narrow for the
   stars / achievements / Deck line to fit on one line (16rem per tile, same as the sections below). */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--tile-gap);
}

/* One tile = one game. Layers, back to front:
     cover image  ->  dark overlay (::before)  ->  bottom fade (::after)  ->  text */
.game {
  position: relative;
  overflow: hidden;
  isolation: isolate;            /* keeps the layers inside the tile */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 9.375rem;          /* 150px: every tile the same height, Steam and Humble alike */
  padding: 0.9rem 1rem;
  border: 2px solid var(--line);
  border-radius: 0.5rem;
  background: var(--tile-bg);
  color: var(--text);
  text-decoration: none;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}
.game:hover,
.game:focus-visible,
.game-wrap:hover > .game {
  border-color: var(--line-hover);
  background: var(--tile-bg-hover);
}

.game-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.game:hover .game-art,
.game:focus-visible .game-art,
.game-wrap:hover > .game .game-art { transform: scale(1.04); }

/* Dark layer over the cover. Fully removed on hover so the image "lights up". */
.game::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: rgba(0, 0, 0, 0.7);
  transition: background 0.4s;
}
.game:hover::before,
.game:focus-visible::before,
.game-wrap:hover > .game::before { background: rgba(0, 0, 0, 0); }

.game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 70%);
  transition: opacity 0.4s;
}
.game:hover::after,
.game:focus-visible::after,
.game-wrap:hover > .game::after { opacity: 0.6; }

/* A Steam tile with its "⋯" menu (quick links) over the bottom right corner. */
.game-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}
.game-wrap > .game { flex: 1; min-width: 0; }
.game-wrap > .game .game-review { padding-right: 1.6rem; }   /* room for the button */
.game-more {
  position: absolute;
  right: calc(0.6rem + 2px);
  bottom: calc(0.6rem + 2px);
  z-index: 2;
}
.game-more[open] { z-index: 6; }
.game-more-button {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  color: var(--text-soft);
  list-style: none;
  cursor: pointer;
  filter: drop-shadow(0 0 3px #000);
  transition: background 0.3s, color 0.3s;
}
.game-more-button::-webkit-details-marker { display: none; }
.game-more-button:hover,
.game-more[open] .game-more-button,
.game-more-button:focus-visible {
  background: rgba(0, 0, 0, 0.75);
  color: var(--text);
  outline: none;
}
.game-more-menu {                 /* opens upwards, so it never hides behind the next row */
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.3rem);
  display: grid;
  min-width: 13rem;
  padding: 0.3rem;
  border: 1px solid var(--line-hover);
  border-radius: 0.5rem;
  background: #050505;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
}
.game-more-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.35rem;
  color: var(--text-soft);
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
}
.game-more-item:hover,
.game-more-item:focus-visible { background: var(--switch-active); color: var(--text); outline: none; }
.game-more-site { color: var(--text-muted); font-size: 0.6875rem; }

/* Top row: big number on the left, price or badge on the right. */
.game-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.game-tag {                     /* "-90%" on Steam tiles, "01" on Humble tiles */
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Bottom block: title with the genre line under it. */
.game-info { display: block; }
/* Always one line. js/tiles.js shrinks the font of a title that is too long (down to about 11px),
   so long names never make the tile taller; "…" only if even that is not enough. */
.game-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.25;
  transition: color 0.3s;
}

/* --- Steam tiles --- */
.steam-price {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--tile-price);
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
}
/* The price with the lowest price on record under it, both right-aligned. */
.steam-price-box {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}
.steam-low {                    /* "lowest was €3.99": Steam's lowest price on record */
  color: var(--text-soft);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.steam-low[hidden] { display: none; }
.steam-low--best {              /* today's price is the lowest ever */
  color: var(--lowest-ever);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.625rem;
}
/* Euro mode, but Steam's euro price has not been fetched yet: shows "price unknown". */
.steam-price--no-euro {
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}
.steam-genre {
  display: block;
  margin-top: 0.3rem;
  color: var(--tile-genre);
  font-size: 0.875rem;
  font-weight: 500;
}

/* --- Humble tiles --- */
.humble-badge {                 /* small icon top right (Battle.net key) */
  display: inline-flex;
  align-items: center;
}
.humble-badge img {
  display: block;
  height: 1.1rem;
  width: auto;
  flex: none;
  filter:
    drop-shadow(0 0 1px #000)
    drop-shadow(0 0 3px #000)
    drop-shadow(0 1px 6px rgba(0, 0, 0, 1))
    drop-shadow(0 2px 12px rgba(0, 0, 0, 0.95));
}
.humble-genre {
  display: block;
  margin-top: 0.3rem;
  color: var(--tile-genre);
  font-size: 0.75rem;           /* a little smaller than .steam-genre */
  font-weight: 500;
}

/* --- Epic tiles (free games) --- */
.epic-free[hidden] { display: none; }
.epic-normal-price {            /* Epic's normal price, crossed out: the game is free right now */
  color: var(--text-soft);
  font-weight: 500;
  text-decoration: line-through;
}
.epic-when {                    /* "Free to keep until Thu, 10 Dec" */
  display: block;
  margin-top: 0.3rem;
  color: var(--tile-genre);
  font-size: 0.875rem;
  font-weight: 500;
}

/* --- "ends in 2d" tag next to the discount (Steam tiles), "free in 2d" on Epic tiles --- */
.game-top-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.game-ends {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line-hover);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-soft);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.game-ends[hidden] { display: none; }
.game-ends--soon {             /* under 24 hours left */
  border-color: var(--ends-soon);
  color: var(--ends-soon);
}
/* The whole tile gets the same red border while its sale has under 24 hours left (also on hover). */
.game:has(.game-ends--soon:not([hidden])) { border-color: var(--ends-soon); }

/* --- "New since your last visit" dot, top left corner of the tile --- */
.game-new {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--new-dot);
  box-shadow: 0 0 0 2px #000, 0 0 8px var(--new-dot);
}

/* --- Facts line under the title: review stars, achievements, Steam Deck Verified --- */
.game-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.2rem;
  margin-top: 0.35rem;
  color: var(--tile-genre);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
/* Two rows of five stars on top of each other: the bright row is cut to --fill (the % positive). */
.review-stars {
  position: relative;
  display: inline-block;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  line-height: 1;
}
.review-stars-empty { color: var(--review-star-empty); }
.review-stars-full {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  overflow: hidden;
  white-space: nowrap;
  color: var(--review-star);
}
.review-count { color: var(--text-soft); }
.review,
.game-achievements,
.game-deck {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.fact-icon { display: inline-flex; }
.fact-icon svg { display: block; filter: drop-shadow(0 0 3px #000); }
.game-achievements .fact-icon { color: var(--text-soft); }
.game-deck .fact-icon { color: var(--deck-verified); }

/* Strong shadow on every piece of text so it stays readable over any cover. */
.game-tag,
.game-title,
.steam-price,
.steam-low,
.steam-genre,
.humble-genre,
.game-review {
  text-shadow:
    0 0 5px #000,
    0 0 5px #000,
    0 0 5px #000,
    0 1px 6px rgba(0, 0, 0, 1),
    0 2px 10px rgba(0, 0, 0, 1),
    0 3px 20px rgba(0, 0, 0, 0.95),
    0 0 32px rgba(0, 0, 0, 0.85);
}


/* 5. Extra deal groups (70%, 50%, historical) --------------------------- */

.deal-groups {
  width: min(100%, var(--content-width));
  display: grid;
  gap: 3rem;
}
.deal-groups:empty { display: none; }
.deal-groups .section-title { margin: 0 0 0.35rem; }
/* 4, 2 or 1 tiles per row. (66.1rem = 4 tiles of 16rem + 3 gaps; 32.7rem = 2 tiles + 1 gap.) */
.deal-groups { container-type: inline-size; }
.deal-groups .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 66.09rem) { .deal-groups .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 32.69rem) { .deal-groups .game-grid { grid-template-columns: minmax(0, 1fr); } }


/* 6. Stores ------------------------------------------------------------- */

.stores { width: min(100%, var(--content-width)); }
.stores .section-title { margin: 0 0 1rem; }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.75rem;
}
.store {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--tile-bg);
  color: var(--text);
  text-decoration: none;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}
.store:hover,
.store:focus-visible {
  border-color: var(--line-hover);
  background: var(--tile-bg-hover);
}
.store-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.store-logo {                    /* small logo before the store's name */
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  border-radius: 0.25rem;
  flex: none;
}
.store-watermark {               /* big faded logo in the corner, brighter on hover */
  position: absolute;
  right: -0.9rem;
  bottom: -0.9rem;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  z-index: -1;
  opacity: 0.1;
  filter: grayscale(1);
  transition: opacity 0.4s, filter 0.4s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.store:hover .store-watermark,
.store:focus-visible .store-watermark {
  opacity: 0.35;
  filter: grayscale(0);
  transform: scale(1.06);
}
.store-name {
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 400;
  transition: color 0.3s;
}
.store:hover .store-name,
.store:focus-visible .store-name { color: var(--text); }

.store-count {
  font-size: 1.75rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.store-count small {            /* the word "deals" after the number */
  margin-left: 0.45rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.stores .section-note a {
  color: var(--text-soft);
  text-decoration: underline;
  text-decoration-color: var(--note-underline);
  text-underline-offset: 3px;
}
.stores .section-note a:hover { color: var(--text); }


/* 7. Footer bar ---------------------------------------------------------
   Two groups of links with "made by sylent with ♥" exactly in the middle. */

.site-footer {
  width: 100%;
  margin-top: 2rem;
  padding: 1rem 0 0.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1.5rem;
  white-space: nowrap;
}
.footer-links { display: flex; align-items: center; gap: 0.95rem; }

/* Second footer line: when the data was last updated, and the site's version on GitHub. */
.footer-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.6rem;
  color: var(--footer-link);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}
.footer-meta:empty { display: none; }
.footer-meta a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-meta a:hover,
.footer-meta a:focus-visible { color: var(--text); }
/* "updated 14 hours ago" in red: the automatic update has probably stopped working. */
.footer-updated--stale { color: var(--ends-soon); }
.footer-links--left  { justify-content: flex-end; }
.footer-links--right { justify-content: flex-start; }

.footer-links a {
  flex-shrink: 0;
  position: relative;
  padding-bottom: 0.35rem;
  color: var(--footer-link);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.3s;
  outline: none;
}
.footer-links a::after {         /* underline that draws in on hover */
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.footer-links a:hover,
.footer-links a:focus-visible { color: var(--text); }
.footer-links a:hover::after,
.footer-links a:focus-visible::after { transform: scaleX(1); }

.footer-separator {
  padding-bottom: 0.35rem;
  color: var(--footer-separator);
  font-size: 0.8125rem;
  user-select: none;
}
.footer-credit {
  padding-bottom: 0.35rem;
  color: var(--footer-credit);
  font-size: 0.8125rem;
}


/* 8. Currency switch (top right) --------------------------------------- */

.currency-switch {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: 1.25rem;
  z-index: 5;
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #000;
}
.currency-switch button {
  appearance: none;
  width: 2.1rem;
  height: 1.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.currency-switch button:hover { color: var(--text); }
.currency-switch button[aria-pressed="true"] { background: var(--switch-active); color: var(--text); }
.currency-switch button:focus-visible { outline: 1px solid var(--text-soft); }

/* Filter menu for the Steam sections (top right, left of the currency switch). */
.steam-filters {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: calc(1.25rem + 4.75rem);   /* the currency switch's width plus a small gap */
  z-index: 5;
}
.steam-filters summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: calc(1.7rem + 6px);       /* same height as the currency switch */
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #000;
  color: var(--text-muted);
  font-size: 0.875rem;
  list-style: none;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.steam-filters summary::-webkit-details-marker { display: none; }
.steam-filters summary:hover,
.steam-filters[open] summary,
.steam-filters--active summary { color: var(--text); }
.steam-filters--active summary { border-color: var(--line-hover); }
.steam-filters summary:focus-visible { outline: 1px solid var(--text-soft); }
.filters-count {                    /* how many filters are on */
  min-width: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--text);
  color: #000;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}
.filters-count[hidden] { display: none; }

.filters-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never wider than the panel, whatever is inside */
  gap: 0.6rem;
  width: 16.5rem;
  max-height: calc(100vh - 5rem);
  overflow-x: hidden;                      /* scroll up and down only, when the screen is short */
  overflow-y: auto;
  padding: 0.75rem;                        /* the same on every side, so the contents sit centered */
  border: 1px solid var(--line-hover);
  border-radius: 0.6rem;
  background: #050505;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  font-size: 0.75rem;
}
.filters-head {                     /* "Steam deals" on the left, "Reset" on the right */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.filters-actions { display: inline-flex; gap: 0.75rem; }   /* "Copy link" and "Reset" */
.filters-heading { margin: 0; color: var(--text-muted); font-size: 0.6875rem; }
.filters-checks { display: grid; gap: 0.4rem; }
.filters-selects {                  /* the dropdowns, two per row, under a thin line */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.filters-search {                   /* title search, at the top of the menu */
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #000;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
}
.filters-search::placeholder { color: var(--text-muted); }
.filters-search:focus { outline: none; border-color: var(--line-hover); }

/* "Search on [site] Search ↗", right under the search box. */
.filters-sites {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  margin-top: -0.2rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
}
.filters-sites select {
  width: 100%;
  min-width: 0;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #000;
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
}
.filters-sites-go {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-hover);
  border-radius: 0.35rem;
  color: var(--text);
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.3s, color 0.3s;
}
.filters-sites-go:hover { border-color: var(--text-soft); }
.filters-sites-go:focus-visible { outline: 1px solid var(--text-soft); }
.filters-sites-go[aria-disabled] {
  border-color: var(--line);
  color: var(--text-muted);
  cursor: default;
}
.filters-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-soft);
  cursor: pointer;
}
.filters-check input { width: 0.8rem; height: 0.8rem; margin: 0; accent-color: var(--text); }
.filters-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* the dropdown shrinks to its column, long options are cut */
  gap: 0.2rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
}
.filters-select > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters-select select {
  width: 100%;
  min-width: 0;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #000;
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
}
.filters-reset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.6875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.filters-reset:hover { color: var(--text); }

/* Shown in a section when the filters leave it empty. */
.grid-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}


/* 9. Small screens and reduced motion ----------------------------------- */

/* Phones: the filter panel spans the screen instead of hanging off the button. */
@media (max-width: 520px) {
  .filters-panel {
    position: fixed;
    top: calc(3.5rem + env(safe-area-inset-top, 0px));
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

@media (max-width: 760px) {
  .countdowns { grid-template-columns: 1fr; gap: 3rem; }
  .column:first-child > .countdown,
  .column:first-child > .timezone-row { margin-right: 0; }
  .countdown-units { font-size: clamp(2.25rem, 12vw, 4.25rem); }

  .site-footer { column-gap: 0.9rem; }
  .footer-links { gap: 0.8rem; }
  .footer-links a { font-size: 0.6875rem; }
  .footer-separator { display: none; }
  .footer-credit { font-size: 0.6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}


/* 10. Game page (game.html) ------------------------------------------------ */

/* "← All deals", top left, level with the currency switch. */
.back-link {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: 1.25rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  height: calc(1.7rem + 6px);
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #000;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s;
}
.back-link:hover,
.back-link:focus-visible { color: var(--text); border-color: var(--line-hover); outline: none; }

.game-page {
  width: min(100%, 60rem);
  justify-content: flex-start;
  gap: 1rem;
  padding-top: clamp(1rem, 6vh, 3rem);
}
.game-page-loading { color: var(--text-muted); font-size: 0.875rem; }

/* Cover on the left, everything else on the right (stacked on narrow screens). */
.game-page-hero {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 2rem;
}
.game-page-cover {
  position: relative;
  aspect-ratio: 460 / 215;          /* Steam's header picture */
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 0.6rem;
  background: var(--tile-bg);
}
.game-page-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-page-info { min-width: 0; }
.game-page-info--alone { width: min(100%, 34rem); text-align: center; }
.game-page-info--alone .game-page-actions { justify-content: center; }
.game-page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.game-page-genre {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* "-90%   €5.99 / LOWEST EVER   ends in 2d until Mon, 7 Dec, 19:00" */
.game-page-deal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--tile-bg);
}
.game-page-discount {
  color: #fff;
  font-size: 2.25rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.game-page-discount--humble { font-size: 1.25rem; font-weight: 500; letter-spacing: 0; }
.game-page-deal .steam-price-box { align-items: flex-start; }
.game-page-deal .steam-price { font-size: 1.375rem; }
.steam-price-note {                 /* "full price on Steam" under a Humble game's price */
  color: var(--text-soft);
  font-size: 0.6875rem;
  font-weight: 500;
}
.game-page-ends {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.game-page-ends-date { color: var(--text-muted); font-size: 0.75rem; }

.game-page-facts { margin-top: 0.9rem; font-size: 0.8125rem; }
.game-page-sections {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Steam (main button), price history, SteamDB, ProtonDB, copy link. */
.game-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.game-page-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-hover);
  border-radius: 999px;
  background: #000;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.game-page-button:hover,
.game-page-button:focus-visible { color: var(--text); border-color: var(--text-soft); outline: none; }
.game-page-button--primary {
  border-color: var(--text);
  background: var(--text);
  color: #000;
  font-weight: 600;
}
.game-page-button--primary:hover,
.game-page-button--primary:focus-visible { background: #fff; color: #000; }

/* "Search other stores": one pill per store. */
.game-page-stores { width: 100%; }
.game-page-store-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.game-page-store {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--tile-bg);
  color: var(--text-soft);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s;
}
.game-page-store:hover,
.game-page-store:focus-visible { color: var(--text); border-color: var(--line-hover); outline: none; }

@media (max-width: 760px) {
  .game-page-hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .game-page-ends { margin-left: 0; }
}
