/* ==========================================================================
   Public pages – commands, leaderboard, status, arcade, web player.
   Roots: .cmdpage .lbpage .statuspage .arcade .player (every rule is scoped under one of them).
   Uses the tokens and components of /app.css; nothing here is global.
   ========================================================================== */

/* ---------- shared page frame ---------- */
:is(.cmdpage, .lbpage, .statuspage, .arcade, .player) { padding-top: calc(var(--nav-h) + clamp(28px, 4.6vw, 72px)); padding-bottom: clamp(72px, 9vw, 140px); }
:is(.cmdpage, .lbpage, .statuspage, .arcade) .pagehead { align-items: flex-end; margin-bottom: 0; padding-bottom: clamp(28px, 4vw, 52px); border-bottom: 0; }
:is(.cmdpage, .lbpage, .statuspage, .arcade) .pagehead h1 { font-size: var(--fs-page); }
:is(.cmdpage, .lbpage, .statuspage, .arcade) .ph-copy { flex: 1 1 520px; min-width: 0; }
:is(.cmdpage, .lbpage, .statuspage, .arcade) .pagehead h1 { overflow-wrap: anywhere; }
:is(.cmdpage, .lbpage, .statuspage, .arcade) .pagehead p { font-size: var(--fs-lede); line-height: 1.5; max-width: 34em; margin-top: 18px; color: var(--steel); }
:is(.cmdpage, .lbpage, .statuspage, .arcade, .player) .ph-slot { flex: 0 1 auto; min-width: 0; }
/* the big number in the slot: one cherry object per screen */
:is(.cmdpage .cmd-total, .statuspage .st-total) { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
:is(.cmdpage .cmd-total, .statuspage .st-total) .stat { font-size: clamp(76px, 8.4vw, 120px); line-height: .8; color: var(--cherry); }
:is(.cmdpage .cmd-total, .statuspage .st-total) span { margin-top: 12px; font-size: 14.5px; color: var(--steel); }
:is(.lbpage, .arcade) .tabs { margin-top: -6px; }
.arcade a.tab { display: inline-flex; align-items: center; text-decoration: none; }

/* ==========================================================================
   COMMANDS
   ========================================================================== */
.cmdpage .pagehead code { font-size: 1em; white-space: nowrap; }

/* sticky tool row: search, count, module pills */
.cmdpage .cmd-pin { height: 1px; margin-bottom: -1px; }
.cmdpage .cmd-tools { position: sticky; top: 0; z-index: var(--z-sticky); padding: 14px 0 0; background: var(--pitch); border-bottom: 1px solid transparent; box-shadow: 0 0 0 100vmax var(--pitch); clip-path: inset(0 -100vmax -1px); transition: border-color var(--t-fast); }
.cmdpage .cmd-tools.is-stuck { border-bottom-color: var(--line-strong); }
.cmdpage .cmd-tools-row { display: flex; align-items: center; gap: 12px 20px; }
.cmdpage .cmd-tools .search { flex: 1 1 auto; max-width: 520px; }
.cmdpage .cmd-count { margin-left: auto; font-size: var(--fs-small); color: var(--smoke); white-space: nowrap; }
.cmdpage .cmd-filters { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 0 14px; }
.cmdpage .cmd-strip { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent 0, black 28px, black calc(100% - 56px), transparent 100%); mask: linear-gradient(90deg, transparent 0, black 28px, black calc(100% - 56px), transparent 100%); }
.cmdpage .cmd-strip.at-start { -webkit-mask: linear-gradient(90deg, black 0, black calc(100% - 56px), transparent 100%); mask: linear-gradient(90deg, black 0, black calc(100% - 56px), transparent 100%); }
.cmdpage .cmd-strip.at-end { -webkit-mask: linear-gradient(90deg, transparent 0, black 28px); mask: linear-gradient(90deg, transparent 0, black 28px); }
.cmdpage .cmd-strip.at-start.at-end { -webkit-mask: none; mask: none; }
.cmdpage .cmd-strip::-webkit-scrollbar { display: none; }
.cmdpage .cmd-strip .filters { flex-wrap: nowrap; width: max-content; padding: 2px 40px 2px 2px; }
.cmdpage .cmd-filters .knob { width: 34px; height: 34px; }
.cmdpage .cmd-filters .knob svg { width: 16px; height: 16px; }
.cmdpage .cmd-filters .cmd-back svg { transform: rotate(-90deg); }
.cmdpage .cmd-filters .cmd-fwd svg { transform: rotate(90deg); }

