@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --neon-blue: #00f3ff;
    --neon-blue-glow: rgba(0, 243, 255, 0.6);
    --glass-bg: rgba(12, 28, 55, 0.75);
    --glass-border: 2px solid #2a5a9c;
    --text-white: #ffffff;
    --highlight-bg: #dfeeff;
    --highlight-text: #0b1a30;
}

.game-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



.game-container {
    position: relative;
    width: 100%;
    min-height: clamp(500px, 85vh, 900px);
    /* Smart height: fits desktop & mobile */
    height: auto;
    background: url('../assets/images/background.png') no-repeat center center / cover;
    background-attachment: scroll;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Centering content vertically */
    max-width: 100vw;
    overflow-x: hidden;
    padding: 20px;

    /* Matching Leaderboard Border Style */
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
}

/* --- HEADER (Positioned Absolutely at top) --- */
.game-container header {
    width: 100%;
    position: relative;
    /* Change from absolute to prevent overlap */
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.game-container .header-content {
    text-align: center;
    position: relative;
    /* Removed background for cleaner look, text shadow handles visibility */
}

/* Logout Button */
.game-container .logout-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(220, 50, 50, 0.8) 0%, rgba(180, 30, 30, 0.9) 100%);
    border: 2px solid rgba(255, 100, 100, 0.6);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(220, 50, 50, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    display: none;
    /* Hidden by default, shown when logged in */
    color: #fff;
}

.game-container .logout-btn:hover {
    background: linear-gradient(135deg, rgba(255, 70, 70, 0.9) 0%, rgba(220, 50, 50, 1) 100%);
    border-color: #ff6b6b;
    box-shadow:
        0 0 25px rgba(255, 100, 100, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.game-container .logout-btn svg {
    display: block;
}

.game-container h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
    margin-bottom: 0;
    line-height: 1;
}

.game-container h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    color: var(--neon-blue);
    letter-spacing: 4px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
}

/* Timer Display - Circular Glossy Design (Matching Lifeline Buttons) */
.game-container .timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30, 60, 100, 0.9) 0%, rgba(15, 35, 70, 0.95) 100%);
    border: 3px solid rgba(100, 180, 255, 0.6);
    box-shadow:
        0 4px 15px rgba(0, 100, 200, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Glossy effect on timer display */
.game-container .timer-display::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
    border-radius: 50%;
}

.game-container.game-active .timer-display {
    opacity: 1;
}

.game-container .timer-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    display: none;
    /* Hide icon for cleaner circular look */
}

.game-container .timer-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #b5d0e8;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
    text-align: center;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Timer Warning State (10 seconds or less) */
.game-container .timer-display.timer-warning {
    border-color: rgba(243, 156, 18, 0.8);
    background: linear-gradient(135deg, rgba(180, 100, 20, 0.9) 0%, rgba(140, 70, 15, 0.95) 100%);
    box-shadow:
        0 0 25px rgba(243, 156, 18, 0.4),
        inset 0 2px 8px rgba(255, 255, 255, 0.15);
    animation: timer-pulse-warning 1s infinite;
}

.timer-display.timer-warning .game-container .timer-value {
    color: #f39c12;
    text-shadow: 0 0 15px rgba(243, 156, 18, 0.8);
}

/* Timer Critical State (5 seconds or less) */
.timer-display.timer-critical {
    border-color: rgba(231, 76, 60, 0.9);
    background: linear-gradient(135deg, rgba(180, 40, 40, 0.9) 0%, rgba(140, 20, 20, 0.95) 100%);
    box-shadow:
        0 0 30px rgba(231, 76, 60, 0.6),
        inset 0 2px 10px rgba(255, 100, 100, 0.2);
    animation: timer-pulse-critical 0.5s infinite;
}

.timer-display.timer-critical .game-container .timer-value {
    color: #e74c3c;
    text-shadow: 0 0 20px rgba(231, 76, 60, 1);
}

@keyframes timer-pulse-warning {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes timer-pulse-critical {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}


/* --- MAIN GAME UI CONTAINER --- */
#game-ui {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 5;
    padding: 20px;
}

/* --- MAIN GAME AREA --- */
.game-container main {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    max-width: 1000px;
    /* Reduced to ensure space for ladder */
}

