/* ProtoReader - Original Quiz Bowl Practice Platform */
/* Created by Lawrence Tong */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --text: #374151;
    --text-light: #6b7280;
    --base-font-size: 16px;
}

/* Light Theme */
body.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --surface-text: #1f2937;
    --border-color: #e5e7eb;
}

/* Dark Theme */
body.theme-dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --surface-text: #f1f5f9;
    --border-color: #334155;
}

/* Glow Effects */
body.glow-neon-pink {
    --glow-color: #ec4899;
    --glow-color-light: rgba(236, 72, 153, 0.3);
}

body.glow-cyan-dream {
    --glow-color: #06b6d4;
    --glow-color-light: rgba(6, 182, 212, 0.3);
}

body.glow-purple-storm {
    --glow-color: #a855f7;
    --glow-color-light: rgba(168, 85, 247, 0.3);
}

body.glow-sunset-fire {
    --glow-color: #f97316;
    --glow-color-light: rgba(249, 115, 22, 0.3);
}

body.glow-ocean-wave {
    --glow-color: #0ea5e9;
    --glow-color-light: rgba(14, 165, 233, 0.3);
}

body.glow-aurora-lights {
    --glow-color: #8b5cf6;
    --glow-color-light: rgba(139, 92, 246, 0.3);
}

/* VIP Pulsing Themes */
body.glow-pulse-gold-purple {
    --glow-color: #fbbf24;
    --glow-color-light: rgba(251, 191, 36, 0.3);
    --glow-color-secondary: #a855f7;
    --glow-color-secondary-light: rgba(168, 85, 247, 0.3);
}

body.glow-pulse-gold-purple::before {
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--glow-color-light) 0%, transparent 50%);
    animation: pulseGoldPurple 6s ease-in-out infinite;
}

@keyframes pulseGoldPurple {
    0% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 1;
        filter: hue-rotate(60deg);
    }
    100% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
}

body.glow-pulse-cyan-pink {
    --glow-color: #06b6d4;
    --glow-color-light: rgba(6, 182, 212, 0.3);
    --glow-color-secondary: #ec4899;
    --glow-color-secondary-light: rgba(236, 72, 153, 0.3);
}

body.glow-pulse-cyan-pink::before {
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--glow-color-light) 0%, transparent 50%);
    animation: pulseCyanPink 6s ease-in-out infinite;
}

@keyframes pulseCyanPink {
    0% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 1;
        filter: hue-rotate(180deg);
    }
    100% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
}

body.glow-pulse-emerald-amber {
    --glow-color: #10b981;
    --glow-color-light: rgba(16, 185, 129, 0.3);
    --glow-color-secondary: #f59e0b;
    --glow-color-secondary-light: rgba(245, 158, 11, 0.3);
}

body.glow-pulse-emerald-amber::before {
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow-color-secondary-light) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--glow-color-light) 0%, transparent 50%);
    animation: pulseEmeraldAmber 6s ease-in-out infinite;
}

@keyframes pulseEmeraldAmber {
    0% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 1;
        filter: hue-rotate(40deg);
    }
    100% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
}

body.glow-pulse-sky-violet {
    --glow-color: #0ea5e9;
    --glow-color-light: rgba(14, 165, 233, 0.3);
    --glow-color-secondary: #8b5cf6;
    --glow-color-secondary-light: rgba(139, 92, 246, 0.3);
}

body.glow-pulse-sky-violet::before {
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow-color-secondary-light) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--glow-color-light) 0%, transparent 50%);
    animation: pulseSkyViolet 6s ease-in-out infinite;
}

@keyframes pulseSkyViolet {
    0% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 1;
        filter: hue-rotate(80deg);
    }
    100% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
}

body.glow-pulse-rose-teal {
    --glow-color: #f43f5e;
    --glow-color-light: rgba(244, 63, 94, 0.3);
    --glow-color-secondary: #14b8a6;
    --glow-color-secondary-light: rgba(20, 184, 166, 0.3);
}

body.glow-pulse-rose-teal::before {
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow-color-secondary-light) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--glow-color-light) 0%, transparent 50%);
    animation: pulseRoseTeal 6s ease-in-out infinite;
}

@keyframes pulseRoseTeal {
    0% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 1;
        filter: hue-rotate(140deg);
    }
    100% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-primary);
    color: var(--surface-text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: var(--base-font-size);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow-color-light) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--glow-color-light) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.has-glow::before {
    opacity: 1;
    animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--surface-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Screen */
h1 {
    text-align: center;
    font-size: 3.5rem;
    color: var(--surface-text);
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.credit {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 3rem;
    font-style: italic;
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.mode-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.15);
}

body.has-glow .mode-card {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mode-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--surface-text);
}

