/* ==========================================================================
   ⚔️ NEXTEDU NEXUS — 1v1 PEER DUEL ARENA STYLESHEET (v7.0.0)
   Obsidian Dark + Frosted Light • 60FPS Hardware Accelerated
   Real-Time Matchmaking • Live Invites • Scorecard AI Analyzer
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ==========================================================================
   1. NEXUS DESIGN TOKENS (Light: Purple/White | Dark: Green/Black)
   ========================================================================== */
:root, [data-theme="light"] {
    --nexus-bg: #f8f5ff;
    --nexus-bg-alt: #f0eaff;
    --nexus-bg-gradient: radial-gradient(circle at 50% -10%, #ede5ff 0%, #f8f5ff 85%);
    --nexus-surface: #ffffff;
    --nexus-surface-card: #ffffff;
    --nexus-surface-hover: #fcfaff;
    --nexus-surface-solid: #ffffff;
    --nexus-glass: rgba(255, 255, 255, 0.96);
    --nexus-glass-border: #e7ddff;
    --nexus-glass-border-hover: rgba(109, 40, 217, 0.4);
    --nexus-text: #171321;
    --nexus-text-muted: #534d66;
    --nexus-text-dim: #7a7393;
    --nexus-primary: #6d28d9;
    --nexus-primary-hover: #5b21b6;
    --nexus-primary-light: rgba(109, 40, 217, 0.08);
    --nexus-cyan: #6d28d9;
    --nexus-blue: #6d28d9;
    --nexus-purple: #6d28d9;
    --nexus-amber: #f59e0b;
    --nexus-emerald: #059669;
    --nexus-rose: #dc2626;
    --nexus-gold: #d97706;
    --nexus-gold-glow: rgba(217, 119, 6, 0.18);
    
    --card-border: #e7ddff;
    --card-bg: #ffffff;
    --input-bg: #f5f0ff;
    
    --nexus-shadow: 0 16px 40px rgba(109, 40, 217, 0.08);
    --nexus-glass-shadow: 0 8px 30px 0 rgba(109, 40, 217, 0.06);
    --nexus-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --nexus-font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --nexus-font-mono: 'SFMono-Regular', Consolas, monospace;
    --nexus-max-width: 960px;
    --nexus-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --nexus-bg: #050807;
    --nexus-bg-alt: #0a0f0d;
    --nexus-bg-gradient: radial-gradient(circle at 50% -10%, #0d1a14 0%, #050807 80%);
    --nexus-surface: #0c1210;
    --nexus-surface-card: #0c1210;
    --nexus-surface-hover: #121a17;
    --nexus-surface-solid: #0c1210;
    --nexus-glass: rgba(12, 18, 16, 0.94);
    --nexus-glass-border: rgba(34, 197, 94, 0.15);
    --nexus-glass-border-hover: rgba(34, 197, 94, 0.45);
    --nexus-text: #edfdf4;
    --nexus-text-muted: #95a59c;
    --nexus-text-dim: #64746b;
    --nexus-primary: #22c55e;
    --nexus-primary-hover: #16a34a;
    --nexus-primary-light: rgba(34, 197, 94, 0.12);
    --nexus-cyan: #22c55e;
    --nexus-blue: #22c55e;
    --nexus-purple: #22c55e;
    --nexus-amber: #f59e0b;
    --nexus-emerald: #22c55e;
    --nexus-rose: #ef4444;
    --nexus-gold: #fbbf24;
    --nexus-gold-glow: rgba(251, 191, 36, 0.28);
    
    --card-border: rgba(34, 197, 94, 0.2);
    --card-bg: #0c1210;
    --input-bg: #111a16;
    
    --nexus-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
    --nexus-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. GLOBAL CANVAS & RESET
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.dashboard-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--nexus-bg);
    background-image: var(--nexus-bg-gradient);
    background-attachment: fixed;
    color: var(--nexus-text);
    font-family: var(--nexus-font);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 20px));
    position: relative;
    overflow-x: hidden;
}

/* Ambient glow orbs */
body.dashboard-body::before {
    content: '';
    position: fixed;
    width: 50vw;
    height: 50vw;
    max-width: 550px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    top: -12%;
    left: -10%;
    z-index: 0;
    pointer-events: none;
    filter: blur(90px);
    transform: translateZ(0);
}
[data-theme="light"] body.dashboard-body::before {
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
}