/* module groups: name left (sticky under the tool row), commands right */
.cmdpage .cmd-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3.2fr); gap: 0 clamp(24px, 4vw, 64px); margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line-strong); }
.cmdpage .cmd-list > .cmd-group:first-child { margin-top: 18px; }
.cmdpage .cmd-mod { position: sticky; top: calc(var(--tools-h, 130px) + 18px); align-self: start; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 20px 0 16px; font-size: var(--fs-title); overflow-wrap: anywhere; }
.cmdpage .cmd-mod .num { font-size: 24px; font-weight: 700; letter-spacing: 0; color: var(--smoke); }

/* one command */
.cmdpage .cmd-rows { min-width: 0; }
.cmdpage .cmd { border-bottom: 1px solid var(--line); }
.cmdpage .cmd-rows > .cmd:last-child { border-bottom: 0; }
.cmdpage .cmd summary { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr) auto 18px; gap: 6px 24px; align-items: center; min-height: 58px; padding: 12px 8px 12px 0; list-style: none; cursor: pointer; }
.cmdpage .cmd summary::-webkit-details-marker { display: none; }
.cmdpage .cmd summary:focus-visible { outline-offset: -2px; border-radius: 8px; }
.cmdpage .cmd-name { display: block; font-stretch: var(--w-display); font-weight: 800; font-size: 20px; line-height: 1.15; letter-spacing: -.03em; color: var(--platinum); overflow-wrap: anywhere; transition: transform var(--t-fast) var(--ease); }
.cmdpage .cmd-slash { color: var(--smoke); transition: color var(--t-fast); }
.cmdpage .cmd summary:hover .cmd-name, .cmdpage .cmd summary:focus-visible .cmd-name, .cmdpage .cmd[open] .cmd-name { transform: translateX(6px); }
.cmdpage .cmd summary:hover .cmd-slash, .cmdpage .cmd summary:focus-visible .cmd-slash, .cmdpage .cmd[open] .cmd-slash { color: var(--cherry); }
.cmdpage .cmd-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; color: var(--steel); }
.cmdpage .cmd-plus { position: relative; width: 18px; height: 18px; color: var(--steel); transition: transform var(--t-med) var(--ease), color var(--t-fast); }
.cmdpage .cmd-plus::before, .cmdpage .cmd-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; border-radius: 2px; background: currentColor; }
.cmdpage .cmd-plus::after { transform: rotate(90deg); }
.cmdpage .cmd summary:hover .cmd-plus { color: var(--platinum); }
.cmdpage .cmd[open] .cmd-plus { transform: rotate(45deg); color: var(--platinum); }

/* open: usage, options, example in a display window */
.cmdpage .cmd-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "use opts" "ex opts" "foot foot"; gap: 22px clamp(20px, 3vw, 44px); margin: 2px 0 18px; padding: clamp(18px, 2.2vw, 28px); }
.cmdpage .cmd-body .mono { display: block; margin-bottom: 8px; }
.cmdpage .cmd-use { grid-area: use; min-width: 0; }
.cmdpage .cmd-usage { display: block; font-stretch: var(--w-display); font-weight: 800; font-size: 19px; line-height: 1.3; letter-spacing: -.02em; color: var(--platinum); overflow-wrap: anywhere; }
.cmdpage .cmd-ex { grid-area: ex; min-width: 0; }
.cmdpage .cmd-ex code { font-size: 16px; color: var(--body); overflow-wrap: anywhere; }
.cmdpage .cmd-opts { grid-area: opts; min-width: 0; }
.cmdpage .cmd-opts ul { margin: 0; padding: 0; list-style: none; }
.cmdpage .cmd-opts li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.cmdpage .cmd-opts li:last-child { border-bottom: 1px solid var(--line); }
.cmdpage .cmd-opts li code { overflow-wrap: anywhere; }
.cmdpage .cmd-req { font-size: 13.5px; font-weight: 600; color: var(--platinum); }
.cmdpage .cmd-opt, .cmdpage .cmd-none { font-size: 13.5px; color: var(--smoke); }
.cmdpage .cmd-foot { grid-area: foot; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.cmdpage .cmd-foot p { font-size: var(--fs-small); color: var(--steel); }

.cmdpage .cmd-empty { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line-strong); margin-top: 36px; }
.cmdpage .cmd-empty p { margin-bottom: 18px; font-stretch: var(--w-display); font-weight: 800; font-size: var(--fs-title); letter-spacing: -.03em; line-height: 1.1; color: var(--platinum); max-width: 24em; overflow-wrap: anywhere; }