.mode-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Setup Screens */
h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--surface-text);
    margin-bottom: 2rem;
}

.setup-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12);
}

body.has-glow .setup-panel {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.filter-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--surface-text);
}

.filter-grid {
    display: grid;
    gap: 1.5rem;
}

.filter-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--surface-text);
}

.category-pills, .difficulty-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.pill:hover {
    border-color: var(--primary);
}

.pill.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.year-range {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-range input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--surface-text);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.start-btn {
    background: var(--primary);
    color: var(--white);
}

.start-btn:hover {
    background: var(--primary-dark);
}

.back-btn {
    background: var(--danger);
    color: var(--white);
}

.back-btn:hover {
    background: #dc2626;
}

/* Game Screens */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left, .header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.stat-pill {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
}

.stat-pill span {
    color: var(--primary);
}

.timer-display {
    text-align: center;
}

.timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    font-family: 'Courier New', monospace;
}

.timer.warning {
    color: var(--warning);
}

.timer.danger {
    color: var(--danger);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Game Layout with Sidebar */
.game-container {
    display: flex;
    gap: 2rem;
    position: relative;
}

.game-main {
    flex: 1;
    min-width: 0; /* Allow flexbox to shrink properly */
}

.game-sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.12);
}

body.has-glow .game-sidebar {
    box-shadow: 0 0 25px var(--glow-color-light), 0 0 50px var(--glow-color-light);
}

.game-sidebar.collapsed {
    width: 50px;
    padding: 0.5rem;
}

.game-sidebar.collapsed .sidebar-content {
    display: none;
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    left: -15px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    font-size: 0.8rem;
    padding: 0;
}

.sidebar-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    border: none;
    margin-bottom: 0;
}

.header-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.header-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.header-left, .header-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-pill {
    background: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    display: block;
}

.stat-pill span {
    color: var(--primary);
}

.timer-display {
    text-align: center;
}

.timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    font-family: 'Courier New', monospace;
}

.timer.warning {
    color: var(--warning);
}

.timer.danger {
    color: var(--danger);
    animation: pulse 0.5s infinite;
}

/* Question Display */
.question-display {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 250px;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.12);
}

body.has-glow .question-display {
    box-shadow: 0 0 25px var(--glow-color-light), 0 0 50px var(--glow-color-light);
}

.buzz-log-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.12);
}

body.has-glow .buzz-log-panel {
    box-shadow: 0 0 25px var(--glow-color-light), 0 0 50px var(--glow-color-light);
}

.buzz-log-panel h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.question-metadata {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.question-text {
    font-size: calc(var(--base-font-size) * 1.25);
    line-height: 1.8;
    color: var(--surface-text);
}

.progress-bar {
    margin-top: 1.5rem;
    height: 4px;
    background: var(--light);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.1s linear;
    width: 0%;
}

/* Buzz Section */
.buzz-section {
    text-align: center;
    margin-bottom: 2rem;
}

.buzz-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
    transition: all 0.2s;
}

.buzz-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
}

.buzz-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    box-shadow: none;
}

.buzz-btn.buzzed {
    background: var(--warning);
    animation: buzzPulse 0.4s ease;
}

@keyframes buzzPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.buzz-key {
    font-size: 0.4em;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.buzz-status {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 30px;
}

/* Buzz Log */
.buzz-log {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.buzz-log-empty {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--light);
}

.buzz-log-item {
    display: flex;
    gap: 0.6rem;
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
}

.buzz-log-item.correct {
    border-color: rgba(16, 185, 129, 0.4);
}

.buzz-log-item.incorrect {
    border-color: rgba(239, 68, 68, 0.4);
}

.buzz-log-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
    margin-top: 2px;
}

.buzz-log-item.correct .buzz-log-icon {
    background: var(--secondary);
}

.buzz-log-item.incorrect .buzz-log-icon {
    background: var(--danger);
}

.buzz-log-body {
    flex: 1;
    min-width: 0;
}

.buzz-log-line {
    font-size: 0.85rem;
    color: var(--surface-text);
    word-break: break-word;
}

.buzz-log-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Answer Section */
.answer-section {
    text-align: center;
    margin-bottom: 2rem;
}

