:root {
  color-scheme: dark;
  --bg: #050611;
  --panel: rgba(15, 18, 42, .78);
  --panel-2: #171b3f;
  --line: rgba(155, 139, 255, .20);
  --line-hot: rgba(103, 232, 249, .48);
  --text: #f7f7ff;
  --muted: #9298bd;
  --gold: #ffd45c;
  --gold-2: #ff9d1c;
  --cyan: #50e6ff;
  --purple: #9b7bff;
  --pink: #ff5db1;
  --green: #36e6a1;
  --red: #ff5775;
  --shadow: 0 32px 100px rgba(0, 0, 0, .55);
  --glow: 0 0 35px rgba(80, 230, 255, .13);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 24px; height: 24px; }
.icon.gold { color: var(--gold); }
.btn .icon, .nav .icon { margin-right: 7px; }
.balance .icon { margin-right: 5px; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 13% 12%, rgba(73, 70, 220, .28), transparent 32rem),
    radial-gradient(circle at 88% 82%, rgba(179, 55, 211, .20), transparent 35rem),
    radial-gradient(circle at 50% 50%, rgba(23, 112, 180, .09), transparent 45rem),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .075;
  background-image:
    linear-gradient(rgba(124, 144, 255, .24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 144, 255, .24) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

#app { position: relative; min-height: 100vh; isolation: isolate; }
#app::before,
#app::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .13;
  pointer-events: none;
  animation: float-orb 14s ease-in-out infinite alternate;
}
#app::before { left: -180px; top: 24%; background: var(--cyan); }
#app::after { right: -170px; top: 8%; background: var(--pink); animation-delay: -5s; }
@keyframes float-orb {
  to { transform: translate3d(45px, 75px, 0) scale(1.18); }
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); }

.splash, .auth-wrap {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  position: relative;
  border: 1px solid rgba(255, 212, 92, .72);
  border-radius: 50%;
  color: var(--gold);
  font: 800 38px Georgia, serif;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.14), transparent 35%), rgba(255, 198, 60, .05);
  box-shadow: 0 0 45px rgba(255, 204, 85, .22), inset 0 0 25px rgba(255, 204, 85, .09);
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(255, 212, 92, .14);
  border-radius: inherit;
  animation: logo-pulse 2.7s ease-out infinite;
}
@keyframes logo-pulse {
  70%, 100% { opacity: 0; transform: scale(1.16); }
}
.splash h1 { margin: 0; letter-spacing: -.03em; }
.splash p { color: var(--muted); }

