/* =========================================
   class-live-quiz.css
   학생용 실시간 퀴즈 스타일시트
   ========================================= */

:root {
    --quiz-bg: var(--bg);
    --quiz-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    --quiz-accent: var(--primary);
    --quiz-accent-dark: var(--primary-dark);
    --quiz-border: var(--border);
    --quiz-text-main: var(--text-main);
    --quiz-text-sub: var(--text-sub);
    --live-theme-primary: var(--primary);
    --live-theme-accent: var(--accent);
    --live-theme-accent-dark: var(--accent-dark);
    --live-theme-warning: var(--warning);
    --live-theme-success: var(--success);
    --live-theme-danger: var(--danger);
    --live-theme-bg-main: var(--bg-main);
    --live-theme-card: var(--card-bg);
    --live-theme-border: color-mix(in srgb, var(--border) 92%, white 8%);
    --live-theme-text-main: var(--text-main);
    --live-theme-text-sub: var(--text-sub);
    --live-surface-bg: rgba(255, 255, 255, 0.96);
    --live-surface-muted-bg: rgba(248, 250, 252, 0.96);
    --live-surface-strong-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.98));
    --live-surface-border: rgba(216, 225, 236, 0.96);
    --live-surface-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --live-status-strip-bg: rgba(255, 255, 255, 0.94);
    --live-status-item-bg: rgba(248, 250, 252, 0.96);
    --live-chip-bg: #eef3f9;
    --live-chip-text: #475569;
    --live-option-bg: rgba(255, 255, 255, 0.98);
    --live-option-hover-bg: rgba(243, 247, 255, 0.98);
    --live-feedback-bg: linear-gradient(160deg, #ffffff, #f8fbff 55%, #f4f8ff);
    --live-feedback-kpi-bg: rgba(255, 255, 255, 0.9);
    --live-race-bg: #ffffff;
    --live-race-track-bg: #e5edf6;
    --live-phase-lobby-bg:
        radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-phase-question-bg:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-phase-reveal-bg:
        radial-gradient(circle at 100% 0%, rgba(20, 184, 166, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    --live-phase-leaderboard-bg:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    --live-phase-finished-bg:
        radial-gradient(circle at 50% 0%, rgba(100, 116, 139, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    --live-page-hero-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
    --live-page-hero-border: rgba(226, 232, 240, 0.9);
    --live-page-hero-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    --live-page-hero-eyebrow: #64748b;
    --live-hud-bg:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.96));
    --live-hud-border: rgba(216, 225, 236, 0.96);
    --live-hud-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    --live-orb-a: radial-gradient(circle, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0));
    --live-orb-b: radial-gradient(circle, rgba(20, 184, 166, 0.18), rgba(20, 184, 166, 0));
    --classic-focus-sidebar-width: 280px;
    --classic-focus-sidebar-gap: 16px;
    --classic-focus-sidebar-right: 18px;
    --classic-focus-main-left: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 26px 22px 42px;
    font-family: var(--font-body, system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
    background: var(--live-phase-lobby-bg);
    color: var(--quiz-text-main);
    max-width: 1000px;
    margin-inline: auto;
    position: relative;
    overflow-x: hidden;
    transition: background 0.35s ease, color 0.25s ease;
}

body.quiz-fullscreen {
    max-width: none;
    margin-inline: 0;
    padding: 10px 14px 14px;
}

body.quiz-fullscreen h1,
body.quiz-fullscreen .subtitle {
    display: none;
}

body.quiz-fullscreen .live-page-hero {
    padding: 0;
    margin-bottom: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    min-height: 0;
}

body.quiz-fullscreen .live-page-hero::before {
    display: none;
}

body.quiz-fullscreen .live-page-hero-copy {
    display: none;
}

body.quiz-fullscreen .pill-actions {
    position: fixed;
    top: 10px;
    right: 12px;
    margin: 0;
    z-index: 360;
}

body.quiz-fullscreen .pill-actions .pill-btn:not(#fullscreenBtn) {
    display: none;
}

body.quiz-fullscreen .live-status-strip {
    margin-top: 52px;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.28;
    filter: blur(28px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body::before {
    width: 220px;
    height: 220px;
    top: 5%;
    left: -70px;
    background: var(--live-orb-a);
    animation: bgFloatA 8s ease-in-out infinite;
}

body::after {
    width: 260px;
    height: 260px;
    right: -90px;
    bottom: 8%;
    background: var(--live-orb-b);
    animation: bgFloatB 9s ease-in-out infinite;
}

body>* {
    position: relative;
    z-index: 2;
}

.hidden {
    display: none !important;
}

body.live-phase-ready,
body.live-phase-loading,
body.live-phase-selection,
body.live-phase-lobby,
body.live-phase-countdown {
    background: var(--live-phase-lobby-bg);
}

body.live-phase-question {
    background: var(--live-phase-question-bg);
}

body.live-phase-reveal {
    background: var(--live-phase-reveal-bg);
}

body.live-phase-leaderboard {
    background: var(--live-phase-leaderboard-bg);
}

body.live-phase-finished {
    background: var(--live-phase-finished-bg);
}

body.live-theme-neon_arena {
    --live-phase-question-bg:
        radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.1), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    --live-phase-reveal-bg:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.1), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
    --live-phase-leaderboard-bg:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.1), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
    --live-phase-finished-bg:
        radial-gradient(circle at 50% 0%, rgba(100, 116, 139, 0.08), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-hud-bg:
        radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.97));
    --live-hud-border: rgba(186, 230, 253, 0.92);
    --live-hud-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
}

body.live-theme-treasure_raid {
    --live-phase-question-bg:
        radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.1), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    --live-phase-reveal-bg:
        radial-gradient(circle at 100% 0%, rgba(239, 68, 68, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
    --live-phase-leaderboard-bg:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.1), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    --live-phase-finished-bg:
        radial-gradient(circle at 50% 0%, rgba(100, 116, 139, 0.08), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-hud-bg:
        radial-gradient(circle at 25% 0%, rgba(20, 184, 166, 0.08), rgba(20, 184, 166, 0)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 248, 252, 0.97));
    --live-hud-border: rgba(199, 210, 254, 0.92);
    --live-hud-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

body.live-theme-galaxy_circuit {
    --live-phase-question-bg:
        radial-gradient(circle at 8% 0%, rgba(99, 102, 241, 0.1), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
    --live-phase-reveal-bg:
        radial-gradient(circle at 95% 0%, rgba(168, 85, 247, 0.08), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8f5ff 100%);
    --live-phase-leaderboard-bg:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
    --live-phase-finished-bg:
        radial-gradient(circle at 50% 0%, rgba(100, 116, 139, 0.08), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-hud-bg:
        radial-gradient(circle at 18% 0%, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 247, 255, 0.97));
    --live-hud-border: rgba(199, 210, 254, 0.92);
    --live-hud-shadow: 0 12px 24px rgba(79, 70, 229, 0.1);
}

body.live-style-realistic_esports_v1 {
    --quiz-card-bg:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.99),
            rgba(246, 249, 253, 0.98));
    --quiz-border: color-mix(in srgb, var(--live-theme-border) 94%, white 6%);
    --quiz-text-main: var(--live-theme-text-main);
    --quiz-text-sub: var(--live-theme-text-sub);
    --live-surface-bg:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.99),
            rgba(246, 249, 253, 0.98));
    --live-surface-muted-bg:
        linear-gradient(180deg,
            rgba(248, 250, 252, 0.98),
            rgba(244, 247, 251, 0.98));
    --live-surface-strong-bg:
        linear-gradient(145deg,
            color-mix(in srgb, var(--live-theme-primary) 8%, white),
            color-mix(in srgb, var(--live-theme-accent) 6%, white));
    --live-surface-border: color-mix(in srgb, var(--live-theme-border) 96%, white 4%);
    --live-surface-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    --live-status-strip-bg: rgba(255, 255, 255, 0.96);
    --live-status-item-bg: rgba(248, 250, 252, 0.98);
    --live-chip-bg: color-mix(in srgb, var(--live-theme-primary) 8%, white);
    --live-chip-text: var(--live-theme-text-main);
    --live-option-bg: rgba(255, 255, 255, 0.99);
    --live-option-hover-bg: color-mix(in srgb, var(--live-theme-primary) 8%, white);
    --live-feedback-bg:
        linear-gradient(160deg,
            rgba(255, 255, 255, 0.99),
            rgba(248, 251, 255, 0.98) 55%,
            color-mix(in srgb, var(--live-theme-primary) 6%, white));
    --live-feedback-kpi-bg: rgba(255, 255, 255, 0.92);
    --live-race-bg: rgba(255, 255, 255, 0.98);
    --live-race-track-bg: color-mix(in srgb, var(--live-theme-border) 82%, white 18%);
    --live-phase-lobby-bg:
        radial-gradient(circle at 18% -8%, color-mix(in srgb, var(--live-theme-primary) 10%, transparent), transparent 26%),
        radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--live-theme-accent) 8%, transparent), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-phase-question-bg:
        radial-gradient(circle at 14% 0%, color-mix(in srgb, var(--live-theme-primary) 10%, transparent), transparent 28%),
        radial-gradient(circle at 84% 12%, color-mix(in srgb, var(--live-theme-accent) 8%, transparent), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    --live-phase-reveal-bg:
        radial-gradient(circle at 86% 0%, color-mix(in srgb, var(--live-theme-accent) 10%, transparent), transparent 26%),
        radial-gradient(circle at 12% 22%, color-mix(in srgb, var(--live-theme-primary) 8%, transparent), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    --live-phase-leaderboard-bg:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--live-theme-primary) 10%, transparent), transparent 26%),
        radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--live-theme-accent) 8%, transparent), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    --live-phase-finished-bg:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--live-theme-accent) 8%, transparent), transparent 26%),
        radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--live-theme-primary) 8%, transparent), transparent 22%),
        linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    --live-page-hero-bg:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--live-theme-primary) 8%, transparent), transparent 36%),
        linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
    --live-page-hero-border: color-mix(in srgb, var(--live-theme-border) 96%, white 4%);
    --live-page-hero-shadow: 0 24px 46px rgba(15, 23, 42, 0.08);
    --live-page-hero-eyebrow: var(--live-theme-primary);
    --live-hud-bg:
        radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--live-theme-primary) 10%, transparent), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.97));
    --live-hud-border: color-mix(in srgb, var(--live-theme-border) 96%, white 4%);
    --live-hud-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
    --live-orb-a: radial-gradient(circle, color-mix(in srgb, var(--live-theme-primary) 18%, transparent), transparent 68%);
    --live-orb-b: radial-gradient(circle, color-mix(in srgb, var(--live-theme-accent) 14%, transparent), transparent 68%);
}

body.live-style-realistic_esports_v1::before,
body.live-style-realistic_esports_v1::after {
    opacity: 0.16;
}

body.live-quality-cinematic .live-status-strip {
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35);
}

body.live-quality-performance .live-status-strip {
    backdrop-filter: blur(4px);
}

body.live-mode-territory_war.live-style-realistic_esports_v1 {
    --live-phase-question-bg:
        radial-gradient(circle at 12% 4%, color-mix(in srgb, var(--live-theme-success) 10%, transparent), transparent 26%),
        radial-gradient(circle at 84% 10%, color-mix(in srgb, var(--live-theme-primary) 10%, transparent), transparent 24%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--live-theme-accent) 8%, transparent), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f6fafc 100%);
}

body.live-mode-boss_raid.live-style-realistic_esports_v1 {
    --live-phase-question-bg:
        radial-gradient(circle at 14% 0%, color-mix(in srgb, var(--live-theme-danger) 10%, transparent), transparent 26%),
        radial-gradient(circle at 82% 10%, color-mix(in srgb, var(--live-theme-primary) 8%, transparent), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8f8fb 100%);
}

.live-page-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 22px 22px 18px;
    margin-bottom: 14px;
    border-radius: 26px;
    border: 1px solid var(--live-page-hero-border);
    background: var(--live-page-hero-bg);
    box-shadow: var(--live-page-hero-shadow);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.live-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 44%);
    pointer-events: none;
    z-index: -1;
}

.live-page-hero-copy {
    min-width: 0;
}

.live-page-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--live-page-hero-eyebrow);
    font-weight: 800;
}

h1 {
    margin: 8px 0 0;
    font-size: clamp(1.8rem, 3.4vw, 2.45rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
    text-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--quiz-text-sub);
    margin: 10px 0 0;
    max-width: 56ch;
}

.live-status-strip {
    position: sticky;
    top: 10px;
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--live-surface-border);
    background: var(--live-status-strip-bg);
    backdrop-filter: blur(8px);
    box-shadow: var(--live-surface-shadow);
}

.live-status-item {
    border-radius: 10px;
    background: var(--live-status-item-bg);
    border: 1px solid var(--live-surface-border);
    padding: 7px 8px;
}

.live-status-label {
    display: block;
    font-size: 0.72rem;
    color: var(--quiz-text-sub);
    margin-bottom: 2px;
}

.live-status-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--quiz-text-main);
    line-height: 1.2;
}

.live-status-strip.phase-question .live-status-item {
    border-color: #93c5fd;
}

.live-status-strip.phase-reveal .live-status-item {
    border-color: #bfdbfe;
}

.live-status-strip.phase-finished .live-status-item {
    border-color: #9ca3af;
}

.live-mission-banner {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(216, 225, 236, 0.96);
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.98));
    color: #0f172a;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.live-mission-banner[data-tone="boost"] {
    border-color: rgba(134, 239, 172, 0.96);
    box-shadow: 0 18px 34px rgba(22, 163, 74, 0.08);
}

.live-mission-banner[data-tone="warning"],
.live-mission-banner[data-tone="danger"] {
    border-color: rgba(252, 165, 165, 0.96);
    box-shadow: 0 18px 34px rgba(220, 38, 38, 0.08);
}

.live-mission-banner[data-tone="defense"] {
    border-color: rgba(191, 219, 254, 0.96);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.08);
}

.live-mission-copy {
    min-width: 0;
}

.live-mission-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #2563eb;
    font-weight: 800;
}

.live-mission-title {
    margin-top: 4px;
    font-size: clamp(1rem, 2vw, 1.28rem);
    font-weight: 900;
    line-height: 1.15;
}

.live-mission-detail {
    margin-top: 4px;
    font-size: 0.88rem;
    color: #5f6c80;
}

.live-mission-cue {
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid rgba(191, 219, 254, 0.96);
    background: rgba(239, 246, 255, 0.98);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .live-mission-banner {
        grid-template-columns: 1fr;
    }

    .live-mission-cue {
        justify-self: start;
        white-space: normal;
    }
}

.live-status-value.submit-done {
    color: #34d399;
}

.live-status-value.submit-wait {
    color: #60a5fa;
}

.card {
    background: var(--live-surface-bg);
    border-radius: 20px;
    padding: 18px 18px 16px;
    box-shadow: var(--live-surface-shadow);
    margin-top: 16px;
    border: 1px solid var(--live-surface-border);
}

.card h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.card p.description {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--quiz-text-sub);
}

.student-info {
    font-size: 0.9rem;
    color: var(--quiz-text-sub);
    margin-top: 4px;
}

.quiz-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--live-chip-bg);
    font-size: 0.75rem;
    color: var(--live-chip-text);
    gap: 4px;
}

.pill.urgent {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
    border: 1px solid #fca5a5;
    animation: urgentPulse 0.7s ease-in-out infinite;
}

.question-card {
    border-radius: 10px;
    border: 1px solid var(--live-surface-border);
    padding: 10px 10px 8px;
    margin-bottom: 10px;
    background: var(--live-surface-muted-bg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.question-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--quiz-text-sub);
    padding-left: 4px;
}

.question-text {
    font-size: 0.98rem;
    margin-bottom: 6px;
    padding-left: 4px;
}

.options-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.options-list li {
    margin-bottom: 4px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--live-surface-border);
    background: var(--live-option-bg);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    font-size: 0.9rem;
    color: var(--quiz-text-main);
}

.option-item input[type="radio"] {
    margin-top: 3px;
}

.option-main {
    display: flex;
    flex-direction: column;
}

