/* reppo.games portal - liquid-glass redesign (issue #19).
   Tokens live in tokens.css; this file never hardcodes a colour, only references
   --tokens. The portal stays usable with no JS: theme follows the OS via the
   media query below, locale falls back to the in-markup English, and every link
   (including the contact mailto) is plain HTML. */

/* No-JS / no-stored-choice dark theme: when the root has no explicit data-theme,
   follow the OS. An explicit data-theme (set from the persisted cookie) wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0a10;
    --ink: #ffffff;
    --ink-sec: rgba(255, 255, 255, 0.55);
    --ink-faint: rgba(255, 255, 255, 0.42);
    --rule: rgba(255, 255, 255, 0.1);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.22);
    --ok: #30d158;
    --warn: #ff9f0a;
    --red: #ff453a;
    --violet: #bf5af2;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-strong: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.22);
    --bar-bg: rgba(22, 22, 26, 0.6);
    --glass-sh: 0 1px 3px rgba(0, 0, 0, 0.4), 0 12px 36px rgba(0, 0, 0, 0.5);
    --wallpaper: radial-gradient(900px 500px at 100% -10%, #3a1e6b 0%, transparent 55%),
      radial-gradient(900px 500px at -10% 50%, #0f3b6c 0%, transparent 55%),
      radial-gradient(700px 400px at 50% 110%, #6b1e4a 0%, transparent 55%),
      linear-gradient(180deg, #0a0a10 0%, #14121d 100%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image: var(--wallpaper);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- logo coin ---------------------------------------------------------- */
.logo {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--logo-grad);
  box-shadow: var(--logo-sh);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-glyph {
  font-family: var(--font-logo);
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  text-shadow: var(--logo-glyph-sh);
  transform: translate(-0.5px, -0.5px);
}
.logo-glyph .dot {
  font-style: normal; /* the period is upright */
}
.logo--lg {
  width: 28px;
  height: 28px;
}
.logo--lg .logo-glyph {
  font-size: 17px;
}

/* The glass header is now the shared <reppo-header> web component (/header.js,
   issue #22) - its markup, styles and theme/locale logic live there, not here.
   `.rh-title` stays because the footer brand reuses the wordmark style. */
.rh-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

/* ---- main shell --------------------------------------------------------- */
.shell {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
}
.col {
  width: 100%;
  max-width: 460px;
  padding: 22px 16px 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Visually hidden but exposed to assistive tech / crawlers (no vertical
   footprint, so it never affects the .col flex layout). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- age filter (progressive enhancement) ------------------------------ */
/* Hidden in markup; app.js drops [hidden] once wired. The explicit
   .filters[hidden] rule is needed because the bare .filters display rule would
   otherwise out-cascade the UA [hidden] { display:none }. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 0;
}
.filters[hidden] {
  display: none;
}
.chip {
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-sec);
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-sh);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  transition: transform 0.12s ease;
}
.chip:active {
  transform: scale(0.96);
}
.chip[aria-pressed='true'] {
  font-weight: 700;
  color: var(--bg);
  background: var(--ink);
  border-color: transparent;
  box-shadow: none;
}
/* The author .gcard rule sets display, which out-cascades the UA [hidden]
   rule; restate it so app.js can hide filtered-out cards. */
.gcard[hidden] {
  display: none;
}

/* icon tile */
.tile {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--r-tile);
  box-shadow: var(--tile-sh);
  color: #fff;
}
.tile-glyph {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}
.tile--num .tile-glyph {
  font-family: var(--font-mono);
  font-weight: 700;
}
.tile--grid {
  width: 50px;
  height: 50px;
}
.tile--grid .tile-glyph {
  font-size: 23px;
}
.t-minesweeper {
  background: var(--grad-minesweeper);
}
.t-blockfall {
  background: var(--grad-blockfall);
}
.t-solitaire {
  background: var(--grad-solitaire);
}
.t-sudoku {
  background: var(--grad-sudoku);
}
.t-dig {
  background: var(--grad-dig);
}
.t-reversi {
  background: var(--grad-reversi);
}
/* Reversi disc glyph: an Othello disc split half-black / half-white, drawn
   purely in CSS (no glyph/SVG) - the duality of the game. */
