/* ============================================================
   LEEWAY GAMEZONE — hub + player. Loaded only on /gamezone/**.
   Always dark (an entertainment surface); fonts are the site's.
   ============================================================ */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/manrope-latin.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../fonts/playfair-latin.woff2) format('woff2'); }

:root {
  --bg: #08070B; --panel: #131118; --panel-2: #1C1924; --line: #2A2632;
  --ink: #F5F4F2; --muted: #B7B4AF; --faint: #8F8B86;
  --accent: #2EE6A6; --pink: #FF4D8D; --gold: #FDE962; --purple: #A184DD;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pad: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.gz { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif; line-height: 1.5; overflow-x: hidden; }
/* :where() keeps this at zero specificity so button classes on links win. */
:where(.gz) a { color: inherit; }
.gz :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.gz-skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 10; }
.gz-skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.gz-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 14px var(--pad); background: linear-gradient(#08070Bf2, #08070Bd9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.gz-logo { font-weight: 800; letter-spacing: .14em; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.gz-logo span { color: var(--accent); }
.gz-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.gz-nav a { display: block; padding: 8px 12px; font-size: .88rem; color: var(--muted); text-decoration: none; border-radius: 999px; transition: color .2s, background .2s; }
.gz-nav a:hover { color: var(--ink); background: var(--panel-2); }
.gz-switch, .gz-back { margin-left: auto; font-size: .85rem; font-weight: 600; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; white-space: nowrap; transition: border-color .2s, background .2s; }
.gz-switch:hover, .gz-back:hover { border-color: var(--ink); }
.gz-switch { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; transition: border-color .2s, background .2s; }
.gz-switch:hover, .gz-switch:focus-visible { background: var(--panel-2); }

/* ---------- Buttons ---------- */
.gz-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font: 600 .95rem/1 'Manrope', system-ui, sans-serif; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s; }
.gz-btn:hover { border-color: var(--ink); }
.gz-btn:active { transform: scale(.97); }
.gz-btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.gz-btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.gz-btn--ghost { background: transparent; }

/* ---------- Hero ---------- */
.gz-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(28px, 5vw, 64px) var(--pad); background: radial-gradient(60% 80% at 80% 30%, rgba(46, 230, 166, .10), transparent 70%); }
.gz-eyebrow { margin: 0 0 8px; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.gz-hero-title { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -.02em; }
.gz-hero-desc { color: var(--muted); max-width: 44ch; margin: 16px 0 24px; font-size: clamp(1rem, 1.4vw, 1.1rem); }
.gz-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.gz-hero-art { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; box-shadow: 0 30px 80px -40px rgba(46, 230, 166, .5); }
.gz-hero-art svg { display: block; width: 100%; height: 100%; }

/* ---------- Rails ---------- */
/* Until hub.js fills the rails, hold a screen of space so the browse
   section never paints in view and then jumps away (CLS). */
#gzRails:empty { min-height: 100vh; }
.gz-row, .gz-browse { padding: clamp(20px, 3vw, 32px) 0 0; }
.gz-row-title { margin: 0 var(--pad) 12px; font-size: clamp(1.1rem, 1.8vw, 1.35rem); font-weight: 700; }
.gz-empty-row { margin: 0 var(--pad); color: var(--faint); font-size: .92rem; }
.gz-rail-wrap { position: relative; }
.gz-rail { list-style: none; margin: 0; padding: 6px var(--pad) 18px; display: grid; grid-auto-flow: column; grid-auto-columns: clamp(200px, 22vw, 280px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad); scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior-x: contain; }
.gz-rail > li { scroll-snap-align: start; }
.gz-rail-btn { position: absolute; top: 6px; bottom: 18px; width: calc(var(--pad) - 4px); min-width: 36px; z-index: 2; border: 0; background: rgba(8, 7, 11, .75); color: var(--ink); font-size: 2rem; cursor: pointer; transition: opacity .2s; }
.gz-prev { left: 0; } .gz-next { right: 0; }
.gz-rail-btn:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .gz-rail-btn { display: none; } }

