* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: #fff;
    background:
        radial-gradient(circle at top center, rgba(80, 99, 255, 0.25), transparent 25%),
        radial-gradient(circle at bottom right, rgba(160, 55, 255, 0.25), transparent 18%),
        linear-gradient(135deg, #08103a 0%, #0b1455 45%, #170a55 100%);
}
body { min-height: 100vh; overflow-x: hidden; }
.hidden { display: none !important; }
.stage-lights {
    position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.beam {
    position: absolute; top: -20%; width: 24vw; height: 130vh;
    background: linear-gradient(to bottom, rgba(215, 236, 255, 0.35), rgba(215, 236, 255, 0.02) 60%, transparent 100%);
    filter: blur(18px);
    clip-path: polygon(45% 0%, 55% 0%, 100% 100%, 0% 100%);
    transform-origin: top center;
    animation: sweep 10s ease-in-out infinite alternate;
}
.beam-1 { left: 4%; animation-delay: 0s; }
.beam-2 { left: 25%; animation-delay: 1.8s; }
.beam-3 { right: 24%; animation-delay: 0.9s; }
.beam-4 { right: 3%; animation-delay: 2.7s; }
@keyframes sweep {
    0% { transform: rotate(-14deg) translateY(-10px); opacity: 0.4; }
    50% { opacity: 0.7; }
    100% { transform: rotate(14deg) translateY(12px); opacity: 0.45; }
}
.page-shell {
    position: relative; z-index: 1; max-width: 1600px; min-height: 100vh; margin: 0 auto; padding: 24px;
    display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start;
}
.money-panel { position: sticky; top: 18px; }
.code-panel {
    margin-bottom: 18px; padding: 18px 20px; border-radius: 24px;
    background: linear-gradient(180deg, rgba(50, 31, 138, 0.94), rgba(25, 18, 94, 0.98));
    border: 2px solid rgba(255, 171, 52, 0.9);
    box-shadow: 0 0 0 3px rgba(255, 171, 52, 0.15), 0 0 30px rgba(255, 171, 52, 0.22);
    text-align: center;
}
.code-label { display: block; color: #ffe7bf; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
#gameCode { display: block; margin-top: 8px; color: #ffb347; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 0.15em; }
.lifelines-row { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; }
.lifeline-btn {
    width: 72px; height: 72px; border-radius: 50%; border: 3px solid rgba(108, 205, 255, 0.95);
    background: radial-gradient(circle at 35% 30%, #101526 0%, #05070d 65%, #111f4c 100%);
    color: #fff; font-size: 2rem; box-shadow: 0 0 0 3px rgba(93, 158, 255, 0.2), 0 0 24px rgba(120, 202, 255, 0.35);
}
.ladder-card, .roster-card, .question-card, .podium-shell {
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(58, 38, 168, 0.92), rgba(31, 22, 110, 0.98));
    border: 3px solid rgba(100, 232, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(158, 86, 255, 0.2), 0 0 35px rgba(109, 219, 255, 0.22), inset 0 0 26px rgba(255, 255, 255, 0.06);
}
.ladder-card { padding: 16px; }
.game-panel { display: grid; gap: 22px; }
.section-kicker { color: #cfe3ff; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; }
.roster-card { padding: 20px; }
.roster-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 16px; }
.roster-head h2, .podium-shell h2 { margin: 6px 0 0; }
.roster-note { color: #ffe9ab; }
.roster-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}
.player-chip {
    padding: 14px; border-radius: 20px; background: rgba(7, 12, 42, 0.6); border: 1px solid rgba(133, 187, 255, 0.24);
}
.player-chip.eliminated { opacity: 0.78; }
.chip-top { display: flex; gap: 12px; align-items: center; }
.chip-avatar, .podium-avatar {
    width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center;
    border: 2px solid rgba(255,255,255,0.2);
}
.chip-name { font-weight: 800; }
.host-badge {
    display: inline-block; margin-left: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 179, 71, 0.18); color: #ffbf61;
    font-size: 0.7rem; vertical-align: middle;
}
.chip-prize { margin-top: 3px; color: #d6e7ff; font-size: 0.92rem; }
.chip-status {
    margin-top: 10px; padding: 9px 12px; border-radius: 999px; text-align: center; font-weight: 800; font-size: 0.9rem;
    background: rgba(255,255,255,0.08);
}
.chip-status.correct { background: rgba(45, 188, 109, 0.24); color: #8af2b0; }
.chip-status.wrong { background: rgba(191, 65, 65, 0.28); color: #ffadad; }
.chip-status.failed { background: rgba(122, 122, 122, 0.3); color: #ececec; }
.chip-status.locked { background: rgba(82, 138, 255, 0.25); color: #c8ddff; }
.chip-status.waiting { background: rgba(255,255,255,0.08); color: #dce8ff; }
.avatar-silhouette {
    position: relative; display: inline-block; width: 28px; height: 28px;
}
.avatar-silhouette::before,
.avatar-silhouette::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%); background: #ffffff;
}
.avatar-silhouette::before {
    top: 0; width: 12px; height: 12px; border-radius: 50%;
}
.avatar-silhouette::after {
    bottom: 0; width: 24px; height: 14px; border-radius: 14px 14px 8px 8px;
}
.avatar-silhouette.woman::after { width: 20px; height: 16px; border-radius: 14px 14px 18px 18px; }
.topbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-pill {
    padding: 16px 18px; border-radius: 22px; background: rgba(9, 14, 50, 0.78); border: 1px solid rgba(133, 187, 255, 0.2); box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.05);
}
.stat-pill .label { display: block; font-size: 0.95rem; color: #c9dcff; margin-bottom: 8px; }
.stat-pill strong { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.question-stage { min-height: 44vh; display: flex; align-items: center; justify-content: center; }
.question-card {
    width: min(100%, 980px); padding: 28px;
    background: radial-gradient(circle at top center, rgba(108, 202, 255, 0.08), transparent 32%), linear-gradient(180deg, rgba(12, 23, 85, 0.96), rgba(12, 12, 55, 0.98));
}
.question-meta {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 20px; color: #d7e6ff;
}
#categoryTag { padding: 8px 12px; border-radius: 999px; background: rgba(95, 118, 255, 0.18); border: 1px solid rgba(155, 179, 255, 0.18); font-weight: 700; }
.question-text {
    min-height: 150px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: clamp(1.35rem, 2.3vw, 2.25rem); font-weight: 800; line-height: 1.3; padding: 22px; margin-bottom: 26px; border-radius: 24px;
    background: linear-gradient(180deg, rgba(29, 42, 120, 0.86), rgba(17, 22, 80, 0.95)); border: 1px solid rgba(173, 215, 255, 0.25);
}
.answers-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.answer-btn {
    min-height: 92px; border-radius: 20px; border: 2px solid rgba(127, 218, 255, 0.4); background: linear-gradient(180deg, #20339b 0%, #111f74 100%);
    color: #fff; font-size: 1.05rem; font-weight: 700; text-align: left; padding: 18px 20px; cursor: pointer; display: flex; align-items: center; gap: 14px;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.04), 0 8px 20px rgba(0,0,0,0.25); transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}
.answer-btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.01); box-shadow: 0 0 20px rgba(126, 224, 255, 0.24), 0 12px 22px rgba(0,0,0,0.28); }
.answer-letter {
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 205, 84, 0.18); border: 1px solid rgba(255, 218, 128, 0.35); color: #ffd65b; font-weight: 900; flex: 0 0 36px;
}
.answer-text { flex: 1; }
.answer-btn.placeholder { justify-content: center; text-align: center; opacity: 0.65; cursor: default; }
.answer-btn.locked { cursor: default; }
.answer-btn.selected { border-color: rgba(255, 223, 119, 0.95); box-shadow: 0 0 24px rgba(255, 214, 102, 0.45); }
.answer-btn.correct { background: linear-gradient(180deg, #127241 0%, #0c4f2c 100%); border-color: rgba(122, 255, 168, 0.85); box-shadow: 0 0 30px rgba(96, 255, 152, 0.45); }
.answer-btn.wrong { background: linear-gradient(180deg, #9d2525 0%, #6a1717 100%); border-color: rgba(255, 125, 125, 0.85); box-shadow: 0 0 28px rgba(255, 103, 103, 0.4); }
.control-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.action-btn {
    min-width: 180px; min-height: 54px; border: none; border-radius: 999px; padding: 14px 24px; font-size: 1rem; font-weight: 800; cursor: pointer;
    background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(166, 216, 255, 0.22);
}
.action-btn.primary { background: linear-gradient(180deg, #f7d35d 0%, #d69f16 100%); color: #221300; }
.ladder-list { display: flex; flex-direction: column; gap: 8px; }
.ladder-row {
    display: grid; grid-template-columns: 16px 50px 1fr; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 999px; color: #ffffff;
}
.ladder-row.current { background: linear-gradient(90deg, rgba(74, 203, 255, 0.2), rgba(106, 104, 255, 0.28)); box-shadow: 0 0 0 2px rgba(97, 214, 255, 0.75), 0 0 18px rgba(97, 214, 255, 0.4), inset 0 0 14px rgba(255, 255, 255, 0.08); }
.ladder-row.earned .ladder-amount { color: #ffd54a; text-shadow: 0 0 12px rgba(255, 213, 74, 0.45); }
.ladder-dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(210, 245, 255, 0.9); box-shadow: 0 0 8px rgba(180, 235, 255, 0.9); }
.ladder-level { font-weight: 800; color: #dfeeff; }
.ladder-amount { font-weight: 800; font-size: 1.25rem; }
.entry-modal, .result-modal { width: min(92vw, 560px); border: none; padding: 0; background: transparent; }
.entry-modal::backdrop, .result-modal::backdrop { background: rgba(0, 0, 0, 0.72); }
.entry-card, .result-card {
    border-radius: 30px; padding: 28px; text-align: center; background: linear-gradient(180deg, rgba(18, 29, 95, 0.98), rgba(11, 11, 54, 0.98)); border: 2px solid rgba(126, 214, 255, 0.52);
}
.entry-card h1 { margin: 10px 0 12px; }
.mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.avatar-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.avatar-option {
    padding: 16px; border-radius: 22px; border: 1px solid rgba(166, 216, 255, 0.22); background: rgba(255,255,255,0.08); color: #fff; cursor: pointer;
    display: grid; gap: 10px; justify-items: center;
}
.avatar-option.active { border-color: rgba(255, 192, 90, 0.95); box-shadow: 0 0 18px rgba(255, 192, 90, 0.28); }
.entry-input {
    width: 100%; margin-top: 12px; min-height: 54px; border-radius: 18px; border: 1px solid rgba(166, 216, 255, 0.22); background: rgba(255,255,255,0.08); color: #fff; padding: 14px 16px; font-size: 1rem;
}
.entry-input::placeholder { color: rgba(255,255,255,0.65); }
.join-link { margin-top: 14px; background: none; border: none; color: #ffcb61; font-weight: 800; font-size: 1rem; cursor: pointer; }
.entry-error { min-height: 24px; color: #ffadad; margin-top: 10px; }
.result-card.correct { box-shadow: 0 0 34px rgba(89, 255, 153, 0.28); }
.result-card.wrong { box-shadow: 0 0 34px rgba(255, 107, 107, 0.24); }
.result-kicker { color: #cfe3ff; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
#resultTitle { margin: 12px 0; font-size: 2rem; }
#resultCopy { margin-bottom: 20px; line-height: 1.5; color: #fff1ae; }
.podium-shell { padding: 24px; text-align: center; }
.podium { display: flex; justify-content: center; align-items: end; gap: 18px; margin-top: 20px; }
.podium-block { display: grid; justify-items: center; gap: 12px; min-width: 150px; }
.podium-name { font-weight: 800; }
.podium-prize { color: #ffedb0; }
.podium-step {
    width: 100%; display: grid; place-items: center; border-radius: 20px 20px 0 0; background: linear-gradient(180deg, rgba(255, 204, 90, 0.85), rgba(214, 159, 22, 0.92)); color: #201200; font-size: 2rem; font-weight: 900;
}
.place-1 .podium-step { height: 170px; }
.place-2 .podium-step { height: 130px; }
.place-3 .podium-step { height: 100px; }
@media (max-width: 1100px) {
    .page-shell { grid-template-columns: 1fr; }
    .money-panel { position: static; order: 2; }
    .game-panel { order: 1; }
}
@media (max-width: 768px) {
    .page-shell { padding: 14px; gap: 18px; }
    .topbar { grid-template-columns: 1fr; }
    .answers-grid { grid-template-columns: 1fr; }
    .mode-buttons, .avatar-picker { grid-template-columns: 1fr; }
    .podium { flex-direction: column; align-items: stretch; }
}

.leave-game-btn {
    margin-top: 18px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 800;
    color: #fff3df;
    background: linear-gradient(180deg, rgba(130, 30, 30, 0.95), rgba(78, 14, 14, 0.98));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.leave-game-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
    filter: brightness(1.05);
}
.leave-game-btn:active {
    transform: translateY(0);
}


.countdown-pulse {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(5rem, 20vw, 11rem);
    font-weight: 900;
    color: #ffd75b;
    text-shadow: 0 0 30px rgba(255, 215, 91, 0.98), 0 0 60px rgba(255, 163, 61, 0.72), 0 0 110px rgba(255, 123, 35, 0.45);
    background: radial-gradient(circle, rgba(255, 192, 70, 0.24) 0%, rgba(255, 192, 70, 0.10) 18%, rgba(255, 192, 70, 0.03) 34%, transparent 52%);
    pointer-events: none;
    opacity: 0;
    transform: scale(1.4);
    z-index: 40;
}
.countdown-pulse.show { animation: countdownPulse 0.82s ease-out forwards; }
@keyframes countdownPulse {
    0% { opacity: 0; transform: scale(1.55); }
    12% { opacity: 1; transform: scale(1.22); }
    100% { opacity: 0; transform: scale(0.82); }
}
