/* Madness Combat Menu Style - Professional Edition */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
    --madness-red: #ff0a0a;
    --madness-red-dark: #8b0000;
    --madness-red-glow: rgba(255, 10, 10, 0.5);
    --madness-dark: #0a0a0a;
    --madness-darker: #050505;
    --madness-grey: #1a1a1a;
    --madness-grey-light: #2a2a2a;
    --madness-text: #e0e0e0;
    --madness-text-dim: #666;
    --madness-accent: #ff3333;
    --madness-gold: #ffd700;
    --madness-silver: #c0c0c0;
    --madness-bronze: #cd7f32;
}

/* ============================================
   MAIN MENU CONTAINER
   ============================================ */
#menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--madness-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 100;
    overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
.menu-bg-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        linear-gradient(rgba(255, 10, 10, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 10, 10, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
    z-index: 0;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.menu-bg-scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1;
    animation: scanline-flicker 0.1s infinite;
}

@keyframes scanline-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
}

.menu-bg-vignette {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, transparent 40%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 2;
}

.menu-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.menu-content {
    display: flex;
    gap: 60px;
    z-index: 10;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
}

.menu-left-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    flex: 1;
    max-width: 500px;
}

.menu-right-panel {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

/* ============================================
   LOGO & BRANDING
   ============================================ */
.menu-logo-container {
    position: relative;
    margin-bottom: 20px;
}

.menu-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 4px;
    line-height: 1;
    position: relative;
    display: inline-block;
}

.logo-m {
    color: var(--madness-red);
    text-shadow: 
        0 0 20px var(--madness-red-glow),
        0 0 40px var(--madness-red-glow),
        4px 4px 0 rgba(0,0,0,0.8);
    animation: logo-pulse 2s ease-in-out infinite;
    display: inline-block;
}

.logo-rest {
    color: var(--madness-text);
    text-shadow: 
        2px 2px 0 rgba(0,0,0,0.8),
        0 0 10px rgba(255,255,255,0.1);
}

@keyframes logo-pulse {
    0%, 100% { 
        text-shadow: 
            0 0 20px var(--madness-red-glow),
            0 0 40px var(--madness-red-glow),
            4px 4px 0 rgba(0,0,0,0.8);
    }
    50% { 
        text-shadow: 
            0 0 30px var(--madness-red-glow),
            0 0 60px var(--madness-red-glow),
            0 0 80px rgba(255,10,10,0.3),
            4px 4px 0 rgba(0,0,0,0.8);
    }
}

.menu-domain {
    font-family: 'Share Tech Mono', monospace;
    font-size: 24px;
    color: var(--madness-red);
    letter-spacing: 6px;
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(90deg, rgba(255,10,10,0.1) 0%, transparent 100%);
    border-left: 3px solid var(--madness-red);
    animation: domain-glow 3s ease-in-out infinite;
}

@keyframes domain-glow {
    0%, 100% { border-left-color: var(--madness-red); }
    50% { border-left-color: var(--madness-accent); }
}

/* ============================================
   MENU BUTTONS
   ============================================ */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.menu-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, var(--madness-grey) 0%, var(--madness-dark) 100%);
    border: 2px solid var(--madness-grey-light);
    color: var(--madness-text);
    padding: 20px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    border-color: var(--madness-red);
    background: linear-gradient(135deg, var(--madness-grey-light) 0%, var(--madness-grey) 100%);
    transform: translateX(10px);
    box-shadow: 
        -5px 0 20px var(--madness-red-glow),
        inset 0 0 20px rgba(255,10,10,0.1);
}

.menu-btn:active {
    transform: translateX(5px) scale(0.98);
}

.menu-btn .btn-icon {
    font-size: 24px;
    color: var(--madness-text-dim);
    transition: color 0.3s, transform 0.3s;
}

.menu-btn:hover .btn-icon {
    color: var(--madness-red);
    transform: scale(1.2);
}

.menu-btn .btn-text {
    flex: 1;
}

.menu-btn .btn-glow {
    position: absolute;
    top: 50%;
    right: 20px;
    width: 8px;
    height: 8px;
    background: var(--madness-text-dim);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: all 0.3s;
}

.menu-btn:hover .btn-glow {
    background: var(--madness-red);
    box-shadow: 0 0 10px var(--madness-red), 0 0 20px var(--madness-red-glow);
}

/* Primary Button Special Style */
.menu-btn.primary {
    border-color: var(--madness-red-dark);
    background: linear-gradient(135deg, rgba(139,0,0,0.3) 0%, var(--madness-dark) 100%);
    font-size: 22px;
    padding: 25px 35px;
}

.menu-btn.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--madness-red);
    opacity: 0.3;
    animation: primary-pulse 2s ease-in-out infinite;
}

@keyframes primary-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.menu-btn.primary:hover {
    border-color: var(--madness-red);
    background: linear-gradient(135deg, rgba(255,10,10,0.3) 0%, rgba(139,0,0,0.3) 100%);
}

/* ============================================
   SOCIAL LINKS
   ============================================ */
.menu-social {
    margin-top: 10px;
}

.discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    border: 2px solid #7289da;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.3s;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.discord-btn:hover {
    background: linear-gradient(135deg, #7289da 0%, #5865F2 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.4);
}

.discord-icon {
    width: 24px;
    height: 24px;
}

