/* ===================================
   FOLKVANGR REALM PORTAL - MAIN STYLES
   =================================== */

/* === ROOT VARIABLES === */
:root {
    /* Neutral Theme (Public/No Characters) */
    --neutral-primary: #2c2c2c;
    --neutral-secondary: #3a3a3a;
    --neutral-accent: #4a4a4a;
    --neutral-text: #e0e0e0;
    
    /* Horde Theme (Red) */
    --horde-primary: #8b0000;
    --horde-secondary: #a01010;
    --horde-accent: #c41e1e;
    --horde-dark: #5a0000;
    --horde-glow: rgba(200, 30, 30, 0.6);
    
    /* Alliance Theme (Blue) */
    --alliance-primary: #003d82;
    --alliance-secondary: #0051a8;
    --alliance-accent: #0066cc;
    --alliance-dark: #002a5c;
    --alliance-glow: rgba(0, 102, 204, 0.6);
    
    /* Golden Accents (Universal) */
    --gold: #d4af37;
    --gold-light: #f4d03f;
    --gold-dark: #b8941e;
    --gold-glow: rgba(212, 175, 55, 0.7);
    
    /* Common Colors */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.6);
}

/* === GLOBAL RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === THEME CLASSES === */
/* Neutral Theme */
body.theme-neutral {
    --theme-primary: var(--neutral-primary);
    --theme-secondary: var(--neutral-secondary);
    --theme-accent: var(--neutral-accent);
    --theme-glow: rgba(74, 74, 74, 0.4);
}

/* Horde Theme */
body.theme-horde {
    --theme-primary: var(--horde-primary);
    --theme-secondary: var(--horde-secondary);
    --theme-accent: var(--horde-accent);
    --theme-glow: var(--horde-glow);
}

/* Alliance Theme */
body.theme-alliance {
    --theme-primary: var(--alliance-primary);
    --theme-secondary: var(--alliance-secondary);
    --theme-accent: var(--alliance-accent);
    --theme-glow: var(--alliance-glow);
}

