:root {
    --bg: #020817;
    --panel-bg: #071120;
    --text: #ffffff;
    --muted: #cbd5e1;
    --accent: #dff7ff;
    --accent-2: #f8fdff;
    --accent-glow: rgba(125, 211, 252, 0.28);
    --border-color: rgba(191, 219, 254, 0.28);
    --danger: #ff8fa3;
    --success: #ffffff;
    --desktop-label-size: 0.78rem;
    --icon-svg-size: 34px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    width: 100vw; height: 100vh;
}
button, input, select, textarea { font: inherit; }

.lunar-container {
    width: 100vw; height: 100vh;
    position: relative;
    overflow: hidden;
}
.lunar-main {
    width: 100%; height: 100%;
    padding: 24px;
    background: radial-gradient(circle at center, #0f172a 0%, #06080c 100%);
}
.desktop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 14px;
    align-content: start;
    max-width: 760px;
}
.desktop-icon {
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    min-height: 92px;
    padding: 14px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 18px rgba(125,211,252,0.16);
    color: var(--text);
    backdrop-filter: blur(12px);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
}
.desktop-icon:hover, .desktop-icon:focus-visible {
    transform: translateY(-2px) scale(1.01);
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}
.desktop-icon svg { width: var(--icon-svg-size, 34px); height: var(--icon-svg-size, 34px); }
.desktop-icon span:last-child { font-size: var(--desktop-label-size, 0.78rem); color: var(--muted); }

.os-window {
    position: absolute;
    display: flex; flex-direction: column;
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 56px rgba(0,0,0,0.7), 0 0 28px var(--accent-glow);
    backdrop-filter: blur(16px);
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.os-window .titlebar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(125,211,252,0.16), rgba(125,211,252,0.06));
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    user-select: none;
}
.os-window .titlebar .title { font-size: 0.9rem; font-weight: 700; color: var(--accent-2); letter-spacing: 0.4px; }
.os-window .titlebar .controls { display: flex; gap: 8px; align-items: center; }
.os-window .titlebar button {
    width: 26px; height: 26px; border: none; border-radius: 999px; color: var(--text); cursor: pointer; font-size: 0.82rem; background: rgba(255,255,255,0.06);
}
.os-window .titlebar button:hover { background: rgba(125,211,252,0.22); }
.os-window .titlebar .close-btn:hover { background: rgba(255,143,163,0.24); color: var(--danger); }
.os-window .body { flex: 1; padding: 14px; overflow: auto; color: var(--text); display: flex; flex-direction: column; }
.os-window.maximized { border-radius: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: rgba(125,211,252,0.24); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

#loading-screen {
    position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 20% 30%, #071425, #02040a);
    overflow: hidden; cursor: pointer;
}
.loader-burst {
    position: absolute; width: 240px; height: 240px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.16);
    box-shadow: 0 0 0 rgba(255,255,255,0), 0 0 40px rgba(191,219,254,0.16);
    opacity: 0;
    transform: scale(0.4);
}
.loader-burst-alt {
    width: 320px; height: 320px; border-color: rgba(125,211,252,0.22); box-shadow: 0 0 0 rgba(255,255,255,0), 0 0 70px rgba(125,211,252,0.18);
}
.loader-burst-small {
    width: 160px; height: 160px; border-color: rgba(255,255,255,0.24); box-shadow: 0 0 0 rgba(255,255,255,0), 0 0 24px rgba(191,219,254,0.22);
}
.loader-burst.pulse { animation: burstPulse 1s ease-out forwards; }
.loader-burst.explode { animation: burstExplode 0.45s ease-out forwards; }
#loading-screen .loading-grid {
    position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px; mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
}
#loading-text {
    position: relative; z-index: 2; font-size: clamp(1.2rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    color: #dff7ff; text-shadow: 0 0 18px rgba(125, 211, 252, 0.24), 0 0 30px rgba(224, 242, 254, 0.14); text-align: center; padding: 0 26px;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}
#loading-text.lightning { color: #fef3c7; text-shadow: 0 0 24px rgba(248,113,113,0.4), 0 0 40px rgba(250,204,21,0.24); }
#power-sword {
    position: absolute; top: -220px; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle, #7c3aed, #06b6d4);
    box-shadow: 0 0 38px rgba(125, 211, 252, 0.45); z-index: 3; transition: top 0.9s cubic-bezier(0.2, 1, 0.2, 1), opacity 0.25s ease;
}
#power-sword.flash { animation: pulseFlash 0.38s ease 2; }
#slice-top, #slice-bottom {
    position: absolute; left: 0; width: 100%; height: 50%; background: linear-gradient(180deg, rgba(125,211,252,0.12), transparent); z-index: 1; transition: transform 0.7s ease;
}
#slice-top { top: 0; transform: translateY(0); }
#slice-bottom { bottom: 0; transform: translateY(0); }
#loading-screen.lightning-flash { animation: lightningPulse 0.28s ease 1; }
#loading-screen.fade-out { opacity: 0; }