body.dashboard-body::after {
    content: '';
    position: fixed;
    width: 45vw;
    height: 45vw;
    max-width: 480px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
    bottom: 5%;
    right: -10%;
    z-index: 0;
    pointer-events: none;
    filter: blur(90px);
    transform: translateZ(0);
}

.main-content {
    width: 100%;
    max-width: var(--nexus-max-width);
    margin: 0 auto;
    padding: 10px 18px 40px;
    position: relative;
    z-index: 5;
    animation: nexusFadeUp 0.5s var(--nexus-ease) forwards;
}

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

/* ==========================================================================
   3. APP HEADER (NEXUS COMPACT)
   ========================================================================== */
.app-header {
    width: 100%;
    max-width: var(--nexus-max-width);
    margin: 14px auto 8px;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.header-greeting-box,
.header-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-top-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    color: var(--nexus-text);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: 0.2s var(--nexus-ease);
}
.btn-top-back:hover {
    border-color: var(--nexus-primary);
    color: var(--nexus-primary);
    transform: translateY(-1px);
}

.brand-text-block {
    display: flex;
    flex-direction: column;
}

.nexus-header-btn {
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--nexus-text);
    font-size: 1.15rem;
    transition: all 0.25s var(--nexus-ease);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nexus-header-btn:hover {
    border-color: var(--nexus-primary);
    color: var(--nexus-primary);
    transform: scale(1.05);
    background: var(--nexus-surface-hover);
    box-shadow: 0 4px 16px var(--nexus-cyan-glow);
}

.back-btn-header {
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--nexus-text);
    font-size: 1.1rem;
    transition: all 0.25s var(--nexus-ease);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.back-btn-header:hover {
    border-color: var(--nexus-primary);
    color: var(--nexus-primary);
    transform: translateX(-3px);
    background: var(--nexus-surface-hover);
    box-shadow: 0 4px 16px var(--nexus-cyan-glow);
}

.header-brand-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    padding: 8px 16px;
    border-radius: 999px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-brand-pill .brand-title {
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    color: var(--nexus-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-brand-pill .brand-badge {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 1px solid rgba(236, 72, 153, 0.4);
    color: #f43f5e;
    font-family: var(--nexus-font-mono);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.glossy-btn {
    background: var(--nexus-surface);
    border: 1px solid var(--nexus-glass-border);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexus-text);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.25s var(--nexus-ease);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glossy-btn:hover {
    border-color: var(--nexus-gold);
    color: var(--nexus-gold);
    transform: rotate(15deg) scale(1.05);
}

.header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.2));
    border: 1px solid var(--nexus-glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s var(--nexus-ease);
    overflow: hidden;
    position: relative;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.header-avatar:hover {
    border-color: var(--nexus-cyan);
    transform: scale(1.06);
    box-shadow: 0 4px 18px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   4. ESPORTS DUEL HERO BANNER
   ========================================================================== */
.live-banner {
    position: relative;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.92) 0%, rgba(99, 102, 241, 0.92) 50%, rgba(56, 189, 248, 0.88) 100%);
    border-radius: 26px;
    padding: 26px 30px;
    margin-bottom: 24px;
    overflow: hidden;
    color: #ffffff;
    box-shadow: 0 14px 40px rgba(99, 102, 241, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s var(--nexus-ease), box-shadow 0.3s var(--nexus-ease);
}

.live-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 48px rgba(99, 102, 241, 0.4);
}

.banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.banner-left {
    max-width: 600px;
}

.live-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.live-badge {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 5px 14px;
    border-radius: 999px;
    font-family: var(--nexus-font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399;
    animation: blinkPulse 1.4s infinite;
}

@keyframes blinkPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.3); }
}

