:root {
  --bg: #04061a;
  --bg-2: #0a0f33;
  --panel: rgba(18, 24, 68, .62);
  --panel-solid: #121847;
  --panel-2: rgba(32, 42, 110, .55);
  --line: rgba(140, 160, 255, .16);
  --line-strong: rgba(140, 160, 255, .32);
  --text: #eef1ff;
  --muted: #98a2d8;
  --blue: #0b22ff;
  --blue-2: #3a55ff;
  --tile-top: #2440ff;
  --tile-bottom: #0612b8;
  --gold: #ffd23f;
  --gold-2: #ffb800;
  --green: #22d37a;
  --red: #ff4d5e;
  --orange: #f7a531;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* animated aurora background */
body::before, body::after {
  content: '';
  position: fixed;
  z-index: -1;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
  pointer-events: none;
}
body::before {
  background: radial-gradient(circle, #1b2cff 0%, transparent 65%);
  top: -30vmax;
  left: -20vmax;
  animation: drift1 26s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(circle, #7a1fff 0%, transparent 65%);
  bottom: -35vmax;
  right: -25vmax;
  opacity: .3;
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, -10vmax) scale(1.1); } }

h1, h2, h3, .display { font-family: 'Oswald', 'Inter', sans-serif; letter-spacing: .02em; font-weight: 600; }
h1, h2, h3 { margin: 0 0 12px; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { height: 12px; }

/* ---------- form elements ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: rgba(4, 7, 30, .7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(58, 85, 255, .3);
  background: rgba(4, 7, 30, .9);
}
textarea { resize: vertical; min-height: 60px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 5px; }
input[type=checkbox] { accent-color: var(--gold); width: 18px; height: 18px; }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, filter .2s;
}
.btn:hover:not(:disabled) { border-color: var(--blue-2); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--blue-2), var(--blue)); border-color: transparent; box-shadow: 0 4px 16px rgba(11, 34, 255, .35); }
.btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold-2)); color: #2a1d00; border-color: transparent; box-shadow: 0 4px 16px rgba(255, 184, 0, .3); }
.btn.green { background: linear-gradient(180deg, #4be394, #16b865); color: #032813; border-color: transparent; }
.btn.red { background: linear-gradient(180deg, #ff7280, #e5334a); color: #2d0308; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 13px 26px; font-size: 17px; border-radius: 12px; }
.btn:hover:not(:disabled).gold, .btn:hover:not(:disabled).primary, .btn:hover:not(:disabled).green, .btn:hover:not(:disabled).red { filter: brightness(1.08); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.error { color: #ff9aa5; min-height: 20px; margin-top: 8px; font-size: 14px; }
.ok { color: #7ff0b1; }

/* ---------- layout ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 6, 26, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.logo {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .06em;
  background: linear-gradient(100deg, #ffe58a 0%, var(--gold) 40%, #fff6cf 50%, var(--gold) 60%, var(--gold-2) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .6));
  animation: shine 6s linear infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.container { max-width: 1440px; margin: 0 auto; padding: 24px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); font-weight: 600; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 230) 80% 60%), hsl(calc(var(--h, 230) + 40) 80% 45%));
  flex: none;
}

.auth-wrap { max-width: 440px; margin: 9vh auto; padding: 0 16px; animation: rise .6s var(--ease) both; }
.auth-wrap .logo { font-size: 58px; text-align: center; margin-bottom: 6px; display: block; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; background: rgba(0, 0, 0, .25); border-radius: 12px; }
.tabs .btn { flex: 1; background: transparent; border-color: transparent; box-shadow: none; }
.tabs .btn:hover { transform: none; }
.tabs .btn.active { background: linear-gradient(180deg, var(--blue-2), var(--blue)); box-shadow: 0 4px 14px rgba(11, 34, 255, .35); }
.topbar .tabs { margin: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.game-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
@media (max-width: 900px) { .game-layout { grid-template-columns: 1fr; } .container { padding: 16px; } }

.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 18px;
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}
.status-banner.changed { animation: rise .4s var(--ease) both; }
.status-banner.me {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 210, 63, .18), rgba(255, 210, 63, .04));
  animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 210, 63, .15), 0 0 30px rgba(255, 210, 63, .25); } }

/* ---------- board ---------- */
.board {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .55));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .03);
  perspective: 900px;
}
.board .cat, .board .tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.board .cat {
  background: linear-gradient(180deg, #1a2fe0, #0a17a8);
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 10px 6px;
  min-height: 68px;
  font-size: clamp(12px, 1.35vw, 18px);
  word-break: break-word;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 -3px 0 rgba(0, 0, 0, .25);
}
.board .tile {
  background: linear-gradient(170deg, var(--tile-top), var(--tile-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -4px 0 rgba(0, 0, 0, .28), 0 4px 10px rgba(0, 0, 0, .35);
  font-family: 'Oswald', sans-serif;
  color: var(--gold);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 44px);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 18px rgba(255, 210, 63, .25);
  min-height: clamp(56px, 9.5vh, 100px);
  user-select: none;
  transition: transform .25s var(--ease), box-shadow .25s, filter .25s;
}
/* glossy sweep */
.board .tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .6s var(--ease);
  pointer-events: none;
}
.board .tile.clickable { cursor: pointer; }
.board .tile.clickable:hover {
  transform: translateY(-3px) scale(1.035);
  filter: brightness(1.15);
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 26px rgba(11, 34, 255, .55), 0 0 0 2px rgba(255, 210, 63, .7);
}
.board .tile.clickable:hover::after { transform: translateX(120%); }
.board.pickable .tile.clickable:not(.used) { animation: invite 2.4s ease-in-out infinite; }
@keyframes invite { 50% { filter: brightness(1.14); } }
.board .tile.used {
  color: transparent;
  text-shadow: none;
  background: linear-gradient(170deg, #0b1266, #060a3f);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .6);
}
.board .tile.active { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255, 210, 63, .6); z-index: 2; }
.board .tile .badge {
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 11px;
  color: #fff;
  text-shadow: none;
  opacity: .8;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}
.board .enter { animation: tileIn .55s var(--spring) both !important; animation-delay: calc(var(--i) * 28ms) !important; }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(.85) rotateX(40deg); } to { opacity: 1; transform: none; } }
.board .just-used { animation: flipOut .7s var(--ease) both !important; }
@keyframes flipOut { 0% { transform: rotateX(0); filter: brightness(1.8); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

/* ---------- scores ---------- */
.side-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.side-title h3 { margin: 0; }
.scores { display: flex; flex-direction: column; gap: 8px; }
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  backdrop-filter: blur(10px);
  position: relative;
}
.score-row.me { border-color: rgba(255, 210, 63, .6); background: linear-gradient(90deg, rgba(255, 210, 63, .12), var(--panel)); }
.score-row .rank { width: 18px; color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; }
.score-row .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row .chooser-tag { font-size: 11px; font-weight: 700; color: #2a1d00; background: var(--gold); border-radius: 99px; padding: 1px 7px; }
.score-row .pts { font-family: 'Oswald', sans-serif; font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.score-row .pts.neg { color: var(--red); }
.score-row.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.05); } }
.floater {
  position: absolute;
  right: 12px;
  top: 4px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 20px;
  pointer-events: none;
  animation: floatUp 1.4s var(--ease) forwards;
}
.floater.plus { color: var(--green); }
.floater.minus { color: var(--red); }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 20% { opacity: 1; transform: translateY(-6px) scale(1.1); } 100% { opacity: 0; transform: translateY(-34px); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4a4f70; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 211, 122, .2); }

