/* KEYCAPS — every control is a physical key on one board.
   Paper face, ink rim, a 2px skirt underneath. Pressing sinks the key onto its skirt (steps, not a tween).
   In a radio group the chosen key stays sunk and lights a small orange LED in its corner, like caps lock.
   Loaded last so it can settle the button styles that style.css and attitude.css accumulated. */
:root { --key-face: #f6f2e8; --key-skirt: #131313; --key-down: #e9e2d2; --led: #ff4f17; }

.shufbtn, .sortbtn, .people-sort, .btn, .subtabs button, .seg button, .gchip, .erabar > button,
.blend-directions button, .surprise-button, .kchip, .viewtoggle button {
  position: relative; border-radius: 0;
  transition: transform 140ms cubic-bezier(.22,1,.36,1), box-shadow 140ms cubic-bezier(.22,1,.36,1), background-color 90ms, border-color 90ms, color 90ms;
}

/* the board: paper keys with a skirt */
.shufbtn, .sortbtn, .people-sort, .btn, .subtabs button, .seg button, .viewtoggle button {
  background: var(--key-face); color: var(--ink); border: 1px solid var(--key-skirt);
  box-shadow: 0 2px 0 var(--key-skirt);
}
.gchip, .erabar > button, .kchip { box-shadow: 0 1px 0 var(--key-skirt); }
.shufbtn:hover, .sortbtn:hover, .people-sort:hover, .btn:hover, .subtabs button:hover, .seg button:hover,
.viewtoggle button:hover, .gchip:hover, .erabar > button:hover {
  border-color: var(--o); box-shadow: 0 2px 0 var(--o); color: var(--ink);
}
.gchip:hover, .erabar > button:hover { box-shadow: 0 1px 0 var(--o); }

/* press: the key sinks onto its skirt */
.shufbtn:active, .sortbtn:active, .people-sort:active, .btn:active, .subtabs button:active, .seg button:active,
.viewtoggle button:active, .blend-directions button:active {
  transform: translateY(2px); box-shadow: 0 0 0 var(--key-skirt);
}
.gchip:active, .erabar > button:active, .kchip:active { transform: translateY(1px); box-shadow: none; }

/* the chosen key in a radio group stays down and lights its LED (no flood fill: the LED is the signal) */
.subtabs button.on, .seg button.on, .viewtoggle button.on, .shufbtn.on, .gchip.on, .erabar > button.on {
  background: var(--key-down); color: var(--ink); border-color: var(--ink);
  transform: translateY(2px); box-shadow: inset 0 2px 0 #00000014;
}
.gchip.on, .erabar > button.on { transform: translateY(1px); }
.subtabs button.on::after, .seg button.on::after, .viewtoggle button.on::after, .shufbtn.on::after,
.gchip.on::after, .erabar > button.on::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px;
  background: var(--led); box-shadow: 0 0 0 1px #ffffff80, 0 0 7px 1px #ff4f17b3;
  animation: led-on 260ms steps(3, end) both;
}
.gchip.on::after, .erabar > button.on::after { width: 4px; height: 4px; top: 2px; right: 2px; }
.erabar > button.on .n, .erabar > button.on small, .gchip.on .n, .gchip.on span { color: var(--o); }
@keyframes led-on { 0% { opacity: 0; } 34% { opacity: 1; } 67% { opacity: .35; } 100% { opacity: 1; } }

/* shuffle: outlined key; on = sunk + LED, never a black slab */
.shufbtn { width: var(--control, 32px); height: var(--control, 32px); border: 1px solid var(--ink); }
.shufbtn.on { color: var(--o); }

/* the one orange key on the board: same skirt model, so it sits level with its neighbours */
.surprise-button { border: 1px solid #7a240a; box-shadow: inset 0 1px #ffb394, 0 2px 0 #7a240a; }
.surprise-button:hover { background: var(--ink); border-color: var(--ink); color: #fff8ea; box-shadow: inset 0 1px #3a3a3a, 0 2px 0 var(--o); }
.surprise-button:active { transform: translateY(2px); box-shadow: inset 0 1px #7d472f, 0 0 0 #7a240a; }
.pick-control small { display: none; } /* the tooltip and the D key say it; the caption pushed the row off level */

/* direction cards in Blend are big keys too */
.blend-directions button { box-shadow: 0 2px 0 var(--line-2); }
.blend-directions button.on { transform: translateY(2px); box-shadow: inset 0 3px 0 var(--o); }

/* bottom player: artwork centred in the bar, never touching its top edge */
.p-now { align-self: center; align-items: center; }
.p-now img { align-self: center; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .subtabs button.on::after, .seg button.on::after, .viewtoggle button.on::after, .shufbtn.on::after,
  .gchip.on::after, .erabar > button.on::after { animation: none; }
}

/* genre chips carry older fills (ink "ALL", olive "on"); bring them onto the board */
.gchips .gchip.on, .gchips .gchip.all.on, .gchips .gchip.on:hover { background: var(--key-down); color: var(--ink); box-shadow: inset 0 2px 0 #00000014; }
.gchips .gchip.on span, .gchips .gchip.all.on span { color: var(--o); }
.gchips .gchip.all { box-shadow: inset 0 0 0 1px var(--ink), 0 1px 0 var(--key-skirt); }

/* taste field canvas */
.taste-field { display: block; width: 100%; cursor: grab; touch-action: none; image-rendering: pixelated; }
.taste-field:active { cursor: grabbing; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only button:focus { position: static; }

/* ---------- QUESTS: the tutorial as a game dialog ---------- */
.quest { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px;
  background: #131313b8; background-image: radial-gradient(#13131355 1px, transparent 1px); background-size: 3px 3px;
  animation: quest-in 160ms cubic-bezier(.22,1,.36,1) both; }
.quest.out { animation: quest-out 160ms cubic-bezier(.22,1,.36,1) both; }
.quest-card { width: min(470px, 100%); background: var(--paper); color: var(--ink); border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--o), 6px 6px 0 3px var(--ink); clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
  animation: quest-drop 340ms cubic-bezier(.22,1,.36,1) both; }
.quest-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--ink); color: var(--paper);
  font: 9px var(--pixel); letter-spacing: .08em; }
.quest-led { width: 7px; height: 7px; background: var(--o); box-shadow: 0 0 8px 1px var(--o); animation: quest-blink 900ms steps(2, end) infinite; }
.quest-n { margin-left: auto; color: var(--o); }
.quest-body { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 16px 16px 6px; }
.quest-face { width: 64px; height: 64px; background: var(--ink); display: grid; place-items: center; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--o); }
.quest-face canvas { width: 60px; height: 60px; image-rendering: pixelated; }
.quest-title { font: 16px/1.25 var(--pixel); letter-spacing: .02em; min-height: 20px; margin: 0 0 10px; }
.quest:not(.still) .quest-title::after { content: "▌"; color: var(--o); animation: quest-blink 700ms steps(2, end) infinite; }
.quest-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.quest-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: center; font: 11px/1.45 var(--mono);
  animation: quest-step 240ms cubic-bezier(.22,1,.36,1) both; animation-delay: calc(420ms + var(--i) * 140ms); }