.auth-card {
  width: min(430px, 94vw);
  padding: 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(139, 130, 255, .28);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(25, 30, 70, .9), rgba(10, 13, 34, .88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 15% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 22px var(--cyan);
}
.auth-card h1 { margin: 0 0 8px; }
.auth-card > p { margin: 0 0 25px; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; padding: 5px; background: #0b1127; border-radius: 12px; }
.tab { flex: 1; border: 0; border-radius: 9px; padding: 9px; color: var(--muted); background: transparent; }
.tab.active { color: var(--text); background: var(--panel-2); }

.auth-wrap { position: relative; width: 100%; }
.auth-card { z-index: 2; }
.auth-live {
  position: absolute;
  top: 50%;
  width: 260px;
  padding: 20px;
  border: 1px solid rgba(139, 130, 255, .2);
  border-radius: 22px;
  text-align: left;
  background: linear-gradient(145deg, rgba(19, 23, 55, .78), rgba(8, 11, 29, .72));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .36), inset 0 1px rgba(255,255,255,.03);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
}
.auth-live-left { left: calc(50% - 503px); }
.auth-live-right { right: calc(50% - 503px); }
.auth-live-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #dfe2ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 13px var(--green);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse {
  50% { opacity: .35; transform: scale(.78); }
}
.auth-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.auth-stat {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(139, 130, 255, .12);
  border-radius: 14px;
  background: rgba(7, 10, 29, .52);
}
.auth-stat > span { display: block; height: 20px; color: var(--cyan); }
.auth-stat strong { display: block; margin: 5px 0 2px; color: white; font-size: 20px; }
.auth-stat small, .auth-jackpot small, .latest-winner small { color: var(--muted); font-size: 11px; }
.auth-jackpot {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 212, 92, .18);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 184, 41, .08), rgba(255, 157, 28, .02));
}
.auth-jackpot .icon { width: 25px; height: 25px; }
.auth-jackpot small, .auth-jackpot strong { display: block; }
.auth-jackpot strong { margin-top: 2px; color: var(--gold); font-size: 14px; }
.auth-leaders { display: grid; gap: 7px; }
.auth-leader {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 6px 9px;
  border-radius: 11px;
  background: rgba(7, 10, 29, .5);
}
.auth-leader b {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(139, 123, 255, .12);
  font-size: 11px;
}
.auth-leader:first-child b { color: #201600; background: linear-gradient(135deg, var(--gold), var(--gold-2)); }
.auth-leader span { overflow: hidden; color: #dfe2ff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.auth-leader strong { color: var(--gold); font-size: 12px; }
.latest-winner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(54, 230, 161, .16);
  border-radius: 14px;
  background: rgba(54, 230, 161, .055);
}
.latest-winner-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--gold);
  background: rgba(255, 212, 92, .1);
}
.latest-winner small, .latest-winner strong { display: block; }
.latest-winner strong { margin-top: 3px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.latest-winner > div { min-width: 0; }
.auth-updated {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}
.auth-updated .live-dot { width: 5px; height: 5px; }
.auth-live-empty { padding: 18px 0; color: var(--muted); text-align: center; font-size: 12px; }

.shell { width: 100%; min-height: 100vh; padding-bottom: 50px; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  width: 100%;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(125, 116, 235, .20);
  background:
    linear-gradient(90deg, rgba(20, 20, 57, .96), rgba(7, 10, 27, .94) 45%, rgba(20, 13, 48, .96));
  box-shadow: 0 12px 45px rgba(0, 0, 0, .28);
  backdrop-filter: blur(26px) saturate(150%);
}
.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 4%, var(--purple) 27%, var(--cyan) 50%, var(--pink) 73%, transparent 96%);
  opacity: .34;
  box-shadow: 0 0 15px rgba(80, 230, 255, .28);
}
.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}
.brand .logo-mark { width: 44px; height: 44px; margin: 0; font-size: 21px; }
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(139, 129, 255, .10);
  border-radius: 14px;
  background: rgba(2, 5, 20, .30);
}
.nav button {
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  position: relative;
  color: var(--muted);
  background: transparent;
}
.nav button::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 3px;
  left: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  opacity: 0;
  transform: scaleX(.3);
  transition: .2s;
}
.nav button:hover, .nav button.active, .nav a:hover {
  color: var(--text);
  background: linear-gradient(135deg, rgba(122, 104, 255, .16), rgba(80, 230, 255, .07));
}
.nav a {
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
}
.nav button.active::after { opacity: 1; transform: scaleX(1); }
.balance {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(255, 207, 78, .16);
  border-radius: 12px;
  white-space: nowrap;
  color: var(--gold);
  font-weight: 900;
  background: linear-gradient(135deg, rgba(255, 197, 45, .10), rgba(255, 142, 30, .035));
  text-shadow: 0 0 20px rgba(255, 195, 45, .24);
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #c6cbea;
  white-space: nowrap;
  background: rgba(255,255,255,.035);
}

.content {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 36px;
}
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h2 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -.045em;
  background: linear-gradient(110deg, #fff 25%, #c9ceff 70%, #77eaff);
  -webkit-background-clip: text;
  color: transparent;
}
h3 { margin: 0 0 16px; }
.muted { color: var(--muted); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; }
.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), transparent 45%),
    var(--panel);
  box-shadow: 0 18px 55px rgba(0,0,0,.22), var(--glow);
  backdrop-filter: blur(16px);
}
.panel-pad { padding: 24px; }
.room-list { display: grid; gap: 12px; }
.room {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(110deg, rgba(79, 64, 170, .11), rgba(255,255,255,.018));
  transition: border-color .2s, transform .2s, background .2s;
}
.room::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--purple), var(--cyan));
  opacity: .7;
}
.room:hover {
  border-color: var(--line-hot);
  background: linear-gradient(110deg, rgba(79, 64, 170, .18), rgba(80,230,255,.035));
  transform: translateY(-2px);
}
.room-name { font-weight: 800; }
.room-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
.metric { min-width: 80px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metric strong { display: block; margin-top: 3px; color: var(--text); font-size: 15px; text-transform: none; }

.form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; text-align: left; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(5, 8, 27, .75);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(88, 215, 255, .1); }
.btn {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  color: #11162b;
  font-weight: 800;
  background: linear-gradient(135deg, #ffe074, var(--gold-2));
  box-shadow: 0 8px 26px rgba(255, 158, 28, .20);
  transition: .18s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.32), transparent 70%);
  transform: translateX(-130%);
  transition: transform .5s;
}
.btn:hover::after { transform: translateX(130%); }
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 11px 32px rgba(255, 158, 28, .28); }
.btn.secondary { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.06); }
.btn.danger { color: white; background: #b83049; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }

.waiting { max-width: 720px; margin: 30px auto; text-align: center; }
.waiting-ring {
  width: 100px; height: 100px; margin: 22px auto;
  border: 5px solid rgba(255,255,255,.08);
  border-top-color: var(--cyan);
  border-right-color: var(--purple);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(80, 230, 255, .16);
  animation: spin 1.3s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 20px 0; }
.chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.04); }

