/* brb fixing it (Xennials will save the world) — site styles ("Now" era = J4M5 home base).
   Other decades live in eras.css and override these through html[data-era]. */

/* ---------- Utilities ---------- */
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
section[id] { scroll-margin-top: 92px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; top: -64px; left: 12px; z-index: 100; transition: top .15s; }
.skip-link:focus-visible { top: 12px; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.section { padding-block: 80px; }
.eyebrow { color: var(--gem-sapphire-deep); margin: 0 0 10px; }
.section-title { margin: 0 0 12px; font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.section-lede { margin: 0 0 34px; max-width: 64ch; font-size: 17px; color: var(--muted-foreground); }
p { text-wrap: pretty; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline 2px var(--overprint); text-underline-offset: 4px; }
.linkish:hover { text-decoration-color: currentColor; }
.marker { font-family: var(--font-marker); font-weight: 400; letter-spacing: 0; text-transform: none; }
.field-row { display: grid; gap: 6px; }
.field-row > label, .field-row > div > label { font-weight: 650; font-size: 14px; }
.field-row.two { grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.two > div { display: grid; gap: 6px; }

/* ---------- P-meter (scroll progress) ---------- */
.pmeter { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 60; display: flex; gap: 3px; padding: 0 3px; pointer-events: none; }
.pmeter span { flex: 1; background: var(--gem-sapphire); opacity: .12; clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%); transition: opacity .2s; }
.pmeter span.on { opacity: .85; }
.pmeter b { width: 16px; font: 700 6px/6px var(--font-pixel); color: transparent; background: var(--gem-ruby); opacity: .15; border-radius: 1px; }
.pmeter.full b { opacity: 1; animation: p-blink .3s steps(2) infinite; }
@keyframes p-blink { 50% { opacity: .2; } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; white-space: nowrap; margin-top: 6px; padding: 5px 0; font: 600 12px/1.4 var(--font-slab); letter-spacing: .1em; text-transform: uppercase; color: var(--gem-sapphire-deep); border-block: 1px dashed var(--border); }
.marquee-track { display: inline-flex; gap: 42px; padding-left: 100%; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
html.no-marquee .marquee-track { animation: none; padding-left: 20px; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 10px; z-index: 50; }
.site-head .j-nav { position: relative; top: 0; margin-top: 8px; gap: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); padding: 6px 10px; border-radius: var(--shape-pill); text-decoration: none; flex: none; }
.brand:hover { background: var(--background); box-shadow: 2px 3px 0 var(--overprint); }
.brand-floppy { color: var(--gem-sapphire); }
.brand-word { font: 700 15px/1 var(--font-sans); letter-spacing: -0.01em; white-space: nowrap; }
.away-dot { font: 700 9px/1 var(--font-sans); text-transform: uppercase; letter-spacing: .08em; background: var(--gem-topaz); color: var(--on-bright); padding: 3px 6px; border-radius: 99px; }
.nav-links { display: flex; gap: 0; margin-inline: auto; }
.nav-links a { padding: 8px 10px; font-size: 13.5px; }
.era-chip { flex: none; font-family: var(--font-slab); letter-spacing: .06em; gap: 4px; }
#theme-toggle { flex: none; }
#theme-toggle .icon-sun { display: none; }
#theme-toggle[data-mode="dark"] .icon-sun { display: block; }
#theme-toggle[data-mode="dark"] .icon-moon { display: none; }

/* ---------- Voice split: Gen X dry / Millennial cringe ---------- */
.voice { display: grid; gap: 6px; margin: 0; font-size: 14px; line-height: 1.45; }
.voice span { display: block; padding: 7px 12px; border-radius: var(--shape-control); }
.voice b { font-family: var(--font-slab); text-transform: uppercase; letter-spacing: .07em; font-size: 11px; margin-right: 4px; }
.voice-x { background: var(--mineral-stone-100); color: var(--foreground); box-shadow: inset 3px 0 0 var(--mineral-stone-500); }
.voice-m { background: color-mix(in oklch, var(--gem-amethyst-light) 55%, var(--background)); color: var(--foreground); box-shadow: inset 3px 0 0 var(--gem-amethyst-glow); }
.voice-m b { color: var(--gem-amethyst-deep); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 44px; align-items: center; padding-top: 52px; padding-bottom: 24px; }
.hero-title { margin: 0 0 10px; font-size: clamp(56px, 9vw, 116px); line-height: .92; max-width: 10ch; letter-spacing: -0.03em; }
.hero-title { text-transform: none; }
.hero-title .ht-2 { color: var(--gem-sapphire); white-space: nowrap; }
.im-caret { display: inline-block; width: .08em; height: .78em; margin-left: .06em; vertical-align: -0.04em; background: currentColor; animation: p-blink 1.05s steps(2) infinite; }
.hero-tagline { margin: 0 0 22px; font: 600 clamp(22px, 2.6vw, 30px)/1.2 var(--font-display); font-variation-settings: "SOFT" 100; letter-spacing: -0.01em; }
.hero-tagline span { display: block; font: 500 16px/1.4 var(--font-slab); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); margin-top: 6px; }
.hero-title span { display: inline-block; }
.hero-voice { margin-bottom: 20px; max-width: 56ch; }
.lede { margin: 0 0 26px; max-width: 58ch; font-size: 18px; line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }

.tuner { border: 0; margin: 0 0 24px; padding: 0; max-width: 560px; }
.tuner legend { padding: 0; margin-bottom: 8px; color: var(--muted-foreground); font-size: 12px; }
.tuner-dial { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px; gap: 4px; border-radius: var(--shape-tile);
  background: linear-gradient(var(--ink), var(--ink)) 8px calc(100% - 15px) / calc(100% - 16px) 1px no-repeat, var(--mineral-stone-100); box-shadow: inset 0 2px 0 oklch(0 0 0 / .06), inset 0 0 0 1px var(--border); }
.tuner-dial label { position: relative; display: grid; justify-items: center; gap: 1px; padding: 8px 2px 20px; cursor: pointer; border-radius: var(--shape-control); text-align: center; }
.tuner-dial input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.tuner-dial label::after { content: ""; position: absolute; bottom: 9px; width: 1px; height: 9px; background: var(--ink); opacity: .6; }
.tuner-year { font: 600 15px/1.1 var(--font-slab); letter-spacing: .04em; }
.tuner-name { font-size: 11px; color: var(--muted-foreground); line-height: 1.2; }
.tuner-dial label:has(input:checked) { background: var(--background); box-shadow: 2px 3px 0 var(--overprint); }
.tuner-dial label:has(input:checked) .tuner-year { color: var(--gem-ruby); }
.tuner-dial label:has(input:focus-visible) { outline: 3px solid var(--ring); outline-offset: 2px; }
.tuner-needle { position: absolute; bottom: 6px; width: 3px; height: 18px; border-radius: 2px; background: var(--gem-ruby); left: calc(8px + (100% - 16px) * var(--needle, .9)); transition: left .45s cubic-bezier(.3, 1.4, .5, 1); box-shadow: 0 0 6px var(--gem-ruby-glow); }
.tuner-hint { margin: 8px 0 0; }

.dispatch { display: grid; gap: 6px; padding: 16px 20px; border-radius: var(--shape-tile); --surface: var(--mineral-sand-100); max-width: 58ch; box-shadow: inset 0 0 0 1px var(--border); }
.dispatch-tag { color: var(--gem-topaz-deep); font-size: 11px; }
.dispatch p { margin: 0; font-size: 14.5px; line-height: 1.5; }

.hero-art { position: relative; min-height: 520px; }
.crt { position: absolute; top: 20px; right: 0; width: min(400px, 100%); z-index: 2; }
.crt-bezel { padding: 22px 22px 10px; border-radius: 26px 26px 18px 18px; background: linear-gradient(170deg, var(--mineral-stone-100), var(--mineral-stone-300)); box-shadow: inset 0 0 0 1.5px var(--border), 6px 8px 0 var(--overprint); }
.crt-screen { position: relative; aspect-ratio: 4 / 3.3; border-radius: 18px / 22px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #12241a, #050a07 80%); box-shadow: inset 0 0 30px oklch(0 0 0 / .9), inset 0 0 0 3px #222; }
.crt-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, oklch(0 0 0 / .22) 2px 3px); mix-blend-mode: multiply; }
.bbs { margin: 0; padding: 14px 16px; height: 100%; font: 16px/1.12 var(--font-term); color: #7dff9b; text-shadow: 0 0 6px #2bff6a99; white-space: pre; overflow: hidden; }
.bbs .caret { animation: p-blink 1s steps(2) infinite; }
.crt-connect { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 8px 10px; border: 1px solid #7dff9b88; border-radius: 6px; background: #071b0ecc; color: #a9ffbd; font: 17px/1 var(--font-term); cursor: pointer; text-align: left; }
.crt-connect:hover, .crt-connect:focus-visible { background: #7dff9b; color: #031007; }
.crt-chin { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 2px; }
.crt-led { width: 9px; height: 9px; border-radius: 50%; background: var(--gem-emerald); box-shadow: 0 0 6px var(--gem-emerald-glow); }
.crt-led.busy { background: var(--gem-topaz); animation: p-blink .25s steps(2) infinite; }
.crt-brand { font: 600 10px/1 var(--font-slab); letter-spacing: .2em; color: var(--muted-foreground); }
.crt-stand { width: 46%; height: 26px; margin: -2px auto 0; border-radius: 0 0 16px 16px / 0 0 12px 12px; background: var(--mineral-stone-300); box-shadow: inset 0 0 0 1.5px var(--border); }
.floppy { position: absolute; left: 0; bottom: 30px; z-index: 3; width: 150px; aspect-ratio: 1; border-radius: 6px 14px 6px 6px; background: linear-gradient(160deg, #3a4a7a, #1f2a52); box-shadow: 4px 5px 0 var(--ink); }
.floppy-shutter { position: absolute; top: 0; left: 30%; width: 44%; height: 34%; background: linear-gradient(90deg, #c7ccd6, #eef0f4 50%, #b9bec9); border-radius: 0 0 3px 3px; }
.floppy-shutter::after { content: ""; position: absolute; top: 18%; right: 14%; width: 22%; height: 60%; background: #1f2a52; }
.floppy-label { position: absolute; left: 10%; right: 10%; bottom: 8%; height: 44%; padding: 7px 8px; background: #fbfaf4; border-radius: 3px; font: 16px/1 var(--font-marker); color: #1f2a52; transform: rotate(-1deg); }
.floppy-label small { font: 600 8.5px/1.3 var(--font-sans); letter-spacing: .04em; color: #555; }
.cdr { position: absolute; right: 16px; bottom: 0; z-index: 1; width: 170px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, transparent 0 13%, #d8dbe0 13% 15%, transparent 15%), conic-gradient(from 20deg, #c9f0ff, #f6d4ff, #fff6c4, #c9ffe0, #c9f0ff, #f6d4ff, #fff6c4, #c9f0ff);
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / .15), 4px 5px 0 var(--ink); }
.cdr-hole { position: absolute; inset: 44%; border-radius: 50%; background: var(--background); box-shadow: inset 0 0 0 1px oklch(0 0 0 / .2); }
.cdr-ink { position: absolute; top: 18%; left: 0; right: 0; text-align: center; font: 18px/1 var(--font-marker); color: #1b1b1b; transform: rotate(-12deg); }
.hero-sticker-1 { position: absolute; top: 0; left: 4%; z-index: 4; background: var(--gem-topaz); color: var(--on-bright); }
.hero-sticker-2 { position: absolute; bottom: 4px; left: 32%; z-index: 4; background: var(--gem-sapphire); color: var(--on-gem); font-size: 11px; }

/* ---------- Window chrome ---------- */
.win { border-radius: var(--shape-card); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--border), 6px 8px 0 var(--overprint); overflow: hidden; }
.win-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--gem-sapphire); color: var(--on-gem); }
.win-icon { font-size: 14px; }
.win-title { flex: 1; font: 600 13px/1 var(--font-slab); letter-spacing: .08em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btns { display: flex; gap: 6px; }
.win-btns i { display: grid; place-items: center; width: 20px; height: 18px; font: 700 11px/1 var(--font-sans); font-style: normal; border-radius: 6px; background: oklch(1 0 0 / .2); }
.win-menu { display: flex; gap: 16px; padding: 6px 14px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
.win-body { padding: 26px; }
.win-status { display: flex; gap: 24px; justify-content: flex-end; padding: 6px 14px; font-size: 11.5px; color: var(--muted-foreground); border-top: 1px solid var(--border); }

/* ---------- Manifesto ---------- */
.case-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "a q1" "b c" "q2 d"; gap: 26px; align-items: stretch; }
.case-item { display: grid; gap: 10px; align-content: start; }
.case-item:nth-of-type(1) { grid-area: a; } .case-item:nth-of-type(2) { grid-area: b; }
.case-item:nth-of-type(3) { grid-area: c; } .case-item:nth-of-type(4) { grid-area: d; }
.case-num { color: var(--muted-foreground); font-size: 12px; }
.case-card { margin: 0; --surface: var(--background); }
.case-card h3 { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -0.01em; }
.case-card p { margin: 0; max-width: 62ch; font-size: 15px; line-height: 1.6; }
.case-quote { display: grid; align-content: center; gap: 18px; padding: 20px; justify-items: start; }
.case-quote:nth-of-type(1) { grid-area: q1; } .case-quote-2 { grid-area: q2; }
.pull { margin: 0; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; max-width: 14ch; }
.case-quote .j-sticker { background: var(--gem-sapphire); color: var(--on-gem); }
.case-quote-2 .j-sticker { background: var(--gem-topaz); color: var(--on-bright); }
.sysprops { margin-top: 32px; padding: 18px 20px; border-radius: var(--shape-tile); background: var(--mineral-fog-100); box-shadow: inset 0 0 0 1px var(--border); }
.sysprops > .j-slab { margin: 0 0 10px; font-size: 12px; color: var(--gem-tourmaline-deep); }
.sysprops dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 26px; }
.sysprops dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--border); font-size: 14px; }
.sysprops dt { color: var(--muted-foreground); }
.sysprops dd { margin: 0; font-weight: 650; text-align: right; }
.term-note { margin-top: 30px; --surface: var(--mineral-sand-100); max-width: 92ch; }
.term-note span { line-height: 1.55; }

/* ---------- Profile / Top 8 ---------- */
.profile { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 26px; align-items: start; }
.profile-side, .profile-main { display: grid; gap: 22px; }
.profile-card { padding: 20px; border-radius: var(--shape-card); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.profile-name { margin: 0 0 12px; font: 800 26px/1 var(--font-sans); letter-spacing: -0.02em; }
.profile-id { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.profile-pic { aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--shape-tile); background: var(--gem-topaz-light); box-shadow: 3px 4px 0 var(--ink); }
.mini-cassette { width: 88%; padding: 8px; gap: 0; }
.mini-cassette .cassette-window { padding: 6px 8px; }
.mini-cassette .reel { width: 24px; height: 24px; }
.mini-cassette .spoke { inset: 6px; }
.profile-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.online { font-weight: 700; color: var(--gem-emerald-deep); display: flex; align-items: center; gap: 6px; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gem-emerald); box-shadow: 0 0 0 3px var(--gem-emerald-light); animation: p-blink 1.4s steps(2) infinite; }
.profile-mood, .profile-view { margin: 12px 0 0; font-size: 13.5px; }
.profile-box { border-radius: var(--shape-tile); overflow: hidden; background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.profile-box-head { margin: 0; padding: 9px 14px; font: 650 14px/1.2 var(--font-sans); background: var(--gem-topaz-light); color: var(--gem-topaz-deep); }
.profile-box > :not(.profile-box-head):not(table):not(.comment) { margin-inline: 16px; }
.interests { width: 100%; border-collapse: collapse; font-size: 13px; }
.interests th { width: 30%; padding: 9px 10px 9px 14px; vertical-align: top; text-align: left; font-weight: 700; background: var(--mineral-sand-100); color: var(--gem-topaz-deep); border-bottom: 1px solid var(--border); }
.interests td { padding: 9px 14px 9px 10px; line-height: 1.45; border-bottom: 1px solid var(--border); }
.blurbs p { font-size: 14.5px; line-height: 1.55; margin-block: 12px; }
.friend-count { margin: 12px 0 10px; font-size: 14px; }
.fame-rail { display: flex; gap: 4px; padding: 5px; border-radius: var(--shape-pill); overflow-x: auto; scrollbar-width: thin; background: var(--mineral-stone-100); }
.fame-rail button { border: 0; background: transparent; padding: 8px 14px; border-radius: var(--shape-pill); font: 600 13.5px var(--font-sans); color: var(--muted-foreground); cursor: pointer; white-space: nowrap; }
.fame-rail button:hover { color: var(--foreground); }
.fame-rail button[aria-selected="true"] { background: var(--background); color: var(--foreground); box-shadow: 2px 3px 0 var(--overprint); }
.fame-count { margin: 10px 2px 12px; }
.friend-grid { list-style: none; margin: 0 16px 6px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.friend-btn { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border: 0; background: transparent; border-radius: var(--shape-tile); cursor: pointer; color: var(--foreground); font: inherit; }
.friend-btn:hover { background: var(--muted); }
.friend-btn[aria-pressed="true"] { background: var(--accent); box-shadow: 2px 3px 0 var(--overprint); }
.friend-name { font-size: 13px; font-weight: 700; line-height: 1.2; text-align: center; color: var(--primary); text-decoration: underline 1.5px var(--overprint); text-underline-offset: 3px; }
.friend-born { font-size: 11.5px; color: var(--muted-foreground); }
.friend-tom { margin: 6px 16px 14px; font-style: italic; }
.pix { display: grid; place-items: center; width: 72px; aspect-ratio: 1; border-radius: 10px; background: var(--gem-sapphire-light); color: var(--gem-sapphire-deep); font: 14px/1 var(--font-pixel); box-shadow: 2px 3px 0 var(--ink); overflow: hidden; image-rendering: pixelated; }
.pix canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.pix-lg { width: 84px; flex: none; }
.comment { display: flex; gap: 16px; padding: 16px; }
html.js .comment:not(.on) { display: none; }
.comment-body { display: grid; gap: 8px; align-content: start; }
.comment-head { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 16px; }
.comment-body p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.fame-src { color: var(--muted-foreground); font-size: 11.5px; text-decoration: none; }
.fame-src:hover { color: var(--primary); text-decoration: underline; }

/* ---------- World map ---------- */
.map-section { background:
    radial-gradient(circle at 92% 22%, color-mix(in oklch, var(--gem-emerald-light) 50%, transparent) 0 70px, transparent 71px),
    radial-gradient(circle at 88% 60%, color-mix(in oklch, var(--gem-emerald-light) 50%, transparent) 0 90px, transparent 91px),
    linear-gradient(var(--mineral-sand-100), var(--mineral-sand-100));
  border-block: 2px solid var(--ink); }
.mini-tile { display: inline-grid; place-items: center; width: 20px; height: 20px; font: 9px/1 var(--font-pixel); vertical-align: -3px; border-radius: 4px; background: var(--gem-topaz); color: var(--ink); box-shadow: 1px 2px 0 var(--ink); }
.map { display: grid; gap: 34px; }
.world-banner { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 18px; padding: 12px 18px; background: #1d222b; color: #efeee9; border-radius: 6px; box-shadow: 4px 5px 0 var(--gem-sapphire-glow); }
.world-num { font: 13px/1 var(--font-pixel); color: #f2c14e; }
.world-name { font: 700 18px/1.2 var(--font-sans); }
.world-span { font-size: 13px; opacity: .8; }
.path { list-style: none; margin: 0; padding: 0 0 0 30px; display: grid; gap: 14px; position: relative; }
.path::before { content: ""; position: absolute; left: 47px; top: 10px; bottom: 10px; width: 8px; background: repeating-linear-gradient(var(--gem-topaz) 0 10px, var(--mineral-sand-300) 10px 16px); border-radius: 4px; }
.stop { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; align-items: start; }
.tile { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; font: 13px/1 var(--font-pixel); color: var(--ink); background: var(--paper); border-radius: 8px; box-shadow: inset 0 0 0 3px var(--ink), 3px 4px 0 var(--ink); }
.stop-bonus .tile { background: var(--gem-topaz); animation: tile-bob 1.6s ease-in-out infinite; }
.stop-fortress .tile { background: var(--mineral-stone-700); color: var(--paper); font-size: 16px; }
.stop-castle .tile { background: var(--gem-ruby); color: var(--paper); font-size: 16px; }
@keyframes tile-bob { 50% { transform: translateY(-3px); } }
.stop-card { padding: 12px 16px; border-radius: var(--shape-tile); background: var(--background); box-shadow: inset 0 0 0 1px var(--border), 2px 3px 0 var(--overprint); max-width: 78ch; }
.stop-year { display: block; margin-bottom: 3px; font-size: 12px; color: var(--gem-sapphire-deep); }
.stop-card p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.stop-bonus .stop-card { background: color-mix(in oklch, var(--gem-topaz-light) 55%, var(--background)); }
.stop-fortress .stop-card, .stop-castle .stop-card { background: var(--gem-sapphire-light); box-shadow: inset 0 0 0 2px var(--ink), 4px 5px 0 var(--ink); }
.stop-fortress .stop-card p { font-size: 17px; font-weight: 650; }
.world-3 .world-banner { box-shadow: 4px 5px 0 var(--gem-ruby-glow); }
.map-end { justify-self: start; padding: 20px 24px; border-radius: var(--shape-card); background: #1d222b; color: #efeee9; box-shadow: 6px 8px 0 var(--gem-topaz); }
.map-end .j-slab { color: #f2c14e; }
.map-end p { margin: 6px 0 0; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.2; }

/* ---------- Scantron ---------- */
.scantron { --scan: oklch(0.62 0.13 20); --scan-light: oklch(0.95 0.025 30); --scan-mid: oklch(0.86 0.06 25);
  position: relative; border-radius: 10px; background: var(--scan-light); color: oklch(0.3 0.04 20); box-shadow: inset 0 0 0 2px var(--scan), 6px 8px 0 var(--ink); overflow: hidden; }
.scan-head { display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; align-items: center; padding: 18px 22px 18px 44px; border-bottom: 2px solid var(--scan); }
.scan-brand { display: grid; }
.scan-title { font: 700 20px/1.1 var(--font-sans); letter-spacing: .04em; color: var(--scan); }
.scan-sub { font: 700 11px/1.4 var(--font-sans); letter-spacing: .12em; }
.scan-year { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-self: end; }
.scan-year label { font: 700 12px/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; }
.scan-input { width: 120px; height: 42px; padding: 0 12px; border: 2px solid var(--scan); border-radius: 4px; background: #fffdfb; color: #222; font: 22px/1 var(--font-term); letter-spacing: .3em; }
.scan-input:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.scan-year .j-error { flex-basis: 100%; margin: 0; text-align: right; }
.scan-marks { position: absolute; left: 10px; top: 0; bottom: 0; display: grid; align-content: space-around; padding-block: 10px; }
.scan-marks i { display: block; width: 18px; height: 6px; background: #1b1b1b; }
.cred-result { display: grid; gap: 8px; justify-items: start; margin: 0; padding: 16px 22px 16px 44px; border-bottom: 2px solid var(--scan); background: #fffdfb; }
.cred-result p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #2a2a2a; }
.cred-result .j-sticker { font-size: 12px; }
.cred-sticker-yes { background: var(--gem-emerald); color: var(--on-gem); }
.cred-sticker-cusp { background: var(--gem-topaz); color: var(--on-bright); }
.cred-sticker-no { background: var(--secondary); color: var(--secondary-foreground); }
.scan-body { padding: 18px 22px 22px 44px; }
.scan-qs { margin: 0; padding: 0; list-style: none; counter-reset: q; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 34px; }
.scan-q { counter-increment: q; padding: 10px 0; border-bottom: 1px solid var(--scan-mid); }
.scan-q > p { margin: 0 0 8px; font-weight: 700; font-size: 14.5px; line-height: 1.35; color: #3a1f1f; }
.scan-q > p::before { content: counter(q) ". "; color: var(--scan); }
.scan-opts { display: grid; gap: 5px; border: 0; margin: 0; padding: 0; }
.scan-opt { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; line-height: 1.35; color: #2a2a2a; }
.scan-opt input { position: absolute; opacity: 0; }
.bubble { display: grid; place-items: center; width: 28px; height: 18px; border-radius: 50%; border: 1.5px solid var(--scan); font: 700 9.5px/1 var(--font-sans); color: var(--scan); background: #fffdfb; transition: background .12s; }
.scan-opt input:checked + .bubble { background: #26262a; border-color: #26262a; color: transparent; box-shadow: inset 0 0 0 2px #3a3a40; }
.scan-opt input:focus-visible + .bubble { outline: 3px solid var(--ring); outline-offset: 2px; }
.scan-opt:hover .bubble { background: var(--scan-mid); }
.scan-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.scan-foot .j-hint { color: #6a4a4a; }
.printout { padding: 18px 22px 24px 44px; background: repeating-linear-gradient(90deg, transparent 0 20px, oklch(0 0 0 / .03) 20px 21px); }
.printout-paper { position: relative; max-width: 620px; padding: 22px 48px; background: repeating-linear-gradient(#fbfbf6 0 24px, #e5f2e4 24px 48px); color: #1d1d1d; box-shadow: 0 2px 0 oklch(0 0 0 / .1), 4px 5px 0 var(--ink); outline: none;
  -webkit-mask: radial-gradient(circle 5px at 18px 12px, transparent 98%, #000) 0 0 / 100% 24px, radial-gradient(circle 5px at calc(100% - 18px) 12px, transparent 98%, #000) 0 0 / 100% 24px; -webkit-mask-composite: source-in; mask-composite: intersect;
  mask: radial-gradient(circle 5px at 18px 12px, transparent 98%, #000) 0 0 / 100% 24px, radial-gradient(circle 5px at calc(100% - 18px) 12px, transparent 98%, #000) 0 0 / 100% 24px; }
.printout.printing .printout-paper { animation: feed 1.6s steps(16) both; }
@keyframes feed { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.printout-text { margin: 0; font: 19px/24px var(--font-term); white-space: pre-wrap; }
.printout-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Mixtape ---------- */
.mix-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding: 12px 18px; border-radius: var(--shape-tile); background: var(--gem-amethyst-light); color: var(--gem-amethyst-deep); box-shadow: 3px 4px 0 var(--ink); }
.mix-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 34px; align-items: start; }
.tv { padding: 20px 20px 14px; border-radius: 28px 28px 20px 20px; background: linear-gradient(170deg, #4a4642, #2a2725); box-shadow: inset 0 0 0 2px #00000055, 6px 8px 0 var(--overprint); }
.tv-screen { position: relative; aspect-ratio: 16 / 10.5; border-radius: 22px / 28px; overflow: hidden; background: #0b0b0b; box-shadow: inset 0 0 0 3px #111, inset 0 0 40px #000; }
.tv-player, .tv-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-poster { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; border: 0; cursor: pointer; background: #111; color: #fff; padding: 0; }
.tv-static { position: absolute; inset: 0; opacity: .5; background-image: var(--grain); background-size: 120px 120px; animation: static .25s steps(4) infinite; filter: grayscale(1) contrast(2.2) brightness(1.4); }
@keyframes static { 25% { background-position: 30px 60px; } 50% { background-position: 80px 10px; } 75% { background-position: 10px 90px; } }
.tv-osd { position: absolute; top: 14px; right: 20px; font: 26px/1 var(--font-term); color: #6dff7d; text-shadow: 0 0 6px #6dff7d; }
.tv-press { position: relative; font: 36px/1 var(--font-term); letter-spacing: .08em; padding: 6px 16px; background: #0008; text-shadow: 0 0 8px #fff8; }
.tv-note { position: relative; font-size: 12px; background: #0008; padding: 2px 8px; }
.tv-poster:hover .tv-press, .tv-poster:focus-visible .tv-press { background: var(--gem-sapphire); }
.tv-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 0; }
.vcr-clock { font: 26px/1 var(--font-term); color: #5dff8a; background: #091109; padding: 4px 10px; border-radius: 4px; box-shadow: inset 0 0 0 1px #1f3a22; text-shadow: 0 0 6px #5dff8a88; }
.vcr-clock.blink { animation: p-blink 1s steps(2) infinite; }
.vcr-btns { display: flex; gap: 8px; }
.vcr { min-width: 44px; height: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: linear-gradient(#d9d6d0, #a9a59e); color: #222; font-size: 15px; cursor: pointer; box-shadow: inset 0 -3px 0 #0003, 0 2px 0 #0006; }
.vcr:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 #0003; }
.now-playing { margin-top: 18px; padding: 16px 18px; border-radius: var(--shape-tile); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.now-playing .j-slab { font-size: 11px; color: var(--gem-ruby); }
.now-playing p { margin: 4px 0 0; }
#now-title { font-weight: 750; font-size: 17px; }
.now-note { font-size: 14px; color: var(--muted-foreground); }
.now-links { font-size: 13px; }
.now-links a { margin-right: 12px; }

.format-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.format-pick label { position: relative; cursor: pointer; }
.format-pick input { position: absolute; opacity: 0; }
.format-pick span { display: grid; gap: 2px; padding: 10px; border-radius: var(--shape-control); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); font-weight: 700; font-size: 14px; text-align: center; height: 100%; }
.format-pick small { font-weight: 500; font-size: 11.5px; color: var(--muted-foreground); }
.format-pick input:checked + span { background: var(--background); box-shadow: inset 0 0 0 2px var(--ink), 3px 4px 0 var(--overprint); }
.format-pick input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }
.medium { display: grid; gap: 14px; padding: 18px; border-radius: var(--shape-card); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.medium-art { display: grid; place-items: center; min-height: 190px; }
.medium-art > * { grid-area: 1 / 1; transition: opacity .3s, transform .4s; }
.medium[data-fmt="tape"] .disc, .medium[data-fmt="tape"] .minidisc,
.medium[data-fmt="cdr"] .cassette, .medium[data-fmt="cdr"] .minidisc,
.medium[data-fmt="md"] .cassette, .medium[data-fmt="md"] .disc { opacity: 0; transform: scale(.9) rotate(-6deg); pointer-events: none; }
.marker-input { font-family: var(--font-marker); font-size: 18px; }

/* Cassette (shared) */
.cassette { position: relative; display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--mineral-stone-300); box-shadow: inset 0 0 0 1.5px var(--border), 3px 4px 0 var(--ink); }
.mix-cassette { width: min(320px, 100%); }
.cassette-label { display: grid; gap: 2px; padding: 8px 12px; border-radius: 6px; background: repeating-linear-gradient(#fbfaf4 0 15px, #dfe6f5 15px 16px); box-shadow: inset 0 0 0 1px var(--border); color: #1d1d1d; }
.cassette-label .marker { font-size: 19px; line-height: 1.1; color: #18244d; }
.cassette-sub { font: 600 9.5px/1.3 var(--font-slab); letter-spacing: .1em; text-transform: uppercase; color: #6b6b6b; }
.cassette-window { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-radius: 30px; background: #2c2b30; box-shadow: inset 0 2px 4px #0008; }
.reel { position: relative; width: 50px; height: 50px; flex: none; border-radius: 50%; background: radial-gradient(circle, #f2efe8 0 30%, #4a3a2c 31% 100%); }
.spoke { position: absolute; inset: 15px; border-radius: 50%; background: conic-gradient(#2c2b30 0 10%, transparent 10% 33%, #2c2b30 33% 43%, transparent 43% 66%, #2c2b30 66% 76%, transparent 76%); }
.tape-line { flex: 1; height: 16px; border-radius: 3px; background: #4a3a2c; opacity: .85; }
.cassette.spinning .spoke { animation: reel-spin 1.2s linear infinite; }
@keyframes reel-spin { to { transform: rotate(360deg); } }
/* CD-R */
.disc { position: relative; width: 190px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, transparent 0 13%, #d8dbe0 13% 16%, #f3f3f1 16% 100%); box-shadow: inset 0 0 0 1px #0002, 3px 4px 0 var(--ink); }
.disc::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 40deg, #c9f0ff55, #f6d4ff55, #fff6c455, #c9ffe055, #c9f0ff55); mix-blend-mode: multiply; }
.disc-hole { position: absolute; inset: 44%; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1px #0003; }
.disc-ink { position: absolute; top: 16%; left: 8%; right: 8%; text-align: center; font-size: 20px; line-height: 1.05; color: #1a1a1a; transform: rotate(-8deg); }
.disc.spinning { animation: reel-spin 1.1s linear infinite; }
/* MiniDisc */
.minidisc { position: relative; width: 170px; aspect-ratio: 68 / 72; border-radius: 6px 6px 10px 10px; background: linear-gradient(160deg, #6fb8e8, #2f6fa8); box-shadow: inset 0 0 0 1px #0003, 3px 4px 0 var(--ink); }
.md-shutter { position: absolute; left: 14%; right: 14%; bottom: 8%; height: 34%; border-radius: 3px; background: linear-gradient(90deg, #b8c2cc, #eef2f6 50%, #aab4be); }
.md-label { position: absolute; top: 9%; left: 10%; right: 10%; height: 38%; display: grid; place-items: center; padding: 6px; border-radius: 3px; background: #fbfaf4; text-align: center; }
.md-label .marker { font-size: 16px; line-height: 1.05; color: #1d1d1d; }

.meter-bar { height: 14px; border-radius: 7px; background: var(--mineral-stone-100); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gem-emerald) 0 6px, var(--gem-emerald-glow) 6px 8px); transition: width .3s; }
.meter-bar span.warn { background: repeating-linear-gradient(90deg, var(--gem-topaz) 0 6px, var(--gem-topaz-glow) 6px 8px); }
.meter-bar span.over { background: repeating-linear-gradient(90deg, var(--gem-ruby) 0 6px, var(--gem-ruby-glow) 6px 8px); }
.meter-text { margin: 6px 0 0; font: 18px/1 var(--font-term); }
.mix-list { margin: 0; padding: 0; list-style: none; counter-reset: m; display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.mix-list li { counter-increment: m; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 8px; background: var(--background); font-size: 13.5px; }
.mix-list li::before { content: counter(m, decimal-leading-zero); font: 16px/1 var(--font-term); color: var(--muted-foreground); }
.mix-list li.side-b-start { margin-top: 10px; position: relative; }
.mix-list li.side-b-start::after { content: "SIDE B"; position: absolute; top: -12px; left: 8px; font: 600 9px/1 var(--font-slab); letter-spacing: .12em; color: var(--gem-ruby); }
.mix-list .mix-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix-list .mix-t small { color: var(--muted-foreground); }
.mix-row-btns { display: flex; gap: 2px; }
.mini-btn { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); cursor: pointer; font-size: 13px; }
.mini-btn:hover { background: var(--muted); }
.mix-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.burn-bar { height: 18px; border-radius: 4px; background: #111; overflow: hidden; box-shadow: inset 0 0 0 1px #333; }
.burn-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #39f 0 8px, #2266cc 8px 10px); }
.burn .j-hint { margin: 6px 0 0; font-family: var(--font-term); font-size: 17px; }

.crate { margin-top: 34px; }
.crate-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.crate-head h3 { margin: 0; font-size: 13px; color: var(--gem-sapphire-deep); }
.crate-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.crate-item { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px 8px 8px; border-radius: var(--shape-tile); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.crate-item.playing { box-shadow: inset 0 0 0 2px var(--gem-ruby), 3px 4px 0 var(--overprint); }
.crate-item.in-mix .crate-add { background: var(--gem-emerald); color: var(--on-gem); }
.crate-spine { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; font: 15px/1 var(--font-term); color: var(--on-gem); background: var(--gem-sapphire); }
.crate-info { min-width: 0; }
.crate-info b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crate-info span { display: block; font-size: 12.5px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crate-btns { display: flex; gap: 2px; }
.crate-add { font-weight: 800; font-size: 16px; }

/* ---------- Away message maker ---------- */
.away-layout { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 30px; align-items: start; }
.away-form { display: grid; gap: 14px; }
.sn-row { display: flex; gap: 8px; }
.aw-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aw-tools .j-input { width: auto; height: 38px; font-size: 14px; }
.aw-font { min-width: 170px; }
.aw-fmt { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--muted); color: var(--foreground); font-size: 15px; cursor: pointer; }
.aw-fmt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.aw-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px oklch(1 0 0 / .5), 0 0 0 1px var(--border); }
.aw-swatch[aria-checked="true"] { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--ink); }
input[type="range"] { accent-color: var(--gem-amethyst); width: 100%; }
.away-preview { display: grid; gap: 14px; position: sticky; top: 100px; }
.buddy-info .win-body { padding: 16px; }
.aw-meta { margin: 0 0 10px; font-size: 13px; color: var(--muted-foreground); display: flex; gap: 8px; align-items: center; }
.aw-away-badge { background: var(--gem-topaz); color: var(--on-bright); font-weight: 800; font-size: 11px; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .06em; }
.aw-card { min-height: 160px; padding: 18px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px #0002; overflow-wrap: anywhere; }
.aw-msg { white-space: pre-wrap; line-height: 1.35; }
.aw-auto { margin: 10px 0 0; font-size: 13px; color: var(--muted-foreground); }
.away-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Player 1 ---------- */
.construction { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; padding: 10px; border-radius: 6px;
  background: repeating-linear-gradient(-45deg, #f5c400 0 18px, #1b1b1b 18px 36px); }
.construction-text { padding: 5px 12px; border-radius: 3px; background: #f5c400; color: #1b1b1b; font: 700 13px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; }
.construction .cone { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 20px solid #ff7a1a; filter: drop-shadow(0 2px 0 #0006); animation: p-blink 1s steps(2) infinite; }
.game-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: start; }
.pocket { width: 330px; padding: 16px 22px 24px; border-radius: 28px 28px 64px 28px / 28px 28px 52px 28px; background: linear-gradient(165deg, var(--gem-sapphire-light), color-mix(in oklch, var(--gem-sapphire-light) 70%, var(--gem-sapphire))); box-shadow: inset 0 0 0 2px oklch(0.25 0.02 265 / .25), inset -8px -10px 0 oklch(0.25 0.02 265 / .08), 8px 10px 0 var(--ink); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pocket-top { display: flex; justify-content: space-between; font: 600 10px/1 var(--font-slab); letter-spacing: .16em; color: oklch(0.31 0.128 262 / .7); margin-bottom: 10px; }
.pocket-screen-wrap { position: relative; padding: 16px 24px 20px; border-radius: 18px 18px 30px 18px; background: #1d222b; box-shadow: inset 0 0 0 2px #0006; }
.pocket-power { position: absolute; left: 6px; top: 44%; display: grid; justify-items: center; gap: 3px; font: 600 5.5px/1 var(--font-sans); color: #9aa3b5; letter-spacing: .08em; }
.pocket-led { width: 7px; height: 7px; border-radius: 50%; background: #3a2a0d; }
.pocket-led.on { background: #ffc23a; box-shadow: 0 0 6px #ffc23a; }
.pocket-screen { display: block; width: 100%; aspect-ratio: 160 / 144; image-rendering: pixelated; background: #9bbc0f; border-radius: 4px; outline: none; }
.pocket-screen:focus-visible { box-shadow: 0 0 0 3px var(--gem-topaz); }
.pocket-brand { margin: 12px 0 16px; font: 700 15px/1 var(--font-slab); color: var(--gem-sapphire-deep); letter-spacing: .14em; text-transform: uppercase; }
.pocket-brand span { font: 600 10px/1 var(--font-slab); letter-spacing: .14em; color: var(--gem-ruby); margin-left: 6px; }
.pocket-controls { display: flex; justify-content: space-between; align-items: center; }
.dpad { position: relative; width: 104px; height: 104px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 6px; border-radius: 50%; background: oklch(0.25 0.02 265 / .12); }
.dpad button { border: 0; background: #1d222b; cursor: pointer; box-shadow: 0 3px 0 #000a; }
.dpad button:active, .dpad button.down { background: #3a4150; transform: translateY(2px); box-shadow: 0 1px 0 #000a; }
.dpad [data-key="up"] { grid-area: 1 / 2; border-radius: 6px 6px 0 0; }
.dpad [data-key="left"] { grid-area: 2 / 1; border-radius: 6px 0 0 6px; }
.dpad [data-key="right"] { grid-area: 2 / 3; border-radius: 0 6px 6px 0; }
.dpad [data-key="down"] { grid-area: 3 / 2; border-radius: 0 0 6px 6px; }
.dpad-center { grid-area: 2 / 2; background: #1d222b; }
.ab { display: flex; gap: 12px; align-items: center; margin-right: 4px; padding: 8px; border-radius: 40px; background: oklch(0.25 0.02 265 / .12); }
.ab button { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--gem-topaz); color: #3a2a05; font: 700 15px/1 var(--font-slab); cursor: pointer; box-shadow: 0 4px 0 #7a5208; }
.ab [data-key="b"] { background: var(--gem-ruby); color: #fde8ec; box-shadow: 0 4px 0 #5a1020; }
.ab button:active, .ab button.down { transform: translateY(3px); box-shadow: none; }
.pocket-meta { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }
.pocket-meta button { padding: 7px 12px; border: 0; border-radius: 8px; background: #1d222b; color: #c9cfdb; font: 700 9px/1 var(--font-sans); letter-spacing: .12em; cursor: pointer; box-shadow: 0 3px 0 #000a; }
.pocket-meta button:active { transform: translateY(2px); box-shadow: none; }
.pocket-speaker { display: grid; grid-template-columns: repeat(6, 6px); gap: 5px; justify-content: end; margin-top: -4px; }
.pocket-speaker i { width: 6px; height: 6px; border-radius: 50%; background: oklch(0.25 0.02 265 / .25); }
.game-help { display: grid; gap: 18px; }
.game-help h3 { margin: 0; font-size: 19px; }
.keys { margin: 0; display: grid; gap: 6px; }
.keys > div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 14px; }
.keys dt { font-weight: 750; }
.keys dd { margin: 0; color: var(--muted-foreground); }
.game-best { margin: 0; }
.mix-secret { --surface: var(--mineral-heather-100); max-width: 52ch; }

/* ---------- Guestbook ---------- */
.counter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 26px; }
.odometer .hit-num { display: inline-flex; gap: 3px; font: 26px/1 var(--font-term); }
.odometer .hit-num i { display: inline-grid; place-items: center; width: 24px; height: 34px; font-style: normal; color: #f2f2f2; background: linear-gradient(#111 0 48%, #000 52% 100%); border-radius: 3px; box-shadow: inset 0 0 0 1px #333, 0 2px 0 var(--ink); }
.gb-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 30px; align-items: start; }
.gb-form .win-body { display: grid; gap: 14px; }
.gb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gb-entries h3 { margin: 0 0 12px; font-size: 13px; color: var(--gem-sapphire-deep); }
.gb-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.gb-entry { padding: 14px 16px; border-radius: var(--shape-tile); background: var(--card); box-shadow: inset 0 0 0 1px var(--border), 2px 3px 0 var(--overprint); }
.gb-entry-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; font-size: 13px; color: var(--muted-foreground); }
.gb-entry-head b { font-size: 15px; color: var(--foreground); }
.gb-entry p { margin: 0; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.gb-entry .gb-found { margin-top: 8px; font-size: 12px; color: var(--muted-foreground); }
.gb-entry.pending { box-shadow: inset 0 0 0 2px var(--gem-topaz), 2px 3px 0 var(--overprint); }
.gb-empty { padding: 16px; border-radius: var(--shape-tile); background: var(--card); }

/* ---------- Journal / ode ---------- */
.ode { padding-block: 96px 88px; }
.journal { max-width: 860px; border-radius: var(--shape-card); background: var(--card); box-shadow: inset 0 0 0 1px var(--border), 6px 8px 0 var(--overprint); overflow: hidden; }
.journal-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px 22px; background: var(--gem-amethyst-light); color: var(--gem-amethyst-deep); font-size: 13px; }
.journal-title { font-weight: 800; }
.ode-lines { margin: 0; padding: 28px 26px 10px; }
.ode-lines p { margin: 0; font-size: clamp(26px, 4vw, 44px); line-height: 1.28; letter-spacing: -0.015em; }
.journal-foot { padding: 12px 26px 22px; font-size: 14px; display: grid; gap: 6px; }
.journal-foot p { margin: 0; }
.ode-cta { margin-top: 30px; }
.ode-sticker { background: var(--gem-sapphire); color: var(--on-gem); font-size: 13px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--border); margin-top: 20px; padding-block: 36px 48px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.b88 { display: inline-grid; grid-template-columns: auto auto; align-items: center; width: 88px; height: 31px; padding: 0; overflow: hidden; font: 700 8px/1 var(--font-sans); text-decoration: none; letter-spacing: .02em; border: 1px solid #000; box-shadow: inset 1px 1px 0 #fff8, inset -1px -1px 0 #0006; }
.b88 b { display: grid; place-items: center; height: 100%; padding: 0 4px; font-size: 7px; color: #fff; background: #000; }
.b88 { color: #000; text-align: center; }
.b88-a { background: #9fe6ff; } .b88-b { background: #ffe066; } .b88-c { background: #b6ff9f; }
.b88-d { background: #c9b6ff; } .b88-e { background: #ffb3c7; } .b88-f { background: #ffd2a1; }
.webring { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; margin-bottom: 30px; border-radius: var(--shape-tile); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); font-size: 14px; }
.webring .j-slab { font-size: 12px; margin-right: auto; }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-grid .j-slab { margin: 0 0 8px; color: var(--foreground); font-size: 12px; }
.foot-copy { margin: 0; font-size: 13.5px; line-height: 1.6; max-width: 46ch; }

/* ---------- MIDI widget, sparkles, toast, dialogs ---------- */
.midi { position: fixed; left: 14px; bottom: 14px; z-index: 55; font-size: 13px; }
.midi-toggle { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--glass-strong); color: var(--foreground); font: 600 12px/1 var(--font-sans); cursor: pointer; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--glass-shadow); }
.midi-toggle.playing { color: var(--gem-ruby); }
.midi-panel { position: absolute; bottom: calc(100% + 8px); left: 0; width: 260px; display: grid; gap: 10px; padding: 14px; border-radius: var(--shape-tile); background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.midi-row { display: flex; align-items: center; gap: 8px; }
.midi-row .vcr { min-width: 36px; height: 32px; }
.midi-name { font: 16px/1 var(--font-term); }
.midi .j-check { font-size: 13.5px; }
.sparkle-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.spark { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; pointer-events: none; animation: spark .8s ease-out forwards; }
.spark::before { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--c, #ffd400); text-shadow: 0 0 4px currentColor; }
@keyframes spark { to { transform: translate(var(--dx), 28px) scale(.2) rotate(120deg); opacity: 0; } }
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 70; width: max-content; max-width: calc(100vw - 32px); }
#toast { margin: 0; }
.trail-choices { display: grid; gap: 10px; justify-items: start; }
#trail-dialog p { margin: 0; font-size: 15px; line-height: 1.55; }
.era-dialog { width: min(100%, 480px); }
.era-list { display: grid; gap: 8px; }
.era-list button { display: flex; gap: 12px; align-items: baseline; text-align: left; padding: 12px 14px; border: 0; border-radius: var(--shape-control); background: var(--background); color: var(--foreground); font: 14px/1.3 var(--font-sans); cursor: pointer; box-shadow: inset 0 0 0 1px var(--border); }
.era-list button b { font-family: var(--font-slab); font-size: 16px; min-width: 44px; }
.era-list button[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--ink), 3px 4px 0 var(--overprint); }

/* ---------- Reveal ---------- */
html.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease-out, transform .5s ease-out; }
html.js-reveal .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1160px) { .nav-links a { padding: 8px 7px; font-size: 13px; } }
@media (max-width: 1040px) {
  .nav-links { display: none; }
  .j-nav { justify-content: space-between; }
  .era-chip { margin-left: auto; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 10px; padding-top: 36px; }
  .hero-art { min-height: 480px; max-width: 520px; width: 100%; justify-self: center; }
  .case-grid { grid-template-columns: 1fr; grid-template-areas: "a" "q1" "b" "c" "q2" "d"; }
  .profile { grid-template-columns: 1fr; }
  .profile-side { grid-template-columns: 1fr 1fr; align-items: start; }
  .mix-layout, .away-layout, .gb-layout { grid-template-columns: 1fr; }
  .away-preview { position: static; }
  .game-layout { grid-template-columns: 1fr; justify-items: center; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .scan-qs { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  html { scroll-padding-bottom: 96px; }
  .section { padding-block: 60px; }
  .site-foot { padding-bottom: 120px; }
  .toast-wrap { bottom: 92px; }
  .midi { bottom: 92px; }
  .profile-side { grid-template-columns: 1fr; }
  .friend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-inline: 10px; }
  .comment { flex-direction: column; }
  .win-body { padding: 18px; }
  .win-menu, .win-status { display: none; }
  .scan-head { grid-template-columns: 1fr; padding-left: 38px; }
  .scan-year { justify-self: start; }
  .scan-body, .cred-result, .printout { padding-left: 38px; padding-right: 16px; }
  .printout-paper { padding: 18px 30px; }
  .path { padding-left: 4px; }
  .path::before { left: 21px; }
  .stop { gap: 12px; }
  .hero-art { min-height: 420px; }
  .crt { width: 92%; }
  .floppy { width: 120px; bottom: 20px; }
  .cdr { width: 130px; }
  .tuner-name { font-size: 10px; }
  .field-row.two { grid-template-columns: 1fr; }
  .pocket { width: min(330px, 100%); }
  .sysprops dl { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .tuner-year { font-size: 13px; }
  .tuner-name { display: none; }
  .tuner-dial label { padding-bottom: 18px; }
  .format-pick span { font-size: 12.5px; padding: 8px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; padding-left: 20px; }
}

/* ---------- Credits dialog ---------- */
.nav-credits { border: 0; background: transparent; padding: 8px 10px; font: 600 13.5px var(--font-sans); color: var(--muted-foreground); cursor: pointer; border-radius: var(--shape-pill); }
.nav-credits:hover { color: var(--foreground); background: var(--background); box-shadow: 2px 3px 0 var(--overprint); }
.webring .credits-btn { order: 10; }
.credits-dialog { width: min(100% - 24px, 820px); max-height: min(88vh, 900px); overflow: auto; padding: 22px 26px 26px; }
.credits-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -22px; margin: -22px -26px 0; padding: 18px 26px 10px; background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 1; }
.credits-head h4 { margin: 0; }
.credits-body { display: grid; gap: 22px; }
.credits-body h5 { margin: 0 0 8px; font-size: 12px; color: var(--gem-sapphire-deep); }
.credits-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13.5px; line-height: 1.45; }
.credits-cols { columns: 2 260px; display: block; }
.credits-cols li { break-inside: avoid; margin-bottom: 5px; }
.credits-note { margin: 0; font-size: 13.5px; line-height: 1.55; }
.credits-dialog .j-hint { margin: 6px 0 0; }
@media (max-width: 767px) {
  .midi-toggle span { display: none; }
  .midi-toggle { width: 40px; height: 40px; justify-content: center; padding: 0; }
}

/* ---------- mCaptcha widget ---------- */
.captcha-row { gap: 6px; }
.captcha-title { font-weight: 650; font-size: 14px; }
#mcaptcha__widget-container { width: min(340px, 100%); height: 86px; border-radius: var(--shape-control); overflow: hidden; background: var(--background); box-shadow: inset 0 0 0 1px var(--border); }
#mcaptcha__widget-container iframe { display: block; border: 0; }

/* The design system's .j-dialog sets display: grid, which beats the browser's own rule that hides
   a closed <dialog>. Keep closed dialogs hidden; open ones still lay out as a grid. */
dialog.j-dialog:not([open]) { display: none; }
