/* NOITA DEATHMATCH — Noita-flavoured pixel UI. Dark stone panels, gold accents,
   pixel fonts, crisp 2px borders, no smoothing on any pixel art. */
/* the numerals: same advances + vertical metrics as their parent font, so swapping them re-lays out nothing */
@font-face { font-family: 'ND Numerals'; src: url('ndnum.woff2') format('woff2'); unicode-range: U+0030-0039; font-display: block; }
@font-face { font-family: 'ND Numerals Title'; src: url('ndnum-title.woff2') format('woff2'); unicode-range: U+0030-0039; font-display: block; }
:root {
  --bg: #0b0a0d;
  --panel: rgba(18, 15, 20, 0.94);
  --panel2: rgba(30, 25, 32, 0.95);
  --edge: #4a3f36;
  --edge2: #7b6650;
  --text: #e8dcc8;
  --dim: #9a8d7a;
  --dimmer: #6f6556;
  --gold: #f2c14e;
  --red: #c8282c;
  --blue: #3b7bd8;
  --lev: #e0b84a;
  --green: #6fd05a;
  /* 'ND Numerals*' carry only the digits 0-9 (tools/numfont.py; verdict 9 #4, Karl's "506"): every number takes
     a 5 that is never an S or an 8, a 6 that is never a G, a slashed 0; the letters stay Pixelify / Silkscreen */
  --font: 'ND Numerals', 'Pixelify Sans', 'Silkscreen', monospace;
  --title: 'ND Numerals Title', 'Silkscreen', 'Pixelify Sans', monospace;
  --slot: 36px;
  --hslot: 26px;
  --ui-scale: 1;      /* set by app.js from the viewport: 1 at 1280x720, 1.5 at 1920x1080 */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; user-select: none; }
/* Pixelify Sans draws its "fi" ligature as a lone glyph ("Fireball" read "Areball", "Final" read "Anal"): plain letters
   everywhere. Form controls reset font-variant through the UA's `font` shorthand, so they get it explicitly. */
