/* 🦖 Arcade UI – gemeinsamer Neon/Glass-Look für alle Spiele im Rex Arcade Hub (Gold als Markenfarbe) */

:root {
    --bg: #0b0b1a;
    --bg-2: #13132b;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.1);
    --stroke: rgba(255, 255, 255, 0.12);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --gold: #ffd23f;
    --orange: #ff8a3d;
    --pink: #ff4d8d;
    --cyan: #3de0ff;
    --green: #3dffa2;
    --red: #ff4d6d;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(ellipse at top, #1a1640 0%, var(--bg) 60%); }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.45; animation: float 22s ease-in-out infinite alternate; }
.b1 { width: 480px; height: 480px; background: #6d28d9; top: -120px; left: -120px; }
.b2 { width: 420px; height: 420px; background: #db2777; bottom: -140px; right: -100px; animation-duration: 26s; }
.b3 { width: 360px; height: 360px; background: #f59e0b; top: 40%; left: 55%; opacity: 0.2; animation-duration: 30s; }
.grid-overlay {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
@keyframes float { to { transform: translate(80px, 60px) scale(1.15); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; backdrop-filter: blur(12px); background: rgba(11, 11, 26, 0.55); border-bottom: 1px solid var(--stroke); }
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand span { color: var(--gold); }
.brand-mark { filter: drop-shadow(0 0 8px rgba(255, 210, 63, 0.6)); }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--glass); border: 1px solid var(--stroke); color: var(--text); text-decoration: none; cursor: pointer; font-size: 1.1rem; transition: background 0.2s, transform 0.15s; }
.icon-btn:hover { background: var(--glass-strong); transform: translateY(-1px); }
.pill { padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(255, 210, 63, 0.12); border: 1px solid rgba(255, 210, 63, 0.35); color: var(--gold); font-weight: 700; letter-spacing: 0.12em; font-size: 0.85rem; }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 6rem; min-height: calc(100vh - 66px); display: flex; flex-direction: column; }
.screen { display: none; flex: 1; flex-direction: column; justify-content: center; align-items: center; }
.screen.active { display: flex; animation: screenIn 0.35s cubic-bezier(.2,.8,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px) scale(0.99); } to { opacity: 1; transform: none; } }

.card { width: 100%; max-width: 480px; background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03)); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 1.75rem; backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.card-wide { max-width: 680px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
h2 { font-size: 1.5rem; font-weight: 800; }
.section-label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 0.6rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.4rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s; user-select: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #1a1000; box-shadow: 0 8px 24px rgba(255, 138, 61, 0.35), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(255, 138, 61, 0.5), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn-primary.changed { background: linear-gradient(135deg, var(--cyan), #6366f1); color: #fff; box-shadow: 0 8px 24px rgba(61, 224, 255, 0.3); }
.btn-ghost { background: var(--glass); border-color: var(--stroke); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-strong); }
.btn-lg { padding: 1rem 1.5rem; font-size: 1.05rem; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-block { width: 100%; margin-top: 0.6rem; }
.link-btn { background: none; border: none; color: var(--gold); cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Menu ---------- */
.hero { text-align: center; }
.hero-logo h1 { font-size: 3rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.hero-logo h1 span { background: linear-gradient(135deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-emoji { display: inline-block; font-size: 3.5rem; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(255, 77, 141, 0.5)); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.tagline { color: var(--muted); margin: 0.6rem 0 1.5rem; }
.player-chip { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem 0.5rem 0.5rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--stroke); cursor: pointer; margin-bottom: 1.5rem; transition: background 0.2s; font-size: 0.9rem; }
.player-chip:hover { background: var(--glass-strong); }
.chip-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 210, 63, 0.18); }
.chip-edit { color: var(--gold); }
.menu-actions { display: grid; gap: 0.75rem; }
.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.8rem; margin: 1.5rem 0 1rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }
.join-row { display: flex; gap: 0.5rem; }
.code-input { flex: 1; min-width: 0; padding: 0.8rem 1rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.3); border: 1px solid var(--stroke); text-align: center; font-weight: 800; font-size: 1.2rem; letter-spacing: 0.3em; text-transform: uppercase; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.code-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.15); }

