:root {
  --a-bg: #f6f6fa; --a-surface: #fff; --a-text: #1b1b25; --a-muted: #6a6a7c; --a-border: #e2e2ec;
  --a-accent: #5b4bf0; --a-accent-text: #fff; --a-shadow: 0 1px 2px rgba(20,20,40,.06), 0 6px 18px rgba(20,20,40,.06);
  --a-bar: #fff; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --a-bg: #101018; --a-surface: #1a1a26; --a-text: #ececf4; --a-muted: #9a9ab0; --a-border: #2a2a3a;
    --a-accent: #8b7fff; --a-accent-text: #10101a; --a-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    --a-bar: #151520; color-scheme: dark;
  }
}
/* The arcade's own tokens (--a-*) read the shared 1dot1 chrome tokens (--bg, --surface, ...) when chrome.css is
   loaded and fall back to the arcade's own palette when it is not (portal unreachable). The arcade never sets
   the chrome's tokens and never styles .site-head, .site-nav or .site-foot; its layout does not need chrome.css. */
:root {
  --a-bg: var(--bg, #f6f6fa); --a-surface: var(--surface, #fff); --a-text: var(--text, #1b1b25);
  --a-muted: var(--muted, #6a6a7c); --a-border: var(--border, #e2e2ec); --a-accent: var(--accent, #5b4bf0);
  --a-accent-text: var(--accent-fg, #fff);
  --a-shadow: var(--shadow, 0 1px 2px rgba(20,20,40,.06), 0 6px 18px rgba(20,20,40,.06));
  --a-bar: var(--surface-2, #fff);
}
@media (prefers-color-scheme: dark) {
  :root {
    --a-bg: var(--bg, #101018); --a-surface: var(--surface, #1a1a26); --a-text: var(--text, #ececf4);
    --a-muted: var(--muted, #9a9ab0); --a-border: var(--border, #2a2a3a); --a-accent: var(--accent, #8b7fff);
    --a-accent-text: var(--accent-fg, #10101a);
    --a-shadow: var(--shadow, 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35));
    --a-bar: var(--surface-2, #151520);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background-color: var(--a-bg); } /* colour only: the chrome's shorthand also paints the theme's background image */
body {
  color: var(--a-text);
  font: var(--fs, 16px)/var(--lh, 1.5) var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.wrap { max-width: 1100px; margin: 0 auto; padding-inline: 20px; }
.page > .wrap { max-width: none; padding-inline: 4px; }
:where(main, .bar, .lb) a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus, var(--a-accent)); outline-offset: 2px; }

/* Catalog */
.hero { padding-block: 24px 12px; }
.brand { margin: 0; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: .8em; height: .8em; border-radius: 22%; background: var(--a-accent); position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; background: var(--a-accent-text);
  clip-path: polygon(34% 26%, 34% 74%, 76% 50%); 
}
.atagline { margin: 6px 0 0; color: var(--a-muted); }
.controls { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
#search {
  width: 100%; max-width: 420px; padding: 11px 14px; font: inherit; color: var(--a-text);
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 10px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.achip {
  font: inherit; font-size: .85rem; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  color: var(--a-muted); background: var(--a-surface); border: 1px solid var(--a-border);
}
.achip:hover { color: var(--a-text); }
.achip[aria-pressed="true"] { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-accent-text); }
.status { color: var(--a-muted); margin: 8px 0 16px; }
.grid {
  list-style: none; margin: 0; padding: 0 0 56px; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.card {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; overflow: hidden;
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 14px; box-shadow: var(--a-shadow);
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--a-accent); }
.athumb {
  aspect-ratio: 16 / 10; width: 100%; display: grid; place-items: center; overflow: hidden; flex: none;
  border-radius: 13px 13px 0 0; /* matches the card's inner corner so the image never pokes out */
  color: rgba(255,255,255,.92); font-size: 2.6rem; font-weight: 800; letter-spacing: .02em;
}
.athumb.has-img { background: var(--a-border); }
.athumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .18s ease, border-color .15s ease, box-shadow .18s ease; }
  .card:hover { transform: translateY(-3px); }
  .athumb img { transition: transform .35s cubic-bezier(.2,.7,.3,1); }
  .card:hover .athumb img, .card:focus-visible .athumb img { transform: scale(1.045); }
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { margin: 0; font-size: 1.1rem; letter-spacing: -.01em; }
.card-desc { margin: 0; color: var(--a-muted); font-size: .92rem; }
.card-meta { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; color: var(--a-muted); }
.tag { padding: 1px 8px; border-radius: 999px; background: var(--a-bg); border: 1px solid var(--a-border); }
/* Feature-flagged (site/features.json): community badge and "Submit a game" link. */
.badge { color: var(--a-accent); border-color: var(--a-accent); }
.submit { align-self: flex-start; }

/* Player */
/* Player: the chrome header sits above the bar and the footer below the game, so the page may scroll;
   the game gets the rest of the viewport (all of it on phones, where the header scrolls away). */
body[data-page="play"] { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body[data-page="play"] > .page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--a-bar); border-bottom: 1px solid var(--a-border); min-height: 44px;
}
.back { text-decoration: none; font-weight: 600; white-space: nowrap; color: var(--a-accent); }
.bar-title { margin: 0; font-size: 1rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { color: var(--a-muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bar-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.abtn {
  display: inline-block; font: inherit; cursor: pointer; text-decoration: none; padding: 9px 18px; border-radius: 9px;
  color: var(--a-accent-text); background: var(--a-accent); border: 1px solid var(--a-accent);
}
.abtn.small { padding: 4px 12px; font-size: .85rem; color: var(--a-text); background: var(--a-surface); border-color: var(--a-border); }
.abtn.small:hover { border-color: var(--a-accent); }
.stage { flex: 1; width: 100%; min-height: 480px; border: 0; background: #000; display: block; }
@media (max-width: 640px) {
  .stage { min-height: max(420px, calc(100vh - 100px)); min-height: max(420px, calc(100dvh - 100px)); }
  .hint { display: none; }
  .bar { gap: 8px 10px; flex-wrap: wrap; }
  .bar-title { flex: 1; min-width: 0; }
  .bar-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; margin-left: auto; }
}

/* 404 */
.notfound { text-align: center; padding-block: 18vh; }
.notfound .code { font-size: 4.5rem; font-weight: 800; margin: 0; color: var(--a-accent); letter-spacing: -.04em; }
.notfound h1 { margin: 0 0 4px; }
.notfound .abtn { margin-top: 24px; }

/* Footer + prose pages (privacy) */
.foot { padding-block: 8px 32px; font-size: .85rem; color: var(--a-muted); }
.foot a { color: var(--a-muted); }
.prose { max-width: 720px; padding-block: 28px 56px; }
.prose h1 { letter-spacing: -.02em; margin: 8px 0 12px; }
.prose h2 { font-size: 1.05rem; margin: 24px 0 6px; }
.prose a.back { font-size: .9rem; }

/* Leaderboard panel (player page; shown only for games with public boards) */
[hidden] { display: none !important; }
.lb {
  position: fixed; right: 0; bottom: 0; top: 0; z-index: 5; width: min(340px, 100%);
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); padding-right: max(16px, env(safe-area-inset-right));
  background: var(--a-surface); border-left: 1px solid var(--a-border); box-shadow: var(--a-shadow);
}
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-head h2 { margin: 0; font-size: 1.05rem; }
.lb-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lb-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--a-border); }
.lb-rank { width: 1.6em; text-align: right; color: var(--a-muted); font-variant-numeric: tabular-nums; flex: none; }
.lb-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who small { color: var(--a-muted); }
.lb-val { font-weight: 650; font-variant-numeric: tabular-nums; flex: none; }
.lb-msg { margin: 0; font-size: .82rem; color: var(--a-muted); }
.lb-name { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.lb-name label { font-size: .85rem; font-weight: 600; }
.lb-row { display: flex; gap: 8px; }
.lb-row input {
  flex: 1; min-width: 0; padding: 6px 10px; font: inherit; color: var(--a-text);
  background: var(--a-bg); border: 1px solid var(--a-border); border-radius: 8px;
}
.lb-row input[aria-invalid="true"] { border-color: #d64545; }
@media (max-width: 640px) { .lb { width: 100%; border-left: 0; } }

/* Locker panel (player page; read-only view of the game's unlockables, docs/UNLOCKS-PLAN.md) */
.lk-body { min-height: 0; }

/* Public stats page (/stats/, site/stats.html; data from GET /api/v1/stats) */
.st { padding-block: 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.st > p:first-child { margin: 0; }
.st a.back { font-size: .9rem; }
.st h1 { margin: 0; letter-spacing: -.02em; }
.st h2 { margin: 0 0 12px; font-size: 1.05rem; }
.st h2 small { font-weight: 400; color: var(--a-muted); font-size: .85rem; }
.st .status { margin: 0; }
.st-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.st-head .atagline { margin-top: 2px; }
#stbody { display: flex; flex-direction: column; gap: 18px; }
.st-tiles { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-tile, .st-card, .st-board {
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 14px; box-shadow: var(--a-shadow);
}
.st-tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-label { color: var(--a-muted); font-size: .85rem; }
.st-num { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-card { padding: 16px; min-width: 0; }
.st-chart-wrap { position: relative; padding-top: 18px; }
.st-ymax { position: absolute; top: 0; left: 0; font-size: .75rem; color: var(--a-muted); font-variant-numeric: tabular-nums; }
.st-chart {
  height: 160px; display: flex; align-items: flex-end; gap: 2px;
  border-bottom: 1px solid var(--a-border);
  background: linear-gradient(var(--a-border), var(--a-border)) 0 0 / 100% 1px no-repeat; /* recessive max gridline */
}
.st-chart.dense { gap: 0; }
.st-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.st-bar i { display: block; width: 100%; background: var(--a-accent); border-radius: 3px 3px 0 0; }
.st-chart.dense .st-bar i { border-radius: 1px 1px 0 0; }
.st-bar:hover i { opacity: .7; }
.st-xaxis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--a-muted); margin-top: 4px; }
.st-scroll { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.st-table th, .st-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--a-border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-table th { font-size: .8rem; font-weight: 600; color: var(--a-muted); }
.st-table th:first-child, .st-table td:first-child { text-align: left; padding-left: 0; }
.st-table tr:last-child td { border-bottom: 0; }
.st-table td:first-child a { font-weight: 600; text-decoration: none; }
.st-table td:first-child a:hover { color: var(--a-accent); }
.st-histh, .st-hist-cell { width: 34%; min-width: 120px; }
.st-hist { display: flex; gap: 2px; height: 10px; width: 100%; border-radius: 3px; overflow: hidden; background: var(--a-bg); }
.st-hist i, .st-legend i { display: block; height: 100%; }
.h0 { background: color-mix(in oklab, var(--a-accent) 28%, var(--a-surface)); }
.h1 { background: color-mix(in oklab, var(--a-accent) 52%, var(--a-surface)); }
.h2 { background: color-mix(in oklab, var(--a-accent) 76%, var(--a-surface)); }
.h3 { background: var(--a-accent); }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: .78rem; color: var(--a-muted); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 10px; height: 10px; border-radius: 2px; }
.st-boards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.st-board { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-board h3 { margin: 0; font-size: .98rem; }
.st-board h3 small { color: var(--a-muted); font-weight: 400; }
.st-note { margin-top: 4px; }
@media (max-width: 640px) {
  .st-tiles { gap: 8px; }
  .st-tile { padding: 10px 12px; }
  .st-card { padding: 14px 12px; }
}
/* Catalog: "N plays · 30d" on each card (filled in after GET /api/v1/stats answers) */
.plays { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---- Scores panel: "You" tab ---- */
.ico { vertical-align: -.15em; flex: none; }
#lbtoggle { display: inline-flex; align-items: center; gap: 6px; }
#lbtoggle .top { color: var(--a-muted); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
#lbtoggle .ico { color: #d9a400; }
@media (max-width: 640px) { #lbtoggle .top { display: none; } }
.lb-you, .lb-board { display: flex; flex-direction: column; gap: 10px; }
.lb-who-line { margin: 0; font-size: .95rem; }
.lb-who-line small { color: var(--a-muted); }
.you-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.you-stat {
  display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; min-width: 0;
  background: var(--a-bg); border: 1px solid var(--a-border); border-radius: 10px;
}
.you-stat.wide { grid-column: 1 / -1; border-color: color-mix(in oklab, var(--a-accent) 45%, var(--a-border)); }
.you-k { font-size: .78rem; color: var(--a-muted); overflow-wrap: anywhere; }
.you-v { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.you-sub { font-size: .75rem; color: var(--a-muted); }

/* ---- /stats/: Your stats ---- */
.you-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.you-game {
  display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 12px 14px; text-decoration: none;
  background: var(--a-bg); border: 1px solid var(--a-border); border-radius: 12px;
}
.you-game:hover, .you-game:focus-visible { border-color: var(--a-accent); }
.you-game h3 { margin: 0; font-size: 1rem; }
.you-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.you-chip { display: inline-flex; flex-direction: column; padding: 4px 10px; border-radius: 8px; background: var(--a-surface); border: 1px solid var(--a-border); min-width: 0; }
.you-chip b { font-variant-numeric: tabular-nums; font-size: .98rem; }

/* ---- Catalog: header link, card trophy ---- */
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search-row #search { flex: 1 1 220px; }
.lb-link { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: .9rem; }
.lb-link .ico { color: #d9a400; }
.grid > li { position: relative; }
.card-trophy {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  color: #7a5a00; background: rgba(255,255,255,.92); border: 1px solid rgba(0,0,0,.12); box-shadow: 0 2px 6px rgba(0,0,0,.2);
  text-decoration: none; opacity: .92;
}
.card-trophy:hover, .card-trophy:focus-visible { opacity: 1; background: #ffd75e; }
@media (prefers-color-scheme: dark) { .card-trophy { background: rgba(20,20,32,.88); color: #ffd75e; border-color: rgba(255,255,255,.18); } .card-trophy:hover, .card-trophy:focus-visible { background: #3a3000; } }

/* ---- /leaderboards/ ---- */
:root { --gold: #e6b422; --silver: #b4bccb; --bronze: #c9803f; --medal-text: #2a2000; }
.lbp { padding-block: 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.lbp > p:first-child { margin: 0; }
.lbp h1 { margin: 0; letter-spacing: -.02em; }
.lbp a.back { font-size: .9rem; }
.lbp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.lbp .status { margin: 0; }
.lbp-games { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.lbp-tab {
  display: flex; align-items: center; gap: 10px; flex: none; scroll-snap-align: start; font: inherit; cursor: pointer; color: var(--a-text);
  padding: 5px 14px 5px 5px; background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 12px;
}
.lbp-tab img { width: 48px; height: 30px; object-fit: cover; border-radius: 7px; display: block; background: var(--a-border); }
.lbp-tab:hover { border-color: var(--a-accent); }
.lbp-tab[aria-pressed="true"] { border-color: var(--a-accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--a-accent) 35%, transparent); font-weight: 650; }
.lbp-game { display: flex; flex-direction: column; gap: 14px; }
.lbp-gh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lbp-gh h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.lbp-boards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.lbp-board { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 16px; box-shadow: var(--a-shadow); padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.lbp-board.focus { border-color: var(--a-accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--a-accent) 35%, transparent), var(--a-shadow); }
.lbp-bh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.lbp-bh h3 { margin: 0; font-size: 1.1rem; }
.lbp-bsub { font-size: .8rem; color: var(--a-muted); }
.lbp-podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; }
.pod {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0;
  padding: 26px 6px 10px; border-radius: 12px; border: 1px solid var(--a-border); border-top: 3px solid var(--m);
  background: linear-gradient(180deg, color-mix(in oklab, var(--m) 20%, var(--a-surface)), var(--a-surface) 75%);
}
.pod.gold { --m: var(--gold); order: 2; padding-top: 34px; padding-bottom: 16px; }
.pod.silver { --m: var(--silver); order: 1; }
.pod.bronze { --m: var(--bronze); order: 3; }
.pod.me, .lbp-list li.me, .lbp-you { box-shadow: inset 0 0 0 2px var(--a-accent); }
.medal {
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: var(--medal-text);
  background: radial-gradient(circle at 35% 30%, #fff8 0, transparent 55%), var(--m); box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.pod.gold .medal { width: 30px; height: 30px; top: 4px; font-size: .95rem; }
.lbp-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.pod.gold .lbp-name { font-size: 1.12rem; }
.lbp-name small { color: var(--a-muted); font-weight: 400; }
.pod-val { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; max-width: 100%; overflow-wrap: anywhere; }
.pod.gold .pod-val { font-size: 1.3rem; }
.pod-at, .lbp-at { font-size: .72rem; color: var(--a-muted); }
.lbp-list li { align-items: center; padding: 7px 6px; border-radius: 8px; }
.lbp-list li .lb-who, .lbp-list .lbp-name { flex: 1; min-width: 0; font-weight: 500; }
.lbp-list li.me { background: color-mix(in oklab, var(--a-accent) 10%, var(--a-surface)); }
.lbp-list .lb-rank { background: var(--a-bg); border-radius: 999px; width: 2em; height: 2em; display: grid; place-items: center; text-align: center; font-size: .8rem; }
.lbp-you { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in oklab, var(--a-accent) 10%, var(--a-surface)); }
.lbp-you .lbp-name { flex: 1; min-width: 0; }
.lbp-you .lb-rank { width: auto; min-width: 2.4em; }
.lbp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; text-align: center; color: var(--a-muted); }
.lbp-empty p { margin: 0; }
.lbp-crown { font-size: 2rem; color: var(--gold); line-height: 1; }
@media (max-width: 520px) {
  .lbp-podium { grid-template-columns: 1fr; }
  .pod, .pod.gold { order: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 2px 10px; padding: 10px 10px 10px 48px; border-top-width: 1px; border-left: 4px solid var(--m); align-items: baseline; }
  .pod .medal, .pod.gold .medal { top: 50%; left: 12px; transform: translateY(-50%); width: 26px; height: 26px; font-size: .85rem; }
  .pod .lbp-name { flex: 1; min-width: 0; font-size: 1rem; }
  .pod-val, .pod.gold .pod-val { font-size: 1.1rem; }
  .pod-at { flex-basis: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .pod { animation: pod-in .55s cubic-bezier(.2,.8,.25,1) both; animation-delay: calc(var(--i, 0) * 110ms); }
  .pod::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.4) 50%, transparent 65%); transform: translateX(-120%);
    animation: pod-shine 1.1s ease-out both; animation-delay: calc(.5s + var(--i, 0) * 110ms);
  }
}
@keyframes pod-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pod-shine { to { transform: translateX(120%); } }

/* ---- Locker: entry points (catalog header, player bar) ---- */
.lk-ico, .lb-link .lk-ico { color: var(--a-accent); }
#lktoggle { display: inline-flex; align-items: center; gap: 6px; }
.lk-full { padding: 8px 10px; border-radius: 10px; background: color-mix(in oklab, var(--a-accent) 9%, var(--a-surface)); border: 1px solid color-mix(in oklab, var(--a-accent) 30%, var(--a-border)); }
.lk-full a { color: var(--a-accent); font-weight: 650; }

/* ---- /locker/ (site/locker.html; data: dist/unlocks/<slug>.json via ArcadeUnlocks.forGame) ---- */
:root {
  --r-common: #8b93a1; --r-rare: #3b82f6; --r-epic: #a855f7; --r-legendary: #f59e0b;
  --rt-common: #5b6270; --rt-rare: #1d5fd1; --rt-epic: #8a2fd6; --rt-legendary: #a75f00; /* readable rarity text */
}
@media (prefers-color-scheme: dark) {
  :root { --r-common: #9ca3af; --rt-common: #b6bcc7; --rt-rare: #79a8ff; --rt-epic: #c792ff; --rt-legendary: #ffbf47; }
}
.r-common { --r: var(--r-common); --rt: var(--rt-common); }
.r-rare { --r: var(--r-rare); --rt: var(--rt-rare); }
.r-epic { --r: var(--r-epic); --rt: var(--rt-epic); }
.r-legendary { --r: var(--r-legendary); --rt: var(--rt-legendary); }
.lkp { padding-block: 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.lkp > p:first-child { margin: 0; }
.lkp a.back { font-size: .9rem; }
.lkp .status { margin: 0; }
.lkp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.lkp-title { min-width: 0; }
.lkp h1 { margin: 0; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.lkp-ico { color: var(--a-accent); width: 1em; height: 1em; }
.lkp-title .atagline { margin-top: 2px; }
.lkp-tag { color: var(--a-muted); font-weight: 400; }
.lkp-meter {
  flex: 0 1 480px; min-width: min(100%, 260px); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 14px; box-shadow: var(--a-shadow);
}
.lkp-count { margin: 0; color: var(--a-muted); font-size: .92rem; }
.lkp-count b { color: var(--a-text); font-size: 1.6rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lkp-bar { height: 8px; border-radius: 99px; background: var(--a-bg); border: 1px solid var(--a-border); overflow: hidden; }
.lkp-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--a-accent), color-mix(in oklab, var(--a-accent) 55%, var(--r-legendary))); }
.lkp-rar { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lkp-rchip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 7px; font-size: .76rem; color: var(--a-muted); border-radius: 999px; background: var(--a-bg); border: 1px solid var(--a-border); }
.lkp-rchip b { color: var(--a-text); font-variant-numeric: tabular-nums; font-weight: 650; }
.lkp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--r); }
.lkp-src { margin: 0; font-size: .74rem; color: var(--a-muted); }

.lkp-recent h2 { margin: 0 0 8px; font-size: 1rem; }
.lkp-rlist { list-style: none; margin: 0; padding: 2px 2px 6px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.lkp-rlist li { flex: none; scroll-snap-align: start; }
.lkp-ritem {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; max-width: 260px; font: inherit; color: var(--a-text); text-align: left; cursor: pointer;
  background: linear-gradient(100deg, color-mix(in oklab, var(--r) 16%, var(--a-surface)), var(--a-surface) 70%);
  border: 1px solid color-mix(in oklab, var(--r) 45%, var(--a-border)); border-radius: 12px;
}
.lkp-ritem:hover { border-color: var(--r); }
.lkp-ritem .lkp-ic { width: 40px; height: 40px; border-radius: 9px; }
.lkp-rt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.lkp-rt b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lkp-rt small { font-size: .74rem; color: var(--a-muted); white-space: nowrap; }

.lkp-games .lbp-tab { padding-right: 12px; }
.lkp-tt { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.lkp-tn { font-size: .72rem; color: var(--a-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.lkp-allic { width: 48px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 1.15rem; background: color-mix(in oklab, var(--a-accent) 14%, var(--a-bg)); }
.lkp-tools { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.lkp-tools .tags { align-items: center; }
.lkp-tl { font-size: .8rem; color: var(--a-muted); margin-right: 2px; }

.lkp-body { display: flex; flex-direction: column; gap: 22px; }
.lkp-game { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 16px; box-shadow: var(--a-shadow); }
.lkp-gh { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lkp-ghl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lkp-ghl img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; background: var(--a-border); }
.lkp-gh h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.02em; }
.lkp-gsub { font-size: .8rem; color: var(--a-muted); }
.lkp-slot { display: flex; flex-direction: column; gap: 10px; }
.lkp-slot + .lkp-slot { border-top: 1px solid var(--a-border); padding-top: 14px; }
.lkp-sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.lkp-sh h3 { margin: 0; font-size: 1rem; }
.lkp-sn { font-size: .78rem; color: var(--a-muted); font-variant-numeric: tabular-nums; }
.lkp-seq { margin-left: auto; font-size: .8rem; color: var(--a-muted); }
.lkp-seq b { color: var(--a-text); font-weight: 650; }
.lkp-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr)); }
.lkp-item {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; min-width: 0; scroll-margin: 90px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--r) 10%, var(--a-surface)), var(--a-surface) 62%);
  border: 1px solid color-mix(in oklab, var(--r) 40%, var(--a-border)); border-top: 3px solid var(--r); border-radius: 13px;
}
.lkp-item.eq { border-color: var(--a-accent); border-top-color: var(--r); box-shadow: 0 0 0 2px color-mix(in oklab, var(--a-accent) 40%, transparent); }
.lkp-item.locked { background: var(--a-surface); border-color: var(--a-border); border-top-color: color-mix(in oklab, var(--r) 55%, var(--a-border)); }
.lkp-top { display: flex; gap: 12px; align-items: center; }
.lkp-icw { position: relative; flex: none; }
.lkp-ic { width: 60px; height: 60px; border-radius: 11px; overflow: hidden; display: grid; place-items: center; background: var(--a-bg); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.lkp-ic img { width: 100%; height: 100%; display: block; object-fit: cover; }
.lkp-ic.mystery {
  font-size: 1.7rem; font-weight: 800; color: var(--r);
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--r) 14%, var(--a-bg)) 0 8px, var(--a-bg) 8px 16px);
  border: 2px dashed color-mix(in oklab, var(--r) 60%, var(--a-border)); box-shadow: none;
}
.lkp-item.locked .lkp-ic img { filter: grayscale(1) contrast(.85); opacity: .5; }
.lkp-lock {
  position: absolute; right: -5px; bottom: -5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem;
  color: var(--a-muted); background: var(--a-surface); border: 1px solid var(--a-border); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.lkp-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lkp-nm { margin: 0; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.lkp-item.locked .lkp-nm { color: var(--a-muted); }
.lkp-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.lkp-rr, .lkp-eqb, .lkp-def { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; line-height: 1.5; }
.lkp-rr { color: var(--rt); background: color-mix(in oklab, var(--r) 16%, transparent); border: 1px solid color-mix(in oklab, var(--r) 45%, transparent); }
.lkp-eqb { color: var(--a-accent-text); background: var(--a-accent); border: 1px solid var(--a-accent); }
.lkp-def { color: var(--a-muted); border: 1px solid var(--a-border); }
.lkp-ds { margin: 0; font-size: .86rem; color: var(--a-muted); }
.lkp-item:not(.locked) .lkp-ds { color: color-mix(in oklab, var(--a-text) 78%, var(--a-muted)); }
.lkp-req { margin: 0; font-size: .86rem; line-height: 1.35; }
.lkp-reqk { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--a-muted); }
.lkp-item.secret .lkp-req { font-style: italic; color: var(--a-muted); }
.lkp-item.secret .lkp-reqk { font-style: normal; color: var(--rt); }
.lkp-prog { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.lkp-pbar { flex: 1; height: 6px; border-radius: 99px; background: var(--a-bg); border: 1px solid var(--a-border); overflow: hidden; }
.lkp-pbar i { display: block; height: 100%; background: var(--r); border-radius: 99px; }
.lkp-pn { font-size: .74rem; color: var(--a-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lkp-eq { margin-top: auto; align-self: stretch; text-align: center; font-weight: 650; }
.lkp-eq.abtn.small { color: var(--a-accent); background: color-mix(in oklab, var(--a-accent) 10%, var(--a-surface)); border-color: color-mix(in oklab, var(--a-accent) 45%, var(--a-border)); }
.lkp-eq.abtn.small:hover, .lkp-eq.abtn.small:focus-visible { color: var(--a-accent-text); background: var(--a-accent); border-color: var(--a-accent); }
.lkp-none { margin: 0; color: var(--a-muted); font-size: .92rem; }
@media (max-width: 520px) {
  .lkp-game { padding: 12px; border-radius: 14px; }
  .lkp-grid { grid-template-columns: 1fr; gap: 10px; }
  .lkp-item { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 6px; padding: 10px; }
  .lkp-item > * { grid-column: 1 / -1; }
  .lkp-item > .lkp-top { grid-column: 1; }
  .lkp-item > .lkp-eq { grid-column: 2; grid-row: 1; align-self: center; margin: 0; }
  .lkp-ic { width: 52px; height: 52px; }
  .lkp-ghl img { width: 52px; height: 33px; }
  .lkp-gh h2 { font-size: 1.15rem; }
  .lkp-seq { margin-left: 0; flex-basis: 100%; }
  .lkp-meter { flex-basis: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .lkp-bar i { transition: width .7s cubic-bezier(.2,.8,.25,1); }
  .lkp-body.enter .lkp-item { animation: lkp-in .38s cubic-bezier(.2,.8,.25,1) both; animation-delay: calc(var(--i, 0) * 28ms); }
  .lkp-item.flash { animation: lkp-pop .6s cubic-bezier(.2,.9,.3,1.3); }
  .lkp-item.eq.flash .lkp-eqb { animation: lkp-badge .5s .1s cubic-bezier(.2,.9,.3,1.4) both; }
  .lkp-item:not(.locked) { transition: transform .15s ease, box-shadow .15s ease; }
  .lkp-item:not(.locked):hover { transform: translateY(-2px); }
}
.lkp-item.flash { outline: 2px solid var(--r); outline-offset: 2px; }
@keyframes lkp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lkp-pop { 0% { transform: scale(.97); } 50% { transform: scale(1.025); } 100% { transform: none; } }
@keyframes lkp-badge { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