/* Question Board */
.game-container .question-board {
    margin-top: 20px;
    width: 100%;
    max-width: 850px;
    min-height: 180px;
    /* Fixed height to prevent flickering/jumping */
    background: rgba(8, 20, 40, 0.85);
    border: 2px solid #4a9eff;
    border-radius: 15px;
    box-shadow:
        0 0 20px rgba(0, 150, 255, 0.4),
        inset 0 0 40px rgba(0, 100, 200, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px clamp(20px, 5vw, 50px);
    position: relative;
    clip-path: polygon(20px 0, calc(100% - 20px) 0,
            100% 20px, 100% calc(100% - 20px),
            calc(100% - 20px) 100%, 20px 100%,
            0 calc(100% - 20px), 0 20px);
    backdrop-filter: blur(5px);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Inner border effect for tech look */
.question-board::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(100, 200, 255, 0.3);
    clip-path: inherit;
    pointer-events: none;
}

.question-text {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    font-family: 'Roboto', sans-serif;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Answers Grid */
.game-container .options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 60px;
    /* Vertical gap, Horizontal gap */
    width: 90%;
    max-width: 1000px;

    /* Animation Initial State */
    opacity: 0;
    transform: translateY(100px);
    transition: all 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
    /* 0.3s Delay */
}

.game-container .option-btn {
    background: linear-gradient(180deg, rgba(16, 40, 70, 0.9) 0%, rgba(10, 25, 50, 0.95) 100%);
    border: 2px solid #3a7bc0;
    border-radius: 10px;
    /* Only slightly rounded corners per reference */
    padding: 18px 25px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: flex-start;
    /* Changed from center to flex-start for better multi-line alignment */
    flex-wrap: nowrap;
    /* Prevent wrapping to new line */
    gap: 0;
    /* Remove gap, use margin-right on label instead */
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-shadow:
        0 0 10px rgba(0, 150, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    /* Tech corners approach (optional visual tweak) */
    clip-path: polygon(10px 0, 100% 0,
            100% calc(100% - 10px), calc(100% - 10px) 100%,
            0 100%, 0 10px);
}

.option-btn::before {
    content: "";
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    clip-path: inherit;
}

.option-btn:hover {
    background: linear-gradient(180deg, rgba(30, 70, 120, 0.9) 0%, rgba(20, 50, 90, 0.95) 100%);
    border-color: #70cfff;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.5);
    transform: translateY(-2px);
}

.option-btn.correct {
    background: linear-gradient(180deg, rgba(20, 100, 40, 0.9) 0%, rgba(10, 60, 20, 0.95) 100%) !important;
    border-color: #00ff44 !important;
    box-shadow: 0 0 30px rgba(0, 255, 68, 0.6) !important;
}

.option-btn.wrong {
    background: linear-gradient(180deg, rgba(120, 30, 30, 0.9) 0%, rgba(80, 20, 20, 0.95) 100%) !important;
    border-color: #ff3333 !important;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.6) !important;
}

.option-btn.selected {
    background: linear-gradient(180deg, rgba(180, 130, 20, 0.9) 0%, rgba(140, 70, 15, 0.95) 100%) !important;
    border-color: #f39c12 !important;
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.6) !important;
}

.game-container .label {
    color: #ffd700;
    font-weight: 700;
    margin-right: 15px;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    flex-shrink: 0;
    /* Prevent label from shrinking and moving down */
    align-self: flex-start;
    /* Keep label at the top when text wraps */
}

.game-container .option-text {
    flex: 1;
    /* Take remaining space */
    min-width: 0;
    /* Allow text to wrap properly */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    /* Better readability for multi-line text */
}

/* --- CENTER LIFELINE BUTTONS (Between Question and Answers) --- */
.center-lifelines {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 20px 0 30px 0;

    /* Animation Initial State */
    opacity: 0;
    transform: scale(0.8);
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.game-container.game-active .center-lifelines {
    opacity: 1;
    transform: scale(1);
}

/* Individual Center Lifeline Button */
.center-lifeline-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30, 60, 100, 0.9) 0%, rgba(15, 35, 70, 0.95) 100%);
    border: 3px solid rgba(100, 180, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(0, 100, 200, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Glossy effect on center lifeline buttons */
.center-lifeline-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
    border-radius: 50%;
}

.center-lifeline-btn svg {
    width: 36px;
    height: 36px;
    fill: #b5d0e8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 1;
}

/* Hover Effect for Center Buttons */
.center-lifeline-btn:hover {
    background: linear-gradient(135deg, rgba(50, 90, 140, 0.95) 0%, rgba(30, 60, 110, 1) 100%);
    border-color: #70cfff;
    box-shadow:
        0 0 25px rgba(0, 200, 255, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.center-lifeline-btn:hover svg {
    fill: #00f3ff;
}

/* Active/Used State for Center Buttons */
.center-lifeline-btn:active,
.center-lifeline-btn.used {
    background: linear-gradient(135deg, rgba(60, 60, 60, 0.7) 0%, rgba(40, 40, 40, 0.8) 100%);
    border-color: #666;
    opacity: 0.5;
    cursor: not-allowed;
}

.center-lifeline-btn.used svg {
    fill: #666;
}



.lifeline-counter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-blue);
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    z-index: 5;
}

/* Custom Tooltip on Hover */
.center-lifeline-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(10, 25, 50, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    z-index: 64;
    pointer-events: none;
}

.center-lifeline-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-15px);
}

/* --- SIDEBAR MONEY LADDER (New Redesigned Layout) --- */
.game-container .money-ladder {
    position: relative;
    width: 280px;
    height: 600px;
    display: flex;
    flex-direction: column;

    /* Animation Initial State */
    opacity: 0;
    transform: translateX(100px);
    transition: all 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s;
    /* 0.6s Delay */
}

/* --- ACTIVE GAME STATES (Triggered by JS) --- */
.game-container.game-active .question-board {
    opacity: 1;
    transform: translateY(0);
}

.game-container.game-active .options-grid {
    opacity: 1;
    transform: translateY(0);
}

.game-container.game-active .money-ladder {
    opacity: 1;
    transform: translateX(0);
    /* Restore original position */
}

/* Question Ladder Panel */
.game-container .ladder-panel {
    flex-grow: 1;
    background: linear-gradient(180deg, rgba(10, 25, 50, 0.95) 0%, rgba(5, 15, 35, 0.98) 100%);
    border: 3px solid rgba(58, 123, 192, 0.6);
    border-radius: 25px;
    padding: 15px 10px;
    box-shadow:
        0 0 25px rgba(0, 100, 200, 0.3),
        inset 0 0 40px rgba(0, 30, 80, 0.5);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar Styling */
.ladder-panel::-webkit-scrollbar {
    width: 6px;
}

.ladder-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.ladder-panel::-webkit-scrollbar-thumb {
    background: rgba(58, 123, 192, 0.6);
    border-radius: 10px;
}

/* Level Header */
/* Level Header - Modern High-Tech Style */
.game-container .level-header {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    color: #8fa3b8;
    background: rgba(15, 35, 65, 0.4);
    /* Cyberpunk Hexagonal Notch Shape */
    clip-path: polygon(15px 0,
            calc(100% - 15px) 0,
            100% 50%,
            calc(100% - 15px) 100%,
            15px 100%,
            0 50%);
    border: none;
    padding: 12px 25px;
    margin: 25px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

/* Unique Border Highlight for Clipped Shape */
.game-container .level-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(58, 123, 192, 0.8) 50%,
            transparent 100%);
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0 50%,
            16px 2px, 2px 50%, 16px calc(100% - 2px), calc(100% - 16px) calc(100% - 2px), calc(100% - 2px) 50%, calc(100% - 16px) 2px, 16px 2px);
    pointer-events: none;
}

