:root {
    --neon-blue: #00f2ff;
    --matrix-green: #00ff41;
    --alert-red: #ff3131;
    --bg-black: #050505;
    --panel-gray: #121212;
    --accent-purple: #bc13fe;
    --text-bright: #ffffff;
}

body {
    background-color: var(--bg-black);
    color: var(--text-bright);
    font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
    margin: 0; padding: 0; overflow-x: hidden; line-height: 1.6;
}

body::before {
    content: " "; display: block; position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 10; background-size: 100% 2px, 3px 100%; pointer-events: none;
}

.uplink-bar {
    display: flex; justify-content: center; align-items: center; gap: 20px;
    flex-wrap: wrap;
    background: rgba(0, 242, 255, 0.05); padding: 8px 20px; 
    border-bottom: 1px solid var(--neon-blue); position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(8px); font-size: 0.85rem;
}
.uplink-bar a { color: var(--matrix-green); text-decoration: none; font-weight: bold; transition: 0.3s; }
.uplink-bar a:hover { color: var(--neon-blue); text-shadow: 0 0 8px var(--neon-blue); }
.uplink-bar .spacer { color: rgba(255,255,255,0.2); }

.container {
    max-width: 1050px; margin: 30px auto;
    border: 1px solid rgba(0, 242, 255, 0.3); padding: 40px;
    background: rgba(18, 18, 18, 0.85);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 242, 255, 0.1);
    position: relative; z-index: 1;
}

.os-banner-v2 {
    width: 100%; height: 180px; background: #000;
    border: 1px solid var(--neon-blue); display: flex;
    flex-direction: column; justify-content: center; align-items: center;
    position: relative; overflow: hidden; margin-bottom: 15px;
}

#matrixCanvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; opacity: 0.3; 
}

.banner-glitch {
    font-size: 5rem; font-weight: 900; color: var(--neon-blue); 
    text-transform: uppercase; letter-spacing: 10px; position: relative;
    z-index: 5; animation: neon-flicker 10s infinite;
}

@keyframes neon-flicker {
    0%, 6%, 8%, 44%, 46%, 82%, 84%, 100% { 
        text-shadow: 0 0 7px var(--neon-blue), 0 0 10px var(--neon-blue), 0 0 21px var(--neon-blue); 
        opacity: 1; 
    }
    7%, 45%, 83% { 
        text-shadow: none; 
        opacity: 0.4; 
    }
}

.banner-sub { font-size: 0.75rem; color: var(--text-bright); background: rgba(0,0,0,0.8); padding: 4px 12px; border: 1px solid var(--neon-blue); letter-spacing: 6px; z-index: 5; }

/* --- STRUCTURAL SYSTEM DIVIDERS --- */
.sys-divider {
    width: 100%; 
    border-collapse: collapse; 
    margin: 25px 0;
    background: rgba(0, 242, 255, 0.02);
    border-top: 1px solid rgba(0, 242, 255, 0.4);
    border-bottom: 1px solid rgba(0, 242, 255, 0.4);
}
.sys-divider td { 
    padding: 6px 15px; 
    color: var(--neon-blue); 
    font-size: 0.75rem; 
    letter-spacing: 3px; 
    text-transform: uppercase; 
}
.sys-divider .stripe { 
    width: 35%; 
    opacity: 0.2; 
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--neon-blue) 4px, var(--neon-blue) 6px); 
}
.sys-divider .center-text { 
    text-align: center; 
    font-weight: bold; 
    width: 30%; 
}

/* Purple Alternative Variant */
.sys-divider.alt {
    background: rgba(188, 19, 254, 0.02);
    border-color: rgba(188, 19, 254, 0.4);
}
.sys-divider.alt td { color: var(--accent-purple); }
.sys-divider.alt .stripe { 
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--accent-purple) 4px, var(--accent-purple) 6px); 
}

