/* ============================================
   THE BRAIN SHAKER - Mad Scientist Theme
   ============================================ */

:root {
    --bg-deep: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222;
    --neon-green: #39ff14;
    --neon-green-dim: rgba(57, 255, 20, 0.3);
    --neon-green-glow: rgba(57, 255, 20, 0.15);
    --electric-yellow: #FFE135;
    --danger-red: #FF4500;
    --text-primary: #f0f0f0;
    --text-secondary: #aaa;
    --text-muted: #666;
    --font-display: 'Bangers', cursive;
    --font-body: 'Nunito', sans-serif;
    --font-math: 'Orbitron', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    background-image:
        linear-gradient(rgba(57, 255, 20, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 255, 20, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

a { color: var(--neon-green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--neon-green-dim); border-radius: 4px; }

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(57, 255, 20, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-logo-img {
    height: 45px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-link:hover { color: var(--neon-green); text-decoration: none; }

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-green);
}

.nav-elo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--electric-yellow);
    letter-spacing: 1px;
}

.nav-admin { color: var(--danger-red) !important; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--neon-green);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        padding: 1rem;
        gap: 1rem;
        border-bottom: 1px solid var(--neon-green-dim);
    }
    .nav-links.active { display: flex; }
    .nav-toggle { display: block; }
    .nav-logo-img { height: 35px; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ============================================
   HERO (GUEST HOME)
   ============================================ */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-logo {
    width: 280px;
    max-width: 80%;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(57, 255, 20, 0.4));
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--neon-green);
    letter-spacing: 3px;
    text-shadow: 0 0 20px var(--neon-green-dim), 0 0 40px var(--neon-green-glow);
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-green);
    border-radius: 50%;
    animation: particleFloat 4s linear infinite;
    opacity: 0;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(0) scale(0); }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-200px) scale(1.5); }
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 1px;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--neon-green);
    color: #000;
}
.btn-primary:hover {
    background: #4dff33;
    box-shadow: 0 0 20px var(--neon-green-dim);
    transform: translateY(-2px);
    text-decoration: none;
    color: #000;
}

.btn-secondary {
    background: transparent;
    color: var(--neon-green);
    border: 2px solid var(--neon-green);
}
.btn-secondary:hover {
    background: var(--neon-green-glow);
    text-decoration: none;
    color: var(--neon-green);
}

.btn-danger {
    background: var(--danger-red);
    color: white;
}
.btn-danger:hover {
    background: #ff5722;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.3);
}

.btn-lg { padding: 1rem 2.5rem; font-size: 1.3rem; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

.btn-shake:hover {
    animation: shake 0.4s ease-in-out;
}

.btn-active {
    background: var(--neon-green) !important;
    color: #000 !important;
}

.btn-difficulty {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--neon-green-dim);
    padding: 1rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
}
.btn-difficulty:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green-glow);
}
.btn-difficulty small {
    font-weight: 400;
    color: var(--text-muted);
}

@keyframes shake {
    0%, 100% { transform: translateX(0) translateY(-2px); }
    25% { transform: translateX(-4px) translateY(-2px); }
    75% { transform: translateX(4px) translateY(-2px); }
}

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

/* ============================================
   FORMS & MODALS
   ============================================ */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--neon-green-dim);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: var(--danger-red); }

.modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--neon-green);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-text {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-footer {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-deep);
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition);
}
.form-input:focus {
    outline: none;
    border-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green-glow);
}

.error-msg {
    background: rgba(255, 69, 0, 0.1);
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-error { color: var(--danger-red); }

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-avatar, .dashboard-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--neon-green);
    object-fit: cover;
}

.dashboard-avatar-placeholder {
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--neon-green);
}

.dashboard-username {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.dashboard-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

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

.elo-number {
    font-family: var(--font-math);
    font-size: 3.5rem;
    color: var(--electric-yellow);
    text-shadow: 0 0 20px rgba(255, 225, 53, 0.3);
    line-height: 1;
    display: block;
}

.elo-label {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-muted);
    letter-spacing: 3px;
}