/* Active Level Header - Neon Cyber Glow */
.game-container .level-header.active {
    background: linear-gradient(90deg,
            rgba(0, 243, 255, 0.05) 0%,
            rgba(0, 243, 255, 0.3) 50%,
            rgba(0, 243, 255, 0.05) 100%);
    color: #fff;
    text-shadow: 0 0 15px var(--neon-blue);
    transform: scale(1.08) translateY(-2px);
    z-index: 10;
}

.game-container .level-header.active::before {
    background: linear-gradient(90deg,
            transparent 0%,
            var(--neon-blue) 40%,
            var(--neon-blue) 60%,
            transparent 100%);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

/* Completed Level Header - Fixed Green State */
.game-container .level-header.completed {
    background: linear-gradient(90deg,
            rgba(39, 174, 96, 0.05) 0%,
            rgba(39, 174, 96, 0.2) 50%,
            rgba(39, 174, 96, 0.05) 100%);
    color: #27ae60;
    text-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
    opacity: 0.8;
}

.game-container .level-header.completed::before {
    background: linear-gradient(90deg,
            transparent 0%,
            #27ae60 40%,
            #27ae60 60%,
            transparent 100%);
}

/* Active Header pulsing indicator */
.game-container .level-header.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--neon-blue);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--neon-blue);
    animation: pulse-line 1.5s infinite alternate;
}

@keyframes pulse-line {
    from {
        opacity: 0.4;
        width: 30px;
    }

    to {
        opacity: 1;
        width: 50px;
    }
}


/* Question Item - Pill Shape */
/* Question Item - Angled Tech Pill */
.question-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 25, 45, 0.6);
    border: 1px solid rgba(58, 123, 192, 0.4);
    /* Notched corners */
    clip-path: polygon(0 8px,
            8px 0,
            100% 0,
            100% calc(100% - 8px),
            calc(100% - 8px) 100%,
            0 100%);
    padding: 10px 18px;
    margin: 4px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Glossy Effect */
.question-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent);
    pointer-events: none;
}