.t-reversi .tile-glyph {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: linear-gradient(90deg, #101015 0 50%, #f5f5f7 50% 100%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.t-burtulis {
  background: var(--grad-burtulis);
}
/* Burtulis letter-tile glyph: two small rounded-square Wordle-style feedback
   tiles - green (correct) and yellow (present), the game's own tile colours -
   drawn purely in CSS via pseudo-elements (no glyph/SVG). */
.t-burtulis .tile-glyph {
  position: relative;
  width: 34px;
  height: 15px;
}
.t-burtulis .tile-glyph::before,
.t-burtulis .tile-glyph::after {
  content: '';
  position: absolute;
  top: 0;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.t-burtulis .tile-glyph::before {
  left: 0;
  background: #6aaa64;
}
.t-burtulis .tile-glyph::after {
  right: 0;
  background: #c9b458;
}
.t-zole {
  background: var(--grad-zole);
}
.t-novuss {
  background: var(--grad-novuss);
}
.t-snake {
  background: var(--grad-snake);
}
/* Snake glyph: three rounded body segments turning a corner - echoes the game's
   own rounded-cell snake, drawn purely in CSS (no glyph/SVG) like the Reversi and
   Burtulis tiles, so it never risks a missing-glyph box for an uncovered codepoint.
   One segment plus two box-shadow copies form an L-bend; --seg/--gap size it, and
   the transform re-centres the L (its mass sits up-and-right of the base box).
   Placeholder art (see #50). */
.t-snake .tile-glyph {
  --seg: 8px;
  --gap: 10px;
  width: var(--seg);
  height: var(--seg);
  border-radius: 2.5px;
  background: #fff;
  box-shadow: var(--gap) 0 0 #fff, var(--gap) calc(-1 * var(--gap)) 0 #fff;
  transform: translate(calc(var(--gap) / -2), calc(var(--gap) / 2));
}
.t-riverwing {
  background: var(--grad-riverwing);
}
/* Riverwing jet glyph: an upward dart/arrowhead with a notched tail - the player's
   jet flying up-river - drawn purely in CSS via clip-path (no glyph/SVG) like the
   Reversi, Burtulis and Snake tiles, so no codepoint can render as a missing-glyph
   box. Provisional placeholder art (see #55). */
.t-riverwing .tile-glyph {
  width: 20px;
  height: 23px;
  background: #fff;
  clip-path: polygon(50% 0, 100% 100%, 50% 76%, 0 100%);
}
.t-tanku {
  background: var(--grad-tanku);
}
/* Tank glyph: a side-view hull with a turret and forward gun barrel, drawn
   purely in CSS via pseudo-elements (no glyph/SVG) like the Reversi, Burtulis,
   Snake and Riverwing tiles, so no codepoint can render as a missing-glyph box.
   Provisional placeholder art (see #59). The hull is the base element; ::before
   is the turret and ::after the barrel. */
.t-tanku .tile-glyph {
  position: relative;
  width: 28px;
  height: 10px;
  border-radius: 3px;
  background: #fff;
}
.t-tanku .tile-glyph::before {
  content: '';
  position: absolute;
  left: 5px;
  top: -6px;
  width: 12px;
  height: 7px;
  border-radius: 3px 3px 0 0;
  background: #fff;
}
.t-tanku .tile-glyph::after {
  content: '';
  position: absolute;
  left: 15px;
  top: -4px;
  width: 12px;
  height: 2.5px;
  border-radius: 1.5px;
  background: #fff;
}
.t-rallijs {
  background: var(--grad-rallijs);
}
/* Rallijs chequered-flag glyph: a 3x3 chequerboard tilted off-axis, drawn purely
   in CSS via a repeating-conic-gradient (no glyph/SVG) like the Reversi, Burtulis,
   Snake, Riverwing and Tanku tiles, so no codepoint can render as a missing-glyph
   box. A flag reads as motorsport at 24px where a car silhouette would not.
   --chk is the gradient TILE, which holds a 2x2 cell block - so cells are --chk/2
   and a box of 1.5 * --chk lands exactly 3x3 with no clipped row.
   Provisional placeholder art (see #75). */
.t-rallijs .tile-glyph {
  --chk: 16px;
  width: calc(var(--chk) * 1.5);
  height: calc(var(--chk) * 1.5);
  border-radius: 3px;
  background: repeating-conic-gradient(#fff 0 25%, rgba(0, 0, 0, 0.5) 0 50%) 0 0 / var(--chk)
    var(--chk);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transform: rotate(-8deg);
}

.tagline {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-sec);
}

/* game grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  padding: 15px 14px 16px;
  border-radius: var(--r-card);
  text-decoration: none;
  color: inherit;
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-sh);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.gcard:active {
  transform: scale(0.985);
  filter: brightness(0.98);
}
.gcard-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.gcard .tagline {
  margin-top: -2px;
}

/* Multiplayer badge - a small corner pill on the online-play cards only
   (issue #59). CSS-only, on brand tokens. The visible "MP" is aria-hidden; the
   accessible name is a localized sr-only "Multiplayer" (data-i18n mp_badge). */
.mp-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* ---- content pages (About / Privacy / Terms / Contact) ----------------- */
.sheet {
  border-radius: var(--r-card-lg);
  padding: 22px 20px;
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-sh);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.page-head h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1;
  color: var(--ink);
}
.prose p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-sec);
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose a {
  color: var(--accent);
  text-decoration: none;
}
.prose a:hover {
  text-decoration: underline;
}
.mail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 18px;
  border-radius: var(--r-tile);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--accent);
  box-shadow: var(--glass-sh);
}
.mail-btn:hover {
  filter: brightness(1.04);
}

