/* Playroom: an arcade-carpet night room; every build sits in a cabinet-screen bezel lit by its own colour. */
:root {
  --night: #17122c;        /* page ground, the arcade carpet */
  --carpet-ink: #241d44;   /* carpet pattern strokes */
  --panel: #211a3e;        /* raised surfaces */
  --bezel: #0d0a1c;        /* screen frames */
  --line: #3a3166;         /* quiet borders */
  --ink: #f2edfb;          /* main text */
  --muted: #b2a9d1;        /* secondary text */
  --coin: #ffcf3f;         /* the one action colour: Play */
  --coin-ink: #2a1d00;
  --glow: #8f7bff;         /* default build accent */
  --display: "Bungee", "Arial Black", Impact, system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: 2.2rem; --step-4: clamp(2.2rem, 5.4vw, 3.6rem);
  --r-screen: 14px; --r-ui: 10px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100%;
  color: var(--ink); font-family: var(--body); font-size: var(--step-0); line-height: 1.55;
  background-color: var(--night);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30l10-10 10 10 10-10' stroke='%23221b42'/%3E%3Cpath d='M118 22l14 24h-28z' stroke='%23201a3f'/%3E%3Ccircle cx='70' cy='86' r='9' stroke='%23231c45'/%3E%3Cpath d='M150 98c8-10 18 8 26-2' stroke='%23201a3f'/%3E%3Cpath d='M30 130l6 12 13 2-10 9 3 13-12-7-12 7 3-13-10-9 13-2z' stroke='%23211b41'/%3E%3Cpath d='M112 150h22M123 139v22' stroke='%23221b42'/%3E%3Ccircle cx='160' cy='160' r='3' fill='%232a2255' stroke='none'/%3E%3Ccircle cx='84' cy='20' r='3' fill='%232a2255' stroke='none'/%3E%3Ccircle cx='12' cy='84' r='3' fill='%232a2255' stroke='none'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--night); }
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: color-mix(in srgb, var(--night) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; padding-block: 12px; flex-wrap: wrap; }
.wordmark { font-family: var(--display); font-size: 1.45rem; text-decoration: none; letter-spacing: .02em; color: var(--ink); line-height: 1; }
.wordmark span { color: var(--coin); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-weight: 700; }
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--panel); }
.xlink { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; color: var(--ink); padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.xlink:hover { border-color: var(--muted); }
.xlink svg { width: 15px; height: 15px; fill: currentColor; }

main { padding-block: 28px 64px; display: grid; gap: 56px; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
.display { font-family: var(--display); line-height: 1.02; letter-spacing: .01em; }
h1.display { font-size: var(--step-4); }
h2.display { font-size: var(--step-3); }
h3 { font-family: var(--body); font-weight: 700; font-size: var(--step-1); line-height: 1.25; }
p { margin: 0; }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; line-height: 1.45; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: var(--r-ui); border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 700 var(--step-0)/1 var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.coin { background: var(--coin); color: var(--coin-ink); border-color: transparent; box-shadow: 0 4px 0 #b88a00; }
.btn.coin:active { transform: translateY(2px); box-shadow: 0 2px 0 #b88a00; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bezel); border-color: var(--ink); }

/* ---------- screen (cabinet bezel around a poster or a live build) ---------- */
.screen { --acc: var(--glow); position: relative; display: block; background: var(--bezel); border-radius: calc(var(--r-screen) + 8px); padding: 8px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px color-mix(in srgb, var(--acc) 70%, transparent); }
.screen::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px; height: 2px; border-radius: 2px; background: var(--acc); opacity: .85; }
.screen .glass { display: block; position: relative; aspect-ratio: 16 / 10; max-width: 100%; border-radius: var(--r-screen); overflow: hidden; background: #000; }
.screen .glass img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 28px 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card { text-decoration: none; display: grid; gap: 12px; align-content: start; }
.card .meta { display: grid; gap: 2px; padding-inline: 4px; }
.card h3 { display: flex; align-items: baseline; gap: 10px; }
.card .no { font: 700 var(--step--1)/1 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.card p { color: var(--muted); font-size: var(--step--1); line-height: 1.45; }
.card .glass img { transition: transform .35s ease; }
.card:hover .glass img { transform: scale(1.035); }
.card:hover h3 span:last-child { text-decoration: underline; text-underline-offset: 3px; }

.badge { display: inline-block; font: 700 .75rem/1 var(--body); padding: 5px 8px; border-radius: 6px; background: var(--coin); color: var(--coin-ink); }
.screen .badge { position: absolute; top: 18px; left: 18px; z-index: 2; }

/* versus card: two posters split by a slanted seam */
.vs-glass { position: relative; }
.vs-glass img { position: absolute; inset: 0; }
.vs-glass img:last-child { clip-path: polygon(56% 0, 100% 0, 100% 100%, 44% 100%); }
.vs-glass .vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); font-family: var(--display); font-size: 1.6rem; color: var(--coin); background: var(--bezel); padding: 6px 12px; border-radius: 8px; line-height: 1; z-index: 2; box-shadow: 0 0 0 2px var(--coin); }

/* ---------- sections ---------- */
.shelf { display: grid; gap: 20px; }
.shelf-head { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.shelf-head > div { display: grid; gap: 6px; min-width: 0; }
.shelf-head a.more { font-weight: 700; color: var(--muted); text-underline-offset: 3px; }
.shelf-head a.more:hover { color: var(--ink); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding-top: 12px; }
.hero-copy { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.hero-copy .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .pick { display: grid; gap: 10px; text-decoration: none; }
.hero .pick .caption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: var(--step--1); padding-inline: 4px; flex-wrap: wrap; }
.hero .pick .caption b { color: var(--ink); }

/* solo card (a shelf with a single item) */
.solo { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: center; text-decoration: none; }
.solo .meta { display: grid; gap: 10px; min-width: 0; }
.solo .meta p { color: var(--muted); }
.solo .meta .btn { justify-self: start; }

/* ---------- build page ---------- */
.crumb { color: var(--muted); font-weight: 700; text-decoration: none; }
.crumb:hover { color: var(--ink); }
.page-head { display: grid; gap: 10px; }
.player-block { display: grid; gap: 14px; }
.player { --acc: var(--glow); }
.player .glass { aspect-ratio: 16 / 10; }
.player .glass iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player .start { position: absolute; inset: 0; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.player .start img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.62); }
.player .start .coin { position: relative; font-size: var(--step-1); min-height: 56px; padding: 10px 28px; }
.player .loading { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: var(--step--1); color: var(--ink); background: color-mix(in srgb, var(--bezel) 80%, transparent); padding: 6px 12px; border-radius: 999px; pointer-events: none; }
.player:fullscreen { padding: 0; border-radius: 0; background: #000; }
.player:fullscreen .glass { aspect-ratio: auto; height: 100%; border-radius: 0; }
.player:fullscreen::after { display: none; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }
.note { font-size: var(--step--1); color: var(--muted); }

.details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.details section { display: grid; gap: 14px; min-width: 0; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.steps li::marker { color: var(--coin); font-weight: 700; }
.keys { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.keys th, .keys td { text-align: left; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys th { font-weight: 700; color: var(--ink); white-space: nowrap; padding-right: 18px; }
.keys td { color: var(--muted); }
kbd { font: 700 .8rem/1 var(--body); background: var(--panel); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: 3px 6px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chips li { font-size: var(--step--1); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
details.secret { border: 1px dashed var(--line); border-radius: var(--r-ui); padding: 12px 14px; }
details.secret summary { cursor: pointer; font-weight: 700; }
details.secret p { margin-top: 8px; color: var(--muted); }

/* ---------- versus page ---------- */
.takes { justify-self: start; display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bezel); border: 1px solid var(--line); flex-wrap: wrap; }
.takes button { min-height: 40px; padding: 6px 16px; border-radius: 8px; border: 0; background: none; color: var(--muted); font: 700 var(--step-0)/1 var(--body); cursor: pointer; }
.takes button[aria-pressed="true"] { background: var(--ink); color: var(--bezel); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split .label { font-weight: 700; padding: 0 4px 8px; }
.compare-wrap { overflow-x: auto; }
.compare { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; }
.compare col.k { width: 20%; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); }
.compare thead th { font-family: var(--display); font-weight: 400; font-size: var(--step-1); color: var(--ink); }
.compare tbody th { color: var(--muted); font-weight: 700; }
.vote { display: grid; gap: 14px; justify-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.vote .row { display: flex; gap: 10px; flex-wrap: wrap; }
.vote output { color: var(--muted); }
.prompt { display: grid; gap: 10px; }
.prompt blockquote { margin: 0; padding: 14px 16px; border-left: 3px solid var(--coin); background: var(--panel); border-radius: 0 var(--r-ui) var(--r-ui) 0; color: var(--ink); max-width: 75ch; }

/* ---------- about ---------- */
.prose { display: grid; gap: 16px; max-width: 64ch; }
.prose h2 { font-family: var(--body); font-weight: 700; font-size: var(--step-1); margin-top: 12px; }
.prose p, .prose li { color: var(--muted); }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bezel) 60%, transparent); }
.site-foot .wrap { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 16px 32px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.site-foot p { color: var(--muted); max-width: 52ch; }
.site-foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-foot nav a { color: var(--muted); font-weight: 700; text-underline-offset: 3px; }
.site-foot nav a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .hero, .solo, .details { grid-template-columns: 1fr; }
  .hero { gap: 28px; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-head .wrap { gap: 10px 16px; }
  .nav { order: 3; width: 100%; margin-right: 0; }
  .wordmark { margin-right: auto; }
  main { gap: 44px; }
  .player .glass { aspect-ratio: 3 / 4; }
  .player[data-orientation="landscape"] .glass { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .card .glass img { transition: none; }
  .card:hover .glass img { transform: none; }
}
