/* =====================================================================
   DCC: SURVIVORS · "LIVE BROADCAST" graphics package
   One system for menus and the in-run HUD: the World Dungeon is a TV show.
   Shape language: slanted bars (-8deg), hard black drop shadows, color tabs,
   no rounded corners. Type: Anton (display), Barlow Condensed (UI/numbers),
   Barlow (body). Colors: show pink, DCC yellow, System AI cyan, live red.
   ===================================================================== */

@font-face { font-family: 'Anton'; src: url(../fonts/anton-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 400; src: url(../fonts/barlow-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: italic; src: url(../fonts/barlow-latin-400-italic.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 500; src: url(../fonts/barlow-latin-500-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 600; src: url(../fonts/barlow-latin-600-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 700; src: url(../fonts/barlow-latin-700-normal.woff2) format('woff2'); font-display: swap; }

:root {
  /* color */
  --ink: #08070b;
  --panel: #131017;
  --panel-2: #1b1621;
  --panel-3: #241d2c;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f2f8;
  --muted: #a69db3;
  --faint: #958da2;   /* v13: was #6f6779 (3.5:1); now >= 5:1 on every panel color */
  --pink: #ff2d78;
  --pink-soft: #ff7aaa;
  --yellow: #ffdd2e;
  --cyan: #38d9ff;
  --red: #ff2b3f;
  --green: #4dff9a;
  --hp: #ff3d55;
  --xp: #a46bff;
  /* type */
  --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --ui: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  /* shape */
  --skew: -8deg;
  --shadow: 5px 5px 0 #000;
  --shadow-sm: 3px 3px 0 #000;
  /* kept for older references */
  --dcc-yellow: var(--yellow);
  --gold: var(--yellow);
  --gold-bright: var(--yellow);
  --parchment: var(--text);
  --edge: var(--line);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); }
body { font-family: var(--body); font-size: 16px; -webkit-user-select: none; user-select: none; touch-action: none; -webkit-font-smoothing: antialiased; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; filter: contrast(1.08) saturate(1.16); }
canvas#bloom { position: fixed; left: 0; top: 0; pointer-events: none; mix-blend-mode: screen; opacity: .5; }   /* v21: blurred inside the 1/8-res canvas; a CSS blur cost 40ms a frame on software compositing */
/* v16 lighting: the low-res light buffer, stretched over the world and multiplied on the GPU */
canvas#atmo { position: fixed; left: 0; top: 0; pointer-events: none; transform-origin: 0 0; image-rendering: auto; }
canvas#light { position: fixed; left: 0; top: 0; pointer-events: none; mix-blend-mode: multiply; transform-origin: 0 0; image-rendering: auto; }
/* v16 grade: floor tint + vignette (was two full-screen canvas fills per frame) */
#grade { position: fixed; inset: 0; pointer-events: none; background: var(--tint, transparent); }
#grade::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .62) 100%); opacity: var(--vig, 1); }
canvas#screenfx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
/* v17: dazed by a Mind Horror (GPU overlay; opacity set by js/attacks.js) */
#psyfx { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(120, 40, 200, 0) 32%, rgba(120, 40, 200, .6) 100%); }
b, strong { font-weight: 700; }
button { font: inherit; color: inherit; }
button:focus { outline: none; }

#ui { position: fixed; inset: 0; pointer-events: none; }

/* ---------------------------------------------------------------------
   Screens
   --------------------------------------------------------------------- */
.screen {
  z-index: 2; position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 16px; padding: 28px 20px; pointer-events: auto; overflow-y: auto; text-align: center; scrollbar-width: thin;
}
.screen > :first-child { margin-top: auto; }
.screen > :last-child { margin-bottom: auto; }
.screen.show { display: flex; animation: screenIn .28s cubic-bezier(.2, .8, .2, 1); }
.screen.dim { background: linear-gradient(180deg, rgba(8, 7, 11, 0.86), rgba(8, 7, 11, 0.94)); backdrop-filter: blur(3px) saturate(0.7); }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Kicker: small yellow slug above a heading */
.kicker {
  display: inline-block; font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 3px; text-transform: uppercase;
  color: #000; background: var(--yellow); padding: 3px 14px 2px; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm);
}
.screen-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }

h2 {
  font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: 1px; text-transform: uppercase;
  color: #fff; transform: skewX(var(--skew)); text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 #000;
}
h2.gold { color: var(--yellow); }
h2.blood { color: #fff; text-shadow: 4px 4px 0 var(--red), 8px 8px 0 #000; }
h3 { font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--pink-soft); margin: 4px 0 8px; }
.sub { color: var(--muted); font-size: 17px; max-width: 640px; line-height: 1.4; }
.hint { font-family: var(--ui); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); font-size: 13px; }
kbd {
  font-family: var(--ui); font-weight: 800; font-size: 13px; letter-spacing: .5px; color: var(--text);
  background: var(--panel-3); border: 1px solid rgba(255, 255, 255, .16); border-bottom-width: 3px; padding: 0 7px; border-radius: 3px;
}

/* ---------------------------------------------------------------------
   Title card
   --------------------------------------------------------------------- */
.screen-title { background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(8, 7, 11, 0.35), rgba(8, 7, 11, 0.88)); gap: 26px; }
.screen-title .title-wrap { margin-top: auto; }
/* v16 title stage: the studio set behind the title, Carl and Donut on the platform */
.screen-title { overflow: hidden; background: linear-gradient(180deg, rgba(8, 7, 11, .62), rgba(8, 7, 11, .08) 34%, rgba(8, 7, 11, 0) 62%, rgba(8, 7, 11, .72)); justify-content: space-between; gap: 10px; padding-bottom: 18px; }
.screen-title > :not(.title-stage):not(.onair) { position: relative; z-index: 1; }
.screen-title > .onair { z-index: 2; }
.title-stage { position: absolute; inset: 0; z-index: 0; pointer-events: none; margin: 0 !important; background: #07060a; }
.ts-frame { position: absolute; left: 50%; top: 50%; width: max(100%, calc(100vh * 1.7769)); aspect-ratio: 1672 / 941; transform: translate(-50%, -50%); }
.ts-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; }
body.pad, body.pad * { cursor: none !important; }   /* v23: no mouse pointer while playing on a controller (js/input.js) */
.ts-tv { position: absolute; pointer-events: none; }
.set-row.danger .set-label { color: #ff8a8a; }                                   /* v23: Settings · Reset account */
.set-row.danger .seg-btn.on { background: var(--red); color: #fff; }   /* v23: live static on the stage monitors (js/tvstatic.js) */
.ts-char { position: absolute; transform: translateX(-50%); filter: drop-shadow(0 10px 6px rgba(0, 0, 0, .55)); animation: tsIdle 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.ts-carl { height: 37%; left: 41.5%; bottom: 21.2%; z-index: 4; }
.ts-donut { z-index: 5; }
body.phone .ts-cast { display: none; }
.ts-donut { height: 16.5%; left: 50%; bottom: 21.4%; animation-delay: -1.4s; }
@keyframes tsIdle { 50% { transform: translateX(-50%) scaleY(1.012); } }
.ts-spot { position: absolute; width: 16%; height: 6%; bottom: 20%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 230, 160, .55), rgba(255, 120, 200, 0)); mix-blend-mode: screen; }
.ts-spot-l { left: 33.5%; } .ts-spot-r { left: 46.6%; width: 14%; }
.screen-title .title-wrap { margin-top: 0; gap: 8px; }
.screen-title .title { font-size: clamp(52px, 8vw, 112px); }
.screen-title .menu-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; width: auto; max-width: 1180px; gap: 10px 12px; margin-top: auto; }
.screen-title .menu-buttons .btn { font-size: clamp(17px, 1.3vw, 24px); padding: 0.62em 1.15em 0.56em; }
.screen-title .menu-foot, .screen-title .fanline { margin-bottom: 0; }
body.phone .ts-frame { top: 46%; }
body.phone .screen-title .menu-buttons { flex-direction: column; width: min(300px, 100%); gap: 7px; }
body.phone .screen-title .menu-buttons .btn { font-size: 15px; padding: 8px 14px 7px; }
body.phone .ts-carl { height: 25%; bottom: 35%; left: 45.6%; } body.phone .ts-donut { height: 10%; bottom: 35.2%; left: 52.4%; }
body.phone .ts-spot { bottom: 34%; width: 8%; } body.phone .ts-spot-l { left: 41.6%; } body.phone .ts-spot-r { left: 48.4%; }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.title {
  font-family: var(--display); font-weight: 400; font-size: clamp(60px, 10.5vw, 136px); line-height: .92; letter-spacing: 2px; text-transform: uppercase;
  transform: skewX(var(--skew)); white-space: nowrap;
}
.title .t-dcc { color: var(--yellow); text-shadow: 5px 5px 0 #000, 10px 10px 0 rgba(0, 0, 0, .5); }
.title .t-main { color: #fff; text-shadow: 6px 6px 0 var(--pink), 12px 12px 0 #000; }
.title-tag { font-family: var(--ui); font-weight: 700; font-size: clamp(16px, 2vw, 21px); letter-spacing: 3px; text-transform: uppercase; color: #ffd0e2; text-shadow: 0 2px 0 #000; }
.onair {
  position: absolute; top: 22px; right: 26px; margin: 0 !important; display: flex; align-items: center; gap: 9px;
  font-family: var(--ui); font-weight: 800; font-size: 15px; letter-spacing: 3px; text-transform: uppercase;
  background: var(--red); color: #fff; padding: 5px 14px; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm);
}
.onair i { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1.2s steps(2, start) infinite; }
.onair span { color: #ffd6dc; font-weight: 700; letter-spacing: 1px; }
.onair span:empty { display: none; }
.menu-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fanline { font-family: var(--ui); font-weight: 600; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--faint); }
#menu-best-chip.empty { display: none; }

/* Chips: label + value pills */
.chip {
  display: inline-flex; align-items: stretch; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm);
  font-family: var(--ui); text-transform: uppercase; letter-spacing: 1.5px;
}
.chip span { background: #000; color: var(--muted); font-weight: 700; font-size: 13px; padding: 5px 10px; display: flex; align-items: center; }
.chip b { background: var(--panel-3); color: var(--yellow); font-weight: 800; font-size: 16px; padding: 4px 12px; display: flex; align-items: center; }
.chip.big b { font-size: 22px; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.menu-buttons { display: flex; flex-direction: column; gap: 10px; width: min(360px, 100%); }
.menu-buttons.row { flex-direction: row; justify-content: center; width: auto; flex-wrap: wrap; gap: 14px; }
.btn {
  position: relative; font-family: var(--ui); font-weight: 800; font-size: 21px; letter-spacing: 2px; text-transform: uppercase; color: var(--text);
  background: var(--panel-2); border: 0; border-left: 6px solid var(--yellow); padding: 13px 28px 12px; cursor: pointer;
  transform: skewX(var(--skew)); box-shadow: var(--shadow); transition: transform .12s, background .12s, box-shadow .12s, color .12s;
}
.btn:hover:not(:disabled), .btn.pad-focus, .btn:focus-visible {
  background: var(--panel-3); color: #fff; transform: skewX(var(--skew)) translateX(5px); box-shadow: 0 0 0 2px var(--yellow), var(--shadow); outline: none;
}
.btn:active:not(:disabled) { transform: skewX(var(--skew)) translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.btn.primary { background: var(--pink); border-left-color: #fff; color: #fff; }
.btn.primary:hover:not(:disabled), .btn.primary.pad-focus, .btn.primary:focus-visible { background: #ff4a8c; box-shadow: 0 0 0 2px #fff, var(--shadow); }
.btn.small { font-size: 15px; padding: 8px 18px 7px; letter-spacing: 1.5px; border-left-width: 4px; box-shadow: var(--shadow-sm); }
.btn.ghost { background: rgba(0, 0, 0, .6); border-left-color: var(--faint); color: var(--muted); }
.btn:disabled { opacity: 0.38; cursor: default; }

/* ---------------------------------------------------------------------
   Cards (crawler select, loot box picks, locked crawlers)
   --------------------------------------------------------------------- */
.cards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: stretch; max-width: 1240px; }
.card {
  position: relative; width: 232px; text-align: left; cursor: pointer; color: var(--text); font-family: var(--body);
  background: var(--panel); border: 0; border-top: 5px solid var(--accent, var(--yellow));
  display: flex; flex-direction: column; box-shadow: 6px 6px 0 #000; transition: transform .14s, box-shadow .14s;
}
.card:hover, .card.pad-focus, .card:focus-visible {
  transform: translateY(-5px); outline: none;
  box-shadow: 0 0 0 2px var(--accent, var(--yellow)), 6px 11px 0 #000, 0 0 40px color-mix(in srgb, var(--accent, var(--yellow)) 30%, transparent);
}
.card-icon { font-size: 46px; line-height: 1; text-align: center; padding: 18px 0 8px; filter: drop-shadow(0 3px 4px #000); }
.card-portrait { position: relative; z-index: 1; height: 100%; width: auto; display: block; margin: 0 auto; image-rendering: auto; box-shadow: 0 0 0 3px #000, 6px 6px 0 rgba(0, 0, 0, .6); }
.card-art.pic { height: 156px; padding: 12px 0 18px; }
.card-art.pic::before { content: ''; position: absolute; inset: -30px; background: var(--art) center / cover; filter: blur(14px) brightness(.42) saturate(1.3); }
.card-art.pic::before { image-rendering: auto; }
.card-sprite { height: 84px; image-rendering: pixelated; display: block; margin: 0 auto; }
.card-art { position: relative; background: #000; overflow: hidden; }
.card-art .card-icon { padding: 0; }
.card-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .75)); pointer-events: none; }
.card-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name {
  align-self: flex-start; margin: -16px 0 2px -4px; position: relative; z-index: 1;
  font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1; letter-spacing: 1px; text-transform: uppercase;
  color: #000; background: var(--accent, var(--yellow)); padding: 5px 12px 4px; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm);
}
.card-title { font-family: var(--ui); font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.card-desc { font-size: 14.5px; line-height: 1.35; color: #ddd6e6; }
.card-weapon { font-size: 14px; color: var(--text); padding-top: 8px; border-top: 1px solid var(--line); }
.card-weapon b { font-family: var(--ui); font-weight: 800; letter-spacing: .5px; font-size: 15px; text-transform: uppercase; }
.card-perk { font-size: 13.5px; color: var(--muted); font-style: italic; line-height: 1.3; }
.stats { display: flex; flex-direction: column; gap: 4px; }
.stat { display: flex; justify-content: space-between; align-items: center; font-family: var(--ui); font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.pips { display: flex; gap: 3px; transform: skewX(var(--skew)); }
.pips i { width: 17px; height: 7px; background: rgba(255, 255, 255, 0.1); display: block; }
.pips i.on { background: var(--accent, var(--yellow)); }

/* Loot-box choice cards */
.choice-card { width: 238px; min-height: 210px; border-top-color: var(--accent, var(--yellow)); }
.choice-card .card-icon { font-size: 52px; padding: 26px 0 14px; text-align: center; }
.choice-card .card-body { align-items: center; text-align: center; }
.choice-card .card-name { align-self: center; margin: 0 0 2px; font-size: 23px; }
.choice-card .key {
  position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; display: grid; place-items: center;
  font-family: var(--ui); font-weight: 800; font-size: 16px; color: var(--text); background: #000; border: 1px solid rgba(255, 255, 255, .2);
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tag {
  font-family: var(--ui); font-weight: 800; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text);
  background: var(--panel-3); padding: 2px 9px; transform: skewX(var(--skew));
}
.tag.new { background: var(--yellow); color: #000; }
.tag.tome { background: #1d2b44; color: #a9c8ff; }
.tag.new.tome { background: #6ea2ff; color: #000; }
.tag.sig { background: var(--pink); color: #fff; }

/* Mastery + banish (under crawler cards) */
.class-slot { display: flex; flex-direction: column; gap: 9px; width: 232px; }
.class-slot .card { width: 100%; flex: 1; }
.mastery { font-family: var(--ui); font-weight: 800; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent, var(--yellow)); text-align: left; }
.mbar { height: 6px; background: rgba(255, 255, 255, .1); margin-top: 5px; overflow: hidden; transform: skewX(var(--skew)); }
.mbar i { display: block; height: 100%; background: var(--accent, var(--yellow)); }
.mnext { color: var(--faint); font-size: 12px; margin-top: 3px; letter-spacing: 1px; }
.ban-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 820px; }
.ban-item { display: inline-flex; align-items: center; gap: 8px; }
.ban-item .ban-kind { font-size: 12px; color: var(--faint); letter-spacing: 1px; }
.ban-item.on { border-left-color: var(--red); color: #ff9aa5; background: rgba(120, 10, 25, .55); text-decoration: line-through; }

/* Locked */
.card.locked { cursor: default; filter: grayscale(.85); opacity: .6; }
.card.locked:hover { transform: none; box-shadow: 6px 6px 0 #000; }
.card.locked .card-name { background: var(--panel-3); color: var(--muted); }
.shop-row.locked { opacity: 0.6; }

/* ---------------------------------------------------------------------
   Panels, stat sheets, shop rows
   --------------------------------------------------------------------- */
.panel { background: var(--panel); border-top: 4px solid var(--pink); padding: 18px 22px; max-width: 720px; text-align: left; box-shadow: 6px 6px 0 #000; }
.help p { margin-bottom: 11px; font-size: 16px; line-height: 1.45; color: #ddd6e6; }
.help p b { font-family: var(--ui); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #fff; font-size: 16.5px; }
.help .dim { color: var(--faint); font-size: 14px; }
.build { display: flex; gap: 34px; flex-wrap: wrap; }
.build-col { min-width: 230px; flex: 1; }
.build-item { font-size: 15px; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
.build-item b { font-family: var(--ui); font-weight: 800; color: var(--yellow); font-size: 15px; letter-spacing: 1px; white-space: nowrap; flex-shrink: 0; }
.build-item span { min-width: 0; }
.nw { white-space: nowrap; }
.build-item.dim { color: var(--faint); font-style: italic; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-family: var(--ui); font-weight: 700; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; }
.kv b { font-family: var(--ui); font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: .5px; text-align: right; }
.kv.hl b { color: var(--yellow); }
.stats-panel { min-width: min(420px, 100%); }
.build .kv { padding: 4px 0; }
.build .kv span { font-size: 13px; }
.build .kv b { font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
#res-stats { max-width: 860px; }
#res-stats .kv:nth-last-child(2):nth-child(odd) { border-bottom: 0; }

.shop { display: flex; flex-direction: column; gap: 10px; width: min(600px, 100%); }
.shop-row {
  display: flex; align-items: center; gap: 14px; background: var(--panel); border-left: 5px solid var(--yellow);
  padding: 11px 16px; text-align: left; box-shadow: 5px 5px 0 #000;
}
.shop-icon { font-size: 28px; width: 44px; text-align: center; }
.shop-icon .px-ico { width: 44px; height: 44px; margin: 0; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.shop-info { flex: 1; }
.shop-name { font-family: var(--ui); font-weight: 800; font-size: 18px; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.shop-name .rank { color: var(--yellow); font-size: 14px; margin-left: 8px; letter-spacing: 1.5px; }
.shop-desc { color: var(--muted); font-size: 14.5px; line-height: 1.35; }
.shop-row.locked { border-left-color: var(--faint); }

/* v23: Characters screen: the roster on the left, the picked crawler (unlock or Training) on the right */
#screen-chars { gap: 10px; padding-top: 18px; padding-bottom: 14px; }
.chars { display: flex; gap: 22px; align-items: flex-start; width: min(1320px, 100%); }
.chars-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 380px; flex-shrink: 0; }
.char-pick {
  display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  background: var(--panel); color: var(--text); border: 0; border-left: 5px solid var(--accent, var(--yellow)); padding: 5px 10px 5px 5px; cursor: pointer;
  transform: skewX(var(--skew)); box-shadow: var(--shadow-sm); transition: transform .12s, background .12s, box-shadow .12s;
}
.char-pick img, .char-pick .char-emoji { grid-row: span 2; width: 52px; height: 52px; object-fit: cover; object-position: 50% 0; font-size: 32px; text-align: center; line-height: 52px; }
.char-pick-name { font-family: var(--ui); font-weight: 800; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; line-height: 1.1; align-self: end; }
.char-pick-sub { font-family: var(--ui); font-weight: 700; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); align-self: start; }
.char-pick.locked img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .5)); }
.char-pick.on { background: var(--panel-3); box-shadow: 0 0 0 2px var(--accent, var(--yellow)), var(--shadow-sm); }
.char-pick:hover, .char-pick:focus-visible, .char-pick.pad-focus { background: var(--panel-3); transform: skewX(var(--skew)) translateX(4px); outline: none; }
.chars-detail { flex: 1; min-width: 0; max-width: none; display: flex; flex-direction: column; gap: 6px; border-top-color: var(--accent, var(--pink)); max-height: calc(100vh - 235px); overflow-y: auto; padding: 10px 18px; }
.char-head { display: flex; gap: 18px; align-items: flex-end; }
.char-big { width: 84px; height: 116px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .6)); flex-shrink: 0; }
.char-big.sil { filter: brightness(0) drop-shadow(0 0 2px rgba(255, 255, 255, .45)); }
.char-id { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; flex: 1; min-width: 0; }
.char-id .mastery { align-self: stretch; margin-top: 2px; }
.char-id .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* the header stays two lines tall */
/* v23: Training tiles, two columns (TRAIN_COLS) */
.chars-detail h3 { margin: 0; }
.train-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; }
.train-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.train-group { margin: 4px 0 0; }
.train-tile { display: flex; align-items: center; gap: 9px; background: var(--panel-2); border-left: 4px solid var(--yellow); padding: 4px 7px 4px 8px; box-shadow: 3px 3px 0 #000; min-width: 0; }
.train-tile.maxed { border-left-color: #7dff9a; }
.tt-ico { width: 30px; height: 30px; font-size: 21px; line-height: 30px; text-align: center; flex-shrink: 0; }
.tt-ico .px-ico { width: 30px; height: 30px; margin: 0; }
.tt-main { flex: 1; min-width: 0; }
.tt-name { display: flex; align-items: center; gap: 8px; font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: #fff; white-space: nowrap; }
.tt-pips { display: inline-flex; gap: 2px; transform: skewX(var(--skew)); }
.tt-pips i { width: 9px; height: 4px; background: rgba(255, 255, 255, .14); }
.tt-pips i.on { background: var(--yellow); }
.train-tile.maxed .tt-pips i.on { background: #7dff9a; }
.tt-desc { color: var(--muted); font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-desc b { color: var(--yellow); }
.train-tile > .btn.small { font-size: 12.5px; padding: 6px 10px 5px; white-space: nowrap; flex-shrink: 0; }
.chars-detail .shop { width: 100%; }
.chars-detail .btn.primary { align-self: flex-start; }
.char-or { color: var(--muted); margin: 4px 0 0; }
.train-group { font-family: var(--ui); font-weight: 800; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); margin: 6px 0 -4px; }
.chars-detail .shop { gap: 7px; }
.chars-detail .shop-row { padding: 7px 12px; gap: 12px; }
.chars-detail .shop-icon, .chars-detail .shop-icon .px-ico { width: 36px; height: 36px; font-size: 24px; }
.chars-detail .shop-name { font-size: 16px; }
.chars-detail .shop-desc { font-size: 13.5px; }
.chars-detail .shop-desc b { color: var(--yellow); }
.train-pick { display: flex; gap: 6px; }
.train-pick .btn { padding: 8px 12px 7px; }
@media (max-width: 1100px) { .train-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .chars { flex-direction: column; align-items: stretch; }
  .chars-list { width: 100%; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .chars-detail { max-height: none; }
}

/* ---------------------------------------------------------------------
   Center banner: full-width broadcast slate
   --------------------------------------------------------------------- */
#banner { z-index: 3; position: absolute; top: 24%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; opacity: 0; pointer-events: none; }
#banner.show { opacity: 1; }
#banner.show #banner-main { animation: slateIn .45s cubic-bezier(.2, .9, .25, 1.15) both; }
#banner.show #banner-sub { animation: slateIn .45s .08s cubic-bezier(.2, .9, .25, 1.15) both; }
#banner.out { opacity: 0; transition: opacity .35s; }
#banner-main {
  font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 64px); line-height: 1.05; letter-spacing: 1.5px; text-transform: uppercase;
  color: #fff; background: #000; padding: 8px 34px 6px; transform: skewX(var(--skew)); box-shadow: 0 0 0 0 transparent, 8px 8px 0 var(--pink);
  max-width: 92vw; text-align: center;
}
#banner-sub {
  margin-top: 10px; font-family: var(--ui); font-weight: 800; font-size: clamp(14px, 1.8vw, 20px); letter-spacing: 2.5px; text-transform: uppercase;
  color: #000; background: var(--yellow); padding: 4px 18px 3px; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm);
}
#banner-sub:empty { display: none; }
/* v21: never clipped. Both lines wrap inside the screen (Msg in ui.js also scales an overflowing word down) */
#banner-main, #banner-sub { max-width: min(92vw, 1100px); overflow-wrap: break-word; text-wrap: balance; }
#banner-sub { text-align: center; line-height: 1.25; }
#banner.long #banner-main { font-size: clamp(26px, 4vw, 52px); }
@keyframes slateIn { from { clip-path: inset(0 100% 0 0); transform: skewX(var(--skew)) translateX(-40px); } to { clip-path: inset(0 0 0 0); transform: skewX(var(--skew)); } }

/* ---------------------------------------------------------------------
   Alert cards (sponsor, achievements, challenges). System AI lines go to the ticker.
   --------------------------------------------------------------------- */
#toasts { position: absolute; right: 16px; bottom: 50px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: min(360px, calc(100vw - 32px)); z-index: 1; }
.toast {
  background: var(--panel); border-left: 6px solid var(--cyan); padding: 9px 14px 10px; text-align: left; width: 100%;
  box-shadow: 5px 5px 0 #000; animation: toastIn .35s cubic-bezier(.2, .9, .25, 1.1); transition: opacity .45s, transform .45s;
}
.toast.out { opacity: 0; transform: translateX(40px); }
.toast-main { font-family: var(--ui); font-weight: 800; font-size: 16px; color: var(--cyan); letter-spacing: 1.5px; text-transform: uppercase; }
.toast-sub { font-size: 14.5px; color: #e6e1ec; line-height: 1.3; margin-top: 1px; }
.toast-sub:empty { display: none; }
.toast.sponsor { border-left-color: var(--pink); } .toast.sponsor .toast-main { color: var(--pink-soft); }
.toast.achieve { border-left-color: var(--yellow); } .toast.achieve .toast-main { color: var(--yellow); }
@keyframes toastIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   In-run HUD
   --------------------------------------------------------------------- */
#hud { position: absolute; inset: 0; display: none; font-family: var(--ui); z-index: 0; }
#hud.on { display: block; }
.slant { transform: skewX(var(--skew)); }

/* Crawler plate (top left) */
.plate { position: absolute; left: 16px; top: 14px; display: flex; align-items: stretch; box-shadow: var(--shadow); transform: skewX(var(--skew)); }
.plate-pic { width: 62px; background: color-mix(in srgb, var(--accent, #ffdd2e) 22%, #0c0a10) 55% 100% / 94% auto no-repeat; /* v16: whole head with headroom, not cropped */ image-rendering: auto; border-right: 4px solid var(--accent, var(--yellow)); display: grid; place-items: center; font-size: 32px; }
.plate-body { background: rgba(14, 11, 18, .92); padding: 7px 12px 8px 12px; width: 252px; display: flex; flex-direction: column; gap: 5px; }
.plate-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plate-name { font-family: var(--display); font-size: 19px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent, #fff); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-lv { font-weight: 800; font-size: 14px; letter-spacing: 1.5px; color: #000; background: var(--yellow); padding: 1px 7px; line-height: 1.2; white-space: nowrap; flex-shrink: 0; }
.plate-name { min-width: 0; }
.bar { position: relative; height: 15px; background: #2a0a12; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ff5a6e, var(--hp) 55%, #c4122d); transition: width .12s linear; }
.bar > em { position: absolute; inset: 0 auto 0 0; background: #fff; opacity: .55; transition: width .5s .25s ease-out; }
.bar > b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-weight: 800; font-size: 13px; letter-spacing: .5px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.bar.low > i { background: linear-gradient(180deg, #ff8a5a, #ff2b3f); animation: lowhp .7s ease-in-out infinite alternate; }
@keyframes lowhp { to { filter: brightness(1.6); } }
/* v23: the XP meter runs across the very top of the screen (it used to sit under the health bar) */
.xptop { position: absolute; top: 0; left: 0; right: 0; height: 6px; background: rgba(20, 12, 32, .85); box-shadow: 0 1px 0 #000; overflow: hidden; pointer-events: none; z-index: 3; }
.xptop > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6b3dd6, #b98cff); box-shadow: 0 0 8px rgba(185, 140, 255, .65); transition: width .15s linear; }
.plate-tags { display: flex; gap: 6px; font-weight: 700; font-size: 12px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; min-height: 0; }
.plate-tags:empty { display: none; }
.plate-tags span { color: var(--yellow); }

/* Loadout slots */
.loadout { position: absolute; left: 16px; top: 98px; display: flex; flex-direction: column; gap: 6px; }
.slots { display: flex; gap: 5px; }
.slot {
  position: relative; width: 38px; height: 38px; background: rgba(10, 8, 14, .88); display: grid; place-items: center; font-size: 20px; line-height: 1;
  border-bottom: 3px solid rgba(255, 255, 255, .12); box-shadow: var(--shadow-sm); font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}
.slot.p { width: 31px; height: 31px; font-size: 15px; }
.slot.max { border-bottom-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow), var(--shadow-sm); }
.slot .pip { position: absolute; left: 3px; right: 3px; bottom: -3px; height: 3px; display: flex; gap: 1px; }
.slot .pip u { flex: 1; background: rgba(255, 255, 255, .14); text-decoration: none; }
.slot .pip u.on { background: var(--yellow); }
.slot.p .pip u.on { background: #8fb6ff; }

/* Stats sheet (Tab) */
.sheet { position: absolute; left: 16px; top: 186px; width: 252px; background: rgba(12, 10, 16, .88); border-left: 4px solid var(--pink); box-shadow: var(--shadow-sm); padding: 7px 10px 8px; }
.sheet.closed { width: auto; padding: 3px 9px; border-left-color: var(--faint); }
.sheet.closed .sheet-body { display: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; gap: 10px; }
.sheet-head kbd { font-size: 12px; padding: 0 5px; border-bottom-width: 2px; }
.sheet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 2px; margin: 6px 0 7px; }
.sheet-grid div { display: flex; flex-direction: column; }
.sheet-grid small { font-weight: 700; font-size: 12px; letter-spacing: .6px; color: var(--muted); }
.sheet-grid small em { font-style: normal; margin-left: 2px; }
.sheet-grid small em.up { color: var(--green); } .sheet-grid small em.dn { color: #ff6a6a; }
.sheet-grid b { font-weight: 800; font-size: 15px; color: var(--text); line-height: 1.1; }
.dps-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 12px; letter-spacing: 2px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 5px; }
.dps-head b { color: var(--yellow); font-size: 14px; letter-spacing: .5px; }
.dps-row { position: relative; height: 15px; margin-top: 3px; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; }
.dps-row i { position: absolute; inset: 0 auto 0 0; background: rgba(255, 45, 120, .32); }
.dps-row span, .dps-row b { position: relative; }
.dps-row b { font-weight: 800; }

/* Scorebug (top center) */
.bug { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bug-main { display: flex; align-items: stretch; transform: skewX(var(--skew)); box-shadow: var(--shadow); }
.bug-floor { background: var(--yellow); color: #000; font-weight: 800; font-size: 15px; letter-spacing: 2px; padding: 0 12px; display: flex; align-items: center; text-transform: uppercase; }
.bug-time { background: #000; color: #fff; font-family: var(--display); font-size: 34px; line-height: 1; padding: 6px 16px 5px; min-width: 112px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.bug-name { background: rgba(14, 11, 18, .92); color: var(--muted); font-weight: 700; font-size: 15px; letter-spacing: 1.5px; padding: 0 14px; display: flex; align-items: center; text-transform: uppercase; white-space: nowrap; }
.bug.boss .bug-time { color: var(--red); }
.bug.warn .bug-time { color: var(--yellow); }
.bug.portal .bug-time { color: #c9a2ff; }
/* v23: the collapse countdown: red tab, blinking red clock */
.bug.collapse .bug-floor { background: var(--red); color: #fff; font-variant-numeric: tabular-nums; }   /* v23: "Collapse 1:49"; the run clock keeps counting up */
.bug.collapse.hurry .bug-floor { animation: collapseblink 1s steps(2) infinite; }
@keyframes collapseblink { 50% { background: #fff; color: var(--red); } }

/* Boss lower third */
.boss3 { display: none; flex-direction: column; align-items: center; width: min(620px, 70vw); }
.boss3.on { display: flex; animation: slateIn .45s cubic-bezier(.2, .9, .25, 1.1) both; }
.boss3-tag { align-self: flex-start; margin-left: 10px; font-weight: 800; font-size: 13px; letter-spacing: 3px; color: #fff; background: var(--red); padding: 2px 12px; transform: skewX(var(--skew)); text-transform: uppercase; }
.boss3-box { width: 100%; background: #000; padding: 6px 12px 9px; transform: skewX(var(--skew)); box-shadow: var(--shadow); }
.boss3-name { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.boss3-name b { font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 1px; text-transform: uppercase; color: #fff; line-height: 1.1; }
.boss3-name span { font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.boss3 .bar { height: 12px; margin-top: 4px; background: #2a0606; }
.boss3 .bar > i { background: linear-gradient(180deg, #ff6a3a, #d4141e); }
.boss3.enraged .boss3-tag { background: #ff6a00; }
.boss3.enraged .bar > i { animation: lowhp .4s ease-in-out infinite alternate; }
/* v21: boss phase gates (66% and 33%): markers on the bar; the bar goes shield-cyan while a gate is up */
.boss3 .bar > s.phase-mark { position: absolute; top: -1px; bottom: -1px; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 0 1px #000, 0 0 6px #7df9ff; z-index: 2; text-decoration: none; }
.boss3 .bar > s.phase-mark.passed { background: #5a5a66; box-shadow: 0 0 0 1px #000; }
.boss3 .bar.gated > i { background: linear-gradient(180deg, #c8fbff, #38d9ff 60%, #1a8fb0); animation: lowhp .3s ease-in-out infinite alternate; }

/* Viewer challenge */
.chal { display: none; flex-direction: column; align-items: center; gap: 4px; }
.chal.on { display: flex; }
.chal-box { display: flex; align-items: stretch; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm); }
.chal-tag { background: var(--pink); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 2px; padding: 3px 10px; text-transform: uppercase; display: flex; align-items: center; }
.chal-txt { background: rgba(10, 8, 14, .92); color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: .8px; padding: 3px 12px; display: flex; gap: 10px; align-items: center; }
.chal-txt b { color: var(--yellow); font-weight: 800; }
.chal-bar { width: 100%; height: 5px; background: rgba(0, 0, 0, .6); transform: skewX(var(--skew)); }
.chal-bar i { display: block; height: 100%; background: var(--pink); }
.chal-txt .mut { color: var(--muted); }
.chal.warn .chal-tag { background: var(--yellow); color: #000; animation: chalpulse .5s steps(2) infinite; }
.chal.warn .chal-bar i { background: var(--yellow); }
.chal.warn .chal-txt b { font-family: var(--display); font-size: 20px; line-height: 1; min-width: 16px; text-align: center; }
.chal.danger .chal-bar i { background: var(--red); }
@keyframes chalpulse { 50% { filter: brightness(1.35); } }
/* v15: set piece caption under the scorebug (walls, pincers, stampedes, rings) */
.wcap { display: none; align-items: stretch; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm); }
.wcap.on { display: flex; animation: wcapin .18s ease-out; }
.wcap.out { opacity: 0; transition: opacity .3s; }
.wcap-tag { background: var(--red); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 2px; padding: 3px 10px; text-transform: uppercase; display: flex; align-items: center; }
.wcap-txt { background: rgba(10, 8, 14, .92); color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: .6px; padding: 3px 12px; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.wcap-txt b { color: var(--yellow); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.wcap-txt span { color: var(--muted); }
@keyframes wcapin { from { transform: skewX(var(--skew)) translateY(-6px); opacity: 0; } }
.tally .chip.lured { display: none; }
.tally .chip.lured.on { display: flex; }
.tally .chip.lured span { background: #2a2006; color: var(--yellow); }
.tally .chip.lured b { color: var(--yellow); min-width: 0; }

/* Live block (top right) */
.live { position: absolute; top: 14px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.live-row { display: flex; align-items: stretch; transform: skewX(var(--skew)); box-shadow: var(--shadow); }
.live-badge { background: var(--red); color: #fff; font-weight: 800; font-size: 18px; letter-spacing: 3px; padding: 3px 12px 2px 10px; display: flex; align-items: center; gap: 8px; }
.live-badge i { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1.2s steps(2, start) infinite; }
.live-views { background: #000; color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .5px; padding: 2px 12px; display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.live-views small { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1.5px; }
.live-views.bump { animation: bump .35s ease-out; }
@keyframes bump { 30% { color: var(--yellow); transform: scale(1.08); } }
.tally { display: flex; gap: 6px; }
.tally .chip span { font-size: 12px; padding: 3px 7px; }
.tally .chip b { font-size: 15px; padding: 2px 9px; min-width: 44px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.tally .chip.kills b { color: #fff; }
.spon { width: 270px; background: rgba(10, 8, 14, .9); padding: 5px 10px 7px; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm); }
.spon-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 12px; letter-spacing: 2px; color: #ffc3d9; text-transform: uppercase; }
.spon-head b { color: #fff; }
.spon-bar { height: 7px; background: #2b0f1d; margin-top: 4px; overflow: hidden; }
.spon-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--yellow)); transition: width .2s linear; }
.spon.hot .spon-bar i { animation: lowhp .35s ease-in-out infinite alternate; }

/* Live chat */
.chat { position: absolute; right: 16px; top: 150px; width: 270px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
}
.chat .msg:first-child:not(:only-child) { opacity: .5; }
.chat .msg:nth-child(2):not(:last-child) { opacity: .78; }
.chat.off { display: none; }
.msg { background: rgba(8, 6, 11, .78); padding: 3px 9px 4px; font-family: var(--body); font-weight: 500; font-size: 13.5px; line-height: 1.3; color: #ece7f2; border-left: 3px solid var(--c, var(--pink)); animation: msgIn .25s ease-out; }
.msg u { text-decoration: none; font-family: var(--ui); font-weight: 800; letter-spacing: .4px; color: var(--c, var(--pink)); margin-right: 6px; font-size: 14px; }
.msg.mod { background: rgba(56, 217, 255, .14); }
.msg.donate { background: linear-gradient(90deg, rgba(255, 221, 46, .22), rgba(8, 6, 11, .8)); }
@keyframes msgIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.chat-hint { position: absolute; right: 16px; top: 150px; font-weight: 700; font-size: 12px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; display: none;
  background: rgba(8, 6, 11, .78); padding: 3px 9px; border-left: 3px solid var(--faint); }
.chat-hint.show { display: block; animation: msgIn .25s ease-out; }   /* chat off = hidden entirely; this only flashes after C */

/* Ticker (bottom) */
.ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; display: flex; align-items: stretch; background: #000; border-top: 3px solid var(--pink); }
.ticker-label { background: var(--cyan); color: #000; font-weight: 800; font-size: 15px; letter-spacing: 2.5px; padding: 0 14px 0 16px; display: flex; align-items: center; text-transform: uppercase; white-space: nowrap; position: relative; z-index: 1; }
.ticker-label::after { content: ''; position: absolute; right: -12px; top: 0; bottom: 0; width: 12px; background: var(--cyan); clip-path: polygon(0 0, 100% 0, 0 100%); }
.ticker-track { flex: 1; overflow: hidden; position: relative; display: flex; align-items: center; }
.ticker-text { white-space: nowrap; padding-left: 24px; font-family: var(--body); font-weight: 600; font-size: 15px; color: #fff; letter-spacing: .2px; will-change: transform; }
.ticker-text.fresh { color: var(--cyan); }
.ticker-help { display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #0f0c13; font-weight: 700; font-size: 12px; letter-spacing: 1.5px; color: var(--faint); text-transform: uppercase; white-space: nowrap; }
.ticker-help kbd { font-size: 12px; padding: 0 5px; border-bottom-width: 2px; margin-right: 4px; }

@keyframes blink { 50% { opacity: .15; } }

/* Boss lower third dock: where the boss bar moves when the boss walks up under it */
.boss-dock { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.boss-dock .boss3 { width: min(620px, 70vw); }

/* Minimap (bottom left, above the ticker) */
.mini { position: absolute; left: 16px; bottom: 46px; display: none; flex-direction: column; align-items: flex-start; }
.mini.on { display: flex; }
.mini canvas { display: block; border-left: 4px solid var(--pink); box-shadow: var(--shadow-sm); image-rendering: auto; }
.mini-tag { font-weight: 800; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: #000; background: var(--cyan); padding: 1px 9px 0; transform: skewX(var(--skew)); margin: 0 0 4px 4px; }

/* Settings */
.settings { display: flex; flex-direction: column; gap: 4px; min-width: min(640px, 100%); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-label { font-family: var(--ui); font-weight: 800; font-size: 18px; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.set-label small { font-family: var(--body); font-weight: 500; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); max-width: 300px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-btn { border-left-color: var(--faint); color: var(--muted); }
.seg-btn.on { background: var(--yellow); color: #000; border-left-color: #fff; }
.seg-btn.on:hover, .seg-btn.on.pad-focus { background: #ffe866; color: #000; }

/* Debug */
#debug { position: absolute; left: 10px; bottom: 44px; font: 12px/1.5 Consolas, monospace; color: #9fe8ff; background: rgba(0, 0, 0, .8); padding: 6px 10px; border-left: 3px solid var(--cyan); display: none; z-index: 4; }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-height: 760px) {
  .screen { gap: 13px; padding-top: 20px; padding-bottom: 20px; }
  .card-art.pic { height: 134px; padding: 10px 0 16px; }
  .card-desc { font-size: 13.5px; }
  .card-body { gap: 6px; }
  h2 { font-size: clamp(30px, 4.4vw, 50px); }
}
@media (max-width: 1100px) { .chat { width: 230px; } .spon { width: 230px; } .bug-name { display: none; } }
@media (max-width: 760px) {
  .plate { left: 10px; top: 10px; } .plate-body { width: 150px; padding: 5px 9px 6px; gap: 4px; } .plate-pic { width: 40px; font-size: 22px; } .plate-name { font-size: 15px; }
  .plate-lv { font-size: 12px; padding: 0 5px; } .bar { height: 13px; } .bar > b { font-size: 11px; }
  .live-views small { display: none; }
  .title { font-size: 13.5vw; }
  /* loot picks on a phone: icon stacked above the title, compact */
  .choice-card { flex-direction: column; align-items: center; }
  .choice-card .card-icon { padding: 10px 0 2px; font-size: 38px; }
  .choice-card .card-body { align-items: center; text-align: center; padding: 4px 14px 12px; gap: 5px; }
  .choice-card .card-name { align-self: center; font-size: 19px; margin: 0; }
  .choice-card .tags { justify-content: center; }
  .choice-card .key { top: 8px; }
  #lv-choices { gap: 12px; }
  .mini { left: 10px; bottom: 36px; }
  .boss-dock { bottom: 36px; }
  .boss-dock .boss3 { width: 70vw; }
  .settings { min-width: 0; width: 100%; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .slot { width: 30px; height: 30px; font-size: 16px; } .slot.p { width: 25px; height: 25px; font-size: 12px; }
  .sheet { display: none; }
  .bug { top: 42px; left: auto; right: 10px; transform: none; align-items: flex-end; }
  .boss3 { width: 62vw; } .boss3-name b { font-size: 17px; } .boss3-name span { display: none; }
  .bug-time { font-size: 24px; min-width: 76px; padding: 4px 10px; }
  .bug-floor { font-size: 12px; padding: 0 8px; }
  .boss3 { width: 70vw; }
  .live { top: 10px; right: 10px; } .live-badge { font-size: 13px; letter-spacing: 2px; padding: 2px 8px; } .live-views { font-size: 14px; padding: 2px 8px; }
  .loadout { left: 10px; top: 80px; }
  .tally, .spon, .chat, .chat-hint, .ticker-help { display: none !important; }
  .ticker { height: 28px; } .ticker-label { font-size: 12px; padding: 0 8px; } .ticker-text { font-size: 13px; }
  #toasts { bottom: 40px; }
  .card { width: 100%; max-width: 360px; } .class-slot { width: 100%; max-width: 360px; }
  .choice-card { min-height: 0; }
  .btn { font-size: 18px; }
  .stat-grid { grid-template-columns: 1fr; }
  .onair { top: 12px; right: 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.card-perk b { font-style: normal; font-family: var(--ui); font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--accent, var(--yellow)); }
.chat { max-height: calc(100vh - 420px); overflow: hidden; }

/* Pixel-art icons (art/icons, 16x16 source). Integer scales only so pixels stay square. */
.px-ico { width: 32px; height: 32px; image-rendering: auto; vertical-align: middle; margin: -8px 2px -6px 0; display: inline-block; }
.px-ico.sm { width: 16px; height: 16px; margin: -3px 3px -2px 0; }
.slot .px-ico { margin: 0; }
.slot { width: 40px; height: 40px; }
.slot.p { width: 36px; height: 36px; }
.choice-card .card-icon .px-ico { width: 64px; height: 64px; margin: 0; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); }
.card-weapon .px-ico { margin: -9px 0 -8px 0; }
.build-item span .px-ico { margin: -8px 4px -7px -2px; }
.kv span .px-ico.sm { margin: -2px 6px 0 0; }
@media (max-width: 760px) {
  .slot { width: 30px; height: 30px; } .slot.p { width: 26px; height: 26px; }
  .slot .px-ico { width: 16px; height: 16px; }
  .choice-card .card-icon .px-ico { width: 48px; height: 48px; }
}

/* Inked crawler portraits fill the top of the card */
.card-art.pic { height: 170px; padding: 0; }
.card-art.pic::before { display: none; }
.card-art.pic .card-portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; box-shadow: none; }
/* v16 crop fix: the portraits' hair and crowns touch the top of the art, so give them headroom and anchor at the top */
.card-art.pic { padding-top: 14px; box-sizing: border-box; background: radial-gradient(ellipse 90% 80% at 50% 35%, color-mix(in srgb, var(--accent) 38%, #120e16), #07060a 78%); }
.card-art.pic .card-portrait { object-position: center top; }
@media (max-height: 760px) { .card-art.pic { height: 150px; } }

/* v13 touch devices: no keyboard badges on loot picks */
body.touch .choice-card .key { display: none; }

/* =====================================================================
   v14: progression and bosses
   ===================================================================== */
/* Loot cards: tier frames (Common / Rare / Legendary), level change, stat diff, evolution hint */
.choice-card { min-height: 250px; --tier: #8a8494; }
.choice-card.tier-common { --tier: #b08a64; }
.choice-card.tier-rare { --tier: #4fa8ff; box-shadow: 0 0 0 2px var(--tier), 6px 6px 0 #000; }
.choice-card.tier-legendary { --tier: #ffc93a; box-shadow: 0 0 0 3px var(--tier), 6px 6px 0 #000, 0 0 28px rgba(255, 201, 58, .35); }
.choice-card.tier-legendary::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 160, .16) 48%, transparent 60%) 0 0 / 300% 100%;
  animation: tierSheen 2.4s linear infinite;
}
@keyframes tierSheen { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.choice-card.evo { --tier: #ff7ad9; box-shadow: 0 0 0 3px #ffc93a, 0 0 0 6px var(--pink), 6px 6px 0 #000, 0 0 36px rgba(255, 122, 217, .45); }
.choice-card { border-top-color: var(--tier); }
.tier-tag {
  position: absolute; top: 10px; right: 10px; font-family: var(--ui); font-weight: 800; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #000; background: var(--tier); padding: 1px 8px; transform: skewX(var(--skew));
}
.choice-card .card-name.long { font-size: 18px; }
.lv-change { font-family: var(--ui); font-weight: 800; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.lv-change b { color: var(--yellow); }
.diff { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: rgba(0, 0, 0, .35); border-left: 3px solid var(--tier);
  font-family: var(--ui); font-weight: 700; font-size: 14px; letter-spacing: .5px; color: #d9d2e3; text-align: left; }
.diff b { color: #7dff9a; }
.pair-hint { font-family: var(--ui); font-weight: 700; font-size: 13px; letter-spacing: .5px; color: #ffb0e4; line-height: 1.3; }
.card-desc .beh { color: var(--yellow); font-weight: 700; }
.tag.evo { background: linear-gradient(90deg, var(--pink), #ffc93a); color: #000; }
.tag.cursed { background: #5a0a18; color: #ff9aa5; }
.tag.lb { background: #2a2433; color: #ffe9a8; }
.lb-ico { font-size: 46px; }
/* chained picks: cards swap in place, no gameplay flicker between picks */
#lv-choices.swap .choice-card { animation: cardSwap .2s cubic-bezier(.2, .9, .25, 1.1) both; }
#lv-choices.swap .choice-card:nth-child(2) { animation-delay: .03s; }
#lv-choices.swap .choice-card:nth-child(3) { animation-delay: .06s; }
#lv-choices.swap .choice-card:nth-child(4) { animation-delay: .09s; }
#lv-choices.swap .choice-card:nth-child(5) { animation-delay: .12s; }
@keyframes cardSwap { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
/* v23: the focused pick has to read at a glance on a controller. The tier frames above replace the generic focus
   shadow, so the focused card gets a pulsing white outline (outlines don't fight the tier box-shadows), lifts and
   grows, and carries an "A · Pick" tab; the other cards dim back (filter, which the swap-in animation leaves alone) */
#lv-choices .choice-card { transition: transform .14s, box-shadow .14s, filter .14s; }
/* v23: five picks (Benefactor boxes, extra-choice perks) fit one row: the shared .cards cap (1240px) was 22px short.
   On narrower windows the cards give up a little width before anything wraps */
@media (min-width: 1000px) {
  #lv-choices { width: 100%; max-width: 1340px; flex-wrap: nowrap; }
  #lv-choices .choice-card { flex: 0 1 238px; min-width: 0; }
}
#lv-choices .choice-card.pad-focus { transform: translateY(-12px) scale(1.05); outline: 4px solid #fff; outline-offset: 5px; z-index: 2; animation: pickPulse 1s ease-in-out infinite; }
#lv-choices:has(.choice-card.pad-focus) .choice-card:not(.pad-focus) { filter: brightness(.55) saturate(.6); }
body.pad #lv-choices .choice-card.pad-focus::after {
  content: 'A · Pick'; position: absolute; left: 50%; bottom: -19px; transform: translateX(-50%) skewX(var(--skew));
  font-family: var(--ui); font-weight: 800; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap;
  color: #000; background: #fff; padding: 3px 16px; box-shadow: var(--shadow-sm); animation: pickTab 1s ease-in-out infinite;
}
@keyframes pickPulse { 50% { outline-color: var(--yellow); } }
@keyframes pickTab { 50% { background: var(--yellow); } }
#lv-kicker { white-space: nowrap; }

/* Locked crawlers: silhouette, unlock goal and progress */
.card.locked { filter: none; opacity: 1; }
.card.locked .card-art { background: radial-gradient(circle at 50% 45%, #2a2233, #000 70%); }
.card.locked img.sil { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .55)) drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); box-shadow: none; }
.card.locked .card-art.pic .card-portrait.sil { height: 100%; }
.sil-canvas, .crawler-canvas { width: 120px; height: 120px; display: block; margin: 0 auto; }
.sil-canvas { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .6)) drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); }
.lock-badge { position: absolute; left: 10px; top: 10px; z-index: 2; font-family: var(--ui); font-weight: 800; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: #000; background: var(--muted); padding: 1px 8px; transform: skewX(var(--skew)); }
.card.locked .card-name { background: var(--panel-3); color: var(--text); }
.unlock-goal { font-family: var(--ui); font-weight: 800; font-size: 15px; letter-spacing: .8px; text-transform: uppercase; color: var(--text); line-height: 1.25; }
.unlock-goal span { display: block; font-size: 12px; letter-spacing: 1.5px; color: var(--accent, var(--yellow)); }
.mbar.goal i { background: var(--accent, var(--yellow)); }
/* Safe Room rank pips */
.shop-pips { display: flex; gap: 3px; margin: 3px 0 4px; transform: skewX(var(--skew)); }
.shop-pips i { width: 14px; height: 6px; background: rgba(255, 255, 255, .1); }
.shop-pips i.on { background: var(--yellow); }
#shop-list { max-height: 62vh; overflow-y: auto; padding-right: 6px; }

/* Banner and intro card move to the bottom when the boss is in the top half */
#banner.low { top: 60%; }
.toast.mini { border-left-color: var(--yellow); padding: 6px 12px 7px; }
.toast.mini .toast-main { color: var(--yellow); font-size: 14px; }

/* Boss intro card: a broadcast lower third with a spotlight sweep (about 1.5s; the world slows meanwhile) */
#bossintro {
  position: absolute; left: 50%; top: 17%; z-index: 2; display: none; align-items: stretch; pointer-events: none;
  transform: translateX(-50%) skewX(var(--skew)); box-shadow: 10px 10px 0 #000; max-width: min(760px, 94vw); overflow: hidden;
}
#bossintro.low { top: auto; bottom: 14%; }
#bossintro.show { display: flex; animation: biIn .38s cubic-bezier(.2, .9, .25, 1.15) both; }
#bossintro.out { animation: biOut .32s ease-in both; }
@keyframes biIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes biOut { to { opacity: 0; transform: translateX(-50%) skewX(var(--skew)) translateY(-10px); } }
.bi-pic { width: 150px; flex-shrink: 0; background: radial-gradient(circle at 50% 40%, #3a2a3a, #000 75%); display: grid; place-items: center; border-right: 5px solid var(--red); }
.bi-pic img { max-width: 136px; max-height: 136px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 #000); transform: skewX(calc(var(--skew) * -1)); }
.bi-pic canvas { width: 140px; height: 140px; transform: skewX(calc(var(--skew) * -1)); }
.bi-body { background: rgba(10, 8, 14, .95); padding: 12px 22px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bi-kicker { font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 2.5px; text-transform: uppercase; color: #000; background: var(--red); align-self: flex-start; padding: 1px 10px; }
.bi-name { font-family: var(--display); font-size: clamp(30px, 4.2vw, 50px); line-height: 1.02; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; }
.bi-title { font-family: var(--ui); font-weight: 800; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; color: var(--yellow); }
.bi-line { font-family: var(--body); font-style: italic; font-size: 15px; line-height: 1.3; color: #ddd6e6; max-width: 520px; }
.bi-beam {
  position: absolute; inset: -40% auto -40% 0; width: 140px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 246, 200, .38), transparent); transform: skewX(-20deg);
  animation: biBeam 1.1s .12s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes biBeam { from { left: -160px; } to { left: 110%; } }
@media (max-width: 760px) { .bi-pic { width: 96px; } .bi-pic img, .bi-pic canvas { max-width: 88px; max-height: 88px; width: 88px; height: 88px; } .bi-line { display: none; } }
.slot.evo { border-bottom-color: var(--pink); box-shadow: 0 0 0 2px #ffc93a, 0 0 10px rgba(255, 122, 217, .6), var(--shadow-sm); }
.slot.evo .pip u.on { background: var(--pink); }
#hud.intro .boss3 { opacity: 0; }   /* the intro card is the "now fighting" moment */
.boss3 { transition: opacity .25s; }
.plate-tags .st { color: #000; background: var(--muted); padding: 0 6px; }
.plate-tags .st.bad { background: var(--pink); color: #fff; }
.plate-tags .st.poison { background: #8dff6a; }

/* =====================================================================
   v19: achievements (popup, badge grid, recap) and the voice picker
   ===================================================================== */
/* In-run popup: a broadcast card. js/achievements.js places it (left/top) away from the crawler and the boss. */
#achpop {
  --k: 1; position: absolute; left: 50%; top: 70%; z-index: 1; display: none; align-items: stretch; pointer-events: none;
  width: min(calc(470px * var(--k)), 92vw); transform: skewX(var(--skew)); box-shadow: calc(8px * var(--k)) calc(8px * var(--k)) 0 #000;
  transition: opacity .16s;   /* v21: moves by fading out and in (it used to slide across the screen) */
}
#achpop.moving { opacity: 0; }
#achpop.show { display: flex; animation: apIn .42s cubic-bezier(.2, .9, .25, 1.15) both; }
#achpop.out { animation: apOut .36s ease-in both; }
#achpop.held { opacity: 0; }
@keyframes apIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes apOut { to { opacity: 0; transform: skewX(var(--skew)) translateY(calc(10px * var(--k))); } }
.ap-badge {
  position: relative; flex-shrink: 0; width: calc(86px * var(--k)); display: grid; place-items: center; border-right: calc(5px * var(--k)) solid var(--yellow);
  background: radial-gradient(circle at 50% 42%, #4a3a12, #120d06 72%);
}
.ap-badge::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 240, 170, .35) 48%, transparent 62%) 0 0 / 300% 100%; animation: tierSheen 1.6s .2s linear 2; }
.ap-badge .ap-ico { width: calc(62px * var(--k)); height: calc(62px * var(--k)); margin: 0; transform: skewX(calc(var(--skew) * -1)); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .7)); }
.ap-badge em { position: absolute; right: calc(4px * var(--k)); bottom: calc(4px * var(--k)); font: 400 calc(20px * var(--k))/1 var(--display); color: #000; background: var(--yellow); padding: 1px 6px; font-style: normal; }
.ap-body { flex: 1; min-width: 0; background: rgba(10, 8, 14, .95); padding: calc(9px * var(--k)) calc(16px * var(--k)) calc(11px * var(--k)); display: flex; flex-direction: column; gap: calc(3px * var(--k)); text-align: left; }
.ap-kick { align-self: flex-start; font: 800 calc(13px * var(--k))/1.25 var(--ui); letter-spacing: 2.5px; text-transform: uppercase; color: #000; background: var(--yellow); padding: 1px 10px; }
.ap-name { font: 400 calc(27px * var(--k))/1.05 var(--display); letter-spacing: 1px; text-transform: uppercase; color: #fff; text-shadow: 3px 3px 0 #000; }
.ap-desc { font: italic 500 calc(14px * var(--k))/1.3 var(--body); color: #ddd6e6; }
.ap-rw { align-self: flex-start; display: inline-flex; align-items: baseline; gap: 7px; margin-top: 2px; font: 800 calc(14px * var(--k))/1.3 var(--ui); letter-spacing: .8px; color: var(--cyan); }
.ap-rw i { font-style: normal; font-size: calc(11px * var(--k)); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.ap-rw.tB { color: #e8a060; } .ap-rw.tS { color: #dfe8f0; } .ap-rw.tG { color: #ffd36b; text-shadow: 0 0 8px rgba(255, 211, 107, .5); }
#achpop.multi .ap-desc { margin-bottom: 2px; }
.ap-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0; border-top: 1px solid var(--line); font: 800 calc(15px * var(--k))/1.2 var(--ui); letter-spacing: .5px; color: #fff; text-transform: uppercase; }
.ap-row .ap-ico.sm { width: calc(22px * var(--k)); height: calc(22px * var(--k)); margin: 0; }
.ap-row .ap-rw { margin: 0 0 0 auto; text-transform: none; }
/* v21: the reward wraps instead of running past the card (the wipe-in clip-path cut it off on phones) */
.ap-rw { flex-wrap: wrap; max-width: 100%; }
.ap-row b { min-width: 0; overflow-wrap: anywhere; }
.ap-more { font: 700 calc(12px * var(--k))/1.2 var(--ui); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }

/* Achievements screen: badge grid */
.ach-count { display: inline-block; margin-left: 8px; font-family: var(--ui); font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.ach-count b { color: var(--yellow); font-size: 1.15em; }
.ach-scroll { width: min(1180px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ach-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 12px; text-align: left; }
.ach-card { --t: var(--muted); display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border-left: 5px solid var(--t); box-shadow: 5px 5px 0 #000; padding: 10px 12px 10px 10px; min-height: 116px; }
.ach-card.tB { --t: #cd7f32; } .ach-card.tS { --t: #cfd8e0; } .ach-card.tG { --t: #ffd36b; } .ach-card.tgold { --t: #ffb020; } .ach-card.tview { --t: var(--cyan); }
.ach-card.got { background: linear-gradient(135deg, color-mix(in srgb, var(--t) 14%, var(--panel)), var(--panel) 60%); }
.ach-ico { width: 58px; height: 58px; flex-shrink: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2c2433, #0b090e 75%); transform: skewX(var(--skew)); font-size: 30px; }
.ach-ico .ach-img { width: 52px; height: 52px; margin: 0; transform: skewX(calc(var(--skew) * -1)); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)); }
.ach-card.locked .ach-img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .5)) drop-shadow(0 0 8px color-mix(in srgb, var(--t) 50%, transparent)); opacity: .9; }
.ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ach-cat { font: 800 11px/1.2 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--t); }
.ach-name { font: 400 19px/1.08 var(--display); letter-spacing: .6px; text-transform: uppercase; color: #fff; }
.ach-card.locked .ach-name { color: var(--faint); }
.ach-desc { font: italic 500 13.5px/1.3 var(--body); color: #ddd6e6; }
.ach-hint { font: italic 500 13.5px/1.3 var(--body); color: var(--muted); }
.ach-hint::after { content: ' · The System AI'; font-style: normal; font-family: var(--ui); font-weight: 700; letter-spacing: .5px; color: var(--cyan); font-size: 12px; }
.ach-goal { font: 700 12.5px/1.25 var(--ui); letter-spacing: .4px; color: var(--muted); }
.ach-meta { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font: 700 12px/1.3 var(--ui); letter-spacing: .6px; color: var(--faint); text-transform: uppercase; }
.ach-rw { color: var(--t); }
.ach-sec { margin: 6px 0 0; font: 400 26px/1 var(--display); letter-spacing: 1px; text-transform: uppercase; color: #fff; }

/* Results: death achievements and the run's haul */
.res-ach { width: min(760px, 100%); display: flex; flex-direction: column; gap: 8px; }
.res-ach:empty { display: none; }
/* v21: stats and achievements side by side; the achievements panel scrolls, top highlights first, the rest grouped and collapsed */
.res-body { display: flex; gap: 18px; align-items: flex-start; justify-content: center; flex-wrap: wrap; width: min(1240px, 100%); }
.res-body #res-stats { flex: 1 1 460px; max-width: 640px; margin: 0; }
.res-body .res-ach { flex: 1 1 380px; max-width: 540px; max-height: min(60vh, 540px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: var(--panel); border-top: 4px solid var(--yellow); box-shadow: 6px 6px 0 #000; padding: 12px 14px 14px; }
.rc-head { display: flex; align-items: baseline; gap: 8px; }
.rc-head b { font: 400 22px/1 var(--display); color: #fff; letter-spacing: 1px; }
.rc-head span { margin-left: auto; font: 800 11px/1.4 var(--ui); letter-spacing: 1.5px; color: #000; background: var(--yellow); padding: 0 7px; text-transform: uppercase; }
.rc-top { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-card { --t: var(--muted); display: flex; align-items: center; gap: 9px; background: linear-gradient(135deg, color-mix(in srgb, var(--t) 16%, var(--panel-2)), var(--panel-2) 70%); border-left: 4px solid var(--t); padding: 7px 9px; text-align: left; min-width: 0; }
.rc-card .rc-ico { width: 40px; height: 40px; margin: 0; flex-shrink: 0; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)); }
.rc-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rc-txt b { font: 400 16px/1.1 var(--display); letter-spacing: .5px; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }
.rc-txt em, .rc-row em { font: 800 10px/1.3 var(--ui); font-style: normal; letter-spacing: 1.5px; color: #000; background: var(--yellow); padding: 0 5px; text-transform: uppercase; margin-right: 6px; vertical-align: 1px; }
.rc-rw { font: 800 13px/1.25 var(--ui); letter-spacing: .4px; color: var(--t); }
.rc-rw small, .rc-row span small { font: 600 11.5px/1.2 var(--body); font-style: italic; letter-spacing: 0; color: var(--muted); }
.res-ach .rc-death { padding: 6px 12px 7px 8px; gap: 10px; }
.res-ach .rc-death .ach-img { width: 42px; height: 42px; }
.res-ach .rc-death b { font-size: 19px; }
.res-ach .rc-death p { font-size: 13px; margin: 1px 0; }
.res-ach .rc-death.slim { padding: 4px 12px 5px 8px; }
.res-ach .rc-death.slim .ach-img { width: 30px; height: 30px; }
.res-ach .rc-death.slim b { font-size: 16px; margin-right: 8px; }
.res-ach .rc-death.slim .ach-kick { display: none; }
.rc-card.tB, .rc-row.tB { --t: #e0a060; } .rc-card.tS, .rc-row.tS { --t: #dfe8f0; } .rc-card.tG, .rc-row.tG { --t: #ffd36b; }
.rc-card.tgold, .rc-row.tgold { --t: #ffb020; } .rc-card.tview, .rc-row.tview { --t: var(--cyan); }
.rc-toggle { align-self: center; margin-top: 2px; }
.rc-toggle .rc-hide, .res-ach.open .rc-toggle .rc-show { display: none; }
.res-ach.open .rc-toggle .rc-hide { display: inline; }
.rc-more { display: none; flex-direction: column; gap: 8px; }
.res-ach.open .rc-more { display: flex; }
.rc-group { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.rc-cat { font: 800 11px/1.2 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.rc-cat i { font-style: normal; color: #000; background: var(--muted); padding: 0 5px; }
.rc-group .rc-row { --t: var(--muted); display: flex; transform: none; background: transparent; border-bottom: 1px solid var(--line); padding: 3px 2px; }
.rc-group .rc-row > * { transform: none; }
.rc-group .rc-row span { margin-left: auto; color: var(--t); font-weight: 700; text-align: right; }
@media (max-width: 760px) { .rc-top { grid-template-columns: 1fr; } .res-body .res-ach { max-height: none; }
  .rc-group .rc-row { flex-wrap: wrap; } .rc-group .rc-row span { flex-basis: 100%; text-align: left; margin-left: 24px; } }
.rc-death { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--panel); border-left: 5px solid var(--red); box-shadow: 5px 5px 0 #000; padding: 8px 14px 9px 10px; }
.rc-death .ach-img { width: 52px; height: 52px; margin: 0; }
.rc-death b { font: 400 22px/1.1 var(--display); letter-spacing: .8px; text-transform: uppercase; color: #fff; }
.rc-death p { margin: 2px 0; font: italic 500 14px/1.3 var(--body); color: #ddd6e6; }
.rc-death .ach-rw { font: 800 13px/1.3 var(--ui); letter-spacing: .6px; color: var(--yellow); }
.ach-kick { font: 800 11px/1.2 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--red); }
.rc-head { font: 800 13px/1.2 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--yellow); text-align: left; }
.rc-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-row { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); padding: 3px 10px 3px 6px; font: 700 13.5px/1.2 var(--ui); letter-spacing: .4px; color: #fff; transform: skewX(var(--skew)); }
.rc-row > * { transform: skewX(calc(var(--skew) * -1)); }
.rc-row em { font-style: normal; font-size: 11px; letter-spacing: 1.5px; color: #000; background: var(--yellow); padding: 0 5px; }
.rc-row span { color: var(--muted); font-weight: 600; }

/* Settings: voice picker */
.voice-pick { align-items: center; margin-left: auto; justify-content: flex-end; }
.voice-pick .vname { min-width: 220px; max-width: 320px; font: 800 15px/1.25 var(--ui); letter-spacing: .5px; color: #fff; text-align: center; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-pick .vlang { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: 1px; margin-left: 4px; }
@media (max-width: 760px) { .ach-grid { grid-template-columns: 1fr; } .voice-pick .vname { min-width: 0; max-width: 60vw; } .ap-desc { display: none; } }

/* =====================================================================
   v21: Tutorial Guild card (js/tutorial.js). A System AI lower third above the ticker;
   the welcome card sits higher and bigger. Hidden under full screens (the level-up
   screen gets its own hint, .lv-tut). Scales with the HUD (--hudk from Broadcast.fit).
   ===================================================================== */
#tut {
  position: absolute; left: 50%; bottom: 52px; z-index: 3; width: min(540px, 92vw); display: none; pointer-events: none;
  transform: translateX(-50%); zoom: var(--hudk, 1); text-align: left; filter: drop-shadow(6px 6px 0 #000);
}
#tut.show { display: block; animation: tutIn .38s cubic-bezier(.2, .9, .25, 1.15) both; }
#tut.under { visibility: hidden; }
#tut.swap .tut-body > * { animation: tutSwap .32s ease-out both; }
@keyframes tutIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes tutSwap { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.tut-tab { display: inline-flex; align-items: stretch; transform: skewX(var(--skew)); margin-left: 12px; font: 800 13px/1 var(--ui); letter-spacing: 2.5px; text-transform: uppercase; }
.tut-tab span { background: var(--cyan); color: #000; padding: 5px 12px 4px; }
.tut-tab b { background: #000; color: var(--cyan); padding: 5px 12px 4px; font-weight: 800; }
.tut-body {
  position: relative; background: linear-gradient(100deg, rgba(10, 18, 24, .96), rgba(10, 8, 14, .96) 55%); border-left: 6px solid var(--cyan);
  padding: 10px 18px 12px 16px; transform: skewX(var(--skew)); display: flex; flex-direction: column; gap: 4px;
}
.tut-body > * { transform: skewX(calc(var(--skew) * -1)); }
.tut-who { font: 800 11px/1.2 var(--ui); letter-spacing: 2.5px; text-transform: uppercase; color: var(--cyan); }
.tut-title { font: 400 28px/1.02 var(--display); letter-spacing: 1px; text-transform: uppercase; color: #fff; text-shadow: 3px 3px 0 #000; }
.tut-text { font: 500 15px/1.35 var(--body); color: #e6e1ec; }
.tut-hint { font: 800 14px/1.5 var(--ui); letter-spacing: .6px; color: var(--yellow); text-transform: uppercase; }
.tut-hint kbd { font-size: 12.5px; margin-right: 3px; color: #fff; }
.tut-prog { position: relative; height: 18px; margin-top: 4px; background: rgba(56, 217, 255, .1); overflow: hidden; }
.tut-prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(56, 217, 255, .55), var(--cyan)); transition: width .18s linear; }
.tut-prog span { position: relative; display: block; padding: 0 8px; font: 800 12px/18px var(--ui); letter-spacing: 1.5px; text-transform: uppercase; color: #fff; text-shadow: 0 1px 0 #000; }
#tut.done .tut-prog i { background: linear-gradient(90deg, #2bd47a, var(--green)); }
#tut.done .tut-title::after { content: ' \2713'; color: var(--green); }
.tut-skip {
  position: absolute; right: 8px; top: 0; pointer-events: auto; cursor: pointer; border: 0; transform: skewX(var(--skew));
  font: 800 12px/1 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); background: #000; padding: 5px 10px 4px; box-shadow: var(--shadow-sm);
}
.tut-skip:hover { color: #fff; background: var(--panel-3); }
.tut-skip kbd { font-size: 11px; padding: 0 4px; margin-left: 4px; border-bottom-width: 2px; }
body.touch .tut-skip kbd { display: none; }
/* the welcome card: higher and bigger */
#tut.intro { bottom: auto; top: 30%; width: min(600px, 92vw); }
#tut.intro .tut-title { font-size: 44px; }
#tut.intro .tut-text { font-size: 16.5px; }
#tut.intro .tut-prog { display: none; }
/* level-up screen hint during the tutorial */
.lv-tut { display: none; max-width: min(720px, 94vw); align-items: center; gap: 10px; text-align: left; background: rgba(10, 18, 24, .92); border-left: 5px solid var(--cyan);
  padding: 7px 14px; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm); }
.lv-tut.on { display: flex; }
.lv-tut > * { transform: skewX(calc(var(--skew) * -1)); }
.lv-tut b { flex-shrink: 0; font: 800 12px/1.3 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: #000; background: var(--cyan); padding: 1px 8px; }
.lv-tut span { font: 500 14.5px/1.35 var(--body); color: #e6e1ec; }
.bug.tut .bug-time { color: var(--cyan); }
@media (max-width: 760px) {
  #tut { bottom: 34px; width: calc(100vw - 16px); }
  #tut .tut-title { font-size: 22px; } #tut .tut-text { font-size: 13.5px; } #tut .tut-hint { font-size: 12.5px; }
  #tut.intro { top: 24%; } #tut.intro .tut-title { font-size: 32px; }
  body.tut-on .mini, body.tut-on #toasts { display: none !important; }
  .lv-tut span { font-size: 13px; }
}

/* =====================================================================
   v21 phone layout fixes (desktop untouched: everything below is phone-only)
   ===================================================================== */
@media (max-width: 760px) {
  /* title: ON AIR sat on top of the kicker; it now leads the title block */
  .screen-title { padding-top: 46px; }
  .screen-title > .onair { top: 10px; right: 50%; transform: translateX(50%) skewX(var(--skew)); font-size: 11px; padding: 3px 10px; letter-spacing: 2px; }
  /* alert cards sit above the minimap instead of on top of it */
  #toasts { bottom: 164px; right: 8px; max-width: calc(100vw - 16px); }
  /* boss bar dock: to the right of the minimap, never over it */
  .boss-dock { left: 116px; right: 8px; transform: none; bottom: 36px; align-items: stretch; }
  .boss-dock .boss3 { width: 100%; }
  /* boss intro card: compact */
  .bi-kicker { font-size: 11px; letter-spacing: 1.5px; padding: 1px 7px; }
  .bi-name { font-size: 28px; }
  .bi-title { font-size: 13px; }
  .bi-body { padding: 8px 14px 10px; }
  /* viewer challenge strip: full width, the goal text wraps */
  .chal-box { max-width: calc(100vw - 20px); }
  .chal-txt { flex-wrap: wrap; row-gap: 0; font-size: 13.5px; }
  .wcap-txt { white-space: normal; font-size: 13.5px; }
  /* achievement popup: narrower badge, readable rewards */
  .ap-badge { width: 64px; } .ap-badge .ap-ico { width: 46px; height: 46px; }
  .ap-name { font-size: 22px; }
}
/* no alert cards over a boss intro card */
body.bi-on #toasts { opacity: 0; transition: opacity .2s; }
@media (max-width: 760px) { body.ap-on #toasts { opacity: 0; transition: opacity .2s; } }

/* v21: Floor Cleared, an episode recap */
#screen-stageclear { background: radial-gradient(ellipse 70% 55% at 50% 38%, rgba(255, 221, 46, .12), rgba(8, 7, 11, .9) 70%), linear-gradient(180deg, rgba(8, 7, 11, .7), rgba(8, 7, 11, .94)); }
#screen-stageclear h2 { font-size: clamp(40px, 6.4vw, 78px); }
.sc-recap { width: min(860px, 100%); display: flex; flex-direction: column; gap: 12px; }
.sc-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sc-tile { background: var(--panel); border-top: 4px solid var(--yellow); box-shadow: 6px 6px 0 #000; padding: 12px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: skewX(var(--skew)); animation: scTile .45s cubic-bezier(.2, .9, .25, 1.15) both; }
.sc-tile:nth-child(2) { animation-delay: .06s; } .sc-tile:nth-child(3) { animation-delay: .12s; } .sc-tile:nth-child(4) { animation-delay: .18s; }
.sc-tile > * { transform: skewX(calc(var(--skew) * -1)); }
.sc-tile b { font: 400 clamp(30px, 3.6vw, 44px)/1 var(--display); color: #fff; letter-spacing: 1px; text-shadow: 3px 3px 0 #000; }
.sc-tile span { font: 800 12px/1.2 var(--ui); letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }
.sc-tile.v { border-top-color: var(--pink); } .sc-tile.v b { color: var(--pink-soft); }
@keyframes scTile { from { opacity: 0; transform: skewX(var(--skew)) translateY(14px); } }
.sc-hls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sc-hl { display: inline-flex; align-items: stretch; transform: skewX(var(--skew)); box-shadow: var(--shadow-sm); background: var(--panel-2); font: 800 15px/1 var(--ui); letter-spacing: .8px; color: #fff; text-transform: uppercase; padding: 0 12px 0 0; align-items: center; }
.sc-hl i { font-style: normal; background: #000; color: var(--muted); font-size: 12px; letter-spacing: 2px; padding: 8px 10px; margin-right: 10px; }
.sc-hl.gold { background: var(--yellow); color: #000; } .sc-hl.gold i { color: var(--yellow); }
.sc-next { display: flex; flex-direction: column; align-items: center; gap: 3px; background: linear-gradient(90deg, transparent, rgba(255, 45, 120, .16), transparent); padding: 10px 40px; width: min(760px, 100%); }
.sc-next-k { font: 800 12px/1.2 var(--ui); letter-spacing: 3px; text-transform: uppercase; color: var(--pink-soft); }
.sc-next b { font: 400 30px/1.05 var(--display); text-transform: uppercase; letter-spacing: 1px; color: #fff; }
.sc-next-s { font: 700 14px/1.3 var(--ui); letter-spacing: 1px; text-transform: uppercase; color: var(--yellow); }
.sc-next-n { font: 500 14px/1.3 var(--body); color: var(--muted); }
@media (max-width: 760px) { .sc-tiles { grid-template-columns: 1fr 1fr; } .sc-next { padding: 8px 12px; } .sc-next b { font-size: 24px; } }

/* v21: one art box for every crawler card. The figure fills the box height (head room at the top, feet or waist at
   the bottom), so a waist-up portrait, a full-body illustration and a pixel sprite all read at the same size. */
.card-art.pic .card-portrait { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; box-shadow: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.card-art.pic .card-portrait.from-sprite { image-rendering: auto; }
.card.locked .card-art.pic { background: radial-gradient(circle at 50% 45%, #2a2233, #000 70%); }
.card.locked .card-art.pic .card-portrait.sil { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .55)) drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); }

/* ---- v22: Zev, your PR agent (show bookings between floors) ---- */
#screen-zev { background: radial-gradient(ellipse 70% 55% at 50% 30%, rgba(56, 217, 255, .13), rgba(8, 7, 11, .9) 70%), linear-gradient(180deg, rgba(8, 7, 11, .72), rgba(8, 7, 11, .95)); gap: 14px; overflow-y: auto; }
#screen-zev .zev-title { font-size: clamp(30px, 4.4vw, 54px); color: #fff; }
.zev-top { display: flex; align-items: flex-end; gap: 18px; width: min(980px, 100%); }
.zev-pic { position: relative; flex: 0 0 auto; width: 150px; height: 190px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
.zev-pic img { max-width: 100%; max-height: 100%; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .6)); animation: zevBob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.zev-pic .zev-ph { display: none; }
.zev-pic.nopic .zev-ph { display: block; position: relative; width: 120px; height: 170px; animation: zevBob 2.6s ease-in-out infinite; }
.zev-bowl { position: absolute; left: 10px; top: 0; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), rgba(120, 220, 255, .35) 40%, rgba(40, 140, 220, .45)); border: 4px solid #000; box-shadow: inset -8px -10px 0 rgba(0, 60, 120, .3); }
.zev-fish { position: absolute; left: 34px; top: 22px; font-size: 48px; animation: zevSwim 3s ease-in-out infinite; }
.zev-suit { position: absolute; left: 22px; top: 94px; width: 76px; height: 76px; border-radius: 20px 20px 10px 10px; border: 4px solid #000; background: repeating-linear-gradient(45deg, #f4f4f4 0 6px, #d8dde4 6px 9px); }
.zev-pic.wobble img, .zev-pic.wobble .zev-ph { animation: zevWobble .45s ease-out; }
@keyframes zevBob { 50% { transform: translateY(-5px); } }
@keyframes zevSwim { 50% { transform: translateX(14px) scaleX(-1); } }
@keyframes zevWobble { 20% { transform: rotate(-9deg); } 45% { transform: rotate(7deg); } 70% { transform: rotate(-4deg); } 100% { transform: rotate(0); } }
.zev-bubble { position: relative; flex: 1; background: var(--panel-2); border: 3px solid #000; box-shadow: var(--shadow); padding: 12px 18px 14px; margin-bottom: 22px; }
.zev-bubble::before { content: ''; position: absolute; left: -20px; bottom: 26px; border: 10px solid transparent; border-right: 14px solid #000; }
.zev-bubble b { font: 400 28px/1 var(--display); letter-spacing: 1px; color: var(--cyan); text-transform: uppercase; }
.zev-role { display: block; font: 700 12px/1.3 var(--ui); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 2px 0 6px; }
#zev-say { font: 500 17px/1.4 var(--body); color: var(--text); min-height: 3.2em; margin: 0; }
#zev-say.zev-warn { color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.zev-rule { margin: 8px 0 0; font: 700 13px/1.35 var(--ui); letter-spacing: .5px; color: var(--red); text-transform: uppercase; }
.zev-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(980px, 100%); }
.zev-card { position: relative; display: flex; flex-direction: column; gap: 7px; text-align: left; background: var(--panel); border: 3px solid #000; border-top: 6px solid var(--zc); box-shadow: var(--shadow); padding: 14px 14px 12px; color: var(--text); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.zev-card:hover, .zev-card:focus-visible, .zev-card.pad-focus { transform: translateY(-4px); box-shadow: 7px 9px 0 #000, 0 0 0 3px var(--zc); outline: none; }
.zev-key { position: absolute; top: 8px; right: 10px; font: 800 13px/1 var(--ui); color: var(--muted); }
.zev-again { align-self: flex-start; background: var(--zc); color: #000; font: 800 11px/1 var(--ui); letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 7px; }
.zev-show { font: 400 22px/1.05 var(--display); letter-spacing: .5px; text-transform: uppercase; color: var(--zc); padding-right: 14px; }
.zev-host { font: 700 12px/1 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.zev-pitch { font: 400 14px/1.4 var(--body); color: #d9d2e4; flex: 1; }
.zev-perk { font: 700 14px/1.35 var(--ui); color: var(--green); }
.zev-cost { font: 700 14px/1.35 var(--ui); color: var(--pink-soft); }
.zev-skip { opacity: .8; }
body.phone .zev-cards { grid-template-columns: 1fr; }
body.phone .zev-pic { width: 90px; height: 120px; } body.phone .zev-pic.nopic .zev-ph { transform: scale(.65); transform-origin: 50% 100%; }
/* v22: short landscape phones: buttons wrap in rows, smaller title, and the menu scrolls if it still doesn't fit */
@media (max-height: 440px) {
  #screen-menu, .screen-title { overflow-y: auto !important; }
  .screen-title .title { font-size: clamp(30px, 11vh, 52px) !important; }
  .screen-title .sub, .screen-title .kicker { font-size: 11px; }
  body.phone .screen-title .menu-buttons, .screen-title .menu-buttons { flex-direction: row !important; flex-wrap: wrap; width: min(640px, 100%) !important; gap: 5px 6px !important; justify-content: center; }
  body.phone .screen-title .menu-buttons .btn, .screen-title .menu-buttons .btn { font-size: 12px !important; padding: 6px 10px 5px !important; }
}

/* v22: Donut rides Mongo */
.ride-btn { position: fixed; right: 18px; bottom: 96px; z-index: 30; display: none; padding: 8px 14px; border-radius: 999px;
  border: 2px solid #5ad1e8; background: rgba(10,20,30,0.82); color: #e8fbff; font: 800 15px 'Barlow Condensed', 'Arial Narrow', sans-serif;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer; pointer-events: auto; }
.ride-btn.on { background: #5ad1e8; color: #08202a; }
.ride-btn { display: none; align-items: center; gap: 6px; }
.ride-btn kbd { font-size: 11px; opacity: 0.75; margin-left: 4px; }
.ride-ico { width: 30px; height: 30px; object-fit: contain; margin: -6px 0 -6px -4px; filter: drop-shadow(0 1px 1px #000); }

/* v22: Safe Room hub */
#screen-hub { padding: 0; background: #0b0708; }
#hub-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hub-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; z-index: 2; }
.hub-hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: rgba(255,240,220,0.75); font: 600 14px 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 1px; z-index: 2; pointer-events: none; text-shadow: 0 1px 3px #000; }
#hub-prompt { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: rgba(10,8,6,0.85); border: 2px solid #ffd36b;
  color: #ffe9b0; font: 800 16px 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 1px; text-transform: uppercase; opacity: 0; transition: opacity .15s; pointer-events: none; z-index: 2; }
#hub-prompt.show { opacity: 1; }
#hub-msg { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); max-width: min(680px, 90vw); padding: 10px 16px; border-radius: 10px; background: rgba(10,8,6,0.88);
  border-left: 4px solid #39ff88; color: #e9ffe9; font: 500 15px/1.35 'Barlow', 'Arial', sans-serif; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 2; }
#hub-msg.show { opacity: 1; }
#hub-panel { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); z-index: 3; }
#hub-panel.show { display: flex; }
.hub-card { width: min(620px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: #16110d; border: 2px solid #3a2c22; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.hub-card header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
.hub-card h3 { margin: 0; font: 800 26px 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #ffd36b; }
.hub-card .hub-list { overflow: auto; padding: 4px 14px; }
.hub-card footer { padding: 10px 14px 14px; display: flex; justify-content: flex-end; }
.hub-note { margin: 0 18px 6px; color: #cbb9a4; font-style: italic; }
.hub-sub { margin: 12px 4px 4px; color: #ffd36b; font: 800 15px 'Barlow Condensed', sans-serif; letter-spacing: 2px; text-transform: uppercase; }
.hub-screens { display: grid; gap: 10px; padding: 6px 2px 10px; }
.hub-scr { background: #061a0c; border: 2px solid #1d5a32; border-radius: 8px; padding: 10px 12px; color: #6dff9e; font: 500 15px/1.4 'Courier New', monospace; }
.hub-scr b { display: block; color: #b6ffcf; margin-bottom: 4px; }

/* v23: level-up Details panel (I / stick click / Details button) */
.lv-info { display: none; flex: none; width: min(900px, 94vw); max-height: 34vh; overflow-y: auto; scrollbar-width: thin; text-align: left; background: rgba(10, 8, 18, .94);
  border: 1px solid rgba(255, 255, 255, .1); border-left: 4px solid var(--box, #b98cff); padding: 9px 14px 8px; box-shadow: var(--shadow-sm); font: 500 14px/1.35 var(--ui); color: var(--t); }
#screen-levelup.info .lv-info { display: block; }
.lv-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#screen-levelup.info { gap: 10px; }
/* the panel repeats each card's numbers and evolution hint, so the cards drop them (and shrink their art) while it's open */
#screen-levelup.info #lv-choices .choice-card .diff, #screen-levelup.info #lv-choices .choice-card .pair-hint { display: none; }
@media (max-height: 900px) { #screen-levelup.info #lv-choices .card-icon { transform: scale(.72); margin: -14px 0 -12px; } }
@media (max-height: 820px) { .lv-info { max-height: 25vh; } #screen-levelup.info { padding-top: 12px; padding-bottom: 10px; } }
#screen-levelup.info #lv-choices .choice-card.info-on:not(.pad-focus) { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 4px; }
.li-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.li-head .px-ico { width: 28px; height: 28px; }
.li-head b { font: 800 16px/1.1 var(--ui); letter-spacing: .4px; text-transform: uppercase; }
.li-head span { margin-left: auto; font: 700 11px/1 var(--ui); letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.li-sec { margin-top: 6px; }
.li-sec h5 { margin: 0 0 3px; font: 800 11px/1.2 var(--ui); letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.li-w { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; border-top: 1px solid rgba(255, 255, 255, .05); }
.li-w:first-of-type { border-top: 0; }
.li-w .px-ico { width: 24px; height: 24px; flex: none; }
.li-w b { font-weight: 800; margin-right: 6px; }
.li-w i { font: 800 10px/1 var(--ui); font-style: normal; letter-spacing: .8px; text-transform: uppercase; color: #12091f; background: #b98cff; padding: 2px 5px; margin-right: 6px; vertical-align: 2px; }
.li-w span { color: var(--muted, #c9c2d6); }
.li-w span b, .li-stats b { color: #8dffb0; font-weight: 800; margin: 0; }
.li-w s { text-decoration: none; opacity: .45; margin: 0 6px; }
.li-w em { font-style: normal; font-weight: 800; color: #8dffb0; }
.li-w em.dn { color: #ff8a8a; }
.li-stats { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.li-same, .li-none { margin: 3px 0 0; color: var(--faint); font-size: 13px; }
.li-hint { margin-top: 6px; font-size: 13px; color: #d9b8ff; }
.li-foot { margin: 6px 0 0; font-size: 11px; color: var(--faint); letter-spacing: .3px; }
@media (max-width: 700px) { .lv-info { font-size: 13px; max-height: 40vh; } }

/* v23: achievement gold to claim */
.ach-claim { margin-top: 6px; align-self: flex-start; background: #ffd36b; color: #1a1206; border-color: #ffd36b; font-weight: 800; }
.ach-claim:hover, .ach-claim.pad-focus { background: #ffe28f; }
.ach-claimed { margin-top: 4px; font: 700 11.5px/1.2 var(--ui); letter-spacing: .6px; text-transform: uppercase; color: var(--faint); }
.ach-gold { color: #ffd36b; }
.ach-claimall { margin-left: 10px; vertical-align: middle; background: #ffd36b; color: #1a1206; border-color: #ffd36b; font-weight: 800; }
.ach-badge { display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px; border-radius: 10px; background: #ffd36b; color: #1a1206; font: 800 12px/18px var(--ui); text-align: center; vertical-align: 2px; }

/* v23: Floor 3 race & class selection */
#screen-select { background: radial-gradient(ellipse 70% 55% at 50% 30%, color-mix(in srgb, var(--accent, #c9a2ff) 16%, transparent), rgba(8, 7, 11, .9) 70%), linear-gradient(180deg, rgba(8, 7, 11, .72), rgba(8, 7, 11, .95)); }
.sel-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: min(900px, 100%); }
.sel-card { flex: 1 1 320px; max-width: 440px; text-align: left; background: var(--panel); border: 3px solid #000; border-top: 6px solid var(--accent, #c9a2ff); box-shadow: var(--shadow); padding: 14px 16px 12px; }
.sel-kind { font: 800 12px/1 var(--ui); letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); }
.sel-name { font-family: var(--display); font-size: 30px; line-height: 1.05; margin: 6px 0 8px; color: var(--accent, #fff); text-transform: uppercase; }
.sel-card ul { margin: 0; padding-left: 18px; font: 500 15px/1.4 var(--body); color: var(--text); }
.sel-card li + li { margin-top: 4px; }
.sel-req { margin-top: 8px; font: 700 12.5px/1.3 var(--ui); letter-spacing: .4px; color: var(--muted); }
.plate-cls { font: 700 11px/1.2 var(--ui); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.card-sel { margin-top: 6px; font: 600 12.5px/1.3 var(--ui); color: var(--muted); }
.card-sel b { color: var(--accent, #c9a2ff); }
/* v23: achievements per crawler */
.ach-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: min(1100px, 100%); }
.ach-tab { opacity: .7; }
.ach-tab.on { opacity: 1; background: var(--yellow); color: #111; border-color: var(--yellow); }
/* v23: the big map (M / View): a see-through square over the middle of the screen; you keep playing under it */
.bigmap { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); display: none; flex-direction: column; align-items: flex-start; pointer-events: none; z-index: 2; }
.bigmap.on { display: flex; }
.bigmap canvas { display: block; border: 2px solid rgba(255, 255, 255, .18); border-left: 4px solid var(--pink); box-shadow: var(--shadow-sm); }
/* v23: stat points (slotless picks) */
.tag.stat { background: #3a8cff; color: #fff; }
.sheet-pts { margin: 2px 0 4px; font: 700 11px/1.3 var(--ui); letter-spacing: .6px; color: #9fc4ff; }
/* v23: Ratings under the view count */
.live-hype { font: 700 11px/1.2 var(--ui); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); text-align: right; margin-top: 1px; transition: color .3s; }
.live-hype.hot { color: #ff7ad9; }
.live-hype.cold { color: #8aa0b8; }
/* v23: settings sections and the FPS counter */
.set-head { margin: 14px 0 4px; font: 800 13px/1 var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--yellow); text-align: left; }
.set-head:first-child { margin-top: 0; }
.fps { position: absolute; right: 14px; bottom: 34px; display: none; font: 700 12px/1 var(--ui); letter-spacing: .8px; color: #8dffb0; background: rgba(0, 0, 0, .55); padding: 3px 6px; pointer-events: none; }
.fps.on { display: block; }