html, body, button, input, select, textarea { font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; display: block; }
canvas#ovl { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; image-rendering: pixelated; z-index: 1; }
img.icon, canvas.icon, img { image-rendering: pixelated; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 2; }
button { font-family: var(--title); font-size: 15px; color: var(--text); background: linear-gradient(#3a3028, #2a221c); border: 2px solid var(--edge2); box-shadow: inset 0 0 0 2px #1a1410, 0 2px 0 #000; padding: 8px 14px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
button:hover, button.padon { color: #fff; border-color: var(--gold); background: linear-gradient(#4a3c30, #33291f); }
button:active { transform: translateY(1px); }
button.big { font-size: 19px; padding: 12px 22px; }
button.small { font-size: 11px; padding: 4px 8px; }
button.primary { border-color: #b08a3a; color: #ffe7a8; }
button:disabled { opacity: 0.45; cursor: default; }
input, select { font-family: var(--title); font-size: 15px; background: #120f14; color: var(--text); border: 2px solid var(--edge); padding: 6px 8px; outline: none; }
input:focus, select:focus { border-color: var(--gold); }
select { cursor: pointer; -webkit-appearance: none; appearance: none; padding: 6px 30px 6px 10px; border-color: var(--edge2); box-shadow: inset 0 0 0 2px #1a1410, 0 2px 0 #000;
  background: #120f14 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%23f2c14e' d='M0 0h10v2H8v2H6v2H4V4H2V2H0z'/%3E%3C/svg%3E") no-repeat right 9px center; }
select:hover, select.padon { border-color: var(--gold); color: #fff; }
select option { background: #120f14; color: var(--text); font-family: var(--title); }
/* pixel sliders + checkboxes (no browser-blue anywhere) */
input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; padding: 0; background: transparent; border: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; background: linear-gradient(90deg, #8a6a24 0 var(--fill, 50%), #120f14 var(--fill, 50%) 100%); border: 2px solid var(--edge); box-shadow: 0 0 0 1px #000; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 20px; margin-top: -7px; background: var(--gold); border: 2px solid #3a2a08; box-shadow: inset -2px -2px 0 #b08a3a, 0 0 0 1px #000; }
input[type=range]::-moz-range-track { height: 6px; background: #120f14; border: 2px solid var(--edge); }
input[type=range]::-moz-range-progress { height: 6px; background: #8a6a24; }
input[type=range]::-moz-range-thumb { width: 10px; height: 18px; background: var(--gold); border: 2px solid #3a2a08; border-radius: 0; }
input[type=range]:focus::-webkit-slider-thumb, input[type=range].padon::-webkit-slider-thumb { background: #fff3c4; }
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; padding: 0; background: #120f14; border: 2px solid var(--edge2); box-shadow: 0 0 0 1px #000; cursor: pointer; position: relative; }
input[type=checkbox]:checked::after { content: ''; position: absolute; inset: 3px; background: var(--gold); box-shadow: inset -2px -2px 0 #b08a3a; }
h2, h3 { font-family: var(--title); font-weight: 400; margin: 0 0 10px; letter-spacing: 1px; }
h2 { font-size: 24px; color: var(--gold); }
h3 { font-size: 14px; color: var(--dim); margin-top: 14px; }
h3 small, h2 small { font-family: var(--font); font-size: 12px; color: var(--dimmer); text-transform: none; letter-spacing: 0; }
.panel { background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #1f1a16, 0 10px 40px rgba(0,0,0,0.6); padding: 22px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.lbl { color: var(--dim); font-size: 14px; }
.hint { color: var(--dimmer); font-size: 13px; margin: 14px 0 0; }

/* TITLE */
#title { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), rgba(0,0,0,0.75)); }
.logo { display: flex; flex-direction: column; align-items: center; font-family: var(--title); line-height: 0.9; text-shadow: 0 0 18px rgba(170, 90, 255, 0.55), 4px 4px 0 #000; }
.logo .l1 { font-size: clamp(56px, 11vw, 132px); color: #e9d7ff; letter-spacing: 8px; }
.logo .l2 { font-size: clamp(22px, 4.2vw, 50px); color: var(--gold); letter-spacing: 10px; text-shadow: 0 0 14px rgba(255, 170, 40, 0.6), 3px 3px 0 #000; }
.tag { color: var(--dim); font-size: 16px; margin-bottom: 8px; text-shadow: 2px 2px 0 #000; }
.menu { display: flex; flex-direction: column; gap: 8px; width: min(340px, 86vw); }
.menu button { width: 100%; }
.menurow { display: flex; gap: 8px; }
.menurow button { flex: 1; }
.joinrow { display: flex; gap: 8px; }
.joinrow input { width: 110px; text-transform: uppercase; text-align: center; letter-spacing: 4px; }
.joinrow button { flex: 1; }
.namebox { margin-top: 10px; color: var(--dim); text-shadow: 2px 2px 0 #000; }
.namebox input { width: 170px; margin-left: 6px; }
.padhint { color: var(--gold); font-size: 13px; text-shadow: 2px 2px 0 #000; }
.foot { position: absolute; bottom: 10px; color: #5a5146; font-size: 12px; }
@media (max-height: 760px) { .logo .l1 { font-size: 84px; } .logo .l2 { font-size: 32px; } .menu { gap: 6px; } .menu button.big { padding: 9px 18px; } #title { gap: 6px; } }

/* LOBBY */
#lobby, #end, #modal, #esc { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); }
#modal, #esc { z-index: 20; }
.lobbypanel { width: min(580px, 94vw); }
/* verdict 10 #4: a lobby option keeps its label beside its select; the row breaks between options, never inside one */
.lopt { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.lobbywait { color: var(--gold); font-size: 15px; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.code { color: #fff; letter-spacing: 6px; background: #120f14; border: 2px solid var(--edge); padding: 2px 10px; }
.plist { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel2); border: 2px solid #2a231e; font-size: 17px; }
.plist .sw { width: 14px; height: 14px; border: 2px solid #000; flex: none; }
.plist .tagx { margin-left: auto; color: var(--dim); font-size: 13px; }
.plist .ready { color: var(--green); }
body:not(.host) .hostonly { display: none !important; }
body.host .guestonly { display: none !important; }
.waithost { color: var(--dim); }
.roundsauto { color: var(--gold); }
.lobbytarget { margin-top: 12px; color: var(--gold); font-family: var(--title); font-size: 14px; }

/* HUD */
#hud { pointer-events: none; }
/* every HUD block keeps its 1280x720 share of the screen: zoomed by --ui-scale (text re-lays out
   crisply at the larger size; the anchored corners grow with it) */
#hud .wands, #hud .bars, #hud .roundinfo, #hud .spectate, #hud .pickups, #hud .score, #hud .netstat, .reconnect { zoom: var(--ui-scale); }
.wands { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.wandrow { display: flex; align-items: center; gap: 2px; padding: 3px; background: rgba(10, 8, 12, 0.72); border: 2px solid #2a231e; position: relative; }
.wandrow.on { border-color: var(--gold); box-shadow: 0 0 8px rgba(242, 193, 78, 0.35); }
.wandrow:not(.on) { opacity: 0.72; }
.wandrow .num { width: 14px; font-family: var(--title); font-size: 11px; color: var(--dim); text-align: center; }
.wandrow.on .num { color: var(--gold); }
.wandrow img.wand { width: 48px; height: 18px; margin-right: 4px; }
.wandrow .rl { position: absolute; left: 0; bottom: -2px; height: 2px; background: #c8c0b0; }
.slot { width: var(--slot); height: var(--slot); background: rgba(0,0,0,0.5); border: 2px solid #3a3029; display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.slot img { width: calc(var(--slot) - 4px); height: calc(var(--slot) - 4px); }
.slot .uses { position: absolute; right: 1px; bottom: -1px; font-size: 10px; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; font-family: var(--title); }
.wandrow .slot { width: var(--hslot); height: var(--hslot); border-width: 1px; }
.wandrow .slot img { width: calc(var(--hslot) - 2px); height: calc(var(--hslot) - 2px); }
.items { display: flex; gap: 4px; margin-top: 4px; }
.items .slot { width: 30px; height: 30px; }
.bars { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.barrow { display: flex; align-items: center; gap: 6px; }
.hico { width: 14px; height: 14px; display: inline-block; background-size: 100% 100%; image-rendering: pixelated; flex: none; }
.bar { width: 190px; height: 12px; background: rgba(0,0,0,0.65); border: 2px solid #2a231e; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width 0.08s linear; }
.bar.hp { height: 16px; } .bar.hp i { background: linear-gradient(#e2393d, #8e1518); }
.bar.hp.low { border-color: #8e1518; animation: pulse 0.5s infinite alternate; }
.bar.mana i { background: linear-gradient(#5ea0ff, #2552a8); }
.bar.reload { height: 8px; } .bar.reload i { background: #c8c0b0; }
.bar.lev { height: 8px; } .bar.lev i { background: linear-gradient(#ffd86a, #b58a1e); }
.bar.hp b { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 13px; font-family: var(--title); text-shadow: 1px 1px 0 #000; }
.gold { display: flex; align-items: center; gap: 6px; font-family: var(--title); font-size: 15px; color: var(--gold); text-shadow: 2px 2px 0 #000; margin-top: 2px; }
.coin { width: 10px; height: 10px; background: radial-gradient(#ffe48a, #c08a12); border: 1px solid #5a3c06; display: inline-block; }
/* the comeback chip (judge verdict 6 #4): under the health bar, and in the Holy Mountain header */
.cbchip { font-family: var(--title); font-size: 12px; line-height: 1; color: #ffd27a; background: rgba(8, 6, 10, 0.78); border: 2px solid #b8862a; padding: 3px 7px; text-shadow: 1px 1px 0 #000; white-space: nowrap; box-shadow: 0 0 8px rgba(242, 193, 78, 0.35); }
.cbchip.mo { color: #9ff0ff; border-color: #3aa6c4; box-shadow: 0 0 8px rgba(80, 200, 240, 0.4); }
.cbchip.hm { display: inline-block; margin-left: 8px; vertical-align: middle; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; padding: 2px 5px; }
/* statuses: Noita-style icon + name + remaining-time bar, one chip per status, by the bars */
.statuses { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; min-height: 0; }
.stchip { display: flex; align-items: center; gap: 5px; background: rgba(8, 6, 10, 0.78); border: 2px solid var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); padding: 2px 6px 2px 3px; animation: stin 0.25s ease-out; }
.stchip img { width: 28px; height: 28px; image-rendering: pixelated; flex: none; }
.stchip span { display: flex; flex-direction: column; gap: 2px; min-width: 74px; }
.stchip b { font-family: var(--title); font-size: 12px; font-weight: 400; color: var(--c); text-shadow: 1px 1px 0 #000; text-transform: uppercase; line-height: 1; }
.stchip b .stt { font-style: normal; color: #fff; margin-left: 8px; float: right; }
.stchip i { display: block; height: 4px; background: rgba(0, 0, 0, 0.7); border: 1px solid #000; }
.stchip u { display: block; height: 100%; width: 100%; background: var(--c); text-decoration: none; transition: width 0.1s linear; }
@keyframes stin { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }
/* your perks in the fight: icons in a row under the bars, stack counts as x2 badges */
.hudperks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 4px; max-width: 228px; margin-top: 2px; }
.hperk { position: relative; width: 30px; height: 30px; background: rgba(8, 6, 10, 0.75); border: 1px solid #4a3f36; }
.hperk img { width: 28px; height: 28px; display: block; }
.hperk em, .sperk b { position: absolute; right: -4px; bottom: -5px; font-style: normal; font-family: var(--title); font-size: 11px; color: #fff; background: #8a3414; border: 1px solid #000; padding: 0 2px; line-height: 12px; }
.hudtip { z-index: 60; max-width: calc(260px * var(--ui-scale)); font-size: calc(13px * var(--ui-scale)); }
.hudtip .tn { font-size: calc(16px * var(--ui-scale)); }
/* flasks: liquid colour + fill level, key hints */
.items { align-items: center; }
.items .slot.flask { position: relative; }
.items .slot.flask img { width: 20px; height: 28px; }
.items .slot.flask .fill { position: absolute; left: 0; bottom: -4px; height: 3px; box-shadow: 0 0 0 1px #000; }
.ihint { font-size: 11px; font-family: var(--title); color: #c8bca8; text-shadow: 1px 1px 0 #000; line-height: 1.55; margin-left: 4px; white-space: nowrap; }
.ihint kbd { font-family: var(--title); font-size: 11px; background: #1a1614; border: 1px solid var(--edge); padding: 0 3px; color: #fff; }
.feed { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; font-size: 14px; text-shadow: 2px 2px 0 #000; }
.feed div { background: rgba(0,0,0,0.5); padding: 2px 8px; animation: fadeout 7s forwards; display: flex; align-items: center; gap: 6px; }
.feed img { width: 18px; height: 18px; }
.feed .me { border: 1px solid rgba(242, 193, 78, 0.6); }
@keyframes fadeout { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
.banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; line-height: 1.15; font-family: var(--title); font-size: calc(clamp(28px, 5vw, 56px) * var(--ui-scale)); color: #fff; text-shadow: 0 0 16px rgba(170,90,255,0.6), 4px 4px 0 #000; }
.subbanner { position: absolute; left: 0; right: 0; top: calc(24% + 70px * var(--ui-scale)); text-align: center; font-size: calc(20px * var(--ui-scale)); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.roundinfo { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-family: var(--title); font-size: 13px; color: var(--dim); text-shadow: 2px 2px 0 #000; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.roundinfo .pipsrow { display: flex; gap: 12px; }
.roundinfo .pp { display: flex; gap: 2px; align-items: center; }
.roundinfo .pp i { width: 9px; height: 9px; border: 1px solid #000; display: inline-block; }
.roundinfo .pp.dead { opacity: 0.35; }
.roundinfo .sd { color: #ff6a20; font-size: 16px; animation: pulse 0.6s infinite alternate; }
.roundinfo .sdw { color: #ff9a4a; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }
.score { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); min-width: 460px; }
.score table { width: 100%; border-collapse: collapse; font-size: 16px; }
.score td, .score th { padding: 6px 10px; text-align: left; border-bottom: 1px solid #2a231e; }
.score th { color: var(--dim); font-family: var(--title); font-size: 12px; font-weight: 400; }
.spectate { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); font-family: var(--title); font-size: 16px; color: #fff; background: rgba(0,0,0,0.6); border: 2px solid var(--edge); padding: 6px 14px; text-shadow: 2px 2px 0 #000; text-align: center; }
.spectate small { display: block; font-family: var(--font); font-size: 12px; color: var(--dim); }
/* verdict 8 #10: a wizard who joined mid-round sits it out: his own bars and wands are dimmed, the label says when he plays */
.spectate small.sitnote { margin-top: 3px; color: var(--gold); font-size: 13px; }
body.sitout #hud #wands, body.sitout #hud .barrow { opacity: 0.3; filter: grayscale(1); }
.pickups { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.pickups div { background: rgba(10, 8, 12, 0.8); border: 1px solid var(--edge); padding: 3px 10px; font-size: 14px; display: flex; gap: 6px; align-items: center; text-shadow: 1px 1px 0 #000; transition: opacity 0.4s; }
.pickups div.out { opacity: 0; }
.pickups img { width: 20px; height: 20px; }
.pickups .g { color: var(--gold); }
.netstat { position: absolute; left: 12px; bottom: 8px; font-size: 11px; color: #5a5146; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(170, 0, 0, 0.55) 100%); transition: opacity 0.06s linear; }
.vignette.sd { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(255, 90, 0, 0.35) 100%); }

/* HOLY MOUNTAIN */
#build { display: flex; align-items: center; justify-content: center; background: rgba(5, 4, 8, 0.62); }
.mountain { width: min(1240px, 97vw); max-height: min(96vh, 940px); display: flex; flex-direction: column; background: var(--panel); border: 2px solid var(--edge2); box-shadow: 0 0 0 2px #000, inset 0 0 40px rgba(255, 200, 120, 0.05), 0 0 60px rgba(242, 193, 78, 0.12); padding: 12px 16px; position: relative; }
.mountain header { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #2a231e; padding-bottom: 8px; flex: none; }
.htitle { font-family: var(--title); font-size: 22px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 190, 60, 0.4); white-space: nowrap; }
.htitle small { font-size: 12px; color: var(--dim); }
/* verdict 9 #7: "Next arena: <name>" never wraps (min-width auto: the row's other blocks give way; the ready
   chips shrink their font, app.js renderReadys); the comeback chip may take the line under it */
.bnext { color: var(--dim); font-size: 13px; flex: 1; line-height: 1.2; }
.bnext .bna { white-space: nowrap; }
.bnext.stack .bna { display: block; }
.bnext.stack .bnl { display: block; font-family: var(--title); font-size: 10px; line-height: 12px; color: var(--dimmer); text-transform: uppercase; }
.bnext b { color: var(--text); font-weight: 400; }
.hgold { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--title); font-size: 20px; color: var(--gold); background: #120f14; border: 2px solid #5a4620; padding: 2px 10px; white-space: nowrap; cursor: help; flex: none; }
.hgold .hgtop { display: flex; align-items: center; gap: 6px; line-height: 1.1; }
.hgold.bump .hgtop { animation: bump 0.3s; }
/* verdict 8 #1 / #8: the gold ledger folds into the gold chip: the last round's pay (and what was spent here)
   under the total, the whole ledger in a panel that opens on hover, focus or a click on the chip */
.hgold .hgln { font-family: var(--font); font-size: 12px; line-height: 1.15; color: #ddd0b8; }
.hgold .hgln:empty { display: none; }
.hgold .hgln b { color: var(--gold); font-weight: 400; }
.hgold .hgln .sp { color: #ff9a7a; }
.bledger { display: none; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 30; min-width: 220px; max-width: 360px; white-space: normal; text-align: left;
  font-family: var(--font); font-size: 13px; line-height: 1.35; color: var(--text); background: rgba(12, 10, 14, 0.98); border: 2px solid #5a4620; box-shadow: 0 0 0 2px #000; padding: 8px 10px; cursor: default; }
.hgold:hover .bledger, .hgold:focus .bledger, .hgold.open .bledger { display: block; }
.bledger .blh { font-family: var(--title); font-size: 10px; color: var(--dimmer); margin-bottom: 4px; }
.bledger .bll { display: flex; justify-content: space-between; gap: 14px; }
.bledger .bll span:first-child { color: var(--dim); }
.bledger .bll.sec { margin-top: 4px; font-family: var(--title); font-size: 10px; color: var(--dimmer); }
.bledger .bll.tot { margin-top: 4px; border-top: 1px solid #3a3026; padding-top: 3px; color: var(--gold); }
.bledger .neg { color: #ff9a7a; } .bledger .pos { color: #9ee07a; }
@keyframes bump { 50% { transform: scale(1.15); } }
.breadys { display: flex; gap: 4px; min-width: 0; flex: 0 1 auto; overflow: hidden; font-size: 11px; }
.breadys span { font-family: var(--title); font-size: 1em; padding: 3px 6px; border: 2px solid #2a231e; background: #120f14; color: var(--dim); white-space: nowrap; display: flex; align-items: center; gap: 4px; flex: none; }
.breadys span.w { color: #8a7e6c; }
.breadys span em { font-style: normal; color: var(--green); }
.breadys span i { width: 8px; height: 8px; border: 1px solid #000; display: inline-block; }
.breadys span.r { color: var(--green); border-color: #2f5a26; }
.btimer { font-family: var(--title); font-size: 30px; color: #fff; min-width: 54px; text-align: right; }
.btimer.low { color: #ff5a3a; animation: pulse 0.5s infinite alternate; }
.bomen { flex: none; margin-top: 6px; padding: 4px 10px; font-size: 13px; color: var(--dim); background: rgba(90, 30, 10, 0.35); border: 1px solid #5a2a14; }
.bomen b { color: #ff9a4a; font-weight: 400; }
.bwarn { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 5; font-family: var(--title); font-size: 20px; color: #fff; background: #7a1a10; border: 2px solid #ff5a3a; padding: 6px 18px; box-shadow: 0 0 0 2px #000, 0 0 30px rgba(255, 60, 30, 0.5); animation: pulse 0.4s infinite alternate; pointer-events: none; }
.bcols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: minmax(0, 1fr); gap: 16px; }
.bleft, .bright { display: flex; flex-direction: column; min-height: 0; }
/* the right column: the draft and the perks scroll if they must; Ready stays pinned under them (verdict 8 #1) */
.bright { overflow: hidden; }
.bscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.bfoot { flex: none; padding-top: 10px; background: var(--panel); }
.bleft h3, .bright h3 { margin: 10px 0 6px; }
.bwands { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
/* a wand list taller than its room ends where the first wand that does not fit begins and says so (app.js wandsCue):
   the cue sits under its edge, the bag and the wand bodies keep the column's foot */
.bwmore { flex: none; margin-top: -2px; padding: 1px 0 2px; text-align: center; font-family: var(--title); font-size: 10px; line-height: 12px; color: var(--gold); border-top: 1px dashed #6a5420; cursor: pointer; }
.bwmore:hover { color: #fff3c0; }
.bwmore .bwml { text-align: left; }
.bwmore .bwmrow { padding: 2px 6px 0; font-family: var(--font); font-size: 11px; line-height: 14px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bwmore .bwmrow:hover { color: #fff3c0; }
.bleft .baghead { margin-top: auto; }
.bwand { background: var(--panel2); border: 2px solid #2a231e; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; position: relative; }
.bwand:hover { border-color: #5a4a3a; }
.bwand.sel { border-color: var(--gold); box-shadow: 0 0 0 1px #000, 0 0 14px rgba(242, 193, 78, 0.18); cursor: default; }
.bwand .whead { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.bwand .whead img { width: 64px; height: 24px; }
.bwand .wname { font-size: 15px; color: #fff; white-space: nowrap; }
.bwand .wsum { font-size: 12px; color: var(--dim); flex: 1; min-width: 0; line-height: 1.2; }
.bwand .seltag { font-family: var(--title); font-size: 10px; color: #1a1206; background: var(--gold); padding: 2px 6px; white-space: nowrap; }
.bwand .newtag, .slot .newtag { font-family: var(--title); font-size: 9px; color: #08200a; background: var(--green); padding: 1px 4px; }
.slot .newtag { position: absolute; left: -2px; top: -6px; z-index: 2; pointer-events: none; animation: pulse 0.7s infinite alternate; }
.bwand .wstats { display: flex; flex-wrap: wrap; gap: 1px 12px; font-size: 12px; color: var(--dim); margin: 4px 0 6px; }
.bwand .wstats span { min-width: 96px; white-space: nowrap; }
.bwand .wstats b { color: var(--text); font-weight: 400; }
.bwand .wslots { display: flex; flex-direction: row; flex-wrap: wrap; gap: 3px; margin-top: 4px; }   /* row: the Wardrobe's .wslots (column) must not leak in */
/* the selected wand: [stats, slots, burst/sustained | THE BENCH] over one row of cast cards */
.bwand .wtop { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 44%, 430px); gap: 10px; align-items: start; }
.bwand .wtl { min-width: 0; }
.bwand .pvhead { margin-top: 6px; font-size: 11px; color: var(--dim); }
/* THE BENCH (public/bench.js): a world-resolution canvas scaled up pixelated, like the game */
.bench { position: relative; border: 2px solid #3a3029; background: #0b0a10; box-shadow: 0 0 0 1px #000, inset 0 0 12px rgba(0, 0, 0, 0.6); cursor: default; }
.bench canvas { display: block; width: 100%; aspect-ratio: 128 / 54; image-rendering: pixelated; }
.bench .bhud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; gap: 6px; padding: 2px 5px; font-size: 10.5px; line-height: 1.2; color: var(--dim); background: linear-gradient(rgba(8, 6, 10, 0.85), rgba(8, 6, 10, 0)); pointer-events: none; }
.bench .bhud b { color: #fff; font-weight: 400; }
.bench .bhud .br { text-align: right; }
.bench .bhud .kill { color: #ff7a5a; } .bench .bhud .nokill { color: var(--dimmer); }
.bench .bghost { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 5px 2px; font-size: 10.5px; color: #ffd46a; background: rgba(8, 6, 10, 0.78); display: flex; align-items: center; gap: 3px; pointer-events: none; white-space: nowrap; overflow: hidden; }
.bench .bghost img { width: 14px; height: 14px; }
.bench.ghost { border-color: #b08a2a; border-style: dashed; }
.bench.drag { border-color: #5fe0d0; border-style: dashed; } .bench.drag .bghost { color: #9af0e4; }
/* the honest cast preview (app.js castPreview) */
.bwand .preview { margin-top: 6px; font-size: 11px; color: var(--dim); }
.bwand .pvsum { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-bottom: 4px; font-size: 12px; }
.bwand .pvsum b { color: #fff; font-weight: 400; }
.bwand .pvsum .pvdry { color: #ff9a6a; } .bwand .pvsum .pvok { color: var(--green); }
.bwand .pvcasts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.bwand .pvcard { background: rgba(0,0,0,0.38); border: 1px solid #2c241d; padding: 2px 5px 3px; min-width: 0; line-height: 1.25; }
.bwand .pvcard.rc { border-color: #6a4622; }
.bwand .pvcard.dry { border-color: #7a2a1e; background: rgba(60, 14, 8, 0.35); }
.bwand .pvh { display: flex; gap: 6px; align-items: baseline; font-size: 11px; }
.bwand .pvh b { font-family: var(--title); color: var(--gold); font-weight: 400; font-size: 11px; }
.bwand .pvh .mn { margin-left: auto; color: #8fb4ff; }
.bwand .pvi { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; min-height: 18px; margin: 2px 0; }
.bwand .pvi img { width: 16px; height: 16px; display: block; }
.bwand .pvs { position: relative; display: inline-block; }
.bwand .pvs.copy img { opacity: 0.8; outline: 1px dashed #2aa59a; outline-offset: -1px; }
.bwand .pvs em { position: absolute; right: -3px; bottom: -4px; font-style: normal; font-size: 9px; color: #fff; background: #1c5a54; padding: 0 2px; line-height: 10px; }
.bwand .pvs .ao { position: absolute; left: -2px; bottom: -5px; font-style: normal; font-size: 9px; color: #1a1206; background: #ffd46a; padding: 0 2px; line-height: 10px; z-index: 1; }
.bwand .pvpay { display: inline-flex; align-items: center; gap: 1px; margin-left: 2px; padding: 0 2px; border: 1px solid #6a5a2a; border-left: 2px solid #f2c14e; background: rgba(242, 193, 78, 0.07); color: #f2c14e; font-size: 10px; }
.bwand .pvno { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 1px; margin-left: 3px; color: #ff7a5a; max-width: 100%; }
.bwand .pvno img { opacity: 0.35; filter: grayscale(1); }
.bwand .pvno small { margin-left: 2px; font-size: 10px; white-space: nowrap; }
.bwand .pvt { font-size: 10.5px; color: var(--dimmer); overflow-wrap: anywhere; }
.bwand .pvt b { color: var(--dim); font-weight: 400; } .bwand .pvt b.wt { color: #fff; }
.bwand .pvt.rc { color: #b08a5a; }
.bwand .pvw { font-size: 11px; color: var(--dim); } .bwand .pvw b { color: #fff; font-weight: 400; }
.bwand .empty { color: #5a5146; font-size: 14px; }
.bagrow { display: flex; gap: 8px; align-items: stretch; flex: none; }
.bag { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; align-content: flex-start; }
.slot.drop, .slot.held { border-color: var(--gold); background: rgba(242, 193, 78, 0.15); }
.slot.filled { cursor: grab; }
.slot.isnew { border-color: #3f8a32; }
.slot.flash { animation: flash 0.45s; }
@keyframes flash { 0% { background: rgba(242, 193, 78, 0.6); } 100% { background: rgba(0,0,0,0.5); } }
.trash { width: 76px; flex: none; padding: 6px; border: 2px dashed #5a2a22; color: #8a4a3a; font-size: 12px; text-align: center; display: flex; flex-direction: column; justify-content: center; font-family: var(--title); }
.trash small { font-family: var(--font); font-size: 10px; }
.trash.drop { border-color: #ff5a3a; color: #ff8a6a; background: rgba(255, 60, 30, 0.1); }
.shophead { display: flex; align-items: center; justify-content: space-between; }
.shophead h3 { margin: 6px 0; }
.shop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.shopitem { background: var(--panel2); border: 2px solid #2a231e; padding: 4px 2px; text-align: center; cursor: pointer; font-size: 11px; line-height: 1.15; position: relative; }
.shopitem:hover { border-color: var(--gold); }
.shopitem img { width: 36px; height: 36px; display: block; margin: 0 auto 2px; }
.shopitem .sn { height: 26px; overflow: hidden; line-height: 1.12; overflow-wrap: normal; }
.shopitem.wand { grid-column: span 5; display: flex; align-items: center; gap: 10px; text-align: left; padding: 5px 8px; }
.shopitem.wand img { width: 64px; height: 24px; margin: 0; }
.shopitem.wand .wsp { display: flex; gap: 2px; margin-top: 2px; } .shopitem.wand .wsp img { width: 18px; height: 18px; }
.shopitem.wand .wmeta { font-size: 11px; color: var(--dim); }
.shopitem.wand .cmp { margin-left: auto; font-family: var(--title); font-size: 10px; }
.shopitem.sold { opacity: 0.3; pointer-events: none; }
.shopitem.poor .price { color: #a04a3a; }
.price { color: var(--gold); font-family: var(--title); font-size: 11px; }
/* THE WORKSHOP (GOAL §E19): the draft, wand bodies, round 1's wand-body pick, the rivals' drafts */
.drafthead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drafthead h3 { margin: 6px 0; min-width: 0; }
#reroll { white-space: nowrap; flex: none; }   /* verdict 9 #7: "REROLL [coin] 30" stays one line; the hint beside it wraps */
.drafthead small b.behind { color: var(--green); font-weight: 400; }
.draft { flex: none; }
.dsteps { display: flex; gap: 4px; margin-bottom: 5px; }
.dstep { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; font-family: var(--title); font-size: 10px; color: var(--dimmer); background: #120f14; border: 2px solid #2a231e; padding: 2px 5px; height: 26px; white-space: nowrap; overflow: hidden; }
.dstep.cur { color: var(--gold); border-color: #6a5420; }
.dstep.done { color: var(--green); border-color: #2f5a26; font-family: var(--font); font-size: 11px; }
.dstep.done b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.dstep img { width: 18px; height: 18px; flex: none; }
.drow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.drow.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.dcard { position: relative; background: linear-gradient(#1d1720, #141016); border: 2px solid #3a3029; padding: 16px 5px 6px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5); transition: transform 0.08s; }
.dcard:hover, .dcard.padon { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 14px rgba(242, 193, 78, 0.25), inset 0 0 18px rgba(0, 0, 0, 0.5); }
.dcard img { width: 40px; height: 40px; filter: drop-shadow(0 0 6px rgba(255, 220, 160, 0.25)); }
.dcard .dkey { position: absolute; left: 3px; top: 2px; font-family: var(--title); font-size: 10px; color: var(--dimmer); }
.dcard .dtag { position: absolute; right: 2px; top: 2px; font-family: var(--title); font-size: 9px; padding: 1px 4px; white-space: nowrap; }
.dcard .dtag.wild { color: #1a1206; background: #c99cff; }
.dcard .dtag.fresh { color: #08200a; background: var(--green); animation: pulse 0.7s infinite alternate; }
.dcard.wild { border-color: #5a3f7a; background: linear-gradient(#22182c, #151019); }
.dcard.fresh { border-color: #3f8a32; }
.dcard .dn { color: #fff; font-size: 13px; line-height: 1.12; overflow-wrap: normal; word-break: normal; hyphens: manual; max-width: 100%; }
.dcard .dt { font-family: var(--title); font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.dcard .de { color: var(--dim); font-size: 11px; line-height: 1.18; }
.dcard .ds { color: var(--dimmer); font-size: 10px; line-height: 1.15; }
.dcard .dsyn { margin-top: auto; width: 100%; color: #ffd46a; background: rgba(242, 193, 78, 0.1); border-top: 1px solid #5a4a20; padding: 3px 2px 0; font-size: 10.5px; line-height: 1.15; }
.dcard .dsyn b { color: #fff3c0; font-weight: 400; }
/* an engine hint on a card the server did not nudge (no ♦): what it does in your wands, dimmer */
.dcard .dhint { margin-top: auto; width: 100%; color: #c8b8a0; background: rgba(255, 255, 255, 0.03); border-top: 1px solid #3a3029; padding: 3px 2px 0; font-size: 10.5px; line-height: 1.15; }
.dcard .dsyn b.g, .dcard .dhint b.g { color: var(--green); font-weight: 400; white-space: nowrap; }
.dcard .dsyn.bad, .dcard .dhint.bad, .tooltip .tsyn.bad { color: #ff9a6a; }
.dcard.syn { border-color: #6a5420; }
.ddone { color: var(--green); font-size: 12px; padding: 6px 8px; border: 2px solid #2f5a26; background: rgba(40, 90, 30, 0.12); }
.tooltip .tsyn { margin-top: 6px; color: #ffd46a; font-size: 12px; }
.tooltip .tsyn small { color: var(--dim); font-size: 11px; }
.rivals { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 6px; font-size: 11px; }
.rivals .rl { font-family: var(--title); font-size: 10px; color: var(--dim); text-transform: uppercase; }
.rivals .rv { display: inline-flex; align-items: center; gap: 2px; background: rgba(0, 0, 0, 0.35); border: 1px solid #3a3029; padding: 1px 4px; white-space: nowrap; }
.rivals .rv i { width: 7px; height: 7px; border: 1px solid #000; display: inline-block; margin-right: 2px; }
.rivals .rv b { color: var(--text); font-weight: 400; margin-right: 3px; }
.rivals .rv img { width: 16px; height: 16px; }
.rivals .rv em { color: var(--dimmer); font-style: normal; }
.rivals.tight .rv b { display: none; }
.rivals.tight .rv i { width: 9px; height: 9px; }
.bodyhead h3 { margin: 8px 0 4px; }
.bodies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; flex: none; }
.shopitem.wand.body { grid-column: auto; padding: 4px 6px; gap: 6px; }
.shopitem.wand.body .bbody { flex: 1; min-width: 0; }
.shopitem.wand.body .bn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bodypick { flex: none; margin-bottom: 2px; }
.bodypick h3 { margin: 6px 0 4px; color: var(--gold); }
.bprow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bpcard { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 2px solid #2a231e; padding: 5px 7px; cursor: pointer; min-width: 0; }
.bpcard:hover, .bpcard.padon { border-color: #8a7a5a; }
.bpcard.on { border-color: var(--gold); box-shadow: 0 0 12px rgba(242, 193, 78, 0.2); }
.bpcard img { width: 64px; height: 24px; flex: none; }
.bpcard .bpt { min-width: 0; font-size: 12px; line-height: 1.2; }
.bpcard .bpt b { color: #fff; font-weight: 400; font-size: 13px; }
.bpcard .bpn { color: var(--dimmer); font-size: 11px; }
.bpcard .bpb { color: var(--dim); font-size: 11px; }
.bpcard .bps { color: var(--dimmer); font-size: 10.5px; }
.bpcard .seltag { font-family: var(--title); font-size: 9px; color: #1a1206; background: var(--gold); padding: 1px 4px; }
/* folded once the draft starts: one slim chip per body */
.bodypick.slim h3 { margin: 4px 0 3px; }
.bodypick.slim .bpcard { padding: 2px 6px; gap: 6px; }
.bodypick.slim .bpcard img { width: 48px; height: 18px; }
.bodypick.slim .bpt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 780px) { .bodypick.slim .bpn { display: none; } }   /* the HELD tag must stay whole */
/* verdict 9 #7: at 1280x720 round 1's wand pick pushed wand 2's slots half under the spell bag; its blurb moves
   to the card's tooltip there (the archetype name and the stat line still say what each wand is) */
@media (max-height: 780px) { .bodypick:not(.slim) .bpb { display: none; } }
.bwand .preview.ghost { outline: 1px dashed #6a5420; outline-offset: 2px; }
.bwand .pvghost { color: #ffd46a; font-size: 12px; line-height: 1.3; margin-bottom: 3px; }
.bwand .pvghost img { width: 16px; height: 16px; vertical-align: -3px; }
.bwand .pvghost.full { color: var(--dim); }

.up, .tooltip td.up { color: var(--green); } .down, .tooltip td.down { color: #e0604a; }
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.perk { background: var(--panel2); border: 2px solid #2a231e; padding: 5px; text-align: center; cursor: pointer; font-size: 11px; position: relative; }
.perk img { width: 34px; height: 34px; display: block; margin: 0 auto 3px; }
.perk b { display: block; color: #fff; font-weight: 400; font-size: 13px; }
.perk span { color: var(--dim); font-size: 11px; line-height: 1.2; display: block; }
.perk:hover { border-color: #8a7a5a; }
.perk .stack { margin-top: 4px; font-family: var(--font); font-size: 11px; line-height: 1.15; color: var(--dimmer); }
.myperks.compact .mperk { padding-right: 3px; }
.myperks.compact .mpn { display: none; }
.perk .stack.have { color: var(--gold); }
.myperks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -2px 0 6px; font-size: 12px; }
.myperks .mpl { font-family: var(--title); font-size: 10px; color: var(--dim); text-transform: uppercase; }
.myperks .none { color: var(--dimmer); font-size: 11px; }
.mperk { display: inline-flex; align-items: center; gap: 3px; background: rgba(0, 0, 0, 0.35); border: 1px solid #3a3029; padding: 1px 5px 1px 1px; }
.mperk img { width: 20px; height: 20px; }
.mperk b { color: var(--gold); font-weight: 400; font-family: var(--title); font-size: 11px; }
.mperk small { color: var(--green); font-family: var(--title); font-size: 9px; }
.perkcell { white-space: normal; }
.sperk { position: relative; display: inline-flex; align-items: center; gap: 3px; margin: 1px 8px 1px 0; vertical-align: middle; }
.sperk img { width: 18px; height: 18px; }
.sperk small { font-size: 12px; color: var(--dim); }
.score .sperk b { position: static; background: none; border: 0; color: var(--gold); font-size: 12px; }
.stlegend { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; font-size: 13px; color: var(--dim); }
.stlegend span { display: flex; align-items: center; gap: 6px; }
.stlegend img { width: 24px; height: 24px; flex: none; }
.stlegend b { font-family: var(--title); font-weight: 400; font-size: 12px; white-space: nowrap; }
.perk.pick { border-color: var(--gold); background: rgba(242, 193, 78, 0.1); }
.perk.taken { border-color: var(--green); }
.perk.taken::after { content: '✓ TAKEN'; position: absolute; right: 3px; top: 3px; font-family: var(--title); font-size: 9px; color: #08200a; background: var(--green); padding: 1px 3px; }
/* taken: the row folds to the one perk taken, on one line (room for the rest of the mountain) */
.perks.done { grid-template-columns: minmax(0, 1fr); }
.perks.done .perk:not(.taken) { display: none; }
.perks.done .perk.taken { display: flex; align-items: center; gap: 8px; text-align: left; padding: 3px 70px 3px 6px; }
.perks.done .perk.taken img { width: 24px; height: 24px; margin: 0; flex: none; }
.perks.done .perk.taken b { display: inline; flex: none; }
.perks.done .perk.taken span { display: inline; min-width: 0; }
.perks.done .perk.taken span.stack { margin: 0; flex: none; white-space: nowrap; }
.perks.done .perk.taken span:not(.stack) { display: none; }   /* (the name and stack say it; the HUD chip's tooltip keeps the text) */
.perks.done .perk.taken b { flex: 1; min-width: 0; }
.perkconfirm { margin-top: 6px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); }
.perkconfirm button { flex: none; }
#readybtn { width: 100%; flex: none; }
#readybtn.on { border-color: var(--green); color: var(--green); }
#readybtn.nudge { animation: pulse 0.45s infinite alternate; border-color: #ff8a4a; }
#readybtn.confirm { border-color: #ff8a4a; color: #ffcf9a; font-size: 14px; }
.bpadhint { margin-top: 6px; font-size: 12px; color: var(--dim); line-height: 1.4; }
.bpadhint kbd, .keys kbd, .pk { font-family: var(--title); font-size: 11px; background: #1a1614; border: 2px solid var(--edge); padding: 0 5px; color: #fff; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; max-width: 340px; background: rgba(12, 10, 14, 0.97); border: 2px solid var(--edge2); padding: 10px 12px; font-size: 13px; box-shadow: 0 0 0 2px #000; }
.tooltip .tn { font-size: 16px; color: #fff; }
.tooltip .tt { font-size: 11px; font-family: var(--title); margin-bottom: 4px; }
.tooltip .td { color: var(--dim); margin-bottom: 6px; }
.tooltip table { border-collapse: collapse; } .tooltip td, .tooltip th { padding: 0 10px 0 0; color: var(--dim); text-align: left; font-weight: 400; }
.tooltip td + td { color: var(--text); }
.tooltip th { font-family: var(--title); font-size: 10px; color: var(--dimmer); }
.tooltip .cmpnote { margin-top: 6px; font-size: 11px; color: var(--dimmer); }
.dragghost { position: fixed; z-index: 60; pointer-events: none; width: 40px; height: 40px; image-rendering: pixelated; opacity: 0.9; }
@media (max-width: 1100px) { .bcols { grid-template-columns: minmax(0, 1fr) 340px; } .breadys span b { display: none; } }
@media (max-height: 780px) {
  .mountain { padding: 8px 12px; }
  .htitle { font-size: 18px; }
  .btimer { font-size: 24px; }
  .bleft h3, .bright h3 { margin: 6px 0 4px; font-size: 12px; }
  .bfoot { padding-top: 6px; }
  .dcard { padding: 14px 4px 4px; } .dcard img { width: 32px; height: 32px; } .dcard .dn { font-size: 12px; } .dcard .de { font-size: 10.5px; }
  .bpcard { padding: 3px 6px; } .bodypick h3 { margin: 3px 0 3px; }
  .bwand { padding: 4px 6px; margin-bottom: 4px; }
  .shopitem img { width: 30px; height: 30px; }
  .perk img { width: 28px; height: 28px; }
  .perk span { font-size: 10px; }
  button.big { font-size: 16px; padding: 9px 18px; }
  :root { --slot: 34px; }
}
@media (min-width: 1700px) and (min-height: 1000px) {
  :root { --slot: 44px; --hslot: 30px; }
  .mountain { width: min(1560px, 94vw); padding: 16px 22px; }
  .bcols { grid-template-columns: minmax(0, 1fr) 500px; gap: 22px; }
  .htitle { font-size: 28px; }
  .hgold .hgln { font-size: 14px; } .bledger { font-size: 15px; max-width: 420px; } .bledger .blh, .bledger .bll.sec { font-size: 12px; }
  .bnext { font-size: 15px; }
  .bwand .wname { font-size: 18px; }
  .bwand .wstats, .bwand .wsum { font-size: 14px; }
  .bwand .pvi img { width: 22px; height: 22px; }
  .bwand .pvcasts { gap: 6px; } .bwand .pvcard { padding: 3px 7px 4px; }
  .bwand .wstats span { min-width: 124px; }
  .bench .bhud, .bench .bghost { font-size: 13px; } .bench .bghost img { width: 18px; height: 18px; }
  .bwand .pvsum { font-size: 15px; } .bwand .pvh, .bwand .pvh b, .bwand .pvw { font-size: 14px; } .bwand .pvt { font-size: 13px; } .bwand .pvpay, .bwand .pvno small { font-size: 12px; }
  .shopitem { font-size: 13px; } .shopitem img { width: 48px; height: 48px; } .shopitem .sn { height: 32px; }
  .perk img { width: 44px; height: 44px; } .perk b { font-size: 15px; } .perk span { font-size: 12px; }
  .dcard img { width: 52px; height: 52px; } .dcard .dn { font-size: 15px; } .dcard .de { font-size: 13px; } .dcard .ds, .dcard .dt { font-size: 11px; } .dcard .dsyn { font-size: 12.5px; } .dcard .dkey, .dcard .dtag { font-size: 11px; }
  .dstep { height: 32px; font-size: 12px; } .dstep.done { font-size: 13px; } .dstep img { width: 24px; height: 24px; }
  .rivals { font-size: 13px; } .rivals .rv img { width: 20px; height: 20px; }
  .bpcard .bpt { font-size: 14px; } .bpcard .bpt b { font-size: 15px; } .bpcard .bpb { font-size: 13px; } .bpcard .bps { font-size: 12.5px; }
  .shopitem.wand.body .wmeta { font-size: 13px; }
  .tooltip { font-size: 14px; max-width: 380px; }
  .breadys { font-size: 13px; }
  .bpadhint { font-size: 14px; }
}

/* END */
.endpanel { width: min(960px, 96vw); max-height: 96vh; overflow-y: auto; }
.endpanel h2 { font-size: 28px; margin-bottom: 2px; }
.endsub { color: var(--dim); font-size: 14px; margin-bottom: 12px; }
.endpanel table { width: 100%; border-collapse: collapse; font-size: 15px; }
.endpanel td, .endpanel th { padding: 6px 8px; border-bottom: 1px solid #2a231e; text-align: left; vertical-align: middle; }
.endpanel th { color: var(--dim); font-family: var(--title); font-size: 11px; font-weight: 400; }
.endpanel .champ td:first-child::before { content: '♛ '; color: var(--gold); }
.endpanel .meRow { background: rgba(242, 193, 78, 0.06); }
.endpanel .mini img { width: 16px; height: 16px; vertical-align: middle; }
.endpanel .pipz i { width: 9px; height: 9px; border: 1px solid #000; display: inline-block; margin-right: 2px; }
.awards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 12px; }
.award { background: var(--panel2); border: 2px solid #2a231e; padding: 8px 10px; font-size: 13px; min-height: 76px; }
.award .at { font-family: var(--title); font-size: 10px; color: var(--dim); letter-spacing: 1px; }
.award .an { font-size: 17px; margin: 2px 0; }
.award .av { color: var(--gold); font-size: 13px; }
.award .wsp { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 4px; } .award .wsp img { width: 16px; height: 16px; }
.award .wimg { width: 56px; height: 21px; }
.timeline { display: flex; gap: 4px; margin: 12px 0 4px; flex-wrap: wrap; }
.timeline .tr { flex: 1; min-width: 74px; background: var(--panel2); border: 2px solid #2a231e; border-top-width: 4px; padding: 4px 6px; font-size: 11px; color: var(--dim); }
.timeline .tr b { display: block; color: #fff; font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .tr .sdt { color: #ff8a4a; font-family: var(--title); font-size: 9px; }
.endach { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--dim); align-items: center; }
.endach span.a { color: var(--gold); border: 2px solid #5a4620; padding: 2px 8px; background: #1a1408; }
.endrow { justify-content: flex-start; }
.endclock { margin-left: auto; color: var(--dimmer); font-size: 13px; }
@media (max-height: 760px) { .endpanel { padding: 14px 18px; } .award { min-height: 0; padding: 6px 8px; } .endpanel td, .endpanel th { padding: 4px 6px; } }

/* MODALS */
.modalpanel { width: min(880px, 96vw); max-height: 90vh; overflow: auto; position: relative; }
.close { position: absolute; right: 10px; top: 10px; }
.codexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.codexgrid .ce { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 2px solid #2a231e; padding: 5px; font-size: 13px; }
.codexgrid .ce img { width: 32px; height: 32px; }
.codexgrid .ce.locked { border-style: dashed; border-color: #3a2f45; background: #110d14; }
.codexgrid .ce.locked span { color: var(--dimmer); font-size: 12px; } .codexgrid .ce.locked small { color: #8a7aa0; font-size: 10.5px; line-height: 1.15; display: inline-block; }
.codexgrid .ce img.sil { image-rendering: pixelated; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; align-items: center; }
.keys kbd { font-size: 12px; padding: 1px 6px; }
.howto p { color: var(--dim); line-height: 1.45; font-size: 15px; }
.howto b { color: var(--text); font-weight: 400; }
.setgrid { display: grid; grid-template-columns: 200px 1fr 50px; gap: 8px 14px; align-items: center; font-size: 15px; }
.setgrid .sv { color: var(--gold); font-family: var(--title); font-size: 12px; text-align: right; }
.setgrid.binds { grid-template-columns: 200px 1fr; }
.setgrid input[type=range] { width: 100%; }
.setgrid button { justify-self: start; }
.bindbtn { min-width: 140px; justify-self: start; }
.bindbtn.wait { border-color: var(--gold); color: var(--gold); }
.padbox { background: var(--panel2); border: 2px solid #2a231e; padding: 8px 12px; font-size: 14px; color: var(--dim); }
.padbox b { color: var(--text); font-weight: 400; }
.ach { display: flex; gap: 10px; align-items: center; padding: 6px; background: var(--panel2); border: 2px solid #2a231e; margin-bottom: 4px; font-size: 14px; }
.ach.locked { opacity: 0.4; }
.ach b { color: var(--gold); font-weight: 400; }
.ach .prog { margin-left: auto; color: var(--dimmer); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.stats div { background: var(--panel2); border: 2px solid #2a231e; padding: 8px; text-align: center; }
.stats b { display: block; font-family: var(--title); font-size: 22px; color: var(--gold); font-weight: 400; }
.hist { width: 100%; border-collapse: collapse; font-size: 13px; } .hist td { padding: 3px 6px; border-bottom: 1px solid #2a231e; color: var(--dim); }
.escpanel { display: flex; flex-direction: column; gap: 8px; width: 320px; }

/* TUTORIAL */
.tut { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.tutring { position: fixed; border: 3px solid var(--gold); box-shadow: 0 0 0 4px rgba(0,0,0,0.6), 0 0 24px rgba(242, 193, 78, 0.6); pointer-events: none; animation: pulse 0.7s infinite alternate; display: none; }
.tutcard { position: fixed; pointer-events: auto; width: 360px; background: rgba(16, 12, 20, 0.97); border: 2px solid var(--gold); box-shadow: 0 0 0 2px #000, 0 8px 30px rgba(0,0,0,0.7); padding: 12px 14px; font-size: 15px; line-height: 1.4; }
/* the in-fight cards dock bottom-left, out of the arena's centre */
.tutcard.bottom { left: 14px; bottom: 14px; width: 400px; text-align: left; zoom: var(--ui-scale); }
.tutstep { font-family: var(--title); font-size: 10px; color: var(--gold); letter-spacing: 1px; margin-bottom: 4px; }
.tuttext b { color: var(--gold); font-weight: 400; }
.tuttext kbd { font-family: var(--title); font-size: 11px; background: #1a1614; border: 2px solid var(--edge); padding: 0 5px; color: #fff; }
.tutbtns { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.tutcard.bottom .tutbtns { justify-content: flex-start; }
.tutcard.done { border-color: var(--green); }

/* GAMEPAD FOCUS + NET */
.padfocus { position: fixed; z-index: 90; pointer-events: none; border: 3px solid #fff3c4; box-shadow: 0 0 0 2px #000, 0 0 14px rgba(242, 193, 78, 0.9); transition: left 0.06s, top 0.06s, width 0.06s, height 0.06s; }
.reconnect { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 95; background: #5a120c; border: 2px solid #ff5a3a; border-top: none; padding: 8px 18px; font-family: var(--title); font-size: 14px; color: #fff; box-shadow: 0 0 0 2px #000; display: flex; gap: 10px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--gold); padding: calc(10px * var(--ui-scale)) calc(16px * var(--ui-scale)); font-size: calc(15px * var(--ui-scale)); z-index: 80; max-width: min(92vw, calc(560px * var(--ui-scale))); text-align: center; pointer-events: none; box-shadow: 0 0 0 2px #000; }
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; font-family: var(--title); font-size: 22px; color: var(--dim); background: rgba(11, 10, 13, 0.88); z-index: 99; }
.loading.boot { background: var(--bg); }
.spin { width: 24px; height: 24px; background: var(--gold); box-shadow: 0 0 16px rgba(242, 193, 78, 0.8); animation: spin 1s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading.hidden { display: none; }

/* ACCOUNTS (accounts lane, 2026-10-04): login gate, account box, Essence, Wardrobe, Leaderboard,
   Profile, match-end rewards + trophy drop */
.loginpanel { width: min(440px, 92vw); display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.loginpanel h2 { margin: 0; }
.loginpanel .hint { margin: 0 0 4px; }
.loginpanel input { width: 100%; font-size: 18px; letter-spacing: 1px; }
.loginres { display: flex; flex-direction: column; gap: 4px; max-height: 250px; overflow-y: auto; }
.loginres .hint { margin: 4px 2px; }
.logpick { display: flex; align-items: center; gap: 10px; text-transform: none; font-family: var(--font); font-size: 16px; padding: 3px 10px; text-align: left; letter-spacing: 0; }
.logpick img { width: 22px; height: 30px; flex: none; }
.logpick span { flex: 1; }
.logpick small { color: var(--dim); font-size: 12px; }
.logpick.best { border-color: var(--gold); }
.loginpanel .row { margin-top: 4px; }
.acctbox { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--dim); text-shadow: 2px 2px 0 #000; font-size: 15px; }
.acctbox b { color: var(--text); font-weight: 400; }
.acctimg { width: 33px; height: 45px; }
.ess { display: inline-flex; align-items: center; gap: 3px; color: #d8b8ff; font-family: var(--title); white-space: nowrap; }
.gem { width: 8px; height: 8px; margin: 0 3px; display: inline-block; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, #f4e8ff, #a070ff 55%, #5a2ab0); border: 1px solid #1a0a30; box-shadow: 0 0 6px rgba(180, 140, 255, 0.7); }
.linkbtn { background: none; border: none; box-shadow: none; color: #7a6f60; padding: 0 4px; font-size: 11px; }
.plist .lsprite { width: 22px; height: 30px; margin: -6px 0; }
.modalpanel.wide { width: min(1120px, 96vw); }
.wardrobe { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
.wstage { background: radial-gradient(ellipse at 50% 85%, rgba(180, 140, 255, 0.18), rgba(0, 0, 0, 0) 60%), #0d0a11; border: 2px solid #2a231e; display: flex; justify-content: center; padding: 6px 0; }
.wprev { width: 150px; height: 190px; image-rendering: pixelated; }
.wname { margin: 8px 0; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wslots { display: flex; flex-direction: column; gap: 3px; }
.wslot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; background: var(--panel2); border: 2px solid #2a231e; padding: 3px 8px; }
.wslot span { color: var(--dim); } .wslot b { font-weight: 400; text-align: right; } .wslot i { color: var(--dimmer); }
.wtint { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--dim); cursor: pointer; }
.wardrobe .hint { font-size: 12px; line-height: 1.4; }
.wardrobe .hint b { color: var(--gold); font-weight: 400; }
.wtabs { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; padding-right: 40px; }
.wtabs button.on { border-color: var(--gold); color: var(--gold); }
.wcount { margin-left: auto; color: var(--dim); font-size: 13px; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.witem { display: grid; grid-template-columns: 45px 1fr; grid-template-rows: auto auto auto; column-gap: 8px; align-items: center; text-align: left; text-transform: none; letter-spacing: 0; font-family: var(--font); padding: 5px 7px; border-color: color-mix(in srgb, var(--rc) 45%, #2a231e); background: linear-gradient(#241d22, #18131a); }
.witem img { grid-row: 1 / 4; width: 45px; height: 51px; }
.witem b { font-weight: 400; font-size: 14px; line-height: 1.15; }
.witem small { font-size: 11px; }
.witem.sel { border-color: var(--gold); box-shadow: inset 0 0 0 2px #1a1410, 0 0 10px rgba(242, 193, 78, 0.45); }
.witem.worn { background: linear-gradient(#24301f, #161d14); }
.witem.locked img { filter: brightness(0.35) grayscale(0.6); }
.wtag { font-size: 11px; font-family: var(--title); color: var(--dim); }
.wtag.worn { color: var(--green); } .wtag.own { color: #b8e0a8; } .wtag.trophy { color: var(--gold); } .wtag.poor { opacity: 0.55; }
.wdetail { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; background: var(--panel2); border: 2px solid #2a231e; padding: 8px 12px; min-height: 60px; }
.wdetail small { color: var(--dim); }
.wdesc { color: var(--dim); font-size: 13px; margin-top: 2px; }
.wbtns { display: flex; gap: 8px; align-items: center; flex: none; }
.wwin { color: var(--dim); font-size: 13px; }
.wwin b { color: var(--gold); font-weight: 400; }
.profhead { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.profhead h2 { margin: 0 0 2px; }
.profimg { width: 65px; height: 80px; }
.ach .prog .ess { margin-left: 6px; }
.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb td, .lb th { padding: 5px 8px; border-bottom: 1px solid #2a231e; text-align: left; vertical-align: middle; }
.lb th { color: var(--dim); font-family: var(--title); font-size: 11px; font-weight: 400; }
.lb .lbn { color: var(--gold); width: 28px; }
.lb .lbw { display: flex; align-items: center; gap: 8px; } .lb .lbw img { width: 22px; height: 30px; }
.lb b { color: var(--gold); font-weight: 400; }
.lb .meRow { background: rgba(242, 193, 78, 0.08); }
.lb .mini img { width: 16px; height: 16px; vertical-align: middle; }
.lbrecent { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--dim); }
.lbrecent b { color: var(--text); font-weight: 400; }
.endrewards { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 10px; }
.erow { display: flex; align-items: center; gap: 10px; background: #1a1220; border: 2px solid #4a3470; padding: 6px 10px; font-size: 13px; flex-wrap: wrap; }
.et { font-family: var(--title); font-size: 10px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; }
.eg { font-family: var(--title); font-size: 20px; color: #d8b8ff; font-weight: 400; }
.eparts { color: var(--dim); flex: 1; } .eparts .a { color: var(--gold); }
.ebal { color: var(--dim); }
.etrophy { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, #2a2008, #16120c); border: 2px solid var(--gold); padding: 6px 12px; box-shadow: 0 0 14px rgba(242, 193, 78, 0.25); }
.etrophy img { width: 60px; height: 68px; }
.etrophy b { display: block; font-size: 18px; color: var(--gold); font-weight: 400; }
.etrophy small { color: var(--dim); font-size: 13px; }
@media (max-height: 760px) { .wgrid { max-height: 44vh; } .wprev { width: 126px; height: 160px; } }
/* the account screens keep roughly their 1280x720 share of a bigger screen */
.loginpanel, .acctbox { zoom: min(var(--ui-scale), 1.3); }
.modalpanel.wide { zoom: min(var(--ui-scale), 1.25); max-height: calc(90vh / min(var(--ui-scale), 1.25)); }

/* WAVE 9 (verdict 5 #6, #7, #1) */
/* modals are solid: the title menu no longer ghosts through the Wardrobe, Leaderboard, Profile, Codex */
#modal { background: rgba(4, 3, 6, 0.82); }
#modal .modalpanel, #esc .panel { background: #120f14; }
.lbtabs { margin: 4px 0 10px; padding-right: 0; }
.lbhm { margin: 10px 0 0; font-size: 13px; } .lbhm b { color: var(--gold); font-weight: 400; }
/* the in-fight tutorial docks at about a quarter of a big screen (it was ~600x150 at 1920) */
@media (min-width: 1600px) { .tutcard.bottom { zoom: min(var(--ui-scale), 1.2); width: calc(25vw / min(var(--ui-scale), 1.2)); } }
/* the match-end screen grows with the screen (1.4x at 1080p) instead of staying at its 720p size */
.endpanel { --endz: min(var(--ui-scale), 1.4); zoom: var(--endz); width: min(960px, calc(96vw / var(--endz))); max-height: calc(96vh / var(--endz)); }
/* the escape rune: walled in, the countdown above the wizard, then "press E" once it may be fired */
#hud .escchip { zoom: var(--ui-scale); }
.escchip { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center;
  background: rgba(6, 18, 24, 0.86); border: 2px solid #3fb8d0; box-shadow: 0 0 0 2px #000, 0 0 18px rgba(90, 220, 255, 0.45); padding: 6px 14px 6px 8px; font-size: 15px; text-shadow: 1px 1px 0 #000; white-space: nowrap; }
.escchip .rune { grid-row: 1 / 3; width: 18px; height: 18px; margin: 4px; transform: rotate(45deg); border: 2px solid #b8f6ff; background: radial-gradient(#e8fdff, #3fb8d0 60%, #0c4a58); box-shadow: 0 0 12px rgba(120, 235, 255, 0.9); animation: runepulse 0.6s infinite alternate; }
.escchip .et1 b { color: #8cecff; font-weight: 400; font-family: var(--title); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.escchip .et2 { font-size: 13px; color: #9ab8c0; }
.escchip.ready { border-color: #b8f6ff; box-shadow: 0 0 0 2px #000, 0 0 26px rgba(150, 240, 255, 0.8); }
.escchip.ready .et2 { color: #fff; }
.escchip kbd { font-family: var(--title); font-size: 11px; background: #0c2a32; border: 2px solid #8cecff; padding: 0 5px; color: #fff; }
@keyframes runepulse { from { box-shadow: 0 0 6px rgba(120, 235, 255, 0.5); } to { box-shadow: 0 0 16px rgba(170, 245, 255, 1); } }
/* the death card / spectator wand view (app.js updateWandCard): bottom-left, under your own wands —
   the killer's wand that got you (slots in order, stats, cast preview, recipes), or the watched /
   hovered wizard's wands. Zoomed like the rest of the HUD (its 1280x720 share at every size). */
#hud .wandcard { zoom: var(--ui-scale); }
.wandcard { position: absolute; left: 12px; bottom: 12px; width: 300px; max-height: calc(100vh / var(--ui-scale) - 220px); overflow: hidden;
  background: rgba(12, 9, 14, 0.9); border: 2px solid var(--edge2); box-shadow: 0 0 0 2px #000, 0 0 22px rgba(170, 90, 255, 0.25); padding: 8px 10px 6px; font-size: 13px; text-shadow: 1px 1px 0 #000; animation: wcin 0.25s ease-out; }
@keyframes wcin { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.wandcard .wc-head { font-family: var(--title); font-size: 16px; display: flex; align-items: baseline; gap: 8px; }
.wandcard .wc-k { font-size: 11px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; }
.wandcard .wc-head b { font-weight: 400; }
.wandcard .wc-sub { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 5px; margin-top: 2px; flex-wrap: wrap; }
.wandcard .wc-sub img { width: 18px; height: 18px; }
.wandcard .wc-sub small { color: var(--dim); }
.wandcard .wc-wand { display: flex; align-items: center; gap: 6px; margin-top: 7px; padding-top: 6px; border-top: 1px solid #2a231e; }
.wandcard .wc-wand img.wand { width: 52px; height: 20px; }
.wandcard .wc-wname { font-weight: 400; color: var(--gold); flex: 1; min-width: 0; line-height: 1.1; }
.wandcard .wc-tag { font-family: var(--title); font-size: 9px; color: #ffb0a0; background: #4a1410; border: 1px solid #8a3020; padding: 0 4px; text-transform: uppercase; white-space: nowrap; }
.wandcard .wc-slots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 5px; }
.wandcard .wc-slots .slot { width: 26px; height: 26px; border-width: 1px; }
.wandcard .wc-slots .slot img { width: 24px; height: 24px; }
.wandcard .wc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; margin-top: 6px; font-size: 12px; color: var(--dim); }
.wandcard .wc-stats span { display: flex; justify-content: space-between; gap: 4px; }
.wandcard .wc-stats b { color: var(--text); font-weight: 400; }
.wandcard .wc-always { font-size: 12px; color: var(--dim); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.wandcard .wc-always img { width: 14px; height: 14px; }
.wandcard .wc-prev { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.wandcard .wc-pl { font-family: var(--title); font-size: 10px; color: var(--dim); text-transform: uppercase; }
.wandcard .wc-prev .cast { display: flex; align-items: center; gap: 1px; background: rgba(0,0,0,0.45); padding: 1px 3px; border: 1px solid #2a231e; }
.wandcard .wc-prev .cast.rc { border-color: #5a3c20; }
.wandcard .wc-prev .cast img { width: 15px; height: 15px; }
.wandcard .wc-prev .cast small { font-size: 10px; color: var(--dimmer); margin-left: 2px; }
.wandcard .wc-rec { margin-top: 6px; padding: 3px 6px; background: rgba(242, 193, 78, 0.1); border: 1px solid rgba(242, 193, 78, 0.55); color: var(--gold); font-size: 12px; line-height: 1.25; }
.wandcard .wc-rec b { font-weight: 400; font-family: var(--title); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.wandcard .wc-rec small { display: block; color: #d8c8a8; font-size: 11px; }
.wandcard .wc-mini { display: flex; align-items: center; gap: 3px; margin-top: 4px; opacity: 0.8; }
.wandcard .wc-mini.on { opacity: 1; }
.wandcard .wc-mini .num { width: 12px; font-family: var(--title); font-size: 10px; color: var(--dim); text-align: center; }
.wandcard .wc-mini img.wand { width: 38px; height: 15px; }
.wandcard .wc-ms { display: flex; flex-wrap: wrap; gap: 1px; }
.wandcard .wc-ms img { width: 16px; height: 16px; display: block; }
.wandcard .wc-foot { margin-top: 6px; font-size: 11px; color: var(--dimmer); }
.wandcard .wc-foot:empty { display: none; }
/* the "New wand recipe" toast */
.toast .rtoast b { color: var(--gold); }
.toast .rtoastd { display: block; font-size: 0.85em; color: var(--dim); margin-top: 2px; }
/* the codex: Spells / Wand recipes tabs, one card per recipe (found = gold) */
.ctabs { margin: 4px 0 6px; }
.recipegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.rcard { background: var(--panel2); border: 2px solid #2a231e; padding: 8px 10px; font-size: 13px; opacity: 0.78; }
.rcard.found { border-color: rgba(242, 193, 78, 0.7); opacity: 1; }
.rcard .rn { font-family: var(--title); font-size: 14px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.rcard.found .rn { color: var(--gold); }
.rcard .rr { margin-left: auto; font-family: var(--font); font-size: 12px; color: var(--text); }
.rcard .rd { margin-top: 3px; }
.rcard .rex { display: flex; align-items: center; gap: 2px; margin-top: 5px; flex-wrap: wrap; }
.rcard .rex .slot { width: 28px; height: 28px; border-width: 1px; }
.rcard .rex .slot img { width: 26px; height: 26px; }
.rcard .rex small { margin-left: 6px; color: var(--dim); font-size: 11px; }
.rcard .rh { margin-top: 4px; font-size: 12px; color: var(--dim); }
/* perk synergies + perk discovery (GOAL §E20, public/synergies.js): the codex Synergies tab (found =
   cyan ♦, not found = silhouettes + a riddle), undiscovered perks as silhouettes, the ♦ on a perk card
   that completes a synergy with a perk you hold, the "New discovery" badge, the synergy toast */
.dia { color: #7fd6ff; }
.scard.found { border-color: rgba(127, 214, 255, 0.7); }
.scard.found .rn { color: #7fd6ff; }
.scard.locked { border-style: dashed; border-color: #2f3a45; background: #0d1114; }
.scard.locked .rh { font-style: italic; color: #9fb4c4; }
.scard.locked .rd { color: var(--dimmer); font-size: 11px; }
.scard .sparts { gap: 4px; }
.schip { display: inline-flex; align-items: center; gap: 4px; background: #15110e; border: 1px solid #2a231e; padding: 2px 6px 2px 2px; font-size: 12px; }
.schip img { width: 24px; height: 24px; image-rendering: pixelated; }
.schip b { font-weight: 400; color: var(--text); }
.schip.world { padding: 4px 8px; color: #9fd0a0; }
.schip.world i { font-style: normal; }
.schip.sil { padding: 2px; background: #0b0d10; border-color: #263038; }
.schip.sil img, img.psil { filter: grayscale(1) brightness(0.42) contrast(1.6); }
.schip.sil.world { width: 28px; height: 28px; justify-content: center; color: #4a5a68; }
.splus { font-style: normal; color: var(--dimmer); font-size: 12px; }
.codexgrid .ce small.dis { color: #7fd6ff; font-size: 10px; }
.perk.syn { border-color: rgba(127, 214, 255, 0.75); box-shadow: 0 0 8px rgba(127, 214, 255, 0.25) inset; }
.perk .psyn { margin-top: 3px; color: #7fd6ff !important; font-size: 11px; line-height: 1.15; }
.perk .psyn b { display: inline; font-size: 11px; color: #bfeaff; }
.perk .pnew { display: block; color: #c9a0ff !important; font-size: 10px; letter-spacing: 0.5px; margin: -1px 0 2px; }
.toast .stoast { color: #7fd6ff; }
.toast .stoast b { color: #bfeaff; }
#feed .sfeed { color: #7fd6ff; }

/* WAVE 10 (verdict 6 #2, #10): "Next up" goals at match end and on the title; the full-bag draft note */
.drafthead small b.bagfull { color: var(--gold); font-weight: 400; }
.nextup { background: #15111a; border: 2px solid #4a3470; padding: 6px 10px 8px; margin: 0 0 10px; }
.nextup .nuh { font-family: var(--title); font-size: 11px; letter-spacing: 2px; color: #d8b8ff; text-transform: uppercase; margin-bottom: 4px; }
.nugrid { display: grid; gap: 10px; grid-template-columns: repeat(var(--nucols, 4), minmax(0, 1fr)); }
.nugrid.n3 { --nucols: 3; } .nugrid.n2 { --nucols: 2; } .nugrid.n1 { --nucols: 1; }
.nucell { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.nucell .nut { font-family: var(--title); font-size: 10px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; }
.nucell .nut small { text-transform: none; letter-spacing: 0; font-family: var(--font); color: var(--dimmer); font-size: 11px; }
.nurow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nun { color: var(--text); flex: 1; min-width: 0; }
.nuv { color: var(--dim); font-size: 11px; white-space: nowrap; }
.nud { color: var(--dimmer); font-size: 11px; line-height: 1.25; }
.nud b { color: var(--dim); font-weight: 400; }
.nubar { flex: 1; height: 6px; min-width: 40px; background: #0b090d; border: 1px solid #3a2e48; display: block; }
.nubar i { display: block; height: 100%; background: linear-gradient(90deg, #a070ff, #d8b8ff); }
.nubig { color: var(--dim); } .nubig b { color: var(--gold); font-family: var(--title); font-weight: 400; font-size: 15px; }
.nusyn { border-left: 2px solid #3a6f8a; padding-left: 6px; } .nusyn .nun { color: #7fd6ff; }   /* verdict 7 #2: the one synergy riddle to chase */
.nucos .nurow { align-items: flex-start; } .nucos .nurow .nurow { align-items: center; }
.nucos .nurow > div { flex: 1; min-width: 0; }
.nuimg { width: 34px; height: auto; flex: none; }
/* the end screen: a compact band (a counted achievement's bar says it all) */
.nu-end .nuach .nudc { display: none; }
/* the match-end buttons stay on screen while the panel scrolls (the strip made it taller than 720p) */
.endpanel .endrow { position: sticky; bottom: -22px; margin: 10px -22px -22px; padding: 10px 22px 14px; background: #121014; border-top: 1px solid #2a231e; z-index: 2; }
@media (max-height: 760px) { .endpanel .endrow { bottom: -14px; margin: 8px -18px -14px; padding: 8px 18px 10px; } }
/* the title: a column beside the menu (below it on a narrow screen) */
.titlenext { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: 300px; zoom: min(var(--ui-scale), 1.3); }
.titlenext .nextup { margin: 0; background: rgba(18, 14, 22, 0.92); box-shadow: 0 0 0 2px #000; }
.titlenext .nugrid { --nucols: 1; gap: 8px; }
@media (max-width: 1099px) { .titlenext { position: static; transform: none; width: min(620px, 94vw); } .titlenext .nugrid { --nucols: 2; } }
/* verdict 7 #9: a long wand's slots wrap in their own box (app.js fitWandsHUD caps .wands short of the round
   header), so a 26-slot wand is two lines under its first slot, never a row under "ROUND 1 · FIRST TO 3" */
.wandrow .hslots { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; min-width: 0; }
.wandrow img.wand { flex: none; }
.wandrow .num { flex: none; }

/* ============================================================== THE AUTOMATON (docs/automaton-spec.md §6.3; public/autoui.js)
   Its colour is proto.js AUTO_COLOR (#c84632): rust-red rims and chips; the boss bar sits top centre under the round line. */
:root { --auto: #c84632; --auto-hi: #ff8a5a; --auto-lo: #5a1810; }
/* the boss bar: NAME — forged by the Mountain / HP / chips */
#hud .abar { zoom: var(--ui-scale); }
.abar { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); width: 440px; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.abar .abn { display: flex; align-items: baseline; gap: 8px; font-family: var(--title); text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.abar .abname { font-size: 17px; color: #ffd8c8; letter-spacing: 2px; font-weight: 400; }
.abar .abby { font-family: var(--font); font-size: 12px; color: #c8a898; }
.abar .abhp { position: relative; width: 100%; height: 14px; background: rgba(8, 4, 6, 0.85); border: 2px solid #3a1410; box-shadow: 0 0 0 1px #000, 0 0 12px rgba(200, 70, 50, 0.35); }
.abar .abhp i, .abar .abhp em { position: absolute; left: 0; top: 0; bottom: 0; }
.abar .abhp em { background: #f0e0c0; opacity: 0.55; z-index: 0; }
.abar .abhp i { background: linear-gradient(#ff6a48, #a8261a 60%, #6a1208); z-index: 1; box-shadow: inset 0 1px 0 rgba(255, 220, 190, 0.5); }
.abar .abhp .abff { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #ffe7a8; box-shadow: 0 0 0 1px #000; z-index: 2; text-decoration: none; }
.abar .abhp .abt { position: absolute; inset: 0; z-index: 3; text-align: center; font-family: var(--title); font-size: 10px; line-height: 11px; color: #fff; text-shadow: 1px 1px 0 #000; }
.abar.hit .abhp { border-color: #fff4e0; }
.abar.rage .abname { color: #ff8a5a; animation: pulse 0.35s infinite alternate; }
.abar.rage .abhp { border-color: #8a1a10; box-shadow: 0 0 0 1px #000, 0 0 18px rgba(255, 60, 30, 0.7); }
.abar.doom .abhp i { background: linear-gradient(#ff3a20, #6a0a04); }
.abar .abchips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; min-height: 0; }
.abc { font-family: var(--title); font-size: 10px; line-height: 1; padding: 3px 6px; background: rgba(8, 6, 10, 0.85); border: 2px solid #5a4a3a; color: #e8dcc8; text-shadow: 1px 1px 0 #000; white-space: nowrap; }
.abc.rage, .abc.doom { color: #ffb08a; border-color: #c84632; animation: pulse 0.4s infinite alternate; }
.abc.doom { color: #ff6040; background: #2a0604; }
.abc.ff { color: #9ff0ff; border-color: #3aa6c4; } .abc.ffon { color: #ffd27a; border-color: #b8862a; }
.abc.next { color: #fff3c4; border-color: #f2c14e; box-shadow: 0 0 8px rgba(242, 193, 78, 0.5); }
.abc.hunt { color: #ff9a7a; border-color: #c84632; box-shadow: 0 0 8px rgba(200, 70, 50, 0.6); }
.abc.enter, .abc.burrow, .abc.shield { color: #d8c8b8; }
/* lane F (battles): phase ticks on the bar, the punish windows (staggered / open), the phase chip */
.abar .abhp .abph { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #1a0a08; box-shadow: 0 0 0 1px rgba(255, 200, 160, 0.55); z-index: 2; text-decoration: none; }
.abar .abhp .abph.past { background: #ffb08a; box-shadow: 0 0 6px rgba(255, 120, 60, 0.9); }
.abc.stag { color: #fff6c8; border-color: #ffe27a; background: #3a2a06; box-shadow: 0 0 10px rgba(255, 226, 122, 0.8); animation: pulse 0.25s infinite alternate; }
.abc.open { color: #ffd27a; border-color: #b8862a; }
.abc.phase { color: #ffc8b0; border-color: #a8261a; }
.abar.stag .abhp { border-color: #ffe27a; box-shadow: 0 0 0 1px #000, 0 0 16px rgba(255, 226, 122, 0.8); }
.abar.open .abhp { border-color: #b8862a; }
.roundinfo .aboss { color: #ff9a7a; font-size: 13px; letter-spacing: 1px; }
/* the entrance title card (D54): centred 2.5 s, fades out */
.atitle { position: fixed; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.atitle .atpan { zoom: var(--ui-scale); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 28px 12px; background: linear-gradient(rgba(20, 8, 8, 0.92), rgba(10, 6, 8, 0.92)); border: 2px solid var(--auto); box-shadow: 0 0 0 2px #000, 0 0 50px rgba(200, 70, 50, 0.45); animation: atin 0.35s ease-out; max-width: 560px; }
.atitle.out .atpan { animation: atout 0.4s ease-in forwards; }
@keyframes atin { from { transform: scale(1.25); opacity: 0; filter: brightness(3); } to { transform: none; opacity: 1; filter: none; } }
@keyframes atout { to { transform: scale(0.92); opacity: 0; } }
.atitle .atk { font-family: var(--title); font-size: 11px; letter-spacing: 4px; color: #c8a898; }
.atitle .aport { width: 224px; height: 150px; image-rendering: pixelated; }
.atitle .atname { font-family: var(--title); font-size: 38px; letter-spacing: 4px; color: #ffe0d0; text-shadow: 0 0 18px rgba(255, 90, 50, 0.7), 3px 3px 0 #000; line-height: 1; }
.atitle .atby { font-size: 14px; color: var(--gold); text-shadow: 2px 2px 0 #000; margin-bottom: 4px; }
.atitle .atboss { margin-top: 4px; font-size: 13px; color: var(--text); }
.atitle .atempty { font-size: 13px; color: #c8a898; font-style: italic; max-width: 360px; text-align: center; }
/* lane F: the entrance card is a lower-third nameplate - it hid the player (normal rounds) and the drop (boss rounds) */
.atitle.low { align-items: flex-end; padding-bottom: 3vh; }
/* verdict 10 #4: a spectator's hazard / vote panel or the "Watching <name>" label owns the lower third: the title card
   goes under the boss bar instead (a dead wizard watching when the Automaton arrives, the builder's test fight) */
body:has(#aspec:not(.hidden)) .atitle.low, body:has(#hud:not(.hidden) #spectate:not(.hidden)) .atitle.low { align-items: flex-start; padding-bottom: 0; padding-top: 19vh; }
/* lane P: a compact nameplate low on the screen (it still covered a wizard standing on the cavern floor): the name, the
   designer, its skill icons and who must slay it; the kit's small print lives on the boss bar's NEXT chip and the end screen */
.atitle.low .atport, .atitle.low .awand, .atitle.low .awname, .atitle.low .akit { display: none; }
.atitle.low .atpan { padding: 6px 22px 6px; gap: 2px; background: linear-gradient(rgba(20, 8, 8, 0.9), rgba(10, 6, 8, 0.9)); }
.atitle.low .atname { font-size: 30px; text-shadow: 0 0 14px rgba(255, 90, 50, 0.8), 2px 2px 0 #000, -1px -1px 0 #000; }
.atitle.low .atby { margin-bottom: 0; }
/* its loadout drawn as a wand: n slots (spell + up to 2 stacked modifiers), behaviours + perks under it */
.awand { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.aslot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 3px 2px; background: rgba(0, 0, 0, 0.5); border: 2px solid #3a3029; min-width: 42px; }
.aslot.on { border-color: #6a4a38; }
.aslot .asn { position: absolute; left: 2px; top: 0; font-family: var(--title); font-size: 9px; color: var(--dimmer); }
.aslot .asp { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.aslot .asp img { width: 32px; height: 32px; }
.aslot .asp i { font-size: 9px; color: #5a5146; font-style: normal; }
.aslot .astks { display: flex; gap: 2px; }
.astk { width: 18px; height: 18px; background: #120f14; border: 1px solid #2a231e; display: flex; align-items: center; justify-content: center; }
.astk img { width: 16px; height: 16px; }
.awand.placing .aslot:not(.tgt) { opacity: 0.45; }
.aslot.tgt, .astk.tgt { border-color: var(--gold); box-shadow: 0 0 8px rgba(242, 193, 78, 0.6); cursor: pointer; pointer-events: auto; animation: pulse 0.6s infinite alternate; }
.aslot.tgt:hover, .astk.tgt:hover, .aslot.tgt.padon, .astk.tgt.padon { background: rgba(242, 193, 78, 0.18); animation: none; }
.aslot .akn { position: absolute; right: 2px; top: 0; font-style: normal; font-family: var(--title); font-size: 9px; color: var(--gold); }
.abehs { display: flex; gap: 4px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.abeh { position: relative; width: 26px; height: 26px; }
.abeh img { width: 26px; height: 26px; }
.abeh b { position: absolute; right: -3px; bottom: -4px; font-family: var(--title); font-size: 9px; color: #fff; background: #8a2414; border: 1px solid #000; padding: 0 2px; line-height: 10px; }
/* the card / perk / steal pick: over the HUD or the Holy Mountain */
.apick { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; background: rgba(5, 3, 6, 0.55); pointer-events: auto; }
.apick .apanel { zoom: var(--ui-scale); width: min(620px, 92vw); max-height: 92vh; overflow: auto; background: rgb(18, 15, 20); border: 2px solid var(--auto); box-shadow: 0 0 0 2px #000, 0 0 40px rgba(200, 70, 50, 0.35); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.apick .ahead { display: flex; align-items: center; gap: 10px; }
.apick .ahead b { font-family: var(--title); font-size: 17px; color: #ffd8c8; letter-spacing: 1px; font-weight: 400; display: block; }
.apick .ahead small { color: var(--dim); font-size: 12px; }
.apick .ahead > div { flex: 1; min-width: 0; }
.apick .aport.mini { width: 56px; height: 40px; image-rendering: pixelated; display: block; }
.apick .atime { font-family: var(--title); font-size: 26px; color: #fff; min-width: 36px; text-align: right; }
.apick .atime.low { color: #ff6a40; animation: pulse 0.3s infinite alternate; }
.apick .atime.small { font-size: 14px; min-width: 0; margin-left: 6px; }
.apick .atbar { height: 4px; background: #120f14; border: 1px solid #2a231e; }
.apick .atbar i { display: block; height: 100%; background: linear-gradient(90deg, #a8261a, #ff8a5a); transition: width 0.2s linear; }
.acards { display: flex; gap: 8px; }
.acard { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 7px; background: linear-gradient(#1e1814, #120e10); border: 2px solid #4a3f36; cursor: pointer; text-align: center; }
.acard:hover, .acard.padon { border-color: var(--gold); background: linear-gradient(#2a2018, #16100e); }
.acard.sel { border-color: var(--gold); box-shadow: 0 0 12px rgba(242, 193, 78, 0.6); }
.acard.k-beh { border-color: #7a2a1e; } .acard.k-mod { border-color: #2f4a7a; }
.acard img { width: 40px; height: 40px; }
.acard .akey { position: absolute; left: 4px; top: 2px; font-family: var(--title); font-size: 10px; color: var(--dimmer); }
.acard .akind { font-family: var(--title); font-size: 9px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; }
.acard b { font-family: var(--title); font-size: 13px; font-weight: 400; color: var(--text); }
.acard .adesc { font-size: 11px; color: var(--dim); line-height: 1.25; }
.acard .ahow { font-size: 11px; color: var(--gold); line-height: 1.2; margin-top: auto; }
.apick .aloh { font-family: var(--title); font-size: 11px; color: var(--dim); display: flex; gap: 8px; align-items: baseline; }
.apick .aloh b { color: var(--gold); font-weight: 400; }
.apick .ahint { margin-left: auto; font-family: var(--font); font-size: 11px; color: var(--dimmer); }
.apick .afoot { display: flex; gap: 8px; align-items: center; }
.apick .aplace { color: var(--gold); font-size: 12px; }
.apick .aperkh { font-family: var(--title); font-size: 13px; color: #ffd8c8; margin-top: 4px; }
.apick .aperkh.steal { color: var(--gold); }
.aperks { display: flex; gap: 8px; }
.aperk { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; background: #16110f; border: 2px solid #4a3f36; cursor: pointer; text-align: center; }
.aperk:hover, .aperk.padon { border-color: var(--gold); }
.aperk img { width: 32px; height: 32px; }
.aperk b { font-family: var(--title); font-size: 12px; font-weight: 400; }
.aperk span { font-size: 11px; color: var(--dim); line-height: 1.2; }
.aperk.steal { border-color: #6a5420; }
.achoice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; padding-top: 6px; border-top: 1px solid #2a231e; }
.achoice div { width: 100%; text-align: center; color: var(--dim); font-size: 13px; }
/* D30: the early Holy Mountain toggle + header line; Ready waits for the real Holy Mountain */
.aswap { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 14; zoom: var(--ui-scale); }
.aswap kbd { font-family: var(--title); font-size: 10px; background: #1a1614; border: 1px solid var(--edge); padding: 0 3px; margin-left: 4px; }
body.earlyhm #readybtn, body.earlyhm #btimer { display: none; }
/* verdict 10 #4: in the early Holy Mountain the toggle sits where Ready will be (app.js renderBuild moves it there) */
#build .bfoot .aswap { position: static; transform: none; zoom: 1; width: 100%; font-size: 15px; padding: 9px 14px; }
.bauto { flex: none; margin-top: 6px; padding: 3px 10px; font-size: 13px; color: var(--dim); background: rgba(90, 20, 14, 0.35); border: 1px solid #5a2014; }
.bauto .abl.auto, .bauto .abl.boss { color: #ffc0a8; }
.bauto .abl.early { color: var(--gold); }
/* the spectator panel (D6/D9/D35): hazards, the vote, bets */
#hud .aspec { zoom: var(--ui-scale); }
.aspec { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); display: flex; gap: 8px; align-items: stretch; pointer-events: auto; }
.aspec .asp { background: rgba(10, 8, 14, 0.88); border: 2px solid #4a3a5a; box-shadow: 0 0 0 1px #000; padding: 5px 8px; display: flex; flex-direction: column; gap: 4px; }
.aspec .asph { font-family: var(--title); font-size: 11px; color: #d8b8ff; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.aspec .asph small { font-family: var(--font); color: var(--dim); font-size: 11px; }
.aspec .ahzs { display: flex; gap: 4px; }
.aspec .ahz { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 5px; font-size: 9px; min-width: 50px; }
.aspec .ahz img { width: 26px; height: 26px; }
.aspec .ahz.armed { border-color: #ff8a5a; box-shadow: 0 0 10px rgba(255, 120, 60, 0.7); color: #fff; }
.aspec .apips { display: flex; gap: 3px; align-items: center; }
.aspec .apips i { width: 10px; height: 10px; border: 1px solid #000; background: #2a2236; display: inline-block; }
.aspec .apips i.on { background: #b88aff; box-shadow: 0 0 6px rgba(184, 138, 255, 0.7); }
.aspec .aring { width: 14px; height: 14px; border-radius: 50%; display: inline-block; background: conic-gradient(#d8b8ff calc(var(--f, 0) * 360deg), #2a2236 0); border: 1px solid #000; margin-left: 4px; }
.aspec .ahzhint { font-size: 11px; color: #ffb08a; }
.aspec .avopt { position: relative; text-align: left; font-size: 12px; padding: 5px 8px; min-width: 150px; overflow: hidden; text-transform: none; }
.aspec .avopt i { position: absolute; left: 0; bottom: 0; height: 3px; background: #b88aff; }
.aspec .avopt em { float: right; font-style: normal; color: var(--dim); margin-left: 8px; }
.aspec .avopt.mine { border-color: #b88aff; color: #fff; box-shadow: 0 0 8px rgba(184, 138, 255, 0.6); }
.aspec .abets { display: flex; gap: 4px; }
.aspec .abets button { white-space: nowrap; }
.aspec .abets .on { border-color: var(--gold); color: #fff; }
.aspec .abetamt { display: flex; gap: 6px; align-items: center; }
.aspec .abetamt input { width: 110px; }
.aspec .abetamt b { font-family: var(--title); color: var(--gold); font-size: 12px; font-weight: 400; min-width: 26px; }
.aspec .abetd { font-size: 12px; color: var(--text); display: block; max-width: 180px; line-height: 1.35; }
.aspec .abetd .coin { vertical-align: -1px; margin-right: 3px; }
/* play test: the "Spectating X" label sat behind the spectator panel; on a small screen the panel and the spectator's wand
   card collide, and the boss bar ran into the HP bars; the title card was taller than a phone's screen */
body.aspecon #hud .spectate { display: none; }   /* the wand card already says WATCHING X (lifted above the panel it sat on the fight) */
@media (max-width: 1000px) { body.aspecon #hud .wandcard { display: none; } .abar { width: 300px; } .abar .abby { display: none; } }
@media (max-height: 560px) { .atitle .atpan { zoom: calc(var(--ui-scale) * 0.62); } }
/* the end screen: its portrait, outcome and loadout */
.aend { display: flex; gap: 14px; align-items: center; margin: 6px 0 10px; padding: 8px 12px; background: rgba(40, 12, 10, 0.45); border: 2px solid #5a2014; }
.aend .aendport canvas { width: 150px; height: 110px; image-rendering: pixelated; display: block; }
.aend .aendt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.aend .aendn { font-family: var(--title); font-size: 22px; letter-spacing: 2px; color: #ffd8c8; }
.aend .aendby { font-size: 13px; color: var(--gold); }
.aend .aendo { font-size: 14px; color: var(--text); }
.aend .aendo .aunb { color: #ff6a40; font-family: var(--title); font-weight: 400; letter-spacing: 1px; }
.aend .aends { font-size: 12px; color: var(--dim); }
.aend .awand { justify-content: flex-start; }
.aend .abehs { justify-content: flex-start; }

/* ============================================================== THE AUTOMATON, stage 3 (lane L4): the Automatons screen
   (Workshop · My Automatons · Library · Shelf, public/library.js), the match-end commission + star row, the preview-room
   panel, the profile's shelf strip, the grade beside a player's design's name. docs/automaton-stage3-spec.md §4.4 §5.4 §6 */
#title .automenu button { border-color: #8a3a28; }
#title .automenu button:hover, #title .automenu button.padon { border-color: var(--auto-hi); color: #ffd8c8; }
#autos { display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, rgba(60, 16, 10, 0.55), rgba(5, 3, 6, 0.92)); }
.autospanel { --az: min(var(--ui-scale), 1.5); zoom: var(--az); width: min(1180px, calc(96vw / var(--az))); height: min(680px, calc(94vh / var(--az))); display: flex; flex-direction: column; padding: 16px 18px 10px; border-color: #5a2014; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #1f1a16, 0 0 50px rgba(200, 70, 50, 0.25); background: rgb(18, 15, 20); }
.autoshead { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid #2a231e; }
.autoshead h2 { margin: 0; color: #ffd8c8; text-shadow: 0 0 14px rgba(255, 90, 50, 0.45), 2px 2px 0 #000; }
.autostabs { display: flex; gap: 6px; flex: 1; justify-content: center; }
.autostabs .libtab.on { border-color: var(--auto-hi); color: #ffe0d0; background: linear-gradient(#5a2a1c, #3a1a12); }
.autosbody { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 4px 10px; }
.autosbody h3 { margin: 10px 0 8px; }
.autosfoot { margin: 6px 0 0; font-size: 12px; text-align: center; }
/* cards: an animated portrait in a dark cave, the name, "by NAME", grade skulls, stars, the record */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; }
.lcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 8px; background: linear-gradient(#1c1418, #120e12); border: 2px solid #3a2a24; box-shadow: 0 0 0 1px #000; text-align: center; position: relative; min-width: 0; }
.lcard.padon, .lcard:hover { border-color: var(--auto-hi); }
.lcard.unb { border-color: #8a3a20; box-shadow: 0 0 0 1px #000, 0 0 14px rgba(255, 106, 64, 0.25); }
.lport { width: 150px; height: 112px; image-rendering: pixelated; background: radial-gradient(ellipse at 50% 85%, #2a1c18 0, #0c0a0c 70%); border: 1px solid #000; display: block; }
.lcard .lname { font-family: var(--title); font-size: 14px; letter-spacing: 1px; color: #ffd8c8; margin-top: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard .lby { font-size: 12px; color: var(--gold); }
.lcard .lmeta { display: flex; gap: 8px; justify-content: center; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.lgrade { color: #ff8a5a; white-space: nowrap; }
.lgrade.g1 { color: #9ad07a; } .lgrade.g2 { color: #e0c860; } .lgrade.g3 { color: #ff9a4a; } .lgrade.g4 { color: #ff6a40; } .lgrade.g5 { color: #ff4a6a; text-shadow: 0 0 6px rgba(255, 60, 80, 0.6); }
.lstars { color: #f2d27a; white-space: nowrap; }
.lcard .lrec { font-size: 11px; color: var(--dim); line-height: 1.3; }
.lcard .lstatus { font-size: 11px; font-family: var(--title); letter-spacing: 1px; color: var(--dim); }
.lcard .lstatus.s-waiting { color: #8fd0ff; } .lcard .lstatus.s-live { color: var(--green); } .lcard .lstatus.s-retired { color: var(--dimmer); }
.lunb { position: absolute; top: 6px; left: 6px; font-family: var(--title); font-size: 10px; letter-spacing: 1px; color: #fff; background: #8a2414; border: 1px solid #000; padding: 1px 4px; box-shadow: 0 0 8px rgba(255, 90, 50, 0.6); }
.lbtns { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.lbtns .warn { border-color: #d04a3a; color: #ffb0a0; }
.lrate { display: flex; gap: 2px; align-items: center; justify-content: center; font-size: 11px; color: var(--dim); margin-top: 3px; }
.lrate span { margin-right: 4px; }
button.lstar { padding: 1px 4px; font-size: 13px; line-height: 1; color: #6a5e4e; font-family: var(--font); }
button.lstar.on { color: #ffd84a; border-color: #b08a3a; }
.lpager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 10px; color: var(--dim); font-size: 13px; }
/* the Workshop: tokens + New on top, the sketches below */
.wsrow { display: flex; gap: 16px; align-items: stretch; }
.wstokens { flex: 1; min-width: 0; }
.wstokens h3 { margin-top: 2px; }
.wstokens .hint { margin-top: 6px; }
.tklist { display: flex; gap: 8px; flex-wrap: wrap; }
.tk { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: rgba(242, 193, 78, 0.07); border: 2px solid #6a5222; }
.tk b { display: block; font-family: var(--title); font-weight: 400; font-size: 13px; color: var(--gold); }
.tk small { color: var(--dim); font-size: 11px; }
.tkic, .ecic { font-size: 22px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.wsnew { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-left: 1px solid #2a231e; }
.wsnew small { color: var(--dim); font-size: 12px; }
.lcard.sk .lport { background: radial-gradient(ellipse at 50% 85%, #1e1a24 0, #0a090c 70%); }
/* the shelf (D38): 64x64 animated mini portraits */
.shelfgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.shent { display: flex; gap: 8px; align-items: flex-start; padding: 6px; background: #161116; border: 2px solid #3a2a24; min-width: 0; }
.shent.padon, .shent:hover { border-color: var(--auto-hi); }
.shport { width: 64px; height: 64px; image-rendering: pixelated; background: radial-gradient(ellipse at 50% 85%, #2a1c18 0, #0c0a0c 70%); border: 1px solid #000; flex: none; }
.shtx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shtx b { font-family: var(--title); font-weight: 400; font-size: 13px; color: #ffd8c8; letter-spacing: 1px; }
.shtx small { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.shtx small:nth-of-type(1) { color: var(--gold); }
.shtx .lrate { justify-content: flex-start; }
/* the profile's shelf strip */
.pshelf { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.pshent { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; }
.pshent small { font-size: 10px; color: var(--dim); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pshmore { font-family: var(--title); color: var(--gold); font-size: 13px; display: flex; flex-direction: column; padding-bottom: 14px; }
.pshmore small { font-family: var(--font); color: var(--dim); font-size: 11px; }
.profauto .aunb { color: #ff6a40; font-family: var(--title); font-weight: 400; }
/* the grade beside a player's design's name (title card, end block) */
.atgrade { color: #ff9a6a; white-space: nowrap; margin-left: 2px; }
.atgrade::before { content: '· '; color: var(--dim); }
.lgrade .sk, .atgrade .sk { font-family: sans-serif; font-size: 1.15em; letter-spacing: -1px; }
.ecomm .ecw { font-style: normal; color: var(--gold); }
/* the match end (§4.4): the champion's commission panel, the star row */
.endauto { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 10px; }
.ecomm { display: flex; gap: 12px; align-items: center; padding: 8px 12px; background: linear-gradient(90deg, rgba(90, 60, 10, 0.45), rgba(40, 20, 8, 0.3)); border: 2px solid #b08a3a; box-shadow: 0 0 16px rgba(242, 193, 78, 0.18); }
.ecomm > div { flex: 1; min-width: 0; }
.ecomm b { display: block; font-family: var(--title); font-weight: 400; font-size: 15px; color: #ffe7a8; letter-spacing: 1px; }
.ecomm small { color: var(--text); font-size: 12px; }
.ecomm small .coin { vertical-align: -1px; margin-right: 4px; }
.ecomm.later, .ecomm.full { background: rgba(40, 30, 14, 0.35); border-color: #5a4a2a; box-shadow: none; }
.erate { display: flex; gap: 10px; align-items: center; padding: 6px 12px; background: rgba(40, 12, 10, 0.35); border: 2px solid #3a2018; }
.erate .et { font-family: var(--title); font-size: 12px; color: #ffd8c8; letter-spacing: 1px; }
.erate .estars { display: flex; gap: 3px; }
.erate button.lstar { font-size: 16px; padding: 2px 6px; }
.erate small { color: var(--dim); font-size: 12px; }
/* the preview room (§7.5): its panel over the HUD; the designer only watches, so his own wands and bars fade */
#hud .pvpanel { position: absolute; right: 12px; top: 12px; zoom: var(--ui-scale); width: 250px; padding: 10px 12px; background: rgb(18, 15, 20); border: 2px solid var(--auto); box-shadow: 0 0 0 2px #000, 0 0 24px rgba(200, 70, 50, 0.3); z-index: 6; pointer-events: auto; }
.pvpanel .pvh { font-family: var(--title); font-size: 12px; letter-spacing: 2px; color: #c8a898; }
.pvpanel .pvh b { color: #ffd8c8; font-weight: 400; font-size: 16px; }
.pvpanel .pvn { font-size: 13px; color: var(--text); margin: 2px 0 6px; }
.pvpanel .pvn b { font-family: var(--title); font-weight: 400; color: #ffd8c8; letter-spacing: 1px; }
.pvpanel .pvres { margin: 0 0 8px; padding-left: 18px; font-size: 12px; color: var(--text); line-height: 1.45; }
.pvpanel .pvres .dim { color: var(--dim); list-style: none; margin-left: -18px; }
.pvpanel .pvbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.pvpanel .pvbtns .on { border-color: var(--gold); color: var(--gold); }
.pvpanel .pvhint { font-size: 11px; color: var(--dimmer); margin-top: 6px; }
/* the test fight while the designer watches (Karl 2026-10-25 "wonky"): his own empty wands / bars / gold / pickup
   hints are not part of the show; the panel, the boss bar and the "Watching X" label are */
body.pvwatch #hud #wands, body.pvwatch #hud .barrow, body.pvwatch #hud .gold, body.pvwatch #hud #hudperks, body.pvwatch #hud #statuses, body.pvwatch #hud #pickups { display: none; }
.spectate small.pvhunt { display: inline; margin-left: 6px; font-size: 13px; color: var(--text); }
/* a preview room plays to 99 round wins (it never ends a match): its round line and score pips say nothing, the panel counts */
body.pvmode #hud #roundinfo > div:first-child, body.pvmode #hud #roundinfo .pipsrow { display: none; }
@media (max-height: 760px) { .autospanel { padding: 12px 14px 8px; } .lport { width: 132px; height: 99px; } }

/* ---- Karl 2026-10-26 (D81-D83): the cursor, the Holy Mountain's quick keys, full screen (lane Q) */
/* the menus' pixel cursor (public/cursor.js applyMenuCursor: the Settings size; small = the system's) */
body { cursor: var(--cur, default); }
body button, body select, body [data-act], body .dcard, body .perk, body .shopitem, body .bpcard, body .bwand, body input[type=range], body input[type=checkbox] { cursor: var(--cur-hand, pointer); }
body button:disabled, body .bwand.sel { cursor: var(--cur, default); }
/* the arrow drawn over a HUD control while the fight holds the pointer lock (the OS cursor is hidden then) */
.vcur { position: fixed; z-index: 300; width: 22px; height: 34px; pointer-events: none; background-repeat: no-repeat; image-rendering: pixelated; }
/* the quick keys in the "Your wands" header line (app.js renderQkHint) */
#bwandhint kbd { font-family: var(--title); font-size: 9px; line-height: 1; background: #1a1614; border: 1px solid var(--edge); box-shadow: 0 0 0 1px #000; padding: 1px 3px; margin: 0 1px; color: #fff; vertical-align: 1px; }
#bwandhint .qk { color: var(--dim); white-space: nowrap; }
@media (min-width: 1700px) and (min-height: 1000px) { #bwandhint { font-size: 13px; } #bwandhint kbd { font-size: 11px; } }
/* a refused quick key: the wand it named flashes red */
.bwand.qkno { animation: qkno 0.6s; }
@keyframes qkno { 0%, 40% { border-color: #ff5a3a; box-shadow: 0 0 0 1px #000, 0 0 16px rgba(255, 70, 40, 0.55); } }
/* full screen buttons (index.html: the title's corner, the Esc menu; Settings): the icon follows the real state */
.fsbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fsico { width: 14px; height: 14px; flex: none;
  background:
    linear-gradient(currentColor, currentColor) left top / 6px 2px, linear-gradient(currentColor, currentColor) left top / 2px 6px,
    linear-gradient(currentColor, currentColor) right top / 6px 2px, linear-gradient(currentColor, currentColor) right top / 2px 6px,
    linear-gradient(currentColor, currentColor) left bottom / 6px 2px, linear-gradient(currentColor, currentColor) left bottom / 2px 6px,
    linear-gradient(currentColor, currentColor) right bottom / 6px 2px, linear-gradient(currentColor, currentColor) right bottom / 2px 6px;
  background-repeat: no-repeat; }
/* on (full screen): the corners pull in to a framed square = "exit" */
.fsbtn.on .fsico { transform: scale(0.7); outline: 2px solid currentColor; outline-offset: 2px; }
.fsbtn.on { border-color: var(--gold); color: #fff3c4; }
.fscorner { position: absolute; top: 12px; right: 14px; z-index: 3; font-size: 12px; padding: 6px 10px; zoom: min(var(--ui-scale), 1.4); }
body.nofs .fsbtn { display: none; }
