/* play.datumkey.com. A night "arcade cabinet" in Datum Navy: the game art carries the color, and Key Orange
   is reserved for Play (spec §4.0, §5; look approved at C2 with Bricolage Grotesque titles). Built by tools/build_play.py. */
:root {
  color-scheme: dark;
  --night: #0B1422;
  --navy: #0F1B2D;
  --line: #2A3C57;
  --ink: #F4F5F2;
  --ink-2: #A9B3C1;
  --key: #E0702A;
  --key-hi: #F2873F;
  --on-key: #1A0E04;
  --leaf: #4FC08D;
  --amber: #F2C14E;
  --accent: #2A3C57;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; background: var(--night); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--key); outline-offset: 3px; border-radius: 6px; }

body.home {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(224,112,42,.10), transparent 60%),
    radial-gradient(700px 500px at 0% 30%, rgba(80,110,170,.12), transparent 60%),
    var(--night);
  min-height: 100vh;
}
.hdr, main, .ftr { max-width: 1180px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand img { width: 22px; height: 34px; }
.brand b { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; font-size: 21px; }
.brand b i { font-style: normal; color: var(--key-hi); }
.brand sup { font-size: 10px; color: var(--ink-2); }
.promise { font: 500 11.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-align: right; }
main { display: grid; gap: 22px; padding-block: 4px 32px; }

/* Featured game */
.feature { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); background: var(--navy); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; text-decoration: none; }
.shot { position: relative; overflow: hidden; background: #000; aspect-ratio: 16 / 10; border-bottom: 2px solid var(--accent); }
.feature .shot { border-bottom: 0; border-right: 2px solid var(--accent); }
.shot img, .shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 6s ease; }
.shot video { opacity: 0; transition: opacity .4s ease; }
.shot video.on { opacity: 1; }
.feature:hover .shot img, .card:hover .shot img { transform: scale(1.06); }
.ftext { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 28px 28px 30px; min-width: 0; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px; border-radius: 6px; border: 1px solid currentColor; }
.tag.now { color: var(--leaf); }
.tag.early { color: var(--amber); }
.tag.other { color: var(--ink-2); }
.tag.feat { color: var(--ink); }
.tag.new { color: var(--key-hi); }
.title { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: .98; text-wrap: balance; }
.feature .title { font-size: clamp(40px, 5vw, 64px); }
.tagline { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 40ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); padding: 0; margin: 0; list-style: none; }
.meta li { display: flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.play { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; background: var(--key); color: var(--on-key); font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; font-size: 20px; padding: 14px 26px 14px 22px; border-radius: 999px; min-height: 52px; text-decoration: none; box-shadow: 0 10px 24px -8px rgba(224,112,42,.6); transition: transform .15s ease, box-shadow .2s ease, background .2s; }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.feature:hover .play, .card:hover .play, .play:hover { background: var(--key-hi); box-shadow: 0 0 0 6px rgba(224,112,42,.18), 0 14px 30px -8px rgba(224,112,42,.75); transform: translateY(-1px); }
.feature:active .play, .card:active .play { transform: scale(.97); }
.feature:focus-visible, .card:focus-visible { outline-offset: 4px; border-radius: var(--radius); }

/* Shelf */
.shelf-wrap { display: grid; gap: 14px; }
.shelf-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf-h h2 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; font-size: 24px; }
.shelf-h span { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 14px/1 var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; min-height: 44px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--night); border-color: var(--ink); }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--navy); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: transform .18s ease, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); border-color: rgba(224,112,42,.6); box-shadow: 0 18px 40px -18px rgba(224,112,42,.45); }
.card .body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; min-width: 0; }
.card .title { font-size: 28px; }
.card .tagline { font-size: 15px; }
.card .row { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; }
.card .play { font-size: 17px; padding: 11px 20px 11px 17px; min-height: 46px; }
.card .play svg { width: 15px; height: 15px; }
.locked { display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 28px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); }
.locked svg { width: 40px; height: 40px; fill: none; stroke: var(--key); stroke-width: 2.2; stroke-linecap: round; }
.locked svg .fill { fill: var(--key); stroke: none; }
.locked b { display: block; font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-size: 20px; }
.locked p { margin: 0; font-size: 14px; max-width: 26ch; }
.nf { padding-block: 64px; justify-items: start; }
.nf .title { font-size: 44px; }