/* Green Matrix Variant */
.sys-divider.matrix {
    background: rgba(0, 255, 65, 0.02);
    border-color: rgba(0, 255, 65, 0.4);
}
.sys-divider.matrix td { color: var(--matrix-green); }
.sys-divider.matrix .stripe { 
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--matrix-green) 4px, var(--matrix-green) 6px); 
}

/* Red Error Variant */
.sys-divider.error {
    background: rgba(255, 49, 49, 0.02);
    border-color: rgba(255, 49, 49, 0.4);
}
.sys-divider.error td { color: var(--alert-red); }
.sys-divider.error .stripe { 
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--alert-red) 4px, var(--alert-red) 6px); 
}

h2 { 
    color: var(--neon-blue); border-bottom: 1px solid rgba(0, 242, 255, 0.2); 
    padding-bottom: 8px; margin-top: 45px; display: flex; align-items: center; gap: 12px;
    font-size: 1.3rem; text-transform: uppercase; letter-spacing: 2px;
    background: linear-gradient(90deg, rgba(0,242,255,0.05) 0%, transparent 100%);
    padding-left: 10px; border-left: 4px solid var(--neon-blue);
}

table:not(.sys-divider) { width: 100%; border-collapse: collapse; margin-bottom: 30px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); }
th { background: rgba(0, 242, 255, 0.08); color: var(--neon-blue); padding: 12px; text-align: left; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }
td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.85rem; }

.buff-tier { color: var(--matrix-green); font-weight: bold; }
.highlight { color: var(--neon-blue); font-weight: bold; }
.highlight-alt { color: var(--accent-purple); font-weight: bold; }

.instruction-box { background: rgba(0, 242, 255, 0.03); border: 1px solid rgba(0, 242, 255, 0.1); padding: 15px 20px; margin: 10px 0 20px 0; font-size: 0.9rem; border-left: 2px solid var(--neon-blue); }
.translation-box { background: rgba(0, 255, 65, 0.03); border: 1px dashed rgba(0, 255, 65, 0.4); padding: 12px 18px; margin-bottom: 30px; font-size: 0.8rem; color: #a3f7b5; }
.flex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; }
.cyber-icon { width: 28px; height: 28px; filter: drop-shadow(0 0 5px var(--neon-blue)); fill: none; stroke: var(--neon-blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.nav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 15px; margin-bottom: 15px; }
.nav-button { 
    border: 1px solid var(--neon-blue); background: rgba(0, 242, 255, 0.03); 
    padding: 12px; text-align: left; cursor: pointer; transition: 0.2s; 
    display: flex; flex-direction: row; align-items: center; gap: 15px; height: 50px;
}
.nav-button:hover { background: rgba(0, 242, 255, 0.1); box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.2); }
.nav-button svg { width: 30px; height: 30px; stroke: var(--neon-blue); fill: none; stroke-width: 1.5; flex-shrink: 0; }
.nav-text { display: flex; flex-direction: column; }