/* === HEADER === */
header {
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-bottom: 3px solid var(--gold);
    box-shadow: var(--shadow-lg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.realm-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.realm-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.server-status:hover {
    color: var(--gold);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Auth items only shown inside mobile nav */
.nav-auth-item {
    display: none;
}

.nav-auth-greeting span {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nav-auth-divider {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 0 20px var(--gold-glow);
    border: 3px solid var(--gold-light);
}

.logo-text h1 {
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === NAVIGATION === */
nav {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Scoped to desktop list only — never touches mobile lists */
.nav-menu-desktop {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 0;
    margin: 0;
}

.nav-menu-desktop > li {
    position: relative;
}

/* Mobile lists must always be block/vertical — override any inherited flex */
.mobile-nav-list {
    display: block !important;
    flex-direction: unset !important;
}
.mobile-group-items {
    flex-direction: unset !important;
}

nav a {
    display: block;
    padding: 15px 25px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.3s;
    position: relative;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--gold);
    transform: translateX(-50%);
    transition: width 0.3s;
}

/* No underline indicator on mobile menu links */
.mobile-nav-list a::before,
.mobile-group-items a::before {
    display: none !important;
}

nav a:hover {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.05);
}

nav a:hover::before {
    width: 80%;
}

nav a.active {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
}

nav a.active::before {
    width: 80%;
}

/* === HAMBURGER BUTTON (hidden on desktop) === */
.nav-hamburger {
    display: none;
    background: none;
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 7px 9px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* === CONTAINER === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === MAIN CONTENT === */
main {
    flex: 1;
    padding: 40px 0;
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--gold);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="rgba(255,255,255,0.02)" width="50" height="50"/><rect fill="rgba(255,255,255,0.02)" x="50" y="50" width="50" height="50"/></svg>');
    background-size: 50px 50px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3rem;
    color: var(--gold);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border: 2px solid var(--gold-light);
}

.btn-primary:hover {
    box-shadow: 0 0 25px var(--gold-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-primary));
    color: var(--text-primary);
    border: 2px solid var(--theme-accent);
}

.btn-secondary:hover {
    box-shadow: 0 0 25px var(--theme-glow);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
}

.btn-outline:hover {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 25px var(--gold-glow);
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === CARDS === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: linear-gradient(135deg, var(--theme-secondary) 0%, var(--theme-primary) 100%);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    border-color: var(--gold);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    box-shadow: 0 0 20px var(--gold-glow);
}

.card h3 {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
}

/* === STATS SECTION === */
.stats-section {
    margin: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.stat-card {
    background: linear-gradient(135deg, var(--theme-primary) 0%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--gold-glow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === LOGIN GRAPH SECTION === */
.login-graph-section {
    margin: 60px 0;
    padding: 40px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 100%);
    border-radius: 12px;
    border: 2px solid var(--gold-alpha);
    box-shadow: var(--shadow-lg);
}

.login-graph-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 30px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 400px;
}

.login-graph-container canvas {
    max-height: 400px;
}

@media (max-width: 1024px) {
    .login-graph-section {
        padding: 25px;
        margin: 40px 0;
    }
    
    .login-graph-container {
        padding: 20px;
        min-height: 350px;
    }
    
    .login-graph-container canvas {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    .login-graph-section {
        padding: 20px;
        margin: 30px 0;
    }
    
    .login-graph-container {
        padding: 15px;
        min-height: 300px;
    }
    
    .login-graph-container canvas {
        max-height: 300px;
    }
}

/* === FOOTER === */
footer {
    background: linear-gradient(180deg, var(--theme-secondary) 0%, var(--theme-primary) 100%);
    border-top: 3px solid var(--gold);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    /* ---- header-top: single slim bar ---- */
    .header-top {
        padding: 8px 0;
    }

    .header-top .container {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        justify-content: space-between;
        align-items: center;
    }

    .realm-info {
        gap: 10px;
    }

    .realm-name {
        font-size: 0.95rem;
    }

    /* Keep only the pulsing dot, hide "Server Online" text */
    .server-status-text {
        display: none;
    }

    /* Show the hamburger button */
    .nav-hamburger {
        display: flex;
    }

    /* ---- header-main: completely hidden on mobile ---- */
    .header-main {
        display: none;
    }

    /* ---- nav: no visible bar, just the dropdown ---- */
    nav#main-nav {
        background: transparent;
        border-top: none;
    }

    /* Nav menu hidden by default */
    #nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.97);
        border-top: 2px solid var(--gold);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    }

    #nav-menu.nav-open {
        display: flex;
    }

    /* Show auth items inside nav on mobile */
    .nav-auth-item {
        display: list-item;
    }

    nav a {
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.95rem;
    }

    nav a::before {
        display: none;
    }

    nav a.active {
        border-left: 3px solid var(--gold);
        padding-left: 17px;
    }

    /* ---- rest of page ---- */
    .hero {
        padding: 30px 20px;
        border-radius: 10px;
    }

    .hero h2 {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }

    .hero p {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .btn-group .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    main {
        padding: 20px 0;
    }
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }

/* === DOWNLOAD PAGE === */

.downloads-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.download-card {
    background: linear-gradient(135deg, rgba(255,215,0,0.05), rgba(218,165,32,0.05));
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.1), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.download-card:hover {
    border-color: var(--gold-bright);
    background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(218,165,32,0.1));
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.download-card:hover::before {
    left: 100%;
}

.download-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.download-title {
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 10px;
    font-weight: 700;
}

.download-description {
    color: #aaa;
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.download-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #888;
}

.download-details strong {
    color: var(--gold);
}

.download-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    color: #000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

.download-btn:active {
    transform: scale(0.98);
}

.download-btn.protected {
    cursor: pointer;
}

.section-title {
    font-size: 1.8rem;
    color: var(--gold);
    margin: 50px 0 30px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold-alpha);
    font-weight: 700;
}

.info-box {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.1), rgba(0, 120, 255, 0.05));
    border-left: 4px solid #0078ff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    color: #aaa;
}

.info-box h4 {
    color: #0078ff;
    margin-bottom: 10px;
}

.info-box ul {
    margin-left: 20px;
    color: #aaa;
}

.info-box li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.coming-soon .download-btn {
    background: #555;
    color: #999;
    cursor: not-allowed;
}

.coming-soon .download-btn:hover {
    box-shadow: none;
    transform: none;
}

.badge {
    display: inline-block;
    background: var(--gold);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .downloads-grid {
        grid-template-columns: 1fr;
    }

    .download-card {
        padding: 20px;
    }

    .download-title {
        font-size: 1.1rem;
    }
}

/* === LEADERBOARD PAGE === */

.leaderboards-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--gold-alpha);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--gold-alpha);
    color: #aaa;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(218,165,32,0.05));
    border-color: var(--gold);
    color: var(--gold);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--gold-alpha);
}

.leaderboard-table thead {
    background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(218,165,32,0.05));
    border-bottom: 2px solid var(--gold);
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid var(--gold-alpha);
    color: #ccc;
}