.option-index {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 1px;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.option-item:hover {
    background: var(--live-option-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.12);
}

.option-color-1 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), var(--live-option-bg) 64%);
}

.option-color-2 {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), var(--live-option-bg) 64%);
}

.option-color-3 {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.16), var(--live-option-bg) 64%);
}

.option-color-4 {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.16), var(--live-option-bg) 64%);
}

.correct-answer {
    border-color: #16a34a !important;
    background: #dcfce7 !important;
}

.wrong-answer-selected {
    border-color: #dc2626 !important;
    background: #fee2e2 !important;
}

.correct-flash {
    animation: correctFlash 0.5s ease-out;
}

@keyframes correctFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }

    100% {
        box-shadow: 0 0 0 14px rgba(34, 197, 94, 0);
    }
}

.shake-wrong {
    animation: shakeWrong 0.3s ease-out;
}

@keyframes shakeWrong {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-2px);
    }

    100% {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.18s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 공통 필 버튼 */
.pill-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
    margin-bottom: 0;
    align-self: end;
    justify-content: flex-end;
}

.pill-btn {
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.9rem;
    border: 1px solid var(--quiz-border);
    background: var(--live-surface-bg);
    color: var(--quiz-text-main);
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.12);
    font-weight: 700;
}

.pill-btn:hover {
    background: var(--live-surface-muted-bg);
}

.pill-btn:active {
    transform: translateY(1px);
}

.pill-btn.primary {
    background: var(--quiz-accent);
    border-color: var(--quiz-accent-dark);
    color: #1f2937;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(251, 146, 60, 0.22);
}

#fullscreenBtn {
    border-color: #94a3b8;
    background: #0f172a;
    color: #f8fafc;
    font-weight: 700;
}

#fullscreenBtn:hover {
    background: #1e293b;
}

body.quiz-fullscreen #fullscreenBtn {
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.4);
}

.btn-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

button {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary {
    background: var(--quiz-accent);
    color: #222;
}

.btn-primary:hover {
    background: var(--quiz-accent-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--live-surface-muted-bg);
    color: var(--quiz-text-main);
    border: 1px solid var(--live-surface-border);
}

.btn-secondary:hover {
    background: var(--live-option-hover-bg);
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

#status {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.small-muted {
    font-size: 0.8rem;
    color: var(--quiz-text-sub);
}

.result-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    margin-left: 6px;
}

.result-correct {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.result-wrong {
    background: rgba(248, 113, 113, 0.16);
    color: #fca5a5;
}

.result-summary-card {
    border-radius: 12px;
    border: 1px solid var(--live-surface-border);
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--live-surface-strong-bg);
    box-shadow: var(--live-surface-shadow);
}

.result-summary-main {
    font-weight: 700;
    margin-bottom: 4px;
}

.result-summary-score {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.result-summary-sub {
    font-size: 0.85rem;
    color: var(--quiz-text-sub);
}

.quiz-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-select-card {
    border-radius: 10px;
    border: 1px solid var(--live-surface-border);
    padding: 10px 12px;
    background: var(--live-surface-bg);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.quiz-select-card:hover {
    background: var(--live-surface-strong-bg);
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.1);
    transform: translateY(-1px);
}

.quiz-select-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.quiz-select-meta {
    font-size: 0.8rem;
    color: var(--quiz-text-sub);
}

.score-popup {
    position: fixed;
    top: 18px;
    left: 50%;
    min-width: min(480px, 90vw);
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    color: #f8fafc;
    font-size: 1.02rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -12px) scale(0.96);
    transition: opacity 0.18s, transform 0.18s;
    z-index: 360;
}

.score-popup.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.mode-brief-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 330;
}

.mode-brief-overlay.show {
    opacity: 1;
}

.mode-brief-card {
    width: min(620px, 92vw);
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: linear-gradient(155deg, rgba(2, 6, 23, 0.95), rgba(30, 41, 59, 0.95));
    color: #f8fafc;
    box-shadow: 0 20px 42px rgba(2, 6, 23, 0.62);
    padding: 22px 24px;
    text-align: center;
    transform: translateY(10px) scale(0.97);
    transition: transform 0.2s ease;
}

.mode-brief-overlay.show .mode-brief-card {
    transform: translateY(0) scale(1);
}

.mode-brief-title {
    font-size: clamp(1.2rem, 2.2vw, 1.58rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.mode-brief-lines {
    display: grid;
    gap: 6px;
    font-size: clamp(0.95rem, 1.65vw, 1.08rem);
    color: #e2e8f0;
}

.mode-brief-overlay.tone-boost .mode-brief-card {
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 22px 46px rgba(21, 128, 61, 0.4);
}

.mode-brief-overlay.tone-warning .mode-brief-card {
    border-color: rgba(251, 146, 60, 0.6);
    box-shadow: 0 22px 46px rgba(180, 83, 9, 0.38);
}

.mode-brief-overlay.tone-defense .mode-brief-card {
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 22px 46px rgba(30, 64, 175, 0.4);
}

.result-stage-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 10%, rgba(15, 23, 42, 0.56), rgba(2, 6, 23, 0.84));
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 340;
}

.result-stage-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.result-stage-card {
    width: min(560px, 92vw);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.36);
    background: linear-gradient(160deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.96));
    color: #f8fafc;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.68);
    padding: 24px 24px 20px;
    text-align: center;
}

.result-stage-head {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #93c5fd;
    margin-bottom: 8px;
}

.result-stage-step {
    font-size: 0.92rem;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.result-stage-main {
    font-size: clamp(1.42rem, 3.2vw, 2.1rem);
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1.1;
}

.result-stage-sub {
    font-size: clamp(0.94rem, 1.85vw, 1.05rem);
    color: #e2e8f0;
    min-height: 26px;
    white-space: pre-line;
    margin-bottom: 14px;
}

.chest-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 220;
    backdrop-filter: blur(4px);
}

.chest-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.chest-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.98));
    color: #0f172a;
    border-radius: 18px;
    padding: 18px 18px 16px;
    width: min(320px, 86vw);
    text-align: center;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(191, 219, 254, 0.96);
    position: relative;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.2s ease;
}

.chest-overlay.show .chest-card {
    transform: scale(1);
}

.chest-emoji {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 8px;
}

.chest-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.chest-sub {
    font-size: 0.85rem;
    color: #5f6c80;
    margin-bottom: 10px;
}

.chest-open-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
    background: var(--primary);
    color: #ffffff;
}

.chest-reveal {
    display: none;
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.chest-card.opened .chest-reveal {
    display: block;
}

.chest-card.opened .chest-sub {
    color: #1f2937;
}

.rank-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 245, 249, 0.82);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 200;
}

.rank-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.rank-overlay-inner {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.98));
    color: #0f172a;
    padding: 24px 24px 20px;
    border-radius: 22px;
    border: 1px solid rgba(216, 225, 236, 0.96);
    width: min(760px, 94vw);
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.14);
    transform: translateY(12px);
    transition: transform 0.2s;
}

.rank-overlay.show .rank-overlay-inner {
    transform: translateY(0);
}

.rank-title {
    font-size: clamp(1.24rem, 2vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.rank-sub {
    font-size: clamp(0.95rem, 1.25vw, 1.08rem);
    color: #5f6c80;
    margin-bottom: 12px;
    white-space: pre-line;
}

.rank-list {
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.98);
    border: 1px solid rgba(216, 225, 236, 0.96);
    padding: 10px 12px;
    margin-bottom: 10px;
    max-height: min(46vh, 420px);
    overflow-y: auto;
}

.rank-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: clamp(0.95rem, 1.15vw, 1.08rem);
    padding: 7px 0;
}

.rank-row.me {
    font-weight: 700;
    color: var(--primary);
}

.rank-no {
    width: 66px;
}

.rank-name {
    flex: 1;
    padding: 0 6px;
}

.rank-score {
    width: 108px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rank-hint {
    font-size: 0.9rem;
    color: #5f6c80;
    text-align: center;
    margin-top: 10px;
}

.rank-ctrl {
    display: flex;
    justify-content: flex-end;
    margin: 4px 0 2px;
    gap: 6px;
}

.rank-ctrl-btn {
    border: 1px solid rgba(216, 225, 236, 0.96);
    background: rgba(255, 255, 255, 0.98);
    color: #334155;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.88rem;
    cursor: pointer;
}

.rank-overlay.rank-up .rank-overlay-inner {
    border: 2px solid #22c55e;
}

.rank-overlay.rank-down .rank-overlay-inner {
    border: 2px solid #ef4444;
}

.rank-overlay.photo-finish .rank-overlay-inner {
    border: 2px solid #2563eb;
    box-shadow: 0 20px 46px rgba(37, 99, 235, 0.16);
}

.rank-overlay.lead-under-threat .rank-overlay-inner {
    border: 2px solid #f97316;
    box-shadow: 0 20px 46px rgba(248, 113, 113, 0.24);
}

.rank-overlay.rank-pressure .rank-overlay-inner {
    border: 2px solid #2563eb;
    box-shadow: 0 20px 46px rgba(37, 99, 235, 0.14);
}

.rank-overlay.phase-loading .rank-list,
.rank-overlay.phase-loading .rank-my-card {
    opacity: 0.2;
    filter: blur(2px);
}

.rank-overlay.phase-drumroll .rank-overlay-inner {
    animation: shakeSoft 0.35s ease-in-out infinite;
}

.rank-overlay.phase-drumroll .rank-list,
.rank-overlay.phase-drumroll .rank-my-card {
    opacity: 0.35;
    filter: blur(3px);
}

.rank-overlay.phase-drumroll .rank-row {
    animation: shuffleFloat 0.6s ease-in-out infinite;
}

.rank-overlay.phase-reveal .rank-title {
    animation: popIn 0.45s ease-out;
}

.rank-overlay.phase-reveal .rank-list,
.rank-overlay.phase-reveal .rank-my-card {
    opacity: 1;
    filter: none;
    animation: slideUp 0.35s ease-out;
}

.rank-overlay.rank-up.phase-reveal .rank-overlay-inner {
    animation: glowUp 0.8s ease-out;
}

.rank-overlay.rank-down.phase-reveal .rank-overlay-inner {
    animation: glowDown 0.8s ease-out;
}

.rank-overlay.photo-finish.phase-drumroll .rank-overlay-inner {
    animation: shakeSoft 0.26s ease-in-out infinite, photoFinishPulse 0.88s ease-in-out infinite;
}

.rank-overlay.lead-under-threat.phase-drumroll .rank-overlay-inner {
    animation: shakeSoft 0.3s ease-in-out infinite, threatPulse 1s ease-in-out infinite;
}

.rank-overlay.photo-finish.phase-reveal .rank-title {
    color: #1d4ed8;
}

.rank-overlay.lead-under-threat.phase-reveal .rank-title {
    color: #fecaca;
}

.rank-overlay.rank-pressure.phase-reveal .rank-title {
    color: #1d4ed8;
}

@keyframes popIn {
    0% {
        transform: scale(0.92);
        opacity: 0.4;
    }

    70% {
        transform: scale(1.04);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shakeSoft {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px);
    }

    50% {
        transform: translateX(2px);
    }

    75% {
        transform: translateX(-1px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes photoFinishPulse {
    0% {
        box-shadow: 0 18px 40px rgba(251, 146, 60, 0.16);
    }

    50% {
        box-shadow: 0 20px 54px rgba(251, 146, 60, 0.34);
    }

    100% {
        box-shadow: 0 18px 40px rgba(251, 146, 60, 0.16);
    }
}

@keyframes threatPulse {
    0% {
        box-shadow: 0 18px 40px rgba(248, 113, 113, 0.18);
        transform: scale(1);
    }

    38% {
        box-shadow: 0 22px 58px rgba(248, 113, 113, 0.32);
        transform: scale(1.01);
    }

    100% {
        box-shadow: 0 18px 40px rgba(248, 113, 113, 0.18);
        transform: scale(1);
    }
}

@keyframes shuffleFloat {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowUp {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }

    100% {
        box-shadow: 0 0 0 14px rgba(34, 197, 94, 0);
    }
}

@keyframes glowDown {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    100% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
    }
}

.rank-my-card {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.98));
    padding: 14px 16px;
    margin: 10px 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.rank-my-card-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-my-label {
    font-size: 0.9rem;
    color: #5f6c80;
    opacity: 0.9;
}

.rank-my-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.rank-my-card-right {
    text-align: right;
}

.rank-my-rank {
    font-size: 1.34rem;
    font-weight: 800;
    color: #2563eb;
}

.rank-my-score {
    font-size: 0.95rem;
    color: #475569;
    opacity: 0.9;
}

.live-game-hud {
    margin: 8px 0 10px;
    padding: 10px 11px;
    border-radius: 14px;
    background: var(--live-hud-bg);
    color: var(--quiz-text-main);
    border: 1px solid var(--live-hud-border);
    box-shadow: var(--live-hud-shadow);
}

.live-game-hud .hud-section {
    border-radius: 11px;
    border: 1px solid color-mix(in srgb, var(--live-surface-border) 92%, rgba(255, 255, 255, 0.04));
    background: color-mix(in srgb, var(--live-theme-card, #ffffff) 76%, transparent);
    padding: 8px 9px;
    margin-bottom: 7px;
}

.live-game-hud .hud-section-title {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--quiz-text-sub);
    margin-bottom: 6px;
    font-weight: 700;
}

.live-game-hud .hud-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.live-game-hud .hud-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--live-surface-border) 92%, rgba(255, 255, 255, 0.04));
    background: color-mix(in srgb, var(--live-chip-bg) 92%, transparent);
    color: var(--live-chip-text);
    white-space: nowrap;
}

.live-game-hud .hud-chip.combo {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(20, 184, 166, 0.14));
    border-color: rgba(147, 197, 253, 0.7);
}

.live-game-hud .hud-chip.rank {
    color: #1d4ed8;
}

.live-game-hud .hud-chip.team {
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.5);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-game-hud .hud-chip.relay {
    color: #e0f2fe;
    border-color: rgba(125, 211, 252, 0.5);
}

.live-game-hud .hud-chip.territory {
    color: #0f766e;
    border-color: rgba(45, 212, 191, 0.45);
}

.live-game-hud .hud-chip.boss {
    color: #fda4af;
    border-color: rgba(251, 113, 133, 0.48);
}

.live-game-hud .hud-chip.neutral {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.45);
}

.live-game-hud .hud-chip.objective-focus {
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(15, 23, 42, 0.72);
}

.live-game-hud .hud-chip.momentum {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.45);
}

.live-game-hud .hud-chip.momentum.warn {
    color: #1d4ed8;
    border-color: rgba(147, 197, 253, 0.58);
}

.live-game-hud .hud-chip.momentum.positive {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.live-game-hud .hud-chip.momentum.negative {
    color: #fda4af;
    border-color: rgba(248, 113, 113, 0.55);
}

.live-game-hud .hud-chip.momentum.pressure {
    color: #1d4ed8;
    border-color: rgba(147, 197, 253, 0.62);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.1));
}

.live-game-hud .hud-chip.momentum.photo-finish {
    color: #0f172a;
    border-color: rgba(96, 165, 250, 0.72);
    background: linear-gradient(135deg, rgba(191, 219, 254, 0.72), rgba(216, 239, 255, 0.84));
    animation: photoFinishChipPulse 0.95s ease-in-out infinite;
}

.live-game-hud .hud-chip.momentum.threat {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.66);
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.3), rgba(249, 115, 22, 0.22));
}

.live-game-hud .hud-chip.finale {
    color: #1d4ed8;
    border-color: rgba(96, 165, 250, 0.6);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.14));
    animation: finalePulse 1.1s ease-in-out infinite;
}

.live-game-hud .hud-chip.finale.hot {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.62);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.28), rgba(244, 63, 94, 0.32));
}

@keyframes photoFinishChipPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.12);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(251, 146, 60, 0.22);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.12);
    }
}

.live-game-hud .hud-chip.urgent {
    animation: urgentPulse 0.75s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.45);
}

.live-game-hud .hud-meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.live-game-hud .hud-meter {
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--live-surface-border) 88%, rgba(255, 255, 255, 0.04));
    background: color-mix(in srgb, var(--live-theme-card, #ffffff) 70%, transparent);
    padding: 6px 8px;
}

.live-game-hud .hud-meter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--quiz-text-sub);
    margin-bottom: 4px;
}

