:root {
  --bg: #07041a;
  --bg2: #120a33;
  --panel: #170f38;
  --panel2: #21174d;
  --line: #3d2f7a;
  --text: #f4efff;
  --muted: #9a90c9;
  --pink: #ff3ea5;
  --cyan: #29e6ff;
  --yellow: #ffe14d;
  --green: #5cff7a;
  --purple: #b77bff;
  --orange: #ff8a3d;
  --red: #ff4d6d;
  --t1: #aab2c8;
  --t2: #5cff7a;
  --t3: #29e6ff;
  --t4: #c084ff;
  --t5: #ffd23f;
  --px: 'Press Start 2P', monospace;
  --num: 'VT323', monospace;
  --body: 'Chakra Petch', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #2a1468 0%, transparent 60%), linear-gradient(180deg, var(--bg2), var(--bg) 70%);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--pink); color: #000; }

/* ---------- backdrop ---------- */
.bg-stars, .bg-grid, .scanlines { position: fixed; pointer-events: none; z-index: 0; }
.bg-stars { inset: 0; background-image:
  radial-gradient(1px 1px at 10% 20%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 80% 10%, #fff6 50%, transparent 51%),
  radial-gradient(2px 2px at 30% 70%, #29e6ff55 50%, transparent 51%), radial-gradient(1px 1px at 60% 40%, #fff5 50%, transparent 51%),
  radial-gradient(2px 2px at 90% 60%, #ff3ea555 50%, transparent 51%), radial-gradient(1px 1px at 45% 15%, #fff7 50%, transparent 51%),
  radial-gradient(1px 1px at 20% 45%, #fff4 50%, transparent 51%), radial-gradient(1px 1px at 70% 85%, #fff5 50%, transparent 51%);
  animation: twinkle 6s steps(3) infinite; }
.bg-grid { left: -50%; right: -50%; bottom: 0; height: 45vh;
  background-image: linear-gradient(#ff3ea5aa 2px, transparent 2px), linear-gradient(90deg, #ff3ea5aa 2px, transparent 2px);
  background-size: 64px 64px; transform: perspective(300px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  animation: gridmove 2.4s linear infinite; opacity: .35; }
.scanlines { inset: 0; z-index: 100; background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0,0,0,.18) 2px 3px); mix-blend-mode: multiply; }
@keyframes gridmove { to { background-position: 0 64px; } }
@keyframes twinkle { 50% { opacity: .6; } }

#app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- primitives ---------- */
.px { font-family: var(--px); letter-spacing: .02em; }
.muted { color: var(--muted); }
.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 #000, inset 0 0 0 2px #0006;
  padding: 18px;
  position: relative;
}
.panel h3, .label { font-family: var(--px); font-size: 10px; color: var(--muted); margin: 0 0 12px; text-transform: uppercase; letter-spacing: .08em; }
.panel h3 b { color: var(--yellow); font-weight: 400; }

.btn {
  --c: var(--cyan);
  font-family: var(--px); font-size: 12px; line-height: 1.2; text-transform: uppercase;
  padding: 14px 18px; cursor: pointer; color: #120820;
  background: var(--c); border: 3px solid #000;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.28), inset 4px 4px 0 rgba(255,255,255,.4), 4px 4px 0 #000;
  transition: filter .12s, transform .05s;
  user-select: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12) drop-shadow(0 0 10px color-mix(in srgb, var(--c) 60%, transparent)); }
.btn:active { transform: translate(4px, 4px); box-shadow: inset -4px -4px 0 rgba(0,0,0,.28), inset 4px 4px 0 rgba(255,255,255,.4); }
.btn:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; transform: none; }
.btn.pink { --c: var(--pink); } .btn.yellow { --c: var(--yellow); } .btn.green { --c: var(--green); }
.btn.purple { --c: var(--purple); } .btn.orange { --c: var(--orange); } .btn.red { --c: var(--red); }
.btn.ghost { --c: var(--panel2); color: var(--text); }
.btn.big { font-size: 16px; padding: 20px 26px; }
.btn.sm { font-size: 9px; padding: 9px 11px; box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 3px 3px 0 rgba(255,255,255,.4), 3px 3px 0 #000; }
.btn.on { outline: 3px solid var(--yellow); outline-offset: 2px; }

.input {
  width: 100%; background: #07041a; border: 3px solid var(--line); padding: 12px 14px; font-size: 18px;
  color: var(--text); outline: none; box-shadow: inset 3px 3px 0 #0008;
}
.input:focus { border-color: var(--cyan); box-shadow: inset 3px 3px 0 #0008, 0 0 0 3px #29e6ff33, 0 0 22px #29e6ff44; }
.input::placeholder { color: #5f5791; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--px); font-size: 9px; text-transform: uppercase;
  padding: 8px 10px; border: 2px solid var(--line); background: #0b0724; color: var(--muted); cursor: pointer; user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--purple); }
.chip.on { background: var(--purple); color: #120820; border-color: #000; box-shadow: 3px 3px 0 #000; }
.chip .n { opacity: .7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* tiers */
.t1 { --tc: var(--t1); } .t2 { --tc: var(--t2); } .t3 { --tc: var(--t3); } .t4 { --tc: var(--t4); } .t5 { --tc: var(--t5); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.topbar .logo-sm { font-family: var(--px); font-size: 18px; color: var(--yellow); text-shadow: 2px 2px 0 var(--pink), 4px 4px 0 #000; cursor: pointer; }
.iconbtn { background: var(--panel); border: 2px solid var(--line); color: var(--muted); font-family: var(--px); font-size: 9px; padding: 8px 10px; cursor: pointer; box-shadow: 3px 3px 0 #000; }
.iconbtn:hover { color: var(--text); border-color: var(--cyan); }

/* ---------- home ---------- */
.home { display: grid; justify-items: center; gap: 26px; padding-top: 4vh; }
.logo { font-family: var(--px); font-size: clamp(56px, 13vw, 128px); line-height: 1; color: var(--yellow); margin: 0;
  text-shadow: 5px 5px 0 var(--pink), 10px 10px 0 var(--cyan), 15px 15px 0 #000; transform: rotate(-3deg);
  animation: logobob 3s ease-in-out infinite; }
.logo span { display: inline-block; animation: letterhop 2.4s ease-in-out infinite; }
.logo span:nth-child(2) { animation-delay: .1s; } .logo span:nth-child(3) { animation-delay: .2s; } .logo span:nth-child(4) { animation-delay: .3s; } .logo span:nth-child(5) { animation-delay: .4s; }
@keyframes letterhop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-10px); } }
@keyframes logobob { 50% { transform: rotate(-2deg) scale(1.02); } }
.tagline { font-family: var(--px); font-size: 11px; color: var(--cyan); text-align: center; line-height: 1.9; margin-top: 6px; }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.home-card { width: min(560px, 100%); display: grid; gap: 16px; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; display: grid; place-items: center; font-size: 28px; background: var(--ac, var(--pink)); color: #120820;
  border: 3px solid #000; box-shadow: inset -4px -4px 0 rgba(0,0,0,.25), inset 4px 4px 0 rgba(255,255,255,.35), 3px 3px 0 #000; cursor: pointer; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 17px; border-width: 2px; box-shadow: inset -3px -3px 0 rgba(0,0,0,.25), inset 3px 3px 0 rgba(255,255,255,.35), 2px 2px 0 #000; }
.avatar.xs { width: 24px; height: 24px; font-size: 12px; border-width: 2px; box-shadow: none; }
.picker { display: none; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.picker.open { display: flex; }
.picker button { width: 36px; height: 36px; background: #0b0724; border: 2px solid var(--line); cursor: pointer; font-size: 18px; color: var(--text); }
.picker button.sw { border: 3px solid #000; }
.picker button.on { outline: 3px solid var(--yellow); }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.joinrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.joinrow .input { font-family: var(--px); font-size: 16px; text-transform: uppercase; letter-spacing: .3em; text-align: center; }
.roomlist { display: grid; gap: 8px; }
.roomitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #0b0724; border: 2px solid var(--line); cursor: pointer; }
.roomitem:hover { border-color: var(--green); }
.roomitem .code { font-family: var(--px); color: var(--green); font-size: 13px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.foot { font-family: var(--px); font-size: 8px; color: var(--muted); text-align: center; line-height: 2; }
.foot b { color: var(--yellow); font-weight: 400; }

/* ---------- lobby ---------- */
.roomcode { text-align: center; }
.roomcode .code { font-family: var(--px); font-size: 40px; color: var(--green); letter-spacing: .15em; text-shadow: 3px 3px 0 #000, 0 0 18px #5cff7a66; margin: 6px 0 12px; }
.plist { display: grid; gap: 8px; }
.pitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #0b0724; border: 2px solid var(--line); }
.pitem.off { opacity: .45; }
.pitem .name { font-weight: 700; font-size: 17px; }
.pitem .tag { font-family: var(--px); font-size: 7px; padding: 4px 6px; background: var(--yellow); color: #000; }
.pitem .tag.bot { background: var(--muted); }
.pitem .x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-family: var(--px); font-size: 10px; }
.pitem .x:hover { color: var(--red); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mode { text-align: left; padding: 14px; background: #0b0724; border: 3px solid var(--line); cursor: pointer; color: var(--text); display: grid; gap: 8px; align-content: start; }
.mode:hover:not(:disabled) { border-color: var(--mc); }
.mode.on { border-color: var(--mc); box-shadow: 0 0 0 2px #000, 0 0 24px color-mix(in srgb, var(--mc) 45%, transparent); background: color-mix(in srgb, var(--mc) 10%, #0b0724); }
.mode .mt { font-family: var(--px); font-size: 11px; color: var(--mc); }
.mode .md { font-size: 13px; color: var(--muted); line-height: 1.35; }
.mode:disabled { cursor: default; }
.setgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 22px; }
.setting .label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.setting .label b { color: var(--yellow); font-weight: 400; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; background: #0b0724; border: 2px solid var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 26px; background: var(--yellow); border: 3px solid #000; cursor: pointer; box-shadow: 2px 2px 0 #000; }
input[type=range]::-moz-range-thumb { width: 14px; height: 22px; background: var(--yellow); border: 3px solid #000; border-radius: 0; cursor: pointer; }
input[type=range]:disabled::-webkit-slider-thumb { background: var(--muted); }
.toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #0b0724; border: 2px solid var(--line); cursor: pointer; text-align: left; color: var(--text); }
.toggle:disabled { cursor: default; opacity: .6; }
.toggle .sw { width: 38px; height: 20px; background: #2a2150; border: 2px solid #000; position: relative; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--muted); transition: left .12s; }
.toggle.on .sw { background: var(--green); }
.toggle.on .sw::after { left: 20px; background: #000; }
.toggle .tt { font-weight: 700; font-size: 14px; }
.toggle .td { font-size: 12px; color: var(--muted); }
.queue { display: grid; gap: 6px; }
.qitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #0b0724; border: 2px dashed var(--line); font-size: 15px; }
.qitem.gen { border-color: var(--purple); color: var(--purple); }
.qitem button { margin-left: auto; }
.search-results { max-height: 260px; overflow: auto; display: grid; gap: 4px; margin-top: 8px; }
.sres { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #0b0724; border: 2px solid transparent; cursor: pointer; font-size: 15px; }
.sres:hover { border-color: var(--cyan); }
.sres .meta { margin-left: auto; font-family: var(--px); font-size: 7px; color: var(--muted); white-space: nowrap; }
.diff { font-family: var(--px); font-size: 7px; padding: 3px 5px; border: 1px solid currentColor; }
.diff.easy { color: var(--green); } .diff.medium { color: var(--cyan); } .diff.hard { color: var(--orange); } .diff.brutal { color: var(--red); }
.startbar { position: sticky; bottom: 12px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 20px; padding: 12px; background: #07041add; border: 3px solid var(--line); backdrop-filter: blur(6px); box-shadow: 6px 6px 0 #000; z-index: 5; }
.stack { display: grid; gap: 20px; }

/* ---------- play ---------- */
.hud { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hud .rnd { font-family: var(--px); font-size: 12px; }
.hud .rnd b { color: var(--yellow); font-weight: 400; }
.hud .meta { font-family: var(--px); font-size: 8px; color: var(--muted); line-height: 1.8; }
.timer { margin-left: auto; font-family: var(--num); font-size: 64px; line-height: .8; color: var(--cyan); text-shadow: 3px 3px 0 #000, 0 0 18px #29e6ff88; min-width: 90px; text-align: right; }
.timer.low { color: var(--red); text-shadow: 3px 3px 0 #000, 0 0 18px #ff4d6d99; animation: pulse .5s steps(2) infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.timebar { height: 14px; background: #0b0724; border: 3px solid #000; margin: 12px 0 18px; box-shadow: 4px 4px 0 #000; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, var(--cyan) 0 14px, #1a9fb3 14px 16px); transform-origin: left; }
.timebar.low i { background: repeating-linear-gradient(90deg, var(--red) 0 14px, #a8233a 14px 16px); }
.prompt { font-family: var(--px); font-size: clamp(20px, 3.6vw, 38px); line-height: 1.35; margin: 4px 0 18px; text-align: center; color: var(--text); text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #000; }
.answer-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; max-width: 760px; margin: 0 auto; }
.answer-row .input { font-size: 24px; padding: 16px 18px; font-weight: 600; }
.feedback { height: 28px; text-align: center; margin: 10px 0 6px; font-family: var(--px); font-size: 10px; }
.feedback span { display: inline-block; animation: pop .25s ease-out; }
.feedback .bad { color: var(--red); } .feedback .dupe { color: var(--orange); } .feedback .ok { color: var(--tc); }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } }
.play-body { display: grid; grid-template-columns: 1fr 260px; gap: 20px; margin-top: 10px; align-items: start; }
@media (max-width: 820px) { .play-body { grid-template-columns: 1fr; } }
.mysum { display: flex; gap: 14px; align-items: baseline; margin-bottom: 12px; font-family: var(--px); font-size: 9px; color: var(--muted); }
.mysum b { font-family: var(--num); font-size: 30px; color: var(--yellow); font-weight: 400; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; }
.ans { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; background: color-mix(in srgb, var(--tc, var(--line)) 14%, #0b0724); border: 2px solid var(--tc, var(--line)); font-weight: 600; font-size: 16px; animation: drop .22s ease-out; }
.ans .tb { font-family: var(--px); font-size: 7px; color: var(--tc); }
.ans.pending { --tc: var(--muted); border-style: dashed; animation: drop .22s ease-out, shimmer 1s linear infinite; }
.ans.bad { --tc: #5a4f7f; text-decoration: line-through; color: #6f6699; }
.ans.dupe { display: none; }
.ans.t5 { box-shadow: 0 0 14px #ffd23f66; }
@keyframes drop { from { transform: translateY(-8px) scale(.9); opacity: 0; } }
@keyframes shimmer { 50% { opacity: .5; } }
.opps { display: grid; gap: 8px; }
.opp { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #0b0724; border: 2px solid var(--line); }
.opp .n { font-weight: 700; }
.opp .cnt { margin-left: auto; font-family: var(--num); font-size: 28px; color: var(--cyan); }
.opp.done { border-color: var(--green); }
.opp .chk { font-family: var(--px); font-size: 7px; color: var(--green); }
.play-foot { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #07041ae6; backdrop-filter: blur(3px); text-align: center; padding: 20px; }
.overlay .big { font-family: var(--px); font-size: clamp(60px, 14vw, 160px); color: var(--yellow); text-shadow: 6px 6px 0 var(--pink), 12px 12px 0 #000; animation: zoom .9s ease-out infinite; }
.overlay .sub { font-family: var(--px); font-size: 12px; color: var(--cyan); margin-top: 22px; line-height: 2; }
.overlay .op { font-family: var(--px); font-size: clamp(16px, 3vw, 28px); line-height: 1.5; margin-top: 18px; max-width: 900px; }
@keyframes zoom { from { transform: scale(1.4); opacity: .3; } 30% { transform: scale(1); opacity: 1; } }

/* curses */
.curse-banner { display: none; text-align: center; font-family: var(--px); font-size: 11px; color: #000; background: var(--orange); padding: 8px; margin: 0 auto 12px; max-width: 760px; border: 3px solid #000; box-shadow: 4px 4px 0 #000; animation: pop .3s; }
.curse-banner.on { display: block; }
.c-tiny .answer-row .input { font-size: 8px; }
.c-blur .answer-row .input { filter: blur(3.5px); }
.c-flip .answer-row .input { transform: rotate(180deg); }
.c-mirror .answer-row .input { transform: scaleX(-1); }
.c-shake .answer-row .input { animation: shake .18s linear infinite; }
.c-ghost .answer-row .input { color: transparent; caret-color: var(--pink); }
.c-hidetimer .timer, .c-hidetimer .timebar i { visibility: hidden; }
@keyframes shake { 25% { transform: translate(3px, -2px) rotate(1deg); } 75% { transform: translate(-3px, 2px) rotate(-1deg); } }
.flash { animation: flash .35s; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--red), 0 0 30px var(--red); } }
.shake-x { animation: shakex .3s; }
@keyframes shakex { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* showdown */
.sd-players { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 6px 0 18px; }
.sd-p { min-width: 150px; padding: 10px 12px; background: #0b0724; border: 3px solid var(--line); display: grid; gap: 6px; justify-items: center; transition: transform .15s; }
.sd-p.cur { border-color: var(--yellow); transform: translateY(-6px); box-shadow: 0 0 0 2px #000, 0 0 26px #ffe14d66; }
.sd-p.out { opacity: .35; filter: grayscale(1); }
.sd-p .hearts { color: var(--red); font-size: 16px; letter-spacing: 2px; }
.sd-p .hearts .lost { color: #3a2f5f; }
.sd-p .pts { font-family: var(--num); font-size: 24px; color: var(--yellow); }
.sd-turn { text-align: center; font-family: var(--px); font-size: 16px; margin: 6px 0 14px; }
.sd-turn.you { color: var(--yellow); animation: pulse .6s steps(2) infinite; }
.sd-clock { text-align: center; font-family: var(--num); font-size: 90px; line-height: .9; color: var(--cyan); text-shadow: 4px 4px 0 #000; }
.sd-clock.low { color: var(--red); }
.sd-used { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
.sd-used .ans { font-size: 14px; padding: 6px 8px; }
.sd-used .ans.old { animation: none; }

/* ---------- reveal ---------- */
.rv-head { text-align: center; margin-bottom: 18px; }
.rv-head .px { font-size: 10px; color: var(--muted); }
.rv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.rv-col .who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rv-col .who .n { font-weight: 700; font-size: 18px; }
.rv-col .rpts { margin-left: auto; font-family: var(--num); font-size: 36px; color: var(--yellow); line-height: .8; }
.rv-list { display: grid; gap: 6px; }
.rv-a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 10px; background: color-mix(in srgb, var(--tc) 12%, #0b0724); border-left: 4px solid var(--tc); opacity: 0; transform: translateX(-10px); }
.rv-a.in { opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
.rv-a .c { font-weight: 700; }
.rv-a .p { font-family: var(--num); font-size: 22px; color: var(--tc); text-align: right; line-height: 1; }
.rv-a .s { grid-column: 1 / -1; font-family: var(--px); font-size: 7px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.rv-a .s .tier { color: var(--tc); }
.rv-a .s .split { color: var(--orange); }
.rv-a .s .raw { font-family: var(--body); font-size: 11px; }
.rv-a.zero .p { color: var(--red); text-decoration: line-through; }
.rv-a.badrow { --tc: #4b416f; color: #7d74a8; text-decoration: line-through; }
.rv-bonus { margin-top: 10px; font-family: var(--px); font-size: 9px; color: #000; background: var(--yellow); padding: 7px 9px; display: inline-block; box-shadow: 3px 3px 0 #000; }
.rv-bonus.sv { background: var(--green); }
.board { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 34px 150px 1fr 110px; align-items: center; gap: 10px; }
.bar .track { height: 22px; background: #0b0724; border: 2px solid #000; }
.bar .fill { height: 100%; background: var(--pc); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); box-shadow: inset -3px -3px 0 rgba(0,0,0,.25); }
.bar .tot { font-family: var(--num); font-size: 28px; text-align: right; color: var(--yellow); }
.bar .gain { font-family: var(--px); font-size: 8px; color: var(--green); }
.bar .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .bar { grid-template-columns: 28px 90px 1fr 80px; } }
.gems .ans { animation: none; }
.readybar { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.readydots { display: flex; gap: 6px; }

/* ---------- final ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 26px 0 30px; min-height: 290px; }
.pod { display: grid; justify-items: center; gap: 8px; width: 170px; }
.pod .blk { width: 100%; display: grid; place-items: center; font-family: var(--px); font-size: 28px; color: #000; border: 3px solid #000; box-shadow: inset -6px -6px 0 rgba(0,0,0,.25), inset 6px 6px 0 rgba(255,255,255,.35), 6px 6px 0 #000; animation: rise .8s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
.pod .n { font-weight: 700; font-size: 18px; text-align: center; }
.pod .s { font-family: var(--num); font-size: 32px; color: var(--yellow); line-height: .8; }
.pod.p1 .blk { height: 170px; background: var(--yellow); }
.pod.p2 .blk { height: 120px; background: #cfd6e6; animation-delay: .2s; }
.pod.p3 .blk { height: 85px; background: var(--orange); animation-delay: .35s; }
@keyframes rise { from { transform: scaleY(0); } }
.crown { font-size: 34px; animation: logobob 1.5s infinite; }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.award { padding: 14px; background: #0b0724; border: 3px solid var(--line); display: grid; gap: 6px; }
.award .at { font-family: var(--px); font-size: 10px; color: var(--pink); }
.award .ad { font-size: 12px; color: var(--muted); }
.award .aw { font-weight: 700; font-size: 17px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 10px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: #07041acc; display: grid; place-items: start center; overflow: auto; padding: 40px 16px; }
.modal .panel { width: min(980px, 100%); }
.modal .close { position: absolute; top: 12px; right: 12px; }
.modal h2 { font-family: var(--px); font-size: 18px; color: var(--yellow); margin: 0 0 18px; text-shadow: 3px 3px 0 #000; }
table.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
table.lb th { font-family: var(--px); font-size: 8px; color: var(--muted); text-align: right; padding: 8px 6px; border-bottom: 2px solid var(--line); }
table.lb td { padding: 9px 6px; text-align: right; border-bottom: 1px solid #2a2150; }
table.lb th:first-child, table.lb td:first-child, table.lb th:nth-child(2), table.lb td:nth-child(2) { text-align: left; }
table.lb tr.click { cursor: pointer; }
table.lb tr.click:hover td { background: #21174d; }
table.lb .num { font-family: var(--num); font-size: 22px; }
.tierbar { display: flex; height: 18px; border: 2px solid #000; margin: 8px 0 4px; }
.tierbar i { display: block; height: 100%; background: var(--tc); }
.help h4 { font-family: var(--px); font-size: 11px; color: var(--cyan); margin: 20px 0 8px; }
.help p, .help li { line-height: 1.55; color: #d9d2f5; }
.tierrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--panel2); border: 3px solid var(--cyan); padding: 10px 14px; box-shadow: 4px 4px 0 #000; font-size: 15px; animation: pop .25s; max-width: 90vw; }
.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 95; background: var(--red); color: #000; font-family: var(--px); font-size: 10px; text-align: center; padding: 8px; display: none; }
.conn.on { display: block; }
.fx-pop { position: fixed; z-index: 70; pointer-events: none; font-family: var(--px); font-size: 14px; color: var(--tc); text-shadow: 2px 2px 0 #000; animation: floatup 1s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-60px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.hud .iconbtn { font-size: 7px; }
#banbox { margin-top: -6px; min-height: 30px; }
#banbox .iconbtn { font-size: 8px; }
.sres .iconbtn { padding: 5px 7px; font-size: 7px; box-shadow: none; }
.sres .iconbtn:hover { border-color: var(--red); color: var(--red); }
details.binned summary { cursor: pointer; list-style: none; }
details.binned summary::before { content: '▸ '; }
details.binned[open] summary::before { content: '▾ '; }