/* ============================================
   MODE CARDS
   ============================================ */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.mode-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    color: var(--text-primary);
}
.mode-card:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 25px var(--neon-green-glow);
    transform: translateY(-4px);
    text-decoration: none;
    color: var(--text-primary);
}

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

.mode-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: var(--neon-green);
}

.mode-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.mode-card-ranked:hover { border-color: var(--electric-yellow); box-shadow: 0 0 25px rgba(255, 225, 53, 0.15); }
.mode-card-ranked .mode-title { color: var(--electric-yellow); }

.mode-card-battle:hover { border-color: var(--danger-red); box-shadow: 0 0 25px rgba(255, 69, 0, 0.15); }
.mode-card-battle .mode-title { color: var(--danger-red); }

.mode-card-competition:hover { border-color: #9b59b6; box-shadow: 0 0 25px rgba(155, 89, 182, 0.15); }
.mode-card-competition .mode-title { color: #9b59b6; }

/* ============================================
   GAME AREA
   ============================================ */
.game-area {
    max-width: 700px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.game-stat {
    text-align: center;
}

.game-stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.game-stat-value {
    font-family: var(--font-math);
    font-size: 1.2rem;
    color: var(--electric-yellow);
    letter-spacing: 1px;
}

.timer-bar-container {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: var(--neon-green);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 100%;
    box-shadow: 0 0 10px var(--neon-green-dim);
}

.timer-bar.timer-warning {
    background: var(--electric-yellow);
    box-shadow: 0 0 10px rgba(255, 225, 53, 0.5);
}

.timer-bar.timer-danger {
    background: var(--danger-red);
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
    animation: pulse 0.5s ease-in-out infinite;
}

.timer-text {
    position: absolute;
    top: -22px;
    right: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 700;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.question-display {
    font-family: var(--font-math);
    font-size: 3rem;
    text-align: center;
    color: var(--text-primary);
    padding: 2rem;
    margin-bottom: 2rem;
    letter-spacing: 3px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid #333;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.answer-area {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.answer-input {
    font-family: var(--font-math);
    font-size: 1.8rem;
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid #444;
    border-radius: var(--radius-sm);
    color: var(--neon-green);
    width: 250px;
    transition: border-color var(--transition);
    letter-spacing: 2px;
    -moz-appearance: textfield;
}
.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.answer-input:focus {
    outline: none;
    border-color: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green-glow);
}

.mad-comment {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.6rem;
    min-height: 2.5rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.mad-comment.correct-comment {
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green-dim);
    animation: bounce 0.5s ease;
}

.mad-comment.wrong-comment {
    color: var(--danger-red);
    text-shadow: 0 0 15px rgba(255, 69, 0, 0.3);
    animation: shake 0.4s ease;
}

.elo-change {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-top: 0.5rem;
}

.elo-up { color: var(--neon-green); }
.elo-down { color: var(--danger-red); }

/* ============================================
   DIFFICULTY SELECTION
   ============================================ */
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   OPERATION SELECTION
   ============================================ */
.operation-selection {
    margin-bottom: 1.5rem;
}

.operation-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-operation {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid #444;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-operation:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green-glow);
}

.btn-operation.btn-active {
    background: var(--neon-green) !important;
    color: #000 !important;
    border-color: var(--neon-green) !important;
}

/* ============================================
   MATCH RESULTS
   ============================================ */
.results-card {
    background: var(--bg-card);
    border: 1px solid var(--neon-green-dim);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-item { text-align: center; }

.result-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.result-value {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 1px;
}

.result-correct { color: var(--neon-green); }
.result-wrong { color: var(--danger-red); }

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-page { max-width: 800px; margin: 0 auto; }

.leaderboard-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid #333;
}

.lb-row {
    cursor: pointer;
    transition: background var(--transition);
}
.lb-row:hover { background: var(--bg-card-hover); }

.lb-row td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1a1a1a;
}

.lb-rank {
    font-family: var(--font-display);
    font-size: 1.2rem;
    width: 50px;
}

.lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.lb-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--neon-green);
}