/* ---------- Cards ---------- */
.gz-card { min-width: 0; }
.gz-card-link { display: flex; flex-direction: column; height: 100%; background: var(--panel); border-radius: 12px; overflow: hidden; text-decoration: none; border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .25s, box-shadow .35s var(--ease); }
.gz-card-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.gz-card-art svg { display: block; width: 100%; height: 100%; transition: transform .6s var(--ease); }
.gz-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.gz-card-cat { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.gz-card-title { font-weight: 700; font-size: 1.02rem; }
.gz-card-desc { font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gz-card-play { margin-top: auto; padding-top: 8px; font-size: .8rem; font-weight: 700; color: var(--accent); }
.gz-card-play::before { content: '\25B6\00a0'; }
.gz-card-link:hover, .gz-card-link:focus-visible { transform: translateY(-4px); border-color: #4A4456; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .9); }
.gz-card-link:hover svg, .gz-card-link:focus-visible svg { transform: scale(1.06); }

/* ---------- Browse ---------- */
.gz-browse { padding-bottom: 48px; scroll-margin-top: 72px; }
.gz-row { scroll-margin-top: 72px; }
.gz-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 var(--pad) 14px; }
.gz-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; max-width: 420px; }
.gz-field--sm { flex: 0 1 220px; }
.gz-label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.gz-field input, .gz-field select { min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }
.gz-field input::placeholder { color: var(--faint); }
.gz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 var(--pad) 12px; }
.gz-chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 .85rem 'Manrope', system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.gz-chip:hover { color: var(--ink); border-color: var(--ink); }
.gz-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gz-chip[aria-pressed="true"]::before { content: '\2713\00a0'; }
.gz-count { margin: 0 var(--pad) 12px; color: var(--faint); font-size: .85rem; }
.gz-grid { list-style: none; margin: 0; padding: 0 var(--pad); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.gz-empty { margin: 8px var(--pad); padding: 28px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.gz-noscript { margin: 16px var(--pad); color: var(--gold); }

.gz-foot { border-top: 1px solid var(--line); padding: 24px var(--pad) 32px; color: var(--faint); font-size: .85rem; }
.gz-foot p { margin: 4px 0; }

/* ---------- Player ---------- */
.gz-play #gzMain { padding: clamp(16px, 3vw, 32px) var(--pad) 40px; max-width: 1100px; margin: 0 auto; }
.gz-play-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
#gzCat { min-height: 1.5em; line-height: 1.5; }   /* filled by script; reserved to avoid a shift */
.gz-play-title { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.05; }
.gz-score { display: flex; gap: 18px; font-size: .9rem; color: var(--muted); }
.gz-score b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Space is reserved even for games without a score, so it never pops in (CLS). */
.gz-score.is-off { visibility: hidden; }
.gz-shell { position: relative; background: #000; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.gz-shell:fullscreen { display: flex; align-items: center; justify-content: center; border-radius: 0; }
/* Height reserved before the game file arrives, so it does not push the page (CLS). */
.gz-stage { display: flex; align-items: center; justify-content: center; min-height: min(72vh, 560px); padding: clamp(8px, 2vw, 16px); outline-offset: -3px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.gz-shell:fullscreen .gz-stage { width: 100%; height: 100%; }
.gz-cv { display: block; width: auto; height: auto; max-width: 100%; max-height: min(72vh, 720px); background: #0B0A10; border-radius: 8px; touch-action: none; }
.gz-shell:fullscreen .gz-cv { max-height: 96vh; }
.gz-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; text-align: center; background: rgba(8, 7, 11, .72); pointer-events: none; }
.gz-msg strong { font-size: clamp(1.3rem, 3vw, 2rem); font-family: 'Playfair Display', Georgia, serif; }
.gz-msg span { color: var(--muted); max-width: 40ch; }
.gz-loading { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--muted); }
.gz-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.gz-padbtn { min-width: 64px; min-height: 56px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font: 700 1.2rem 'Manrope', system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
.gz-padbtn:active { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .gz-pad { display: none; } }
.gz-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gz-fav[aria-pressed="true"] { color: var(--pink); border-color: var(--pink); }
.gz-info { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.gz-info h2 { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }
.gz-info p { margin: 0 0 20px; color: var(--muted); max-width: 60ch; }
.gz-keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.gz-keys dt { font-weight: 700; color: var(--ink); }
.gz-keys dd { margin: 0; color: var(--muted); }
.gz-missing { padding: 64px 0; text-align: center; }
.gz-missing h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; }
.gz-missing p { color: var(--muted); margin: 0 0 24px; }

/* ---------- DOM-based games (boards, grids) ---------- */
.gzg { width: min(100%, 560px); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--ink); }
.gzg-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; }
.gzg-status { min-height: 1.5em; font-weight: 600; text-align: center; color: var(--muted); }
.gzg-grid { display: grid; gap: 4px; width: 100%; }
.gzg-cell { aspect-ratio: 1; border: 0; border-radius: 6px; background: var(--panel-2); color: var(--ink); font: 700 clamp(.9rem, 3.4vw, 1.4rem) 'Manrope', system-ui, sans-serif; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
.gzg-cell:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 1; }
.gzg-cell:active { transform: scale(.96); }
.gzg-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.gzg-seg button { min-height: 40px; padding: 6px 14px; border: 0; background: transparent; color: var(--muted); font: 600 .85rem 'Manrope', system-ui, sans-serif; cursor: pointer; }
.gzg-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Static SEO pages: breadcrumbs, intro, facts, categories ---------- */
.gz-crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .82rem; color: var(--faint); }
.gz-crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--line); }
.gz-crumbs a { color: var(--muted); text-decoration: none; }
.gz-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.gz:not(.gz-play) .gz-crumbs { padding: 16px var(--pad) 0; }
.gz-eyebrow a { color: inherit; text-decoration: none; }
.gz-eyebrow a:hover { text-decoration: underline; }
.gz-intro { margin: 0 0 16px; color: var(--muted); max-width: 70ch; }
.gz-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 20px; font-size: .92rem; }
.gz-facts dt { font-weight: 700; color: var(--ink); }
.gz-facts dd { margin: 0; color: var(--muted); }
.gz-related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.gz-related .gz-row-title, .gz-related .gz-grid, .gz-related .gz-more { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.gz-more { margin: 16px var(--pad) 32px; color: var(--muted); font-size: .92rem; }
.gz-more a { color: var(--ink); }
.gz-catlinks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gz-catlinks .gz-chip { display: inline-flex; align-items: center; text-decoration: none; }
.gz-catlinks .gz-chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gz-catnav { margin: 0 var(--pad) 20px; }
.gz-cat-head { padding: clamp(20px, 4vw, 48px) var(--pad) 16px; }
.gz-cat-head .gz-hero-desc { max-width: 62ch; }
.gz-hub-h1 { margin: 0 0 18px; font-size: .9rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
#gzGrid + .gz-empty { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .gz-top { flex-wrap: wrap; row-gap: 6px; }
  .gz-nav { order: 3; width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); overflow-x: auto; scrollbar-width: none; }
  .gz-nav ul { padding: 0 calc(var(--pad) - 12px); }
  .gz-nav a { white-space: nowrap; min-height: 40px; display: flex; align-items: center; }
}
@media (max-width: 760px) {
  .gz-hero { grid-template-columns: 1fr; }
  .gz-hero-art { order: -1; }
  .gz-info { grid-template-columns: 1fr; gap: 0; }
  .gz-score { flex-basis: 100%; }   /* own line, whatever the title length */
  .gz-rail { grid-auto-columns: 72%; }
}
@media (max-width: 400px) {
  .gz-top { gap: 12px; }
  .gz-logo { font-size: .78rem; letter-spacing: .1em; }
  .gz-switch, .gz-back { padding: 8px 10px; font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gz *, .gz *::before, .gz *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