.quest-steps kbd { min-width: 26px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; font: 9px var(--pixel);
  background: var(--key-face); border: 1px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.quest-reward { margin: 12px 0 4px; padding: 7px 9px; border: 1px dashed var(--line-2); font: 10px/1.4 var(--mono); color: var(--muted);
  animation: quest-step 240ms cubic-bezier(.22,1,.36,1) both; animation-delay: 900ms; }
.quest-reward b { font: 8px var(--pixel); color: var(--o); margin-right: 6px; letter-spacing: .08em; }
.quest-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px 16px; }
.quest-actions button { height: 34px; padding: 0 16px; font: 10px var(--pixel); letter-spacing: .06em; border: 1px solid var(--ink); background: var(--key-face); box-shadow: 0 2px 0 var(--ink); }
.quest-actions button:active { transform: translateY(2px); box-shadow: none; }
.quest-actions .quest-go { background: var(--o); color: #fff8ea; border-color: #7a240a; box-shadow: inset 0 1px #ffb394, 0 2px 0 #7a240a; }
.quest-actions .quest-go:hover, .quest-actions .quest-go:focus-visible { background: var(--ink); border-color: var(--ink); outline: none; }
.quest.still, .quest.still .quest-card, .quest.still .quest-steps li, .quest.still .quest-reward { animation: none; }
@keyframes quest-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes quest-out { to { opacity: 0; } }
@keyframes quest-drop { 0% { transform: translateY(-28px) scale(.96); opacity: 0; } 60% { transform: translateY(4px); opacity: 1; } 100% { transform: none; } }
@keyframes quest-step { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes quest-blink { 50% { opacity: .15; } }
/* ACCEPT points at the first move: the control pulses orange three times */
.quest-ping { position: relative; z-index: 5; animation: quest-ping 800ms cubic-bezier(.22,1,.36,1) 3; }
@keyframes quest-ping { 0% { box-shadow: 0 0 0 0 #ff4f17, 0 0 0 0 #131313; } 50% { box-shadow: 0 0 0 4px #ff4f17, 0 0 0 7px #131313; } 100% { box-shadow: 0 0 0 9px #ff4f1700, 0 0 0 12px #13131300; } }
@media (max-width: 520px) { .quest-body { grid-template-columns: 48px minmax(0, 1fr); } .quest-face { width: 48px; height: 48px; } .quest-face canvas { width: 44px; height: 44px; } .quest-title { font-size: 13px; } }

/* ---------- BLEND: VS title card ---------- */
.vs-card { position: absolute; inset: 0; z-index: 6; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 0 18px;
  background: var(--ink); color: var(--paper); cursor: pointer; overflow: hidden;
  background-image: repeating-linear-gradient(135deg, #ff4f1722 0 6px, transparent 6px 14px); }
.vs-side { display: grid; justify-items: center; gap: 6px; font: 10px var(--pixel); letter-spacing: .06em; text-transform: uppercase; }
.vs-side img { width: 64px; height: 64px; object-fit: cover; border: 2px solid var(--paper); box-shadow: 4px 4px 0 var(--o); image-rendering: pixelated; background: #2a2a2a; }
.vs-a { animation: vs-left 300ms cubic-bezier(.22,1,.36,1) both; }
.vs-b { animation: vs-right 300ms cubic-bezier(.22,1,.36,1) both; }
.vs-stamp { font: 34px/1 var(--pixel); color: var(--o); text-shadow: 3px 3px 0 var(--paper); animation: vs-stamp 260ms cubic-bezier(.22,1,.36,1) 360ms both; }
.vs-card.vs-out { animation: vs-wipe 220ms cubic-bezier(.22,1,.36,1) both; }
@keyframes vs-left { from { transform: translateX(-140%); } to { transform: none; } }
@keyframes vs-right { from { transform: translateX(140%); } to { transform: none; } }
@keyframes vs-stamp { 0% { transform: scale(2.6) rotate(-8deg); opacity: 0; } 70% { transform: scale(.9) rotate(2deg); opacity: 1; } 100% { transform: none; } }
@keyframes vs-wipe { to { clip-path: inset(0 0 0 100%); } }

/* ---------- GRID: cards as sleeves ---------- */
.rows.grid { perspective: none; }
.rows.grid .card { transition: border-color 140ms, box-shadow 140ms; }
.rows.grid .card .c-art { position: relative; }
.rows.grid .card.deal { animation: card-deal 200ms ease-out both; }
@keyframes card-deal { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rows.grid .card.deal { animation: none; } }

/* ---------- RHYTHM: one vertical gap between blocks, one inset for loose captions ---------- */
:root { --block: 12px; --inset: 12px; }
/* Blend chooser: the TASTE TWINS heading spans the grid instead of occupying the first card slot */
.blend-candidates .twin-head { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 0 2px; }
.blend-candidates .twin-head > * { margin: 0; }
/* person page + Blend result: same gap between every block, same frame on every panel */
#person-modes { margin: var(--block) 0; }
#person-blend > * + * { margin-top: var(--block); }
#blend-summary { border-top-width: 1px; border-top-color: var(--line-2); box-shadow: inset 0 3px 0 var(--ink); padding: 14px var(--inset) 12px; }
#blend-directions { margin: var(--block) 0 0; gap: var(--block); }
#blend-pool-caption { margin: 8px var(--inset) 0; }
#blend-view { margin-top: var(--block); }
.blend-signals { margin-top: 8px; }

/* People tab: the side column is empty there, so the view takes the full width like the hero above it */
.shell:has(#view-explore:not(.hidden)) { grid-template-columns: minmax(0, 1fr); }
.shell:has(#view-explore:not(.hidden)) > .side { display: none; }


/* Recently active (side panel): name truncates instead of running into the counts */
.ra-row { grid-template-columns: 20px 22px minmax(0, 1fr) auto auto; gap: 7px; font-size: 11.5px; }
.ra-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-row .nw, .ra-row .when { white-space: nowrap; font-size: 10px; color: var(--muted); }

/* Archive mode tabs (MY LIKES · FREE DOWNLOADS · DIG MODE · KEY·BPM) are a radio group like the rest */
.archive-tools .btn { background: var(--key-face); color: var(--ink); border: 1px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.archive-tools .btn.solid { background: var(--key-down); color: var(--ink); transform: translateY(2px); box-shadow: inset 0 2px 0 #00000014; }
.archive-tools .btn.solid::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; background: var(--led); box-shadow: 0 0 0 1px #ffffff80, 0 0 7px 1px #ff4f17b3; }
.archive-tools { gap: 8px; margin-bottom: var(--block); }

/* KEY · BPM gets the same framed row as GENRE and YEAR */
.index2 .key-row { padding: 8px 10px; border: 1px solid #b7a98b65; border-left: 3px solid var(--ink); background: #f3efe6; }
.index2 .key-row .index-marker { background: var(--ink); }

/* Lurklist genre filter: a paper key, not an orange slab */
#w-genre { background: var(--key-face); color: var(--ink); border: 1px solid var(--ink); box-shadow: 0 2px 0 var(--ink); clip-path: none; }
#w-genre option { color: var(--ink); background: var(--paper); }
.genre-select:has(#w-genre) .ic { color: var(--ink); }
#view-explore .explore-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: var(--block); width: 100%; }
#view-explore .explore-watchlist { border-color: var(--line-2); border-top: 3px solid var(--o); background: var(--paper); }
@media (max-width: 900px) { #view-explore .explore-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- ARCADE CHIP: a handheld you can't miss ---------- */
.arcade-chip { width: 52px; height: 58px; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 0;
  box-shadow: 3px 3px 0 var(--o); transition: transform 80ms cubic-bezier(.22,1,.36,1); }
.arcade-chip svg { width: 30px; height: 40px; }
.arcade-chip::after { content: "PLAY"; position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%); font: 8px var(--pixel); letter-spacing: .08em;
  color: var(--ink); background: var(--paper); border: 1px solid var(--ink); padding: 1px 4px; white-space: nowrap; }
.arcade-chip:hover, .arcade-chip:focus-visible { background: var(--o); color: #fff8ea; border-color: var(--ink); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.arcade-chip:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--o); }
.arcade-chip.is-loading { animation: chip-wiggle 1.2s steps(4, end) infinite; box-shadow: 3px 3px 0 var(--o), 0 0 0 4px #ff4f1733; }
.arcade-chip.is-loading::after { content: "LOADING…"; color: #fff8ea; background: var(--o); border-color: var(--o); }
.arcade-chip .handheld-led { fill: var(--o); animation: quest-blink 1.4s steps(2, end) infinite; }
@keyframes chip-wiggle { 0%, 70%, 100% { transform: none; } 78% { transform: rotate(-6deg); } 86% { transform: rotate(5deg); } 94% { transform: rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .arcade-chip.is-loading, .arcade-chip .handheld-led { animation: none; } }

/* ---------- PLAYER: quiet until there's something to play ---------- */
body:not(.has-track) .player .p-wave, body:not(.has-track) .player .p-time, body:not(.has-track) .player .p-vol,
body:not(.has-track) .player #p-crate, body:not(.has-track) .player #p-more, body:not(.has-track) .player #p-shuffle,
body:not(.has-track) .player .seek-step, body:not(.has-track) .player #p-prev, body:not(.has-track) .player #p-next,
body:not(.has-track) .player #p-repeat, body:not(.has-track) .player #p-art, body:not(.has-track) .player .live-sparks { display: none; }
body:not(.has-track) .player { grid-template-columns: auto auto 1fr auto auto auto auto auto; }
body:not(.has-track) .player .p-title { color: var(--paper); }
body:not(.has-track) .player .p-artist::before { content: "▶ "; color: var(--o); }
body.has-track .player { animation: player-open 260ms cubic-bezier(.22,1,.36,1); }
@keyframes player-open { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
body:has(#loading-arcade:not(.hidden)) #arcade-chip { display: none; } /* the open window replaces the chip */

/* ---------- LOG IN ---------- */
.sc-login { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; margin-left: 10px; font: 9px var(--pixel); letter-spacing: .08em;
  color: #fff8ea; background: var(--o); border: 1px solid #7a240a; box-shadow: inset 0 1px #ffb394, 0 2px 0 #7a240a; text-decoration: none; white-space: nowrap; }
.sc-login:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); box-shadow: 0 2px 0 var(--o); }
.sc-login:active { transform: translateY(2px); box-shadow: none; }
.sc-led { width: 6px; height: 6px; background: #fff8ea; box-shadow: 0 0 6px #fff; animation: quest-blink 1.2s steps(2, end) infinite; }
.title-screen { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; background: #131313;
  background-image: linear-gradient(180deg, #131313f0, #131313d8), url("/web/art/city-signal.jpg"); background-size: cover; background-position: center 60%; }
.ts-card { display: grid; justify-items: center; gap: 18px; text-align: center; animation: quest-drop 420ms cubic-bezier(.22,1,.36,1) both; }
.ts-mark { width: min(520px, 80vw); image-rendering: pixelated; }
.ts-line { font: 12px var(--pixel); letter-spacing: .1em; color: var(--o); margin: 0; }
.ts-go { margin-top: 10px; padding: 14px 22px; font: 12px var(--pixel); letter-spacing: .08em; color: #fff8ea; background: var(--o); text-decoration: none;
  border: 2px solid #f1ede4; box-shadow: 5px 5px 0 #f1ede4; }
.ts-go:hover { background: #f1ede4; color: var(--ink); box-shadow: 5px 5px 0 var(--o); }
.ts-go:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #f1ede4; }
.ts-fine { max-width: 420px; font: 10px/1.6 var(--mono); color: #bdb29c; margin: 0; }
.ts-press { font: 9px var(--pixel); color: #f1ede4; letter-spacing: .14em; animation: quest-blink 1s steps(2, end) infinite; margin: 0; }
@media (max-width: 760px) { .sc-login { height: 26px; padding: 0 8px; font-size: 8px; } }

/* if the arcade script never placed the chip, it still sits bottom-right above the player */
#arcade-chip:not([style*="top"]) { top: auto; bottom: 96px; right: 14px; }

/* ---------- COLOUR PASS: neon traces, genre chips with presence, key text that reads ---------- */
.hdr, .player { background-image: linear-gradient(#0f120dcc, #0f120de0), url('/web/circuits-neon.svg'); }
.gchips .gchip { border: 1px solid #13131366; background: #fbf8f0; color: var(--ink); font-weight: 600; }
.gchips .gchip span { color: var(--o); font-weight: 700; }
.gchips .gchip:nth-child(6n+1):not(.all) { box-shadow: inset 3px 0 0 #ff4f17, 0 1px 0 var(--ink); }
.gchips .gchip:nth-child(6n+2) { box-shadow: inset 3px 0 0 #2b6cb0, 0 1px 0 var(--ink); }
.gchips .gchip:nth-child(6n+3) { box-shadow: inset 3px 0 0 #2f855a, 0 1px 0 var(--ink); }
.gchips .gchip:nth-child(6n+4) { box-shadow: inset 3px 0 0 #b7791f, 0 1px 0 var(--ink); }
.gchips .gchip:nth-child(6n+5) { box-shadow: inset 3px 0 0 #805ad5, 0 1px 0 var(--ink); }
.gchips .gchip:nth-child(6n) { box-shadow: inset 3px 0 0 #c53030, 0 1px 0 var(--ink); }
.gchips .gchip { padding-left: 10px; }
.gchips .gchip:hover { border-color: var(--o); background: #fff3ea; }
.gchips .gchip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.gchips .gchip.on span { color: #ffb08a; }
/* explanatory lines: a size up, ink instead of grey, with the important bits in orange */
#discovery-scope, .blend-pool-caption, .scene-lore > span:last-child, .hint, .taste-map-scope, #taste-map-scope, .w-sub, .disc-sub {
  font-size: 11px; color: #3a372f; letter-spacing: .01em; }
.scene-lore b { font-size: 11px; color: var(--ink); }
.scene-kicker { color: var(--o); font-weight: 700; }
.blend-pool-caption, #discovery-scope { font-weight: 600; }

/* ---------- BLEND CHOOSER v2: twins first and big, then blend-any-two ---------- */
.blend-chooser h1 { font-size: 22px; margin: 0 0 6px; }
.blend-chooser > p { font-size: 12px; color: #3a372f; max-width: 640px; margin: 0 0 16px; }
.blend-candidates { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.blend-candidates .twin-head h2 { font: 14px var(--pixel); letter-spacing: .06em; color: var(--ink); margin: 0; }
.blend-candidates .twin-head .hint { font-size: 12px; }
.blend-candidate.twin { min-height: 78px; padding: 12px 14px; border: 1px solid var(--ink); background: #fbf8f0; box-shadow: 0 2px 0 var(--ink); text-align: left; }
.blend-candidate.twin:hover { border-color: var(--o); box-shadow: 0 2px 0 var(--o); background: #fff3ea; transform: translateY(-1px); }
.blend-candidate.twin:active { transform: translateY(2px); box-shadow: none; }
.blend-candidate.twin img { width: 52px; height: 52px; }
.blend-candidate.twin .twin-body b { font-size: 15px; }
.blend-candidate.twin .twin-rank { font: 14px var(--pixel); color: var(--o); }
.blend-candidate.twin.twin-first { grid-column: 1 / -1; min-height: 92px; border-width: 2px; box-shadow: 4px 4px 0 var(--o); }
.blend-candidate.twin.twin-first img { width: 64px; height: 64px; }
.blend-candidate.twin.twin-first .twin-body b { font-size: 18px; }
.blend-any { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.blend-any-h { font: 12px var(--pixel); letter-spacing: .06em; margin: 0 0 4px; }
.blend-any .hint { margin: 0 0 10px; }
.blend-choose-fields { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) auto; gap: 10px; align-items: end; margin: 0; }
.blend-choose-fields label { display: grid; gap: 5px; font: 9px var(--pixel); letter-spacing: .08em; color: var(--ink); min-width: 0; }
.blend-choose-fields input { height: 38px; padding: 0 12px; font: 13px var(--mono); color: var(--ink); background: #fbf8f0; border: 1px solid var(--ink); box-shadow: inset 0 2px 0 #0000000d; width: 100%; }
.blend-choose-fields input:focus { outline: 2px solid var(--o); outline-offset: 1px; }
.blend-orbit { height: 38px; display: grid; place-items: center; font: 16px var(--pixel); color: var(--o); }
#blend-compare { height: 38px; padding: 0 18px; }
@media (max-width: 760px) { .blend-candidates { grid-template-columns: minmax(0, 1fr); } .blend-choose-fields { grid-template-columns: minmax(0, 1fr); } .blend-orbit { display: none; } }

/* ---------- VS fight: health bars, ROUND 1, FIGHT! ---------- */
.vs-card { grid-template-rows: auto 1fr; row-gap: 6px; padding-top: 12px; }
.vs-hp { grid-row: 1; display: grid; gap: 3px; font: 8px var(--pixel); letter-spacing: .06em; color: var(--paper); animation: vs-left 260ms cubic-bezier(.22,1,.36,1) both; }
.vs-hp-a { grid-column: 1; }
.vs-hp-b { grid-column: 3; justify-items: end; text-align: right; animation-name: vs-right; }
.vs-hp i { display: block; height: 8px; width: 100%; background: #3a0f05; border: 1px solid var(--paper); position: relative; overflow: hidden; }
.vs-hp i::after { content: ""; position: absolute; inset: 0; width: var(--hp); background: linear-gradient(90deg, #ffd23f, #ff4f17); animation: vs-fill 520ms cubic-bezier(.22,1,.36,1) 200ms both; }
.vs-hp-b i::after { left: auto; right: 0; }
.vs-side, .vs-stamp { grid-row: 2; }
.vs-call { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 30px/1 var(--pixel); color: var(--paper); text-shadow: 3px 3px 0 var(--o); opacity: 0; pointer-events: none; white-space: nowrap; }
.vs-round { animation: vs-call 380ms cubic-bezier(.22,1,.36,1) 760ms both; }
.vs-fight { font-size: 44px; color: var(--o); text-shadow: 4px 4px 0 var(--paper); animation: vs-call 520ms cubic-bezier(.22,1,.36,1) 1220ms both; }
.vs-card.vs-shake { animation: vs-shake 260ms cubic-bezier(.22,1,.36,1); }
.vs-card .vs-stamp { animation-delay: 300ms; }
@keyframes vs-fill { from { width: 0; } }
@keyframes vs-call { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(.95); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); } }
@keyframes vs-shake { 25% { transform: translate(-4px, 2px); } 50% { transform: translate(4px, -2px); } 75% { transform: translate(-2px, -1px); } }
.blend-candidate.twin { display: grid; grid-template-columns: 34px 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.blend-candidate.twin.twin-first { grid-template-columns: 34px 64px minmax(0, 1fr) auto; }
.blend-candidate.twin .twin-body { min-width: 0; }
.vs-card.vs-shake .vs-stamp { opacity: 0; }

/* ---------- LANDING: the front door. The city as a 2.5D pixel scene, the Watcher standing on a cartridge dialog box ---------- */
.landing.modal { z-index: 450; padding: 0; background: #0a0b09; display: block; overflow: auto; }
.landing.out { animation: ld-out 420ms cubic-bezier(.22,1,.36,1) both; }
@keyframes ld-out { to { opacity: 0; transform: scale(1.04); filter: blur(2px); } }
.ld-art { position: fixed; inset: 0; background: #0a0b09; }
.ld-art .stage-gl { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.ld-art.no-gl { background: #0a0b09 url('/web/art/city-signal.jpg') center 58% / cover no-repeat; filter: grayscale(1) contrast(1.25) brightness(.42); }
.ld-card { position: relative; min-height: 100%; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 18px; padding: 8vh 16px 6vh; }
.ld-mark { margin: 0; line-height: 0; align-self: start; filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 24px #000c); }
.ld-mark img { width: min(620px, 88vw); image-rendering: pixelated; animation: ld-type 900ms steps(7, end) 600ms both; }
@keyframes ld-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.ld-stage { position: relative; width: min(780px, 100%); align-self: end; }
.ld-hero { display: block; width: 100%; image-rendering: pixelated; cursor: pointer; margin-bottom: -10px; position: relative; z-index: 1; }

/* the dialog box: black, a bone double rule with notched corners, a portrait window on the left */
.ld-dlg { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding: 18px 20px 20px; color: #f1ede4; background: #0b0c0a;
  border: 3px solid #f1ede4; outline: 3px solid #0b0c0a; box-shadow: inset 0 0 0 3px #0b0c0a, inset 0 0 0 5px #4a5145, 0 10px 0 #000, 0 0 60px #000;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  animation: ld-box 520ms cubic-bezier(.22,1,.36,1) 1100ms both; }
@keyframes ld-box { from { opacity: 0; transform: translateY(24px) scaleY(.2); } 60% { opacity: 1; } to { transform: none; } }
.ld-port { display: grid; gap: 6px; align-content: start; justify-items: center; }
.ld-port canvas { width: 80px; height: 80px; image-rendering: pixelated; border: 3px solid #f1ede4; box-shadow: 0 0 0 3px #0b0c0a, 0 0 0 5px #4a5145; background: #131313; }
.ld-port span { font: 700 13px var(--head); letter-spacing: .12em; color: #ff8a4c; text-shadow: 0 0 10px #ff4f1766; }
.ld-say { display: grid; gap: 14px; align-content: start; min-width: 0; text-align: left; }
.ld-line { margin: 0; min-height: 3.2em; font: 500 17px/1.5 var(--head); letter-spacing: .01em; color: #f1ede4; cursor: default; }
.ld-line .dlg-em { color: #ff8a4c !important; font-weight: 700; text-shadow: 0 0 10px #ff4f1766; }
.ld-caret { color: #ff8a4c; animation: quest-blink .6s steps(2, end) infinite; margin-left: 1px; }

/* the menu: a save-file list with a ▶ cursor that follows hover, focus and arrow keys */
.ld-menu { display: grid; gap: 4px; opacity: 0; transform: translateY(6px); transition: opacity 280ms cubic-bezier(.22,1,.36,1), transform 280ms cubic-bezier(.22,1,.36,1); pointer-events: none; }
.ld-menu.in { opacity: 1; transform: none; pointer-events: auto; }
.ld-opt { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding: 8px 10px; text-align: left; color: #cfc8b8; background: transparent; border: 0; cursor: pointer; font: inherit; transition: background 160ms, color 160ms; }
.ld-opt i { font-style: normal; color: #ff5b1c; opacity: 0; transform: translateX(-4px); transition: opacity 140ms, transform 200ms cubic-bezier(.22,1,.36,1); }
.ld-opt b { font: 700 16px var(--head); letter-spacing: .04em; white-space: nowrap; }
.ld-opt span { font: 12px/1.45 var(--mono); color: #8d877a; }
.ld-opt.on, .ld-opt:focus-visible { color: #fff8ea; background: #1d201b; outline: none; }
.ld-opt.on i { opacity: 1; transform: none; animation: ld-nudge .7s ease-in-out infinite; }
.ld-opt.on span { color: #cfc8b8; }
.ld-opt[data-k="login"] b { color: #ff8a4c; }
@keyframes ld-nudge { 50% { transform: translateX(3px); } }
.ld-opt:active { transform: translateY(1px); }
.ld-search { display: grid; gap: 10px; }
.ld-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ld-row input { height: 40px; padding: 0 12px; font: 14px var(--mono); color: #f1ede4; background: #131512; border: 2px solid #4a5145; min-width: 0; }
.ld-row input:focus { outline: none; border-color: #ff5b1c; box-shadow: 0 0 0 3px #ff5b1c33; }
.ld-row button { height: 40px; padding: 0 16px; font: 700 14px var(--head); letter-spacing: .06em; color: #fff8ea; background: #ff5b1c; border: 2px solid #f1ede4; cursor: pointer; }
.ld-back { justify-self: start; font: 600 12px var(--head); letter-spacing: .08em; color: #8d877a; background: none; border: 0; padding: 2px 0; cursor: pointer; }
.ld-back:hover { color: #f1ede4; }
@media (prefers-reduced-motion: reduce) { .ld-mark img, .ld-dlg { animation: none; } .ld-menu { transition: none; } .ld-opt.on i { animation: none; } }

/* ---------- TALKING ON YOUR LIKES ---------- */
.cm-panel .hint { font-size: 11px; margin: 0 0 8px; }
.cm-list { display: grid; gap: 2px; }
.cm-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 2px; border-bottom: 1px dashed var(--line-2); cursor: pointer; }
.cm-row:hover b { color: var(--o); }
.cm-row img { width: 32px; height: 32px; object-fit: cover; background: #2a2a2a; }
.cm-body { min-width: 0; display: grid; }
.cm-body b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-body small { font-size: 10px; color: #3a372f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-body em { color: var(--o); font-style: normal; font-weight: 700; }
.cm-row .btn.sm { height: 24px; padding: 0 8px; font-size: 9px; }
.cm-in { font: 8px var(--pixel); color: var(--muted); }

/* ---------- TASTE MAP OPEN = DIG VIEW ---------- */
.taste-card { width: min(1100px, 96vw); }
.taste-card #taste-large { float: left; width: 56%; }
.taste-card #taste-categories { margin-left: 58%; max-height: 520px; overflow: auto; padding-right: 4px; }
.taste-card .taste-method { clear: both; }
.dig-head h3 { font: 18px var(--pixel); margin: 0; color: var(--ink); }
.dig-head span { font-size: 11px; color: #3a372f; }
.dig-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.dig h4 { font: 9px var(--pixel); letter-spacing: .08em; color: var(--o); margin: 14px 0 6px; }
.dig-artists { display: flex; flex-wrap: wrap; gap: 6px; }
.dig-artists .tag { cursor: pointer; border: 1px solid var(--ink); background: #fbf8f0; }
.dig-artists .tag b { color: var(--o); }
.dig-track { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; text-align: left; padding: 6px 4px; border-bottom: 1px dashed var(--line-2); background: none; }
.dig-track .ic { width: 22px; height: 22px; padding: 5px; background: var(--o); color: #fff; }
.dig-track b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dig-track small { font-size: 10px; color: #3a372f; }
.dig-track:hover b { color: var(--o); }
@media (max-width: 760px) { .taste-card #taste-large { float: none; width: 100%; } .taste-card #taste-categories { margin-left: 0; max-height: none; } }
.taste-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 18px; align-items: start; }
.taste-card > * { grid-column: 1 / -1; }
.taste-card #taste-large { float: none; width: auto; grid-column: 1; grid-row: 2; }
.taste-card #taste-categories { margin: 0; grid-column: 2; grid-row: 2; max-height: 560px; }
@media (max-width: 760px) { .taste-card { grid-template-columns: minmax(0, 1fr); } .taste-card #taste-categories { grid-column: 1; grid-row: auto; } }

/* ---------- PHONE: the first screen shows tracks, not chrome ---------- */
@media (max-width: 760px) {
  .hdr .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; width: 100%; }
  .hdr .nav::-webkit-scrollbar { display: none; }
  .hdr .nav > button, .hdr .nav > div > button { flex: none; padding: 6px 8px; font-size: 10px; }
  .scene-art { min-height: 0; padding: 12px 12px 14px; background-size: cover; }
  .scene-copy h1 { font-size: 16px; line-height: 1.3; }
  .scene-copy p { font-size: 11px; max-width: none; }
  .scene-foot { padding: 6px 10px; }
  .scene-foot .scene-lore > span:last-child { display: none; }
  .scene-lore b { font-size: 9px; }
  .arcade-chip { width: 40px; height: 46px; box-shadow: 2px 2px 0 var(--o); }
  .arcade-chip svg { width: 22px; height: 30px; }
  .arcade-chip::after { display: none; }
  body:not(.has-track) .player { grid-template-columns: minmax(0, 1fr) auto; min-height: 52px; padding: 6px 12px; }
  body:not(.has-track) .player .p-ctrl { grid-column: 2; grid-row: 1; }
  body:not(.has-track) .player .p-keys, body:not(.has-track) .player #p-sfx, body:not(.has-track) .player #p-dig, body:not(.has-track) .player #p-queue { display: none; }
  .sc-login { order: 2; margin: 4px 0 0; }
  .ld-dlg { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; } .ld-port { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; } .ld-port canvas { width: 48px; height: 48px; }
  .ld-line { font-size: 15px; min-height: 4.5em; } .ld-opt { grid-template-columns: 16px minmax(0, 1fr); } .ld-opt span { grid-column: 2; } .ld-card { padding-top: 6vh; }
}

@media (max-width: 760px) { body:not(.has-track) .player > :not(.p-now):not(.p-ctrl) { display: none !important; } }

/* ---------- READABILITY: filters and headings a size up, numbers you can read, signals that pop ---------- */
.ph, .panel .ph { font-size: 13px; letter-spacing: .06em; }
.index-marker { font-size: 11px; padding: 2px 6px; }
.genre-row .ph, .year-row .ph, .key-row .ph { font-size: 13px; }
.gchips { gap: 7px; }
.gchips .gchip { height: 30px; padding: 0 12px 0 14px; font-size: 12.5px; border-width: 1.5px; border-color: var(--ink); }
.gchips .gchip span { font-size: 12px; font-family: var(--mono); }
.erabar > button b { font-size: 15px; font-weight: 700; color: var(--ink); }
.erabar > button span, .erabar button span { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--o); letter-spacing: 0; }
.erabar > button { min-height: 44px; border: 1.5px solid #13131355; }
.erabar > button.on b, .erabar > button.on span { color: var(--ink); }
.subtabs button { font-size: 11px; height: 30px; }
.tabsbar .tabs button { font-size: 12px; }
.sortbtn { font-size: 11px; }
.r-title { font-size: 13.5px; }
.tag { font-size: 10.5px; }

/* ---------- SIDE PANELS: framed, coloured, a holographic sheen ---------- */
.side { gap: 18px; }
.side > .panel, .side .panel { position: relative; border: 1.5px solid var(--ink); border-top: 4px solid var(--o); background: #fbf8f0;
  box-shadow: 4px 4px 0 #13131322, 0 0 0 1px #fff inset; overflow: hidden; }
.side .panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 20%, #ff4f1730 38%, #7dd3fc33 50%, #c4b5fd33 58%, transparent 75%); background-size: 280% 100%;
  animation: holo 9s linear infinite; }
.side .panel .ph { color: var(--ink); }
.side .panel .ph .sl { color: var(--o); text-shadow: 0 0 8px #ff4f1799; }
.side .panel:hover { box-shadow: 4px 4px 0 var(--o), 0 0 18px #ff4f1733; }
@keyframes holo { from { background-position: 140% 0; } to { background-position: -140% 0; } }
@media (prefers-reduced-motion: reduce) { .side .panel::before { animation: none; } }

/* ---------- DIALOG BOXES: each section's explainer is the observer talking, on screen, VGM style ---------- */
.dlg.scene--strip, .scene-foot.dlg { background: var(--ink) !important; color: var(--paper); border: 2px solid var(--ink) !important; outline: 2px solid #f1ede4; outline-offset: -5px;
  box-shadow: 5px 5px 0 var(--o); padding: 12px 14px !important; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; min-height: 0; }
.scene-foot.dlg { grid-template-columns: 56px minmax(0, 1fr) auto; margin: 0; }
.dlg .scene-face { width: 48px; height: 48px; border: 2px solid #f1ede4; background: #000; box-shadow: 3px 3px 0 var(--o); }
.dlg.scene--strip .scene-face { width: 40px; height: 40px; }
.dlg .scene-face canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.dlg-body { position: relative; display: grid; gap: 4px; padding-top: 10px; min-width: 0; }
.dlg-name { position: absolute; top: -20px; left: 0; padding: 2px 8px; font: 9px var(--pixel); letter-spacing: .1em; color: var(--ink); background: var(--o); border: 2px solid #f1ede4; }
.dlg-body b.dlg-line { font: 12px/1.45 var(--pixel); letter-spacing: .04em; color: #fff8ea; }
.dlg-body span.dlg-line { font: 12px/1.5 var(--mono); color: #e2d9c5; display: block !important; }
.dlg-caret { position: absolute; right: 0; bottom: -4px; color: var(--o); font-size: 10px; animation: quest-blink .8s steps(2, end) infinite; }
.dlg-body.typing .dlg-caret { opacity: 0; animation: none; }
.dlg-body.typing .dlg-line:not(:empty)::after { content: "▌"; color: var(--o); }
.scene--strip.dlg { margin-bottom: 14px; }

/* ---------- TWIN % + BLEND ATTRACT SCREEN ---------- */
.twin-tier { display: grid; justify-items: end; gap: 2px; }
.twin-tier em { font: 22px/1 var(--pixel); color: var(--o); font-style: normal; text-shadow: 2px 2px 0 #13131322; }
.twin-tier small { font: 8px var(--pixel); letter-spacing: .08em; color: var(--ink); }
.blend-candidate.twin.twin-first .twin-tier em { font-size: 30px; }
.twin-body small strong { color: var(--o); font-size: 12px; }
.bduel-tier i { font-style: normal; color: #ffb08a; }
.blend-attract { grid-column: 1 / -1; position: relative; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr auto; gap: 8px 18px; align-items: center;
  min-height: 230px; padding: 16px 22px 14px; margin-bottom: 8px; color: var(--paper); background: #0d0f0b; border: 2px solid var(--ink); outline: 2px solid #f1ede4; outline-offset: -6px;
  box-shadow: 6px 6px 0 var(--o); cursor: pointer; overflow: hidden; text-align: center; }
.blend-attract::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(135deg, #ff4f1724 0 8px, transparent 8px 20px), url('/web/art/city-signal.jpg') center 60% / cover; filter: grayscale(1) brightness(.35);
  animation: ba-stripes 14s linear infinite; }
.blend-attract > * { position: relative; }
.ba-hp { grid-row: 1; display: grid; gap: 4px; font: 9px var(--pixel); letter-spacing: .06em; }
.ba-a-hp { grid-column: 1; justify-items: start; text-align: left; } .ba-b-hp { grid-column: 3; justify-items: end; text-align: right; }
.ba-hp i { display: block; width: 100%; height: 10px; border: 1.5px solid #f1ede4; background: #3a0f05; position: relative; }
.ba-hp i::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--hp); background: linear-gradient(90deg, #ffd23f, #ff4f17); animation: ba-hp 3.2s cubic-bezier(.22,1,.36,1) infinite; }
.ba-b-hp i::after { left: auto; right: 0; }
.ba-side { grid-row: 2; display: grid; justify-items: center; gap: 8px; font: 11px var(--pixel); letter-spacing: .06em; }
.ba-side img { width: 92px; height: 92px; object-fit: cover; border: 3px solid #f1ede4; box-shadow: 5px 5px 0 var(--o); background: #222; image-rendering: pixelated; }
.ba-a { grid-column: 1; animation: ba-bob 1.2s steps(2, end) infinite; } .ba-b { grid-column: 3; animation: ba-bob 1.2s steps(2, end) .6s infinite; }
.ba-vs { grid-row: 2; grid-column: 2; font: 48px/1 var(--pixel); color: var(--o); text-shadow: 4px 4px 0 #f1ede4; animation: ba-vs 1.6s cubic-bezier(.22,1,.36,1) infinite; }
.ba-cta { grid-row: 3; grid-column: 1 / -1; font: 11px var(--pixel); letter-spacing: .1em; color: #fff8ea; animation: quest-blink 1s steps(2, end) infinite; }
.blend-attract:hover { box-shadow: 8px 8px 0 var(--o), 0 0 24px #ff4f1755; }
.blend-attract:hover .ba-vs { animation-duration: .5s; }
.blend-attract:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--o); }
@keyframes ba-bob { 50% { transform: translateY(-5px); } }
@keyframes ba-vs { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.15) rotate(3deg); } }
@keyframes ba-hp { 0% { width: 8%; } 60%, 100% { width: var(--hp); } }
@keyframes ba-stripes { from { background-position: 0 0, center 60%; } to { background-position: 280px 0, center 60%; } }
@media (max-width: 760px) { .blend-attract { min-height: 190px; padding: 12px; gap: 6px 10px; } .ba-side img { width: 64px; height: 64px; } .ba-vs { font-size: 32px; } .ba-cta { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { .ba-a, .ba-b, .ba-vs, .ba-hp i::after, .blend-attract::before, .ba-cta { animation: none; } }

/* arcade: arrives like a cartridge sliding in, then glows while it waits for you */
.loading-arcade.arcade-enter { animation: arcade-in 520ms cubic-bezier(.22,1,.36,1) both, arcade-glow 1.6s cubic-bezier(.22,1,.36,1) 520ms 4; }
@keyframes arcade-in { 0% { transform: translateY(120%) rotate(4deg); } 70% { transform: translateY(-8px) rotate(-1deg); } 100% { transform: none; } }
@keyframes arcade-glow { 50% { box-shadow: 0 0 0 3px var(--o), 0 0 28px #ff4f17aa, 4px 5px 0 #000; } }
.loading-arcade .arcade-status { font-size: 11px; color: #ffd9c4; }
@media (prefers-reduced-motion: reduce) { .loading-arcade.arcade-enter { animation: none; } }

/* ---------- MOTION, BACK UP FRONT: the city has room to move, sections wipe in ---------- */
@media (min-width: 761px) { .scene:not(.scene--strip):not(.scene--compact) .scene-art { min-height: 178px; padding: 20px 20px 26px; } .scene-copy h1 { font-size: 26px; } }
.v-enter { animation: v-wipe 300ms cubic-bezier(.22,1,.36,1) both !important; }
@keyframes v-wipe { 0% { clip-path: inset(0 100% 0 0); transform: translateX(-10px); } 100% { clip-path: inset(0 0 0 0); transform: none; } }
.row.current { box-shadow: inset 4px 0 0 var(--o), 0 0 0 1px #ff4f1755, 0 0 22px #ff4f1726; }
.row:hover .r-play, .card:hover .r-play { transform: scale(1.08); transition: transform 90ms cubic-bezier(.22,1,.36,1); }
@media (prefers-reduced-motion: reduce) { .v-enter { animation: none !important; } }

/* ---------- PROFILE & SETTINGS ---------- */
.profile-modal { z-index: 420; }
.pf-card { width: min(760px, 96vw); max-height: 92vh; overflow: auto; border: 2px solid var(--ink); border-top: 4px solid var(--o); box-shadow: 6px 6px 0 var(--o); }
.pf-note { font-size: 11.5px; background: #fff3ea; border-left: 3px solid var(--o); padding: 8px 10px; margin: 0 0 12px; }
.pf-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; }
.pf-pic { display: grid; gap: 8px; align-content: start; justify-items: center; }
.pf-img { width: 150px; height: 150px; object-fit: cover; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--o); background: #222; }
.pf-fields { display: grid; gap: 12px; }
.pf-fields label { display: grid; gap: 5px; font: 9px var(--pixel); letter-spacing: .08em; }
.pf-fields label small { font: 10px var(--mono); letter-spacing: 0; color: var(--muted); }
.pf-fields input, .pf-fields textarea { font: 13px var(--mono); padding: 8px 10px; border: 1px solid var(--ink); background: #fbf8f0; width: 100%; resize: vertical; }
.pf-fields input:focus, .pf-fields textarea:focus { outline: 2px solid var(--o); outline-offset: 1px; }
.pf-h { font: 12px var(--pixel); letter-spacing: .08em; margin: 20px 0 8px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.pf-settings { display: grid; gap: 10px; }
.pf-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12.5px; cursor: pointer; }
.pf-toggle input { width: 18px; height: 18px; accent-color: var(--o); }
.pf-toggle small { display: block; font-size: 10.5px; color: var(--muted); }
.pf-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pf-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; }
.pf-err { margin-right: auto; color: #b42318; font-size: 12px; }
@media (max-width: 760px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } }
.side > .panel, .side .panel { flex-shrink: 0; }
.scene--strip.dlg { margin-top: 16px; }

/* Key / BPM is parked for now (KEYS_ENABLED in app.js) */
.key-row, [data-kd-open], .kchip, #kd-modal, .archive-tools [data-archive-nav="keys"] { display: none !important; }

/* genre colour = the same on every tag and on the taste map (genre-colors.js) */
.gchips .gchip:not(.all) { box-shadow: inset 4px 0 0 var(--gc, #ff4f17), 0 1px 0 var(--ink) !important; }
.gchips .gchip:not(.all) span { color: var(--gc, #ff4f17); filter: brightness(.85); }
.gchips .gchip:not(.all):hover { background: color-mix(in srgb, var(--gc, #ff4f17) 12%, #fbf8f0); border-color: var(--gc, #ff4f17); }
.gchips .gchip.on:not(.all) { background: var(--gc, #ff4f17) !important; color: #fff !important; border-color: var(--ink); }
.gchips .gchip.on:not(.all) span { color: #fff; filter: none; }
.row .tag[data-genre] { border-left: 3px solid var(--gc, transparent); }

/* ---------- DISCOVER HUB: twins + talkers above the people / tracks ---------- */
.disc-hub { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; padding: 14px 12px 4px; }
.disc-hub .panel { border: 1.5px solid var(--ink); border-top: 4px solid var(--o); background: #fbf8f0; padding: 12px 14px; }
.disc-hub .hint { font-size: 11.5px; margin: 4px 0 10px; }
.hub-twins-grid { display: grid; gap: 8px; }
.hub-twins-grid .blend-candidate.twin { cursor: default; min-height: 0; }
.twin-acts { display: flex; gap: 6px; margin-top: 6px; }
.twin-acts .btn.sm { height: 24px; padding: 0 9px; font-size: 9px; }
.discovery-switch button { font-size: 11px; }
@media (max-width: 900px) { .disc-hub { grid-template-columns: minmax(0, 1fr); } }

/* ---------- BLEND ARENA: a fighting-game stage with two name boxes ---------- */
.blend-arena-page { padding: 14px; }
.arena { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; gap: 12px 22px; align-items: center;
  min-height: 420px; padding: 20px 26px 18px; color: var(--paper); background: #0d0f0b; border: 2px solid var(--ink); outline: 2px solid #f1ede4; outline-offset: -7px; box-shadow: 7px 7px 0 var(--o); overflow: hidden; }
.arena::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: repeating-linear-gradient(135deg, #ff4f1722 0 8px, transparent 8px 22px), url('/web/art/city-signal.jpg') center 62% / cover; filter: grayscale(1) brightness(.33); animation: ba-stripes 16s linear infinite; }
.arena > * { position: relative; }
.arena-hp { grid-row: 1; display: grid; gap: 5px; font: 9px var(--pixel); letter-spacing: .06em; }
.arena-hp.a { grid-column: 1; } .arena-hp.b { grid-column: 3; justify-items: end; text-align: right; }
.arena-hp i { display: block; width: 100%; height: 12px; border: 2px solid #f1ede4; background: #3a0f05; position: relative; }
.arena-hp i::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--hp, 8%); background: linear-gradient(90deg, #ffd23f, #ff4f17); transition: width 500ms cubic-bezier(.22,1,.36,1); }
.arena-hp.b i::after { left: auto; right: 0; }
.arena-side { grid-row: 2; display: grid; justify-items: center; gap: 10px; }
.arena-side.a { grid-column: 1; } .arena-side.b { grid-column: 3; }
.arena-pic { width: 128px; height: 128px; border: 3px solid #f1ede4; box-shadow: 6px 6px 0 var(--o); background: #1b1b1b; display: block; animation: ba-bob 1.3s steps(2, end) infinite; }
.arena-side.b .arena-pic { animation-delay: .65s; }
.arena-pic img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.arena-side label { font: 10px var(--pixel); letter-spacing: .12em; color: var(--o); }
.arena-side input { width: min(320px, 100%); height: 40px; padding: 0 12px; text-align: center; font: 13px var(--mono); color: var(--ink); background: #f1ede4; border: 2px solid #f1ede4; box-shadow: inset 0 2px 0 #0000001a; }
.arena-side input:focus { outline: 3px solid var(--o); outline-offset: 2px; }
.arena-side.enter .arena-pic { animation: vs-right 320ms cubic-bezier(.22,1,.36,1) both; }
.arena-vs { grid-row: 2; grid-column: 2; font: 64px/1 var(--pixel); color: var(--o); text-shadow: 5px 5px 0 #f1ede4; animation: ba-vs 1.6s cubic-bezier(.22,1,.36,1) infinite; }
.arena-fight { grid-row: 3; grid-column: 1 / -1; justify-self: center; padding: 14px 30px; font: 15px var(--pixel); letter-spacing: .1em; color: #fff8ea; background: var(--o);
  border: 3px solid #f1ede4; box-shadow: 6px 6px 0 #f1ede4; animation: arena-pulse 1.4s cubic-bezier(.22,1,.36,1) infinite; }
.arena-fight:hover { background: #f1ede4; color: var(--ink); box-shadow: 6px 6px 0 var(--o); }
.arena-fight:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 #f1ede4; }
.arena-fight:disabled { opacity: .6; animation: none; }
.arena-rules { grid-row: 4; grid-column: 1 / -1; margin: 0; text-align: center; font: 12px/1.55 var(--mono); color: #e2d9c5; max-width: 640px; justify-self: center; }
@keyframes arena-pulse { 50% { box-shadow: 6px 6px 0 #f1ede4, 0 0 26px #ff4f17; } }
.roster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.roster-head h2 { font: 14px var(--pixel); letter-spacing: .08em; margin: 0; }
.roster-head .hint { font-size: 11.5px; }
.blend-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.roster-tile { display: grid; justify-items: center; gap: 6px; padding: 10px 8px; background: #fbf8f0; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.roster-tile img { width: 72px; height: 72px; object-fit: cover; border: 2px solid var(--ink); background: #222; }
.roster-tile b { font: 9px var(--pixel); letter-spacing: .04em; text-align: center; }
.roster-tile em { font: 14px var(--pixel); color: var(--o); font-style: normal; }
.roster-tile:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--o); border-color: var(--o); }
.roster-tile.picked { background: var(--ink); color: var(--paper); border-color: var(--o); box-shadow: 0 3px 0 var(--o), 0 0 16px #ff4f1766; }
.roster-tile.picked img { border-color: var(--o); }
@media (max-width: 760px) { .arena { min-height: 0; padding: 14px 12px; gap: 10px; } .arena-pic { width: 84px; height: 84px; } .arena-vs { font-size: 36px; } .arena-side input { height: 36px; font-size: 12px; } .arena-fight { font-size: 12px; padding: 12px 18px; } }
@media (prefers-reduced-motion: reduce) { .arena::before, .arena-pic, .arena-vs, .arena-fight { animation: none; } }

#view-blend #blend-scene { display: none; } /* the arena explains itself */

/* ---------- HEADINGS: a readable pixel face for the things you read first; Silkscreen stays for small labels ---------- */
:root { --head: "Pixelify Sans", "Silkscreen", monospace; }
.scene-copy h1, .blend-chooser h1, .dig-head h3, .quest-title {
  font-family: var(--head); font-weight: 700; letter-spacing: .01em; text-transform: none; }
.scene-copy h1 { font-size: 34px; line-height: 1.12; max-width: 520px; text-shadow: 2px 2px 0 #f1ede4; }
.scene-copy .eyebrow { font: 11px var(--pixel); letter-spacing: .14em; color: var(--o); }
.scene-copy p { font-size: 13px; line-height: 1.55; color: #2b2924; max-width: 380px; }
.roster-head h2, .blend-candidates .twin-head h2, .blend-any-h, .pf-h, .dig h4 { font-family: var(--head); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.ph, .panel .ph { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: .03em; }
.dlg-body b.dlg-line { font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: .03em; line-height: 1.4; }
.quest-title { font-size: 22px; }
.arena-side label, .arena-hp b, .ba-hp b { font-family: var(--head); font-weight: 600; font-size: 13px; letter-spacing: .06em; }
.arena-fight { font-family: var(--head); font-weight: 700; font-size: 20px; letter-spacing: .06em; }
.arena-vs { font-family: var(--head); font-weight: 700; font-size: 76px; }
.ld-way b { font-family: var(--head); font-weight: 700; font-size: 16px; letter-spacing: .03em; }
.roster-tile b { font-family: var(--head); font-weight: 600; font-size: 12px; }
.twin-tier em, .roster-tile em { font-family: var(--head); font-weight: 700; }
.lurk-btn { letter-spacing: .08em; }
.lurk-btn .ic { width: 13px; height: 13px; margin-right: 4px; }
@media (max-width: 760px) { .scene-copy h1 { font-size: 22px; } .ph, .panel .ph { font-size: 15px; } .arena-vs { font-size: 44px; } }

.side .panel .ph, #taste-panel .ph { font-family: var(--head) !important; font-weight: 600; font-size: 17px !important; }


/* ---------- FLUID PASS: interface motion eases (pixel sprites and LEDs keep their steps) ---------- */
.v-enter { animation: v-flow 420ms cubic-bezier(.22,1,.36,1) both !important; }
@keyframes v-flow { 0% { opacity: 0; transform: translateY(10px); filter: blur(3px) saturate(.6); } 60% { opacity: 1; filter: blur(0) saturate(1); } 100% { transform: none; } }
.tdr-stamp.in { animation: tdr-in2 420ms cubic-bezier(.22,1,.36,1) forwards !important; }
.tdr-stamp.out { animation: tdr-out2 380ms cubic-bezier(.55,0,.75,.2) forwards !important; }
@keyframes tdr-in2 { 0% { opacity: 0; transform: translateX(40px) skewX(-8deg); clip-path: inset(0 0 0 100%); } 60% { opacity: 1; transform: translateX(-4px) skewX(2deg); clip-path: inset(0 0 0 0); } 100% { transform: none; } }
@keyframes tdr-out2 { to { opacity: 0; transform: translateX(30px); clip-path: inset(0 0 0 100%); } }
.tdr-stamp { box-shadow: 0 0 0 1px #ff4f1755, 0 0 24px #ff4f1733; }
.vs-hp i::after, .ba-hp i::after, .arena-hp i::after { transition: width 900ms cubic-bezier(.22,1,.36,1) !important; animation-timing-function: cubic-bezier(.22,1,.36,1) !important; animation-duration: 1100ms !important; }
.row, .card, .panel, .gchip, .erabar > button, .btn, .roster-tile { transition-timing-function: cubic-bezier(.22,1,.36,1); }

/* duel health bars that stay on the page after the fight: size of each collection, orange = what they share */
.bduel-hp { display: block; width: min(220px, 100%); height: 12px; margin: 0 auto 10px; border: 2px solid var(--ink); background: #3a0f05; position: relative; overflow: hidden; box-shadow: 2px 2px 0 #13131333; }
.bduel-hp::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: linear-gradient(90deg, #ffd23f, #ffb347); transition: width 1100ms cubic-bezier(.22,1,.36,1) 150ms; }
.bduel-hp i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--o); box-shadow: 0 0 10px #ff4f17; transition: width 1300ms cubic-bezier(.22,1,.36,1) 600ms; }
.bduel-hp.b::before, .bduel-hp.b i { left: auto; right: 0; }
.bduel-hp.full::before { width: var(--hp); }
.bduel-hp.full i { width: calc(var(--hp) * var(--sh-n, 1)); width: min(var(--hp), var(--sh)); }
.dlg-em { color: #ff8a4c; font-weight: 800; text-shadow: 0 0 10px #ff4f1766; }
.dlg-body b.dlg-line .dlg-em { color: #ffb08a; }
.dlg-body.typing .dlg-line:empty::after { content: ""; }

/* the page flows in as the curtain dissolves: header drops, panels rise in a stagger */
body.flowing .hdr { animation: flow-down 600ms cubic-bezier(.22,1,.36,1) both; }
body.flowing .main > *:not(.hidden), body.flowing .side > * { animation: flow-up 700ms cubic-bezier(.22,1,.36,1) both; }
body.flowing .side > *:nth-child(2) { animation-delay: 80ms; } body.flowing .side > *:nth-child(3) { animation-delay: 160ms; } body.flowing .side > *:nth-child(4) { animation-delay: 240ms; }
body.flowing .player { animation: flow-player 700ms cubic-bezier(.22,1,.36,1) 200ms both; }
@keyframes flow-down { from { transform: translateY(-100%); } }
@keyframes flow-up { from { opacity: 0; transform: translateY(18px); filter: blur(2px); } }
@keyframes flow-player { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { body.flowing * { animation: none !important; } }

/* home hero: splat render replaces the flat image */
.scene-art.has-splat { background-image: none !important; background-color: #efe9dc; }
.splat-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scene-art.has-splat .live-layer { z-index: 1; mix-blend-mode: multiply; }
.scene-art.has-splat .scene-copy { position: relative; z-index: 2; }
.scene-art.has-splat .scene-copy h1 { text-shadow: 0 0 12px #efe9dc, 0 0 2px #efe9dc; }

.dlg-body .dlg-em, .scene-lore .dlg-em { color: #ff8a4c !important; font-weight: 800; font-size: inherit !important; background: none; text-shadow: 0 0 10px #ff4f1766; }
.dlg-body b.dlg-line .dlg-em { color: #ffb08a !important; }

/* ---------- ARENA v2: mode toggle, matches dropdown, full roster ---------- */
.arena-mid { grid-row: 2; grid-column: 2; display: grid; justify-items: center; gap: 14px; }
.arena-mode { display: inline-flex; border: 2px solid #f1ede4; background: #0d0f0b; box-shadow: 3px 3px 0 var(--o); }
.arena-mode button { padding: 8px 12px; font: 600 11px var(--head); letter-spacing: .06em; color: #e2d9c5; background: transparent; border: 0; transition: background 220ms cubic-bezier(.22,1,.36,1), color 220ms; }
.arena-mode button.on { background: var(--o); color: #fff8ea; }
.arena-me { font: 700 13px var(--head); letter-spacing: .06em; color: #fff8ea; padding: 9px 14px; border: 2px dashed #f1ede466; }
.arena.mode-match #blend-choose-a, .arena.mode-match #blend-choose-b { display: none; }
.arena.mode-any .arena-me, .arena.mode-any .arena-pick { display: none; }
.arena-pick { display: inline-flex; align-items: center; gap: 10px; min-width: min(320px, 100%); justify-content: space-between; padding: 10px 14px; font: 700 13px var(--head); letter-spacing: .05em;
  color: var(--ink); background: #f1ede4; border: 2px solid #f1ede4; box-shadow: 4px 4px 0 var(--o); cursor: pointer; transition: transform 160ms cubic-bezier(.22,1,.36,1), box-shadow 160ms; }
.arena-pick:hover { transform: translate(-1px, -2px); box-shadow: 6px 6px 0 var(--o); }
.arena-pick i { font-style: normal; color: var(--o); }
.arena-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(360px, 90vw); max-height: 320px; overflow: auto;
  background: #0d0f0b; border: 2px solid #f1ede4; box-shadow: 6px 6px 0 var(--o); animation: list-in 240ms cubic-bezier(.22,1,.36,1) both; }
.arena-side.b { position: relative; }
.arena-list button { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 7px 10px; background: none; border: 0; border-bottom: 1px solid #ffffff14; color: #f1ede4; text-align: left; cursor: pointer; }
.arena-list button:hover { background: #ff4f1722; }
.arena-list img { width: 34px; height: 34px; object-fit: cover; }
.arena-list b { font: 600 12px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-list em { font: 700 13px var(--head); color: var(--o); font-style: normal; }
@keyframes list-in { from { opacity: 0; transform: translate(-50%, -6px); } }
.arena-rules b { color: #ff8a4c; }
.roster-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.roster-tools input { flex: 1 1 200px; height: 34px; padding: 0 12px; font: 13px var(--mono); border: 1.5px solid var(--ink); background: #fbf8f0; }
.roster-tools input:focus { outline: 2px solid var(--o); }
.roster-tile small { font: 10px var(--mono); color: var(--muted); }
.roster-tile.ghost { background: #f3efe6; border-style: dashed; }
.roster-tile.ghost em { color: var(--muted); }
.roster-head.more { margin-top: 26px; }
.roster-tile { transition: transform 200ms cubic-bezier(.22,1,.36,1), box-shadow 200ms, border-color 200ms; }

.arena { overflow: visible; }
.arena::before { overflow: hidden; }

/* ---------- MORE LIKE THIS ---------- */
.r-likeit { width: 28px; height: 28px; display: inline-grid; place-items: center; font: 700 16px var(--head); color: var(--o); background: #fff3ea; border: 1.5px solid var(--o);
  box-shadow: 0 2px 0 #7a240a; transition: transform 160ms cubic-bezier(.22,1,.36,1), background 160ms; cursor: pointer; }
.r-likeit:hover { background: var(--o); color: #fff8ea; transform: translateY(-1px) rotate(-6deg); }
.r-likeit:active { transform: translateY(2px); box-shadow: none; }
.more-card { width: min(1100px, 96vw); max-height: 92vh; overflow: auto; border: 2px solid var(--ink); border-top: 4px solid var(--o); box-shadow: 6px 6px 0 var(--o); }
.more-card .modal-head .hint { font-size: 12px; margin: 4px 0 0; }
.more-card .modal-head .hint b { color: var(--o); }
#more-modal:not(.hidden) .more-card { animation: flow-up 420ms cubic-bezier(.22,1,.36,1) both; }

/* ---------- THE WATCHER as the logo: his living portrait in a little framed window ---------- */
.logo-mark.hero-mark { width: 40px; height: 40px; image-rendering: pixelated; border: 2px solid var(--ink, #131313); box-shadow: 3px 3px 0 var(--o); background: #131313; flex: none; }
.logo:hover .hero-mark { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--o); transition: transform 160ms cubic-bezier(.22,1,.36,1), box-shadow 160ms; }
@media (max-width: 760px) { .logo-mark.hero-mark { width: 30px; height: 30px; box-shadow: 2px 2px 0 var(--o); } }
.scene-run { height: 34px !important; }

/* ---------- TALKING TEXT (text.js): a rounded game font, letters that pop in and bob, Paper Mario / SM64 style ---------- */
:root { --talk: "Pixelify Sans", "Silkscreen", monospace; --body: "JetBrains Mono", ui-monospace, monospace; }
.tx-w { display: inline-block; white-space: nowrap; }
.tx-c { display: inline-block; white-space: pre; }
.tx-c.tx-sp { display: inline; white-space: normal; }
.tx-c:not(.on) { visibility: hidden; }

@keyframes tx-pop { from { scale: .3; opacity: .3; translate: 0 4px; } to { scale: 1; opacity: 1; translate: 0 0; } }
.tx-em { color: #ff9a5c; }

.tx-done .tx-em .tx-c { animation: tx-hop 520ms steps(4, end) calc((var(--i) - var(--i0)) * 40ms) 2 both; }
@keyframes tx-wave { 0% { translate: 0 0; } 20% { translate: 0 -1px; } 40% { translate: 0 -2px; } 60% { translate: 0 -1px; } 80% { translate: 0 1px; } }
.tx-done .tx-shake .tx-c { animation: tx-shake 240ms steps(1, end) calc(var(--i) * -60ms) 3; }
@keyframes tx-hop { 0%, 100% { translate: 0 0; } 30% { translate: 0 -3px; } 60% { translate: 0 1px; } }
@keyframes tx-shake { 0% { translate: 1px 0; } 25% { translate: -1px 1px; } 50% { translate: 0 -1px; } 75% { translate: -1px 0; } }
@media (prefers-reduced-motion: reduce) { .tx-c.on, .tx-em .tx-c.on, .tx-shake .tx-c.on { animation: none !important; } }

/* dialog boxes speak in it: white letters with a hard one-pixel drop, like an N64 text box */
.dlg-body b.dlg-line, .scene-lore b.dlg-line { font: 600 15px/1.4 var(--talk) !important; letter-spacing: .03em !important; color: #fff8ea !important; text-shadow: 0 2px 0 #000 !important; text-transform: none !important; }
.dlg-body span.dlg-line, .scene-lore span.dlg-line { font: 400 12.5px/1.55 var(--body) !important; color: #e2d9c5 !important; letter-spacing: .01em; text-shadow: 0 1px 0 #000; }
.dlg-body .tx-em, .scene-lore .tx-em { color: #ff9a5c !important; font-weight: 700; text-shadow: 0 2px 0 #3a1404 !important; }
.dlg-body.typing .dlg-line:not(:empty)::after { content: none; }
.dlg-name { font: 700 11px var(--talk) !important; letter-spacing: .08em !important; }
.ld-line { font: 600 16px/1.5 var(--talk) !important; text-shadow: 0 2px 0 #000; }
.ld-line .tx-em { color: #ff9a5c; text-shadow: 0 2px 0 #3a1404; }

/* ---------- page titles: the same rounded game face, calm ink on paper, the handle in orange with a hard ink drop ---------- */
.scene-copy h1 { font: 700 34px/1.1 var(--talk) !important; letter-spacing: .01em !important; color: #1a1d17 !important; text-shadow: none !important; text-transform: none !important; max-width: 560px; }
.scene-copy h1 .tx-em { color: #ff5b1c; text-shadow: 0 3px 0 #1a1d17; }
.scene-copy p { font: 400 13px/1.55 var(--body); color: #3a372f; }
.scene-copy .eyebrow { font: 700 12px var(--talk); letter-spacing: .14em; }
@media (max-width: 760px) { .scene-copy h1 { font-size: 26px !important; } .scene-copy p { font-size: 13.5px; } }

/* ---------- GRIT: boxes snap open in hard frames, like a cartridge text window ---------- */
.dlg.dlg-open { animation: dlg-open 200ms steps(4, end) both; }
@keyframes dlg-open { from { clip-path: inset(46% 0 46% 0); } to { clip-path: inset(0 0 0 0); } }
.ld-dlg { animation: ld-box-grit 260ms steps(5, end) 1100ms both !important; }
@keyframes ld-box-grit { from { clip-path: polygon(6px 48%, calc(100% - 6px) 48%, 100% 48%, 100% 52%, calc(100% - 6px) 52%, 6px 52%, 0 52%, 0 48%); opacity: 1; } to { clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); } }
.ld-opt.on i { animation: ld-nudge-grit .6s steps(2, end) infinite !important; }
@keyframes ld-nudge-grit { 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .dlg.dlg-open, .ld-dlg { animation: none !important; } }

/* =====================================================================================================================
   PHONE: designed for a thumb, not shrunk from the desktop. Tabs live at the bottom, the player sits right above them,
   the header scrolls away, filters are one swipeable row each, and a track row is one line of art + title + menu
   (tap the row to play; ⋯ holds more-like-this, crate, queue). Text never drops below 12.5px.
   ===================================================================================================================== */
@media (max-width: 760px) {
  :root { --tab-h: 62px; --pl-h: 58px; --safe-b: env(safe-area-inset-bottom, 0px); }
  html { -webkit-text-size-adjust: 100%; }
  body { padding-bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b) + 16px) !important; }

  /* header: logo + avatar on one line, search under it; it scrolls away so content gets the screen */
  .hdr { position: relative !important; display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo . me" "search search search"; gap: 8px 10px; padding: 10px 14px 10px !important; min-height: 0 !important; }
  .hdr .logo { grid-area: logo; gap: 8px; } .hdr .me { grid-area: me; width: 34px; height: 34px; }
  .hdr .logo-wordmark { height: 20px !important; width: auto !important; }
  .hdr .tagline { display: none !important; }
  .hdr .search { grid-area: search; width: 100% !important; height: 42px; margin: 0 !important; }
  .hdr .search input { font-size: 15px !important; } /* 16px-ish so iOS doesn't zoom the page on focus */
  .hdr .search kbd { display: none; }
  .hdr .sc-login { grid-area: search; justify-self: end; align-self: start; margin-top: -44px !important; }

  /* the tabs: a fixed bottom bar, icon over label, a big target each, the current one lit with an orange cap */
  .hdr .nav { position: fixed !important; z-index: 120; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding: 0 4px var(--safe-b) !important;
    display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 !important; margin: 0 !important; width: auto !important; overflow: visible !important;
    background: #0d0f0b; border-top: 2px solid #2b3128; box-shadow: 0 -8px 24px #0006; }
  .hdr .nav > button, .hdr .nav > .nav-drop > button { display: grid !important; grid-template-rows: 26px auto; justify-items: center; align-content: center; gap: 3px; height: var(--tab-h);
    padding: 0 2px !important; font: 600 11px var(--talk) !important; letter-spacing: .02em !important; color: #a39c8d !important; background: none !important; border: 0 !important; box-shadow: none !important; position: relative; white-space: nowrap; min-width: 0; }
  .hdr .nav > .nav-drop { display: contents; }
  .hdr .nav .ic { width: 22px !important; height: 22px !important; }
  .hdr .nav .ic.chev { display: none; }
  .hdr .nav button.on { color: #fff8ea !important; }
  .hdr .nav button.on::before { content: "" !important; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--o); }
  .hdr .nav button.on .ic { color: var(--o); }
  .hdr .nav .nav-badge { position: absolute; top: 6px; right: calc(50% - 20px); }
  .hdr .nav .nav-drop .menu { position: fixed !important; left: 10px !important; right: 10px !important; top: auto !important; bottom: calc(var(--tab-h) + var(--safe-b) + 8px) !important; max-height: 60vh; overflow: auto; }

  /* the player: a slim bar above the tabs. Art, title, play, dice; the waveform becomes a progress line on top */
  .player { bottom: calc(var(--tab-h) + var(--safe-b)) !important; left: 0 !important; right: 0 !important; height: var(--pl-h) !important; min-height: 0 !important;
    display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px !important; padding: 0 8px 0 10px !important; z-index: 110; }
  .player > :not(.p-now):not(.p-ctrl):not(.p-wave):not(.song-dice):not(iframe):not(.live-sparks):not(.queue-pop) { display: none !important; }
  .player .p-now { display: grid !important; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
  .player .p-now img { width: 42px !important; height: 42px !important; }
  .player .p-now .p-btn, .player .p-date { display: none !important; }
  .player .p-title { font: 600 13.5px/1.2 var(--body) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .player .p-artist { font-size: 12.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .player .p-ctrl { display: flex !important; gap: 0; }
  .player .p-ctrl > :not(.p-play) { display: none !important; }
  .player .p-play { width: 46px !important; height: 46px !important; }
  .player .song-dice { width: 44px; height: 44px; } .player .song-dice kbd { display: none; }
  .player .p-wave { position: absolute !important; left: 0; right: 0; top: -2px; height: 4px !important; pointer-events: none; }
  .player .p-wave canvas { width: 100% !important; height: 4px !important; }
  body:not(.has-track) .player .p-wave { display: none !important; }

  /* the arcade chip: tucked bottom-right above the player, small */
  .arcade-chip { top: auto !important; bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b) + 12px) !important; right: 12px !important; width: 40px !important; height: 44px !important; }

  /* hero + dialog: shorter, readable */
  .scene-art { padding: 16px 14px 14px !important; min-height: 0 !important; }
  .scene-copy .eyebrow { font-size: 11px; }
  .scene-copy h1 { font-size: 26px !important; line-height: 1.12 !important; }
  .scene-copy p { font-size: 12.5px !important; line-height: 1.5 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .scene-foot.dlg, .dlg.scene--strip { grid-template-columns: 44px minmax(0, 1fr) !important; gap: 12px !important; padding: 16px 14px 14px !important; }
  .dlg .scene-face { width: 44px !important; height: 44px !important; }
  .dlg-body b.dlg-line, .scene-lore b.dlg-line { font-size: 14px !important; }
  .dlg-body span.dlg-line, .scene-lore span.dlg-line { font-size: 12.5px !important; display: block !important; }
  .scene-legend { display: none !important; }

  /* filters: one swipeable row each instead of a wall of chips */
  .panel.index2 { padding: 12px 0 10px !important; }
  .panel.index2 .ph-row, .panel.index2 .year-row > .ph { padding: 0 14px; }
  .panel.index2 .ph { font-size: 15px !important; }
  .gchips:not(.hidden), .subchips:not(.hidden), .erabar:not(.hidden), .archive-tools:not(.hidden), .tabsbar .tabs { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; gap: 8px !important; padding: 2px 14px 8px !important; margin: 0 !important; }
  .gchips::-webkit-scrollbar, .subchips::-webkit-scrollbar, .erabar::-webkit-scrollbar, .archive-tools::-webkit-scrollbar, .tabsbar .tabs::-webkit-scrollbar { display: none; }
  .gchips > *, .subchips > *, .erabar > *, .archive-tools > *, .tabsbar .tabs > * { flex: none !important; scroll-snap-align: start; min-height: 40px; }
  .erabar > * { min-width: 58px; }
  .genre-row, .year-row { gap: 8px; }

  /* list toolbar: tabs swipe, surprise + sort share one line */
  .tabsbar { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 8px !important; padding: 10px 0 !important; }
  .tabsbar .gridicon, .tabsbar .count { display: none !important; }
  .tabsbar .sortwrap { display: grid !important; grid-template-columns: auto 44px minmax(0, 1fr); gap: 8px; padding: 0 14px; }
  .tabsbar .pick-control small, .tabsbar .surprise-button kbd { display: none; }
  .tabsbar .surprise-button, .tabsbar .shufbtn, .tabsbar .sortbtn { height: 44px; }
  .tabsbar .sortbtn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .panel.listpanel { padding: 0 !important; }

  /* a track row: art · title/artist · ⋯   (tap anywhere to play; the waveform only shows on the playing row) */
  .rows:not(.grid) .row { display: grid !important; grid-template-columns: 56px minmax(0, 1fr) 44px !important; grid-template-areas: "art body more" !important;
    align-items: center; gap: 0 12px !important; padding: 8px 6px 8px 14px !important; min-height: 74px; height: auto !important; border-bottom: 1px solid #00000012; }
  .rows:not(.grid) .row > .r-num, .rows:not(.grid) .row > .r-play, .rows:not(.grid) .row .r-av, .rows:not(.grid) .row > .r-side,
  .rows:not(.grid) .row > .r-likeit, .rows:not(.grid) .row > .r-crate { display: none !important; }
  .rows:not(.grid) .row > .r-art { grid-area: art; width: 56px !important; height: 56px !important; position: relative !important; margin: 0 !important; }
  .rows:not(.grid) .row > .r-art img { width: 100%; height: 100%; object-fit: cover; }
  .rows:not(.grid) .row > .r-body { grid-area: body; min-width: 0; display: grid !important; gap: 2px; }
  .rows:not(.grid) .row .r-title { font: 600 14px/1.3 var(--body) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rows:not(.grid) .row .r-title a { font: inherit !important; }
  .rows:not(.grid) .row .r-artist { font: 400 12.5px/1.3 var(--body) !important; color: #6b665b !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rows:not(.grid) .row .r-wave { display: none !important; }
  .rows:not(.grid) .row.current .r-wave { display: block !important; height: 28px !important; margin-top: 4px; }
  .rows:not(.grid) .row > .r-more { grid-area: more; width: 44px !important; height: 48px !important; display: grid !important; place-items: center; }
  .rows:not(.grid) .row.current > .r-art::after { content: ""; position: absolute; inset: 0; background: #0d0f0b99 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff5b1c' d='M1 2h1v5H1zm2-1h1v7H3zm2 2h1v3H5zm2-1h1v5H7z'/%3E%3C/svg%3E") center / 26px no-repeat; image-rendering: pixelated; }

  /* menus open as bottom sheets you can reach */
  .menu.row-menu, .rowmenu, .menu[data-el="sortmenu"] { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b) + 8px) !important; max-height: 60vh; overflow: auto; z-index: 200; }
  .menu button { min-height: 44px; font-size: 14px !important; }

  /* modals become full-height sheets */
  .modal .modal-card { width: 100% !important; max-width: none !important; max-height: calc(100dvh - 24px) !important; margin: 12px 0 0 !important; border-radius: 0; }
}
@media (max-width: 760px) {
  /* scroll rows must scroll, not stretch their grid parents (which would widen the whole page) */
  html, body { overflow-x: clip; max-width: 100vw; }
  .shell, main, main > *, .view, .panel, .panel.index2 > *, .genre-row, .year-row, .listpanel, .tabsbar, .tabsbar > *, .archive-tools { min-width: 0 !important; max-width: 100%; }
  .gchips, .subchips, .erabar, .archive-tools, .tabsbar .tabs { width: 100%; max-width: 100vw; box-sizing: border-box; }
}
@media (max-width: 760px) {
  .hdr .nav button::after, .hdr .nav button.on::after { content: none !important; display: none !important; }
  body:not(.has-track) .player .p-now { grid-template-columns: minmax(0, 1fr); }
  body:not(.has-track) .player .p-now img { display: none !important; }
  .player .p-meta { min-width: 0; }
  /* the city sits behind the right side only, faded, so the words on the left stay clean */
  .scene-art .splat-layer, .scene-art .live-layer { -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 30%, #000 85%); mask-image: linear-gradient(90deg, transparent 0, transparent 30%, #000 85%); opacity: .8; }
  .scene-copy { position: relative; z-index: 2; }
  /* the arcade lives up in the header next to your avatar, out of the content's way */
  .arcade-chip { position: absolute !important; top: 10px !important; bottom: auto !important; right: 56px !important; width: 34px !important; height: 36px !important; z-index: 30 !important; }
  .arcade-chip svg { width: 18px !important; height: 26px !important; }
}
@media (max-width: 760px) {
  .player > .p-now { grid-column: 1 !important; grid-row: 1 !important; }
  .player > .p-ctrl { grid-column: 2 !important; grid-row: 1 !important; justify-content: flex-end; width: auto !important; }
  .player > .song-dice { grid-column: 3 !important; grid-row: 1 !important; }
}
@media (max-width: 760px) {
  /* the loading arcade docks as a sheet above the player instead of a floating window you'd have to drag */
  #loading-arcade:not(.hidden) { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b)) !important;
    width: auto !important; max-width: none !important; height: auto !important; max-height: 58vh; transform: none !important; z-index: 115 !important; border-left: 0 !important; border-right: 0 !important; box-shadow: 0 -10px 30px #0008 !important; }
  #loading-arcade #arcade-home { display: none; }
  #loading-arcade .arcade-head { cursor: default; min-height: 44px; }
  #loading-arcade .arcade-head button { min-width: 40px; min-height: 40px; }
}
@media (max-width: 760px) {
  /* taste twins: pic + name + match on top, stats under, the two buttons full width */
  .blend-candidate.twin, .blend-candidate.twin.twin-first { grid-template-columns: 52px minmax(0, 1fr) auto !important; grid-template-areas: "pic body tier" !important; gap: 10px 12px !important; padding: 12px !important; align-items: start; }
  .blend-candidate.twin .twin-rank { position: absolute; top: 6px; left: 8px; font-size: 10px !important; opacity: .7; }
  .blend-candidate.twin { position: relative; }
  .blend-candidate.twin > img { grid-area: pic; width: 52px !important; height: 52px !important; }
  .blend-candidate.twin .twin-body { grid-area: body; display: grid; gap: 4px; }
  .blend-candidate.twin .twin-body > b { font: 700 16px/1.2 var(--talk) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .blend-candidate.twin .twin-body > small { font: 400 12px/1.4 var(--body) !important; }
  .blend-candidate.twin .twin-acts { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; grid-column: 1 / -1; }
  .blend-candidate.twin .twin-acts .btn { height: 40px; justify-content: center; font-size: 12px !important; }
  .blend-candidate.twin .twin-body { grid-column: 2; } 
  .blend-candidate.twin .twin-tier { grid-area: tier; text-align: right; }
  .blend-candidate.twin .twin-tier em { font-size: 24px !important; }
  .blend-candidate.twin .twin-tier small { font-size: 9px !important; display: block; max-width: 70px; margin-left: auto; }
}
@media (max-width: 760px) {
  /* blend arena on a phone: P1 · VS · P2 across, then the mode toggle, then FIGHT, then the rules */
  .arena { grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr) !important; grid-template-areas: "hpa . hpb" "a vs b" "mode mode mode" "fight fight fight" "rules rules rules" !important; gap: 10px 6px !important; padding: 14px 12px !important; }
  .arena > .arena-hp.a { grid-area: hpa; } .arena > .arena-hp.b { grid-area: hpb; }
  .arena > .arena-side.a { grid-area: a; } .arena > .arena-side.b { grid-area: b; }
  .arena > .arena-mid { display: contents !important; }
  .arena .arena-vs { grid-area: vs; align-self: center; justify-self: center; font-size: 34px !important; }
  .arena .arena-mode { grid-area: mode; justify-self: stretch; display: grid !important; grid-template-columns: 1fr 1fr; }
  .arena .arena-mode button { min-height: 42px; font-size: 12px !important; }
  .arena > .arena-fight { grid-area: fight; justify-self: stretch; min-height: 52px; font-size: 16px !important; }
  .arena > .arena-rules { grid-area: rules; font: 400 12.5px/1.55 var(--body) !important; }
  .arena-side { min-width: 0; display: grid; justify-items: center; gap: 6px; text-align: center; }
  .arena-side .arena-pic { width: 76px !important; height: 76px !important; }
  .arena-side input, .arena-side .arena-pick, .arena-side .arena-me { width: 100% !important; min-width: 0; font-size: 12px !important; }
  .arena-side .arena-pick { min-height: 42px; }
  .arena-hp b { font-size: 11px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .arena-list:not(.hidden) { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b) + 8px) !important; max-height: 55vh; overflow: auto; z-index: 200; }
  .hint, .panel > p, .twin-head p { font: 400 12.5px/1.55 var(--body) !important; }
}
@media (max-width: 760px) {
  .roster-tools { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 8px !important; }
  .roster-tools .subtabs { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .roster-tools .subtabs::-webkit-scrollbar { display: none; }
  .roster-tools .subtabs > button { flex: none; min-height: 40px; white-space: nowrap; }
  .roster-tools input { height: 44px; font-size: 15px !important; }
}
@media (max-width: 760px) {
  .tabsbar .sortwrap { display: flex !important; align-items: stretch; gap: 8px; }
  .tabsbar .sortwrap > .pick-control { flex: none; }
  .tabsbar .surprise-button { white-space: nowrap; padding: 0 12px; }
  .tabsbar .shufbtn { flex: none; width: 44px; }
  .tabsbar .sortbtn { flex: 1 1 auto; }
  .toast, #toast { bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b) + 10px) !important; left: 10px !important; right: 10px !important; max-width: none !important; }
}

/* ---------- THE DARK BALL (cartridge.js): tucked by the logo, wobbles now and then like something's inside ---------- */
.dark-ball { position: relative; align-self: end; width: 14px; height: 14px; margin: 0 0 4px -6px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .78; transform-origin: 50% 90%; z-index: 2; }
.dark-ball canvas { width: 14px; height: 14px; image-rendering: pixelated; display: block; }
.dark-ball:hover { opacity: 1; }
.dark-ball.wob { animation: ball-wob 1.5s steps(1, end) 1; }
@keyframes ball-wob { 0%, 12%, 30%, 44%, 62%, 76%, 100% { transform: rotate(0); } 6% { transform: rotate(-22deg); } 20% { transform: rotate(18deg); } 38% { transform: rotate(-16deg); } 52% { transform: rotate(14deg); } 70% { transform: rotate(-10deg); } }
.dark-ball.popped { animation: ball-pop 420ms steps(4, end) 1; }
@keyframes ball-pop { 0% { transform: scale(1); } 40% { transform: scale(1.6) translateY(-4px); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dark-ball.wob, .dark-ball.popped { animation: none; } }

/* cartridge mode: the handheld shows a 160×144 Game Boy screen instead of the arcade games */
#loading-arcade.cart-mode #arcade-canvas, #loading-arcade.cart-mode .arcade-controls, #loading-arcade.cart-mode #arcade-touch, #loading-arcade.cart-mode #arcade-help, #loading-arcade.cart-mode #arcade-reroll { display: none !important; }
#loading-arcade:not(.cart-mode) .cart { display: none; }
.cart { display: grid; gap: 8px; justify-items: center; padding: 4px 0 2px; }
.cart-screen { position: relative; width: min(100%, 320px); aspect-ratio: 160 / 144; background: #0f380f; border: 3px solid #0b0c0a; box-shadow: inset 0 0 0 2px #2b3128, 0 0 0 2px #4a5145; }
.cart-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.cart-boot.off { display: none; }
.cart-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.cart-name { font: 700 12px var(--talk); letter-spacing: .08em; color: #ff8a4c; margin-right: auto; }
.cart-insert, .cart-eject { font: 700 11px var(--talk); letter-spacing: .06em; padding: 6px 10px; color: #f1ede4; background: #1d201b; border: 1px solid #4a5145; cursor: pointer; }
.cart-insert:hover, .cart-eject:hover { border-color: #ff5b1c; color: #fff; }
.cart-help { margin: 0; font: 500 11.5px/1.4 var(--talk); color: #a39c8d; text-align: center; }
.cart-help kbd { font: 700 10px var(--talk); padding: 0 4px; border: 1px solid #4a5145; }
#loading-arcade.cart-mode { height: auto !important; min-height: 0 !important; }
#loading-arcade.cart-mode .arcade-body, #loading-arcade.cart-mode .arcade-playfield { height: auto !important; min-height: 0 !important; overflow: visible !important; }
#loading-arcade.cart-mode .arcade-status, #loading-arcade.cart-mode .arcade-progress, #loading-arcade.cart-mode #arcade-resize { display: none !important; }
#loading-arcade.cart-mode .cart-screen { width: min(100%, 288px); }
@media (min-width: 761px) { #loading-arcade.cart-mode { top: auto !important; bottom: 76px !important; max-height: calc(100vh - 140px); overflow: auto; } }

/* ---------- NPCs (npcs.js): small residents docked inline after a heading, with a soft shadow; they talk in a cartridge box ---------- */
#npc-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
.npc { position: relative; display: inline-block; vertical-align: bottom; width: 48px; height: 28px; margin: 0 0 0 12px; padding: 0; border: 0; background: none; cursor: pointer; overflow: visible;
  animation: npc-in 420ms cubic-bezier(.22,1,.36,1) both; }
.npc canvas { position: absolute; left: 0; bottom: -2px; width: 48px; height: 48px; image-rendering: pixelated; display: block;
  filter: drop-shadow(2px 3px 0 #0000004d); animation: npc-float 2.6s ease-in-out infinite; }
.npc::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -4px; height: 5px; border-radius: 50%; background: radial-gradient(closest-side, #0000004d, transparent); animation: npc-shadow 2.6s ease-in-out infinite; }
.npc:hover canvas { filter: drop-shadow(2px 3px 0 #0000004d) drop-shadow(0 0 5px #ff5b1c88); }
.npc:focus-visible { outline: 2px solid var(--o); outline-offset: 2px; }
@keyframes npc-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes npc-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.8); opacity: .65; } }
@keyframes npc-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.npc.npc-leave { animation: npc-leave 380ms cubic-bezier(.22,1,.36,1) both; }
@keyframes npc-leave { to { opacity: 0; translate: 0 -8px; } }
.souls-item .npc { position: absolute; right: 10px; bottom: 8px; margin: 0; }

.npc-say { position: absolute; left: 0; top: 0; width: max-content; max-width: min(300px, calc(100vw - 16px)); padding: 9px 12px 14px; pointer-events: auto; cursor: pointer;
  color: #fff8ea; background: #0b0c0a; border: 2px solid #f1ede4; box-shadow: inset 0 0 0 2px #0b0c0a, inset 0 0 0 4px #4a5145, 3px 4px 0 #00000059;
  animation: npc-say 220ms cubic-bezier(.22,1,.36,1) both; }
.npc-say.out { animation: npc-say-out 180ms ease-in both; }
@keyframes npc-say { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } }
@keyframes npc-say-out { to { opacity: 0; scale: .96; } }
.npc-name { display: inline-block; position: absolute; top: -12px; left: 10px; padding: 1px 7px; font: 700 10px var(--talk); letter-spacing: .1em; color: #0d0f0b; background: var(--o); border: 2px solid #f1ede4; }
.npc-say p { margin: 6px 0 0; font: 500 13.5px/1.45 var(--talk); letter-spacing: .02em; text-shadow: 0 1px 0 #000; }
.npc-say .tx-em { color: #ff9a5c; font-weight: 700; }
.npc-next { position: absolute; right: 8px; bottom: 2px; font: 9px var(--talk); font-style: normal; color: var(--o); opacity: 0; }
.npc-say.done .npc-next { opacity: 1; animation: quest-blink .8s steps(2, end) infinite; }
.npc-tail { position: absolute; width: 10px; height: 10px; background: #f1ede4; }
.npc-say[data-side="right"] .npc-tail { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.npc-say[data-side="above"] .npc-tail { top: auto !important; bottom: -11px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.npc-say[data-side="below"] .npc-tail { top: -11px !important; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@media (prefers-reduced-motion: reduce) { .npc, .npc canvas, .npc::after, .npc-say { animation: none !important; } }

/* ---------- SOULS MOMENTS (souls.js) ---------- */
.souls-banner { position: fixed; left: 0; right: 0; top: 50%; z-index: 600; display: grid; justify-items: center; gap: 2px; padding: 26px 0 22px; transform: translateY(-50%); pointer-events: none;
  background: linear-gradient(180deg, transparent, #000000ee 20%, #000000f4 50%, #000000ee 80%, transparent); animation: souls-in 3.2s steps(16, end) both; }
.souls-banner canvas { image-rendering: pixelated; display: block; max-width: 100vw; }
.souls-banner p { margin: 0; font: 400 13px/1.45 var(--body); letter-spacing: .04em; color: #d9cfb9; text-shadow: 0 2px 0 #000; text-align: center; padding: 0 16px; }
.souls-red p { color: #e0b0a8; }
@keyframes souls-in { 0% { opacity: 0; } 14% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }
.souls-item { position: fixed; left: 50%; bottom: 96px; z-index: 590; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; width: min(420px, calc(100vw - 24px));
  padding: 10px 14px; transform: translateX(-50%); color: #f1ede4; background: #0b0c0ae8; border: 1px solid #6a5a3a; box-shadow: inset 0 0 0 1px #000, 0 10px 30px #0009; cursor: pointer; animation: si-in 240ms steps(4, end) both; }
.souls-item.out { animation: si-in 240ms steps(4, end) reverse both; }
@keyframes si-in { from { opacity: 0; clip-path: inset(0 50% 0 50%); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.si-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #6a5a3a; background: #000; font-size: 22px; color: #e9c27c; }
.si-icon img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; filter: contrast(1.1) saturate(.85); }
.si-txt { display: grid; gap: 1px; min-width: 0; }
.si-txt small { font: 600 10px "Cinzel", serif; letter-spacing: .2em; color: #e9c27c; }
.si-txt b { font: 600 15px/1.25 var(--talk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-txt em { font: 500 12px var(--talk); font-style: normal; color: #a99f8b; }
.soapstone { position: fixed; left: 16px; bottom: 96px; z-index: 92; display: grid; grid-template-columns: 26px auto; grid-template-rows: auto auto auto; gap: 0 10px; align-items: center; max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px 10px 10px; text-align: left; color: #ffd9b8; background: #120a05e6; border: 1px solid #ff5b1c55; box-shadow: 0 0 24px #ff5b1c33, inset 0 0 18px #ff5b1c1a; cursor: pointer; animation: ss-in 600ms steps(6, end) both; }
.soapstone.out { animation: ss-in 400ms steps(4, end) reverse both; }
@keyframes ss-in { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
.ss-rune { grid-row: 1 / span 3; width: 26px; height: 26px; background: radial-gradient(circle, #ffb08a 0 2px, #ff5b1c 3px 5px, transparent 6px), conic-gradient(from 45deg, #ff5b1c55 0 25%, transparent 0 50%, #ff5b1c55 0 75%, transparent 0); image-rendering: pixelated; animation: quest-blink 1.6s steps(2, end) infinite; }
.ss-msg { font: 600 15px var(--talk); text-shadow: 0 0 10px #ff5b1c88; }
.ss-msg .tx-em { color: #fff1e0; }
.soapstone small { font: 500 12px var(--talk); color: #c99a7a; }
.ss-rate { font: 600 10px var(--talk); font-style: normal; letter-spacing: .08em; color: #ff8a4c; margin-top: 2px; }
@media (max-width: 760px) { .souls-item, .soapstone { bottom: calc(var(--tab-h) + var(--pl-h) + var(--safe-b) + 12px); } .soapstone { left: 12px; } }
@media (prefers-reduced-motion: reduce) { .souls-banner, .souls-item, .soapstone, .ss-rune { animation: none; } }

/* ---------- BLEND: centred middle column, loud numbers ---------- */
@media (min-width: 761px) { .arena-mid { justify-self: center; align-self: center; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 16px; } }
.arena-mid > .arena-vs, .arena-mid > .arena-mode { grid-row: auto !important; grid-column: auto !important; margin: 0 !important; }
.arena-mid > .arena-mode { order: -1; }
.arena-hp b { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.arena-hp.b b { justify-content: flex-end; }
.arena-hp .hp-n, .bduel-side > span:not([class]) b { font: 700 17px var(--head); color: #ff8a4c; text-shadow: 0 0 12px #ff5b1c55, 0 2px 0 #000; letter-spacing: .02em; }
.roster-tile small strong { font: 700 13px var(--head); color: #ff5b1c; }
.roster-tile em { font-size: 16px !important; color: #ff5b1c !important; font-weight: 800; }
.bduel-n { color: #ff5b1c !important; text-shadow: 0 0 18px #ff5b1c66; }
.bduel-pct { color: #ff8a4c !important; font-weight: 800 !important; }

/* ---------- BLEND WITH YOU: the call to action on every profile ---------- */
.person-modes button.blend-cta { background: var(--o) !important; color: #fff8ea !important; border: 2px solid #0d0f0b !important; box-shadow: 3px 3px 0 #0d0f0b, 0 0 0 0 #ff5b1c66; font-weight: 800 !important; padding-inline: 14px !important; position: relative; }
.person-modes button.blend-cta.on { background: #0d0f0b !important; color: #ff8a4c !important; box-shadow: inset 0 0 0 2px #ff5b1c; }
.person-modes button.blend-cta:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #0d0f0b, 0 0 18px #ff5b1c88; }
.blend-cta .bw-ic { display: inline-block; margin-right: 2px; }
.blend-cta.cta-call:not(.on) { animation: cta-call 1.1s cubic-bezier(.22,1,.36,1) 2 both 400ms; }
@keyframes cta-call { 0% { box-shadow: 3px 3px 0 #0d0f0b, 0 0 0 0 #ff5b1c88; } 40% { transform: translateY(-2px); } 70% { box-shadow: 3px 3px 0 #0d0f0b, 0 0 0 12px #ff5b1c00; transform: none; } 100% { box-shadow: 3px 3px 0 #0d0f0b, 0 0 0 0 #ff5b1c00; } }
@media (prefers-reduced-motion: reduce) { .blend-cta.cta-call { animation: none !important; } }

/* the ウォッチャー section stamp is identity, not decoration: with reduced motion it still shows, as a plain fade */
@media (prefers-reduced-motion: reduce) {
  .tdr-stamp { display: flex !important; }
  .tdr-stamp.in { animation: tdr-fade-in 200ms linear forwards !important; }
  .tdr-stamp.out { animation: tdr-fade-out 300ms linear forwards !important; }
}
@keyframes tdr-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tdr-fade-out { to { opacity: 0; } }
@media (max-width: 760px) { .tdr-stamp { top: 12px !important; right: 12px !important; transform-origin: top right; scale: .82; z-index: 130 !important; } }
.tdr-stamp { z-index: 650 !important; } /* above dialogs, so overlay screens get their stamp too */