.game-wrap {
  display: grid;
  grid-template-columns: 245px minmax(0, 900px);
  align-items: start;
  gap: 22px;
  max-width: 1167px;
  margin: 0 auto;
  padding-top: 30px;
}
.game-stage { min-width: 0; }
.game-players {
  position: sticky;
  top: 106px;
  overflow: hidden;
  padding: 18px;
}
.game-players-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.game-players-head .eyebrow { font-size: 9px; }
.game-players-head h3 { display: flex; align-items: center; gap: 6px; margin: 5px 0 0; font-size: 16px; }
.game-players-head > strong {
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--green);
  background: rgba(54, 230, 161, .09);
  font-size: 12px;
}
.game-player-list { display: grid; gap: 7px; margin-top: 13px; }
.game-player {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 7px;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid rgba(54, 230, 161, .1);
  border-radius: 12px;
  background: rgba(54, 230, 161, .045);
  transition: opacity .25s, background .25s, border-color .25s;
}
.game-player-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--cyan);
  background: rgba(80, 230, 255, .09);
}
.game-player > div { min-width: 0; }
.game-player strong, .game-player span { display: block; }
.game-player strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.game-player strong small {
  display: inline;
  margin-left: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--gold);
  background: rgba(255, 212, 92, .1);
  font-size: 8px;
  text-transform: uppercase;
}
.game-player > div > span { margin-top: 3px; color: var(--green); font-size: 10px; }
.game-player > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}
.game-player.out { opacity: .48; border-color: rgba(255, 87, 117, .12); background: rgba(255, 87, 117, .035); }
.game-player.out .game-player-avatar { color: var(--muted); background: rgba(255,255,255,.05); }
.game-player.out > div > span { color: var(--muted); }
.game-player.out > i { background: var(--red); box-shadow: none; }
.game-player.thinking > i { background: var(--gold); box-shadow: 0 0 9px var(--gold); }
.game-player.answered { border-color: rgba(88, 215, 255, .28); }
.game-player.answered > div > span { color: var(--cyan); }
.game-player.answered > i { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.game-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.bank { color: var(--gold); font-weight: 900; font-size: 24px; }
.timer {
  position: relative;
  overflow: hidden;
  height: 9px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 5px rgba(0,0,0,.5);
}
.timer > i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--gold));
  box-shadow: 0 0 18px var(--cyan);
  transform-origin: left;
}
.question {
  margin-top: 18px;
  padding: 30px;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.question-number { color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.question h2 { margin: 14px 0 26px; font-size: clamp(23px, 4vw, 35px); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer {
  position: relative;
  overflow: hidden;
  min-height: 64px;
  border: 1px solid rgba(116, 129, 255, .30);
  border-radius: 15px;
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
  background: linear-gradient(115deg, rgba(32, 39, 92, .76), rgba(13, 18, 49, .78));
  transition: .18s ease;
}
.answer::after {
  content: "";
  position: absolute;
  inset: auto 15% 0;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  opacity: 0;
  transition: .2s;
}
.answer b {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 11px;
  border: 1px solid rgba(255, 212, 92, .42);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(255, 190, 30, .06);
}
.answer:hover:not(:disabled) {
  border-color: var(--cyan);
  background: linear-gradient(115deg, rgba(48, 61, 145, .82), rgba(15, 34, 73, .85));
  transform: translateY(-2px);
}
.answer:hover:not(:disabled)::after { opacity: 1; inset-inline: 5%; }
.answer.correct { border-color: var(--green); background: rgba(54, 230, 161, .16); }
.answer.wrong { border-color: var(--red); background: rgba(255, 87, 117, .14); }
.answer:disabled { cursor: default; opacity: 1; }
.answer:disabled:not(.selected):not(.correct):not(.wrong) { opacity: .46; }
.answer.selected,
.answer.selected:disabled {
  opacity: 1;
  border-color: var(--gold);
  background: linear-gradient(115deg, rgba(115,78,17,.72), rgba(59,43,23,.82));
  box-shadow: 0 0 0 1px rgba(255, 204, 85, .4), 0 0 28px rgba(255, 204, 85, .18);
}
.answer.selected::after {
  opacity: 1;
  inset-inline: 8%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.answer.selected b {
  color: #1a1404;
  background: var(--gold);
  border-color: var(--gold);
}
.answer-pick {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.survivors { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.survivor { padding: 6px 10px; border-radius: 8px; background: rgba(62,213,152,.1); color: var(--green); font-size: 13px; }
.survivor.out { color: var(--muted); background: rgba(255,255,255,.04); text-decoration: line-through; }
.badge-section { margin-bottom: 22px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.achievement {
  display: grid;
  gap: 4px;
  min-height: 132px;
  padding: 12px;
  border: 1px solid rgba(255, 212, 92, .35);
  border-radius: 14px;
  background: rgba(255, 212, 92, .06);
}
.achievement b { font-size: 28px; line-height: 1; }
.achievement strong { font-size: 14px; }
.achievement small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.achievement em { color: var(--gold); font-style: normal; font-size: 11px; }
.achievement .meter { display: block; overflow: hidden; height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); }
.achievement .meter i { display: block; height: 100%; background: var(--gold); }
.achievement.locked { opacity: .48; filter: grayscale(1); border-color: var(--line); background: rgba(255,255,255,.03); }
.achievement.locked em, .achievement.locked .meter i { color: var(--muted); background: var(--muted); }
.code-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.code-form input {
  flex: 1;
  min-width: 0;
  width: auto;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.code-form .btn { flex: none; white-space: nowrap; }
.invite-card { margin-bottom: 16px; }
.invite-card .code-form { margin-bottom: 0; }
.invite-card input { letter-spacing: 0; text-transform: none; }
.category-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.category-picks label, .checkline {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
}
.category-picks input, .checkline input { width: auto; padding: 0; }
.room-code { letter-spacing: .14em; font-size: 18px; }
.room-code strong { color: var(--gold); }
.result-actions { display: grid; gap: 10px; justify-items: center; margin-top: 18px; }
.training { max-width: 820px; margin: 0 auto; }
.training .question { margin-top: 18px; border: 0; background: transparent; box-shadow: none; }
.result { max-width: 620px; margin: 55px auto; padding: 40px; text-align: center; }
.result .trophy { font-size: 70px; }
.result {
  position: relative;
  overflow: hidden;
}
.result::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  left: calc(50% - 120px);
  top: -120px;
  border-radius: 50%;
  background: var(--gold);
  filter: blur(90px);
  opacity: .12;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(119, 107, 255, .055); }
tbody tr:nth-child(1) > td:first-child { color: var(--gold); }
tbody tr:nth-child(2) > td:first-child { color: #c9d3ea; }
tbody tr:nth-child(3) > td:first-child { color: #d78e5b; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.07); font-size: 12px; }
.badge.ok { color: var(--green); background: rgba(62,213,152,.1); }
.badge.bad { color: var(--red); background: rgba(255,100,124,.1); }
.admin-grid { display: grid; gap: 22px; }
.answer-editor { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.answer-editor input[type=radio] { width: auto; }
.empty { padding: 45px 20px; color: var(--muted); text-align: center; }
.connection {
  position: fixed;
  z-index: 30;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(10, 13, 35, .86);
  box-shadow: 0 8px 25px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  font-size: 11px;
}
.connection.live { color: var(--green); }
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 28px;
  max-width: min(520px, 90vw); padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 11px;
  color: white; background: #1b2547; box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #7d2435; }

@media (max-width: 1000px) {
  .auth-live { display: none; }
  .game-wrap { grid-template-columns: 1fr; max-width: 900px; }
  .game-players { position: static; }
  .game-player-list { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

@media (max-width: 820px) {
  .shell { width: 100%; }
  .content { width: min(100% - 20px, 720px); padding-top: 24px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 11px 10px; }
  .brand { width: auto; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .user-pill { display: none; }
  .grid { grid-template-columns: 1fr; }
  .room { grid-template-columns: 1fr 1fr; }
  .room > :first-child { grid-column: 1 / -1; }
  .answers { grid-template-columns: 1fr; }
  .page-head { align-items: start; flex-direction: column; }
}