/* Question Number */
.q-number {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #b5d0e8;
    min-width: 28px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Question Text */
.q-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #9db8d0;
    flex-grow: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Trophy Icon */
.trophy-icon {
    font-size: 1.3rem;
    margin-left: auto;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

/* Active/Ongoing Question - Yellow Glow */
/* Active/Ongoing Question - Gold Matrix Glow */
.question-item.current {
    background: linear-gradient(90deg,
            rgba(180, 130, 20, 0.3) 0%,
            rgba(243, 156, 18, 0.1) 100%);
    border: 1px solid #f39c12;
    box-shadow:
        0 0 20px rgba(243, 156, 18, 0.3),
        inset 0 0 15px rgba(243, 156, 18, 0.1);
    transform: translateX(5px);
}

.question-item.current .q-number,
.question-item.current .q-text {
    color: #f39c12;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.8);
}


/* Completed Question - Fixed Green State */
.question-item.completed {
    background: linear-gradient(135deg, rgba(15, 100, 60, 0.7) 0%, rgba(10, 70, 40, 0.8) 100%);
    border: 2px solid #27ae60;
    box-shadow:
        0 0 12px rgba(39, 174, 96, 0.4),
        inset 0 0 8px rgba(39, 174, 96, 0.15);
}

.question-item.completed .q-number,
.question-item.completed .q-text {
    color: #27ae60;
    text-shadow: 0 0 6px rgba(39, 174, 96, 0.5);
}

/* Completed with trophy icon */
.question-item.completed::after {
    content: "🏆";
    position: absolute;
    right: 12px;
    font-size: 1.2rem;
    filter: drop-shadow(0 0 4px rgba(39, 174, 96, 0.6));
}

/* Hover Effect */
.question-item:hover {
    background: linear-gradient(135deg, rgba(30, 60, 100, 0.8) 0%, rgba(15, 35, 65, 0.9) 100%);
    border-color: #5da3d5;
    box-shadow:
        0 0 12px rgba(93, 163, 213, 0.4),
        inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ============================================ */

/* Tablet Landscape (max-width: 1200px) */
@media (max-width: 1200px) {
    .game-container {
        width: 100%;
        height: auto;
        min-height: 100vh;
    }

    .game-container header {
        padding-right: 280px;
    }

    .game-container main {
        padding-right: 0;
    }

    .game-container .money-ladder {
        width: 260px;
        right: 30px;
    }

    .game-container .question-board {
        width: 90%;
        padding: 25px 35px;
    }



    .game-container .options-grid {
        width: 95%;
        gap: 25px 50px;
    }

    .game-container .option-btn {
        padding: 16px 22px;
    }
}

/* Tablet Portrait (max-width: 900px) */
@media (max-width: 900px) {
    body {
        overflow-y: auto;
    }

    .game-container {
        width: 100%;
        height: auto;
        min-height: 100vh;
        flex-direction: column;
        overflow-y: visible;
        padding-bottom: 30px;
    }

    .game-container header {
        position: relative;
        height: auto;
        padding: 20px 15px 15px;
        padding-right: 15px;
    }

    #game-ui {
        flex-direction: column;
        gap: 20px;
        padding: 10px;
    }

    .game-container h1 {
        font-size: 2.2rem;
    }

    .game-container h2 {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }


    .game-container .logout-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
    }

    .game-container .timer-display {
        position: static;
        transform: none;
        width: 70px;
        height: 70px;
        font-size: 0.9rem;
    }

    .timer-display .game-container .timer-value {
        font-size: 1.5rem;
        min-width: 40px;
    }

    .timer-display .game-container .timer-icon {
        font-size: 1.3rem;
    }

    .game-container main {
        padding: 15px;
        padding-right: 15px;
        padding-bottom: 20px;
        width: 100%;
        height: auto;
    }

    .game-container .question-board {
        margin-top: 15px;
        width: 95%;
        min-height: 160px;
        padding: 20px 25px;
    }

    .question-text {
        line-height: 1.4;
    }

    .center-lifelines {
        gap: 18px;
        margin: 15px 0 20px 0;
    }

    .center-lifeline-btn {
        width: 60px;
        height: 60px;
        border-width: 2px;
    }

    .center-lifeline-btn svg {
        width: 30px;
        height: 30px;
    }

    .game-container .options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 95%;
    }

    .game-container .option-btn {
        padding: 16px 22px;
    }

    .game-container .label {
        margin-right: 12px;
    }

    /* Sidebar moves to bottom on tablet */
    .game-container .money-ladder {
        position: relative;
        width: 95%;
        max-width: 600px;
        height: auto;
        right: auto;
        top: auto;
        transform: none;
        margin: 20px auto 0;
        opacity: 1 !important;
    }

    .game-container.game-active .money-ladder {
        transform: none;
    }

    .game-container .ladder-panel {
        max-height: 400px;
        padding: 12px 8px;
    }

    .game-container .level-header {
        font-size: 0.95rem;
        padding: 10px 20px;
        margin: 20px 0 10px 0;
    }

    .question-item {
        padding: 10px 16px;
        margin: 3px 0;
    }

    .q-number {
        font-size: 1.2rem;
        min-width: 26px;
    }

    .q-text {
        font-size: 0.8rem;
    }

    /* Welcome Screen */
    .game-container .welcome-logo {
        width: 350px;
    }

    .game-container .start-btn {
        font-size: 1.7rem;
        padding: 12px 70px;
    }

    .game-container .version {
        font-size: 0.7rem;
    }

    /* Signup Panel */
    .signup-panel {
        padding: 35px 50px;
        width: 550px;
    }

    .signup-panel .game-container h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }

    .input-group label {
        font-size: 1.1rem;
    }

    .input-group input,
    .input-group select {
        padding: 13px 18px;
        font-size: 1rem;
    }

    .small-btn {
        font-size: 1.5rem;
        padding: 13px 35px;
    }

    /* Game Over Screen */
    .game-over-content {
        padding: 40px;
        width: 600px;
    }

    .game-over-content .game-container h2 {
        font-size: 3rem;
        margin-bottom: 25px;
    }

    .stats-container {
        gap: 15px;
        margin: 30px 0;
    }

    .stat-item {
        padding: 18px;
    }

    .stat-label {
        font-size: 0.95rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .cyber-rules-wrapper {
        width: 90%;
        padding: 30px;
    }
}

