/* 🌌 ULTIMATE PREMIUM DESIGN SYSTEM 2025 */
:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;

    /* Podium Colors */
    --gold: #fbbf24;
    --silver: #cbd5e1;
    --bronze: #d97706;
}

/* --- ✨ MULTIPLE CHOICE OPTIONS --- */
.options-grid {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}

.question-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-option strong {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 1.2rem;
}

/* Modal Content Styles */
.modal-header {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.sol-text {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--success);
    margin-bottom: 2rem;
    word-wrap: break-word;
}

.exp-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #475569;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 5px solid var(--primary);
    word-wrap: break-word;
}

.question-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: var(--primary);
}

/* --- ❌ SHAKE ANIMATION FOR WRONG ANSWERS --- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-10px);
    }

    40%,
    80% {
        transform: translateX(10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px var(--primary-glow);
    }

    100% {
        transform: scale(1);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 🎭 PROJECTOR MODE - FOCUS ON ARENA */
body.game-active {
    overflow-y: auto !important;
}

body.game-active .developer-footer {
    display: none !important;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

button,
.btn-premium,
.hint-btn,
.rule-card,
.podium-card {
    cursor: pointer !important;
}

/* ✨ ANIMATED PARTICLES BACKGROUND */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 15% 15%, #1e1b4b 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, #312e81 0%, transparent 40%),
        #070b14;
}

/* 👤 DEVELOPER FOOTER - STATIC AT END OF CONTENT */
.developer-footer {
    width: 100vw;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 50px;
    box-sizing: border-box;
}

.developer-footer p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
}

.developer-footer strong {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.footer-links a:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

/* 🖼️ SCREEN SYSTEM */
.screen {
    width: 100%;
    min-height: 100vh;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1rem 5rem 1rem;
    box-sizing: border-box;
    transition: opacity 0.4s ease;
}

.screen.active {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* (Redundant sections removed) */

/* 🏆 HEADER STYLES */
.glowing-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    text-align: center;
    background: linear-gradient(90deg, #fff, #a855f7, #6366f1, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix lint */
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
    filter: drop-shadow(0 0 15px var(--primary-glow));
    margin-top: 2rem;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

/* 📜 START SCREEN - 6 RULES GRID */
.rules-container {
    width: 100%;
    max-width: 1100px;
    margin-bottom: 3rem;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.rule-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    text-align: center;
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.rule-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.rule-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.rule-card p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.rule-card.danger {
    border-top: 4px solid var(--accent);
}

.rule-card.warning {
    border-top: 4px solid var(--warning);
}

.rule-card.info {
    border-top: 4px solid var(--primary);
}

/* 🎮 TEAM SETUP */
.team-setup {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 30px;
    width: 100%;
    max-width: 900px;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.team-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.team-input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.team-input-group input,
.team-input-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    color: #fff;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.names-entry {
    margin-bottom: 1.5rem;
}

.names-entry label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.names-entry textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    color: #fff;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.setup-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.teams-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.preview-team-card {
    background: rgba(99, 102, 241, 0.05);
    /* Fixed rgba error */
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 15px;
    text-align: left;
}

.preview-team-card h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.3rem;
    font-size: 0.9rem;
}

.preview-team-card ul {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-main);
}

.preview-team-card li {
    padding: 0.2rem 0;
}

.start-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    padding: 1.5rem 4rem;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: 50px;
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--primary-glow);
    transition: 0.3s;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px var(--primary-glow);
}

/* (Duplicate footer removed - see line 147 for active definition) */

/* 🎮 GAME SCREEN LAYOUT - FIXED */
#gameScreen.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: auto;
    min-height: 100vh;
}

.scoreboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.team-score {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: 0.4s;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.team-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.team-score.active-turn {
    border-color: var(--success) !important;
    background: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.6) !important;
    transform: translateY(-15px) scale(1.05);
    animation: successPulse 1s ease infinite alternate;
}

@keyframes successPulse {
    from {
        transform: translateY(-15px) scale(1.05);
    }

    to {
        transform: translateY(-15px) scale(1.08);
    }
}

.score-pop {
    animation: scorePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

@keyframes scorePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
        color: var(--success);
        text-shadow: 0 0 20px var(--success);
    }

    100% {
        transform: scale(1);
    }
}

.team-points {
    font-size: 3rem;
    font-weight: 900;
    margin: 0.2rem 0;
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.question-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 1rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    width: 100%;
    margin-bottom: 2rem;
}

#questionNumber {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
    justify-content: flex-end;
    max-width: 600px;
}

.timer {
    font-size: 2rem;
    font-weight: 900;
    color: var(--success);
}

.timer-bar {
    flex-grow: 1;
    height: 10px;
    background: #334155;
    border-radius: 5px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: var(--success);
    transition: 1s linear;
    width: 100%;
}

/* 🖼️ QUESTION BOX - GLASSMORPHIC FIX */
.question-outer-container {
    width: 100%;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.badges-wrapper {
    position: absolute;
    top: -24px;
    /* Higher up to avoid the line */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    pointer-events: none;
    z-index: 1001;
}

.question-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    color: #fff;
    padding: 3rem 2rem 2rem 2rem;
    /* Increased top padding */
    border-radius: 30px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    position: relative;
    text-align: center;
    margin-top: 40px;
    z-index: 10;
}

