/* Shared chrome for the secondary pages (games, legal). The home page keeps its
   own inlined stylesheet: it is one document and inlining saves it a request. */

:root {
  --bg: #07080f;
  --ink: #e6e8f2;
  --muted: #9aa0b8;
  --dim: #8f95ad;
  --faint: #6e7390;
  --lav: #9aa3ff;
  --lav-2: #8b95ff;
  --lav-soft: #c7d2fe;
  --cyan: #6ee0ff;
  --gold: #d6a65e;
  --line: rgba(230, 232, 242, 0.09);
  --line-strong: rgba(230, 232, 242, 0.14);
  --panel: rgba(255, 255, 255, 0.025);
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: #a5b4fc; text-decoration: none; }
a:hover { color: var(--lav-soft); }
img { max-width: 100%; }
::selection { background: rgba(139, 149, 255, 0.3); }
:focus-visible { outline: 2px solid rgba(139, 149, 255, 0.8); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* header + footer ------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  padding: 18px clamp(20px, 4vw, 48px);
  background: rgba(7, 8, 15, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 232, 242, 0.07);
}
.brand { font-family: var(--mono); font-size: 14px; letter-spacing: 0.08em; color: var(--lav-soft); font-weight: 500; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px); font-size: 14px; flex-wrap: wrap; }
.nav-link { color: var(--dim); transition: color 0.25s ease; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-cta { color: var(--ink); border: 1px solid rgba(230, 232, 242, 0.2); border-radius: 999px; padding: 8px 18px; transition: color 0.25s ease, border-color 0.25s ease; }
.nav-cta:hover { border-color: rgba(139, 149, 255, 0.6); color: var(--lav-soft); }

.site-footer {
  border-top: 1px solid rgba(230, 232, 242, 0.07);
  padding: 28px clamp(20px, 4vw, 48px);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}
.site-footer a { color: var(--faint); }
.site-footer a:hover { color: var(--muted); }

/* layout ---------------------------------------------------------------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px) clamp(64px, 9vw, 110px); }
.wrap-narrow { max-width: 760px; }

.crumbs { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--faint); display: flex; gap: 9px; flex-wrap: wrap; }
.crumbs a { color: var(--lav); }
.crumbs a:hover { color: var(--lav-soft); }

.kicker { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.16em; color: var(--lav); margin: 26px 0 0; }
h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; margin: 16px 0 0; max-width: 20ch; }
.grad { background: linear-gradient(92deg, var(--lav-2) 0%, var(--cyan) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 2vw, 18.5px); line-height: 1.65; color: var(--muted); max-width: 62ch; margin: 22px 0 0; }

h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 56px 0 0; }
h3 { font-size: 17px; font-weight: 700; margin: 28px 0 0; }
p, li { font-size: 15.5px; line-height: 1.72; color: #b4b9cf; }
p { margin: 14px 0 0; }
ul, ol { margin: 14px 0 0; padding-left: 20px; }
li { margin-top: 8px; }
strong { color: var(--ink); font-weight: 500; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--lav-soft); }

.card { border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 3vw, 30px); background: var(--panel); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip { font-family: var(--mono); font-size: 12.5px; color: #c0c5de; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 14px; background: rgba(255, 255, 255, 0.03); }

.btn-primary { display: inline-block; padding: 14px 30px; border-radius: 12px; background: linear-gradient(92deg, #6366f1, #4f46e5); color: #fff; font-weight: 500; font-size: 15px; box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35); transition: box-shadow 0.3s ease; }
.btn-primary:hover { box-shadow: 0 10px 40px rgba(99, 102, 241, 0.55); color: #fff; }
.btn-ghost { display: inline-block; padding: 14px 30px; border-radius: 12px; border: 1px solid rgba(230, 232, 242, 0.18); color: var(--ink); font-weight: 500; font-size: 15px; background: rgba(255, 255, 255, 0.03); transition: border-color 0.3s ease, color 0.3s ease; }
.btn-ghost:hover { border-color: rgba(139, 149, 255, 0.5); color: var(--lav-soft); }

/* game grid ------------------------------------------------------------- */

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; margin-top: 34px; }
.game-card { display: block; border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 3vw, 32px); background: var(--panel); color: inherit; transition: border-color 0.3s ease, transform 0.3s ease; }
.game-card:hover { border-color: rgba(139, 149, 255, 0.4); color: inherit; transform: translateY(-3px); }
.game-card h2 { font-size: 21px; margin: 16px 0 0; }
.game-card p { font-size: 14.5px; color: var(--muted); margin: 10px 0 0; }
.game-card .go { display: inline-block; margin-top: 18px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.1em; color: var(--lav); }
.game-ico { width: 46px; height: 46px; border-radius: 12px; background: rgba(139, 149, 255, 0.12); border: 1px solid rgba(139, 149, 255, 0.3); display: grid; place-items: center; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; }
.card-soon { border: 1px dashed var(--line-strong); border-radius: 20px; padding: clamp(24px, 3vw, 32px); display: grid; place-items: center; min-height: 150px; font-family: var(--mono); font-size: 13px; color: var(--faint); text-align: center; }

