:root {
    --bg-base: #151b23;
    --bg-glass: rgba(35, 45, 59, 0.65);
    --bg-glass-hover: rgba(45, 58, 76, 0.8);
    --bg-sponsors: rgb(0, 0, 0);
    --bg-taskbar: rgba(17, 23, 31, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
}

.light-mode {
    --bg-base: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.65);
    --bg-glass-hover: rgba(241, 245, 249, 0.8);
    --bg-sponsors: rgb(255, 255, 255);
    --bg-taskbar: rgba(248, 250, 252, 0.85);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-main: #0f172a;
    --text-muted: #475569;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at center, var(--bg-base) 0%, #0a0a0a 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 48px;
    transition: color 0.3s, background 0.3s;
    overflow-x: hidden;
}

body.light-mode { background: radial-gradient(circle at center, #e2e8f0 0%, #cbd5e1 100%); }

body.energy-saver .bg-orb { display: none !important; animation: none !important; }
body.energy-saver .aero-glass, 
body.energy-saver .aero-taskbar,
body.energy-saver .search-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg-base) !important;
    box-shadow: none !important;
}
body.energy-saver *, body.energy-saver *::before, body.energy-saver *::after { transition: none !important; animation: none !important; }
body.energy-saver .ticker-wrap { display: none !important; }

.sponsor-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px;
    background: var(--bg-sponsors);
    border-bottom: 1px solid var(--border-glass);
    align-items: center;
    min-height: 56px;
}

.banner-link {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.banner-link:hover {
    transform: scale(1.05);
}

.logo-container { display: grid; align-items: center; height: 28px; position: relative; overflow: hidden; }
.logo-container img { grid-area: 1 / 1; height: 28px; width: auto; justify-self: start; }
.logo-icon { z-index: 1; position: relative; }
.logo-full { z-index: 2; max-width: 0; object-fit: cover; object-position: left center; transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1); background: var(--bg-sponsors); }
.banner-link:hover .logo-full { max-width: 200px; }


.bg-orb {
    position: fixed; border-radius: 50%; filter: blur(120px); opacity: .18; pointer-events: none; z-index: -1;
    animation: drift 30s ease-in-out infinite alternate;
}
.orb1 { width: 480px; height: 480px; top: -120px; left: -80px; background: #3949ff; }
.orb2 { width: 520px; height: 520px; bottom: -180px; right: -80px; background: #7c3aed; animation-duration: 36s; }

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

.layout-container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 32px 24px; flex-grow: 1; }

.aero-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.icon_button {
    background: transparent; border: none; padding: 8px; color: inherit; 
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; 
    border-radius: 8px; transition: background 0.2s, color 0.2s; text-decoration: none;
}
.icon_button:hover { background: rgba(255, 255, 255, 0.1); }
body.light-mode .icon_button:hover { background: rgba(0, 0, 0, 0.05); }

.button { 
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; 
    height: 40px; padding: 0 16px; font-size: 0.875rem; font-weight: 500; border-radius: 6px; 
    cursor: pointer; transition: all 0.2s ease; overflow: hidden; text-decoration: none;
}
.button-secondary { 
    color: var(--text-main); 
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 49%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.2) 100%), var(--bg-glass); 
    border: 1px solid var(--border-glass); 
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.2);
}
.button-secondary:hover { 
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 49%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.15) 100%), var(--bg-glass-hover); 
}
body.light-mode .button-secondary { 
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 49%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.05) 100%), var(--bg-glass); 
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.8), 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.15);
}
body.light-mode .button-secondary:hover { 
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.6) 49%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.1) 100%), var(--bg-glass-hover); 
}

header {
    position: sticky; top: 0; z-index: 100; display: flex; align-items: center; width: 100%; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--border-glass);
    transition: 0.3s;
}
header .header-logo { display: flex; align-items: center; height: 100%; text-decoration: none; color: var(--text-main); }
header .header-logo img { height: 24px; width: auto; }
nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.aero-taskbar { 
    position: fixed; bottom: 0; left: 0; width: 100%; height: 48px; background: var(--bg-glass); 
    backdrop-filter: blur(16px); border-top: 1px solid var(--border-glass); display: flex; 
    align-items: center; padding: 0 16px; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.2); 
    justify-content: space-between;
}
.taskbar-left, .taskbar-right { display: flex; align-items: center; }
.taskbar-center { overflow: hidden; display: flex; align-items: center; justify-content: center; flex-grow: 1; padding: 0 24px; }
.clock { font-size: 0.875rem; color: var(--text-main); font-variant-numeric: tabular-nums; font-weight: 500; margin-left: 16px; }

.ticker-wrap { 
    white-space: nowrap; width: 100%; max-width: 800px; overflow: hidden; 
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); 
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); 
}
.ticker-track { display: inline-flex; align-items: center; width: max-content; animation: ticker 45s linear infinite; color: var(--text-muted); font-size: 0.875rem; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-divider { height: 14px; margin: 0 24px; vertical-align: middle; opacity: 0.4; }
body.light-mode .ticker-divider { filter: invert(1); }

.start-menu {
    position: fixed; bottom: 56px; left: 16px; width: 320px; z-index: 99;
    padding: 20px; border-radius: 12px; display: flex; flex-direction: column; gap: 16px;
    transform: translateY(20px) scale(0.95); opacity: 0; pointer-events: none;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: bottom left;
}
.start-menu.active { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.start-menu h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 4px; border-bottom: 1px solid var(--border-glass); padding-bottom: 8px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.setting-row select {
    background: rgba(0,0,0,0.2); color: var(--text-main); border: 1px solid var(--border-glass);
    padding: 6px 12px; border-radius: 6px; outline: none; font-family: inherit; font-size: 0.875rem; cursor: pointer;
}
body.light-mode .setting-row select { background: rgba(255,255,255,0.5); }