.live-game-hud .hud-meter-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.24);
    overflow: hidden;
}

.live-game-hud .hud-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22d3ee, #34d399);
    transition: width 0.28s ease-out;
}

.live-game-hud .hud-meter-fill.combo {
    background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.personal-feedback-card {
    margin-top: 8px;
    border-radius: 16px;
    border: 1px solid var(--live-surface-border);
    background: var(--live-feedback-bg);
    padding: 13px 14px 12px;
    color: var(--quiz-text-main);
    box-shadow: var(--live-surface-shadow);
}

.personal-feedback-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.personal-feedback-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

.personal-feedback-kpi {
    border-radius: 10px;
    border: 1px solid var(--live-surface-border);
    background: var(--live-feedback-kpi-bg);
    padding: 6px 7px;
    display: grid;
    gap: 2px;
}

.personal-feedback-kpi span {
    font-size: 0.72rem;
    color: var(--quiz-text-sub);
}

.personal-feedback-kpi strong {
    font-size: 1rem;
}

.personal-feedback-line {
    font-size: 0.88rem;
    margin-bottom: 4px;
    color: var(--quiz-text-main);
}

.race-area {
    margin: 6px 0 6px;
}

.race-wrapper {
    background: var(--live-race-bg);
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid var(--live-surface-border);
}

.race-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--quiz-text-sub);
    margin-bottom: 4px;
}

.race-label span:first-child {
    font-weight: 600;
}

.race-track {
    display: flex;
    align-items: center;
    gap: 6px;
}

.race-start,
.race-end {
    font-size: 1.1rem;
}

.race-bar {
    position: relative;
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: var(--live-race-track-bg);
    overflow: hidden;
}

.race-progress {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, #22c55e, #a3e635);
    width: 0%;
    transition: width 0.35s ease-out;
}

.race-pawn {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    pointer-events: none;
    transition: left 0.35s ease-out, transform 0.35s ease-out;
}

/* 아바타 */
.avatar-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid rgba(0, 0, 0, 0.04);
    background: #f9fafb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.avatar-bubble.lg {
    width: 46px;
    height: 46px;
    font-size: 22px;
}

.student-info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #111827;
}

.student-info-box .code {
    font-size: 0.82rem;
    color: #6b7280;
}

.rank-row {
    gap: 6px;
}

.rank-row .rank-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 퀴즈 TOP5 */
.quiz-top-card {
    margin-top: 10px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.98));
    color: var(--quiz-text-main);
    border: 1px solid rgba(191, 219, 254, 0.88);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.quiz-top-card::after {
    content: "";
    position: absolute;
    inset: -40px 20% auto auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 60%);
    transform: rotate(18deg);
    pointer-events: none;
}

.quiz-top-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quiz-top-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    position: relative;
    z-index: 1;
}

.quiz-top-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(216, 225, 236, 0.96);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.quiz-top-rank {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.quiz-top-item .name {
    font-weight: 700;
    color: var(--quiz-text-main);
}

.quiz-top-item .meta {
    font-size: 0.82rem;
    color: var(--quiz-text-sub);
    opacity: 0.95;
}

.quiz-top-empty {
    color: var(--quiz-text-sub);
    opacity: 0.85;
    padding: 6px 4px;
}

.territory-mini-wrap {
    margin: 8px 0 10px;
}

.territory-board {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    background:
        radial-gradient(circle at 14% 18%, rgba(45, 212, 191, 0.18), transparent 28%),
        radial-gradient(circle at 86% 20%, rgba(59, 130, 246, 0.18), transparent 30%),
        linear-gradient(155deg, rgba(7, 16, 33, 0.96), rgba(11, 25, 48, 0.92) 48%, rgba(15, 23, 42, 0.9));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 18px 42px rgba(2, 6, 23, 0.35);
    padding: 18px 18px 16px;
}

.territory-board.compact {
    padding: 10px;
    border-radius: 18px;
}

.territory-board::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(0deg, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0)),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.035) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.03) 0 1px, transparent 1px 34px);
    mix-blend-mode: screen;
    opacity: 0.5;
}

.territory-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #e2e8f0;
    font-size: 0.82rem;
    margin-bottom: 14px;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.territory-board-title {
    display: grid;
    gap: 4px;
}

.territory-board-head strong {
    letter-spacing: 0.08em;
    font-size: 0.92rem;
}

.territory-board-head span {
    color: #94a3b8;
}

.territory-board-state {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background: rgba(15, 23, 42, 0.5);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.territory-grid-shell {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
}

.territory-grid-inner {
    display: grid;
    grid-template-columns: 24px max-content;
    gap: 8px;
    align-items: start;
    justify-content: center;
}

.territory-grid-axis {
    display: grid;
    gap: 4px;
}

.territory-grid-axis-top {
    grid-template-columns: 24px repeat(var(--territory-size, 5), var(--territory-cell, 28px));
    align-items: center;
    justify-content: center;
}

.territory-grid-axis-side {
    grid-template-rows: repeat(var(--territory-size, 5), var(--territory-cell, 28px));
}

.territory-axis-corner {
    width: 24px;
    height: 24px;
}

.territory-axis-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(186, 230, 253, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.territory-grid {
    display: grid;
    grid-template-columns: repeat(var(--territory-size, 5), var(--territory-cell, 28px));
    gap: 5px;
    justify-content: center;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 22px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    background:
        radial-gradient(circle at center, rgba(15, 23, 42, 0.42), rgba(2, 6, 23, 0.7)),
        linear-gradient(180deg, rgba(2, 6, 23, 0.54), rgba(2, 6, 23, 0.34));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.territory-cell {
    position: relative;
    overflow: hidden;
    width: var(--territory-cell, 28px);
    height: var(--territory-cell, 28px);
    border-radius: 13px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.94));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 700;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
    padding: 0;
    cursor: default;
    appearance: none;
}

.territory-cell-surface,
.territory-cell-glow,
.territory-cell-banner,
.territory-cell-frontier,
.territory-cell-icon {
    position: absolute;
    pointer-events: none;
}

.territory-cell-surface {
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0)),
        linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
}

.territory-cell-glow {
    inset: 20%;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
    opacity: 0;
}

.territory-cell-banner {
    top: 6px;
    left: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.62);
    border: 1px solid rgba(248, 250, 252, 0.12);
    color: #e2e8f0;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.territory-cell-icon {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    line-height: 1;
    font-size: 0.92rem;
    color: rgba(226, 232, 240, 0.9);
    text-shadow: 0 0 12px rgba(15, 23, 42, 0.42);
}