.leaderboard-table tbody tr {
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.leaderboard-table tbody tr.own-character {
    background: rgba(0, 255, 0, 0.08);
    border-left: 4px solid #00ff00;
}

.leaderboard-table tbody tr.own-character:hover {
    background: rgba(0, 255, 0, 0.12);
}

.rank {
    font-weight: 700;
    color: var(--gold);
    min-width: 40px;
}

.rank.top1 { color: #ffd700; font-size: 1.2rem; }
.rank.top2 { color: #c0c0c0; font-size: 1.1rem; }
.rank.top3 { color: #cd7f32; font-size: 1.05rem; }

.character-name {
    color: var(--gold);
    font-weight: 600;
    font-size: 1.05rem;
}

.character-info {
    color: #888;
    font-size: 0.9rem;
}

.faction-horde  { color: #b30000; font-weight: 600; }
.faction-alliance { color: #0078ff; font-weight: 600; }
.level-60 { color: #ffd700; font-weight: 700; }

.class-section {
    margin-bottom: 40px;
}

.class-title {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold-alpha);
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .tabs { gap: 5px; }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px;
        font-size: 0.9rem;
    }

    .character-name { font-size: 0.95rem; }
}

/* === LOTTERY PAGE === */

.lottery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.lottery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.lottery-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--gold-alpha);
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
}

.lottery-card:hover {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.lottery-card h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-preview {
    background: rgba(255, 215, 0, 0.1);
    border: 2px dashed var(--gold);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.ticket-preview h4 {
    color: var(--gold);
    margin-bottom: 15px;
}

.ticket-amount {
    font-size: 2rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 10px;
}

.ticket-description {
    color: #aaa;
    font-size: 0.9rem;
}

.btn-purchase {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    color: #000;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-purchase:hover {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.btn-purchase:active { transform: translateY(0); }

.btn-purchase:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.winners-table,
.participants-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--gold-alpha);
    margin-top: 20px;
}

.winners-table thead,
.participants-table thead {
    background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(218,165,32,0.05));
    border-bottom: 2px solid var(--gold);
}

.winners-table th,
.participants-table th {
    padding: 15px;
    text-align: left;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.winners-table td,
.participants-table td {
    padding: 15px;
    border-bottom: 1px solid var(--gold-alpha);
    color: #ccc;
}

.winners-table tbody tr,
.participants-table tbody tr {
    transition: all 0.3s ease;
}

.winners-table tbody tr:hover,
.participants-table tbody tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.no-characters {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .lottery-grid {
        grid-template-columns: 1fr;
    }
}

/* === PLAYER MAP PAGE === */

.map-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.map-btn {
    padding: 12px 24px;
    background: var(--theme-secondary);
    border: 2px solid var(--gold);
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-btn:hover {
    background: var(--theme-accent);
    box-shadow: 0 0 25px var(--gold-glow);
    transform: translateY(-2px);
}

.map-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    box-shadow: 0 0 20px var(--gold-glow);
}

.map-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gold);
}

.map-container {
    position: relative;
    width: 100%;
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
}

.player-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 8px currentColor; }
    50%       { box-shadow: 0 0 20px currentColor; }
}