/* Mobile Landscape & Small Tablet (max-width: 768px) */
@media (max-width: 768px) {
    .game-container h1 {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .game-container h2 {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .game-container .timer-display {
        width: 60px;
        height: 60px;
        border-width: 2px;
    }

    .timer-display .game-container .timer-value {
        font-size: 1.4rem;
    }

    .game-container .question-board {
        padding: 18px 20px;
        min-height: 140px;
    }



    .center-lifelines {
        gap: 15px;
        margin: 12px 0 18px 0;
    }

    .center-lifeline-btn {
        width: 55px;
        height: 55px;
    }

    .center-lifeline-btn svg {
        width: 28px;
        height: 28px;
    }

    .game-container .options-grid {
        gap: 12px;
    }

    .game-container .option-btn {
        padding: 14px 18px;
    }

    .game-container .label {
        margin-right: 10px;
    }

    .game-container .money-ladder {
        max-width: 500px;
    }

    .game-container .ladder-panel {
        max-height: 350px;
    }

    .game-container .level-header {
        font-size: 0.9rem;
        padding: 9px 18px;
        margin: 18px 0 8px 0;
        letter-spacing: 2px;
    }

    .question-item {
        padding: 9px 14px;
    }

    .q-number {
        font-size: 1.15rem;
    }

    .q-text {
        font-size: 0.75rem;
    }

    /* Welcome Screen */
    .game-container .welcome-logo {
        width: 300px;
    }

    .game-container .start-btn {
        font-size: 1.5rem;
        padding: 10px 60px;
        border-radius: 40px;
    }

    /* Signup Panel */
    .signup-panel {
        padding: 30px 40px;
        width: 90%;
        max-width: 500px;
    }

    .signup-panel .game-container h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .input-group {
        gap: 8px;
    }

    .input-group label {
        font-size: 1rem;
    }

    .input-group input,
    .input-group select {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .small-btn {
        font-size: 1.4rem;
        padding: 12px 30px;
    }

    /* Game Over Screen */
    .game-over-content {
        padding: 35px;
        width: 90%;
        max-width: 500px;
    }

    .game-over-content .game-container h2 {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }

    .stats-container {
        gap: 12px;
        margin: 25px 0;
    }

    .stat-item {
        padding: 15px;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }
}

/* Mobile Portrait (max-width: 480px) */
@media (max-width: 480px) {
    .game-container header {
        padding: 15px 10px 12px;
    }

    .game-container h1 {
        font-size: 1.4rem;
        letter-spacing: 0.5px;
        margin-bottom: 5px;
    }

    .game-container h2 {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .game-container .logout-btn {
        padding: 5px 8px;
    }

    .game-container .logout-btn svg {
        width: 20px;
        height: 20px;
    }

    .game-container .timer-display {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }

    .timer-display .game-container .timer-value {
        font-size: 1.3rem;
    }

    .game-container main {
        padding: 10px;
    }

    .game-container .question-board {
        margin-top: 10px;
        width: 94%;
        min-height: 120px;
        padding: 15px 18px;
        border-width: 1.5px;
        border-radius: 12px;
    }

    .question-text {
        line-height: 1.5;
    }

    .center-lifelines {
        gap: 12px;
        margin: 10px 0 15px 0;
        flex-wrap: wrap;
    }

    .center-lifeline-btn {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }

    .center-lifeline-btn svg {
        width: 24px;
        height: 24px;
    }

    .game-container .options-grid {
        gap: 10px;
        width: 98%;
    }

    .game-container .option-btn {
        padding: 12px 15px;
        border-radius: 8px;
    }

    .game-container .label {
        margin-right: 8px;
    }

    /* Sidebar */
    .game-container .money-ladder {
        width: 98%;
        max-width: 100%;
        margin-top: 15px;
    }

    .game-container .ladder-panel {
        max-height: 300px;
        padding: 10px 6px;
        border-radius: 20px;
        border-width: 2px;
    }

    .game-container .level-header {
        font-size: 0.8rem;
        padding: 8px 15px;
        margin: 15px 0 6px 0;
        letter-spacing: 1.5px;
    }

    .question-item {
        padding: 8px 12px;
        clip-path: polygon(0 6px, 6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
    }

    .q-number {
        font-size: 1.05rem;
        min-width: 24px;
    }

    .q-text {
        font-size: 0.85rem;
    }

    .question-item.completed::after {
        font-size: 1rem;
        right: 10px;
    }

    /* Welcome Screen */
    .game-container .welcome-logo {
        width: 250px;
    }

    .game-container .start-btn {
        font-size: 1.3rem;
        padding: 10px 50px;
        border-radius: 35px;
    }

    .game-container .version {
        font-size: 0.65rem;
        bottom: 15px;
        right: 15px;
    }

    /* Signup Panel */
    .signup-panel {
        padding: 25px 20px;
        border-radius: 15px;
        border-width: 1.5px;
    }

    .signup-panel .game-container h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .signup-panel form {
        gap: 18px;
    }

    .input-group {
        gap: 7px;
    }

    .input-group label {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .input-group input,
    .input-group select {
        padding: 11px 14px;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .small-btn {
        font-size: 1.2rem;
        padding: 11px 25px;
        margin-top: 5px;
    }

    /* Game Over Screen */
    .game-over-content {
        padding: 25px 20px;
        border-radius: 20px;
        border-width: 2px;
    }

    .game-over-content .game-container h2 {
        font-size: 2rem;
        margin-bottom: 18px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 20px 0;
    }

    .stat-item {
        padding: 15px;
        border-radius: 12px;
    }

    .stat-label {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .restart-btn {
        font-size: 1.3rem;
        padding: 10px 40px;
    }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
    .game-container h1 {
        font-size: 1.2rem;
    }

    .game-container h2 {
        font-size: 0.65rem;
    }



    .game-container .option-btn {
        padding: 10px 12px;
    }

    .game-container .label {
        margin-right: 6px;
    }

    .center-lifeline-btn {
        width: 45px;
        height: 45px;
    }

    .center-lifeline-btn svg {
        width: 22px;
        height: 22px;
    }

    .game-container .welcome-logo {
        width: 200px;
    }

    .game-container .start-btn {
        font-size: 1.1rem;
        padding: 8px 40px;
    }

    .signup-panel .game-container h2 {
        font-size: 1.3rem;
    }

    .game-over-content .game-container h2 {
        font-size: 1.7rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

/* --- WELCOME SCREEN --- */
.game-container .hidden {
    display: none !important;
}

.game-container .welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/images/background.png') no-repeat center center / cover;
    z-index: 65;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    overflow-y: auto;
    padding: 20px 0;
}

.welcome-screen.game-container .hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    z-index: 2;
    padding-bottom: 50px;
}

.game-container .welcome-logo {
    width: 450px;
    height: auto;
    max-width: 80%;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.4));
    animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.4));
        transform: scale(1);
    }

    100% {
        filter: drop-shadow(0 0 40px rgba(0, 243, 255, 0.7));
        transform: scale(1.02);
    }
}

.start-btn {
    padding: 10px 50px;
}

.game-container .start-btn {
    background: linear-gradient(180deg, #0a2e52 0%, #05182d 100%);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid #3a7bc0;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow:
        0 0 20px rgba(0, 150, 255, 0.3),
        inset 0 0 20px rgba(0, 150, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.start-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.start-btn:hover {
    background: linear-gradient(180deg, #104070 0%, #0a2540 100%);
    border-color: #00f3ff;
    box-shadow:
        0 0 30px rgba(0, 243, 255, 0.6),
        inset 0 0 30px rgba(0, 243, 255, 0.2);
    transform: scale(1.05);
}

.start-btn:hover::before {
    left: 100%;
}

.game-container .version {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 1px;
}

/* Enhancements for separation from main game background if needed */
.welcome-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(5, 11, 20, 0.4) 0%, rgba(5, 11, 20, 0.9) 100%);
    z-index: 1;
}

/* --- SIGNUP SCREEN (Uses .welcome-screen as base) --- */
.signup-panel {
    background: rgba(10, 25, 50, 0.95);
    border: 2px solid #3a7bc0;
    border-radius: 20px;
    padding: 40px 60px;
    z-index: 66;
    /* Ensure it floats well above everything */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow:
        0 0 30px rgba(0, 150, 255, 0.4),
        inset 0 0 50px rgba(0, 20, 40, 0.8);
    backdrop-filter: blur(15px);
    width: 600px;
    max-width: 90%;
    position: relative;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.signup-panel .game-container h2 {
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
    text-align: center;
    border-bottom: 2px solid var(--neon-blue);
    padding-bottom: 15px;
    width: 100%;
    letter-spacing: 2px;
}

.signup-panel form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    color: var(--neon-blue);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.input-group input,
.input-group select {
    background: rgba(5, 15, 30, 0.7);
    border: 1px solid #3a7bc0;
    border-radius: 8px;
    padding: 15px 20px;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    background: rgba(10, 30, 60, 0.9);
}

.input-group select option {
    background: #05182d;
    color: #fff;
    padding: 10px;
}

.start-btn::before {
    pointer-events: none;
    /* Critical for reliable clicks */
}

.small-btn {
    margin-top: 10px;
    padding: 15px 40px;
    font-size: 1.6rem;
    width: 100%;
    background: linear-gradient(180deg, #3a7bc0 0%, #0a2e52 100%);
    border-color: #00f3ff;
}

.small-btn:hover {
    background: linear-gradient(180deg, #4da3ff 0%, #104070 100%);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.5);
}

/* --- RULES SCREEN --- */
.cyber-rules-wrapper {
    background: rgba(10, 25, 45, 0.95);
    border: 3px solid var(--neon-blue);
    border-radius: 30px;
    padding: 40px;
    width: 850px;
    max-width: 95%;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.3), inset 0 0 30px rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(15px);
    text-align: center;
    z-index: 10;
}

.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 30px 0;
    text-align: left;
}

.rule-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s ease;
}

.rule-card:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-blue);
    transform: translateY(-5px);
}

.rule-header {
    font-family: 'Rajdhani', sans-serif;
    color: var(--neon-blue);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 8px;
}

.rule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-list li {
    font-size: 0.95rem;
    margin-bottom: 6px;
    padding-left: 15px;
    position: relative;
    color: #b5d0e8;
}

.rule-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--neon-blue);
}

.rule-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #b5d0e8;
    margin: 0;
}