.reward-pill {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fef08a;
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 0.74rem;
    padding: 4px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.live-title {
    font-family: var(--nexus-font-heading);
    font-size: 1.85rem;
    font-weight: 900;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.live-desc {
    font-size: 0.94rem;
    opacity: 0.92;
    margin: 8px 0 0;
    font-weight: 500;
    line-height: 1.5;
}

.banner-bg-icon {
    position: absolute;
    right: -15px;
    top: -30px;
    font-size: 10.5rem;
    opacity: 0.12;
    pointer-events: none;
    animation: floatSwords 7s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes floatSwords {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-12px) rotate(4deg); }
}

/* ==========================================================================
   5. ARENA GRID (DUAL-PANE LAYOUT)
   ========================================================================== */
.duel-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    margin-bottom: 26px;
    align-items: stretch;
}

@media (max-width: 820px) {
    .duel-grid {
        grid-template-columns: 1fr;
    }
}

.duel-card {
    background: var(--nexus-surface-card);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 26px;
    padding: 26px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--nexus-glass-shadow);
    transition: all 0.3s var(--nexus-ease);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

.duel-card:hover {
    border-color: var(--nexus-glass-border-hover);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.duel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--nexus-glass-border);
}

.duel-card-title {
    font-family: var(--nexus-font-heading);
    font-size: 1.18rem;
    font-weight: 800;
    margin: 0;
    color: var(--nexus-text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.duel-card-title i {
    font-size: 1.25rem;
}

.duel-card-badge {
    font-family: var(--nexus-font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--nexus-cyan);
}

/* ==========================================================================
   6. CHALLENGE CREATOR FORM & AUTOCOMPLETE
   ========================================================================== */
.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--nexus-font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--nexus-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i.input-icon {
    position: absolute;
    left: 16px;
    color: var(--nexus-text-dim);
    font-size: 1.05rem;
    pointer-events: none;
    transition: color 0.2s var(--nexus-ease);
}

.input-field, .select-field {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border-radius: 16px;
    border: 1px solid var(--nexus-glass-border);
    background: var(--input-bg);
    color: var(--nexus-text);
    font-family: var(--nexus-font);
    font-size: 0.94rem;
    font-weight: 600;
    outline: none;
    transition: all 0.25s var(--nexus-ease);
    box-sizing: border-box;
}

.input-field:focus, .select-field:focus {
    border-color: var(--nexus-cyan);
    background: var(--nexus-surface);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.input-wrapper:focus-within i.input-icon {
    color: var(--nexus-cyan);
}

.select-field {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2338bdf8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 44px;
}

.select-field option {
    background: var(--nexus-surface-solid);
    color: var(--nexus-text);
    padding: 8px;
}

/* Autocomplete Floating Suggestions Dropdown */
#suggestionsDropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--nexus-surface-solid);
    border: 1px solid var(--nexus-glass-border-hover);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.2);
    z-index: 1000;
    max-height: 230px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px;
    animation: dropdownOpen 0.2s var(--nexus-ease) forwards;
}

@keyframes dropdownOpen {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s var(--nexus-ease);
    border: 1px solid transparent;
}

.suggestion-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
    transform: translateX(3px);
}

