:root {
  --bg: #041219;
  --bg2: #071f29;
  --panel: rgba(10, 38, 49, 0.88);
  --panel2: rgba(15, 54, 66, 0.85);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #f1ad32;
  --gold-glow: rgba(241, 173, 50, 0.35);
  --teal: #35c4bf;
  --cyan: #38bdf8;
  --red: #f43f5e;
  --green: #10b981;
  --purple: #a855f7;
  --border: rgba(255,255,255,.12);
  --shadow: 0 20px 50px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(53,196,191,.15), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(241,173,50,.12), transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(56,189,248,.08), transparent 50%),
    linear-gradient(160deg, #030d12 0%, #071e28 50%, #030e15 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: .12;
  background-image: repeating-linear-gradient(112deg, transparent 0 20px, rgba(140,220,240,.12) 21px, transparent 22px 48px);
  transform: translateY(-8px);
}

a { color: var(--cyan); text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }

.shell { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 50px; position: relative; z-index: 1; }

/* Top Header */
.topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; flex-wrap: wrap; }
.brand { display:flex; align-items:center; gap:14px; }
.brand-mark { width:48px; height:48px; border:2px solid var(--gold); border-radius:50%; display:grid; place-items:center; color:var(--gold); font-weight:900; letter-spacing:-1px; box-shadow:0 0 28px rgba(241,173,50,.25); transition: transform .3s ease; flex-shrink: 0; background: rgba(241,173,50,.08); }
.brand:hover .brand-mark { transform: rotate(12deg) scale(1.06); }
.brand h1 { margin:0; font-size: clamp(22px, 3vw, 32px); line-height:1.05; font-weight:900; background: linear-gradient(135deg, #ffffff, #cbd5e1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand small { color:var(--muted); display:block; margin-top:3px; font-size: clamp(12px, 1.5vw, 13px); }

/* Badges & Kickers */
.kicker { text-transform:uppercase; letter-spacing:.14em; color:var(--gold); font-size:11px; font-weight:800; display: inline-flex; align-items: center; gap: 6px; }
.event-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(241,173,50,0.12); border: 1px solid rgba(241,173,50,0.3); color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

/* Cards & Layout */
.card { background: linear-gradient(180deg, rgba(14,48,60,.85), rgba(6,25,33,.9)); border:1px solid var(--glass-border); backdrop-filter: blur(16px); border-radius:24px; box-shadow:var(--shadow); padding: clamp(18px, 3vw, 26px); transition: transform .25s ease, box-shadow .25s ease; max-width: 100%; overflow: hidden; position: relative; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: 24px; padding: 1px; background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent 60%); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card h2, .card h3 { margin-top:4px; word-break: break-word; color: #fff; }

.grid-2 { display:grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .85fr); gap:20px; }
@media (max-width: 880px) { .grid-2 { grid-template-columns:1fr; } }

/* Section Cards Grid */
.section-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap:12px; }
.section-card { display:flex; gap:12px; padding:14px; background:rgba(255,255,255,.03); border:1px solid var(--glass-border); border-radius:16px; align-items:flex-start; transition: all .2s cubic-bezier(0.34, 1.56, 0.64, 1); cursor: pointer; position: relative; }
.section-card:hover { border-color:rgba(241,173,50,.5); transform:translateY(-2px); background:rgba(255,255,255,.06); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.section-card input { margin-top:2px; width:18px; height:18px; accent-color:var(--gold); cursor: pointer; flex-shrink: 0; }
.section-card .sec-num { font-size: 10px; font-weight: 800; color: var(--gold); opacity: 0.8; letter-spacing: 0.05em; display: block; margin-bottom: 2px; }
.section-card strong { display:block; font-size:13px; line-height: 1.3; color: #f1f5f9; }
.section-card span { color:var(--muted); font-size:11px; margin-top: 2px; display: block; }

/* Settings Inputs & Switches */
.settings-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap:14px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field label { font-size:12px; color:var(--muted); font-weight:700; letter-spacing:.02em; }
.input, select.input { width:100%; padding:12px 14px; border-radius:12px; border:1px solid var(--glass-border); background:rgba(3,17,24,0.8); color:var(--text); outline:none; transition: border-color .2s ease, box-shadow .2s ease; }
.input:focus { border-color:var(--teal); box-shadow:0 0 0 3px rgba(53,196,191,.18); }

.toggle { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; border-radius:12px; border:1px solid var(--glass-border); background:rgba(255,255,255,.025); transition: background .2s ease; }
.toggle:hover { background:rgba(255,255,255,.05); }
.toggle input { width:20px; height:20px; accent-color:var(--gold); cursor: pointer; flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 14px;
  color: #031219;
  background: linear-gradient(135deg, #f5bc54, #f1ad32);
  box-shadow: 0 8px 24px var(--gold-glow);
  transition: transform .18s cubic-bezier(0.34, 1.56, 0.64, 1), filter .15s ease, box-shadow .15s ease;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(241,173,50,.35); }
.btn:active { transform: scale(0.96); }
.btn.secondary { background: linear-gradient(135deg, #4bd5d0, #35c4bf); color: #031219; box-shadow: 0 8px 24px rgba(53,196,191,.25); }
.btn.ghost { background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--glass-border); box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.3); }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #e11d48); color: white; box-shadow: 0 8px 24px rgba(244,63,94,.3); }
.btn.wide { width: 100%; }

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

@media (max-width: 639px) {
  .btn-responsive .btn-text { display: none; }
  .btn-responsive { padding: 11px; }
}

.actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.note { color:var(--muted); font-size:12px; line-height:1.5; }
.error { color:#fca5a5; background:rgba(239,68,68,.15); border:1px solid rgba(239,68,68,.3); padding:10px 14px; border-radius:12px; display:none; margin-top:10px; animation: slideUpFade .25s ease; word-break: break-word; }
.success { color:#6ee7b7; background:rgba(16,185,129,.15); border:1px solid rgba(16,185,129,.3); padding:10px 14px; border-radius:12px; }

/* Host Lobby */
.lobby-grid { display:grid; grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); gap:20px; align-items: stretch; }
@media (max-width: 800px) { .lobby-grid { grid-template-columns:1fr; } }

/* PIN Box - Card styling */
.pin-badge-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 18px; padding: 14px; margin: 12px 0; }
.pin {
  font-size: clamp(34px, 5.5vw, 56px);
  letter-spacing: .08em;
  color: var(--gold);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 35px var(--gold-glow);
  animation: popIn .4s cubic-bezier(0.34, 1.56, 0.64, 1);
  word-break: break-all;
  max-width: 100%;
}

.join-url-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); font-size: 12px; color: var(--muted); max-width: 100%; word-break: break-all; }

.qr-wrap {
  background: white;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  border-radius: 16px;
  margin: 12px auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  transition: transform .3s ease;
}
.qr-wrap:hover { transform: scale(1.03); }
.qr-wrap img { width:100%; height:100%; object-fit:contain; }

.player-count-badge { display:inline-flex; align-items:center; gap:10px; padding: 8px 16px; border-radius: 999px; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); font-size: clamp(18px, 3.5vw, 24px); font-weight:900; color: #fff; }
.pulse { width:12px; height:12px; border-radius:50%; background:var(--green); box-shadow:0 0 0 0 rgba(16,185,129,.7); animation:pulse 1.8s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow:0 0 0 10px rgba(16,185,129,0); } 100% { box-shadow:0 0 0 0 rgba(16,185,129,0); } }

.player-chips { display:flex; flex-wrap:wrap; gap:8px; max-height:240px; overflow-y:auto; margin-top:16px; padding-right:4px; }
.chip { padding:7px 14px; border-radius:999px; background:rgba(255,255,255,.08); border:1px solid var(--glass-border); font-size:12px; font-weight: 700; animation: popIn .3s cubic-bezier(0.34, 1.56, 0.64, 1); transition: all .2s ease; word-break: break-word; }
.chip:hover { background: rgba(255,255,255,.16); transform: scale(1.05); }

/* Game Toolbar & Stats */
.game-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.stat-row { display:flex; flex-wrap:wrap; gap:10px; flex: 1 1 auto; }
.stat { background:rgba(255,255,255,.04); border:1px solid var(--glass-border); border-radius:14px; padding:10px 14px; flex: 1 1 100px; min-width: 95px; transition: background .2s ease; }
.stat:hover { background:rgba(255,255,255,.08); }
.stat b { display:block; font-size: clamp(18px, 2.5vw, 22px); word-break: break-all; color: #fff; }
.stat span { color:var(--muted); font-size:10px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }

.question-box { padding: clamp(18px, 3vw, 26px); border-radius:20px; background:rgba(3,17,24,.85); border:1px solid var(--glass-border); animation: slideUpFade .35s ease-out; }
.question-box h2 { font-size:clamp(22px, 3.8vw, 40px); line-height:1.15; margin:8px 0 20px; word-break: break-word; }

.option-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap:12px; }
.option { padding:16px; border-radius:16px; min-height:68px; border:2px solid transparent; background:rgba(255,255,255,.05); display:flex; align-items:center; gap:14px; font-weight:800; font-size: clamp(14px, 1.8vw, 17px); transition: transform .2s ease, border-color .2s ease, background .2s ease; animation: slideUpFade .35s ease-out both; word-break: break-word; }
.option .shape { flex:none; width:30px; height:30px; display:grid; place-items:center; border-radius:10px; color:white; font-size:14px; font-weight:900; }
.option:nth-child(1) .shape { background:#f43f5e; }
.option:nth-child(2) .shape { background:#38bdf8; }
.option:nth-child(3) .shape { background:#f5bc54; }
.option:nth-child(4) .shape { background:#10b981; }
.option.correct { border-color:var(--green); background:rgba(16,185,129,.2); animation: correctPulse .6s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 0 25px rgba(16,185,129,.25); }
.option.wrong { opacity:.35; filter: grayscale(60%); }

.timer { width:72px; height:72px; border-radius:50%; display:grid; place-items:center; font-size:26px; font-weight:950; border:5px solid var(--gold); color:var(--gold); background:rgba(0,0,0,.3); box-shadow: 0 0 25px var(--gold-glow); transition: all .2s ease; flex-shrink: 0; }
.timer.warning { border-color: var(--red); color: var(--red); box-shadow: 0 0 30px rgba(244,63,94,.5); animation: pulseTimer .6s infinite alternate; }

.progress { height:8px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden; }
.progress > div { height:100%; background:linear-gradient(90deg,var(--teal),var(--gold)); width:0%; transition:width .3s ease-out; }

/* Responsive Tables */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.leaderboard { width:100%; border-collapse:separate; border-spacing:0 7px; min-width: 320px; }
.leaderboard th { color:var(--muted); text-transform:uppercase; font-size:10px; letter-spacing:.1em; text-align:left; padding:0 10px 4px; }
.leaderboard td { background:rgba(255,255,255,.05); padding:10px 12px; font-size: 14px; transition: background .2s ease; word-break: break-word; }
.leaderboard tr { animation: slideUpFade .3s ease-out both; }
.leaderboard td:first-child { border-radius:12px 0 0 12px; width:48px; color:var(--gold); font-weight:900; }
.leaderboard td:last-child { border-radius:0 12px 12px 0; text-align:right; font-weight:900; width: 80px; }

/* Player Mobile Experience */
.player-shell { width:min(680px, calc(100% - 20px)); margin:0 auto; padding:14px 0 30px; position:relative; z-index:1; }
.player-card { margin-top:14px; animation: slideUpFade .35s ease-out; }
.join-hero { text-align:center; padding:20px 10px 8px; }
.join-hero h1 { margin:0; font-size:clamp(32px, 8vw, 52px); word-break: break-all; }

.player-option { width:100%; text-align:left; border:2px solid transparent; color:white; padding:18px; border-radius:18px; background:rgba(255,255,255,.06); margin-bottom:12px; font-weight:850; font-size: clamp(15px, 2vw, 18px); min-height:76px; transition: transform .15s ease, opacity .2s ease, outline .15s ease; animation: slideUpFade .35s ease-out both; word-break: break-word; }
.player-option:nth-child(1) { background:linear-gradient(135deg,#e11d48,#f43f5e); }
.player-option:nth-child(2) { background:linear-gradient(135deg,#0284c7,#38bdf8); }
.player-option:nth-child(3) { background:linear-gradient(135deg,#d97706,#f5bc54); }
.player-option:nth-child(4) { background:linear-gradient(135deg,#059669,#10b981); }
.player-option:active:not(:disabled) { transform: scale(0.96); }
.player-option.selected { outline:4px solid white; transform:scale(.985); box-shadow: 0 0 30px rgba(255,255,255,.4); }
.player-option.locked { opacity:.5; cursor: not-allowed; }

.center { text-align:center; }
.big-score { font-size: clamp(42px, 8vw, 60px); font-weight:950; color:var(--gold); animation: popIn .4s cubic-bezier(0.34, 1.56, 0.64, 1); text-shadow: 0 0 30px var(--gold-glow); }
.result-icon { width:80px; height:80px; border-radius:50%; display:grid; place-items:center; margin:0 auto 14px; font-size:40px; font-weight:900; animation: stampPop .5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.result-icon.ok { background:rgba(16,185,129,.2); color:var(--green); border:2px solid var(--green); box-shadow: 0 0 35px rgba(16,185,129,.35); }
.result-icon.no { background:rgba(244,63,94,.18); color:var(--red); border:2px solid var(--red); box-shadow: 0 0 35px rgba(244,63,94,.35); }

/* Projector 100-inch Display - High Elegance */
.screen-body { overflow:hidden; background: radial-gradient(circle at 50% 30%, rgba(56,189,248,.12), transparent 45%), radial-gradient(circle at 10% 80%, rgba(241,173,50,.12), transparent 40%), linear-gradient(160deg, #020a0e 0%, #061822 50%, #020a0e 100%); }
.screen-shell { height:100vh; max-height:100vh; overflow:hidden; padding: clamp(16px, 2.5vh, 28px) clamp(24px, 3.5vw, 40px); display:flex; flex-direction:column; position:relative; z-index:1; justify-content: space-between; }
.screen-header { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap: wrap; border-bottom: 1px solid var(--glass-border); padding-bottom: 14px; flex-shrink: 0; }
.screen-brand { font-size: clamp(18px, 2.2vw, 26px); font-weight:950; letter-spacing: 0.04em; background: linear-gradient(135deg, #ffffff, #cbd5e1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.screen-stage { flex:1; min-height: 0; display:flex; align-items:center; justify-content:center; width:100%; padding: 12px 0; }
.screen-lobby { display:grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 320px); gap: clamp(20px, 2.5vw, 36px); align-items:center; width:min(1040px,100%); margin:0 auto; animation: slideUpFade .4s ease; }
@media (max-width: 900px) { .screen-lobby { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

.screen-lobby-left { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(8px, 1.4vh, 14px); }
@media (max-width: 900px) { .screen-lobby-left { align-items: center; } }

.screen-lobby-title { font-size: clamp(40px, 5.5vw, 76px); margin: 0; line-height: 1.05; font-weight: 950; background: linear-gradient(135deg, #ffffff, #e2e8f0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.02em; }
.screen-lobby-sub { font-size: clamp(14px, 1.4vw, 19px); color: var(--muted); margin: 0; max-width: 520px; line-height: 1.35; }

.screen-pin-card { display: flex; flex-direction: column; gap: 2px; padding: clamp(10px, 1.4vh, 14px) clamp(20px, 2vw, 28px); background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 18px; box-shadow: 0 12px 35px rgba(0,0,0,0.35); width: fit-content; min-width: 280px; max-width: 100%; }
.screen-pin-card .pin { font-size: clamp(38px, 5vw, 68px); margin: 0; text-shadow: 0 0 40px var(--gold-glow); white-space: nowrap; letter-spacing: 0.08em; }

.screen-qr-card { background: linear-gradient(180deg, rgba(14,48,60,.9), rgba(6,25,33,.95)); border: 1px solid var(--glass-border); backdrop-filter: blur(20px); border-radius: 24px; padding: clamp(16px, 2.2vh, 22px); display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 25px 60px rgba(0,0,0,0.5); width: 100%; }
.screen-qr-card .qr-wrap { width: 100%; max-width: min(270px, 32vh); aspect-ratio: 1; border-radius: 16px; margin: 0; padding: 14px; box-shadow: 0 15px 40px rgba(0,0,0,.5); }

.screen-question { width:min(1180px,100%); animation: slideUpFade .4s ease; }
.screen-question h1 { font-size:clamp(30px, 4.2vw, 64px); line-height:1.08; margin:8px 0 20px; text-align:center; word-break: break-word; color: #fff; }
.screen-question .option { min-height:88px; font-size:clamp(18px, 2.1vw, 30px); padding: 18px; border-radius: 18px; }

.screen-footer { display:flex; justify-content:space-between; align-items:center; gap:16px; color:var(--muted); font-weight:700; flex-wrap: wrap; font-size: clamp(13px, 1.5vw, 16px); border-top: 1px solid var(--glass-border); padding-top: 14px; flex-shrink: 0; }

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: clamp(14px, 2vw, 28px);
  width: min(860px, 100%);
  margin: 16px auto 24px;
}
@media (max-width: 600px) {
  .podium { grid-template-columns: 1fr; align-items: stretch; }
}

.podium .place {
  text-align: center;
  border-radius: 22px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  backdrop-filter: blur(16px);
  animation: podiumRise 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.podium .place-2 {
  order: 1;
  min-height: 195px;
  animation-delay: 0.1s;
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.18), rgba(6, 25, 33, 0.95));
  border: 1px solid rgba(203, 213, 225, 0.4);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.podium .place-1 {
  order: 2;
  min-height: 260px;
  animation-delay: 0.3s;
  background: linear-gradient(180deg, rgba(245, 188, 84, 0.28), rgba(6, 25, 33, 0.95));
  border: 2px solid rgba(245, 188, 84, 0.85);
  box-shadow: 0 0 60px rgba(245, 188, 84, 0.4), 0 20px 45px rgba(0,0,0,0.6);
  transform: scale(1.04);
  z-index: 2;
}

.podium .place-3 {
  order: 3;
  min-height: 165px;
  animation-delay: 0.2s;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.18), rgba(6, 25, 33, 0.95));
  border: 1px solid rgba(217, 119, 6, 0.4);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

@media (max-width: 600px) {
  .podium .place-1, .podium .place-2, .podium .place-3 {
    order: unset;
    min-height: auto;
    transform: none;
  }
}

.podium .place.empty {
  opacity: 0.4;
  border-style: dashed;
  background: rgba(255,255,255,0.02);
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: 10px;
  margin-bottom: 6px;
}

.crown-cap {
  position: absolute;
  top: -18px;
  left: -8px;
  width: 56px;
  height: auto;
  transform: rotate(-22deg);
  z-index: 10;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
  animation: crownWiggle 2.5s infinite ease-in-out alternate;
  pointer-events: none;
}
@keyframes crownWiggle {
  0% { transform: rotate(-22deg) translateY(0) scale(1); }
  100% { transform: rotate(-17deg) translateY(-2px) scale(1.02); }
}

.avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.3);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 950;
  color: white;
  margin: 0 auto;
}
.place-1 .avatar-circle {
  width: 86px;
  height: 86px;
  font-size: 36px;
  background: linear-gradient(135deg, #f5bc54, #d97706);
  border: 3px solid #ffffff;
  color: #000;
  box-shadow: 0 0 35px rgba(245, 188, 84, 0.7);
}

.rank-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
  min-height: 40px;
}
.rank-asset {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.place-1 .rank-asset {
  height: 52px;
}
.medal-svg {
  width: 20px;
  height: 20px;
  margin-right: 4px;
  flex-shrink: 0;
}
.inline-flex {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fallback-rank-badge {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.podium .name {
  font-size: 18px;
  font-weight: 900;
  word-break: break-word;
  color: white;
}
.place-1 .name {
  font-size: 22px;
  color: #ffffff;
  text-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.podium .batch {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}

.score-pill {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  font-weight: 900;
  font-size: 13px;
  color: var(--gold);
}
.place-1 .score-pill {
  background: var(--gold);
  color: #000;
  font-size: 15px;
  box-shadow: 0 0 20px rgba(245, 188, 84, 0.4);
}

.hidden { display:none !important; }
.mini { font-size:11px; color:var(--muted); }
hr.sep { border:0; border-top:1px solid var(--glass-border); margin:18px 0; }

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.05s !important; }
.stagger-2 { animation-delay: 0.12s !important; }
.stagger-3 { animation-delay: 0.19s !important; }
.stagger-4 { animation-delay: 0.26s !important; }
.stagger-5 { animation-delay: 0.33s !important; }

/* Keyframe Animations */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.7); }
  70% { opacity: 1; transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes stampPop {
  0% { opacity: 0; transform: scale(0.3) rotate(-15deg); }
  60% { opacity: 1; transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes podiumRise {
  from { opacity: 0; transform: translateY(60px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); background: rgba(16,185,129,.35); }
  100% { transform: scale(1); }
}

@keyframes pulseTimer {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.toast {
  background: rgba(7, 30, 40, 0.95);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  backdrop-filter: blur(14px);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.35s ease forwards 3.2s;
  pointer-events: auto;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
