/* =====================================================
   RETOS.PE — Estilo Gaming
   ===================================================== */

:root {
    --bg-primary:    #0B1437;
    --bg-secondary:  #131A3D;
    --bg-card:       #1A2452;
    --bg-card-hover: #232E66;
    --accent-blue:   #3B82F6;
    --accent-purple: #8B5CF6;
    --accent-pink:   #EC4899;
    --accent-yellow: #FBBF24;
    --accent-green:  #10B981;
    --accent-red:    #EF4444;
    --accent-orange: #F97316;
    --text-primary:  #FFFFFF;
    --text-muted:    #94A3B8;
    --border:        rgba(139, 92, 246, 0.2);

    --gradient-blue:   linear-gradient(135deg, #3B82F6, #1E40AF);
    --gradient-purple: linear-gradient(135deg, #8B5CF6, #6D28D9);
    --gradient-pink:   linear-gradient(135deg, #EC4899, #BE185D);
    --gradient-orange: linear-gradient(135deg, #F97316, #C2410C);
    --gradient-yellow: linear-gradient(135deg, #FBBF24, #D97706);
    --gradient-green:  linear-gradient(135deg, #10B981, #059669);

    --shadow-glow:    0 0 24px rgba(139, 92, 246, 0.3);
    --shadow-card:    0 8px 24px rgba(0, 0, 0, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-display: 'Russo One', 'Bangers', sans-serif;
    --font-body:    'Poppins', system-ui, sans-serif;
}

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

html, body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        var(--bg-primary);
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }

/* =================== LAYOUT =================== */
.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #0F1635 0%, #0B1437 100%);
    border-right: 1px solid var(--border);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    padding: 20px;
    background: linear-gradient(135deg, #1E1B4B, #0B1437);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: var(--gradient-blue);
    border-radius: 8px;
    display: grid; place-items: center;
    box-shadow: var(--shadow-glow);
    font-size: 22px;
}

.sidebar-logo .logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #FBBF24, #EC4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar-logo .logo-sub {
    font-size: 9px; color: var(--text-muted);
    letter-spacing: 0.5px;
}

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
    background: var(--gradient-blue);
    color: white;
    box-shadow: var(--shadow-glow);
}
.nav-item .badge {
    margin-left: auto;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}
.nav-item .badge.new { background: var(--accent-green); }

.streak-card {
    margin: 16px 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.2));
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-radius: var(--radius-md);
    text-align: center;
}
.streak-card .label { font-size: 11px; color: var(--text-muted); }
.streak-card .value {
    font-family: var(--font-display);
    font-size: 32px;
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-area {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 24px;
    background: rgba(15, 22, 53, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}

.compete-banner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(249, 115, 22, 0.15));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    text-align: center;
    flex: 0 0 auto;
}
.compete-banner .top-line {
    font-family: var(--font-display);
    color: var(--accent-yellow);
    font-size: 14px;
    letter-spacing: 1px;
}
.compete-banner .sub { font-size: 11px; color: var(--text-muted); }

.stat-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--border);
}
.stat-pill .icon-circle {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 14px;
}
.stat-pill.energy .icon-circle { background: var(--gradient-blue); }
.stat-pill.coins  .icon-circle { background: var(--gradient-yellow); }
.stat-pill.gems   .icon-circle { background: var(--gradient-purple); }

.user-greeting {
    margin-left: auto;
    display: flex; align-items: center; gap: 12px;
    padding: 6px 14px;
    background: var(--bg-card);
    border-radius: 999px;
    border: 1px solid var(--border);
}
.user-greeting .greet-name { font-weight: 700; font-size: 14px; }
.user-greeting .greet-level { font-size: 11px; color: var(--text-muted); }
.user-greeting .avatar-mini {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
    overflow: hidden;
    background: var(--bg-card);
}
.user-greeting .avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

/* =================== CONTENT =================== */
.content { padding: 24px; display: grid; grid-template-columns: 1fr 360px; gap: 24px; }

@media (max-width: 1100px) { .content { grid-template-columns: 1fr; } .sidebar { display: none; } .app { grid-template-columns: 1fr; } }

