:root {
    --bg: #0a0a0a; --card-bg: rgba(20, 20, 20, 0.4); --accent: #b589d6;
    --border: #222222; --text: #888888;
    --terminal-width: 1300px;
    --hover-bg: rgba(181, 137, 214, 0.05);
}

/* --- THEMES --- */
body.theme-light { --bg: #d9c5b2; --card-bg: rgba(200, 180, 160, 0.4); --accent: #7a4a2a; --border: #bda691; --text: #3d2b1f; --hover-bg: rgba(122, 74, 42, 0.1); }
body.theme-green { --bg: #050a05; --card-bg: #081208; --accent: #234f1e; --border: #1a3a16; --text: #a7c4a0; --hover-bg: rgba(35, 79, 30, 0.2); }
body.theme-blue { --bg: #020412; --card-bg: #0a0e24; --accent: #4d61ff; --border: #1e2a5a; --text: #a5b4fc; --hover-bg: rgba(77, 97, 255, 0.15); }

/* --- CLASSIC 95 THEME --- */
body.theme-win95 { 
    --bg: #008080; --card-bg: #c0c0c0; --accent: #000080; --border: #808080; --text: #000000; --hover-bg: #dfdfdf;
}
body.theme-win95 #starfield { opacity: 0.3; }
body.theme-win95 .card, body.theme-win95 .status-bar, body.theme-win95 .btn, body.theme-win95 .theme-indicator, body.theme-win95 .theme-toggle, body.theme-win95 .external-link-btn {
    background: #c0c0c0 !important; border: 2px solid !important; border-color: #ffffff #808080 #808080 #ffffff !important; border-radius: 0 !important; color: #000 !important; box-shadow: none !important; backdrop-filter: none !important;
}
body.theme-win95 .card h2 { background: #000080; color: white; padding: 2px 5px; margin: -30px -30px 15px -30px; font-size: 11px; text-transform: none; }
body.theme-win95 .btn:active, body.theme-win95 .theme-toggle:active { border-color: #808080 #ffffff #ffffff #808080 !important; padding-top: 2px; padding-left: 14px; }
body.theme-win95 .status-bar { top: auto; bottom: 0; width: 100%; height: 28px; border-top: 2px solid #ffffff !important; left: 0; transform: none; }
body.theme-win95 .sidebar-header { color: #000; font-weight: bold; border-bottom: 2px solid #808080; }

/* --- AERO PEAK --- */
#aero-clouds { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; display: none; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; background: white; filter: blur(50px); border-radius: 50%; opacity: 0.3; animation: moveClouds linear infinite; }
@keyframes moveClouds { from { transform: translateX(-350px); } to { transform: translateX(calc(100vw + 350px)); } }
body.theme-aero #aero-clouds { display: block; background: linear-gradient(135deg, #1e528e 0%, #2979ff 50%, #72aade 100%); }
body.theme-aero { --bg: transparent; --card-bg: rgba(255, 255, 255, 0.15); --accent: #00e5ff; --border: rgba(255, 255, 255, 0.4); --text: #ffffff; --hover-bg: rgba(255, 255, 255, 0.25); }
body.theme-aero .card, body.theme-aero .status-bar, body.theme-aero .theme-indicator, body.theme-aero .theme-toggle, body.theme-aero .btn { 
    backdrop-filter: blur(25px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.8); border-left: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), inset 0 0 0 1px rgba(255, 255, 255, 0.1); border-radius: 4px;
}
body.theme-aero .card h2 { text-shadow: 0 0 10px rgba(0, 229, 255, 0.8); font-weight: 500; }

/* --- COZY LO-FI (RAIN) --- */
body.theme-rain { --bg: transparent; --card-bg: rgba(28, 20, 15, 0.85); --accent: #e2a87e; --border: rgba(226, 168, 126, 0.25); --text: #f3e5d8; --hover-bg: rgba(226, 168, 126, 0.1); }
body.theme-rain #aero-clouds { display: block; background: linear-gradient(to bottom, #140d08 0%, #2b1e16 100%); }
body.theme-rain .cloud { background: #4a3528; opacity: 0.3; filter: blur(80px); }
#rain-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; display: none; pointer-events: none; }
body.theme-rain #rain-canvas { display: block; }
body.theme-rain .card, body.theme-rain .status-bar, body.theme-rain .theme-indicator, body.theme-rain .theme-toggle { backdrop-filter: blur(18px) saturate(120%); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(226, 168, 126, 0.05); }

/* --- RAINBOW VOMIT --- */
@keyframes rgb-shift { 0% { color: #ff0000; border-color: #ff0000; } 33% { color: #00ff00; border-color: #00ff00; } 66% { color: #0000ff; border-color: #0000ff; } 100% { color: #ff0000; border-color: #ff0000; } }
body.theme-rgb { --bg: #050505; --card-bg: rgba(10, 10, 10, 0.8); --accent: #fff; --border: #333; --text: #eee; }
body.theme-rgb .status-segment, body.theme-rgb .sidebar-header, body.theme-rgb h2, body.theme-rgb .theme-toggle, body.theme-rgb .theme-indicator, body.theme-rgb .ttt-cell, body.theme-rgb #snake-canvas, body.theme-rgb #strike-canvas, body.theme-rgb .card, body.theme-rgb .status-bar, body.theme-rgb .btn, body.theme-rgb .feed-container { animation: rgb-shift 3s infinite linear; }

/* --- CORE LAYOUT --- */
html, body { background-color: var(--bg) !important; margin: 0; padding: 0; color: var(--text); font-family: 'DM Mono', monospace; min-height: 100vh; overflow-x: hidden; transition: background 0.4s; }
#starfield { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.status-bar { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 600px; height: 38px; background: var(--card-bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; z-index: 100; backdrop-filter: blur(8px); transition: 0.3s ease; }
.status-bar:hover { border-color: var(--accent); background: var(--hover-bg); }
.status-segment { color: var(--accent); font-size: 9px; letter-spacing: 2px; text-transform: uppercase; }
.layout-wrapper { position: relative; display: grid; grid-template-columns: 140px 1fr 300px 180px; gap: 30px; padding: 120px 20px 90px 20px; max-width: var(--terminal-width); margin: 0 auto; z-index: 10; }
.nav-dock, .media-wing, .link-rail { position: sticky; top: 120px; height: fit-content; display: flex; flex-direction: column; }
.btn, .external-link-btn { background: transparent; border: 1px solid var(--border); color: var(--text); width: 100%; height: 38px; cursor: pointer; font-family: inherit; text-transform: uppercase; font-size: 10px; transition: 0.3s; margin-bottom: 8px; display: flex; align-items: center; padding-left: 12px; text-decoration: none; box-sizing: border-box; }
.btn:hover, .external-link-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--hover-bg); padding-left: 18px; }
.card { border: 1px solid var(--border); padding: 30px; background: var(--card-bg); backdrop-filter: blur(2px); transition: 0.3s ease; margin-bottom: 20px; }
.card:hover { border-color: var(--accent); background: var(--hover-bg); transform: translateY(-2px); }
.card h2 { color: var(--accent); font-size: 14px; margin: 0 0 15px 0; }
.sidebar-header { font-size: 10px; color: var(--accent); letter-spacing: 2px; padding-bottom: 10px; margin-bottom: 15px; border-bottom: 1px solid var(--border); }
.mini-feed { margin-bottom: 25px; }
.mini-feed h3 { font-size: 9px; color: #555; margin: 0 0 8px 0; text-transform: uppercase; }
.feed-container { position: relative; background: #000; border: 1px solid var(--border); transition: all 0.3s ease; overflow: hidden; }
.feed-container:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.video-box { padding-bottom: 56.25%; height: 0; position: relative; }
.video-box iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.tiktok-wrap { height: 280px; }
.controls-group { position: fixed; bottom: 45px; left: 25px; display: flex; align-items: center; gap: 10px; z-index: 1000; }
#theme-menu { position: absolute; bottom: 55px; left: 0; background: var(--card-bg); border: 1px solid var(--border); backdrop-filter: blur(15px); display: none; flex-direction: column; padding: 8px; gap: 4px; min-width: 180px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
#theme-menu.active { display: flex; animation: menuUp 0.2s ease-out; }
.theme-option { background: transparent; border: 1px solid transparent; color: var(--text); padding: 8px 12px; text-align: left; font-family: inherit; font-size: 10px; letter-spacing: 1px; cursor: pointer; transition: 0.2s; text-transform: uppercase; }
.theme-option:hover { border-color: var(--accent); color: var(--accent); background: var(--hover-bg); }
.theme-toggle { width: 45px; height: 45px; background: var(--card-bg); border: 1px solid var(--border); color: var(--accent); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 24px; transition: all 0.4s ease; }
.theme-toggle:hover { border-color: var(--accent); transform: rotate(180deg); }
.theme-indicator { height: 45px; padding: 0 15px; border: 1px solid var(--border); color: var(--accent); display: flex; align-items: center; font-size: 10px; letter-spacing: 2px; background: var(--card-bg); min-width: 140px; }
@keyframes menuUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- ARCADE --- */
#arcade-wrapper { display: none; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 15px; }
.ttt-cell { aspect-ratio: 1; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; background: rgba(0,0,0,0.4); transition: 0.2s; font-weight: bold; }
.ttt-cell:hover { border-color: var(--accent); color: var(--accent); background: var(--hover-bg); }
.ttt-cell.winner { border-color: var(--accent); color: var(--accent); background: var(--hover-bg); box-shadow: inset 0 0 15px var(--hover-bg); }
canvas.game-canvas { background: rgba(0,0,0,0.8); border: 1px solid var(--border); width: 100%; aspect-ratio: 1; transition: 0.3s ease; image-rendering: pixelated; cursor: pointer; }
canvas.game-canvas:hover { border-color: var(--accent); }
.game-meta { font-size: 9px; display: flex; justify-content: space-between; margin-top: 15px; color: var(--accent); border-top: 1px solid var(--border); padding-top: 10px; }
.game-msg { font-size: 9px; color: var(--text); margin-top: 10px; text-align: center; height: 12px; text-transform: uppercase; }
.interest-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: 0.2s; }
.interest-link:hover { border-bottom-color: var(--accent); }

@media (max-width: 1100px) { .layout-wrapper { grid-template-columns: 1fr; padding-top: 100px; } .status-bar { width: 90%; } #arcade-wrapper { grid-template-columns: 1fr; } }