.territory-cell-frontier {
    right: 5px;
    bottom: 4px;
    z-index: 3;
    font-size: 0.76rem;
    font-weight: 900;
    color: #fef08a;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.territory-cell.owned {
    background: linear-gradient(180deg, color-mix(in srgb, var(--cell-color, #60a5fa) 28%, rgba(15, 23, 42, 0.92)), rgba(15, 23, 42, 0.94));
    border-color: color-mix(in srgb, var(--cell-color, #60a5fa) 70%, rgba(248, 250, 252, 0.12));
    color: color-mix(in srgb, var(--cell-color, #93c5fd) 84%, #f8fafc 16%);
}

.territory-cell.owned .territory-cell-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0)),
        linear-gradient(180deg, color-mix(in srgb, var(--cell-color, #60a5fa) 34%, rgba(30, 41, 59, 0.9)), rgba(15, 23, 42, 0.96));
}

.territory-cell.owned .territory-cell-glow {
    opacity: 0.5;
    background: radial-gradient(circle, color-mix(in srgb, var(--cell-color, #60a5fa) 44%, rgba(255, 255, 255, 0.18)), transparent 70%);
}

.territory-cell.mine {
    box-shadow: 0 0 0 2px rgba(248, 250, 252, 0.12), 0 0 26px rgba(125, 211, 252, 0.14);
    transform: scale(1.03);
}

.territory-cell.neutral {
    opacity: 0.92;
    color: rgba(226, 232, 240, 0.28);
}

.territory-cell.castle {
    border-width: 2px;
    border-color: rgba(250, 204, 21, 0.72);
    color: #fde68a;
    box-shadow:
        inset 0 0 0 1px rgba(250, 204, 21, 0.2),
        0 0 18px rgba(250, 204, 21, 0.16);
}

.territory-cell.castle .territory-cell-surface {
    background:
        linear-gradient(180deg, rgba(250, 204, 21, 0.16), rgba(250, 204, 21, 0)),
        linear-gradient(180deg, rgba(51, 65, 85, 0.96), rgba(15, 23, 42, 0.96));
}

.territory-cell.castle .territory-cell-icon {
    font-size: 1.02rem;
}

.territory-cell.frontier-owned:not(.castle) {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 20px rgba(125, 211, 252, 0.12);
}

.territory-cell.frontier-neutral:not(.claim-valid) {
    border-color: rgba(96, 165, 250, 0.26);
}

.territory-cell.recent-capture:not(.claim-valid) .territory-cell-glow {
    opacity: 0.72;
    animation: territoryRecentCapturePulse 1.4s ease-out 1;
}

.territory-cell.castle-danger {
    box-shadow:
        inset 0 0 0 1px rgba(248, 113, 113, 0.36),
        0 0 22px rgba(248, 113, 113, 0.22);
}

.territory-cell.castle-danger .territory-cell-surface {
    background:
        linear-gradient(180deg, rgba(248, 113, 113, 0.18), rgba(248, 113, 113, 0)),
        linear-gradient(180deg, rgba(51, 65, 85, 0.96), rgba(15, 23, 42, 0.96));
}

.territory-cell.claim-valid {
    cursor: pointer;
    border-color: rgba(251, 191, 36, 0.9);
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.28),
        0 0 24px rgba(251, 191, 36, 0.2),
        inset 0 0 0 1px rgba(251, 191, 36, 0.12);
    animation: territoryClaimPulse 1.15s ease-in-out infinite;
}

.territory-cell.claim-valid .territory-cell-glow {
    opacity: 0.82;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.42), transparent 72%);
}

.territory-cell.claim-dim {
    opacity: 0.42;
    filter: saturate(0.78);
}

.territory-cell.claim-valid:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.06);
}

.territory-cell.claim-pending {
    border-color: rgba(34, 197, 94, 0.88);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.28), 0 0 20px rgba(34, 197, 94, 0.22);
}

.territory-cell.eliminated {
    filter: saturate(0.25);
    opacity: 0.48;
}

.territory-cell:disabled {
    cursor: default;
}

.territory-board-foot {
    display: grid;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.territory-phase-note {
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.45;
}

.territory-legend {
    display: grid;
    gap: 5px;
}

.territory-legend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.territory-legend-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.territory-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--legend-color, #94a3b8);
    box-shadow: 0 0 12px color-mix(in srgb, var(--legend-color, #94a3b8) 55%, transparent);
}

@keyframes territoryClaimPulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 0 16px rgba(251, 191, 36, 0.14);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.34), 0 0 24px rgba(251, 191, 36, 0.22);
        transform: scale(1.04);
    }
}

@keyframes territoryRecentCapturePulse {
    0% {
        opacity: 0.85;
        transform: scale(0.85);
    }
    100% {
        opacity: 0;
        transform: scale(1.25);
    }
}

.live-fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 260;
    overflow: hidden;
}

.live-atmosphere-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 210;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow: hidden;
}

body.live-style-realistic_esports_v1 .live-atmosphere-layer {
    opacity: 1;
}

.live-atmosphere-layer::before {
    content: "";
    position: absolute;
    inset: -18%;
    background:
        radial-gradient(circle at 15% 18%, rgba(56, 189, 248, 0.26), transparent 40%),
        radial-gradient(circle at 84% 12%, rgba(250, 204, 21, 0.18), transparent 38%),
        radial-gradient(circle at 50% 86%, rgba(37, 99, 235, 0.18), transparent 54%);
    mix-blend-mode: screen;
    animation: atmosphereFloat 14s ease-in-out infinite;
}

.live-atmosphere-layer::after {
    content: "";
    position: absolute;
    left: -8%;
    right: -8%;
    bottom: -42px;
    height: 220px;
    background-image:
        linear-gradient(0deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 18px 18px;
    transform: perspective(320px) rotateX(70deg);
    opacity: 0.42;
    animation: arenaGridDrift 16s linear infinite;
}

body.live-quality-performance .live-atmosphere-layer::before {
    opacity: 0.62;
    filter: saturate(0.88);
}

body.live-quality-performance .live-atmosphere-layer::after {
    opacity: 0.22;
    background-size: 22px 22px;
}

body.live-mode-territory_war.live-style-realistic_esports_v1 .live-atmosphere-layer::after {
    background-size: 24px 24px;
    opacity: 0.55;
}

body.live-mode-boss_raid.live-style-realistic_esports_v1 .live-atmosphere-layer::before {
    background:
        radial-gradient(circle at 18% 16%, rgba(251, 113, 133, 0.32), transparent 38%),
        radial-gradient(circle at 84% 18%, rgba(248, 113, 113, 0.26), transparent 40%),
        radial-gradient(circle at 50% 84%, rgba(251, 191, 36, 0.16), transparent 56%);
}

body.live-mode-boss_raid.live-style-realistic_esports_v1 .live-atmosphere-layer::after {
    opacity: 0.3;
}

.fx-ambient-star {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: var(--size, 3px);
    height: var(--size, 3px);
    border-radius: 999px;
    background: var(--star-color, #ffffff);
    box-shadow: 0 0 10px color-mix(in srgb, var(--star-color, #ffffff) 70%, transparent 30%);
    opacity: 0.24;
    animation: ambientTwinkle var(--dur, 3200ms) ease-in-out infinite;
    animation-delay: var(--delay, 0ms);
}

.fx-particle {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: var(--size, 10px);
    height: var(--size, 10px);
    border-radius: 50%;
    color: #f8fafc;
    background: radial-gradient(circle, var(--fx-color, #34d399), rgba(255, 255, 255, 0));
    box-shadow: 0 0 12px var(--fx-shadow, rgba(52, 211, 153, 0.45));
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
    animation: particleFly var(--dur, 760ms) cubic-bezier(.18, .66, .18, 1) forwards;
}

.fx-particle.emoji {
    width: auto;
    height: auto;
    font-size: var(--emoji-size, 18px);
    background: transparent;
    box-shadow: none;
    transform: translate(-50%, -50%) scale(1);
}

.fx-screen-pulse {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--pulse-color, #60a5fa) 55%, transparent 45%), transparent 68%),
        linear-gradient(180deg, color-mix(in srgb, var(--pulse-color, #60a5fa) 22%, transparent 78%), transparent 55%);
    opacity: var(--pulse-opacity, 0.32);
    mix-blend-mode: var(--pulse-blend, screen);
    animation: screenPulse var(--pulse-dur, 760ms) cubic-bezier(.17, .67, .2, .98) forwards;
}

.fx-shock-ring {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: 0;
    height: 0;
    border-radius: 999px;
    border: 2px solid color-mix(in srgb, var(--ring-color, #93c5fd) 80%, #ffffff 20%);
    box-shadow: 0 0 16px color-mix(in srgb, var(--ring-color, #93c5fd) 48%, transparent 52%);
    transform: translate(-50%, -50%);
    opacity: 0.86;
    animation: shockRingExpand var(--ring-dur, 760ms) cubic-bezier(.14, .66, .2, 1) forwards;
}

.fx-ribbon {
    position: absolute;
    left: -35%;
    top: var(--ribbon-y, 40%);
    width: 170%;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg,
            transparent 0%,
            color-mix(in srgb, var(--ribbon-color, #facc15) 15%, transparent 85%) 8%,
            color-mix(in srgb, var(--ribbon-color, #facc15) 56%, #ffffff 44%) 48%,
            color-mix(in srgb, var(--ribbon-color, #facc15) 22%, transparent 78%) 92%,
            transparent 100%);
    box-shadow: 0 0 24px color-mix(in srgb, var(--ribbon-color, #facc15) 35%, transparent 65%);
    transform: translateY(-50%) rotate(var(--ribbon-tilt, -8deg));
    animation: ribbonSweep var(--ribbon-dur, 920ms) cubic-bezier(.14, .67, .18, .98) forwards;
    opacity: 0;
}

.fx-phase-banner {
    position: absolute;
    left: 50%;
    top: 26%;
    transform: translate(-50%, -50%);
    min-width: min(74vw, 460px);
    max-width: 84vw;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--banner-color, #f8fafc) 50%, transparent 50%);
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.42)),
        radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--banner-color, #f8fafc) 22%, transparent 78%), transparent 62%);
    box-shadow:
        0 18px 36px rgba(15, 23, 42, 0.42),
        0 0 22px color-mix(in srgb, var(--banner-color, #f8fafc) 30%, transparent 70%);
    text-align: center;
    color: #f8fafc;
    animation: phaseBannerIn 1120ms cubic-bezier(.15, .7, .2, .98) forwards;
}

.fx-phase-main {
    font-size: clamp(1rem, 3.2vw, 1.45rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--banner-color, #f8fafc) 75%, #ffffff 25%);
    text-shadow: 0 0 14px color-mix(in srgb, var(--banner-color, #f8fafc) 40%, transparent 60%);
}

.fx-phase-sub {
    margin-top: 4px;
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.95);
    letter-spacing: 0.02em;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -80px))) scale(0.4);
    }
}

@keyframes ambientTwinkle {
    0% {
        opacity: 0.12;
        transform: scale(0.75);
    }

    50% {
        opacity: 0.55;
        transform: scale(1.15);
    }

    100% {
        opacity: 0.14;
        transform: scale(0.8);
    }
}

@keyframes screenPulse {
    0% {
        opacity: 0;
        transform: scale(1.03);
    }

    20% {
        opacity: var(--pulse-opacity, 0.32);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes shockRingExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.84;
        border-width: 2px;
    }

    100% {
        width: var(--ring-size, 240px);
        height: var(--ring-size, 240px);
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes ribbonSweep {
    0% {
        transform: translate(-10%, -50%) rotate(var(--ribbon-tilt, -8deg));
        opacity: 0;
    }

    18% {
        opacity: 0.85;
    }

    100% {
        transform: translate(8%, -50%) rotate(var(--ribbon-tilt, -8deg));
        opacity: 0;
    }
}

@keyframes phaseBannerIn {
    0% {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 20px)) scale(0.92);
    }

    18% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    74% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 14px)) scale(1.02);
    }
}

@keyframes atmosphereFloat {
    0% {
        transform: translate3d(-1%, -1%, 0) scale(1);
    }

    50% {
        transform: translate3d(2%, 1%, 0) scale(1.04);
    }

    100% {
        transform: translate3d(-1%, -1%, 0) scale(1);
    }
}

@keyframes arenaGridDrift {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 0 28px, 24px 0;
    }
}

@keyframes urgentPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes finalePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.35);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

@keyframes bgFloatA {
    0% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(18px, 10px, 0);
    }

    100% {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes bgFloatB {
    0% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(-20px, -12px, 0);
    }

    100% {
        transform: translate3d(0, 0, 0);
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px 12px 28px;
    }

    body.quiz-fullscreen {
        padding: 8px 10px 12px;
    }

    body.quiz-fullscreen .pill-actions {
        top: 8px;
        right: 8px;
    }

    .live-page-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 16px 16px;
        border-radius: 20px;
    }

    .pill-actions {
        justify-content: flex-start;
    }

    .live-status-strip {
        grid-template-columns: 1fr 1fr;
    }

    .score-popup {
        min-width: min(420px, 92vw);
        font-size: 0.95rem;
        padding: 10px 14px;
        top: 14px;
    }

    .rank-overlay-inner {
        width: min(520px, 96vw);
        padding: 16px 14px 14px;
        border-radius: 16px;
    }

    .rank-list {
        max-height: min(52vh, 320px);
    }

    .rank-row {
        font-size: 0.9rem;
        padding: 5px 0;
    }

    .rank-no {
        width: 54px;
    }

    .rank-score {
        width: 84px;
    }

    .mode-brief-card,
    .result-stage-card {
        border-radius: 16px;
        padding: 16px 14px;
    }

    .mode-brief-lines {
        font-size: 0.92rem;
    }

    .result-stage-main {
        font-size: 1.34rem;
    }

    .live-game-hud .hud-chip-row {
        gap: 5px;
    }

    .live-game-hud .hud-chip {
        font-size: 0.72rem;
        padding: 4px 7px;
    }

    .live-game-hud .hud-meters {
        grid-template-columns: 1fr;
    }

    .territory-grid {
        gap: 2px;
    }

    .territory-cell {
        width: calc(var(--territory-cell, 26px) - 2px);
        height: calc(var(--territory-cell, 26px) - 2px);
    }

    .personal-feedback-kpis {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   보스전 HUD
   ========================================= */
.boss-hud {
    margin: 10px 0;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(160deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    border: 1px solid rgba(233, 69, 96, 0.4);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.5), inset 0 0 30px rgba(233, 69, 96, 0.08);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
}

.boss-hud::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(233, 69, 96, 0.15), transparent 60%);
    pointer-events: none;
}

.boss-character {
    text-align: center;
    position: relative;
    z-index: 1;
}

.boss-emoji {
    font-size: 3.5rem;
    line-height: 1;
    display: inline-block;
    animation: bossIdle 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(233, 69, 96, 0.4));
}

.boss-hud.boss-hit .boss-emoji {
    animation: bossHitShake 0.4s ease-out;
}

.boss-hud.boss-rage .boss-emoji {
    animation: bossRage 0.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(239, 68, 68, 0.7));
}

.boss-hud.boss-defeated .boss-emoji {
    animation: bossDefeat 1s ease-out forwards;
}

.boss-name {
    font-size: 1rem;
    font-weight: 800;
    margin-top: 4px;
    color: #2563eb;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.14);
    position: relative;
    z-index: 1;
}

.boss-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.boss-status-badge.normal {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.boss-status-badge.rage {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: urgentPulse 0.6s ease-in-out infinite;
}

.boss-status-badge.weak {
    background: rgba(37, 99, 235, 0.12);
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.32);
}

.boss-hp-area {
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.boss-hp-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.boss-hp-track {
    height: 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
    position: relative;
}

.boss-hp-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444, #f97316, #22c55e);
    background-size: 300% 100%;
    transition: width 0.5s ease-out;
    position: relative;
}

.boss-hp-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: hpShine 2s ease-in-out infinite;
}

.boss-hp-track.damage .boss-hp-fill {
    animation: hpBarDamage 0.4s ease-out;
}

.boss-hp-track.damage-heavy .boss-hp-fill {
    animation-duration: 0.52s;
}

.boss-hp-track.damage-critical .boss-hp-fill {
    animation-duration: 0.68s;
    filter: saturate(1.18);
}

.boss-damage-popup {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: damagePopup 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

/* =========================================
   카운트다운 애니메이션
   ========================================= */
.countdown-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 250;
    pointer-events: none;
}

.countdown-number {
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 40px rgba(251, 191, 36, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: countdownPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.countdown-number.go {
    color: #22c55e;
    text-shadow: 0 0 40px rgba(34, 197, 94, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* =========================================
   화면 흔들림 (오답/보스)
   ========================================= */
body.screen-shake {
    animation: screenShake 0.35s ease-out;
}

/* =========================================
   정답/오답 플래시
   ========================================= */
.correct-screen-flash {
    position: fixed;
    inset: 0;
    background: rgba(34, 197, 94, 0.15);
    pointer-events: none;
    z-index: 240;
    animation: flashFade 0.5s ease-out forwards;
}

.wrong-screen-flash {
    position: fixed;
    inset: 0;
    background: rgba(239, 68, 68, 0.15);
    pointer-events: none;
    z-index: 240;
    animation: flashFade 0.5s ease-out forwards;
}

body.boss-stage-active .correct-screen-flash,
body.boss-stage-active .wrong-screen-flash {
    display: none !important;
}

/* =========================================
   콤보 불꽃
   ========================================= */
.combo-fire-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fef3c7;
    background: linear-gradient(135deg, #f97316, #ef4444, #dc2626);
    border: 1px solid rgba(251, 146, 60, 0.6);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
    animation: comboFire 0.8s ease-in-out infinite;
}

/* =========================================
   새 키프레임
   ========================================= */
@keyframes countdownPop {
    0% {
        opacity: 0;
        transform: scale(2.5);
    }
    30% {
        opacity: 1;
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.98);
        opacity: 1;
    }
    100% {
        transform: scale(0.4);
        opacity: 0;
    }
}

@keyframes screenShake {
    0% { transform: translate(0, 0); }
    15% { transform: translate(-4px, 2px); }
    30% { transform: translate(4px, -2px); }
    45% { transform: translate(-3px, -1px); }
    60% { transform: translate(3px, 1px); }
    75% { transform: translate(-2px, 0); }
    100% { transform: translate(0, 0); }
}

@keyframes bossIdle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-4px) rotate(-2deg); }
    75% { transform: translateY(-2px) rotate(2deg); }
}

@keyframes bossHitShake {
    0% { transform: translateX(0) scale(1); }
    15% { transform: translateX(-12px) translateY(2px) scale(0.93); }
    30% { transform: translateX(10px) translateY(-3px) scale(1.06); }
    45% { transform: translateX(-8px) scale(0.98); }
    60% { transform: translateX(6px) scale(1.03); }
    75% { transform: translateX(-3px) scale(1.01); }
    100% { transform: translateX(0) scale(1); }
}

@keyframes bossRage {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-3px) scale(1.05); }
    75% { transform: translateX(3px) scale(1.05); }
}

@keyframes bossDefeat {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(10deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(45deg); opacity: 0; }
}

@keyframes hpBarDamage {
    0% { filter: brightness(1); }
    20% { filter: brightness(1.45) saturate(1.1); }
    45% { filter: brightness(0.84) saturate(1.28); }
    72% { filter: brightness(1.18) saturate(1.12); }
    100% { filter: brightness(1); }
}

@keyframes hpShine {
    0% { background-position: -100% 0; }
    50% { background-position: 200% 0; }
    100% { background-position: -100% 0; }
}

@keyframes damagePopup {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.5); }
    30% { transform: translateX(-50%) translateY(-10px) scale(1.2); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.8); }
}

@keyframes comboFire {
    0%, 100% { box-shadow: 0 0 8px rgba(249, 115, 22, 0.3); }
    50% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.6), 0 0 30px rgba(239, 68, 68, 0.3); }
}

@keyframes flashFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes victoryGlow {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
    50% { box-shadow: 0 0 30px 10px rgba(251, 191, 36, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

@keyframes flagPlant {
    0% { transform: translateY(-20px) scale(0); opacity: 0; }
    50% { transform: translateY(2px) scale(1.2); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes bossEntrance {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.3) rotate(5deg); opacity: 1; }
    80% { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 보스전 팀 HP (선택적) */
.boss-team-hp {
    margin-top: 8px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
    z-index: 1;
}

.boss-team-hp-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 3px;
}

.boss-team-hp-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.5);
    overflow: hidden;
}

.boss-team-hp-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.4s ease-out;
}

/* 보스 반격 경고 */
.boss-attack-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
    pointer-events: none;
    z-index: 240;
    animation: flashFade 0.6s ease-out forwards;
}

/* =========================================
   Boss Raid Stage-First
   ========================================= */
.boss-stage-shell {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 180;
    overflow: hidden;
    pointer-events: none;
    --boss-stage-rail-width: clamp(280px, 22vw, 340px);
    --boss-stage-rail-gap: 24px;
    --boss-stage-main-shift: 0px;
}

.boss-stage-shell.show {
    display: block;
}

.boss-stage-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--live-theme-danger, #f87171) 18%, transparent), transparent 30%),
        radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--live-theme-primary, #818cf8) 18%, transparent), transparent 24%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--live-theme-warning, #f59e0b) 14%, transparent), transparent 30%),
        linear-gradient(180deg, color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 90%, #020617) 0%, color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 70%, #020617) 46%, #020617 100%);
    transition: filter 0.3s ease, background 0.3s ease;
}

.boss-stage-backdrop::before,
.boss-stage-backdrop::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
}

.boss-stage-backdrop::before {
    width: 62vw;
    height: 62vw;
    left: -14vw;
    top: -22vw;
    background: radial-gradient(circle, color-mix(in srgb, var(--live-theme-primary, #818cf8) 18%, transparent), transparent 60%);
    filter: blur(30px);
    animation: bossStageNebula 10s ease-in-out infinite;
}

.boss-stage-backdrop::after {
    left: 0;
    right: 0;
    bottom: -18vh;
    height: 58vh;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--live-theme-warning, #f59e0b) 16%, transparent), transparent 42%),
        linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(2, 6, 23, 0.95) 70%, rgba(2, 6, 23, 1) 100%);
}

.boss-stage-arena {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 136px 28px 28px;
}

.boss-stage-top-rail {
    position: absolute;
    top: 18px;
    left: 20px;
    right: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 16px;
    align-items: center;
    z-index: 3;
}

.boss-stage-left-rail {
    position: absolute;
    top: 18px;
    left: 20px;
    width: var(--boss-stage-rail-width);
    display: none;
    gap: 12px;
    z-index: 4;
}

.boss-stage-identity,
.boss-stage-hp-area,
.boss-stage-mission-card,
.boss-stage-status-mini,
.boss-stage-modal-shell,
.boss-stage-message-card,
.boss-stage-ceremony-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(160deg, rgba(2, 6, 23, 0.86), rgba(15, 23, 42, 0.82));
    box-shadow: 0 24px 46px rgba(2, 6, 23, 0.42);
    backdrop-filter: blur(12px);
}

.boss-stage-identity {
    padding: 16px 18px;
    border-radius: 24px;
}

.boss-stage-mission-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 24px;
}

.boss-stage-mission-card[data-tone="boost"] {
    border-color: rgba(74, 222, 128, 0.38);
    box-shadow: 0 20px 38px rgba(21, 128, 61, 0.22);
}

.boss-stage-mission-card[data-tone="warning"],
.boss-stage-mission-card[data-tone="danger"] {
    border-color: rgba(251, 146, 60, 0.42);
    box-shadow: 0 20px 38px rgba(180, 83, 9, 0.24);
}

.boss-stage-mission-card[data-tone="defense"] {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 20px 38px rgba(30, 64, 175, 0.24);
}

.boss-stage-mission-card .live-mission-title {
    font-size: clamp(1.02rem, 1.8vw, 1.28rem);
}

.boss-stage-mission-card .live-mission-detail {
    line-height: 1.45;
}

.boss-stage-mission-card .live-mission-cue {
    max-width: 132px;
    white-space: normal;
    text-align: right;
    justify-self: end;
}

.boss-stage-overline,
.boss-stage-message-overline,
.boss-stage-modal-eyebrow {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #f59e0b;
}

.boss-stage-name-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.boss-stage-name-stack {
    display: grid;
    gap: 4px;
}

.boss-stage-name-row .boss-name {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 2.2rem);
    font-weight: 900;
    color: #f8fafc;
    text-shadow: 0 10px 28px rgba(244, 63, 94, 0.28);
}

.boss-stage-phase-text {
    font-size: 0.9rem;
    color: #f8fafc;
    opacity: 0.84;
    letter-spacing: 0.08em;
}

.boss-stage-hp-area {
    padding: 16px 18px;
    border-radius: 24px;
}

.team-stage-top-metric {
    padding: 16px 18px;
    border-radius: 24px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    background: linear-gradient(160deg, rgba(2, 6, 23, 0.86), rgba(15, 23, 42, 0.82));
    box-shadow: 0 24px 46px rgba(2, 6, 23, 0.42);
    backdrop-filter: blur(12px);
}

.team-stage-top-metric.hidden,
.team-stage-objective-board.hidden {
    display: none;
}

.team-stage-top-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.team-stage-top-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.team-stage-top-item span {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.team-stage-top-item strong {
    font-size: 0.96rem;
    color: #f8fafc;
}

.boss-hp-track {
    height: 18px;
    position: relative;
    overflow: hidden;
}

.boss-hp-ghost {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.82), rgba(251, 191, 36, 0.34));
    opacity: 0.62;
    transition: width 0.9s cubic-bezier(0.2, 1, 0.3, 1);
}