.ftr { border-top: 1px solid var(--line); padding-block: 20px 28px; display: grid; gap: 10px; font-size: 13px; color: var(--ink-2); }
.ftr nav { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
.ftr nav a { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.ftr nav a:hover { text-decoration: underline; }
.ftr small { font-size: 12px; }

@media (max-width: 1000px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Phone (spec §4.1): featured stacks with a full-width Play; shelf cards become rows. */
@media (max-width: 620px) {
  .hdr, main, .ftr { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .hdr { padding-block: 8px; }
  .promise { display: none; }
  main { gap: 18px; padding-block: 0 20px; }
  .feature { grid-template-columns: 1fr; }
  .feature .shot { aspect-ratio: 16 / 9; border-right: 0; border-bottom: 2px solid var(--accent); }
  .ftext { padding: 14px 16px 16px; gap: 10px; }
  .feature .title { font-size: 38px; }
  .tagline { font-size: 15px; }
  .feature .play { align-self: stretch; justify-content: center; }
  .shelf-h span { display: none; }
  .shelf { grid-template-columns: 1fr; gap: 14px; }
  .card.is-featured { display: none; }
  .card { grid-template-columns: 40% minmax(0, 1fr); grid-template-rows: none; }
  .card .shot { aspect-ratio: auto; height: 100%; min-height: 136px; border-bottom: 0; border-right: 2px solid var(--accent); }
  .card .body { padding: 12px 14px 14px; gap: 6px; }
  .card .title { font-size: 21px; }
  .card .tagline { font-size: 13.5px; }
  .card .meta { display: none; }
  .card .play { font-size: 15px; padding: 9px 16px 9px 13px; min-height: 44px; }
  .locked { padding: 16px; grid-auto-flow: column; justify-content: start; text-align: left; justify-items: start; align-items: center; }
  .locked svg { width: 30px; height: 30px; }
}

/* Game page: slim bar + full-size game (spec §4.2) */
body.gp { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; }
.gbar { flex: none; display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); background: var(--night); border-bottom: 1px solid var(--line); font-size: 13.5px; position: relative; z-index: 2; }
.gbar .back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; min-height: 44px; min-width: 44px; padding: 0 8px 0 2px; }
.gbar .back svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gname { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; font-size: 16px; }
.ver, .news summary { font: 500 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.news { position: relative; }
.news summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: 44px; }
.news summary::-webkit-details-marker { display: none; }
.news summary:hover { color: var(--ink); }
.news ol { position: absolute; top: 44px; left: 0; width: min(360px, 80vw); margin: 0; padding: 12px 16px; list-style: none; background: var(--navy); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; box-shadow: 0 20px 40px -10px rgba(0,0,0,.6); }
.news li { font-size: 13px; color: var(--ink-2); }
.news li b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.news time { font-family: var(--mono); font-size: 11.5px; margin-right: 4px; }
.gbar .next { margin-left: auto; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.gbar .next:hover, .gbar .back:hover { color: var(--key-hi); }
#game-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; display: block; background: #000; }
.nojs { position: fixed; inset: auto 0 0 0; margin: 0; padding: 16px; color: var(--ink); text-align: center; }
/* On a phone the bar is just one small back button (verifier V3.3). */
@media (max-width: 620px), (max-height: 500px) {
  .gbar { height: 44px; gap: 8px; border-bottom: 0; }
  .gbar .back span, .gname, .news, .ver, .gbar .next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .feature:hover .shot img, .card:hover .shot img, .card:hover, .feature:hover .play, .card:hover .play { transform: none; }
  .shot video { display: none; }
}

/* Per-game accent colors (from the games list) */
.g-alkemora { --accent: #9B6BFF; }
.g-camper-keys { --accent: #F2C14E; }