/* --- RESPONSIVE - RULES SCREEN --- */
@media (max-width: 900px) {
    .cyber-rules-wrapper {
        padding: 30px;
    }

    .rules-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .game-container .welcome-screen {
        justify-content: flex-start;
        padding-top: 40px;
    }

    .cyber-rules-wrapper {
        padding: 25px 20px;
        border-radius: 25px;
        margin-bottom: 40px;
    }

    .rules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }

    .rule-card {
        padding: 15px;
    }

    .rule-header {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .cyber-rules-wrapper {
        padding: 20px 15px;
    }

    .cyber-rules-wrapper .cyber-title {
        font-size: 1.6rem !important;
        letter-spacing: 2px;
    }

    .rule-card {
        padding: 12px;
    }

    .rule-header {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .rule-list li {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .rule-card p {
        font-size: 0.85rem;
    }

    #rules-start-game-btn {
        padding: 12px 20px;
        font-size: 0.9rem !important;
    }
}

/* --- GAME OVER SCREEN --- */
.game-container .game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/images/background.png') no-repeat center center / cover;
    z-index: 67;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    backdrop-filter: blur(8px);
}

.game-over-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(30, 10, 10, 0.6) 0%, rgba(5, 0, 0, 0.95) 100%);
    z-index: 1;
}

.game-over-content {
    background: rgba(15, 5, 5, 0.9);
    border: 3px solid #ff3333;
    border-radius: 25px;
    padding: 50px;
    z-index: 10;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3), inset 0 0 30px rgba(255, 0, 0, 0.1);
    width: 650px;
    max-width: 90%;
    animation: fadeInScale 0.5s ease-out;
}

.game-over-content .game-container h2 {
    color: #ff3333;
    font-size: 3.5rem;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 51, 51, 0.8);
    font-family: 'Rajdhani', sans-serif;
    border-bottom: none;
    padding-bottom: 0;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 51, 51, 0.3);
    border-radius: 15px;
    padding: 20px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 51, 51, 0.1);
    border-color: #ff3333;
}

.stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.restart-btn {
    background: linear-gradient(180deg, #ff3333 0%, #a01010 100%);
    border-color: #ff6666;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.4);
}

.restart-btn:hover {
    background: linear-gradient(180deg, #ff4d4d 0%, #cc0000 100%);
    box-shadow: 0 0 40px rgba(255, 51, 51, 0.7);
}

.revival-btn {
    background: linear-gradient(180deg, #00c853 0%, #007e33 100%) !important;
    border: 2px solid #b2ff59 !important;
    color: #000 !important;
    font-weight: 800 !important;
    margin-top: 20px !important;
    width: 100% !important;
    box-shadow: 0 0 25px rgba(0, 200, 83, 0.4) !important;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    transition: all 0.3s ease;
}

.revival-btn:hover {
    background: linear-gradient(180deg, #00e676 0%, #00c853 100%) !important;
    box-shadow: 0 0 40px rgba(0, 200, 83, 0.7) !important;
    transform: translateY(-3px);
}

.game-container .hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- RESPONSIVE - GAME OVER SCREEN --- */
@media (max-width: 768px) {
    .game-over-content {
        padding: 40px 30px;
        width: 85%;
        max-width: 500px;
    }

    .game-over-content h2 {
        font-size: 2.5rem !important;
        margin-bottom: 25px;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 30px 0;
    }

    .stat-item {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .game-over-content {
        padding: 30px 20px;
        width: 92%;
    }

    .game-over-content h2 {
        font-size: 2rem !important;
        letter-spacing: 2px;
        margin-bottom: 20px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
    }

    .stat-item {
        padding: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .stat-label {
        margin-bottom: 0;
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .restart-btn,
    .revival-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .revival-btn {
        margin-top: 12px !important;
    }
}

/* ============================================
   VICTORY SCREEN STYLES - COMPACT DESIGN
   ============================================ */

/* Victory Screen Container - Matches Game Container Style */
.game-container .victory-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 20, 0.95);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 68;
    transition: all 0.5s ease;
}

/* Victory Content Container - Compact Card Style */
.victory-content {
    position: relative;
    width: 85%;
    max-width: 600px;
    background: linear-gradient(135deg,
            rgba(15, 40, 75, 0.95) 0%,
            rgba(10, 30, 60, 0.98) 100%);
    border: 3px solid rgba(0, 243, 255, 0.5);
    border-radius: 25px;
    padding: 40px 35px;
    box-shadow:
        0 0 50px rgba(0, 243, 255, 0.4),
        inset 0 0 60px rgba(0, 100, 150, 0.2);
    backdrop-filter: blur(20px);
    text-align: center;
    animation: victoryEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Tech corners */
    clip-path: polygon(25px 0, calc(100% - 25px) 0,
            100% 25px, 100% calc(100% - 25px),
            calc(100% - 25px) 100%, 25px 100%,
            0 calc(100% - 25px), 0 25px);
}

/* Inner border effect */
.victory-content::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(100, 200, 255, 0.3);
    clip-path: inherit;
    pointer-events: none;
}

@keyframes victoryEntrance {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(40px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Trophy Container - Compact Size */
.trophy-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
}

.trophy-icon {
    font-size: 5rem;
    animation: trophyBounce 2s infinite ease-in-out;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 8px 25px rgba(255, 215, 0, 0.6));
}

@keyframes trophyBounce {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

.trophy-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle,
            rgba(255, 215, 0, 0.3) 0%,
            rgba(255, 215, 0, 0.1) 50%,
            transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s infinite ease-in-out;
    z-index: 1;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

/* Victory Title - Compact */
.victory-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg,
            #00f3ff 0%,
            #00ff88 50%,
            #00f3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: titleGlow 3s infinite alternate;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.5));
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.4));
    }

    100% {
        filter: drop-shadow(0 0 30px rgba(0, 243, 255, 0.8));
    }
}

/* Victory Subtitle - Compact */
.victory-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    color: #b5d0e8;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* Victory Stats Grid - 2 Column Compact Layout */
.victory-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 30px 0;
}

.victory-stat-card {
    background: linear-gradient(135deg,
            rgba(30, 60, 100, 0.6) 0%,
            rgba(15, 35, 70, 0.8) 100%);
    border: 2px solid rgba(0, 243, 255, 0.3);
    border-radius: 15px;
    padding: 20px 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Tech corners */
    clip-path: polygon(12px 0, 100% 0,
            100% calc(100% - 12px), calc(100% - 12px) 100%,
            0 100%, 0 12px);
}

.victory-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.5s ease;
}

.victory-stat-card:hover::before {
    left: 100%;
}

.victory-stat-card:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: #00f3ff;
    box-shadow: 0 8px 30px rgba(0, 243, 255, 0.4);
}


.victory-stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #8fa3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.victory-stat-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #00f3ff;
    text-shadow: 0 0 18px rgba(0, 243, 255, 0.6);
}

/* Victory Action Buttons - Compact */
.victory-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.victory-btn {
    padding: 14px 35px;
    font-size: 1rem;
    min-width: 160px;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.victory-btn.secondary {
    background: linear-gradient(180deg,
            rgba(100, 100, 100, 0.8) 0%,
            rgba(60, 60, 60, 0.9) 100%);
    border-color: rgba(150, 150, 150, 0.6);
}

.victory-btn.secondary:hover {
    background: linear-gradient(180deg,
            rgba(120, 120, 120, 0.9) 0%,
            rgba(80, 80, 80, 1) 100%);
    border-color: #999;
    box-shadow: 0 0 25px rgba(150, 150, 150, 0.4);
}

/* ============================================
   RESPONSIVE - VICTORY SCREEN
   ============================================ */

@media (max-width: 900px) {
    .victory-content {
        padding: 35px 28px;
        max-width: 90%;
    }

    .trophy-icon {
        font-size: 4.5rem;
    }

    .trophy-container {
        width: 90px;
        height: 90px;
        margin-bottom: 20px;
    }

    .victory-title {
        font-size: 2.2rem;
    }

    .victory-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .victory-stats-grid {
        gap: 15px;
        margin: 25px 0;
    }

    .victory-stat-card {
        padding: 18px 12px;
    }

    .victory-stat-label {
        font-size: 0.85rem;
    }

    .victory-stat-value {
        font-size: 2rem;
    }

    .victory-actions {
        flex-direction: column;
        gap: 12px;
    }

    .victory-btn {
        width: 100%;
        min-width: auto;
        padding: 13px 30px;
    }
}

@media (max-width: 600px) {
    .victory-content {
        padding: 30px 22px;
        width: 92%;
    }

    .trophy-icon {
        font-size: 4rem;
    }

    .trophy-container {
        width: 80px;
        height: 80px;
        margin-bottom: 18px;
    }

    .victory-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .victory-subtitle {
        font-size: 0.95rem;
        margin-bottom: 22px;
    }

    .victory-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 22px 0;
    }

    .victory-stat-card {
        padding: 16px 12px;
    }

    .victory-stat-label {
        font-size: 0.8rem;
    }

    .victory-stat-value {
        font-size: 1.8rem;
    }

    .victory-btn {
        font-size: 0.95rem;
        padding: 12px 25px;
    }
}