.suggestion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(99, 102, 241, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--nexus-text);
    flex-shrink: 0;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-username {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--nexus-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-fullname {
    font-size: 0.74rem;
    color: var(--nexus-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-primary {
    width: 100%;
    padding: 15px 20px;
    border-radius: 16px;
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #38bdf8 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.35);
    transition: all 0.3s var(--nexus-ease);
    margin-top: 6px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(139, 92, 246, 0.5);
    filter: brightness(1.08);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* ==========================================================================
   7. BATTLE INVITES SECTION
   ========================================================================== */
#received-invites-container {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--input-bg);
    border: 1px solid var(--nexus-glass-border);
    transition: all 0.25s var(--nexus-ease);
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.invite-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #ec4899, #38bdf8);
    border-radius: 4px 0 0 4px;
}

.invite-item:hover {
    transform: translateY(-2px);
    border-color: var(--nexus-glass-border-hover);
    background: var(--nexus-surface-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.invite-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 180px;
}

.invite-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(99, 102, 241, 0.3));
    border: 1px solid rgba(236, 72, 153, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    color: #f43f5e;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.invite-meta {
    flex: 1;
    min-width: 0;
}

.invite-meta h4 {
    margin: 0;
    font-family: var(--nexus-font-heading);
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--nexus-text);
}

.invite-meta h4 strong {
    color: var(--nexus-cyan);
}

.invite-meta p {
    margin: 3px 0 0 0;
    font-size: 0.76rem;
    color: var(--nexus-text-muted);
    font-weight: 600;
}

.invite-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-action {
    padding: 9px 15px;
    border-radius: 12px;
    font-family: var(--nexus-font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.2s var(--nexus-ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-accept {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    filter: brightness(1.08);
}

.btn-decline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--nexus-rose);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-decline:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.btn-cancel-request {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.btn-cancel-request:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.invite-item.sent-invite-item::before {
    background: linear-gradient(to bottom, #f59e0b, #ef4444);
}

/* Empty state styling */
.empty-arena-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 38px 20px;
    color: var(--nexus-text-muted);
    margin: auto 0;
}

.empty-arena-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid var(--nexus-glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--nexus-cyan);
    margin-bottom: 14px;
    opacity: 0.7;
}

.empty-arena-text {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--nexus-text-muted);
}

.empty-arena-sub {
    font-size: 0.78rem;
    color: var(--nexus-text-dim);
    margin-top: 4px;
}

/* ==========================================================================
   8. COMBAT STANDINGS & MATCH HISTORY
   ========================================================================== */
.history-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.history-filter-tabs {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 14px;
    padding: 3px;
    gap: 4px;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--nexus-text-muted);
    font-family: var(--nexus-font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--nexus-ease);
}

.filter-tab.active {
    background: var(--nexus-cyan);
    color: #060913;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
}

.btn-clear-history {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: var(--nexus-rose);
    padding: 8px 14px;
    border-radius: 12px;
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s var(--nexus-ease);
    outline: none;
}

.btn-clear-history:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

#duel-history-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 20px;
    background: var(--input-bg);
    border: 1px solid var(--nexus-glass-border);
    flex-wrap: wrap;
    gap: 14px;
    transition: all 0.25s var(--nexus-ease);
    position: relative;
    overflow: hidden;
}

.history-row:hover {
    transform: translateY(-2px);
    background: var(--nexus-surface-hover);
    border-color: var(--nexus-glass-border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.history-row.completed-row {
    border-color: rgba(56, 189, 248, 0.2) !important;
    cursor: pointer;
}

.history-row.completed-row:hover {
    border-color: var(--nexus-cyan) !important;
}

.history-row.active-row {
    border-color: rgba(16, 185, 129, 0.3) !important;
    background: rgba(16, 185, 129, 0.05);
}

.history-row.declined-row {
    opacity: 0.6;
    border-color: var(--nexus-glass-border) !important;
}

.player-vs-block {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 0.96rem;
    color: var(--nexus-text);
}

.player-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.player-name.is-you {
    color: var(--nexus-cyan);
}

.vs-badge {
    font-size: 0.68rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ec4899, #6366f1);
    padding: 3px 8px;
    border-radius: 8px;
    color: #ffffff;
    font-family: var(--nexus-font-mono);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.history-meta-block {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.history-subject-tag {
    font-size: 0.82rem;
    color: var(--nexus-text-muted);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.history-score-display {
    font-family: var(--nexus-font-mono);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.duel-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--nexus-font-heading);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--nexus-amber);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.badge-accepted {
    background: rgba(56, 189, 248, 0.12);
    color: var(--nexus-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--nexus-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-declined {
    background: rgba(239, 68, 68, 0.1);
    color: var(--nexus-rose);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   9. DETAILED MATCH SCORECARD MODAL
   ========================================================================== */
.nextedu-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 15, 0.85);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    padding: 20px;
}

.modal-content.modern-card {
    width: 100%;
    max-width: 680px;
    background: var(--nexus-surface-card);
    border: 1px solid var(--nexus-glass-border-hover);
    border-radius: 28px;
    padding: 32px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--nexus-shadow), 0 0 0 1px rgba(56, 189, 248, 0.2);
    animation: modalScaleUp 0.35s var(--nexus-ease) forwards;
    box-sizing: border-box;
}

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

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexus-text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s var(--nexus-ease);
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--nexus-rose);
    color: var(--nexus-rose);
    transform: rotate(90deg);
}

/* AI Scorecard Analyzer Screen (10-Second Countdown) */
#modalAnalyzerScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 10px;
    text-align: center;
}

.analyzer-scanner-rings {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 28px;
}

.ring-outer {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(56, 189, 248, 0.15);
    border-radius: 50%;
}

.ring-rotating {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--nexus-cyan);
    border-right-color: #ec4899;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.ring-pulse-center {
    position: absolute;
    inset: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(13, 19, 36, 0.8) 100%);
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.ring-pulse-center i {
    font-size: 2.2rem;
    color: var(--nexus-cyan);
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.analyzer-title {
    font-family: var(--nexus-font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--nexus-text);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.analyzer-desc {
    color: var(--nexus-text-muted);
    font-size: 0.88rem;
    margin: 0 0 24px;
    font-weight: 500;
    max-width: 380px;
}

.analyzer-timer-box {
    font-family: var(--nexus-font-mono);
    font-size: 2.4rem;
    font-weight: 900;
    color: #ec4899;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 6px 32px;
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(236, 72, 153, 0.25);
    letter-spacing: 1px;
}

/* Scorecard Details Screen */
#modalDetailsScreen {
    display: none;
}

.modal-header-report {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--nexus-glass-border);
}

.modal-subject-title {
    font-family: var(--nexus-font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--nexus-text);
    margin: 8px 0 4px;
    letter-spacing: -0.4px;
}

.modal-match-meta {
    color: var(--nexus-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0;
}

.modal-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    background: var(--input-bg);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 22px;
    text-align: center;
}

.player-score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-score-label {
    font-family: var(--nexus-font-heading);
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--nexus-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-score-num {
    font-family: var(--nexus-font-mono);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.scoreboard-vs-divider {
    font-family: var(--nexus-font-mono);
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--nexus-text-dim);
    background: var(--nexus-surface);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--nexus-glass-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.modal-verdict-banner {
    text-align: center;
    padding: 14px 18px;
    border-radius: 16px;
    font-family: var(--nexus-font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 24px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.breakdown-title {
    font-family: var(--nexus-font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--nexus-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

#modalQuestionsBreakdown {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.question-breakdown-card {
    background: var(--input-bg);
    border: 1px solid var(--nexus-glass-border);
    border-radius: 18px;
    padding: 18px;
    transition: all 0.2s var(--nexus-ease);
}

.question-breakdown-card:hover {
    border-color: var(--nexus-glass-border-hover);
    background: var(--nexus-surface-hover);
}

.q-text-header {
    font-family: var(--nexus-font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--nexus-text);
    margin-bottom: 12px;
    line-height: 1.5;
}

.q-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.q-option-pill {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.84rem;
    border: 1px solid var(--nexus-glass-border);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-option-pill.is-correct {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--nexus-emerald);
    font-weight: 800;
}

.q-option-pill.is-standard {
    background: transparent;
    color: var(--nexus-text-muted);
}

.q-comparison-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--nexus-glass-border);
    padding-top: 12px;
    font-size: 0.82rem;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   10. FLOATING GLASS BOTTOM NAVIGATION
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    left: 15px;
    width: calc(100% - 30px);
    max-width: 500px;
    margin: 0 auto;
    right: 15px;
    height: 64px;
    background: var(--nexus-surface);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--nexus-glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-radius: 32px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nexus-text-muted);
    text-decoration: none;
    transition: all 0.25s var(--nexus-ease);
    height: 44px;
    width: 44px;
    border-radius: 50%;
    border: 1px solid transparent;
}

.bottom-nav-item i {
    font-size: 1.35rem;
    transition: transform 0.25s var(--nexus-ease);
}

.bottom-nav-item.active {
    color: var(--nexus-cyan) !important;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item:hover {
    color: var(--nexus-cyan);
    background: rgba(56, 189, 248, 0.08);
}

.bottom-nav-item span {
    display: none !important;
}

/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 640px) {
    .app-header {
        padding: 8px 12px;
        margin-top: 8px;
    }
    .header-brand-pill .brand-title {
        font-size: 1.05rem;
    }
    .live-banner {
        padding: 20px 18px;
        border-radius: 22px;
        margin-bottom: 20px;
    }
    .live-title {
        font-size: 1.45rem;
    }
    .duel-card {
        padding: 20px 16px;
        border-radius: 22px;
    }
    .modal-content.modern-card {
        padding: 22px 16px;
        border-radius: 22px;
        max-height: 90vh;
        max-height: 90dvh;
    }
    .modal-close-btn {
        top: 14px;
        right: 14px;
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    .modal-scoreboard {
        gap: 10px;
        padding: 16px 10px;
        border-radius: 18px;
    }
    .player-score-label {
        font-size: 0.78rem;
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .player-score-num {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }
    .scoreboard-vs-divider {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    .modal-subject-title {
        font-size: 1.35rem;
    }
    .question-breakdown-card {
        padding: 14px 12px;
        border-radius: 16px;
    }
    .q-comparison-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .q-comparison-footer span {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nextedu-modal {
        padding: 10px !important;
    }
    .modal-content.modern-card {
        padding: 18px 12px !important;
        border-radius: 18px !important;
    }
    .modal-close-btn {
        top: 10px !important;
        right: 10px !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 0.85rem !important;
    }
    .modal-header-report {
        margin-bottom: 16px;
        padding-bottom: 12px;
        padding-top: 6px;
    }
    .modal-subject-title {
        font-size: 1.2rem !important;
        margin: 6px 0 2px !important;
    }
    .modal-match-meta {
        font-size: 0.76rem !important;
    }
    .modal-scoreboard {
        gap: 6px !important;
        padding: 12px 8px !important;
        border-radius: 14px !important;
        margin-bottom: 16px !important;
    }
    .player-score-label {
        font-size: 0.72rem !important;
        max-width: 85px;
    }
    .player-score-num {
        font-size: 1.5rem !important;
    }
    .scoreboard-vs-divider {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.72rem !important;
    }
    .modal-verdict-banner {
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
    }
    .breakdown-title {
        font-size: 0.92rem !important;
        margin-bottom: 10px !important;
    }
    .question-breakdown-card {
        padding: 12px 10px !important;
        border-radius: 14px !important;
    }
    .q-text-header {
        font-size: 0.85rem !important;
        line-height: 1.35 !important;
        margin-bottom: 10px !important;
    }
    .q-option-pill {
        padding: 8px 10px !important;
        font-size: 0.76rem !important;
        border-radius: 10px !important;
    }
    .q-comparison-footer {
        padding-top: 8px !important;
        font-size: 0.76rem !important;
    }
    #modalQuestionsBreakdown {
        gap: 10px !important;
    }
    .history-filter-tabs {
        overflow-x: auto;
        width: 100%;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================================================
   12. LIGHT THEME ENHANCEMENTS (White & Purple) + FORCED DARK GLASS MODALS
   ========================================================================== */
[data-theme="light"] {
    --card-border: rgba(124, 58, 237, 0.12);
    --card-bg: #ffffff;
    --input-bg: #f5f2fa;
}

[data-theme="light"] body.dashboard-body {
    background-color: #fbf9fe;
    background-image: radial-gradient(circle at 50% -10%, #ede8f5 0%, #fbf9fe 85%);
    color: #1e1b4b;
}

/* Header Buttons in Light Mode */
[data-theme="light"] .btn-top-back,
[data-theme="light"] .nexus-header-btn,
[data-theme="light"] .glossy-btn {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.15);
    color: #1e1b4b;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.05);
}

[data-theme="light"] .btn-top-back:hover,
[data-theme="light"] .nexus-header-btn:hover,
[data-theme="light"] .glossy-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #faf7ff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .header-avatar {
    background: #f5f2fa;
    border-color: rgba(124, 58, 237, 0.15);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.05);
}

[data-theme="light"] .header-avatar:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

/* Duel Card Styling in Light Mode */
[data-theme="light"] .duel-card {
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.05);
}

[data-theme="light"] .duel-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 12px 36px rgba(124, 58, 237, 0.09);
}

[data-theme="light"] .duel-card-header {
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .duel-card-title {
    color: #1e1b4b;
}

[data-theme="light"] .duel-card-badge {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.22);
    color: #7c3aed;
}

/* Forms, Inputs & Selects in Light Mode */
[data-theme="light"] .input-label {
    color: #5b5570;
}

[data-theme="light"] .input-wrapper i.input-icon {
    color: #8b859e;
}

[data-theme="light"] .input-field,
[data-theme="light"] .select-field {
    background: #f5f2fa;
    border: 1px solid rgba(124, 58, 237, 0.15);
    color: #1e1b4b;
}

[data-theme="light"] .input-field::placeholder {
    color: #8b859e;
}

[data-theme="light"] .input-field:focus,
[data-theme="light"] .select-field:focus {
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

[data-theme="light"] .input-wrapper:focus-within i.input-icon {
    color: #7c3aed;
}

[data-theme="light"] .select-field option {
    background: #ffffff;
    color: #1e1b4b;
}

[data-theme="light"] .select-field optgroup {
    background: #f5f2fa;
    color: #5b5570;
    font-weight: 700;
}

/* Autocomplete Floating Dropdown in Light Mode */
[data-theme="light"] #suggestionsDropdown {
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.15);
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.12);
}

[data-theme="light"] .suggestion-item:hover {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .suggestion-username {
    color: #1e1b4b;
}

[data-theme="light"] .suggestion-fullname {
    color: #5b5570;
}

/* Primary Action Button */
[data-theme="light"] .btn-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.3) !important;
}

/* Invites Received List in Light Mode */
[data-theme="light"] .invite-item {
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.1);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.04);
}