/* ---------- question overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(8, 12, 50, .88), rgba(2, 3, 16, .96));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn .3s ease both;
}
.question-card {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(120, 140, 255, .35), transparent 60%),
    linear-gradient(170deg, #1c34ff, #0816b8 55%, #050d86);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 80px rgba(0, 0, 0, .3);
  width: min(1000px, 100%);
  padding: 30px 34px;
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  position: relative;
  transform-origin: center;
}
.question-card.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
.question-card.flash-green { animation: flashGreen 1s ease; }
@keyframes flashGreen { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 122, .9), 0 30px 80px rgba(0, 0, 0, .65); } 100% { box-shadow: 0 0 0 40px rgba(34, 211, 122, 0), 0 30px 80px rgba(0, 0, 0, .65); } }

.question-card .meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .12);
}
.question-card .meta .pts { color: var(--gold); font-weight: 700; }

/* typewriter text: left-aligned inside a centered block so lines never re-center while typing */
.qtext {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: clamp(24px, 3.3vw, 42px);
  line-height: 1.3;
  letter-spacing: .01em;
  margin: 22px auto 20px;
  max-width: 860px;
  text-align: left;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  white-space: pre-wrap;
  min-height: 1.3em;
}
.qtext .w { display: inline-block; white-space: pre; }
.qtext .w.ws { display: inline; white-space: pre-wrap; }
.qtext .w.in { animation: wordIn .5s var(--ease) both; }
@keyframes wordIn {
  from { opacity: 0; filter: blur(8px); transform: translateY(.3em); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
.caret {
  display: inline-block;
  width: 3px;
  height: .95em;
  margin-left: 4px;
  vertical-align: -0.1em;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 210, 63, .8);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.question-card img.qimg { max-width: 100%; max-height: 45vh; border-radius: 12px; margin-bottom: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.question-card .answer {
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 22px;
  margin: 12px auto 6px;
  max-width: 760px;
}
.question-card .answer b { color: var(--gold); }
.tag { display: inline-block; background: linear-gradient(180deg, #ffe07a, var(--gold-2)); color: #2a1d00; font-weight: 700; border-radius: 99px; padding: 2px 10px; font-size: 11px; letter-spacing: .06em; vertical-align: middle; }

.q-body.enter > * { animation: rise .4s var(--ease) both; }
.q-body.enter > *:nth-child(2) { animation-delay: .06s; }
.q-body.enter > *:nth-child(3) { animation-delay: .12s; }
.q-body.enter .answer { animation: pop .55s var(--spring) both; }

/* intro: category + points */
.intro { padding: 30px 0 20px; }
.intro-cat { font-family: 'Oswald', sans-serif; font-size: clamp(26px, 4.6vw, 52px); text-transform: uppercase; letter-spacing: .06em; animation: slideDown .6s var(--ease) both; }
.intro-points {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(80px, 14vw, 170px);
  line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 6px 0 rgba(0, 0, 0, .45), 0 0 50px rgba(255, 210, 63, .45);
  animation: pop .7s var(--spring) .15s both;
}
.intro .tag { font-size: 16px; padding: 4px 16px; animation: pop .5s var(--spring) .35s both; }
.intro-wait { margin-top: 22px; color: rgba(255, 255, 255, .7); animation: fadeIn .5s ease .5s both; }
.dots span { animation: dotBlink 1.4s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBlink { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); letter-spacing: .3em; } to { opacity: 1; transform: none; } }

/* buzzer */
.buzzer-wrap { position: relative; width: 180px; height: 180px; margin: 10px auto 8px; }
.buzzer-wrap .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 90, 90, .7);
  animation: ring 1.6s ease-out infinite;
  pointer-events: none;
}
.buzzer-wrap .ring + .ring { animation-delay: .8s; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
.buzzer {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 7px solid #6d0f17;
  background: radial-gradient(circle at 35% 28%, #ff9a9a 0%, #ff3345 45%, #b3121f 80%);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .06em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .4);
  cursor: pointer;
  box-shadow: 0 12px 0 #4a0810, 0 20px 40px rgba(0, 0, 0, .55), inset 0 -8px 16px rgba(0, 0, 0, .25), inset 0 8px 16px rgba(255, 255, 255, .25);
  display: block;
  margin: 0 auto;
  transition: transform .08s, box-shadow .08s, filter .3s;
  -webkit-tap-highlight-color: transparent;
}
.buzzer:hover:not(:disabled) { filter: brightness(1.08); }
.buzzer:active:not(:disabled), .buzzer.pressed { transform: translateY(10px); box-shadow: 0 2px 0 #4a0810, 0 6px 14px rgba(0, 0, 0, .5), inset 0 -4px 10px rgba(0, 0, 0, .3); }
.buzzer:disabled { filter: grayscale(.9) brightness(.55); cursor: not-allowed; }
.buzzer-hint { font-size: 13px; color: rgba(255, 255, 255, .6); margin-top: 14px; }
.buzzer-hint kbd { background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .2); border-radius: 5px; padding: 1px 6px; font-family: inherit; }

.phase-msg { font-size: 21px; font-weight: 700; margin: 10px 0; }
.phase-msg.gold { color: var(--gold); }
.my-turn {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--gold);
  margin: 18px 0;
  text-shadow: 0 0 30px rgba(255, 210, 63, .6);
  animation: pop .5s var(--spring) both, glowText 1.6s ease-in-out .5s infinite;
}
@keyframes glowText { 50% { text-shadow: 0 0 50px rgba(255, 210, 63, .95); } }
.answering-name { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin: 16px 0; padding: 8px 20px 8px 8px; border-radius: 99px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 210, 63, .5); }
.answering-name .avatar { width: 38px; height: 38px; font-size: 16px; }

.buzz-list { list-style: none; padding: 0; margin: 12px auto; max-width: 380px; text-align: left; }
.buzz-list li { background: rgba(0, 0, 0, .28); border-radius: 10px; padding: 7px 12px; margin-bottom: 5px; display: flex; justify-content: space-between; }
.buzz-list li:first-child { background: linear-gradient(90deg, #ffe07a, var(--gold-2)); color: #2a1d00; font-weight: 700; }

.estimate-form { display: flex; gap: 8px; max-width: 420px; margin: 14px auto; }
.estimate-form input { font-size: 22px; text-align: center; font-weight: 600; }
.results { width: 100%; max-width: 560px; margin: 12px auto; border-collapse: separate; border-spacing: 0 5px; }
.results td { padding: 8px 12px; background: rgba(0, 0, 0, .22); }
.results td:first-child { border-radius: 10px 0 0 10px; text-align: left; }
.results td:last-child { border-radius: 0 10px 10px 0; text-align: right; }
.q-body.enter .results tr { animation: rise .4s var(--ease) both; }
.q-body.enter .results tr:nth-child(2) { animation-delay: .08s; }
.q-body.enter .results tr:nth-child(3) { animation-delay: .16s; }
.q-body.enter .results tr:nth-child(n+4) { animation-delay: .24s; }
.results tr.win td { background: rgba(255, 210, 63, .2); color: var(--gold); font-weight: 700; }
.results tr.pick td { cursor: pointer; }
.results tr.pick:hover td { background: rgba(255, 255, 255, .08); }
.award-chip { display: inline-flex; align-items: center; gap: 8px; margin: 6px; padding: 8px 16px; border-radius: 99px; font-weight: 700; font-size: 18px; }
.q-body.enter .award-chip { animation: pop .5s var(--spring) .2s both; }
.award-chip.plus { background: rgba(34, 211, 122, .2); border: 1px solid var(--green); color: #aaf5cc; }
.award-chip.minus { background: rgba(255, 77, 94, .18); border: 1px solid var(--red); color: #ffc0c6; }

/* answer timer */
.timer { position: relative; height: 12px; background: rgba(0, 0, 0, .35); border-radius: 99px; overflow: hidden; margin: 16px auto 4px; max-width: 520px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.timer .bar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffe07a, var(--gold-2)); border-radius: 99px; box-shadow: 0 0 12px rgba(255, 210, 63, .6); }
.timer.low .bar { background: linear-gradient(90deg, #ff8a95, var(--red)); box-shadow: 0 0 12px rgba(255, 77, 94, .7); animation: lowPulse .6s ease-in-out infinite; }
@keyframes lowPulse { 50% { opacity: .6; } }
.timer span { display: none; }
.timer-label { font-family: 'Oswald', sans-serif; font-size: 17px; color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; min-height: 1.3em; }

/* buzz / wrong banner */
.banner {
  position: fixed;
  left: 50%;
  top: 16%;
  z-index: 40;
  transform: translateX(-50%);
  padding: 16px 34px;
  border-radius: 18px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 700;
  color: #2a1d00;
  background: linear-gradient(180deg, #ffe07a, var(--gold-2));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 210, 63, .5);
  pointer-events: none;
  white-space: nowrap;
  animation: bannerIn 1.8s var(--ease) forwards;
}
.banner.red { background: linear-gradient(180deg, #ff8a95, #e5334a); color: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 77, 94, .5); }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -30px) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  25% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -14px) scale(.96); }
}

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; }

/* final */
.final { text-align: center; }
.final .card { padding: 30px; }
.podium-wrap { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 30px 0 20px; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(180px, 30%); }
.podium-col .pname { font-weight: 700; font-size: 18px; }
.podium-col .pscore { font-family: 'Oswald', sans-serif; color: var(--gold); font-size: 24px; }
.podium-col .pname, .podium-col .pscore, .podium-col .avatar { animation: rise .5s var(--ease) both; }
.podium-col.p1 .pname, .podium-col.p1 .pscore, .podium-col.p1 .avatar { animation-delay: 1.5s; }
.podium-col.p2 .pname, .podium-col.p2 .pscore, .podium-col.p2 .avatar { animation-delay: 1.1s; }
.podium-col.p3 .pname, .podium-col.p3 .pscore, .podium-col.p3 .avatar { animation-delay: .8s; }
.podium-col .avatar { width: 48px; height: 48px; font-size: 20px; }
.podium-block {
  width: 100%;
  border-radius: 12px 12px 4px 4px;
  display: grid;
  place-items: center;
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(180deg, var(--tile-top), var(--tile-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--shadow);
  transform-origin: bottom;
  animation: grow .9s var(--spring) both;
}
.podium-col.p1 .podium-block { height: 200px; background: linear-gradient(180deg, #ffe07a, var(--gold-2)); color: #2a1d00; animation-delay: .9s; }
.podium-col.p2 .podium-block { height: 150px; animation-delay: .5s; }
.podium-col.p3 .podium-block { height: 110px; animation-delay: .2s; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.rest-list { max-width: 420px; margin: 0 auto; text-align: left; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; }
@media (max-width: 1100px) { .admin-grid { grid-template-columns: 1fr; } }
.control-panel .qtext { font-size: 20px; margin: 10px 0; text-align: left; }
.control-panel .admin-answer { background: rgba(34, 211, 122, .12); border: 1px solid rgba(34, 211, 122, .55); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.control-panel img, .control-panel canvas { max-width: 100%; max-height: 220px; border-radius: 10px; }
.control-panel.enter { animation: rise .35s var(--ease) both; }
.control-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.answering-box { background: linear-gradient(90deg, #ffe07a, var(--gold-2)); color: #2a1d00; border-radius: 12px; padding: 12px; font-size: 22px; font-weight: 700; text-align: center; margin: 10px 0; }
.enter .answering-box { animation: pop .45s var(--spring) both; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
table.list tr:hover td { background: rgba(255, 255, 255, .02); }
.player-admin { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.player-admin .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.player-admin input { width: 84px; padding: 6px 8px; }
.player-admin.chooser .name { color: var(--gold); }
.settings-form .row > div { min-width: 110px; }

.award-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.award-row .name { flex: 1; font-weight: 600; }
.award-row .btn.on.plus { background: linear-gradient(180deg, #4be394, #16b865); color: #032813; border-color: transparent; }
.award-row .btn.on.zero { border-color: var(--gold); }
.award-row .btn.on.minus { background: linear-gradient(180deg, #ff7280, #e5334a); color: #2d0308; border-color: transparent; }

/* board editor */
.editor-cats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.editor-cat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; backdrop-filter: blur(10px); }
.editor-q { background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 10px; }
.editor-q.estimate { border-color: rgba(247, 165, 49, .6); }
.editor-q .row input[type=number] { width: 90px; }
.editor-q img { max-width: 100%; max-height: 120px; border-radius: 8px; margin-top: 6px; display: block; }

/* image reveal */
.reveal-box { display: inline-block; overflow: hidden; border-radius: 12px; margin-bottom: 14px; max-width: 100%; line-height: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.reveal-box .qimg { margin-bottom: 0 !important; display: block; box-shadow: none !important; }
.reveal-box canvas.qimg { width: auto; height: auto; max-width: 100%; max-height: 45vh; }
.reveal-box.zoom img { will-change: transform; }
.control-panel .reveal-box canvas, .control-panel .reveal-box img { max-width: 100%; max-height: 220px; }
.focus-pick { position: relative; display: inline-block; cursor: crosshair; margin-top: 6px; }
.focus-pick img { margin-top: 0 !important; }
.focus-pick .marker { position: absolute; width: 16px; height: 16px; border: 3px solid var(--gold); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #000; pointer-events: none; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  padding: 11px 20px;
  border-radius: 12px;
  z-index: 50;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  animation: toastIn .35s var(--spring) both;
}
.toast.err { border-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0); } }

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

/* lobby / start screen */
.lobby { text-align: center; padding: 6vh 0 40px; }
.lobby-hero.enter > * { animation: rise .6s var(--ease) both; }
.lobby-hero.enter > *:nth-child(2) { animation-delay: .12s; }
.lobby-hero.enter > *:nth-child(3) { animation-delay: .24s; }
.lobby-logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(64px, 12vw, 150px);
  letter-spacing: .05em;
  line-height: 1;
  background: linear-gradient(100deg, #ffe58a 0%, var(--gold) 40%, #fff6cf 50%, var(--gold) 60%, var(--gold-2) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .5)) drop-shadow(0 0 40px rgba(255, 210, 63, .25));
  animation: shine 6s linear infinite, float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.lobby-title { font-family: 'Oswald', sans-serif; font-size: clamp(22px, 3vw, 34px); margin: 18px 0 10px; }
.lobby-meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.lobby-meta .pill { font-size: 14px; padding: 5px 14px; }
.lobby-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; margin: 40px auto 14px; }
.lobby-player {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.lobby-player .avatar { width: 36px; height: 36px; font-size: 15px; }
.lobby-player.me { border-color: var(--gold); }
.lobby-player.offline { opacity: .45; }
.lobby-player.new { animation: pop .55s var(--spring) both; animation-delay: calc(var(--i) * 70ms); }
.lobby-player:not(.new) { animation: bob 3s ease-in-out infinite; animation-delay: calc(var(--i) * -400ms); }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* text answer mode */
.answer-form input { font-size: 20px; text-align: left; }
.typed-answer { display: inline-flex; align-items: center; gap: 12px; margin: 16px 0; padding: 12px 22px 12px 12px; border-radius: 18px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 210, 63, .5); text-align: left; }
.typed-answer .avatar { width: 42px; height: 42px; font-size: 17px; }
.typed-text { font-family: 'Oswald', sans-serif; font-size: 28px; color: var(--gold); }
.attempts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.attempt { padding: 4px 12px; border-radius: 99px; font-size: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.attempt.ok { border-color: var(--green); color: #aaf5cc; }
.attempt.bad { border-color: var(--red); color: #ffc0c6; }
.score-adjust { display: flex; align-items: center; gap: 4px; }
.score-adjust .val { min-width: 54px; text-align: center; font-family: 'Oswald', sans-serif; font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }
.score-adjust .val.neg { color: var(--red); }

.player-admin { flex-wrap: wrap; }
.player-admin .name { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.pa-controls { display: flex; align-items: center; gap: 6px; width: 100%; justify-content: flex-end; }
.pa-controls .score-adjust { margin-right: auto; }

/* estimate surprise on the intro card */
.surprise-stamp {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 26px;
  border-radius: 14px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: .06em;
  color: #2a1d00;
  background: linear-gradient(180deg, #ffe07a, var(--gold-2));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 40px rgba(255, 210, 63, .5);
  transform: rotate(-4deg);
  animation: stamp .7s var(--spring) .6s both;
}
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-4deg) scale(2.4); }
  60% { opacity: 1; transform: rotate(-4deg) scale(.92); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}

/* ---------- admin: big question control ---------- */
.control-panel { margin-bottom: 16px; }
.cp-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; }
.cp-status b { font-family: 'Oswald', sans-serif; font-size: 20px; }
.control-panel.big { padding: 24px 26px; border-color: var(--line-strong); }
.cp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cp-cat { font-family: 'Oswald', sans-serif; font-size: 22px; text-transform: uppercase; letter-spacing: .05em; }
.cp-pts { font-family: 'Oswald', sans-serif; font-size: 26px; color: var(--gold); font-weight: 700; }
.cp-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
@media (max-width: 900px) { .cp-grid { grid-template-columns: 1fr; } }
.cp-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.cp-question { background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.cp-qtext { font-family: 'Oswald', sans-serif; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.3; white-space: pre-wrap; margin-bottom: 10px; }
.cp-question img, .cp-question canvas { max-height: 260px !important; }
.cp-solution { background: rgba(34, 211, 122, .12); border: 2px solid rgba(34, 211, 122, .6); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; }
.cp-answer { font-family: 'Oswald', sans-serif; font-size: clamp(26px, 2.8vw, 40px); color: #b6f7d2; line-height: 1.2; margin-bottom: 6px; }
.cp-live { margin: 20px 0 6px; text-align: center; }
.cp-live .timer { max-width: 100%; }
.cp-hint { font-size: 18px; color: var(--muted); }
.cp-who { display: inline-flex; align-items: center; gap: 12px; font-family: 'Oswald', sans-serif; font-size: 34px; font-weight: 700; color: var(--gold); }
.cp-who .avatar { width: 48px; height: 48px; font-size: 20px; }
.enter .cp-who { animation: pop .45s var(--spring) both; }
.cp-typed { font-family: 'Oswald', sans-serif; font-size: clamp(30px, 3.5vw, 52px); margin: 8px 0; }
.cp-typed:not(.muted) { color: #fff; text-shadow: 0 0 30px rgba(255, 210, 63, .35); }
.cp-wrong { font-size: 24px; font-weight: 700; color: var(--red); }
.cp-estimates { font-size: 18px; max-width: 100%; }
.control-panel .control-actions { justify-content: center; margin-top: 18px; }
.btn.huge { padding: 18px 40px; font-size: 22px; border-radius: 14px; min-width: 200px; }
.btn kbd, .cp-live kbd { font-family: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .25); margin-left: 6px; opacity: .8; }
.control-panel .buzz-list { margin: 14px auto 0; }
.control-panel .award-row { max-width: 560px; margin: 0 auto; text-align: left; }
.control-panel.big .qtext { display: none; }