/* ---------- Rooms ---------- */
.room-list { max-height: 420px; overflow-y: auto; margin-bottom: 0.5rem; display: grid; gap: 0.6rem; }
.room-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--stroke); cursor: pointer; transition: transform 0.15s, border-color 0.2s, background 0.2s; animation: screenIn 0.3s ease; }
.room-item:hover { transform: translateX(4px); border-color: rgba(255, 210, 63, 0.5); background: rgba(255, 210, 63, 0.08); }
.room-code-sm { font-weight: 800; letter-spacing: 0.15em; color: var(--gold); }
.room-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.room-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--orange)); color: #1a1000; font-weight: 900; flex-shrink: 0; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- Create ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1.5rem; }
.category-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.9rem 0.4rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.25); border: 1.5px solid var(--stroke); cursor: pointer; transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.category-btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.3); }
.category-btn .cat-icon { font-size: 1.7rem; transition: transform 0.2s; }
.category-btn .cat-name { font-weight: 700; font-size: 0.85rem; }
.category-btn small { color: var(--muted); font-size: 0.7rem; }
.category-btn.selected { border-color: var(--cat, var(--gold)); background: color-mix(in srgb, var(--cat, var(--gold)) 18%, transparent); box-shadow: 0 0 20px color-mix(in srgb, var(--cat, var(--gold)) 35%, transparent); }
.category-btn.selected .cat-icon { transform: scale(1.15); }
.category-btn.selected::after { content: "✓"; position: absolute; top: 6px; right: 8px; font-size: 0.75rem; font-weight: 900; color: var(--cat, var(--gold)); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.field select { appearance: none; padding: 0.75rem 2.2rem 0.75rem 0.9rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffd23f' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 0.9rem center; border: 1px solid var(--stroke); color: var(--text); font-weight: 600; font-size: 0.95rem; cursor: pointer; outline: none; }
.field select:focus { border-color: var(--gold); }
.field select option { background: var(--bg-2); }

/* ---------- Waiting ---------- */
.room-code-box { text-align: center; margin-bottom: 1rem; }
.room-code { font-size: 3rem; font-weight: 900; letter-spacing: 0.25em; padding-left: 0.25em; background: linear-gradient(135deg, var(--gold), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; cursor: pointer; margin-bottom: 0.5rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-bottom: 1.5rem; }
.chip { padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--stroke); font-size: 0.78rem; color: #cbd5e1; }
.count-badge { margin-left: 0.4rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--glass-strong); color: var(--text); letter-spacing: 0; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.6rem; margin-bottom: 1.25rem; }
.avatar-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.9rem 0.5rem; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--stroke); animation: popIn 0.35s cubic-bezier(.3,1.6,.5,1); }
.avatar-card.me { border-color: rgba(255, 210, 63, 0.6); background: rgba(255, 210, 63, 0.08); }
.avatar-card .big-avatar { font-size: 2.2rem; }
.avatar-card .avatar-name { font-size: 0.85rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-card .crown { position: absolute; top: -10px; font-size: 1.1rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
@keyframes popIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.waiting-dots { text-align: center; color: var(--muted); margin: 0.75rem 0; }
.waiting-dots span { animation: blink 1.4s infinite; }
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ---------- Game ---------- */
.game-layout { width: 100%; display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
.game-main { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.game-hud { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.round-info { min-width: 90px; }
.round-info.right { text-align: right; }
.round-num { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.round-num small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.timer-ring { position: relative; width: 96px; height: 96px; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke 0.3s; filter: drop-shadow(0 0 6px rgba(255, 210, 63, 0.6)); }
.timer { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer-ring.warn .ring-fg { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(255, 77, 109, 0.8)); }
.timer-ring.warn .timer { color: var(--red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.timer-bar { display: none; }
.question-card { max-width: 100%; text-align: center; padding: 2rem 1.5rem; margin-bottom: 1.25rem; position: relative; overflow: hidden; }
.question-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--cat, var(--gold)), transparent); }
.question-card.enter { animation: qIn 0.5s cubic-bezier(.2,.8,.2,1); }
@keyframes qIn { from { opacity: 0; transform: translateY(16px) rotateX(12deg); } to { opacity: 1; transform: none; } }
.category-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.9rem; border-radius: 999px; background: color-mix(in srgb, var(--cat, var(--gold)) 18%, transparent); border: 1px solid color-mix(in srgb, var(--cat, var(--gold)) 45%, transparent); color: var(--cat, var(--gold)); font-weight: 700; font-size: 0.85rem; margin-bottom: 1rem; }
.question-text { font-size: clamp(1.3rem, 3.2vw, 1.9rem); font-weight: 800; line-height: 1.3; margin-bottom: 0.75rem; text-wrap: balance; }
.unit-hint { color: var(--muted); font-size: 0.9rem; }
.answer-box { width: 100%; max-width: 440px; }
.answer-field { position: relative; }
.answer-input { width: 100%; padding: 1.1rem 5rem 1.1rem 1.25rem; font-size: 2rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; background: rgba(0,0,0,0.35); border: 2px solid rgba(255, 210, 63, 0.35); border-radius: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.answer-input::placeholder { color: rgba(255,255,255,0.25); font-size: 1.1rem; font-weight: 600; }
.answer-input:focus { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(255, 210, 63, 0.15); }
.answer-input:disabled { opacity: 0.5; }
.answer-unit { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; font-size: 0.85rem; max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.answer-status { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 0.6rem; min-height: 1.2em; }
.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.scoreboard { max-width: none; padding: 1.25rem; position: sticky; top: 84px; }
.score-list { display: grid; gap: 0.4rem; }
.score-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.6rem; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid transparent; transition: background 0.3s; }
.score-row.me { border-color: rgba(255, 210, 63, 0.4); background: rgba(255, 210, 63, 0.07); }
.score-row .rank { width: 1.4rem; color: var(--muted); font-weight: 800; font-size: 0.85rem; text-align: center; }
.score-row .avatar { font-size: 1.35rem; position: relative; }
.score-row .avatar.done::after { content: "✓"; position: absolute; right: -6px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--green); color: #032; font-size: 0.65rem; font-weight: 900; display: grid; place-items: center; animation: popIn 0.3s; }
.score-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.9rem; }
.score-row .pts { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.host-badge { margin-left: 0.3rem; font-size: 0.8rem; }

/* ---------- Reveal ---------- */
.reveal-card { text-align: center; }
.reveal-question { font-size: 1.05rem; color: #cbd5e1; margin: 0.25rem 0 1rem; text-wrap: balance; }
.correct-box { margin-bottom: 1.5rem; }
.correct-answer { font-size: clamp(2.5rem, 8vw, 4rem); font-weight: 900; font-variant-numeric: tabular-nums; background: linear-gradient(135deg, var(--green), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 24px rgba(61, 255, 162, 0.35)); word-break: break-all; line-height: 1.1; }
.correct-unit { color: var(--muted); font-weight: 600; margin-top: 0.25rem; }

.numberline { position: relative; height: 70px; margin: 0.5rem 0.75rem 1.5rem; }
.nl-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); border-radius: 2px; background: linear-gradient(90deg, rgba(255,77,109,0.6), rgba(61,255,162,0.9) 50%, rgba(255,77,109,0.6)); }
.nl-target { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 2px solid var(--green); box-shadow: 0 0 18px rgba(61, 255, 162, 0.6); z-index: 2; }
.nl-marker { position: absolute; top: 50%; transform: translate(-50%, -50%) scale(0); font-size: 1.5rem; z-index: 3; animation: markerIn 0.5s cubic-bezier(.3,1.6,.5,1) forwards; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.6)); }
.nl-marker.up { top: 8%; }
.nl-marker.down { top: 92%; }
.nl-marker.me::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); transform: translateX(-50%); }
@keyframes markerIn { to { transform: translate(-50%, -50%) scale(1); } }