/* ==========================================================================
   LEADERBOARD
   ========================================================================== */
.lbpage .ph-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(18px, 2.4vw, 32px); align-items: end; }
.lbpage .ph-copy > h1 { grid-column: 2; }
.lbpage .ph-copy > p { grid-column: 1 / -1; }
.lbpage .lb-gicon { grid-column: 1; grid-row: 1; width: clamp(56px, 6.4vw, 92px); height: clamp(56px, 6.4vw, 92px); border-radius: 24%; font-size: 30px; box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -20px #000; }
.lbpage .ph-slot .search { width: min(340px, 100%); }

/* podium: 2 – 1 – 3, first place on the lacquer plinth */
.lbpage .lb-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "p2 p1 p3"; align-items: end; gap: clamp(12px, 2vw, 28px); margin: 28px 0 clamp(48px, 6vw, 88px); border-bottom: 1px solid var(--line-strong); }
.lbpage .lb-pod { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.lbpage .lb-pod.p1 { grid-area: p1; } .lbpage .lb-pod.p2 { grid-area: p2; } .lbpage .lb-pod.p3 { grid-area: p3; }
.lbpage .lb-pod-who { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; padding: 0 8px 22px; }
.lbpage .lb-ring { display: block; flex: none; padding: 3px; border-radius: 50%; background: var(--line-strong); }
.lbpage .p1 .lb-ring { padding: 6px; background: var(--chrome-band); box-shadow: var(--sh-object); }
.lbpage .lb-pod-av { display: block; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--oxblood); box-shadow: 0 0 0 3px var(--pitch); }
.lbpage .p1 .lb-pod-av { width: 132px; height: 132px; }
.lbpage .lb-pod-text { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; min-width: 0; }
.lbpage .lb-pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-stretch: var(--w-display); font-weight: 800; font-size: 21px; letter-spacing: -.03em; color: var(--platinum); }
.lbpage .p1 .lb-pod-name { font-size: 27px; }
.lbpage .lb-pod-handle { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--smoke); }
.lbpage .lb-pod-big { margin-top: 8px; font-size: 30px; line-height: 1; color: var(--platinum); }
.lbpage .lb-pod-big.coin { color: var(--champagne); }
.lbpage .p1 .lb-pod-big { font-size: 40px; }
.lbpage .lb-pod-big small { font-size: .52em; font-weight: 700; color: var(--steel); }
.lbpage .lb-pod-big.coin small { color: var(--champagne); }
.lbpage .lb-pod-small small { font-size: 1em; }
.lbpage .lb-pod-small { font-size: 16px; font-weight: 700; color: var(--steel); }
.lbpage .lb-plinth { position: relative; display: grid; justify-items: center; align-content: start; width: 100%; overflow: hidden; border-radius: var(--r-slab) var(--r-slab) 6px 6px; border-bottom-width: 0; }
.lbpage .p1 .lb-plinth { height: clamp(190px, 19vw, 260px); }
.lbpage .p2 .lb-plinth { height: clamp(136px, 13vw, 180px); }
.lbpage .p3 .lb-plinth { height: clamp(104px, 9.6vw, 134px); }
.lbpage .lb-plinth.chrome-rim { box-shadow: var(--sh-object), inset 0 1px 0 rgba(255, 255, 255, .12); }
.lbpage .lb-plinth .stat { padding-top: 14px; font-size: clamp(90px, 10vw, 140px); line-height: .82; }
.lbpage .p1 .lb-plinth .stat { padding-top: 18px; font-size: clamp(140px, 15vw, 220px); filter: drop-shadow(0 6px 10px rgba(40, 0, 6, .55)); }
.lbpage .lb-pod.is-me .lb-pod-name::after { content: " (you)"; font-size: .62em; font-weight: 600; color: var(--steel); }
.lbpage .lb-podium.n1 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "p1"; max-width: 420px; }
.lbpage .lb-podium.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "p2 p1"; max-width: 840px; }