/* =================== HERO =================== */
.hero {
    background: linear-gradient(135deg, #1E3A8A 0%, #312E81 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.hero h1 .highlight {
    background: var(--gradient-yellow);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { color: rgba(255,255,255,0.8); margin-bottom: 24px; }
.hero::after {
    content: '';
    position: absolute;
    right: -100px; top: -100px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent);
    pointer-events: none;
}

.battle-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.battle-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.battle-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.battle-card .icon-big {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    font-size: 28px;
    margin-bottom: 16px;
}
.battle-card.normal   .icon-big { background: var(--gradient-blue); }
.battle-card.juvenil  .icon-big { background: var(--gradient-purple); }
.battle-card.desafio  .icon-big { background: var(--gradient-orange); }
.battle-card h3 { font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; margin-bottom: 6px; }
.battle-card p  { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.battle-card.normal { border-top: 4px solid var(--accent-blue); }
.battle-card.juvenil { border-top: 4px solid var(--accent-purple); }
.battle-card.desafio { border-top: 4px solid var(--accent-orange); }

.btn-play {
    display: block; width: 100%;
    padding: 12px;
    background: var(--gradient-yellow);
    color: #1F2937;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    border-radius: var(--radius-md);
    transition: transform 0.2s;
    text-align: center;
}
.btn-play:hover { transform: scale(1.03); }

/* =================== PANEL CARDS =================== */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.panel-title {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}
.panel-link { font-size: 12px; color: var(--accent-yellow); }

/* RIVAL CARDS */
.rivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.rival-card {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s;
}
.rival-card:hover { transform: translateY(-3px); border-color: var(--accent-purple); }
.rival-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid var(--accent-blue);
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
}
.rival-avatar img { width:100%; height:100%; object-fit: cover; }
.rival-avatar .badge-shield {
    position: absolute; top: -4px; right: -4px;
    width: 22px; height: 22px;
    background: var(--accent-green);
    border-radius: 50%;
    display: grid; place-items: center;
    border: 2px solid var(--bg-card);
    font-size: 10px;
}
.rival-name { font-weight: 700; font-size: 14px; }
.rival-info { font-size: 11px; color: var(--text-muted); }
.rival-school { font-size: 11px; color: var(--accent-blue); margin: 4px 0; }
.rival-score {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    font-weight: 800; color: var(--accent-yellow);
    margin: 8px 0;
}
.btn-challenge {
    display: block; width: 100%;
    padding: 8px;
    background: var(--gradient-green);
    color: white;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: var(--radius-sm);
}
.btn-challenge:hover { filter: brightness(1.1); }

/* =================== RIGHT SIDEBAR =================== */
.right-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.profile-card {
    text-align: center;
}
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 3px solid var(--accent-purple);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-glow);
}
.profile-avatar img { width: 100%; height: 100%; }
.profile-name { font-weight: 700; font-size: 18px; }
.profile-level-badge {
    display: inline-block;
    margin: 6px 0;
    padding: 4px 12px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--accent-purple);
    border-radius: 999px;
    font-size: 11px;
    color: var(--accent-purple);
    font-weight: 700;
}
.xp-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}
.xp-bar-fill {
    height: 100%;
    background: var(--gradient-purple);
    transition: width 0.5s;
}
.xp-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: right; }

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.profile-stat {
    text-align: center;
    padding: 12px 4px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}
.profile-stat .icon { font-size: 22px; }
.profile-stat .stat-label { font-size: 10px; color: var(--text-muted); }
.profile-stat .stat-value { font-family: var(--font-display); font-size: 16px; }

/* RANKING */
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}
.ranking-item:hover { background: var(--bg-card-hover); }
.ranking-item.you {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--accent-purple);
}
.ranking-pos {
    width: 24px; text-align: center;
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--accent-yellow);
}
.ranking-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--bg-card);
    display: grid; place-items: center;
    font-size: 14px;
}
.ranking-name { flex: 1; font-size: 13px; font-weight: 600; }
.ranking-points {
    font-family: var(--font-display);
    color: var(--accent-yellow);
    font-size: 14px;
}

/* =================== BOTTOM ROW =================== */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.last-battle {
    display: flex; flex-direction: column; gap: 12px;
}
.battle-header {
    display: flex; align-items: center; justify-content: space-between;
}
.victory-badge {
    background: var(--gradient-green);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.5px;
}
.defeat-badge { background: var(--gradient-orange); color: white; font-size:11px; font-weight:800; padding:4px 10px; border-radius:999px; }
.battle-vs {
    display: flex; align-items: center; gap: 16px; padding: 8px 0;
}
.battle-vs .me-info, .battle-vs .opp-info { flex: 1; display: flex; align-items: center; gap: 10px; }
.battle-vs .vs-text {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--accent-yellow);
}
.battle-vs .opp-info { flex-direction: row-reverse; text-align: right; }
.score-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}
.score-row .score {
    font-family: var(--font-display);
    font-size: 28px;
}