/* ============================================
   ONLINE STATUS
   ============================================ */
.menu-online-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 4px;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 10px #0f0, 0 0 20px rgba(0,255,0,0.5);
    animation: online-pulse 1.5s ease-in-out infinite;
}

@keyframes online-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.online-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #0f0;
    text-shadow: 0 0 10px rgba(0,255,0,0.5);
}

.online-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--madness-text-dim);
    letter-spacing: 2px;
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-container {
    background: linear-gradient(180deg, var(--madness-grey) 0%, var(--madness-dark) 100%);
    border: 2px solid var(--madness-grey-light);
    height: 100%;
    display: flex;
    flex-direction: column;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    max-height: 500px;
}

.leaderboard-header {
    padding: 20px 25px;
    background: linear-gradient(90deg, var(--madness-red-dark) 0%, transparent 100%);
    border-bottom: 2px solid var(--madness-red);
}

.leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--madness-text);
    letter-spacing: 3px;
}

.leaderboard-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--madness-red);
    letter-spacing: 2px;
    margin-top: 4px;
}

.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 15px;
    color: var(--madness-text-dim);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 2px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--madness-grey-light);
    border-top-color: var(--madness-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Leaderboard Item */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(0,0,0,0.3);
    border-left: 3px solid var(--madness-grey-light);
    margin-bottom: 8px;
    transition: all 0.2s;
    animation: item-slide-in 0.3s ease-out backwards;
}

.leaderboard-item:hover {
    background: rgba(255,10,10,0.1);
    border-left-color: var(--madness-red);
    transform: translateX(5px);
}

.leaderboard-item.rank-1 { border-left-color: var(--madness-gold); }
.leaderboard-item.rank-2 { border-left-color: var(--madness-silver); }
.leaderboard-item.rank-3 { border-left-color: var(--madness-bronze); }

@keyframes item-slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.leaderboard-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    width: 35px;
    text-align: center;
    color: var(--madness-text-dim);
}

.leaderboard-item.rank-1 .leaderboard-rank { color: var(--madness-gold); text-shadow: 0 0 10px rgba(255,215,0,0.5); }
.leaderboard-item.rank-2 .leaderboard-rank { color: var(--madness-silver); }
.leaderboard-item.rank-3 .leaderboard-rank { color: var(--madness-bronze); }

.leaderboard-name {
    flex: 1;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--madness-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--madness-red);
    background: rgba(255,10,10,0.1);
    padding: 4px 10px;
    border-radius: 3px;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */
#settings-panel {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 20;
    align-items: center;
    justify-content: center;
}

.settings-container {
    width: 450px;
    background: linear-gradient(180deg, var(--madness-grey) 0%, var(--madness-dark) 100%);
    border: 2px solid var(--madness-grey-light);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(90deg, var(--madness-red-dark) 0%, transparent 100%);
    border-bottom: 2px solid var(--madness-red);
}

.settings-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--madness-text);
    letter-spacing: 3px;
}

.settings-close {
    background: none;
    border: none;
    color: var(--madness-text-dim);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 5px;
}

.settings-close:hover {
    color: var(--madness-red);
}

.settings-body {
    padding: 30px 25px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.settings-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--madness-text);
    letter-spacing: 1px;
}

.settings-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-control input[type="range"] {
    width: 150px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--madness-grey-light);
    border-radius: 3px;
    outline: none;
}

.settings-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--madness-red);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--madness-red-glow);
    transition: transform 0.2s;
}

.settings-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.settings-control span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--madness-red);
    min-width: 40px;
    text-align: right;
}

.settings-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--madness-grey-light);
    display: flex;
    justify-content: center;
}

.settings-footer .menu-btn {
    width: 100%;
    justify-content: center;
}

/* ============================================
   VERSION TAG
   ============================================ */
.menu-version {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--madness-text-dim);
    letter-spacing: 2px;
    z-index: 10;
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */
.leaderboard-list::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: var(--madness-dark);
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--madness-grey-light);
    border-radius: 3px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: var(--madness-red);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media screen and (max-width: 900px) {
    .menu-content {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding: 20px;
    }
    
    .menu-left-panel {
        align-items: center;
        max-width: 100%;
    }
    
    .menu-logo {
        font-size: 48px;
    }
    
    .menu-domain {
        font-size: 18px;
    }
    
    .menu-buttons {
        max-width: 350px;
    }
    
    .menu-btn {
        padding: 16px 25px;
        font-size: 16px;
    }
    
    .menu-btn.primary {
        padding: 20px 30px;
        font-size: 18px;
    }
    
    .menu-right-panel {
        max-width: 100%;
        width: 100%;
    }
    
    .leaderboard-container {
        max-height: 300px;
    }
}

@media screen and (max-width: 480px) {
    .menu-logo {
        font-size: 36px;
    }
    
    .menu-domain {
        font-size: 14px;
        letter-spacing: 4px;
    }
    
    .discord-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .settings-container {
        width: 90%;
    }
}

/* Placeholder for empty leaderboard */
.leaderboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--madness-text-dim);
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

.leaderboard-empty span:first-child {
    font-size: 18px;
    font-weight: 600;
    color: var(--madness-text);
    margin-bottom: 10px;
}

.leaderboard-hint {
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
    color: var(--madness-text-dim);
    opacity: 0.7;
}