/* rank 4 and down: hairline rows */
.lbpage .lb-list { margin: 0; padding: 0; list-style: none; }
.lbpage .lb-list li { display: grid; grid-template-columns: 52px 44px minmax(0, 1.3fr) minmax(0, 1fr) minmax(130px, auto); gap: 18px; align-items: center; min-height: 68px; padding: 12px 16px 12px 8px; border-bottom: 1px solid var(--line); transition: background-color var(--t-fast); }
.lbpage .lb-list li:first-child { border-top: 1px solid var(--line); }
.lbpage .lb-list li:hover { background: var(--oxblood); }
.lbpage .lb-list li.is-me { box-shadow: inset 3px 0 0 var(--cherry); }
.lbpage .lb-rank { font-size: 22px; color: var(--smoke); text-align: right; }
.lbpage .lb-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--oxblood); }
.lbpage .lb-who { display: flex; flex-direction: column; min-width: 0; }
.lbpage .lb-who b, .lbpage .lb-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbpage .lb-who b { font-size: 16.5px; font-weight: 700; color: var(--platinum); }
.lbpage .lb-who small { font-size: 14px; color: var(--smoke); }
.lbpage .lb-lvl { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; min-width: 0; }
.lbpage .lb-lvl .num { font-size: 16px; color: var(--steel); white-space: nowrap; }
.lbpage .lb-lvl .bar { height: 8px; }
.lbpage .lb-val { font-size: 22px; text-align: right; white-space: nowrap; color: var(--platinum); }
.lbpage .lb-val.coin { color: var(--champagne); }
.lbpage .lb-val small { font-size: 13px; font-weight: 600; color: var(--smoke); }
.lbpage .lb-none { display: block !important; padding: 22px 8px !important; color: var(--steel); }
.lbpage .lb-note { margin-top: 22px; }

/* ==========================================================================
   STATUS
   ========================================================================== */
.statuspage .st-dot { width: .2em; height: .2em; margin-right: .24em; vertical-align: .2em; }
.statuspage .st-dot.ok { box-shadow: 0 0 0 .05em rgba(246, 242, 239, .16); }
.statuspage .st-dot.live { animation: st-breathe 2.8s var(--ease-in-out) infinite; }
@keyframes st-breathe { 50% { box-shadow: 0 0 0 .14em rgba(246, 242, 239, 0); } }
.statuspage .st-figures { border-top: 1px solid var(--line-strong); border-bottom: 0; }
.statuspage .st-figures b { font-size: clamp(44px, 5vw, 68px); }
.statuspage .st-sec { margin-top: clamp(56px, 7vw, 96px); }
.statuspage .st-sec > h2, .statuspage .st-sechead { padding-top: 22px; border-top: 1px solid var(--line-strong); }
.statuspage .st-sechead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 32px; }
.statuspage .st-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); color: var(--steel); }
.statuspage .st-legend li { display: flex; align-items: center; gap: 8px; }
.statuspage .st-legend i { width: 8px; height: 18px; border-radius: 99px; }
/* the comb: one chrome tooth per day */
.statuspage .st-comb { display: flex; gap: 0; height: 64px; margin-top: 28px; }
.statuspage .st-day { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; border-radius: 5px; outline-offset: 2px; cursor: default; }
.statuspage .st-day > i { display: block; width: max(4px, 46%); height: 44px; border-radius: 99px; transition: transform var(--t-fast) var(--ease); }
.statuspage :is(.st-day, .st-legend li) > i.up, .statuspage .st-day.up > i, .statuspage .st-legend .up { background: var(--chrome-soft); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .35); }
.statuspage .st-day.mid > i, .statuspage .st-legend .mid { background: var(--blush); }
.statuspage .st-day.down > i, .statuspage .st-legend .down { background: var(--flare); }
.statuspage .st-day.none > i, .statuspage .st-legend .none { background: var(--line); }
.statuspage .st-day:hover > i, .statuspage .st-day:focus-visible > i { transform: translateY(-6px); }
.statuspage .st-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; z-index: 2; display: grid; gap: 2px; padding: 9px 13px; border-radius: 12px; background: var(--glass); box-shadow: var(--sh-pop); white-space: nowrap; font-size: 14px; color: var(--steel); pointer-events: none; opacity: 0; transform: translate(-50%, 4px); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease); }
.statuspage .st-tip b { font-weight: 700; color: var(--platinum); }
.statuspage .st-day.is-start .st-tip { left: 0; transform: translate(0, 4px); }
.statuspage .st-day.is-end .st-tip { left: auto; right: 0; transform: translate(0, 4px); }
.statuspage .st-day:hover .st-tip, .statuspage .st-day:focus-visible .st-tip { opacity: 1; transform: translate(-50%, 0); }
.statuspage .st-day.is-start:hover .st-tip, .statuspage .st-day.is-start:focus-visible .st-tip, .statuspage .st-day.is-end:hover .st-tip, .statuspage .st-day.is-end:focus-visible .st-tip { transform: none; }
.statuspage .axis { padding-top: 12px; }
.statuspage .st-incidents { margin: 22px 0 0; padding: 0; list-style: none; }
.statuspage .st-incidents li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); }
.statuspage .st-incidents li:last-child { border-bottom: 1px solid var(--line); }
.statuspage .st-incidents .num { font-size: 18px; color: var(--smoke); }
.statuspage .st-incidents .st-pct { color: var(--platinum); }
.statuspage .st-incidents .st-pct.down { color: var(--flare); }
.statuspage .st-sec > .empty { padding-top: 18px; }
.statuspage .st-updated { margin-top: clamp(40px, 5vw, 64px); }