/* CATEGORIES */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.cat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    text-align: center;
    transition: transform 0.2s;
}
.cat-card:hover { transform: translateY(-3px); }
.cat-card .cat-icon {
    width: 48px; height: 48px;
    margin: 0 auto 8px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    font-size: 22px;
}
.cat-card .cat-name { font-size: 13px; font-weight: 600; }
.cat-card .cat-level { font-size: 10px; color: var(--text-muted); }

/* =================== AUTH PAGES =================== */
.auth-container {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}
.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-card .auth-logo .logo-name {
    font-family: var(--font-display);
    font-size: 32px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #FBBF24, #EC4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-card h2 { font-family: var(--font-display); margin-bottom: 8px; font-size: 22px; }
.auth-card .auth-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); font-weight: 500; }
.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--gradient-purple);
    color: white;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1.5px;
    border-radius: var(--radius-md);
    transition: transform 0.2s;
    text-transform: uppercase;
    display: inline-block;
    text-align: center;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

.btn-secondary {
    padding: 10px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    display: inline-block;
}
.btn-secondary:hover { border-color: var(--accent-purple); }

.gender-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.gender-option {
    padding: 14px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.gender-option.selected {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.15);
}
.gender-option .em { font-size: 28px; }
.gender-option .label { font-size: 13px; font-weight: 600; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--accent-red); color: #FCA5A5; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--accent-green); color: #6EE7B7; }
.alert ul { padding-left: 20px; }

.text-link { color: var(--accent-blue); }
.text-link:hover { color: var(--accent-purple); }

/* =================== PLAY / QUESTIONS =================== */
.play-screen {
    min-height: 100vh;
    display: flex; flex-direction: column;
    padding: 24px;
    max-width: 800px; margin: 0 auto;
}
.play-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.q-progress { font-family: var(--font-display); font-size: 18px; }
.timer-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-yellow) 0%, var(--bg-card) 0%);
    display: grid; place-items: center;
    position: relative;
    transition: background 0.3s;
}
.timer-circle::before {
    content: ''; position: absolute; inset: 6px;
    background: var(--bg-primary); border-radius: 50%;
}
.timer-circle .timer-number {
    position: relative; z-index: 1;
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--accent-yellow);
}
.timer-circle.urgent { animation: pulse-urgent 0.5s infinite; }
@keyframes pulse-urgent {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.question-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}
.q-cat-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--accent-purple);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.q-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin: 12px 0 24px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) { .options-grid { grid-template-columns: 1fr; } }

.option-btn {
    padding: 18px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 12px;
}
.option-btn:hover { border-color: var(--accent-purple); background: var(--bg-card-hover); transform: translateY(-2px); }
.option-btn.selected {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: var(--shadow-glow);
}
.option-letter {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 16px;
    flex-shrink: 0;
}
.option-btn.selected .option-letter {
    background: var(--gradient-purple);
}