/* embedded game --------------------------------------------------------- */

.game-stage { margin-top: 34px; border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden; background: var(--bg); }
.game-stage iframe { display: block; width: 100%; height: clamp(560px, 80vh, 860px); border: 0; }
.game-note { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 12px; }

/* faq ------------------------------------------------------------------- */

.faq { margin-top: 20px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 0; font-size: 16px; font-weight: 500; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--lav); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; }

/* fullscreen -----------------------------------------------------------
   Driven from the container, not from inside the game: any future game gets
   the button for free without knowing about it. */

.game-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 34px; }
.game-bar + .game-stage { margin-top: 12px; }

.btn-fs {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  color: var(--dim); background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 18px; cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.35s ease;
}
.btn-fs:hover { color: var(--lav-soft); border-color: rgba(139, 149, 255, 0.55); background: rgba(139, 149, 255, 0.07); box-shadow: 0 8px 30px rgba(99, 102, 241, 0.22); }
.btn-fs:active { transform: translateY(1px); }
.btn-fs[hidden] { display: none; }

.btn-fs svg { width: 13px; height: 13px; flex: none; overflow: visible; }
.btn-fs svg path { fill: none; stroke: var(--lav); stroke-width: 1.7; stroke-linecap: round; transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.5, 1); }
.btn-fs:hover .c-tl { transform: translate(-1.6px, -1.6px); }
.btn-fs:hover .c-tr { transform: translate(1.6px, -1.6px); }
.btn-fs:hover .c-bl { transform: translate(-1.6px, 1.6px); }
.btn-fs:hover .c-br { transform: translate(1.6px, 1.6px); }

/* while fullscreen the button wears the gold of the filled cells: the same
   accent the game uses, so the active state reads as part of the game */
.btn-fs[aria-pressed="true"] { color: #14100a; background: var(--gold); border-color: var(--gold); }
.btn-fs[aria-pressed="true"] svg path { stroke: #14100a; }
.btn-fs[aria-pressed="true"]:hover { color: #14100a; background: #e4b872; border-color: #e4b872; box-shadow: 0 8px 30px rgba(214, 166, 94, 0.28); }
/* arrows point inward on the way out */
.btn-fs[aria-pressed="true"]:hover .c-tl { transform: translate(1.6px, 1.6px); }
.btn-fs[aria-pressed="true"]:hover .c-tr { transform: translate(-1.6px, 1.6px); }
.btn-fs[aria-pressed="true"]:hover .c-bl { transform: translate(1.6px, -1.6px); }
.btn-fs[aria-pressed="true"]:hover .c-br { transform: translate(-1.6px, -1.6px); }

@media (prefers-reduced-motion: reduce) {
  .btn-fs svg path { transition: none; }
  .btn-fs:hover svg path, .btn-fs[aria-pressed="true"]:hover svg path { transform: none; }
}

.game-stage:fullscreen { border: 0; border-radius: 0; }
.game-stage:fullscreen iframe { height: 100vh; }
.game-stage:-webkit-full-screen { border: 0; border-radius: 0; }
.game-stage:-webkit-full-screen iframe { height: 100vh; }