#taskbar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; height: 56px;
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: rgba(7, 16, 31, 0.86); border: 1px solid var(--border-color); border-radius: 18px;
    box-shadow: 0 16px 42px rgba(0,0,0,0.55), 0 0 24px rgba(125,211,252,0.16);
    backdrop-filter: blur(14px); z-index: 20000;
}
#taskbar-start { padding: 8px 12px; border-radius: 12px; background: rgba(125,211,252,0.14); color: var(--accent); font-weight: 700; cursor: pointer; }
#taskbar-icons { display: flex; align-items: center; gap: 8px; }
.dock-item {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.dock-item.dragging { opacity: 0.5; }
.dock-item:hover { transform: translateY(-3px); box-shadow: 0 0 18px rgba(125,211,252,0.2); }
.dock-item svg { width: 22px; height: 22px; }
#taskbar-clock { margin-left: auto; color: var(--muted); font-family: monospace; font-size: 0.9rem; padding-right: 4px; }
.taskbar-tile { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid rgba(255,255,255,0.08); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.taskbar-tile .badge { background: var(--danger); color: white; font-size: 0.72rem; padding: 0 6px; border-radius: 999px; }

#notification-center { position: fixed; right: 20px; bottom: 70px; display: flex; flex-direction: column; gap: 8px; z-index: 30000; width: min(340px, calc(100vw - 28px)); pointer-events: none; }
#notification-center .notif { pointer-events: auto; padding: 10px 12px; border-radius: 14px; background: rgba(7,16,31,0.9); border: 1px solid var(--border-color); box-shadow: 0 14px 30px rgba(0,0,0,0.45); opacity: 0; transform: translateY(8px); transition: all 0.2s ease; }
#notification-center .notif.show { opacity: 1; transform: translateY(0); }

.settings-section {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.settings-section h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--accent-2);
}
.settings-section label {
    display: grid;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}
.settings-app-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}
.settings-app-row button {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(125,211,252,0.12);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.78rem;
}
.settings-app-row button:hover {
    background: rgba(125,211,252,0.18);
}

.app-store-card {
    display: grid; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border-color); background: rgba(255,255,255,0.04); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.app-store-card header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.app-store-card .app-tag { color: var(--accent); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.3em; }
.app-store-card button { padding: 8px 10px; border-radius: 999px; border: 1px solid var(--border-color); background: rgba(125,211,252,0.14); color: var(--accent); cursor: pointer; }
.app-store-card button:hover { box-shadow: 0 0 18px rgba(125,211,252,0.2); }

@keyframes pulseFlash { 0% { transform: scale(0.92); filter: brightness(0.8);} 50% { transform: scale(1.2); filter: brightness(1.5);} 100% { transform: scale(1); filter: brightness(1);} }
@keyframes burstPulse { 0% { opacity: 0; transform: scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes burstExplode { 0% { opacity: 0.9; transform: scale(0.8); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes lightningPulse { 0% { box-shadow: 0 0 0 rgba(255,255,255, 0);} 50% { box-shadow: 0 0 80px rgba(191,219,254,0.2);} 100% { box-shadow: 0 0 0 rgba(255,255,255,0);} }