[data-theme="light"] .invite-item:hover {
    background: #faf7ff;
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .invite-meta h4 {
    color: #1e1b4b;
}

[data-theme="light"] .invite-meta h4 strong {
    color: #7c3aed;
}

[data-theme="light"] .invite-meta p {
    color: #5b5570;
}

[data-theme="light"] .btn-decline {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .btn-decline:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Empty Arena State in Light Mode */
[data-theme="light"] .empty-arena-icon {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
}

[data-theme="light"] .empty-arena-text {
    color: #1e1b4b;
}

[data-theme="light"] .empty-arena-sub {
    color: #5b5570;
}

/* Match History & Filter Tabs in Light Mode */
[data-theme="light"] .history-filter-tabs {
    background: #f5f2fa;
    border: 1px solid rgba(124, 58, 237, 0.12);
}

[data-theme="light"] .filter-tab {
    color: #5b5570;
}

[data-theme="light"] .filter-tab:hover {
    color: #1e1b4b;
}

[data-theme="light"] .filter-tab.active {
    background: #7c3aed;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

[data-theme="light"] .btn-clear-history {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

[data-theme="light"] .btn-clear-history:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

/* History Rows in Light Mode */
[data-theme="light"] .history-row {
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.1);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.04);
}

[data-theme="light"] .history-row:hover {
    background: #faf7ff;
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .history-row.completed-row {
    border-color: rgba(124, 58, 237, 0.2) !important;
}

[data-theme="light"] .history-row.completed-row:hover {
    border-color: #7c3aed !important;
}

[data-theme="light"] .history-row.active-row {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.25) !important;
}

[data-theme="light"] .player-vs-block {
    color: #1e1b4b;
}

[data-theme="light"] .player-name.is-you {
    color: #7c3aed;
}

[data-theme="light"] .history-subject-tag {
    color: #5b5570;
}

/* ==========================================================================
   FORCED DARK GLASS FOR MODALS & SCORECARDS ACROSS BOTH THEMES
   ========================================================================== */
.nextedu-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 5, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: nexusFadeIn 0.3s ease;
}

.modal-content.modern-card {
    background: #191210 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-radius: 28px;
    padding: 36px 30px;
    max-width: 580px;
    width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7) !important;
    color: #f8fafc !important;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #241a16 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s var(--nexus-ease);
}
.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.modal-subject-title {
    color: #f8fafc !important;
}

.modal-match-meta {
    color: #cbd5e1 !important;
}

.modal-scoreboard {
    background: #241a16 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.player-score-label {
    color: #cbd5e1 !important;
}

.scoreboard-vs-divider {
    background: #191210 !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.breakdown-title {
    color: #f8fafc !important;
}

.question-breakdown-card {
    background: #241a16 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.question-breakdown-card:hover {
    border-color: rgba(16, 185, 129, 0.35) !important;
}
.q-text-header {
    color: #f8fafc !important;
}
.analyzer-title {
    color: #f8fafc !important;
}
.analyzer-desc {
    color: #cbd5e1 !important;
}