/* ==========================================================================
   ARCADE
   ========================================================================== */
.arcade .arc-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: start; margin-top: 18px; }
.arcade .arc-play { min-width: 0; max-width: 560px; }
.arcade .arc-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.arcade .arc-score .mono { display: block; margin-bottom: 8px; }
.arcade .arc-score .odo { font-size: 46px; }
.arcade .arc-best { text-align: right; }
.arcade .arc-best .num { display: block; font-size: 40px; line-height: 1.1; color: var(--platinum); }

/* the screen: black glass in a chrome bezel */
.arcade .stage { position: relative; display: block; min-height: 0; max-width: 560px; padding: 12px; border-width: 4px; border-radius: 30px; background: linear-gradient(var(--pitch), var(--pitch)) padding-box, var(--chrome-band) border-box; box-shadow: var(--sh-object), 0 1px 0 rgba(255, 255, 255, .1); overflow: visible; perspective: none; }
.arcade .stage::after { content: ""; position: absolute; inset: 12px; border-radius: 16px; box-shadow: inset 0 3px 14px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(246, 242, 239, .08); pointer-events: none; }
.arcade .stage canvas.snake { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; background: var(--glass); touch-action: none; cursor: pointer; }
.arcade .arc-status { min-height: 1.55em; margin-top: 16px; font-size: var(--fs-small); color: var(--steel); }

/* 2048: tiles walk the palette with their value */
.arcade .g2048 { position: relative; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 3%; aspect-ratio: 1; padding: 3%; border-radius: 16px; background: var(--glass); touch-action: none; user-select: none; container-type: inline-size; cursor: default; }
.arcade .g2048 .t { display: grid; place-items: center; min-width: 0; border-radius: 12px; background: var(--pitch); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(246, 242, 239, .05); font-stretch: var(--w-num); font-weight: 900; font-size: 11cqw; line-height: 1; font-variant-numeric: tabular-nums; color: var(--platinum); }
.arcade .g2048 .t.wide { font-size: 8.4cqw; }
.arcade .g2048 .t[class*=" v"] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px -8px #000; }
.arcade .g2048 .v2 { background: linear-gradient(180deg, rgba(246, 242, 239, .07), rgba(246, 242, 239, 0) 60%), var(--glass); box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 14px -8px #000; }
.arcade .g2048 .v4 { background: var(--oxblood); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .1); }
.arcade .g2048 .v8, .arcade .g2048 .v16 { background: var(--velvet); }
.arcade .g2048 .v32, .arcade .g2048 .v64 { background: var(--cherry); color: #fff; }
.arcade .g2048 .v128, .arcade .g2048 .v256 { background: var(--flare); color: var(--on-red); }
.arcade .g2048 .v512, .arcade .g2048 .v1024 { background: var(--blush); color: var(--on-chrome); }
.arcade .g2048 :is(.v2048, .v4096) { background: var(--chrome-soft); color: var(--on-chrome); }
.arcade .g2048 .t.pop { animation: arc-pop var(--t-fast) var(--ease); }
@keyframes arc-pop { from { transform: scale(.84); } }
.arcade .g2048.over .t { opacity: .3; }
.arcade .g2048.over::after { content: "Game over"; position: absolute; inset: 0; display: grid; place-items: center; font-stretch: var(--w-display); font-weight: 900; font-size: 9cqw; letter-spacing: -.04em; color: var(--platinum); }

/* phone d-pad: four chrome knobs */
.arcade .arc-pad { display: none; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 52px); grid-template-areas: ". up ." "left . right" ". down ."; gap: 2px 10px; justify-content: center; place-items: center; margin-top: 8px; }
.arcade .arc-pad .knob { width: 56px; height: 56px; }
.arcade .arc-pad .knob svg { width: 22px; height: 22px; }
.arcade .arc-up { grid-area: up; } .arcade .arc-down { grid-area: down; } .arcade .arc-left { grid-area: left; } .arcade .arc-right { grid-area: right; }
.arcade .arc-down svg { transform: rotate(180deg); } .arcade .arc-left svg { transform: rotate(-90deg); } .arcade .arc-right svg { transform: rotate(90deg); }
@media (max-width: 860px), (pointer: coarse) { .arcade .arc-pad { display: grid; } }