/* Arcade Leaderboard */
.leaderboard-container { 
    border: 1px solid var(--matrix-green); padding: 25px; 
    background: repeating-linear-gradient(0deg, rgba(0,255,65,0.03) 0px, rgba(0,255,65,0.03) 1px, transparent 1px, transparent 3px);
    position: relative; margin-top: 50px; box-shadow: inset 0 0 30px rgba(0, 255, 65, 0.05);
}
.leaderboard-title { color: var(--matrix-green); margin-top: 0; text-align: center; font-size: 1.3rem; letter-spacing: 4px; text-transform: uppercase; text-shadow: 0 0 10px rgba(0,255,65,0.5); }
.leaderboard-header { display: flex; justify-content: space-between; padding: 5px 15px; font-size: 0.75rem; color: #888; border-bottom: 1px solid rgba(0,255,65,0.3); margin-bottom: 10px; }
.leaderboard-row { 
    display: flex; justify-content: space-between; padding: 12px 15px; 
    background: rgba(0,0,0,0.6); margin-bottom: 6px; border-left: 3px solid var(--matrix-green);
    font-size: 0.95rem; transition: 0.2s;
}
.leaderboard-row:hover { background: rgba(0, 255, 65, 0.1); transform: translateX(5px); }
.rank-name { font-weight: bold; display: flex; gap: 15px; }
.rank-num { opacity: 0.5; width: 25px; }

.pulse { animation: pulse-opacity 2s infinite; }
@keyframes pulse-opacity { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* Modals */
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 101; backdrop-filter: blur(3px); }
.modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 95%; max-width: 900px; max-height: 85vh; overflow-y: auto; background: var(--panel-gray); border: 1px solid var(--neon-blue); padding: 35px; z-index: 102; box-shadow: 0 20px 50px rgba(0,0,0,0.9); }
.modal::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-track { background: #000; }
.modal::-webkit-scrollbar-thumb { background: var(--neon-blue); }

.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(0, 242, 255, 0.3); padding-bottom: 15px; margin-bottom: 25px; }
.modal-header.alt-header { border-bottom: 1px solid var(--accent-purple); border-left: 4px solid var(--accent-purple); padding-left: 10px; }
.modal-header h2 { margin: 0; font-size: 1.5rem; border: none; padding: 0; background: none; }
.close-btn { cursor: pointer; color: var(--text-bright); font-size: 1.2rem; transition: 0.2s; background: rgba(255,255,255,0.1); padding: 5px 15px; border: 1px solid rgba(255,255,255,0.2); }
.close-btn:hover { background: var(--alert-red); color: #fff; border-color: var(--alert-red); }

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.rule-item { 
    background: rgba(0,0,0,0.4); padding: 15px; 
    border-left: 2px solid var(--matrix-green); font-size: 0.85rem; 
    transition: all 0.3s ease; cursor: default;
}
.rule-item:hover {
    background: linear-gradient(90deg, rgba(0, 255, 65, 0.07) 0%, rgba(188, 19, 254, 0.02) 100%);
    box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.05);
    border-left-color: var(--neon-blue);
    transform: translateX(4px);
}
.rule-item strong { color: var(--matrix-green); display: block; margin-bottom: 4px; font-size: 0.9rem; transition: 0.3s; }
.rule-item:hover strong { color: var(--neon-blue); }

.perks-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; margin-top: 20px; }
.support-links a { display: block; padding: 12px; margin-bottom: 12px; border: 1px solid var(--accent-purple); text-align: center; color: var(--text-bright); text-decoration: none; font-weight: bold; background: rgba(188, 19, 254, 0.05); transition: 0.2s; }
.support-links a:hover { background: var(--accent-purple); color: #fff; box-shadow: 0 0 15px rgba(188, 19, 254, 0.4); }
.perk-list { background: rgba(0,0,0,0.3); padding: 20px; border: 1px solid rgba(188, 19, 254, 0.3); font-size: 0.85rem; }
.perk-list ul { margin: 0; padding-left: 20px; color: #ccc; }
.perk-list li { margin-bottom: 8px; }

/* --- TERMINAL FOOTER --- */
.terminal-footer {
    max-width: 1050px; margin: 0 auto 40px auto;
    border-top: 1px solid rgba(0, 242, 255, 0.3);
    padding: 15px 0; font-size: 0.75rem; color: #888;
    display: flex; justify-content: space-between; align-items: center;
    letter-spacing: 1px;
}
.terminal-footer a { color: var(--matrix-green); text-decoration: none; transition: 0.3s; }
.terminal-footer a:hover { color: var(--neon-blue); text-shadow: 0 0 5px var(--neon-blue); }
.terminal-footer .spacer { margin: 0 10px; color: rgba(255,255,255,0.1); }
.footer-left, .footer-right { display: flex; align-items: center; }

.spotify-btn {
    display: flex; align-items: center; justify-content: center;
    background: #1DB954; color: #000 !important;
    border-radius: 50%; padding: 4px; width: 18px; height: 18px;
    transition: 0.3s; margin-left: 5px;
}
.spotify-btn:hover { background: #1ed760; box-shadow: 0 0 10px #1DB954; transform: scale(1.1); }
.spotify-btn svg { width: 100%; height: 100%; }