.lb-name {
    font-weight: 700;
}

.lb-elo {
    font-family: var(--font-math);
    font-size: 1rem;
    color: var(--electric-yellow);
}

.rank-gold td { background: rgba(255, 215, 0, 0.08); }
.rank-silver td { background: rgba(192, 192, 192, 0.05); }
.rank-bronze td { background: rgba(205, 127, 50, 0.05); }

.rank-gold .lb-name { color: #FFD700; }
.rank-silver .lb-name { color: #C0C0C0; }
.rank-bronze .lb-name { color: #CD7F32; }

/* ============================================
   PROFILE
   ============================================ */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--neon-green);
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--neon-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--neon-green);
}

.profile-username {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: 2px;
}

.profile-bio { color: var(--text-secondary); margin: 0.3rem 0; }
.profile-rank { color: var(--electric-yellow); font-weight: 700; }
.profile-joined { color: var(--text-muted); font-size: 0.85rem; }

.elo-badge {
    display: inline-block;
    font-family: var(--font-math);
    font-size: 1.2rem;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    letter-spacing: 1px;
}

.elo-tier-gm { background: rgba(255, 215, 0, 0.15); color: #FFD700; border: 1px solid #FFD700; }
.elo-tier-expert { background: rgba(155, 89, 182, 0.15); color: #9b59b6; border: 1px solid #9b59b6; }
.elo-tier-advanced { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid #3498db; }
.elo-tier-intermediate { background: rgba(57, 255, 20, 0.15); color: var(--neon-green); border: 1px solid var(--neon-green); }
.elo-tier-beginner { background: rgba(255, 225, 53, 0.15); color: var(--electric-yellow); border: 1px solid var(--electric-yellow); }
.elo-tier-novice { background: rgba(255, 69, 0, 0.15); color: var(--danger-red); border: 1px solid var(--danger-red); }

.elo-tier-name {
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-family: var(--font-math);
    font-size: 1.8rem;
    color: var(--neon-green);
    display: block;
    letter-spacing: 1px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-top: 0.2rem;
}

.profile-section {
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--electric-yellow);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

#eloChart {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid #333;
}

.match-log-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.match-mode {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--neon-green);
    min-width: 80px;
}

.match-score { font-weight: 700; }
.match-date { color: var(--text-muted); font-size: 0.85rem; margin-left: auto; }

/* ============================================
   BATTLE
   ============================================ */
.battle-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.join-room-inline {
    display: flex;
    gap: 0.5rem;
}

.join-room-inline .form-input {
    width: 140px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 3px;
}

.battle-room-list {
    display: grid;
    gap: 1rem;
}

.battle-room-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color var(--transition);
}
.battle-room-card:hover {
    border-color: var(--neon-green);
}

.waiting-room {
    text-align: center;
    padding: 2rem;
}

.room-code-display {
    margin: 1rem 0;
}

.room-code {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--electric-yellow);
    letter-spacing: 5px;
    text-shadow: 0 0 20px rgba(255, 225, 53, 0.3);
}

.waiting-players {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.waiting-player {
    background: var(--bg-card);
    border: 1px solid var(--neon-green-dim);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    text-align: center;
}

.waiting-player-name {
    font-weight: 700;
    display: block;
}

.waiting-player-elo {
    font-family: var(--font-display);
    color: var(--electric-yellow);
    font-size: 1.1rem;
}

.battle-scoreboard {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.battle-player-score {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    text-align: center;
    min-width: 100px;
}

.battle-player-score.is-me {
    border-color: var(--neon-green);
}

.battle-player-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

.battle-player-pts {
    font-family: var(--font-math);
    font-size: 1.5rem;
    color: var(--electric-yellow);
}

.battle-final-scoreboard {
    max-width: 500px;
    margin: 0 auto;
}

.battle-final-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border: 1px solid #333;
}

.battle-final-rank {
    font-family: var(--font-display);
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.battle-final-entry:first-child {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.05);
}

/* ============================================
   COMPETITIONS
   ============================================ */
.competition-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color var(--transition);
}
.competition-card:hover { border-color: #9b59b6; }

.comp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comp-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.comp-status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 1px;
}

