@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@800;900&family=Oswald:wght@500;700&display=swap');

:root {
    --bg-dark: #050505;
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ea;
    --neon-green: #39ff14;
    --neon-red: #ff073a;
    --neon-purple: #9d00ff;
    --text-light: #ffffff;
}

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

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
    position: relative;
    /* Unique animated deep galaxy gradient background */
    background: radial-gradient(circle at 0% 0%, #1a0b2e 0%, #000000 50%, #0d1b2a 100%);
    background-size: 200% 200%;
    animation: bgPan 15s ease infinite alternate;
}

@keyframes bgPan {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* Stream Overlays */
.stream-overlay {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
    pointer-events: none;
}

.top-left, .top-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.live-badge {
    background: var(--neon-red);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px var(--neon-red);
}

.blinking-dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

.viewer-count, .round-badge, .mode-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.mode-badge {
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 15px var(--neon-blue);
    border: none;
}

/* Main Container */
.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px 20px;
    position: relative;
    z-index: 10;
}

h1#questionText {
    font-size: 3.5rem;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 0 20px var(--neon-blue);
    font-weight: 900;
    margin-bottom: 30px;
    max-width: 90%;
}

/* Stage & Flags */
.stage {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.flag-main {
    max-height: 35vh;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    object-fit: contain;
    transition: transform 0.5s ease;
    animation: float 4s ease-in-out infinite;
}

/* Gentle flag zoom effect used via JS */
.flag-main.zoom-effect {
    transform: scale(1.05);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* VS Mode Container */
.vs-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.vs-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.vs-item img {
    height: 25vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.vs-text {
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-pink);
    animation: pulse 1s infinite alternate;
}

.stat-reveal {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin-bottom: 40px;
}

.option-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-blue);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    padding: 20px;
    border-radius: 12px;
    cursor: default;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2) inset;
    transition: all 0.3s;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* Correct / Wrong States */
.option-btn.correct {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 30px var(--neon-green), 0 0 10px var(--neon-green) inset;
    color: black;
    transform: scale(1.05);
    z-index: 2;
}

.option-btn.wrong {
    background: rgba(255, 7, 58, 0.2);
    border-color: var(--neon-red);
    color: rgba(255,255,255,0.5);
    animation: shake 0.4s;
    opacity: 0.6;
}

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

.flash-bg {
    animation: bgFlash 0.5s ease;
}

@keyframes bgFlash {
    0%, 100% { background-color: var(--bg-dark); }
    50% { background-color: rgba(57, 255, 20, 0.2); }
}

/* Circular Timer */
.timer-container {
    position: absolute;
    bottom: 30px;
    right: 40px;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--neon-blue);
    stroke-width: 8;
    stroke-dasharray: 283; /* 2 * pi * r (r=45) */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
    stroke-linecap: round;
}

.timer-text {
    position: absolute;
    font-family: 'Oswald', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 0 0 10px var(--neon-blue);
}

.timer-urgent .timer-progress {
    stroke: var(--neon-red);
    animation: pulse 0.5s infinite alternate;
}

.timer-urgent .timer-text {
    color: var(--neon-red);
    text-shadow: 0 0 15px var(--neon-red);
    transform: scale(1.2);
    transition: 0.2s;
}

@keyframes pulse {
    0% { filter: drop-shadow(0 0 5px currentColor); }
    100% { filter: drop-shadow(0 0 20px currentColor); }
}

/* ============================
   ANSWER REVEAL PANEL
   Slides up from bottom
============================ */
.reveal-panel {
    position: fixed;
    bottom: -200px;  /* hidden off-screen */
    left: 0; right: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 28px 40px;
    background: linear-gradient(135deg, #0a0f1a 0%, #0d2017 100%);
    border-top: 3px solid var(--neon-green);
    box-shadow: 0 -10px 60px rgba(57, 255, 20, 0.3);
    transition: bottom 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-panel.slide-up {
    bottom: 0;
}

.reveal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--neon-green);
    color: #000;
    font-size: 3rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--neon-green);
    flex-shrink: 0;
    animation: iconPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-icon.wrong-icon {
    background: var(--neon-red);
    box-shadow: 0 0 30px var(--neon-red);
}

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

.reveal-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reveal-label {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.reveal-answer {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px var(--neon-green);
    line-height: 1.1;
    text-transform: uppercase;
    word-break: break-word;
}

/* ============================
   TRANSITION SCREEN
============================ */
.transition-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 4, 12, 0.96);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(24px);
}

.transition-screen.show {
    opacity: 1;
    pointer-events: all;
}

.transition-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: transitionPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes transitionPop {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.transition-emoji {
    font-size: 6rem;
    animation: spin 3s linear infinite;
}

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

.transition-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 6px;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.5));
}

.transition-sub {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
}

.loading-bar {
    width: min(500px, 80vw);
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.loading-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--neon-blue), var(--neon-pink));
    box-shadow: 0 0 20px var(--neon-blue);
    border-radius: 10px;
    transition: width 2.8s linear;
}

/* Particles Canvas/Container overlay */
#particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 25;
}

/* ==================================
   MOBILE / RESPONSIVENESS
================================== */
@media (max-width: 768px) {
    .stream-overlay {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .top-left, .top-right {
        justify-content: space-between;
        width: 100%;
    }

    .game-container {
        padding: 140px 10px 20px 10px;
    }

    h1#questionText {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .flag-main {
        max-height: 25vh;
        margin-bottom: 20px;
    }

    .vs-container {
        gap: 15px;
        flex-direction: column;
    }

    .vs-item img {
        height: 15vh;
    }

    .vs-text {
        font-size: 2rem;
        position: absolute;
        top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        z-index: 5;
    }
    
    .stat-reveal {
        font-size: 1.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 120px;
        max-height: 35vh;
        overflow-y: auto;
    }

    .option-btn {
        font-size: 1.3rem;
        padding: 12px;
    }

    .timer-container {
        bottom: 15px;
        right: 15px;
        width: 80px;
        height: 80px;
    }

    .timer-text {
        font-size: 2.2rem;
    }

    .reveal-answer {
        font-size: 1.8rem;
    }

    .reveal-icon {
        width: 55px;
        height: 55px;
        font-size: 2rem;
    }

    .transition-title {
        font-size: 3rem;
    }

    .transition-emoji {
        font-size: 4rem;
    }

    .reveal-panel {
        gap: 15px;
        padding: 18px 20px;
    }
}