.boss-stage-phase-banner {
    position: absolute;
    top: 104px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92));
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.44);
    z-index: 3;
}

.boss-stage-phase-banner[data-tone="boost"] {
    border-color: rgba(34, 197, 94, 0.42);
    color: #dcfce7;
}

.boss-stage-phase-banner[data-tone="warning"],
.boss-stage-phase-banner[data-tone="danger"] {
    border-color: rgba(251, 146, 60, 0.42);
    color: #ffedd5;
}

.boss-stage-phase-banner[data-tone="defense"] {
    border-color: rgba(96, 165, 250, 0.42);
    color: #dbeafe;
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-hp-area {
    display: none;
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-name {
    font-size: clamp(2.1rem, 4.5vw, 3rem);
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-phase-text {
    color: #cbd5e1;
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-phase-banner {
    top: 108px;
}

.team-stage-objective-board {
    position: absolute;
    top: 168px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 60vw);
    z-index: 2;
    pointer-events: none;
}

.boss-stage-shell[data-stage-mode="territory_war"] .team-stage-objective-board {
    top: 50px;
    width: min(1120px, 82vw);
    z-index: 3;
    pointer-events: auto;
}

body.live-stage-renderer-ready.live-mode-territory_war .team-stage-board.territory {
    background: linear-gradient(165deg, rgba(2, 6, 23, 0.72), rgba(15, 23, 42, 0.52));
    box-shadow: 0 24px 46px rgba(2, 6, 23, 0.34);
}

.team-stage-board {
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 26px;
    background: linear-gradient(165deg, rgba(2, 6, 23, 0.84), rgba(15, 23, 42, 0.78));
    box-shadow: 0 24px 46px rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(12px);
    padding: 18px 20px;
}

.team-stage-board-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    color: #e2e8f0;
}

.team-stage-board-head strong {
    font-size: 1rem;
}

.team-stage-board-head span {
    font-size: 0.84rem;
    color: #94a3b8;
}

.team-stage-board.territory {
    position: relative;
    padding: 24px 26px 22px;
    border-radius: 32px;
    border-color: rgba(96, 165, 250, 0.3);
    background:
        radial-gradient(circle at 15% 16%, rgba(45, 212, 191, 0.16), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(96, 165, 250, 0.16), transparent 26%),
        linear-gradient(160deg, rgba(3, 10, 30, 0.96), rgba(8, 20, 44, 0.92) 52%, rgba(15, 23, 42, 0.88));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 26px 56px rgba(2, 6, 23, 0.42);
}

.team-stage-board.territory::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 0 1px, transparent 1px 72px),
        linear-gradient(0deg, rgba(148, 163, 184, 0.025) 0 1px, transparent 1px 72px);
    opacity: 0.45;
}

.team-stage-board.territory .team-stage-board-head {
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.team-stage-board.territory .team-stage-board-head strong {
    font-size: 1.08rem;
    letter-spacing: 0.1em;
}

.team-stage-board.territory .team-stage-board-head span {
    max-width: 52ch;
    text-align: right;
}

.team-stage-board.territory.claim {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(251, 191, 36, 0.2),
        0 28px 64px rgba(2, 6, 23, 0.45);
}

.team-stage-board.territory.locked {
    border-color: rgba(248, 250, 252, 0.16);
    background:
        radial-gradient(circle at 15% 16%, rgba(250, 204, 21, 0.12), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(148, 163, 184, 0.14), transparent 26%),
        linear-gradient(160deg, rgba(3, 10, 30, 0.96), rgba(15, 23, 42, 0.9) 58%, rgba(30, 41, 59, 0.86));
}

.team-stage-board-body {
    position: relative;
    z-index: 1;
}

.team-stage-territory-meta {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.team-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.58);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.team-stage-badges,
.team-relay-queue {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-name {
    font-size: clamp(2rem, 4.4vw, 3rem);
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-phase-text {
    color: #f8fafc;
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-boss-wrap {
    inset: 78px 0 164px;
}

.boss-stage-shell[data-stage-mode="map_expedition"] .boss-stage-boss-wrap {
    inset: 72px 0 164px;
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-boss-aura {
    bottom: 14vh;
    width: min(48vw, 620px);
    height: min(48vw, 620px);
    background:
        radial-gradient(circle, rgba(251, 191, 36, 0.22), rgba(251, 191, 36, 0.06) 36%, rgba(45, 212, 191, 0.08) 54%, transparent 72%);
    filter: blur(16px);
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-boss {
    bottom: 4vh;
    width: min(42vw, 540px);
    height: min(42vh, 420px);
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-floor-glow {
    width: min(34vw, 420px);
    background: radial-gradient(circle, rgba(251, 191, 36, 0.18), rgba(20, 184, 166, 0.05) 56%, transparent 74%);
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-glyph {
    font-size: clamp(7rem, 16vw, 10rem);
    opacity: 0.88;
    filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 34px rgba(251, 191, 36, 0.28));
}

.boss-stage-shell[data-stage-mode="solo_treasure"] .team-stage-objective-board {
    top: 148px;
    width: min(980px, 68vw);
    z-index: 3;
    pointer-events: auto;
}

.boss-stage-shell[data-stage-mode="map_expedition"] .boss-stage-boss,
.boss-stage-shell[data-stage-mode="map_expedition"] .boss-stage-boss-aura {
    display: none;
}

body.boss-stage-desktop-rail.treasure-stage-active .team-stage-objective-board {
    left: calc(50% + var(--boss-stage-main-shift));
    width: min(880px, calc(100vw - var(--boss-stage-rail-width) - 150px));
}

body.treasure-stage-active .boss-stage-quiz-dock {
    width: min(460px, 32vw);
}

body.treasure-stage-active .boss-stage-combat-hud {
    pointer-events: auto;
}

body.treasure-stage-active .boss-stage-combat-hud .hud-section.treasure {
    background:
        linear-gradient(160deg, rgba(8, 18, 39, 0.92), rgba(16, 28, 53, 0.82)),
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 40%);
    border-color: rgba(250, 204, 21, 0.16);
}

.treasure-stage-board {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(250, 204, 21, 0.16);
    background:
        radial-gradient(circle at 12% 16%, rgba(251, 191, 36, 0.14), transparent 26%),
        radial-gradient(circle at 86% 14%, rgba(45, 212, 191, 0.12), transparent 24%),
        linear-gradient(160deg, rgba(5, 12, 29, 0.96), rgba(11, 23, 49, 0.94) 52%, rgba(15, 23, 42, 0.9));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 26px 60px rgba(2, 6, 23, 0.44);
    padding: 22px 24px 20px;
}

.treasure-stage-board::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.025) 0 1px, transparent 1px 68px),
        linear-gradient(0deg, rgba(148, 163, 184, 0.02) 0 1px, transparent 1px 68px);
    opacity: 0.34;
}

.treasure-stage-board-head,
.treasure-target-picker-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.treasure-stage-board-head strong {
    color: #f8fafc;
    font-size: 1.08rem;
    letter-spacing: 0.08em;
}

.treasure-stage-board-head span {
    color: #94a3b8;
    font-size: 0.84rem;
    text-align: right;
}

.treasure-altar-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.treasure-altar-pedestal,
.treasure-stage-summary,
.treasure-target-picker-card,
.treasure-reward-inline {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(12px);
}

.treasure-altar-pedestal {
    min-height: 146px;
    padding: 18px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 10px;
}

.treasure-altar-pedestal.waiting {
    min-height: 220px;
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.18), transparent 38%),
        rgba(15, 23, 42, 0.58);
}

.treasure-altar-glyph {
    font-size: 2.4rem;
    color: #fde68a;
    text-shadow: 0 0 26px rgba(251, 191, 36, 0.28);
}

.treasure-altar-copy {
    color: #e2e8f0;
    font-size: 0.98rem;
    line-height: 1.5;
}

.treasure-chest-choice-row {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.treasure-chest-choice {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 18px 16px;
    border-radius: 26px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.64)),
        radial-gradient(circle at top, rgba(250, 204, 21, 0.08), transparent 44%);
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.treasure-chest-choice:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(250, 204, 21, 0.32);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.34), 0 0 0 1px rgba(250, 204, 21, 0.12);
}

.treasure-chest-choice.rarity-rare {
    background:
        linear-gradient(180deg, rgba(8, 20, 44, 0.92), rgba(15, 23, 42, 0.72)),
        radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 40%);
}

.treasure-chest-choice.rarity-epic {
    background:
        linear-gradient(180deg, rgba(38, 8, 57, 0.94), rgba(18, 24, 48, 0.76)),
        radial-gradient(circle at top, rgba(217, 70, 239, 0.16), transparent 40%);
}

.treasure-chest-art,
.treasure-reward-art,
.treasure-slot-icon,
.treasure-item-icon {
    display: grid;
    place-items: center;
}

.treasure-chest-art {
    min-height: 136px;
}

.treasure-svg-frame {
    width: 118px;
    height: 118px;
}

.treasure-slot-icon .treasure-svg-frame,
.treasure-reward-art .treasure-svg-frame,
.treasure-item-icon .treasure-svg-frame {
    width: 72px;
    height: 72px;
}

.treasure-chest-copy,
.treasure-reward-copy,
.treasure-slot-copy,
.treasure-item-copy {
    display: grid;
    gap: 4px;
}

.treasure-chest-copy strong,
.treasure-reward-copy strong,
.treasure-slot-copy strong,
.treasure-item-copy strong {
    color: #f8fafc;
    font-size: 0.98rem;
}

.treasure-chest-copy span,
.treasure-reward-copy span,
.treasure-slot-copy span,
.treasure-item-copy span,
.treasure-stage-footnote,
.treasure-feed-row,
.treasure-feed-empty,
.treasure-target-picker-sub {
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.45;
}

.treasure-stage-footnote {
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.treasure-reward-reveal {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.treasure-discard-grid,
.treasure-stage-summary-grid {
    margin-top: 18px;
    display: grid;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.treasure-discard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.treasure-discard-choice,
.treasure-slot {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: center;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.58);
    color: #f8fafc;
    padding: 12px 14px;
    text-align: left;
}

.treasure-discard-choice {
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.treasure-discard-choice:hover,
.treasure-slot:hover {
    border-color: rgba(250, 204, 21, 0.28);
    transform: translateY(-2px);
}

.treasure-slot-grid {
    display: grid;
    gap: 10px;
}

.treasure-slot {
    width: 100%;
}

.treasure-slot.empty {
    grid-template-columns: 1fr;
    min-height: 88px;
    place-items: center;
    text-align: center;
    background: rgba(15, 23, 42, 0.34);
}

.treasure-slot-empty {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.86rem;
}

.treasure-slot.critical {
    border-color: rgba(248, 113, 113, 0.36);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.12);
}

.treasure-stage-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.treasure-stage-summary,
.treasure-target-picker-card {
    padding: 16px;
}

.treasure-stage-summary-title,
.treasure-target-picker-title {
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.treasure-rank-mini-list,
.treasure-target-picker-list {
    display: grid;
    gap: 8px;
}

.treasure-rank-row,
.treasure-target-row,
.treasure-feed-row {
    display: grid;
    align-items: center;
    gap: 8px;
    border-radius: 16px;
}

.treasure-rank-row {
    grid-template-columns: 36px 1fr auto;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.44);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}

.treasure-rank-row.me {
    border-color: rgba(250, 204, 21, 0.3);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.6));
}

.treasure-feed-preview {
    display: grid;
    gap: 8px;
}

.treasure-feed-row {
    grid-template-columns: 12px 1fr;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.36);
}

.treasure-feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(180deg, #93c5fd, #2563eb);
    align-self: center;
}

.treasure-reward-inline {
    margin-top: 16px;
    padding: 16px;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    align-items: center;
}

.treasure-target-picker {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(10px);
}

.treasure-target-picker.hidden {
    display: none;
}

.treasure-target-picker-card {
    width: min(780px, calc(100vw - 32px));
    max-height: min(82vh, 860px);
    overflow: auto;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.12), transparent 34%),
        linear-gradient(165deg, rgba(4, 10, 27, 0.96), rgba(10, 20, 43, 0.94));
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.52);
}

.treasure-target-picker-eyebrow {
    color: #f59e0b;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.treasure-target-picker-close {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.treasure-target-row {
    width: 100%;
    grid-template-columns: 56px 1.2fr auto auto auto;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.52);
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.treasure-target-row:hover {
    transform: translateY(-2px);
    border-color: rgba(250, 204, 21, 0.3);
}

.treasure-target-row.disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.team-battle-board,
.team-relay-board {
    display: grid;
    gap: 12px;
}

.team-battle-lane,
.team-relay-lane {
    --team-stage-color: rgba(96, 165, 250, 0.9);
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.team-battle-lane-head,
.team-relay-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: #f8fafc;
}

.team-battle-lane-bar {
    margin-top: 10px;
    height: 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    overflow: hidden;
}

.team-battle-lane-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--team-stage-color), rgba(250, 204, 21, 0.92));
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.24);
}

.team-battle-lane-meta {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.team-relay-rep {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #f8fafc;
}

.boss-stage-boss-wrap {
    position: absolute;
    inset: 132px 0 190px;
    z-index: 1;
}

.live-stage-renderer-mount {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.live-stage-renderer-mount canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.boss-stage-shell[data-stage-mode="map_expedition"] .live-stage-renderer-mount {
    display: block;
    inset: 16px;
    z-index: 2;
    pointer-events: auto;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at 16% 18%, rgba(56, 189, 248, 0.14), transparent 26%),
        linear-gradient(145deg, rgba(12, 18, 30, 0.88), rgba(9, 33, 53, 0.82));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.45), 0 24px 48px rgba(2, 6, 23, 0.28);
}

body.map-stage-active .live-mission-banner {
    display: none !important;
}

.map-stage-shell {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 180;
    overflow: hidden;
    pointer-events: none;
}

.map-stage-shell.show {
    display: block;
}

.map-stage-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(34, 197, 94, 0.16), transparent 24%),
        radial-gradient(circle at 84% 12%, rgba(56, 189, 248, 0.16), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.12), transparent 30%),
        linear-gradient(180deg, #0f172a 0%, #102033 54%, #08101d 100%);
}

.map-stage-backdrop::before,
.map-stage-backdrop::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
}

.map-stage-backdrop::before {
    left: -12vw;
    top: -18vw;
    width: 54vw;
    height: 54vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 62%);
    filter: blur(24px);
}

.map-stage-backdrop::after {
    right: -10vw;
    bottom: -16vw;
    width: 46vw;
    height: 46vw;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.1), transparent 64%);
    filter: blur(20px);
}

.map-stage-arena {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18px 20px 20px;
}

.map-stage-topbar,
.map-stage-board,
.map-stage-panel,
.map-stage-phase-banner {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(160deg, rgba(3, 10, 24, 0.9), rgba(15, 23, 42, 0.82));
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(14px);
}

.map-stage-topbar {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.82fr);
    gap: 14px;
    align-items: stretch;
    padding: 14px 16px;
    border-radius: 24px;
    pointer-events: auto;
}

.map-stage-course-card {
    display: grid;
    gap: 8px;
}

.map-stage-overline,
.map-stage-panel-eyebrow {
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #93c5fd;
}

.map-stage-title-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.map-stage-title-stack {
    display: grid;
    gap: 4px;
}

.map-stage-title {
    font-size: clamp(1.46rem, 2.4vw, 2.2rem);
    font-weight: 900;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.map-stage-phase {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #cbd5e1;
}

.map-stage-presence-badge,
.map-stage-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    background: rgba(8, 47, 73, 0.46);
    color: #e0f2fe;
    font-size: 0.8rem;
    font-weight: 700;
}

.map-stage-top-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.map-stage-metric-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.44);
}