.player-dot.horde   { background: #b30000; color: #b30000; }
.player-dot.alliance { background: #0078ff; color: #0078ff; }
.player-dot.gm      { background: #ffd700; color: #ffd700; border-color: #ffd700; }

.player-dot:hover {
    width: 20px;
    height: 20px;
    z-index: 100;
    animation: none;
    box-shadow: 0 0 25px currentColor;
}

.player-tooltip {
    position: fixed !important;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10000;
    border: 2px solid var(--gold);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
    display: none;
}

.player-tooltip.show { display: block; }

.tooltip-name {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--gold);
}

.tooltip-info {
    color: #aaa;
    line-height: 1.6;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.legend-dot.horde    { background-color: #b30000; box-shadow: 0 0 4px rgba(179,0,0,0.8); }
.legend-dot.alliance { background-color: #0078ff; box-shadow: 0 0 4px rgba(0,120,255,0.8); }
.legend-dot.gm       { background-color: #ffd700; box-shadow: 0 0 4px rgba(255,215,0,0.9); }

/* === STATISTICS PAGE (additions) === */

.stats-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.timestamp {
    color: #666;
    font-size: 0.85rem;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
}

.stat-sub {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gold-alpha);
}

.stat-sub span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-sub .label {
    font-size: 0.75rem;
    color: #555;
}

.stat-sub .value {
    color: var(--gold);
    font-weight: 600;
}

/* Bot stat line — gray, smaller, sits below the player stat */
.stat-bot {
    font-size: 0.78rem;
    color: #555;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
    letter-spacing: 0.01em;
}

/* Bot sub-value in info-grid cells */
.info-bot {
    color: #555;
    font-size: 0.8rem;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
}

.section {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--gold-alpha);
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-fill.horde    { background: linear-gradient(90deg, #b30000, #ff4444); }
.progress-fill.alliance { background: linear-gradient(90deg, #0078ff, #66b3ff); }

.gold-display {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.1));
    border: 1px solid var(--gold-alpha);
    border-radius: 8px;
    padding: 15px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.gold-value {
    color: var(--gold);
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid var(--gold-alpha);
    border-radius: 8px;
    padding: 15px;
}

.info-label {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-value {
    color: var(--gold);
    font-size: 1.3rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    .section-title { font-size: 1.3rem; }
}

/* === NAVIGATION DROPDOWNS === */

/* nav-inner: flex row, space-between */
.nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
}

/* Desktop nav list */
.nav-menu-desktop {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    flex-wrap: nowrap;
}

.nav-menu-desktop > li > a {
    display: block;
    padding: 0 14px;
    line-height: 52px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-menu-desktop > li > a:hover,
.nav-menu-desktop > li > a.active {
    color: var(--gold);
}

/* Vertical divider between flat links and logged-in items */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--gold-alpha);
    margin: 0 6px;
    align-self: center;
}

/* Dropdown group */
.nav-group {
    position: relative;
}

.nav-group-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
    padding: 0 14px;
    line-height: 52px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-group-btn:hover {
    color: var(--gold);
}

.nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.nav-group:hover .nav-arrow,
.nav-group.open .nav-arrow {
    transform: rotate(180deg);
}

/* Dropdown panel */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 190px;
    background: #1a1a1a;
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 6px 0;
    list-style: none;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    animation: dropFadeIn 0.18s ease;
}

@keyframes dropFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-group:hover .nav-dropdown,
.nav-group.open .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: block;
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav-dropdown li a:hover {
    background: rgba(255,215,0,0.08);
    color: var(--gold);
}

/* Desktop auth area */
.nav-auth-desktop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 0 10px;
    flex-shrink: 0;
}

.nav-welcome {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* btn-play: gold gradient CTA */
.btn-play {
    display: inline-block;
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000 !important;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
    white-space: nowrap;
}

.btn-play:hover {
    box-shadow: 0 0 18px rgba(255,215,0,0.45);
    transform: translateY(-1px);
}

/* btn-sm tweak */
.btn.btn-sm,
a.btn-sm {
    padding: 7px 14px;
    font-size: 0.85rem;
    border-radius: 5px;
}

/* === MOBILE NAV === */

/* Hide desktop nav elements on mobile */
@media (max-width: 1100px) {
    .nav-menu-desktop,
    .nav-auth-desktop {
        display: none !important;
    }

    #main-nav .container.nav-inner {
        display: block;
    }
}

/* Hide mobile nav elements on desktop */
@media (min-width: 1101px) {
    .mobile-menu {
        display: none !important;
    }

    .nav-hamburger {
        display: none !important;
    }
}

/* Mobile slide-down menu */
.mobile-menu {
    display: none;
    background: #111;
    border-top: 2px solid var(--gold-alpha);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.mobile-menu.open {
    display: block;
    max-height: 90vh;
    overflow-y: auto;
}

.mobile-menu-inner {
    padding: 12px 0;
}

.mobile-auth {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px 14px;
    border-bottom: 2px solid var(--gold-alpha);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-list > li > a {
    display: block;
    width: 100%;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.mobile-nav-list > li > a:hover,
.mobile-nav-list > li > a:active {
    color: var(--gold);
    background: rgba(255,215,0,0.06);
}

.mobile-divider {
    height: 2px;
    background: var(--gold-alpha);
    margin: 6px 0;
    display: block;
}

/* Mobile accordion group */
.mobile-group {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-group-toggle {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.nav-group-toggle:hover,
.nav-group-toggle:active {
    color: var(--gold);
    background: rgba(255,215,0,0.06);
}

.mobile-group.open > .nav-group-toggle {
    color: var(--gold);
    background: rgba(255,215,0,0.04);
}

.mobile-arrow {
    font-size: 0.85rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.mobile-group.open .mobile-arrow {
    transform: rotate(180deg);
}

.mobile-group-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    background: rgba(0,0,0,0.2);
    border-left: 3px solid var(--gold-alpha);
}

.mobile-group.open > .mobile-group-items {
    display: block;
}

.mobile-group-items li a {
    display: block;
    width: 100%;
    padding: 12px 20px 12px 28px;
    color: #bbb;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.mobile-group-items li:last-child a {
    border-bottom: none;
}

.mobile-group-items li a:hover,
.mobile-group-items li a:active {
    color: var(--gold);
    background: rgba(255,215,0,0.06);
}

/* === BACK TO TOP === */

.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 22px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 900;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    text-decoration: none;
    line-height: 1;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 0 18px rgba(255,215,0,0.5);
}

/* === MOBILE STICKY PLAY CTA === */

.mobile-play-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    background: rgba(17,17,17,0.97);
    border-top: 2px solid var(--gold-alpha);
    z-index: 850;
    text-align: center;
}

.mobile-play-cta a {
    display: block;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow 0.2s;
}

.mobile-play-cta a:hover {
    box-shadow: 0 0 20px rgba(255,215,0,0.4);
}

@media (max-width: 1100px) {
    .mobile-play-cta {
        display: block;
    }

    body {
        padding-bottom: 64px;
    }
}