.status-upcoming { background: rgba(255, 225, 53, 0.15); color: var(--electric-yellow); }
.status-active { background: rgba(57, 255, 20, 0.15); color: var(--neon-green); }
.status-finished { background: rgba(102, 102, 102, 0.15); color: #888; }

.comp-details {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.comp-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.comp-countdown {
    font-family: var(--font-display);
    color: var(--electric-yellow);
    letter-spacing: 1px;
}

/* Podium */
.podium {
    max-width: 500px;
    margin: 1.5rem auto;
}

.podium-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid #333;
}

.podium-rank {
    font-family: var(--font-display);
    font-size: 1.3rem;
    min-width: 40px;
}

.podium-name { font-weight: 700; flex: 1; }

.podium-score {
    font-family: var(--font-display);
    color: var(--electric-yellow);
    font-size: 1.1rem;
}

.podium-gold { border-color: #FFD700; background: rgba(255, 215, 0, 0.05); }
.podium-silver { border-color: #C0C0C0; background: rgba(192, 192, 192, 0.03); }
.podium-bronze { border-color: #CD7F32; background: rgba(205, 127, 50, 0.03); }

.podium-gold .podium-rank { color: #FFD700; }
.podium-silver .podium-rank { color: #C0C0C0; }
.podium-bronze .podium-rank { color: #CD7F32; }

/* ============================================
   ADMIN
   ============================================ */
.admin-page { max-width: 900px; margin: 0 auto; }

.admin-section {
    margin-bottom: 2.5rem;
}

.admin-form {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid #333;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid #333;
}

.admin-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #1a1a1a;
}

.admin-table tr:hover td {
    background: var(--bg-card-hover);
}

/* ============================================
   MINI LEADERBOARD (HOME)
   ============================================ */
.mini-leaderboard .mini-lb-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: background var(--transition);
}
.mini-leaderboard .mini-lb-entry:hover { background: var(--bg-card-hover); }

.mini-lb-rank {
    font-family: var(--font-display);
    font-size: 1.1rem;
    width: 30px;
    text-align: center;
}

.mini-lb-name { font-weight: 700; flex: 1; }

.mini-lb-elo {
    font-family: var(--font-display);
    color: var(--electric-yellow);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
    max-width: 350px;
}

.toast-success {
    background: rgba(57, 255, 20, 0.15);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}

.toast-error {
    background: rgba(255, 69, 0, 0.15);
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* ============================================
   PARTICLES / EFFECTS
   ============================================ */
.correct-explosion {
    position: fixed;
    pointer-events: none;
    z-index: 5000;
}

.spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: sparkFly 0.8s ease-out forwards;
}

@keyframes sparkFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ============================================
   PAGE TITLE
   ============================================ */
.page-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-align: center;
    color: var(--neon-green);
    letter-spacing: 3px;
    margin-bottom: 2rem;
    text-shadow: 0 0 15px var(--neon-green-glow);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .hero-title { font-size: 2rem; }
    .hero-logo { width: 200px; }
    .question-display { font-size: 1.8rem; padding: 1.5rem 1rem; }
    .answer-input { font-size: 1.4rem; width: 180px; }
    .elo-number { font-size: 2.5rem; }
    .mode-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .dashboard-header { flex-direction: column; text-align: center; }
    .game-header { gap: 0.75rem; }
    .answer-area { flex-direction: column; align-items: center; }
    .profile-header { flex-direction: column; text-align: center; }
    .battle-actions { flex-direction: column; }
}