/* =================== RESULT =================== */
.result-hero {
    text-align: center;
    padding: 60px 20px;
}
.result-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 6vw, 56px);
    letter-spacing: 2px;
    margin: 16px 0;
}
.result-hero h1.win  { background: var(--gradient-yellow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-hero h1.lose { background: var(--gradient-orange); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-hero h1.draw { background: var(--gradient-blue); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-emoji { font-size: 72px; }
.result-vs-cards {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 16px; align-items: center;
    max-width: 700px; margin: 32px auto;
}
.result-side {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    border: 2px solid var(--border);
}
.result-side.winner { border-color: var(--accent-yellow); box-shadow: 0 0 30px rgba(251,191,36,0.3); }
.result-side .avatar-big {
    width: 100px; height: 100px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid var(--accent-purple);
}
.result-side .score-big {
    font-family: var(--font-display);
    font-size: 64px;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.result-side.winner .score-big { background: var(--gradient-yellow); -webkit-background-clip: text; background-clip: text; color: transparent;}
.result-vs { font-family: var(--font-display); font-size: 32px; color: var(--accent-yellow); }

/* =================== TABLE =================== */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
table thead {
    background: rgba(139, 92, 246, 0.1);
}
table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
table tbody tr:hover { background: rgba(139, 92, 246, 0.05); }

.btn-mini {
    padding: 6px 12px; font-size: 12px;
    border-radius: 6px;
    background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid var(--border);
    display: inline-block;
    margin-right: 4px;
}
.btn-mini.danger  { color: #FCA5A5; border-color: var(--accent-red); }
.btn-mini.warn    { color: #FCD34D; border-color: var(--accent-yellow); }
.btn-mini.success { color: #6EE7B7; border-color: var(--accent-green); }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab.active { color: var(--accent-yellow); border-color: var(--accent-yellow); }
.tab:hover { color: var(--text-primary); }

/* Empty state */
.empty {
    text-align: center; padding: 48px 20px;
    color: var(--text-muted);
}
.empty .em { font-size: 56px; margin-bottom: 16px; }

/* Animaciones */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.5s; }

/* Mobile fixes */
@media (max-width: 768px) {
    .battle-cards { grid-template-columns: 1fr; }
    .bottom-row { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .result-vs-cards { grid-template-columns: 1fr; }
    .result-vs { display: none; }
    .topbar { flex-wrap: wrap; }
}

/* ============================================
   AUTH PAGES (Login & Register)
   ============================================ */
.auth-body {
    background: linear-gradient(135deg, #0B1437 0%, #1A1F4D 50%, #2D1B4E 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
}
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    width: 100%;
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-wrapper-wide { grid-template-columns: 1fr; max-width: 700px; }
.auth-card {
    padding: 48px 40px;
    background: var(--bg-card);
}
.auth-card-wide { padding: 40px; }
.auth-side {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #DB2777 100%);
    padding: 48px 40px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-tagline h2 {
    font-family: 'Russo One', sans-serif;
    font-size: 28px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.auth-tagline p { font-size: 16px; opacity: 0.95; margin-bottom: 32px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.feature-item {
    background: rgba(255,255,255,0.12);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    backdrop-filter: blur(8px);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 8px;
}
.logo-shield { font-size: 36px; }
.auth-logo h1 {
    font-family: 'Russo One', sans-serif;
    font-size: 32px;
    color: white;
    margin: 0;
}
.text-yellow { color: var(--accent-yellow); }
.auth-subtitle { color: var(--text-muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}
.form-help { font-size: 12px; margin-top: 4px; }
.form-check {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-soft); font-size: 13px;
}
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.auth-footer {
    margin-top: 24px; text-align: center;
    color: var(--text-muted); font-size: 14px;
}
.link-yellow { color: var(--accent-yellow); text-decoration: none; font-weight: 600; }
.link-yellow:hover { text-decoration: underline; }
.link-muted { color: var(--text-muted); text-decoration: none; }

/* Gender picker */
.gender-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gender-option { cursor: pointer; }
.gender-option input { display: none; }
.gender-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px; border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.08);
    transition: all 0.2s;
}
.gender-option input:checked + .gender-card {
    border-color: var(--accent-yellow);
    background: rgba(255,210,63,0.12);
    transform: translateY(-2px);
}
.gender-icon { font-size: 36px; margin-bottom: 8px; }
.gender-label { font-weight: 600; color: var(--text-soft); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 28px;
    max-width: 560px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.08);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.modal-header h3 { color: white; margin: 0; font-family: 'Russo One', sans-serif; }
.modal-close {
    background: transparent; border: 0; color: var(--text-muted);
    font-size: 28px; cursor: pointer; line-height: 1;
}
.modal-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.modal-body form { display: flex; flex-direction: column; gap: 14px; }

/* ============================================
   PAGE COMMON
   ============================================ */
.page-header {
    display: flex; justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
    font-family: 'Russo One', sans-serif;
    color: white; font-size: 26px; margin: 0;
}
.page-subtitle { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 24px; }

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex; gap: 4px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}
.tab:hover { color: white; background: rgba(255,255,255,0.04); }
.tab.active {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}
.tab-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}
.tab-content { background: transparent; }

/* ============================================
   CHALLENGES LIST
   ============================================ */
.challenges-list { display: flex; flex-direction: column; gap: 10px; }
.challenge-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr auto;
    align-items: center; gap: 14px;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
.challenge-rival { display: flex; gap: 12px; align-items: center; }
.rival-avatar-sm {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
}
.rival-name { color: white; font-weight: 600; }
.rival-meta { color: var(--text-muted); font-size: 12px; }
.challenge-info { text-align: center; }
.challenge-score { display: flex; gap: 8px; justify-content: center; align-items: center; font-weight: 700; }
.score-mine { color: var(--accent-yellow); font-size: 18px; }
.score-rival { color: white; font-size: 18px; }
.score-vs { color: var(--text-muted); font-size: 12px; }
.challenge-time { color: var(--text-soft); font-size: 13px; }
.challenge-time-sm { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.badge-victory { display: inline-block; background: rgba(34,197,94,0.18); color: #4ADE80; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.badge-defeat { display: inline-block; background: rgba(239,68,68,0.18); color: #F87171; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.badge-draw { display: inline-block; background: rgba(168,162,158,0.18); color: #D6D3D1; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.badge-you { background: var(--accent-yellow); color: #0B1437; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; margin-left: 6px; }

.btn-disabled { opacity: 0.5; pointer-events: none; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center; padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 16px;
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { color: white; margin: 0 0 8px; font-family: 'Russo One', sans-serif; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }
.empty-state-sm { text-align: center; padding: 30px; color: var(--text-muted); }
.empty-cell { text-align: center; padding: 30px; color: var(--text-muted); }

/* ============================================
   CTA PANEL
   ============================================ */
.cta-panel {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: 16px; padding: 20px 24px;
    margin-top: 24px; flex-wrap: wrap; gap: 16px;
}
.cta-content h3 { color: white; font-family: 'Russo One', sans-serif; margin: 0 0 4px; }
.cta-content p { color: rgba(255,255,255,0.85); margin: 0; font-size: 14px; }

/* ============================================
   PLAY (juego)
   ============================================ */
.play-body {
    background: linear-gradient(135deg, #0B1437 0%, #1E1B4B 100%);
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: white;
    padding: 16px;
}
.play-wrapper { max-width: 900px; margin: 0 auto; }
.play-header {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}
.play-logo {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Russo One', sans-serif;
    color: white;
    margin-bottom: 14px;
}
.play-vs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px; align-items: center;
}
.play-player { display: flex; gap: 10px; align-items: center; }
.play-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent-yellow);
}
.play-name { font-weight: 700; }
.play-score { color: var(--accent-yellow); font-size: 13px; }
.play-vs-text {
    font-family: 'Russo One', sans-serif;
    font-size: 22px;
    color: var(--accent-yellow);
}
.play-progress {
    text-align: center; margin-top: 14px;
    color: var(--text-soft); font-size: 14px;
}

.play-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 28px;
    position: relative;
}
.timer-wrap {
    display: flex; justify-content: center;
    margin-bottom: 24px;
}
.timer-circle {
    position: relative;
    width: 120px; height: 120px;
}
.timer-svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.timer-bg {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 8;
}
.timer-fg {
    fill: none;
    stroke: #4ADE80;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-circle.timer-warn .timer-fg { stroke: var(--accent-yellow); }
.timer-circle.timer-danger .timer-fg { stroke: #F87171; }
.timer-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Russo One', sans-serif;
    font-size: 38px;
    color: white;
}

.question-card {}
.question-meta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.question-text {
    color: white;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 24px;
    line-height: 1.3;
}
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.option-btn {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 18px 16px;
    color: white; text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 14px;
}
.option-btn:hover:not(.disabled) {
    background: rgba(124,92,255,0.15);
    border-color: #7C5CFF;
    transform: translateY(-2px);
}
.option-btn.selected {
    background: rgba(124,92,255,0.2);
    border-color: #7C5CFF;
}
.option-btn.correct {
    background: rgba(74,222,128,0.18);
    border-color: #4ADE80;
}
.option-btn.wrong {
    background: rgba(248,113,113,0.18);
    border-color: #F87171;
}
.option-btn.disabled { cursor: default; }
.option-letter {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Russo One', sans-serif;
    font-size: 16px;
    flex-shrink: 0;
}
.option-text { flex: 1; }

.play-result-overlay {
    position: absolute; inset: 0;
    background: rgba(11,20,55,0.9);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px;
}
.play-result-card { text-align: center; }
.result-emoji { font-size: 64px; margin-bottom: 14px; }

.badge-category {
    background: rgba(124,92,255,0.18);
    color: #C4B5FD;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.badge-difficulty {
    background: rgba(255,210,63,0.18);
    color: var(--accent-yellow);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.badge-easy { background: rgba(74,222,128,0.18); color: #4ADE80; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.badge-medium { background: rgba(255,210,63,0.18); color: var(--accent-yellow); padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.badge-hard { background: rgba(248,113,113,0.18); color: #F87171; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.badge-level {
    background: rgba(124,92,255,0.18);
    color: #C4B5FD;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.badge-level-big {
    display: inline-block;
    background: linear-gradient(135deg, #7C3AED, #4F46E5);
    color: white;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    margin: 8px 0;
}

/* ============================================
   WAITING
   ============================================ */
.waiting-wrapper {
    display: flex; justify-content: center;
    padding: 20px 0;
}
.waiting-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 600px; width: 100%;
}
.waiting-card h1 {
    font-family: 'Russo One', sans-serif;
    color: white;
    margin: 16px 0 8px;
}
.waiting-subtitle { color: var(--text-muted); margin-bottom: 28px; }
.waiting-animation {
    display: flex; justify-content: center; gap: 8px;
    margin-bottom: 8px;
}
.dot-pulse {
    width: 12px; height: 12px;
    background: var(--accent-yellow);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite;
}
.dot-pulse:nth-child(2) { animation-delay: 0.2s; }
.dot-pulse:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.waiting-vs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 20px;
    margin: 28px 0;
}
.waiting-player { text-align: center; }
.waiting-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-yellow);
}
.waiting-name { color: white; font-weight: 700; margin-top: 8px; }
.waiting-status {
    display: inline-block; margin-top: 6px;
    padding: 4px 12px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
}
.status-done { background: rgba(74,222,128,0.18); color: #4ADE80; }
.status-pending { background: rgba(255,210,63,0.18); color: var(--accent-yellow); }
.waiting-score { color: var(--accent-yellow); font-weight: 700; margin-top: 6px; font-size: 18px; }
.waiting-vs-text {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 22px;
}
.waiting-info {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}
.info-item {
    display: flex; justify-content: space-between;
    color: var(--text-soft); font-size: 14px;
    padding: 6px 0;
}
.info-item strong { color: white; }
.waiting-actions {
    display: flex; gap: 10px; justify-content: center;
    flex-wrap: wrap; margin-top: 20px;
}
.waiting-note {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px;
}

/* ============================================
   RESULT
   ============================================ */
.result-page {}
.result-hero {
    text-align: center;
    border-radius: 20px;
    padding: 40px 24px;
    margin-bottom: 24px;
}
.result-victory {
    background: linear-gradient(135deg, #16A34A, #22C55E);
}
.result-defeat {
    background: linear-gradient(135deg, #B91C1C, #DC2626);
}
.result-draw {
    background: linear-gradient(135deg, #4B5563, #6B7280);
}
.result-icon { font-size: 72px; margin-bottom: 12px; }
.result-hero h1 {
    font-family: 'Russo One', sans-serif;
    font-size: 42px;
    color: white;
    margin: 0 0 8px;
    letter-spacing: 2px;
}
.result-subtitle { color: rgba(255,255,255,0.95); font-size: 16px; }
.result-vs-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px; align-items: center;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 28px 20px;
    margin-bottom: 20px;
}
.result-player { text-align: center; padding: 12px; border-radius: 12px; }
.result-player.is-winner {
    background: rgba(255,210,63,0.1);
    border: 2px solid var(--accent-yellow);
}
.result-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-yellow);
}
.result-name { color: white; font-weight: 700; font-size: 16px; margin-top: 8px; }
.result-meta { color: var(--text-muted); font-size: 12px; }
.result-score {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 36px;
    margin-top: 8px;
}
.result-label { color: var(--text-muted); font-size: 12px; }
.result-vs-text {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 24px;
}
.result-rewards {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}
.result-rewards h3 {
    color: white;
    font-family: 'Russo One', sans-serif;
    margin: 0 0 16px;
}
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.reward-card {
    text-align: center;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px;
}
.reward-icon { font-size: 32px; margin-bottom: 6px; }
.reward-value {
    font-family: 'Russo One', sans-serif;
    font-size: 26px;
    color: var(--accent-yellow);
}
.reward-label { color: var(--text-muted); font-size: 12px; }

.result-questions {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}
.result-questions h3 {
    color: white;
    font-family: 'Russo One', sans-serif;
    margin: 0 0 16px;
}
.questions-review { display: flex; flex-direction: column; gap: 12px; }
.question-review {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px;
    border-left: 3px solid transparent;
}
.question-review.is-correct { border-left-color: #4ADE80; }
.question-review.is-wrong { border-left-color: #F87171; }
.qr-header {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 8px; flex-wrap: wrap;
}
.qr-num {
    background: var(--accent-yellow);
    color: #0B1437;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.qr-status { font-size: 13px; color: var(--text-soft); font-weight: 600; }
.qr-text { color: white; margin: 8px 0; }
.qr-answers {
    display: flex; gap: 16px;
    color: var(--text-muted); font-size: 13px;
    flex-wrap: wrap;
}

.result-actions {
    display: flex; gap: 10px; justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 768px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-main {
    overflow: hidden;
    text-align: center;
    padding: 0;
}
.profile-banner {
    height: 80px;
    background: linear-gradient(135deg, #7C3AED, #4F46E5);
}
.profile-info { padding: 0 20px 20px; margin-top: -40px; }
.profile-avatar-lg {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
}
.profile-info h2 {
    color: white;
    font-family: 'Russo One', sans-serif;
    margin: 12px 0 6px;
}
.profile-school { color: var(--text-muted); font-size: 13px; margin: 8px 0 16px; }
.xp-section { text-align: left; margin-top: 16px; }
.xp-header {
    display: flex; justify-content: space-between;
    color: var(--text-soft); font-size: 12px;
    margin-bottom: 6px;
}
.xp-bar {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
}
.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-yellow), #F59E0B);
    transition: width 0.4s;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 18px; text-align: center;
}
.stat-icon { font-size: 28px; margin-bottom: 4px; }
.stat-value {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 22px;
    margin-bottom: 4px;
}
.stat-label { color: var(--text-muted); font-size: 12px; }

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 14px 20px 20px;
}
.achievement-card {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px; text-align: center;
}
.ach-icon { font-size: 36px; margin-bottom: 6px; }
.ach-name { color: white; font-weight: 700; font-size: 14px; }
.ach-desc { color: var(--text-muted); font-size: 12px; margin: 4px 0; }
.ach-date { color: var(--text-muted); font-size: 11px; }

/* ============================================
   SCHOOL PAGE
   ============================================ */
.school-hero {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center; gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 768px) { .school-hero { grid-template-columns: 1fr; text-align: center; } }
.school-hero-icon {
    font-size: 56px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    width: 90px; height: 90px;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
}
.school-hero-info h2 {
    color: white;
    font-family: 'Russo One', sans-serif;
    margin: 0 0 6px;
}
.school-location { color: var(--text-muted); font-size: 14px; margin: 0 0 8px; }
.school-rank-badge {
    display: inline-block;
    background: rgba(255,210,63,0.15);
    color: var(--accent-yellow);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}
.school-hero-stats { display: flex; gap: 18px; }
.hero-stat { text-align: center; }
.hero-stat-value {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 26px;
}
.hero-stat-label { color: var(--text-muted); font-size: 12px; }

/* ============================================
   RANKINGS TABLE
   ============================================ */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    text-align: left;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ranking-table td {
    padding: 12px;
    color: var(--text-soft);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.ranking-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.ranking-table .is-mine {
    background: rgba(255,210,63,0.06);
}
.rank-medal { font-size: 22px; }
.rank-num {
    display: inline-block;
    background: rgba(255,255,255,0.06);
    width: 28px; height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    color: var(--text-soft);
    font-weight: 700;
    font-size: 12px;
}
.cell-with-icon { display: flex; align-items: center; gap: 10px; }
.school-icon { font-size: 20px; }

.pagination-wrap {
    display: flex; justify-content: center;
    margin-top: 20px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notifications-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center; gap: 14px;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    border-left: 3px solid transparent;
}
.notif-item.is-unread {
    border-left-color: var(--accent-yellow);
    background: rgba(255,210,63,0.04);
}
.notif-icon {
    font-size: 28px;
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.notif-title { color: white; font-weight: 700; font-size: 14px; }
.notif-message { color: var(--text-soft); font-size: 13px; margin: 2px 0; }
.notif-time { color: var(--text-muted); font-size: 11px; }
.notif-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent-yellow);
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-body {
    background: var(--bg-primary);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    color: white;
    min-height: 100vh;
}
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    background: var(--bg-card);
    padding: 20px 14px;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-logo {
    display: flex; gap: 10px; align-items: center;
    padding: 8px 6px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 16px;
}
.admin-logo span { font-size: 26px; }
.admin-logo strong {
    font-family: 'Russo One', sans-serif;
    font-size: 16px;
    display: block;
}
.admin-logo small { color: var(--text-muted); font-size: 11px; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    color: var(--text-soft);
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: inherit;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.04); color: white; }
.admin-nav-item.active {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}
.admin-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 12px 0;
}
.admin-logout-form { margin: 0; }
.admin-logout { color: #F87171 !important; }
.nav-badge {
    margin-left: auto;
    background: var(--accent-red, #EF4444);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.admin-main { display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-topbar-title {
    font-family: 'Russo One', sans-serif;
    font-size: 18px;
}
.admin-topbar-user {
    display: flex; gap: 10px; align-items: center;
    color: var(--text-soft); font-size: 13px;
}
.admin-role {
    background: rgba(124,92,255,0.18);
    color: #C4B5FD;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
}
.admin-content { padding: 24px; flex: 1; }

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card-admin {
    display: flex; gap: 14px; align-items: center;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 18px;
    border-left: 4px solid;
}
.stat-card-admin.stat-blue { border-left-color: #3B82F6; }
.stat-card-admin.stat-green { border-left-color: #22C55E; }
.stat-card-admin.stat-purple { border-left-color: #A855F7; }
.stat-card-admin.stat-orange { border-left-color: #F97316; }
.stat-icon-bg {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
}
.stat-card-value {
    font-family: 'Russo One', sans-serif;
    font-size: 22px;
    color: white;
}
.stat-card-label { color: var(--text-soft); font-size: 12px; }
.stat-card-extra { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
}
@media (max-width: 768px) { .admin-grid-2 { grid-template-columns: 1fr; } }

.quick-stats { padding: 8px 20px 20px; }
.quick-stat {
    display: flex; justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-soft);
    font-size: 14px;
}
.quick-stat:last-child { border: 0; }
.quick-stat strong { color: white; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    text-align: left;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-table td {
    padding: 12px;
    color: var(--text-soft);
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.actions-row { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline; }
.btn-success { background: #22C55E !important; color: white !important; }
.btn-warning { background: #F59E0B !important; color: white !important; }
.btn-danger { background: #EF4444 !important; color: white !important; }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.status-active { background: rgba(34,197,94,0.18); color: #4ADE80; }
.status-blocked { background: rgba(239,68,68,0.18); color: #F87171; }
.status-pending { background: rgba(255,210,63,0.18); color: var(--accent-yellow); }

.filter-form {
    display: flex; gap: 8px; flex-wrap: wrap;
    align-items: center;
}
.filter-form .form-control { padding: 8px 12px; font-size: 13px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.admin-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-actions {
    display: flex; gap: 10px; margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.settings-section {
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.settings-section h4 {
    color: white;
    font-family: 'Russo One', sans-serif;
    margin: 0 0 14px;
    font-size: 16px;
}

.form-check-row {
    display: flex; gap: 12px; align-items: center;
    flex-direction: row !important;
    padding: 10px 0;
}
.form-check-row small { display: block; color: var(--text-muted); font-size: 12px; }

.switch {
    position: relative;
    display: inline-block;
    width: 50px; height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 28px;
    transition: 0.3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px; width: 22px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .slider { background: linear-gradient(135deg, #4F46E5, #7C3AED); }
.switch input:checked + .slider:before { transform: translateX(22px); }

.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }

/* ============================================
   GAME DETAIL ADMIN
   ============================================ */
.game-detail-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px; align-items: center;
    padding: 20px;
}
.game-player-card {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 20px; text-align: center;
}
.game-player-card h4 {
    color: white;
    margin: 0 0 6px;
    font-family: 'Russo One', sans-serif;
}
.game-player-meta { color: var(--text-muted); font-size: 12px; }
.game-player-score {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 36px;
    margin: 12px 0 4px;
}
.game-player-label { color: var(--text-muted); font-size: 12px; }
.game-player-extra { color: var(--text-soft); font-size: 13px; margin-top: 8px; }

.game-vs-info { text-align: center; }
.game-vs-text {
    font-family: 'Russo One', sans-serif;
    color: var(--accent-yellow);
    font-size: 28px;
}
.game-status {
    background: rgba(255,255,255,0.06);
    padding: 6px 14px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}
.game-winner {
    color: var(--accent-yellow);
    font-weight: 700;
    margin-top: 8px;
}
.game-meta-info {
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 16px;
    margin: 0 20px;
    color: var(--text-soft);
    font-size: 13px;
    display: flex; gap: 20px; flex-wrap: wrap;
}