.map-stage-metric-card span {
    font-size: 0.74rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.map-stage-metric-card strong {
    font-size: 1rem;
    color: #f8fafc;
}

.map-stage-phase-banner {
    position: absolute;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 11px 20px;
    border-radius: 999px;
    color: #f8fafc;
    font-size: 0.96rem;
    font-weight: 800;
    pointer-events: none;
}

.map-stage-phase-banner[data-tone="boost"] {
    border-color: rgba(74, 222, 128, 0.4);
    color: #dcfce7;
}

.map-stage-phase-banner[data-tone="warning"],
.map-stage-phase-banner[data-tone="danger"] {
    border-color: rgba(251, 146, 60, 0.42);
    color: #ffedd5;
}

.map-stage-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 16px;
    height: calc(100% - 118px);
    margin-top: 14px;
}

.map-stage-board-wrap,
.map-stage-sidebar {
    min-height: 0;
}

.map-stage-board {
    position: relative;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 28px;
    pointer-events: auto;
    background:
        radial-gradient(circle at 10% 12%, rgba(125, 211, 252, 0.08), transparent 18%),
        linear-gradient(180deg, rgba(9, 18, 32, 0.96), rgba(9, 25, 42, 0.94));
}

.map-stage-renderer-mount {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.map-stage-renderer-mount canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.map-stage-question-surface {
    position: absolute;
    inset: 22px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.map-stage-question-surface:empty {
    display: none;
}

.map-stage-question-surface > * {
    pointer-events: auto;
}

.map-stage-question-surface .boss-stage-modal-shell,
.map-stage-question-surface .boss-stage-ceremony-card,
.map-stage-question-surface .boss-stage-message-card {
    width: min(720px, calc(100% - 24px));
    max-height: calc(100% - 12px);
    overflow: auto;
}

.map-stage-interaction-hint {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    z-index: 3;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(8, 15, 28, 0.72);
    color: #dbeafe;
    font-size: 0.88rem;
    line-height: 1.45;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(10px);
}

.map-stage-sidebar {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(220px, 0.88fr);
    gap: 14px;
}

.map-stage-panel {
    min-height: 0;
    overflow: auto;
    padding: 16px;
    border-radius: 24px;
    pointer-events: auto;
}

.map-stage-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.map-stage-panel-title {
    font-size: 1.04rem;
    font-weight: 800;
    color: #f8fafc;
}

.map-stage-roster {
    display: grid;
    gap: 10px;
}

.map-stage-roster-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.42);
}

.map-stage-roster-row.me {
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(30, 64, 175, 0.16);
}

.map-stage-roster-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.map-stage-roster-copy strong {
    color: #f8fafc;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-stage-roster-copy span {
    color: #94a3b8;
    font-size: 0.76rem;
}

.map-stage-roster-status {
    font-size: 0.76rem;
    font-weight: 700;
    color: #cbd5e1;
    text-align: right;
}

.map-stage-empty {
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.32);
    color: #94a3b8;
    font-size: 0.86rem;
    line-height: 1.45;
}

.map-expedition-touch-controls {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 24;
    display: flex;
    justify-content: flex-end;
}

.map-touch-pad {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.28);
}

.map-touch-row {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    gap: 8px;
}

.map-touch-btn {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.92));
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.map-touch-btn.action {
    background: linear-gradient(145deg, rgba(14, 116, 144, 0.92), rgba(14, 165, 233, 0.84));
}

.map-touch-btn.sprint {
    width: 100%;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.92), rgba(251, 191, 36, 0.84));
    font-size: 0.92rem;
    letter-spacing: 0.04em;
}

.map-touch-btn:active {
    transform: translateY(1px) scale(0.98);
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-boss-wrap {
    inset: 52px 0 140px;
}

.boss-stage-shell[data-stage-mode="territory_war"] .live-stage-renderer-mount {
    z-index: 2;
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-boss,
.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-boss-aura {
    display: none;
}

.boss-stage-shell[data-stage-mode="territory_war"] .boss-stage-impact-layer {
    inset: 32px 8vw 0;
}

.boss-stage-boss-aura,
.boss-stage-boss {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.boss-stage-boss-aura {
    bottom: 12vh;
    width: min(54vw, 720px);
    height: min(54vw, 720px);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(244, 63, 94, 0.36), rgba(244, 63, 94, 0.08) 36%, rgba(59, 130, 246, 0.04) 58%, transparent 72%);
    filter: blur(18px);
    animation: bossAuraPulse 2.8s ease-in-out infinite;
}

.boss-stage-boss {
    bottom: 0;
    width: min(62vw, 820px);
    height: min(66vh, 760px);
}

.boss-stage-floor-glow {
    position: absolute;
    left: 50%;
    bottom: 10%;
    width: min(42vw, 520px);
    height: min(12vw, 140px);
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.28), rgba(251, 146, 60, 0.06) 55%, transparent 72%);
    filter: blur(12px);
}

.boss-stage-shadow {
    position: absolute;
    left: 50%;
    bottom: 7%;
    width: min(38vw, 460px);
    height: min(9vw, 110px);
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(2, 6, 23, 0.68), transparent 72%);
}

.boss-stage-glyph {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    font-size: clamp(10rem, 24vw, 18rem);
    line-height: 1;
    filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 34px rgba(244, 63, 94, 0.28));
    animation: bossStageFloat 2.8s ease-in-out infinite;
    user-select: none;
}

.boss-stage-boss.boss-hit .boss-stage-glyph {
    animation: bossHitShake 0.42s ease-out;
}

.boss-stage-boss.boss-hit-heavy .boss-stage-glyph {
    animation-duration: 0.5s;
}

.boss-stage-boss.boss-hit-critical .boss-stage-glyph {
    animation-duration: 0.64s;
    filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 44px rgba(251, 146, 60, 0.4));
}

.boss-stage-boss.boss-rage .boss-stage-glyph {
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 40px rgba(239, 68, 68, 0.5));
}

.boss-stage-boss.boss-defeated .boss-stage-glyph {
    animation: bossDefeat 1.1s ease-out forwards;
}

.boss-stage-impact-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.boss-impact-fx {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    gap: 4px;
    place-items: center;
    isolation: isolate;
    color: #fef3c7;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    animation: bossImpactRise 1.45s ease-out forwards;
}

.boss-impact-fx.critical .boss-impact-number {
    color: #fde68a;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.36), 0 4px 18px rgba(0, 0, 0, 0.55);
}

.boss-impact-fx.miss .boss-impact-number {
    color: #fecaca;
}

.boss-impact-ring,
.boss-impact-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
}

.boss-impact-ring {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(251, 146, 60, 0.72);
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.24);
    transform: translate(-50%, -50%);
    animation: bossImpactRing 0.82s ease-out forwards;
}

.boss-impact-ring.critical {
    border-color: rgba(251, 191, 36, 0.9);
    box-shadow: 0 0 26px rgba(251, 191, 36, 0.34);
    animation-duration: 1.05s;
}

.boss-impact-burst {
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle, rgba(251, 146, 60, 0.22), transparent 45%),
        radial-gradient(circle, rgba(248, 113, 113, 0.16), transparent 62%);
    filter: blur(1px);
    animation: bossImpactBurst 0.72s ease-out forwards;
}

.boss-impact-burst.critical {
    background:
        radial-gradient(circle, rgba(251, 191, 36, 0.26), transparent 42%),
        radial-gradient(circle, rgba(249, 115, 22, 0.22), transparent 66%);
    animation-duration: 0.92s;
}

.boss-impact-fx.severity-heavy .boss-impact-number {
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
}

.boss-impact-fx.severity-critical .boss-impact-number {
    font-size: clamp(2rem, 3.6vw, 3.1rem);
}

.boss-impact-number {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    position: relative;
    z-index: 2;
}

.boss-impact-tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.64);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: #f8fafc;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 2;
}

.boss-stage-status-mini {
    width: 100%;
    padding: 14px;
    border-radius: 22px;
    display: grid;
    gap: 8px;
}

.boss-stage-mini-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    font-size: 0.82rem;
}

.boss-stage-mini-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.boss-stage-mini-item strong {
    color: #f8fafc;
    font-size: 0.92rem;
}

.boss-stage-quiz-dock {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: min(560px, 42vw);
    max-width: calc(100vw - 48px);
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: auto;
    opacity: 1;
    transition: transform 0.14s ease, opacity 0.08s linear, filter 0.12s ease;
    will-change: transform, opacity;
}

.boss-stage-quiz-dock[data-state="submitting"] {
    pointer-events: none;
}

.boss-stage-quiz-dock[data-state="submitting"] .boss-stage-modal-shell {
    filter: saturate(0.92) brightness(0.96);
}

.boss-stage-quiz-dock[data-state="resolving"] {
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(28px) scale(0.96);
}

.boss-stage-quiz-dock[data-state="territory-claim"] {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(34px) scale(0.95);
}

.boss-stage-quiz-dock[data-state="treasure-offer"] {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(30px) scale(0.96);
}

.boss-stage-quiz-dock[data-state="entering"] {
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.985);
}

body.boss-stage-desktop-rail .boss-stage-shell {
    --boss-stage-main-shift: calc((var(--boss-stage-rail-width) + var(--boss-stage-rail-gap)) / 2);
}

body.boss-stage-desktop-rail .boss-stage-left-rail {
    display: grid;
}

body.boss-stage-desktop-rail .boss-stage-top-rail {
    left: calc(20px + var(--boss-stage-rail-width) + var(--boss-stage-rail-gap));
}

body.boss-stage-desktop-rail .boss-stage-phase-banner {
    left: calc(50% + var(--boss-stage-main-shift));
}

body.boss-stage-desktop-rail .boss-stage-boss-aura,
body.boss-stage-desktop-rail .boss-stage-boss,
body.boss-stage-desktop-rail .boss-stage-quiz-dock {
    left: calc(50% + var(--boss-stage-main-shift));
}

body.boss-stage-desktop-rail .boss-stage-quiz-dock {
    width: min(560px, calc(100vw - var(--boss-stage-rail-width) - 120px));
}

body.boss-stage-desktop-rail.team-stage-active .team-stage-objective-board {
    left: calc(50% + var(--boss-stage-main-shift));
    width: min(700px, calc(100vw - var(--boss-stage-rail-width) - 160px));
}

body.boss-stage-desktop-rail.territory-stage-active .team-stage-objective-board {
    top: 36px;
    left: calc(20px + var(--boss-stage-rail-width) + 20px);
    transform: none;
    width: min(1080px, calc(100vw - var(--boss-stage-rail-width) - 72px));
}

body.boss-stage-desktop-rail .boss-stage-combat-hud {
    width: var(--boss-stage-rail-width);
}

body.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud {
    left: 16px;
    right: 16px;
    top: 148px;
    bottom: auto;
    width: auto;
}

body.team-stage-active .boss-stage-hp-area {
    display: none;
}

body.team-stage-active .boss-stage-boss-aura {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.08) 36%, rgba(34, 197, 94, 0.04) 58%, transparent 72%);
}

body.team-stage-active .boss-stage-floor-glow {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04) 55%, transparent 72%);
}

body.live-stage-renderer-ready.team-stage-active .territory-grid {
    background:
        radial-gradient(circle at center, rgba(15, 23, 42, 0.28), rgba(2, 6, 23, 0.54)),
        linear-gradient(180deg, rgba(2, 6, 23, 0.44), rgba(2, 6, 23, 0.28));
}

body.live-stage-renderer-ready.team-stage-active .territory-cell {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.82));
}

body.team-stage-active .boss-stage-glyph {
    font-size: clamp(8rem, 18vw, 12rem);
    opacity: 0.22;
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.36)) drop-shadow(0 0 22px rgba(59, 130, 246, 0.18));
}

.boss-stage-modal-shell,
.boss-stage-message-card,
.boss-stage-ceremony-card {
    padding: 18px 18px 16px;
    border-radius: 28px;
    color: var(--quiz-text-main);
}

.boss-stage-modal-shell {
    position: relative;
    overflow: hidden;
}