.difficulty-badge,
.category-badge,
.points-badge {
    position: static !important;
    pointer-events: auto;
    padding: 0.6rem 1.6rem;
    border-radius: 100px;
    /* Pillow shape looks more premium */
    font-weight: 800;
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.difficulty-badge:hover,
.category-badge:hover,
.points-badge:hover {
    transform: translateY(-2px);
}

.easy {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: rgba(16, 185, 129, 0.4);
}


.medium {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(59, 130, 246, 0.4);
}

.hard {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: rgba(245, 158, 11, 0.4);
}

.expert {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Category Colors */
.cat-math {
    background: rgba(30, 41, 59, 0.8);
    border-color: #3b82f6;
}

.cat-logic {
    background: rgba(30, 41, 59, 0.8);
    border-color: #8b5cf6;
}

.cat-probability {
    background: rgba(30, 41, 59, 0.8);
    border-color: #ec4899;
}

.cat-general {
    background: rgba(30, 41, 59, 0.8);
    border-color: #10b981;
}

.cat-english {
    background: rgba(30, 41, 59, 0.8);
    border-color: #f59e0b;
}

.points-badge {
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    border-color: rgba(244, 63, 94, 0.4);
}


.question-title {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.question-text {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: #fff;
}

.global-hint-display {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid var(--gold);
    border-radius: 12px;
    margin-top: 2rem;
    color: var(--gold);
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.global-hint-item {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(251, 191, 36, 0.2);
}

.global-hint-item:last-child {
    border-bottom: none;
}

/* 🕹️ NEW MODERATOR DASHBOARD */
.moderator-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.col-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    margin-bottom: 5px;
    padding-left: 5px;
}

.col-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
}

.master-award-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.hint-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.hint-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 0.8rem;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    /* Ensure pointer */
    color: #fff;
    transition: 0.3s;
}

.hint-btn.h1 {
    background: rgba(16, 185, 129, 0.4);
}

.hint-btn.h2 {
    background: rgba(245, 158, 11, 0.4);
}

.hint-btn.h3 {
    background: rgba(239, 68, 68, 0.4);
}

.master-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.master-award-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.navigation-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-premium {
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    /* Force pointer */
    transition: 0.2s;
}

.btn-penalty {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.btn-global-hint {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
}

.btn-answer {
    background: rgba(245, 158, 11, 0.2);
    border: 2px solid var(--warning);
    color: var(--warning);
}

.btn-award {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
}

/* 🚫 PENALTY NOTICE MODAL */
#penaltyNoticeModal .modal-content {
    background: linear-gradient(135deg, #450a0a 0%, #0f172a 100%);
    border: 3px solid var(--danger);
    text-align: center;
    padding: 4rem;
    box-shadow: 0 0 100px rgba(239, 68, 68, 0.4);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* ❌ WRONG ANSWER MODAL STYLES */
#wrongAnswerModal .modal-content {
    background: linear-gradient(135deg, #450a0a 0%, #1e1b4b 100%);
    border: 3px solid #ef4444;
    text-align: center;
    padding: 4rem;
    box-shadow: 0 0 100px rgba(239, 68, 68, 0.4);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.penalty-notice-title {
    font-size: 3.5rem;
    font-weight: 950;
    color: var(--danger);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.penalty-notice-text {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 2rem;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 🎊 VICTORY POPUP MODAL */
#victoryModal .modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 3px solid var(--success);
    text-align: center;
    padding: 4rem;
    box-shadow: 0 0 100px rgba(16, 185, 129, 0.4);
}

.victory-title {
    font-size: 3.5rem;
    font-weight: 950;
    color: var(--success);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    animation: bigPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-team-name {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 2rem;
}

@keyframes bigPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ⚡ BUTTON CLICK ANIMATION */
.btn-award:active {
    transform: scale(0.9) !important;
    background: var(--success) !important;
    color: #fff !important;
}

.award-btn-celebrate {
    animation: btnCelebrate 0.5s ease;
}

@keyframes btnCelebrate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 40px var(--success);
    }

    100% {
        transform: scale(1);
    }
}

/* 🏁 WINNER SCREEN REDESIGN */
.winner-container {
    text-align: center;
    width: 100%;
    padding-top: 2rem;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin: 4rem 0;
}

.podium-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 30px;
    width: 250px;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.podium-card.rank-1 {
    order: 2;
    height: 450px;
    border-top: 15px solid var(--gold);
    transform: translateY(-50px);
    box-shadow: 0 30px 60px rgba(251, 191, 36, 0.2);
}

.podium-card.rank-2 {
    order: 1;
    height: 350px;
    border-top: 12px solid var(--silver);
}

.podium-card.rank-3 {
    order: 3;
    height: 300px;
    border-top: 10px solid var(--bronze);
}

.podium-crown {
    font-size: 5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px gold);
}

.final-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.final-rank-item {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 8px solid var(--primary);
    transition: 0.3s;
}

.final-rank-item.winner {
    border-left-color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15);
}

.final-rank-item .rank-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-dim);
    width: 50px;
}