/* right column */
.arcade .arc-side { min-width: 0; padding-top: 6px; }
.arcade .arc-how p { max-width: 30em; margin-top: 14px; color: var(--steel); }
.arcade .arc-top { margin-top: clamp(40px, 5vw, 64px); padding-top: 22px; border-top: 1px solid var(--line-strong); }
.arcade .arc-top .empty { padding-top: 16px; }
.arcade .arc-top ol { margin: 16px 0 0; padding: 0; list-style: none; }
.arcade .arc-top li { display: grid; grid-template-columns: 30px 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 58px; padding: 10px 0; border-top: 1px solid var(--line); }
.arcade .arc-top li:last-child { border-bottom: 1px solid var(--line); }
.arcade .arc-top li.is-me { box-shadow: inset 3px 0 0 var(--cherry); padding-left: 10px; }
.arcade .arc-rank { font-size: 19px; color: var(--smoke); text-align: right; }
.arcade .arc-top img, .arcade .arc-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--oxblood); display: grid; place-items: center; font-weight: 800; color: var(--platinum); }
.arcade .arc-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--platinum); }
.arcade .arc-pts { font-size: 22px; color: var(--platinum); }

/* ==========================================================================
   WEB PLAYER
   ========================================================================== */
.player { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(40px, 6vw, 104px); align-items: start; }
.player .pl-now, .player .pl-side { min-width: 0; }