.boss-stage-quiz-meta {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.boss-stage-quiz-meta-title {
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--live-theme-primary, var(--primary, #818cf8));
}

.boss-stage-quiz-meta-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.boss-stage-quiz-meta .pill {
    font-size: 0.76rem;
    backdrop-filter: blur(8px);
}

body.boss-stage-desktop-rail .boss-stage-modal-shell {
    padding-top: 84px;
}

body.boss-stage-desktop-rail .boss-stage-quiz-meta {
    position: absolute;
    top: 18px;
    right: 18px;
    width: min(260px, calc(100% - 36px));
    margin-bottom: 0;
    justify-items: end;
    text-align: right;
}

body.boss-stage-desktop-rail .boss-stage-quiz-meta-chips {
    justify-content: flex-end;
}

.boss-stage-game-hud {
    margin-bottom: 12px;
}

.boss-stage-combat-hud {
    position: absolute;
    left: 20px;
    bottom: 24px;
    width: min(var(--boss-stage-rail-width), 320px);
    margin: 0;
    z-index: 4;
    pointer-events: none;
}

.boss-stage-combat-hud:empty {
    display: none;
}

.boss-stage-combat-hud .hud-section {
    margin-bottom: 6px;
    padding: 7px 8px;
}

.boss-stage-combat-hud .hud-section-title {
    font-size: 0.64rem;
    margin-bottom: 5px;
}

.boss-stage-combat-hud .hud-chip {
    padding: 4px 8px;
    font-size: 0.74rem;
}

.boss-stage-combat-hud .hud-meter {
    padding: 6px 7px;
}

.boss-stage-combat-hud .hud-meter-label {
    font-size: 0.7rem;
}

.boss-stage-question-card {
    margin: 0;
    padding: 16px;
    border-radius: 22px;
    background: var(--live-surface-bg);
    border: 1px solid var(--live-surface-border);
    box-shadow: var(--live-surface-shadow);
}

.boss-stage-question-card .question-text {
    font-size: clamp(1.02rem, 1.8vw, 1.2rem);
}

.boss-stage-quiz-dock[data-layout="classic-focus"] {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(1240px, calc(100vw - 48px));
    max-width: none;
    transform: translate(-50%, -50%);
}

.boss-stage-quiz-dock[data-layout="classic-focus"][data-state="resolving"] {
    transform: translate(-50%, calc(-50% + 28px)) scale(0.96);
}

.boss-stage-quiz-dock[data-layout="classic-focus"][data-state="entering"] {
    transform: translate(-50%, calc(-50% + 18px)) scale(0.985);
}

.classic-focus-modal-shell {
    padding: 18px;
    border-radius: 30px;
    max-height: min(84vh, 800px);
    overflow: auto;
    background:
        radial-gradient(circle at top, color-mix(in srgb, var(--live-theme-primary, #818cf8) 16%, transparent), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--live-theme-card, #ffffff) 84%, rgba(6, 11, 22, 0.92)), color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 76%, var(--live-theme-card, #ffffff)));
    border: 1px solid color-mix(in srgb, var(--live-theme-border, rgba(148, 163, 184, 0.22)) 96%, rgba(255, 255, 255, 0.06));
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.18);
}

.classic-focus-meta {
    margin-bottom: 14px;
}

.classic-focus-question-card {
    padding: 22px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--live-theme-primary, #818cf8) 12%, transparent), transparent 36%),
        linear-gradient(165deg,
            color-mix(in srgb, var(--live-theme-card, #ffffff) 88%, rgba(255, 255, 255, 0.04)),
            color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 74%, var(--live-theme-card, #ffffff)));
    border: 1px solid color-mix(in srgb, var(--live-theme-border, rgba(148, 163, 184, 0.22)) 94%, rgba(255, 255, 255, 0.08));
    box-shadow: 0 22px 48px rgba(2, 6, 23, 0.16);
}

.classic-focus-question-layout {
    display: grid;
    grid-template-columns: minmax(420px, 58%) minmax(300px, 1fr);
    gap: 20px;
    align-items: center;
}

.classic-focus-question-layout.no-media {
    grid-template-columns: minmax(0, 1fr);
}

.classic-focus-media-wrap {
    display: flex;
    min-width: 0;
}

.classic-focus-question-card .question-media {
    margin: 0;
    width: 100%;
    min-height: clamp(420px, 58vh, 520px);
    padding: 12px;
    background: color-mix(in srgb, var(--live-theme-card, #ffffff) 74%, transparent);
    border-color: color-mix(in srgb, var(--live-theme-border, rgba(148, 163, 184, 0.22)) 90%, rgba(255, 255, 255, 0.06));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.classic-focus-question-card .question-media img {
    width: 100%;
    height: 100%;
    max-height: clamp(440px, 62vh, 560px);
    object-fit: contain;
}

.classic-focus-body {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.classic-focus-question-card .question-text {
    font-size: clamp(1.18rem, 1.9vw, 1.48rem);
    line-height: 1.44;
    margin: 0;
    padding: 0;
}

.classic-focus-question-card .question-header {
    margin-bottom: 10px;
    padding-left: 0;
}

.classic-focus-question-card .options-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.classic-focus-question-card .options-list li {
    margin-bottom: 0;
}

.classic-focus-question-card .option-item {
    border-radius: 22px;
    padding: 11px 15px;
    min-height: 60px;
    font-size: 1rem;
}

.classic-focus-question-card .option-index {
    font-size: 0.82rem;
    margin-bottom: 3px;
}

.classic-focus-question-card .option-text {
    line-height: 1.42;
}

.classic-focus-footer {
    display: grid;
    gap: 6px;
}

.live-reveal-summary {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    background: color-mix(in srgb, var(--live-theme-card, #ffffff) 72%, transparent);
    border: 1px solid color-mix(in srgb, var(--live-surface-border) 86%, rgba(255, 255, 255, 0.04));
}

.live-reveal-summary-line {
    margin-top: 12px;
    font-weight: 700;
    color: var(--quiz-text-main);
}

.live-reveal-summary-result {
    margin-top: 4px;
    font-size: 1.1rem;
    color: var(--quiz-text-main);
}

.boss-stage-message-card,
.boss-stage-ceremony-card {
    text-align: center;
}

.boss-stage-message-title {
    margin-top: 8px;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.boss-stage-message-detail {
    margin-top: 8px;
    color: var(--quiz-text-sub);
    font-size: 0.98rem;
    line-height: 1.5;
}

.boss-stage-message-card.countdown,
.boss-stage-ceremony-card.victory {
    border-color: rgba(251, 191, 36, 0.28);
}

.boss-stage-ceremony-card.defeat {
    border-color: rgba(248, 113, 113, 0.26);
}

.boss-stage-countdown {
    margin: 18px 0 10px;
    font-size: clamp(3.6rem, 11vw, 6rem);
    font-weight: 900;
    color: #fde68a;
    text-shadow: 0 0 28px rgba(251, 191, 36, 0.34);
}

.boss-screen-punch .boss-stage-boss-wrap,
.boss-screen-punch .boss-stage-hp-area {
    animation: bossStagePunch 0.28s cubic-bezier(.18, .88, .28, 1);
}

.boss-screen-punch-critical .boss-stage-boss-wrap,
.boss-screen-punch-critical .boss-stage-hp-area {
    animation-duration: 0.38s;
}

.boss-stage-shell.boss-stage-impact-hit .boss-stage-backdrop {
    filter: saturate(1.08) brightness(1.02);
}

.boss-stage-shell.boss-stage-impact-critical .boss-stage-backdrop {
    filter: saturate(1.18) brightness(1.04);
}

.boss-stage-shell.boss-stage-impact-counter .boss-stage-backdrop {
    filter: saturate(0.92) brightness(0.95);
}

.boss-stage-shell.boss-stage-impact-hit .boss-stage-boss-aura {
    opacity: 0.96;
}

.boss-stage-shell.boss-stage-impact-critical .boss-stage-boss-aura {
    opacity: 1;
    filter: blur(14px) saturate(1.16);
}

.boss-stage-shell[data-phase="phase-2"] .boss-stage-backdrop {
    background:
        radial-gradient(circle at 20% 20%, rgba(239, 68, 68, 0.28), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.12), transparent 26%),
        radial-gradient(circle at 50% 100%, rgba(249, 115, 22, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(10, 7, 18, 0.98) 0%, rgba(17, 24, 39, 1) 100%);
}

.boss-stage-shell[data-phase="phase-3"] .boss-stage-backdrop {
    background:
        radial-gradient(circle at 20% 20%, rgba(239, 68, 68, 0.32), transparent 26%),
        radial-gradient(circle at 82% 0%, rgba(96, 165, 250, 0.12), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(249, 115, 22, 0.22), transparent 28%),
        linear-gradient(180deg, rgba(11, 5, 15, 1) 0%, rgba(10, 15, 28, 1) 100%);
}

.boss-stage-shell[data-phase="final"] .boss-stage-backdrop {
    background:
        radial-gradient(circle at 22% 18%, rgba(239, 68, 68, 0.34), transparent 26%),
        radial-gradient(circle at 78% 0%, rgba(251, 191, 36, 0.24), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(245, 158, 11, 0.22), transparent 28%),
        linear-gradient(180deg, rgba(23, 8, 12, 1) 0%, rgba(14, 19, 34, 1) 100%);
}

.boss-stage-shell[data-phase="defeated"] .boss-stage-backdrop {
    background:
        radial-gradient(circle at 50% 14%, rgba(251, 191, 36, 0.22), transparent 26%),
        radial-gradient(circle at 50% 100%, rgba(34, 197, 94, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(9, 14, 27, 1) 0%, rgba(4, 10, 20, 1) 100%);
}

body.boss-stage-active {
    max-width: none;
    margin-inline: 0;
    padding: 0;
    overflow: hidden;
}

body.boss-stage-active h1,
body.boss-stage-active .subtitle,
body.boss-stage-active .pill-actions,
body.boss-stage-active #studentProfileCard,
body.boss-stage-active #top5Section,
body.boss-stage-active #liveQuizCard {
    display: none !important;
}

body.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-strip {
    position: fixed;
    top: 18px;
    right: 20px;
    left: auto;
    width: min(360px, calc(100vw - 40px));
    margin: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    z-index: 260;
    background: rgba(2, 6, 23, 0.76);
}

body.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-item {
    padding: 6px 8px;
}

body.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-value {
    font-size: 0.84rem;
}

body.boss-stage-active:not(.boss-stage-desktop-rail) .live-mission-banner {
    position: fixed;
    top: 18px;
    left: 20px;
    width: min(520px, calc(100vw - 420px));
    margin: 0;
    z-index: 260;
}

body.boss-stage-desktop-rail .live-mission-banner,
body.boss-stage-desktop-rail .live-status-strip {
    display: none !important;
}

body.boss-stage-active .sfx-control {
    right: 20px;
    left: auto;
    bottom: 18px;
    z-index: 280;
}

body.classic-focus-stage .boss-stage-top-rail,
body.classic-focus-stage .boss-stage-phase-banner,
body.classic-focus-stage .boss-stage-boss,
body.classic-focus-stage .boss-stage-boss-aura,
body.classic-focus-stage .boss-stage-floor-glow,
body.classic-focus-stage .boss-stage-shadow,
body.classic-focus-stage .boss-stage-glyph,
body.classic-focus-stage #bossStageImpactLayer,
body.classic-focus-stage .live-mission-banner {
    display: none !important;
}

body.classic-focus-stage .boss-stage-backdrop {
    background:
        radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--live-theme-primary, #818cf8) 18%, transparent), transparent 22%),
        radial-gradient(circle at 82% 14%, color-mix(in srgb, var(--live-theme-accent, #10b981) 16%, transparent), transparent 24%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--live-theme-warning, #f59e0b) 14%, transparent), transparent 26%),
        linear-gradient(180deg, color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 90%, #030712) 0%, color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 68%, #020617) 52%, #020617 100%);
}

body.classic-focus-stage .boss-stage-arena {
    padding: 0;
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-strip {
    position: fixed;
    top: 16px;
    right: 18px;
    left: auto;
    width: min(286px, calc(100vw - 32px));
    margin: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    z-index: 260;
    background: color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 82%, transparent);
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-item {
    padding: 6px 8px;
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-label {
    font-size: 0.58rem;
    color: var(--quiz-text-sub);
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-value {
    font-size: 0.8rem;
    color: var(--quiz-text-main);
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud {
    top: auto;
    bottom: 20px;
    left: 20px;
    right: auto;
    width: min(300px, calc(100vw - 40px));
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud .hud-section.common.classic-focus,
body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud .hud-section.objective.classic-focus {
    background: color-mix(in srgb, var(--live-theme-card, #ffffff) 78%, transparent);
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud .hud-chip-row {
    gap: 6px;
}

body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud .hud-chip {
    font-size: 0.72rem;
}

body.classic-focus-stage .classic-focus-question-card .live-reveal-summary {
    border: 1px solid color-mix(in srgb, var(--live-theme-border, rgba(148, 163, 184, 0.22)) 92%, rgba(255, 255, 255, 0.06));
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--live-theme-card, #ffffff) 80%, transparent), color-mix(in srgb, var(--live-theme-bg-main, #0f172a) 70%, transparent)),
        radial-gradient(circle at top, color-mix(in srgb, var(--live-theme-primary, #818cf8) 12%, transparent), transparent 55%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.classic-focus-stage .classic-focus-question-card .live-reveal-summary-line {
    color: var(--quiz-text-main);
}

body.classic-focus-stage .classic-focus-question-card .live-reveal-summary-result {
    color: var(--quiz-text-main);
}

@media (max-width: 1180px) {
    .boss-stage-quiz-dock[data-layout="classic-focus"] {
        width: min(1000px, calc(100vw - 40px));
    }

    .classic-focus-question-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .classic-focus-question-card .question-media {
        min-height: min(36vh, 340px);
    }

    .classic-focus-question-card .question-media img {
        max-height: min(34vh, 320px);
    }
}

@media (min-width: 1100px) {
    body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-strip {
        top: 18px;
        right: 20px;
        width: var(--classic-focus-sidebar-width);
        gap: 6px;
    }

    body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud {
        top: 196px;
        right: 20px;
        left: auto;
        bottom: auto;
        width: var(--classic-focus-sidebar-width);
        max-height: calc(100vh - 218px);
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud .hud-section {
        padding: 8px 9px;
    }

    body.classic-focus-stage .boss-stage-quiz-dock[data-layout="classic-focus"] {
        max-width: none;
    }

    body.classic-focus-stage .classic-focus-modal-shell {
        padding: 20px 22px;
        max-height: min(88vh, 860px);
    }

    body.classic-focus-stage .classic-focus-question-card {
        padding: 24px;
    }

    body.classic-focus-stage .classic-focus-question-layout {
        grid-template-columns: minmax(580px, 62%) minmax(280px, 1fr);
        gap: 24px;
        align-items: stretch;
    }

    body.classic-focus-stage .classic-focus-media-wrap {
        align-items: stretch;
    }

    body.classic-focus-stage .classic-focus-question-card .question-media {
        min-height: clamp(500px, 66vh, 680px);
    }

    body.classic-focus-stage .classic-focus-question-card .question-media img {
        max-height: clamp(520px, 70vh, 700px);
    }

    body.classic-focus-stage .classic-focus-body {
        align-content: center;
    }
}

@media (max-width: 760px) {
    .boss-stage-quiz-dock[data-layout="classic-focus"] {
        width: calc(100vw - 20px);
        top: 53%;
    }

    .boss-stage-quiz-dock[data-layout="classic-focus"][data-state="resolving"] {
        transform: translate(-50%, calc(-53% + 24px)) scale(0.96);
    }

    .boss-stage-quiz-dock[data-layout="classic-focus"][data-state="entering"] {
        transform: translate(-50%, calc(-53% + 16px)) scale(0.985);
    }

    .classic-focus-modal-shell {
        padding: 14px;
        border-radius: 22px;
        max-height: min(86vh, 760px);
    }

    .classic-focus-question-card {
        padding: 14px;
        border-radius: 22px;
    }

    .classic-focus-question-card .question-text {
        font-size: 1.02rem;
    }

    .classic-focus-question-card .question-media img {
        max-height: min(24vh, 210px);
    }

    body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-strip {
        top: 10px;
        right: 10px;
        left: auto;
        width: min(252px, calc(100vw - 20px));
    }

    body.classic-focus-stage.boss-stage-active:not(.boss-stage-desktop-rail) .boss-stage-combat-hud {
        left: 10px;
        bottom: 10px;
        width: min(260px, calc(100vw - 20px));
    }
}

@keyframes bossStageFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes bossAuraPulse {
    0%, 100% {
        transform: translateX(-50%) scale(0.96);
        opacity: 0.84;
    }
    50% {
        transform: translateX(-50%) scale(1.06);
        opacity: 1;
    }
}

@keyframes bossImpactRise {
    0% {
        opacity: 0;
        transform: translate(-50%, -12%) scale(0.66);
    }
    22% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.06);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(0.88);
    }
}

@keyframes bossImpactRing {
    0% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(0.3);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4.2);
    }
}

@keyframes bossImpactBurst {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.6);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

@keyframes bossStagePunch {
    0% {
        transform: translateY(0) scale(1);
    }
    35% {
        transform: translateY(-4px) scale(1.01);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes bossStageNebula {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(4vw, 2vw, 0) scale(1.08);
    }
}

/* 볼륨/사운드 컨트롤 */
.sfx-control {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sfx-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    color: #e2e8f0;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sfx-toggle-btn:hover {
    background: rgba(15, 23, 42, 0.9);
}

.sfx-toggle-btn.muted {
    color: #6b7280;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1080px) {
    .boss-stage-top-rail {
        grid-template-columns: 1fr;
    }

    body.boss-stage-active:not(.boss-stage-desktop-rail) .live-mission-banner {
        width: min(420px, calc(100vw - 400px));
    }

    .boss-stage-quiz-dock {
        width: min(560px, 56vw);
    }

    .team-stage-top-grid {
        grid-template-columns: 1fr 1fr;
    }

    .team-stage-objective-board {
        top: 148px;
        width: calc(100vw - 32px);
        max-height: 48vh;
        overflow: auto;
    }

    .boss-stage-shell[data-stage-mode="territory_war"] .team-stage-objective-board {
        top: 56px;
        width: min(94vw, 920px);
        max-height: 56vh;
    }

    .boss-stage-shell[data-stage-mode="solo_treasure"] .team-stage-objective-board {
        top: 132px;
        width: min(94vw, 920px);
    }

    .map-stage-arena {
        padding: 14px 14px 18px;
    }

    .map-stage-topbar {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .map-stage-layout {
        grid-template-columns: 1fr;
        height: calc(100% - 190px);
    }

    .map-stage-board {
        min-height: 420px;
        border-radius: 24px;
    }

    .map-stage-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .map-stage-panel {
        max-height: 260px;
    }

    .map-expedition-touch-controls {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 10px;
    }

    .map-touch-pad {
        padding: 10px;
        border-radius: 18px;
    }

    .map-touch-row {
        grid-template-columns: repeat(3, 48px);
    }

    .map-touch-btn {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 0.96rem;
    }

    .treasure-chest-choice-row,
    .treasure-altar-grid,
    .treasure-stage-summary-grid {
        grid-template-columns: 1fr;
    }

    .treasure-reward-reveal,
    .treasure-reward-inline {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .territory-grid-inner {
        grid-template-columns: 1fr;
    }

    .territory-grid-axis-top,
    .territory-grid-axis-side {
        display: none;
    }
}

@media (max-width: 720px) {
    .map-stage-arena {
        padding: 10px 10px 18px;
    }

    .map-stage-topbar {
        padding: 12px 14px;
        border-radius: 18px;
    }

    .map-stage-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-stage-top-metrics {
        grid-template-columns: 1fr;
    }

    .map-stage-phase-banner {
        top: 92px;
        font-size: 0.84rem;
        padding: 9px 15px;
    }

    .map-stage-layout {
        height: calc(100% - 246px);
        gap: 12px;
    }

    .map-stage-board {
        min-height: 340px;
        border-radius: 22px;
    }

    .map-stage-question-surface {
        inset: 12px;
    }

    .map-stage-sidebar {
        grid-template-columns: 1fr;
    }

    .map-stage-panel {
        padding: 14px;
        border-radius: 20px;
        max-height: none;
    }

    .map-stage-interaction-hint {
        left: 12px;
        right: 12px;
        bottom: 92px;
        font-size: 0.82rem;
    }

    .map-stage-roster-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .map-stage-roster-status {
        grid-column: 2;
        text-align: left;
    }

    .boss-stage-arena {
        padding: 148px 16px 16px;
    }

    .boss-stage-left-rail {
        display: none !important;
    }

    .boss-stage-top-rail {
        top: 90px;
        left: 16px;
        right: 16px;
        gap: 12px;
    }

    .boss-stage-phase-banner {
        top: 48px;
        font-size: 0.88rem;
        padding: 10px 16px;
    }

    .boss-stage-boss-wrap {
        inset: 112px 0 42vh;
    }

    .boss-stage-boss {
        width: min(88vw, 520px);
        height: 48vh;
    }

    .boss-stage-glyph {
        font-size: clamp(7rem, 32vw, 10rem);
    }

    .boss-stage-quiz-dock {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
        max-width: none;
        transform: none;
    }

    .boss-stage-combat-hud {
        left: 14px;
        right: 14px;
        top: 136px;
        bottom: auto;
        width: auto;
    }

    .boss-stage-quiz-dock[data-state="resolving"] {
        transform: translateY(20px) scale(0.985);
    }

    .boss-stage-quiz-dock[data-state="entering"] {
        transform: translateY(12px) scale(0.992);
    }

    .boss-stage-modal-shell,
    .boss-stage-message-card,
    .boss-stage-ceremony-card {
        padding: 16px 16px 14px;
        border-radius: 22px;
    }

    .boss-stage-quiz-meta {
        margin-bottom: 10px;
    }

    .boss-stage-quiz-meta-title {
        font-size: 0.76rem;
        letter-spacing: 0.06em;
    }

    .boss-stage-quiz-meta-chips {
        justify-content: flex-start;
    }

    .boss-stage-combat-hud .hud-meters {
        grid-template-columns: 1fr;
    }

    .team-stage-top-grid {
        grid-template-columns: 1fr;
    }

    .team-stage-objective-board {
        top: 136px;
        width: calc(100vw - 28px);
        max-height: 42vh;
    }

    .boss-stage-shell[data-stage-mode="territory_war"] .team-stage-objective-board {
        top: 64px;
        width: 94vw;
        max-height: 50vh;
    }

    .boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-boss-wrap {
        inset: 106px 0 44vh;
    }

    .boss-stage-shell[data-stage-mode="solo_treasure"] .boss-stage-boss {
        width: min(78vw, 360px);
        height: 28vh;
    }

    .boss-stage-shell[data-stage-mode="solo_treasure"] .team-stage-objective-board {
        top: 116px;
        width: 94vw;
        max-height: 48vh;
    }

    body.treasure-stage-active .boss-stage-quiz-dock {
        width: auto;
    }

    .team-stage-board.territory {
        padding: 18px 18px 16px;
        border-radius: 24px;
    }

    .treasure-stage-board {
        padding: 18px 18px 16px;
        border-radius: 24px;
    }

    .treasure-discard-grid {
        grid-template-columns: 1fr;
    }

    .treasure-target-picker {
        padding: 14px;
    }

    .treasure-target-row {
        grid-template-columns: 42px 1fr;
    }

    .treasure-target-row span:nth-child(3),
    .treasure-target-row span:nth-child(4),
    .treasure-target-row span:nth-child(5) {
        grid-column: 2;
    }

    .territory-board {
        padding: 12px;
        border-radius: 20px;
    }

    .territory-grid {
        gap: 4px;
        padding: 8px;
    }

    .territory-cell {
        border-radius: 10px;
    }

    .territory-cell-banner {
        top: 4px;
        left: 4px;
        min-width: 14px;
        height: 14px;
        font-size: 0.5rem;
    }

    .territory-cell-frontier {
        right: 4px;
        bottom: 3px;
        font-size: 0.68rem;
    }

    body.boss-stage-active:not(.boss-stage-desktop-rail) .live-status-strip {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }

    body.boss-stage-active:not(.boss-stage-desktop-rail) .live-mission-banner {
        top: 72px;
        left: 14px;
        right: 14px;
        width: auto;
    }
}


/* =========================================
   Map Expedition Fullscreen HUD
   ========================================= */

.map-stage-question-surface {
    position: absolute;
    inset: 0;
    z-index: 44;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 24px 72px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    background: transparent;
    transform: none;
}

.map-stage-question-surface:empty {
    display: none;
}

.map-stage-question-surface.active {
    opacity: 1;
}

.map-stage-question-surface > * {
    pointer-events: auto;
    width: min(620px, calc(100vw - 40px));
    max-height: calc(100% - 12px);
    overflow: auto;
}

.map-stage-topbar,
.map-stage-sidebar,
.map-stage-interaction-hint {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

body.map-stage-active .map-stage-shell {
    pointer-events: auto;
    font-family: "SUIT", "Pretendard", "Noto Sans KR", sans-serif;
}

body.map-stage-active .map-stage-backdrop {
    background:
        radial-gradient(circle at 12% 12%, rgba(96, 165, 250, 0.18), transparent 20%),
        radial-gradient(circle at 86% 14%, rgba(45, 212, 191, 0.12), transparent 22%),
        radial-gradient(circle at 50% 100%, rgba(148, 163, 184, 0.1), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 62%, #e8eff6 100%) !important;
}

body.map-stage-active .map-stage-backdrop::before,
body.map-stage-active .map-stage-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.map-stage-active .map-stage-backdrop::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.14;
}

body.map-stage-active .map-stage-backdrop::after {
    background:
        radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.52), transparent 24%),
        radial-gradient(circle at 76% 20%, rgba(191, 219, 254, 0.34), transparent 26%),
        radial-gradient(circle at 52% 88%, rgba(226, 232, 240, 0.24), transparent 32%);
    filter: blur(24px);
}

body.map-stage-active .map-stage-arena {
    padding: 8px;
}

body.map-stage-active .map-stage-topbar,
body.map-stage-active .map-stage-sidebar,
body.map-stage-active .map-stage-interaction-hint {
    opacity: 0.78;
    transform: none;
}

body.map-stage-active.is-moving .map-stage-topbar,
body.map-stage-active.is-moving .map-stage-sidebar,
body.map-stage-active.is-moving .map-stage-interaction-hint {
    opacity: 0.14;
    transform: translateY(-2px);
}

body.map-stage-active .map-stage-topbar:hover,
body.map-stage-active .map-stage-sidebar:hover {
    opacity: 0.98 !important;
    transform: none !important;
}

body.map-stage-active .map-stage-shell.has-overlay .map-stage-topbar,
body.map-stage-active .map-stage-shell.has-overlay .map-stage-sidebar,
body.map-stage-active .map-stage-shell.has-overlay .map-stage-interaction-hint {
    opacity: 0.08;
    transform: translateY(-2px);
    pointer-events: none;
}

body.map-stage-active .map-stage-topbar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 32;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: start;
    padding: 0;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.map-stage-active .map-stage-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    height: 100%;
    margin-top: 0;
}

body.map-stage-active .map-stage-board-wrap {
    height: 100%;
}

body.map-stage-active .map-stage-course-card,
body.map-stage-active .map-stage-metric-card,
body.map-stage-active .map-stage-panel,
body.map-stage-active .map-stage-phase-banner {
    background: rgba(255, 255, 255, 0.24) !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
}

body.map-stage-active .map-stage-course-card {
    padding: 8px 10px;
    gap: 4px;
}

body.map-stage-active .map-stage-title-row {
    align-items: center;
    gap: 8px;
}

body.map-stage-active .map-stage-overline,
body.map-stage-active .map-stage-panel-eyebrow,
body.map-stage-active .map-stage-metric-card span {
    color: #b86822 !important;
    text-shadow: none !important;
}

body.map-stage-active .map-stage-title,
body.map-stage-active .map-stage-panel-title,
body.map-stage-active .map-stage-phase,
body.map-stage-active .map-stage-metric-card strong,
body.map-stage-active .map-stage-roster-copy strong,
body.map-stage-active .map-stage-roster-status {
    color: #0f172a !important;
    text-shadow: none !important;
}

body.map-stage-active .map-stage-title {
    font-size: clamp(1rem, 1.7vw, 1.38rem);
    line-height: 1.08;
}

body.map-stage-active .map-stage-phase {
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: #475569 !important;
}

body.map-stage-active .map-stage-presence-badge,
body.map-stage-active .map-stage-panel-badge {
    min-width: 50px;
    padding: 3px 9px;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.86) !important;
    color: #f8fafc !important;
    box-shadow: none !important;
}

body.map-stage-active .map-stage-top-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

body.map-stage-active .map-stage-metric-card {
    min-width: 96px;
    padding: 7px 9px;
    gap: 2px;
}

body.map-stage-active .map-stage-metric-card strong {
    font-size: 0.88rem;
}

body.map-stage-active .map-stage-metric-card span {
    font-size: 0.66rem;
}

body.map-stage-active .map-stage-phase-banner {
    top: 64px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 800;
}

body.map-stage-active .map-stage-board {
    height: 100%;
    min-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

body.map-stage-active .map-stage-renderer-mount {
    inset: 0;
    border: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

body.map-stage-active .map-stage-question-surface {
    inset: 0;
    width: auto !important;
    max-width: none !important;
    padding: 28px 24px 72px !important;
    opacity: 0;
    pointer-events: none;
    transform: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.map-stage-active .map-stage-question-surface.active {
    opacity: 1;
}

body.map-stage-active .map-stage-question-surface > * {
    width: min(620px, calc(100vw - 40px));
}

body.map-stage-active .map-stage-question-surface .boss-stage-modal-shell,
body.map-stage-active .map-stage-question-surface .boss-stage-ceremony-card,
body.map-stage-active .map-stage-question-surface .boss-stage-message-card {
    width: min(620px, calc(100vw - 40px));
    max-height: calc(100% - 12px);
    padding: 16px 18px !important;
    border-radius: 24px !important;
    border: 1px solid rgba(226, 232, 240, 0.94) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16) !important;
    backdrop-filter: blur(18px) saturate(150%);
}

body.map-stage-active .map-stage-question-surface .question-card {
    margin-bottom: 0;
    border: 1px solid rgba(226, 232, 240, 0.96) !important;
    background: rgba(255, 255, 255, 0.84) !important;
    box-shadow: none !important;
}

body.map-stage-active .map-stage-info-card {
    width: min(560px, calc(100vw - 36px));
    padding: 14px 16px !important;
}

body.map-stage-active .map-stage-info-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body.map-stage-active .map-stage-info-head h3 {
    margin: 2px 0 0;
    font-size: 1.08rem;
    color: #0f172a;
}

body.map-stage-active .map-stage-info-head .boss-stage-message-overline {
    color: #b86822;
}

body.map-stage-active .map-stage-info-head .boss-stage-message-title {
    margin-top: 4px;
    font-size: 1.08rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #0f172a;
}

body.map-stage-active .map-stage-info-close {
    min-width: 56px;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, 0.48) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.74) !important;
    color: #0f172a !important;
    box-shadow: none !important;
    font-family: "SUIT", "Pretendard", "Noto Sans KR", sans-serif;
    font-size: 0.76rem;
    font-weight: 800;
}

body.map-stage-active .map-stage-info-icon,
body.map-stage-active .map-stage-info-foot {
    display: none !important;
}

body.map-stage-active .map-stage-info-body {
    margin-top: 10px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #334155;
    font-size: 0.94rem;
    line-height: 1.72;
    white-space: normal;
}

body.map-stage-active .map-stage-interaction-hint {
    left: 50%;
    right: auto;
    bottom: 12px;
    z-index: 34;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: min(780px, calc(100% - 28px));
    min-height: 0;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.42) !important;
    background: rgba(255, 255, 255, 0.74) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(16px) saturate(150%);
    color: #0f172a !important;
    font-size: 0.82rem;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(-50%);
    pointer-events: none;
}

body.map-stage-active .map-stage-sidebar {
    position: absolute;
    top: 74px;
    right: 10px;
    z-index: 33;
    width: min(240px, calc(100vw - 20px));
    max-height: calc(100% - 88px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
}

body.map-stage-active .map-stage-panel {
    padding: 10px 12px;
    border-radius: 18px !important;
    scrollbar-width: thin;
}

body.map-stage-active .map-stage-panel::-webkit-scrollbar {
    width: 8px;
}

body.map-stage-active .map-stage-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.4);
}

body.map-stage-active .map-stage-panel-head {
    margin-bottom: 8px;
    gap: 8px;
}

body.map-stage-active .map-stage-panel-title {
    font-size: 0.88rem;
    line-height: 1.15;
}

body.map-stage-active .map-stage-roster {
    gap: 6px;
}

body.map-stage-active .map-stage-roster-row {
    gap: 8px;
    padding: 8px 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: none;
    color: #334155;
}

body.map-stage-active .map-stage-roster-row.me {
    background: rgba(219, 234, 254, 0.72);
    border-color: rgba(96, 165, 250, 0.34);
}

body.map-stage-active .map-stage-roster-copy strong {
    font-size: 0.84rem;
}

body.map-stage-active .map-stage-roster-copy span {
    color: #475569;
    font-size: 0.72rem;
}

body.map-stage-active .map-stage-roster-status {
    font-size: 0.7rem;
    white-space: nowrap;
    color: #334155;
}

body.map-stage-active .map-stage-empty {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.36);
    background: rgba(255, 255, 255, 0.28);
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.35;
}

body.map-stage-active .map-stage-progress-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

body.map-stage-active .map-stage-progress-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.42);
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 700;
}

body.map-stage-active .map-stage-progress-grid {
    display: grid;
    gap: 6px;
}

body.map-stage-active .map-stage-progress-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.78rem;
    color: #475569;
}

body.map-stage-active .map-stage-progress-stat strong {
    color: #0f172a;
    font-size: 0.82rem;
}

body.map-stage-active .map-stage-progress-bar {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
}

body.map-stage-active .map-stage-progress-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa, #34d399);
}

body.map-stage-active .map-stage-progress-note {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.34);
    color: #334155;
    font-size: 0.76rem;
    line-height: 1.45;
}

body.map-stage-active .map-stage-progress-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin-top: 8px;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
}

body.map-stage-active .map-stage-progress-foot .hud-chip {
    padding: 4px 8px;
    border-radius: 999px;
    border: 0;
    background: rgba(15, 23, 42, 0.84);
    color: #f8fafc;
    box-shadow: none;
    font-size: 0.7rem;
}

body.map-stage-active .map-touch-pad {
    padding: 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px) saturate(150%);
}

body.map-stage-active .map-touch-btn {
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    font-family: "SUIT", "Pretendard", "Noto Sans KR", sans-serif;
}

body.map-stage-active .map-touch-btn.action {
    background: rgba(219, 234, 254, 0.96);
}

body.map-stage-active .map-touch-btn.sprint {
    background: rgba(255, 255, 255, 0.96);
    color: #1d4ed8;
}

body.map-stage-active .map-touch-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

@media (max-width: 1024px) {
    body.map-stage-active .map-stage-topbar {
        grid-template-columns: 1fr;
    }

    body.map-stage-active .map-stage-top-metrics {
        justify-content: flex-start;
    }

    body.map-stage-active .map-stage-sidebar {
        width: min(216px, 34vw);
    }
}

@media (max-width: 720px) {
    body.map-stage-active .map-stage-topbar {
        top: 8px;
        left: 8px;
        right: 8px;
    }

    body.map-stage-active .map-stage-course-card {
        padding: 9px 10px;
    }

    body.map-stage-active .map-stage-sidebar {
        top: auto;
        right: auto;
        left: 8px;
        bottom: 96px;
        width: min(210px, calc(100vw - 120px));
        max-height: min(38vh, 280px);
    }

    body.map-stage-active .map-stage-interaction-hint {
        bottom: 84px;
        max-width: calc(100% - 20px);
        white-space: normal;
        text-overflow: clip;
        line-height: 1.35;
    }

    body.map-stage-active .map-expedition-touch-controls {
        right: 8px;
        bottom: 8px;
    }

    body.map-stage-active .map-stage-question-surface {
        padding: 20px 12px 104px !important;
    }

    body.map-stage-active .map-stage-question-surface > * {
        width: min(92vw, 620px);
    }
}