@media (max-width: 400px) {
    .victory-content {
        padding: 25px 18px;
    }

    .trophy-icon {
        font-size: 3.5rem;
    }

    .victory-title {
        font-size: 1.6rem;
    }

    .victory-subtitle {
        font-size: 0.9rem;
    }

    .victory-stat-value {
        font-size: 1.6rem;
    }
}

/* --- CYBER SIGNUP & COUNTRY STYLES --- */
.cyber-signup-wrapper,
.cyber-country-wrapper {
    background: rgba(8, 20, 40, 0.95);
    border: 3px solid #00f3ff;
    border-radius: 20px;
    padding: 50px 40px;
    position: relative;
    box-shadow: 0 0 60px rgba(0, 243, 255, 0.4), inset 0 0 40px rgba(0, 100, 150, 0.1);
    backdrop-filter: blur(25px);
    overflow: hidden;
    max-width: 650px;
    width: 90%;
    z-index: 69;
    margin: auto;
}

.cyber-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 15px;
}

.cyber-tab {
    background: transparent;
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: rgba(0, 243, 255, 0.6);
    padding: 10px 25px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.cyber-tab.active {
    background: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
    border-color: #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.cyber-panel {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cyber-badge {
    position: absolute;
    top: 25px;
    right: -35px;
    background: #00f3ff;
    color: #0b1a30;
    padding: 8px 50px;
    transform: rotate(45deg);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 2.5px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

.cyber-signup-header,
.game-container .cyber-country-header {
    text-align: center;
    margin-bottom: 40px;
}

.cyber-title {
    font-size: 2.8rem;
    color: #fff;
    text-shadow: 0 0 20px #00f3ff;
    margin-bottom: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
}

.cyber-signup-header p,
.cyber-country-header p {
    color: #b5d0e8;
    letter-spacing: 1.5px;
    font-size: 1.1rem;
}

.cyber-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.cyber-group {
    margin-bottom: 25px;
    text-align: left;
}

.cyber-group label {
    display: block;
    color: #00f3ff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.cyber-group input,
.cyber-group select {
    width: 100%;
    background: rgba(5, 15, 30, 0.9) !important;
    border: 2px solid rgba(0, 243, 255, 0.3) !important;
    border-radius: 10px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.7) !important;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    /* 16px prevents iOS zoom on focus */
    -webkit-text-fill-color: rgba(255, 255, 255, 0.7) !important;
    appearance: none;
    -webkit-appearance: none;
}

.cyber-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300f3ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 18px !important;
    cursor: pointer;
}

.cyber-group select option {
    background: #081428;
    color: #ffffff;
}

/* Fix for browser autofill white background */
.cyber-group input:-webkit-autofill,
.cyber-group input:-webkit-autofill:hover,
.cyber-group input:-webkit-autofill:focus,
.cyber-group select:-webkit-autofill,
.cyber-group select:-webkit-autofill:hover,
.cyber-group select:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(5, 15, 30, 1) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.cyber-group input:focus,
.cyber-group select:focus {
    border-color: #00f3ff !important;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4) !important;
    background: rgba(10, 30, 60, 1) !important;
}

.cyber-group input::placeholder {
    color: rgba(255, 255, 255, 0.1);
}

.cyber-start-btn {
    width: 100%;
    background: linear-gradient(180deg, #0a2e52 0%, #05182d 100%);
    color: #fff;
    border: 2px solid #3a7bc0;
    border-radius: 50px;
    padding: 5px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 15px;
}

.cyber-start-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.cyber-start-btn:hover {
    background: linear-gradient(180deg, #104070 0%, #0a2540 100%);
    border-color: #00f3ff;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.6), inset 0 0 20px rgba(0, 243, 255, 0.2);
    transform: translateY(-5px) scale(1.03);
}

.cyber-start-btn:hover::before {
    left: 100%;
}

.cyber-footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    border-top: 2px solid rgba(0, 243, 255, 0.1);
    padding-top: 25px;
}

.footer-item {
    font-size: 0.8rem;
    color: #4a6b8a;
    letter-spacing: 1.5px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.cyber-status-msg {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
}

.cyber-status-msg.success {
    background: rgba(0, 255, 68, 0.15);
    color: #00ff44;
    border: 1px solid #00ff44;
    box-shadow: 0 0 20px rgba(0, 255, 68, 0.3);
}

.cyber-status-msg.error {
    background: rgba(255, 51, 51, 0.15);
    color: #ff3333;
    border: 1px solid #ff3333;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
}

@media (max-width: 900px) {
    .cyber-input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cyber-signup-wrapper,
    .cyber-country-wrapper {
        padding: clamp(20px, 5vw, 40px);
        width: 100%;
    }

    .cyber-title {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .cyber-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* --- MASTER MUTE BUTTON --- */
.mute-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 50px;
    height: 50px;
    background: rgba(8, 20, 40, 0.84);
    border: 2px solid #00f3ff;
    border-radius: 50%;
    color: #00f3ff;
    cursor: pointer;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 0;
}

.mute-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6), inset 0 0 10px rgba(0, 243, 255, 0.2);
    background: rgba(0, 243, 255, 0.15);
}

.mute-btn svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 5px #00f3ff);
}

.mute-btn .game-container .hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .mute-btn {
        top: 15px;
        left: 15px;
        width: 44px;
        height: 44px;
    }

    .mute-btn svg {
        width: 24px;
        height: 24px;
    }
}