/* the deck: cover with a chrome record peeking out on the right */
.player .pl-deck { position: relative; width: 70%; aspect-ratio: 16 / 9; margin-bottom: clamp(28px, 3.4vw, 44px); }
.player .pl-cover { position: relative; z-index: 1; width: 100%; height: 100%; overflow: hidden; border-radius: var(--r-panel); background: var(--glass); box-shadow: var(--sh-object), inset 0 0 0 1px var(--line); }
.player .pl-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.player .pl-idle { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(80% 110% at 22% 0%, var(--oxblood) 0%, var(--glass) 62%); box-shadow: inset 0 3px 14px #000; }
.player .pl-idle img { width: 22%; opacity: .5; }
.player .pl-disc { position: absolute; z-index: 0; top: 4%; right: -24%; width: 51.75%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 30.5%, rgba(0, 0, 0, .6) 31% 32.5%, rgba(0, 0, 0, 0) 33%),
    repeating-radial-gradient(circle, rgba(0, 0, 0, .22) 0 1px, rgba(0, 0, 0, 0) 1px 3.5px),
    conic-gradient(from 18deg, #f6f2ef 0%, #948d8b 10%, #2b2223 20%, #c3bbb8 31%, #ffffff 42%, #8c8583 55%, #2b2223 66%, #d6cfcc 80%, #f6f2ef 100%);
  box-shadow: 0 34px 60px -26px #000, inset 0 0 0 2px rgba(255, 255, 255, .3), inset 0 0 0 7px rgba(20, 8, 10, .55);
  animation: pl-spin 4s linear infinite; animation-play-state: paused; }
.player .pl-deck.is-spinning .pl-disc { animation-play-state: running; }
.player .pl-label { position: absolute; inset: 33.5%; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #ff3a3f 0%, var(--cherry) 52%, #b20c22 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.player .pl-label img { width: 46%; opacity: .92; }
.player .pl-label::after { content: ""; position: absolute; width: 7%; aspect-ratio: 1; border-radius: 50%; background: var(--pitch); }
@keyframes pl-spin { to { transform: rotate(360deg); } }

.player .pl-where { margin-bottom: 12px; }
.player .pl-title { font-size: clamp(30px, 3.5vw, 52px); line-height: .98; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: .06em; }
.player .pl-title a { text-decoration: none; transition: color var(--t-fast); }
.player .pl-title a:hover { color: var(--blush); }
.player .pl-sub { max-width: 34em; margin-top: 14px; font-size: var(--fs-lede); color: var(--steel); }
.player .pl-sub code { font-size: 1em; }
.player .pl-err { color: var(--flare); }
.player .pl-now > .cta { margin-top: 28px; }
.player .pl-bar { margin-top: 26px; cursor: pointer; }
.player .pl-bar > i { transition: width .5s linear; }
.player .pl-bar:focus-visible { outline-offset: 4px; }
.player .pl-times { display: flex; justify-content: space-between; padding-top: 10px; }
.player .pl-times .num { font-size: 17px; color: var(--steel); }
.player .pl-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 18px; }
.player .pl-transport .knob svg { width: 18px; height: 18px; }
.player .pl-play { width: 64px; height: 64px; }
.player .pl-transport .pl-play svg { width: 26px; height: 26px; }
.player .pl-gap { flex: 1 1 12px; }
.player .pl-transport .btn[aria-pressed="true"] { background: var(--chrome-soft); border-color: rgba(255, 255, 255, .6); color: var(--on-chrome); }
.player .pl-knobs { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px 28px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.player .pl-knobs label { min-width: 0; }
.player .pl-volrow { display: flex; align-items: center; gap: 14px; min-height: var(--h-control); }
.player .pl-volrow .num { min-width: 3.4em; font-size: 18px; color: var(--platinum); text-align: right; }
.player .pl-note { margin-top: 18px; font-size: var(--fs-small); color: var(--steel); }

/* right column: add a song, up next */
.player .pl-side { padding-top: 4px; }
.player .pl-add { display: flex; gap: 10px; margin-bottom: 36px; }
.player .pl-add .input { flex: 1 1 auto; }
.player .pl-h2 { display: flex; align-items: baseline; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.player .pl-h2 .num { font-size: 22px; letter-spacing: 0; color: var(--smoke); }
.player .pl-side .empty { padding-top: 14px; max-width: 30em; }
.player .pl-queue { margin: 16px 0 0; padding: 0; list-style: none; }
.player .pl-queue li { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 0; border-top: 1px solid var(--line); }
.player .pl-queue li:last-child { border-bottom: 1px solid var(--line); }
.player .pl-queue img, .player .pl-ph { flex: none; width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--oxblood); }
.player .pl-t { flex: 1 1 auto; min-width: 0; }
.player .pl-t b, .player .pl-t small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .pl-t b { font-size: 15.5px; color: var(--platinum); }
.player .pl-t small { font-size: 13.5px; color: var(--smoke); }
.player .pl-queue .knob svg { width: 14px; height: 14px; }
.player .pl-more { margin-top: 12px; font-size: var(--fs-small); color: var(--smoke); }

/* ==========================================================================
   breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .cmdpage .cmd-group { grid-template-columns: minmax(0, 1fr); }
  .cmdpage .cmd-mod { position: static; padding-bottom: 6px; }
  .arcade .arc-grid { grid-template-columns: minmax(0, 1fr); }
  .arcade .arc-play { width: 100%; }
  .player { grid-template-columns: minmax(0, 1fr); }
  .player .pl-deck { width: 74%; max-width: 640px; }
}
@media (max-width: 900px) {
  .cmdpage .cmd summary { grid-template-columns: minmax(0, 1fr) auto 18px; gap: 4px 14px; }
  .cmdpage .cmd-desc { grid-column: 1; grid-row: 2; font-size: 14.5px; }
  .cmdpage .cmd summary > .tag, .cmdpage .cmd summary > span:empty { grid-column: 2; grid-row: 1; }
  .cmdpage .cmd-plus { grid-column: 3; grid-row: 1; }
  .cmdpage .cmd-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "use" "opts" "ex" "foot"; }
  .lbpage .lb-list li { grid-template-columns: 40px 44px minmax(0, 1fr) auto; gap: 14px; }
  .lbpage .lb-list .lb-lvl { display: none; }
}
@media (max-width: 760px) {
  :is(.cmdpage, .lbpage, .statuspage, .arcade) .pagehead { padding-bottom: 28px; }
  :is(.cmdpage .cmd-total, .statuspage .st-total) { flex-direction: row; align-items: baseline; gap: 12px; text-align: left; }
  :is(.cmdpage .cmd-total, .statuspage .st-total) .stat { font-size: 64px; }
  :is(.cmdpage .cmd-total, .statuspage .st-total) span { margin-top: 0; }
  .cmdpage .cmd-tools { padding-top: 10px; }
  .cmdpage .cmd-count { display: none; }
  .cmdpage .cmd-tools .search { max-width: none; }
  .cmdpage .cmd-filters { padding: 10px 0 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .cmdpage .cmd-filters .knob { display: none; }
  .cmdpage .cmd-name { font-size: 18px; }
  .cmdpage .cmd summary { min-height: 56px; padding-block: 11px; }

  .lbpage .ph-slot { flex: 1 1 100%; }
  .lbpage .ph-slot .search { width: 100%; max-width: none; }
  /* podium becomes three rows, same materials, first place larger */
  .lbpage .lb-podium, .lbpage .lb-podium.n1, .lbpage .lb-podium.n2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "p1" "p2" "p3"; max-width: none; gap: 10px; margin: 18px 0 36px; border-bottom: 0; }
  .lbpage .lb-pod { flex-direction: row; align-items: center; gap: 14px; text-align: left; }
  .lbpage .lb-plinth { order: -1; flex: none; width: 64px; height: 76px !important; align-content: center; border-radius: 18px; border-bottom-width: 2px; }
  .lbpage .p1 .lb-plinth { width: 84px; height: 108px !important; border-bottom-width: 3px; border-radius: 22px; }
  .lbpage .lb-plinth .stat { padding-top: 0; font-size: 64px; }
  .lbpage .p1 .lb-plinth .stat { padding-top: 0; font-size: 96px; }
  .lbpage .lb-pod-who { flex-direction: row; gap: 12px; padding: 0; min-width: 0; }
  .lbpage .lb-pod-av { width: 52px; height: 52px; }
  .lbpage .p1 .lb-pod-av { width: 68px; height: 68px; }
  .lbpage .p1 .lb-ring { padding: 4px; }
  .lbpage .lb-pod-text { align-items: flex-start; gap: 1px; }
  .lbpage .lb-pod-name, .lbpage .p1 .lb-pod-name { font-size: 18px; }
  .lbpage .lb-pod-handle { font-size: 13px; }
  .lbpage .lb-pod-big { margin-top: 4px; font-size: 22px; }
  .lbpage .p1 .lb-pod-big { font-size: 28px; }
  .lbpage .lb-pod-small { display: none; }
  .lbpage .lb-list li { grid-template-columns: 26px 40px minmax(0, 1fr) auto; gap: 12px; padding: 10px 4px; min-height: 62px; }
  .lbpage .lb-rank { font-size: 18px; }
  .lbpage .lb-av { width: 40px; height: 40px; }
  .lbpage .lb-val { font-size: 19px; }
  .lbpage .lb-val small { display: none; }

  .statuspage .st-figures b { font-size: 44px; }
  .statuspage .st-day > i { width: max(5px, 62%); }
  .statuspage .st-incidents li { grid-template-columns: 74px minmax(0, 1fr) auto; gap: 12px; }

  .arcade .arc-score .odo { font-size: 36px; }
  .arcade .arc-best .num { font-size: 32px; }
  .arcade .stage { padding: 8px; border-width: 3px; border-radius: 24px; }
  .arcade .stage::after { inset: 8px; border-radius: 14px; }
  .arcade .stage canvas.snake, .arcade .g2048 { border-radius: 14px; }
  .arcade .g2048 .t { border-radius: 9px; }
  .arcade .arc-status { text-align: center; }

  .player .pl-deck { width: 76%; }
  .player .pl-knobs { grid-template-columns: minmax(0, 1fr); }
  .player .pl-transport { gap: 12px; }
  .player .pl-gap { flex-basis: 100%; height: 0; }
  .player .pl-add { flex-direction: column; }
  .player .pl-add .btn { width: 100%; }
}

/* reduced motion: nothing turns or slides by itself */
@media (prefers-reduced-motion: reduce) {
  .player .pl-disc, .player .pl-deck.is-spinning .pl-disc { animation: none; }
  .player .pl-bar > i { transition: none; }
  .statuspage .st-dot.live { animation: none; }
  .cmdpage .cmd-name { transition: none; }
}

/* base fix, scoped: hovering the selected pill must keep its dark type on chrome */
.cmdpage .filters [aria-pressed="true"]:hover { color: var(--on-chrome); }