/* ---- footer (portal only) ---------------------------------------------- */
.ft {
  margin-top: auto;
  width: 100%;
  border-top: 0.5px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.ft-in {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ft-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  align-self: flex-start;
}
.ft-brand .rh-title {
  font-size: 17px;
}
.ft-tag {
  margin: 0;
  max-width: 240px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-sec);
}
.ft-nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 9px;
}
.ft-nav a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-sec);
  text-decoration: none;
}
.ft-nav a:hover {
  color: var(--ink);
}
.ft-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 0.5px solid var(--rule);
}
.ft-copy,
.ft-locale {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---- responsive breakpoints -------------------------------------------- */
/* Three layouts from the one Home mockup, keyed to the mockup's own frame
   widths: phone 390 (base), tablet 744, desktop 1180. Grid goes 2 -> 3 -> 4
   columns; content width, spacing, heading and tile sizes step up with it. The
   mockup's device chrome and outer frame radius are scaffolding, not shipped. */

/* Tablet - mockup 744px frame, 3-column grid. */
@media (min-width: 744px) {
  body[data-page='home'] .col {
    max-width: 744px;
    padding: 30px 30px 40px;
  }
  body[data-page='home'] .ft-in {
    max-width: 744px;
    padding-left: 30px;
    padding-right: 30px;
  }
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .gcard-name {
    font-size: 18px;
  }
  .tile--grid {
    width: 58px;
    height: 58px;
  }
  .tile--grid .tile-glyph {
    font-size: 27px;
  }
  .t-reversi .tile-glyph {
    width: 27px;
    height: 27px;
  }
  .t-burtulis .tile-glyph {
    width: 40px;
    height: 18px;
  }
  .t-burtulis .tile-glyph::before,
  .t-burtulis .tile-glyph::after {
    width: 18px;
    height: 18px;
  }
  .t-snake .tile-glyph {
    --seg: 9px;
    --gap: 11.5px;
  }
  .t-riverwing .tile-glyph {
    width: 23px;
    height: 26px;
  }
  /* 18px tile -> 9px cells -> a 27px box: whole pixels at 1x, so the chequer stays
     crisp. Deliberately not scaled again at 1180px - the pixel-exact value matters
     more here than the 1px it would gain to match Reversi's 28px disc. */
  .t-rallijs .tile-glyph {
    --chk: 18px;
  }
}

/* Desktop - mockup 1180px frame, 4-column grid. */
@media (min-width: 1180px) {
  body[data-page='home'] .col {
    max-width: 1180px;
    padding: 40px 48px 52px;
  }
  body[data-page='home'] .ft-in {
    max-width: 1180px;
    padding-left: 48px;
    padding-right: 48px;
  }
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
  .gcard-name {
    font-size: 19px;
  }
  .tile--grid {
    width: 60px;
    height: 60px;
  }
  .tile--grid .tile-glyph {
    font-size: 28px;
  }
  .t-reversi .tile-glyph {
    width: 28px;
    height: 28px;
  }
  .t-burtulis .tile-glyph {
    width: 42px;
    height: 19px;
  }
  .t-burtulis .tile-glyph::before,
  .t-burtulis .tile-glyph::after {
    width: 19px;
    height: 19px;
  }
  .t-snake .tile-glyph {
    --seg: 9.5px;
    --gap: 12px;
  }
  .t-riverwing .tile-glyph {
    width: 24px;
    height: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gcard,
  .chip {
    transition: none;
  }
}