.answer-section input {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    font-size: calc(var(--base-font-size) * 1.1);
    border: 2px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.answer-section button {
    background: var(--primary);
    color: var(--white);
}

.answer-feedback {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 30px;
}

.answer-feedback.correct {
    color: var(--secondary);
}

.answer-feedback.incorrect {
    color: var(--danger);
}

/* Bonus Display */
.bonus-display {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.12);
}

body.has-glow .bonus-display {
    box-shadow: 0 0 25px var(--glow-color-light), 0 0 50px var(--glow-color-light);
}

.bonus-leadin {
    font-size: calc(var(--base-font-size) * 1.1);
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    font-weight: 500;
}

.bonus-parts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bonus-part {
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.bonus-part.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.part-label {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.part-question {
    margin-bottom: 1rem;
    font-size: calc(var(--base-font-size) * 1.05);
    line-height: 1.6;
}

.part-answer {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--base-font-size);
    margin-bottom: 0.75rem;
}

.part-submit {
    background: var(--primary);
    color: var(--white);
}

.part-feedback {
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controls button {
    background: var(--text);
    color: var(--white);
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    width: 100%;
}

.controls button:hover {
    background: var(--dark);
}

/* Database Screen */
.search-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12);
}

body.has-glow .search-panel {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--surface-text);
}

.search-bar button {
    background: var(--primary);
    color: var(--white);
}

.search-filters {
    display: flex;
    gap: 1rem;
}

.search-filters select {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--surface-text);
}

.search-results {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12);
}

body.has-glow .search-results {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.search-result {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result:hover {
    background: var(--bg-primary);
}

.search-result:last-child {
    border-bottom: none;
}

/* Statistics */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stats-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12);
}

body.has-glow .stats-section {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.stats-section h3 {
    margin-bottom: 1rem;
    color: var(--surface-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stats-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
}

.clear-stats-btn {
    background: var(--danger);
    color: var(--white);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.clear-stats-btn:hover {
    background: #dc2626;
}

.stat-box {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    text-align: center;
}

.stat-box .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Settings */
.settings-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12);
}

body.has-glow .settings-panel {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--surface-text);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container input[type="range"] {
    flex: 1;
}

.slider-container span {
    font-weight: 600;
    color: var(--primary);
    min-width: 80px;
}

input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
}

/* Multiplayer */
.setup-item {
    margin-bottom: 1.5rem;
}

.setup-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.setup-item input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.room-code {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.room-code strong {
    color: var(--primary);
    font-size: 1.5rem;
}

.players-list {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 200px;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12);
}

body.has-glow .players-list {
    box-shadow: 0 0 20px var(--glow-color-light), 0 0 40px var(--glow-color-light);
}

.player-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.player-item.host {
    background: var(--primary);
    color: var(--white);
}

#connection-status {
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

/* Custom Alert Box */
.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-alert.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.custom-alert-content {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    min-width: 300px;
    box-shadow: 
        0 0 20px rgba(37, 99, 235, 0.4),
        0 0 40px rgba(37, 99, 235, 0.2),
        inset 0 0 20px rgba(37, 99, 235, 0.1);
    animation: alertGlow 2s ease-in-out infinite;
}

.custom-alert-icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    animation: alertPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#custom-alert-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--surface-text);
}

@keyframes alertGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(37, 99, 235, 0.4),
            0 0 40px rgba(37, 99, 235, 0.2),
            inset 0 0 20px rgba(37, 99, 235, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(37, 99, 235, 0.6),
            0 0 60px rgba(37, 99, 235, 0.3),
            inset 0 0 30px rgba(37, 99, 235, 0.15);
    }
}

@keyframes alertPulse {
    0% { 
        transform: scale(0);
        opacity: 0;
    }
    50% { 
        transform: scale(1.15);
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Glow effect for backgrounds */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .mode-cards {
        grid-template-columns: 1fr;
    }
    
    .buzz-btn {
        width: 150px;
        height: 150px;
        font-size: 1.5rem;
    }
    
    .game-container {
        flex-direction: column;
    }
    
    .game-sidebar {
        width: 100%;
        order: -1; /* Put sidebar above main content on mobile */
    }
    
    .game-sidebar.collapsed {
        width: 100%;
        padding: 0.5rem 1rem;
    }
    
    .sidebar-toggle {
        left: 50%;
        transform: translateX(-50%);
        bottom: -15px;
        top: auto;
    }
    
    .game-sidebar.collapsed .sidebar-toggle {
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}
