:root {
    --bg-dark: #050814;
    --neon-blue: #00f0ff;
    --neon-pink: #ff007f;
    --neon-purple: #9d4edd;
    --neon-green: #00ff88;
    --neon-yellow: #ffc300;
    --neon-orange: #ff5400;
    --glass-bg: rgba(10, 18, 40, 0.90);
    --glass-border: rgba(0, 240, 255, 0.35);
    --glass-glow: 0 0 25px rgba(0, 240, 255, 0.2);
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading: 'Trebuchet MS', 'Arial Black', sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-main);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 40%, #0d1633 0%, #03050a 100%);
}

#stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 177.78vh; /* 16:9 ratio */
    max-height: 56.25vw;
    background: linear-gradient(135deg, #070d1e 0%, #04060f 100%);
    box-shadow: 0 0 70px rgba(0, 240, 255, 0.22), 0 0 140px rgba(157, 78, 221, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
}

.stage-ambient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 85%, rgba(0, 240, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(255, 0, 127, 0.08) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    z-index: 1;
    pointer-events: none;
}

.slide-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 5;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(0.98);
    display: flex;
    flex-direction: column;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 10;
}

.slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 3.5% 3.5%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Two-column split layout for slides with rich illustrations */
.slide-split {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    align-items: center;
    height: 100%;
}

.slide-art-box {
    position: relative;
    width: 100%;
    height: 90%;
    max-height: 420px;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.25);
    background: #000;
}

.slide-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.slide-art-box:hover .slide-art-img {
    transform: scale(1.04);
}

.slide-art-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(0deg, rgba(3, 6, 18, 0.95) 0%, rgba(3, 6, 18, 0) 100%);
    font-size: 0.85vw;
    font-weight: 700;
    color: var(--neon-yellow);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Top Universal HUD Bar */
#top-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8.5%;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5%;
    background: linear-gradient(180deg, rgba(3, 6, 18, 0.96) 0%, rgba(3, 6, 18, 0) 100%);
    pointer-events: none;
}

#top-hud * {
    pointer-events: auto;
}

.team-hud-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.9vw;
    font-weight: 800;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.team-hud-badge.team-a {
    background: rgba(0, 240, 255, 0.18);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
}

.team-hud-badge.team-b {
    background: rgba(255, 0, 127, 0.18);
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.35);
}

.team-buzz-btn {
    border: none;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.8vw;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.team-buzz-btn.team-a {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 12px var(--neon-blue);
}
.team-buzz-btn.team-a:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px var(--neon-blue);
}

.team-buzz-btn.team-b {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 12px var(--neon-pink);
}
.team-buzz-btn.team-b:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px var(--neon-pink);
}

.badge-tag {
    background: rgba(157, 78, 221, 0.2);
    border: 1px solid var(--neon-purple);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85vw;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(157, 78, 221, 0.25);
}

.hud-btn {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.hud-btn:hover {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: 0 0 12px var(--neon-blue);
    transform: scale(1.08);
}

.hud-btn.active {
    background: var(--neon-blue);
    color: #000;
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
}

#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 7.5%;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2.5%;
    background: linear-gradient(0deg, rgba(3, 6, 18, 0.95) 0%, rgba(3, 6, 18, 0) 100%);
    pointer-events: none;
}

#bottom-nav * {
    pointer-events: auto;
}

.nav-btn {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(157, 78, 221, 0.25) 100%);
    border: 1px solid var(--neon-blue);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.95vw;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.nav-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 25px var(--neon-blue);
    transform: translateY(-2px);
}

.slide-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.25s ease;
}

.dot:hover {
    background: var(--neon-blue);
    transform: scale(1.3);
}

.dot.active {
    width: 24px;
    border-radius: 10px;
    background: var(--neon-blue);
    box-shadow: 0 0 12px var(--neon-blue);
}

/* Glassmorphism Panels */
.cyber-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(14px);
    box-shadow: var(--glass-glow);
    transition: all 0.3s ease;
}

.cyber-card:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
}

/* Buttons */
.cyber-btn {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--neon-blue);
    color: #fff;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 1vw;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.cyber-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 25px var(--neon-blue);
    text-shadow: none;
    transform: scale(1.03);
}

.cyber-btn.pink {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.18);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.25);
}
.cyber-btn.pink:hover {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 25px var(--neon-pink);
}

.cyber-btn.green {
    border-color: var(--neon-green);
    background: rgba(0, 255, 136, 0.18);
}
.cyber-btn.green:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 25px var(--neon-green);
}

/* 3D Flip Card Container */
.flip-card {
    background-color: transparent;
    perspective: 1200px;
    height: 100%;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.flip-card-front {
    background: rgba(12, 20, 42, 0.95);
    border: 2px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
    justify-content: space-between;
    transition: all 0.3s ease;
}

.flip-card:hover .flip-card-front {
    border-color: var(--neon-blue);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.45);
    transform: translateY(-4px);
}

.flip-card-img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    border-bottom: 2px solid rgba(0, 240, 255, 0.2);
}

.flip-card-front-bar {
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: rgba(10, 16, 35, 0.9);
    font-size: 1vw;
    font-weight: 700;
    color: var(--neon-yellow);
}