.guess-list { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; text-align: left; }
.guess-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); opacity: 0; animation: rowIn 0.4s ease forwards; }
.guess-row.scored { background: rgba(255, 210, 63, 0.07); }
.guess-row.me { border-color: rgba(255, 210, 63, 0.55); }
.guess-row .rank { width: 1.6rem; text-align: center; font-weight: 900; color: var(--muted); }
.guess-row .avatar { font-size: 1.4rem; }
.guess-row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.guess-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.guess-row .dev { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.guess-row .dev.over { color: #ff9eb1; }
.guess-row .dev.under { color: #9ecbff; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.badge { min-width: 3.6rem; text-align: center; padding: 0.3rem 0.65rem; border-radius: 999px; font-weight: 900; font-size: 0.85rem; color: #1a1000; white-space: nowrap; }
.badge.gold { background: linear-gradient(135deg, #ffe066, #ffb300); box-shadow: 0 0 14px rgba(255, 200, 0, 0.45); }
.badge.silver { background: linear-gradient(135deg, #f1f5f9, #94a3b8); }
.badge.bronze { background: linear-gradient(135deg, #f0b27a, #b86b30); }
.badge.exact { background: linear-gradient(135deg, var(--green), var(--cyan)); box-shadow: 0 0 18px rgba(61, 255, 162, 0.6); }
.badge.none { background: rgba(255,255,255,0.08); color: var(--muted); font-weight: 600; }
.next-info { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.next-info .hint { font-size: 0.75rem; color: var(--muted); }
.autonext { width: 100%; max-width: 320px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.autonext > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--orange)); animation: drain linear forwards; }
@keyframes drain { from { width: 100%; } to { width: 0; } }

/* ---------- Game over ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 0.75rem; margin: 1.5rem 0 1.25rem; min-height: 220px; }
.podium-slot { display: flex; flex-direction: column; align-items: center; width: 31%; max-width: 150px; }
.podium-avatar { font-size: 2.6rem; animation: popIn 0.5s cubic-bezier(.3,1.6,.5,1) both; }
.podium-name { font-weight: 800; font-size: 0.9rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0.25rem 0; }
.podium-score { font-size: 0.8rem; color: var(--gold); font-weight: 800; margin-bottom: 0.4rem; }
.podium-block { width: 100%; border-radius: 12px 12px 4px 4px; display: grid; place-items: start center; padding-top: 0.5rem; font-size: 1.6rem; font-weight: 900; transform-origin: bottom; animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both; }
.podium-slot.p1 .podium-block { height: 130px; background: linear-gradient(180deg, #ffe066, #d49b00); box-shadow: 0 0 30px rgba(255, 210, 63, 0.4); }
.podium-slot.p2 .podium-block { height: 95px; background: linear-gradient(180deg, #e2e8f0, #7c8aa0); }
.podium-slot.p3 .podium-block { height: 70px; background: linear-gradient(180deg, #f0b27a, #9a5523); }
.podium-slot.p1 { order: 2; } .podium-slot.p2 { order: 1; } .podium-slot.p3 { order: 3; }
.podium-slot.p1 .podium-block, .podium-slot.p1 .podium-avatar { animation-delay: 0.6s; }
.podium-slot.p2 .podium-block, .podium-slot.p2 .podium-avatar { animation-delay: 0.3s; }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- Misc ---------- */
.volume-box { position: fixed; right: 1rem; bottom: 1rem; z-index: 30; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem; border-radius: 999px; background: rgba(11, 11, 26, 0.75); border: 1px solid var(--stroke); backdrop-filter: blur(10px); font-size: 0.8rem; }
.volume-box input { width: 90px; accent-color: var(--gold); cursor: pointer; }
.volume-box #volumeLabel { min-width: 2.6rem; text-align: right; color: var(--muted); }
.toast-host { position: fixed; left: 50%; bottom: 5rem; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column-reverse; align-items: center; gap: 0.5rem; pointer-events: none; }
.toast { padding: 0.65rem 1.1rem; border-radius: 12px; background: rgba(19, 19, 43, 0.92); border: 1px solid rgba(255, 210, 63, 0.4); box-shadow: 0 10px 30px rgba(0,0,0,0.4); font-size: 0.9rem; font-weight: 600; max-width: 90vw; text-align: center; animation: toastIn 0.3s cubic-bezier(.3,1.4,.5,1); }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .game-layout { grid-template-columns: 1fr; }
    .scoreboard { position: static; }
}
@media (max-width: 560px) {
    .card { padding: 1.25rem; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
    .hero-logo h1 { font-size: 2.4rem; }
    .room-code { font-size: 2.3rem; }
    .timer-ring { width: 80px; height: 80px; }
    .answer-input { font-size: 1.6rem; }
    .volume-box input { width: 60px; }
    .podium { min-height: 190px; }
    .guess-row { gap: 0.5rem; padding: 0.6rem 0.7rem; }
    .guess-row .rank { display: none; }
    .guess-row .who { min-width: 4.5rem; }
    .guess-row .val { font-size: 0.9rem; }
    .guess-row .dev { font-size: 0.66rem; }
    .badge { min-width: 0; padding: 0.25rem 0.5rem; font-size: 0.78rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