.final-rank-item.winner .rank-num {
    color: var(--gold);
}

.final-rank-item .rank-name {
    flex-grow: 1;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: left;
}

.final-rank-item .rank-score {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}


.final-rank-item.winner .rank-score {
    color: var(--gold);
}

/* 🪟 MODAL SYSTEM */
.modal {
    display: none;
    /* Crucial fix for visual overlap */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: modalIn 0.4s ease forwards;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: #0f172a;
    color: #fff;
    padding: 3rem;
    border-radius: 40px;
    max-width: 800px;
    width: 90%;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 2.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.penalty-grid-flex {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.penalty-team-box {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
}

/* 🌈 CONSOLATION SCREEN */
.joy-container {
    text-align: center;
    max-width: 900px;
    padding: 4rem;
    background: var(--card-bg);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.joy-title {
    font-size: 4rem;
    font-weight: 950;
    background: linear-gradient(to right, #6366f1, #a855f7, #f43f5e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.joy-message {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--text-dim);
    margin-bottom: 3rem;
}

.joy-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.stat-box {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    min-width: 180px;
}

@media (max-width: 1000px) {
    .rules-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-inputs {
        grid-template-columns: repeat(3, 1fr);
    }

    .setup-grid {
        grid-template-columns: 1fr;
    }

    .podium-container {
        flex-direction: column;
        align-items: center;
    }

    .podium-card {
        width: 100%;
        height: auto !important;
        order: unset !important;
        transform: none !important;
    }

    .game-actions-grid {
        grid-template-columns: 1fr;
    }

    .developer-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        height: auto;
        padding: 1.5rem;
    }

    .punishment-grid {
        grid-template-columns: 1fr !important;
    }
}

/* 📱 MOBILE OPTIMIZATIONS (Phone) */
@media (max-width: 768px) {
    .scoreboard {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .team-inputs {
        grid-template-columns: 1fr;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .timer-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .timer-bar {
        width: 100%;
    }

    .question-info-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .badges-wrapper {
        flex-wrap: wrap;
        top: -40px;
        padding: 0 10px;
    }

    .difficulty-badge,
    .category-badge,
    .points-badge {
        font-size: 0.7rem;
        padding: 0.4rem 1rem;
    }

    .question-text {
        font-size: 1.4rem;
    }

    .hints-section {
        grid-template-columns: 1fr;
    }

    .master-award-btns {
        grid-template-columns: 1fr;
    }

    .penalty-grid-flex {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .sol-text {
        font-size: 1.6rem;
    }

    .exp-text {
        font-size: 1rem;
        padding: 1rem;
    }

    .modal-header {
        font-size: 1.4rem;
    }

    .glowing-title {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 3px;
        margin-bottom: 2rem;
    }

    .start-btn {
        padding: 1.2rem 2.5rem;
        font-size: 1.2rem;
        width: 100%;
    }

    .joy-title {
        font-size: 2.5rem;
    }

    .joy-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-box {
        min-width: unset;
        width: 100%;
    }

    .final-rank-item .rank-name {
        font-size: 1rem;
    }

    .final-rank-item .rank-score {
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 1.2rem;
        width: 95%;
    }

    .victory-title {
        font-size: 2.2rem;
    }

    .victory-team-name {
        font-size: 1.8rem;
    }

    #wrongAnswerModal .modal-content,
    #penaltyNoticeModal .modal-content {
        padding: 2rem 1rem;
    }

    .penalty-notice-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .question-container {
        padding: 3rem 1rem 1.5rem 1rem;
        border-radius: 20px;
    }

    .question-title {
        font-size: 1rem;
    }

    .global-hint-display {
        font-size: 1rem;
        padding: 1rem;
    }

    .team-points {
        font-size: 2.2rem;
    }

    /* Prevent overflow on small screens for modal descriptions */
    [style*="font-size: 1.5rem"] {
        font-size: 1.1rem !important;
    }

    .penalty-notice-title {
        font-size: 1.8rem;
    }
}

/* 🚩 ROUND COMPLETE STYLES */
#roundModal .modal-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 3px solid var(--primary);
    text-align: center;
    color: #fff;
    box-shadow: 0 0 100px rgba(99, 102, 241, 0.4);
}

.round-scores-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.round-scores-summary div {
    font-size: 1.2rem;
    font-weight: 700;
}

.round-scores-summary div span {
    color: var(--primary);
    display: block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

#roundWinnerName {
    font-size: 3rem;
    font-weight: 950;
    background: linear-gradient(45deg, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 1rem;
    text-shadow: 0 0 30px var(--primary-glow);
}

/* 👮‍♂️ NEW MODERATION BUTTONS */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
    color: #fff;
}

.btn-correct {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.btn-correct:hover {
    background: var(--success);
    color: #fff;
}

.btn-wrong {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-wrong:hover {
    background: var(--danger);
    color: #fff;
}