.flip-card-back {
    background: linear-gradient(135deg, rgba(8, 20, 45, 0.96) 0%, rgba(15, 35, 70, 0.96) 100%);
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 35px rgba(0, 255, 136, 0.35);
    transform: rotateY(180deg);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Voice Note Recording Zone */
.voice-note-zone {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(10, 18, 40, 0.92);
    border: 1px solid var(--neon-purple);
    border-radius: 14px;
    padding: 10px 18px;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.2);
}

.mic-btn {
    background: linear-gradient(135deg, var(--neon-pink) 0%, #ff5400 100%);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.4);
    transition: all 0.2s ease;
}

.mic-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 30px var(--neon-pink);
}

.mic-btn.recording {
    animation: pulseRecord 1s infinite alternate;
    background: #ff0000;
}

@keyframes pulseRecord {
    from { transform: scale(1); box-shadow: 0 0 15px #ff0000; }
    to { transform: scale(1.2); box-shadow: 0 0 35px #ff0000; }
}

.team-select-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 18, 38, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 6px 14px;
    margin-bottom: 12px;
}

.team-selector-btn {
    border: 2px solid transparent;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85vw;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: all 0.2s ease;
}

.team-selector-btn.active.team-a {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.25);
    color: var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
}

.team-selector-btn.active.team-b {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.25);
    color: var(--neon-pink);
    box-shadow: 0 0 15px var(--neon-pink);
}

.speak-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin-left: 8px;
    vertical-align: middle;
}
.speak-btn:hover {
    background: var(--neon-blue);
    color: #000;
    border-color: var(--neon-blue);
    transform: scale(1.15);
}

#buzz-modal {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 16px 32px;
    border-radius: 24px;
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    display: none;
}
#buzz-modal.team-a {
    background: rgba(0, 240, 255, 0.92);
    border: 3px solid #fff;
    color: #000;
    box-shadow: 0 0 40px var(--neon-blue);
}
#buzz-modal.team-b {
    background: rgba(255, 0, 127, 0.92);
    border: 3px solid #fff;
    color: #fff;
    box-shadow: 0 0 40px var(--neon-pink);
}

.hero-portal {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 3px solid var(--neon-blue);
    box-shadow: 0 0 50px var(--neon-blue), inset 0 0 40px var(--neon-purple);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: spinSlow 20s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.quiz-options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}
.quiz-opt-btn {
    background: rgba(12, 22, 48, 0.92);
    border: 2px solid rgba(0, 240, 255, 0.35);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.15vw;
    font-weight: 700;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}
.quiz-opt-btn:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 25px var(--neon-blue);
    transform: translateY(-3px);
}
.quiz-opt-btn.correct {
    border-color: var(--neon-green) !important;
    background: rgba(0, 255, 136, 0.3) !important;
    box-shadow: 0 0 35px var(--neon-green) !important;
}
.quiz-opt-btn.wrong {
    border-color: var(--neon-pink) !important;
    background: rgba(255, 0, 127, 0.3) !important;
    box-shadow: 0 0 35px var(--neon-pink) !important;
    animation: shake 0.4s ease;
}

.timeline-widget {
    background: rgba(10, 18, 38, 0.9);
    border: 1px solid var(--neon-blue);
    border-radius: 16px;
    padding: 16px 22px;
    margin: 12px 0;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}
.timeline-track {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin: 22px 0;
}
.timeline-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    border-radius: 6px;
    box-shadow: 0 0 12px var(--neon-blue);
}
.timeline-handle {
    position: absolute;
    top: -9px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
    transform: translateX(-50%);
}

.builder-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 16px 0;
}

.terminal-window {
    background: rgba(5, 10, 25, 0.95);
    border: 2px solid var(--neon-purple);
    border-radius: 14px;
    padding: 22px;
    font-family: var(--font-mono);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.3);
}
.glitch-word {
    color: var(--neon-pink);
    text-decoration: underline wavy var(--neon-pink);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    animation: glitchPulse 1.2s infinite;
}

#winner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 5, 15, 0.95);
    backdrop-filter: blur(25px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.podium-box {
    background: linear-gradient(135deg, #09122c 0%, #200f38 100%);
    border: 3px solid var(--neon-yellow);
    border-radius: 28px;
    padding: 35px;
    max-width: 760px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 195, 0, 0.45);
    color: #fff;
}

.input-cyber {
    background: rgba(12, 22, 48, 0.92);
    border: 1px solid var(--neon-blue);
    border-radius: 10px;
    padding: 10px 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}
.input-cyber:focus {
    box-shadow: 0 0 18px var(--neon-blue);
    border-color: var(--neon-green);
}

#slide-drawer {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    height: 100vh;
    background: rgba(8, 12, 25, 0.96);
    border-left: 2px solid var(--neon-blue);
    backdrop-filter: blur(20px);
    z-index: 100;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}
#slide-drawer.open { right: 0; }
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 12px;
    margin-bottom: 15px;
}
.drawer-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.drawer-item {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}
.drawer-item:hover, .drawer-item.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes glitchPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; transform: scale(1.02); }
}
