@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Glassmorphism System Tokens */
    --glass-bg: rgba(255, 255, 255, 0.42);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-shadow: rgba(0, 0, 0, 0.06);
    
    --text-primary: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #78716c;
    
    --accent-orange: #f97316;
    --accent-blue: #0ea5e9;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    
    --btn-red: #ff5f56;
    --btn-yellow: #ffbd2e;
    --btn-green: #27c93f;
    
    --font-ui: 'Inter', -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-pill: 100px;
    
    --z-welcome: 10000;
    --z-dock: 999;
    --z-window: 10;
    --z-menu: 1000;
    --z-cc: 1000;
}

/* Dark Mode Variables Override */
body.dark-mode {
    --glass-bg: rgba(20, 20, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: rgba(0, 0, 0, 0.35);
    
    --text-primary: #f5f0e8;
    --text-secondary: #d6d3d1;
    --text-muted: #a8a29e;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-ui);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   DYNAMIC LIQUID GRADIENT WALLPAPERS
   ========================================== */
body {
    background: #0f0c1b;
    position: relative;
    overflow: hidden;
    transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

body::before, body::after {
    content: '';
    position: absolute;
    width: 75vw;
    height: 75vw;
    max-width: 900px;
    max-height: 900px;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.55;
    mix-blend-mode: screen;
    pointer-events: none;
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme 1: Alps Twilight */
body.bg-alps {
    background: url('swiss_alps.png') no-repeat center center fixed;
    background-size: cover;
}
body.bg-alps::before {
    background: radial-gradient(circle, #e0c3fc 0%, rgba(142, 197, 252, 0.3) 70%);
    top: -15%;
    left: -10%;
    animation: float1 25s ease-in-out infinite;
}
body.bg-alps::after {
    background: radial-gradient(circle, #8ec5fc 0%, rgba(224, 195, 252, 0.3) 70%);
    bottom: -15%;
    right: -10%;
    animation: float2 30s ease-in-out infinite;
}

/* Theme 2: Obsidian Peak */
body.bg-obsidian {
    background: linear-gradient(135deg, #180808 0%, #292524 100%);
}
body.bg-obsidian::before {
    background: radial-gradient(circle, #3f3f46 0%, transparent 70%);
    top: 5%;
    left: 10%;
    opacity: 0.4;
}
body.bg-obsidian::after {
    background: radial-gradient(circle, #27272a 0%, transparent 70%);
    bottom: 5%;
    right: 10%;
    opacity: 0.4;
}

/* Theme 3: Misty Fuji */
body.bg-fuji {
    background: url('misty_fuji.png') no-repeat center center fixed;
    background-size: cover;
}
body.bg-fuji::before {
    background: radial-gradient(circle, #a7f3d0 0%, rgba(6, 78, 59, 0.15) 70%);
    top: -10%;
    left: 20%;
    animation: float1 22s ease-in-out infinite;
    opacity: 0.3;
}
body.bg-fuji::after {
    background: radial-gradient(circle, #059669 0%, rgba(2, 44, 34, 0.15) 70%);
    bottom: -10%;
    right: 20%;
    animation: float2 28s ease-in-out infinite;
    opacity: 0.3;
}

/* Theme 4: Mountain Sunset (Default) */
body.bg-sunset {
    background: url('mountain_sunset.jpg') no-repeat center center fixed;
    background-size: cover;
}
body.bg-sunset::before {
    background: radial-gradient(circle, #fb923c 0%, rgba(120, 53, 15, 0.15) 70%);
    top: -15%;
    left: -5%;
    animation: float1 26s ease-in-out infinite;
    opacity: 0.3;
}
body.bg-sunset::after {
    background: radial-gradient(circle, #f43f5e 0%, rgba(28, 13, 2, 0.15) 70%);
    bottom: -15%;
    right: -5%;
    animation: float2 28s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10%, 8%) scale(1.1); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1.1); }
    50% { transform: translate(-8%, -10%) scale(0.9); }
}

/* ==========================================
   MACOS-STYLE LOCKSCREEN (PASSWORDLESS)
   ========================================== */
#welcome-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-welcome);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: rgba(11, 8, 30, 0.25);
    backdrop-filter: blur(45px) saturate(140%);
    -webkit-backdrop-filter: blur(45px) saturate(140%);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#welcome-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    user-select: none;
}

.login-username {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.login-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    padding: 3px 3px 3px 14px;
    width: 220px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.25s ease;
}

.login-form:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15), 0 4px 15px rgba(0,0,0,0.1);
}

.login-password-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.login-password-input::placeholder {
    color: rgba(255,255,255,0.6);
    letter-spacing: 0em;
}

.login-submit-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.login-submit-btn:hover {
    background: #fff;
    color: #1c1917;
}

.login-hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ==========================================
   DESKTOP & GRID SYSTEM
   ========================================== */
#desktop {
    width: 100vw;
    height: calc(100vh - 68px);
    position: relative;
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 16px;
    z-index: 5;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 92px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    border: 1px solid transparent;
    padding: 6px;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.desktop-icon:active {
    transform: scale(0.94);
}

.icon-image {
    font-size: 2.2rem;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12));
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.desktop-icon:hover .icon-image {
    transform: translateY(-2px);
}

.icon-label {
    font-size: 0.72rem;
    font-weight: 500;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ==========================================
   AEROGLASS WINDOW ARCHITECTURE
   ========================================== */
.window {
    position: fixed;
    width: 640px;
    height: 480px;
    min-width: 350px;
    min-height: 250px;
    
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 10px 40px var(--glass-shadow);
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    transition: 
        opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s ease;
    pointer-events: none;
}

.window.active-window {
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 24px 60px var(--glass-shadow);
}

.window.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.window.minimized {
    opacity: 0;
    transform: scale(0.8) translateY(80px);
    pointer-events: none;
}

.window.maximized {
    top: 12px !important;
    left: 12px !important;
    width: calc(100vw - 24px) !important;
    height: calc(100vh - 96px) !important;
    border-radius: var(--radius-md);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Window Header */
.window-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    position: relative;
    cursor: move;
    flex-shrink: 0;
}

.window-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    position: absolute;
    left: 18px;
}

.window-btn {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-btn.close { background: var(--btn-red); }
.window-btn.minimize { background: var(--btn-yellow); }
.window-btn.maximize { background: var(--btn-green); }

.window-btn::after {
    font-size: 8px;
    color: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.15s ease;
    font-weight: 800;
}

.window-controls:hover .window-btn::after {
    opacity: 1;
}

.window-btn.close::after { content: '×'; }
.window-btn.minimize::after { content: '−'; }
.window-btn.maximize::after { content: '+'; }

.window-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.01em;
}

.window-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   MACOS-STYLE DOCK
   ========================================== */
#dock-container {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    height: 52px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: var(--z-dock);
    transition: all 0.3s ease;
}

body.dark-mode #dock-container {
    background: rgba(20, 20, 25, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.dock-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.start-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.dock-shortcuts {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dock-shortcut-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding-bottom: 4px;
}

.dock-shortcut-btn:hover {
    transform: scale(1.28) translateY(-6px);
}

/* Active indicator dot */
.dock-shortcut-btn.running::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-primary);
}

.dock-right {
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    padding-left: 14px;
}

body.dark-mode .dock-right {
    border-left-color: rgba(255, 255, 255, 0.1);
}

.dock-system-info {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dock-cc-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
    color: var(--text-primary);
}

.dock-cc-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.dock-clock {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================
   MACOS-STYLE CONTROL CENTER PANEL
   ========================================== */
.control-center-panel {
    position: fixed;
    bottom: 72px;
    right: 20px;
    width: 290px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(35px) saturate(180%);
    -webkit-backdrop-filter: blur(35px) saturate(180%);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.12);
    z-index: var(--z-cc);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.control-center-panel.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cc-tile {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
}

body.dark-mode .cc-tile {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.05);
}

.cc-tile.cc-double {
    grid-column: span 2;
}

.cc-tile.cc-clickable {
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
}

.cc-tile.cc-clickable:hover {
    background: rgba(255, 255, 255, 0.35);
}

.cc-tile.cc-clickable:active {
    transform: scale(0.97);
}

body.dark-mode .cc-tile.cc-clickable:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cc-tile-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-tile-icon {
    font-size: 1.2rem;
}

.cc-tile-text {
    display: flex;
    flex-direction: column;
}

.cc-title {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cc-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.cc-tile-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
}

.cc-slider-row {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.dark-mode .cc-slider-row {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.05);
}

.cc-slider-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cc-slider {
    flex: 1;
    accent-color: var(--text-primary);
    cursor: pointer;
    height: 4px;
}

.cc-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.68rem;
    font-weight: 600;
}

.cc-stat-label {
    width: 28px;
    color: var(--text-secondary);
}

.cc-stat-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

body.dark-mode .cc-stat-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

.cc-stat-bar {
    height: 100%;
    background: var(--text-primary);
    border-radius: var(--radius-pill);
    transition: width 0.8s ease;
}

.cc-stat-val {
    width: 28px;
    text-align: right;
    color: var(--text-primary);
}

/* ==========================================
   APP: About / System Specs
   ========================================== */
.about-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    margin: auto;
    width: 100%;
    max-width: 400px;
}

.about-header-logo {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.about-tag {
    display: inline-block;
    background: var(--text-primary);
    color: var(--glass-bg);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.about-container > p {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.about-spec-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 0.76rem;
    text-align: left;
}

body.dark-mode .about-spec-grid {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
}

.spec-label {
    font-weight: 600;
    color: var(--text-muted);
}

.spec-val {
    color: var(--text-secondary);
}

/* ==========================================
   APP: Devlogs
   ========================================== */
.devlog-app {
    display: grid;
    grid-template-columns: 165px 1fr;
    height: 100%;
    margin: 0;
}

.devlog-sidebar {
    background: rgba(0, 0, 0, 0.02);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.dark-mode .devlog-sidebar {
    background: rgba(255, 255, 255, 0.01);
    border-right-color: rgba(255, 255, 255, 0.05);
}

.devlog-sidebar-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding-left: 8px;
    margin-bottom: 8px;
}

.devlog-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font-ui);
    transition: all 0.15s ease;
}

.devlog-nav-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
}

body.dark-mode .devlog-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.devlog-nav-btn.active {
    background: var(--text-primary);
    color: #fff;
    font-weight: 600;
}

body.dark-mode .devlog-nav-btn.active {
    color: #000;
}

.devlog-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .devlog-content-area {
    background: rgba(0, 0, 0, 0.1);
}

.devlog-body-text {
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.devlog-body-text h1, .devlog-body-text h2, .devlog-body-text h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.devlog-body-text h1 { font-size: 1.35rem; margin-top: 0; }
.devlog-body-text h3 { font-size: 0.95rem; margin-top: 18px; }
.devlog-body-text p { margin-bottom: 12px; }
.devlog-body-text ul { margin-left: 18px; margin-bottom: 12px; }
.devlog-body-text li { margin-bottom: 4px; }

.devlog-body-text code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--accent-orange);
}

body.dark-mode .devlog-body-text code {
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   APP: AeroPaint
   ========================================== */
.paint-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
}

.paint-toolbar {
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

body.dark-mode .paint-toolbar {
    background: rgba(0, 0, 0, 0.15);
}

.paint-tools-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paint-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.color-swatch:hover {
    transform: scale(1.2);
}

.color-swatch.active {
    border-color: var(--text-primary);
    transform: scale(1.25);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(0,0,0,0.12);
}

.paint-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.15s ease;
}

.paint-btn:hover {
    background: rgba(255, 255, 255, 0.45);
}

body.dark-mode .paint-btn {
    background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .paint-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.paint-slider {
    width: 80px;
    accent-color: var(--text-primary);
    cursor: pointer;
}

.paint-canvas-container {
    flex: 1;
    position: relative;
    background: #ffffff;
    cursor: crosshair;
}

body.dark-mode .paint-canvas-container {
    background: #1e1e24;
}

#paint-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================
   APP: Retro Snake
   ========================================== */
.snake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    margin: auto;
}

.snake-game-screen {
    position: relative;
    width: 300px;
    height: 300px;
    background: #fdfdfd;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

body.dark-mode .snake-game-screen {
    background: #1c1917;
}

#snake-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.snake-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .snake-overlay {
    background: rgba(20, 20, 25, 0.6);
}

.snake-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.snake-status {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.snake-score-row {
    display: flex;
    justify-content: space-between;
    width: 300px;
    font-size: 0.8rem;
    font-weight: 600;
}

.snake-score-box {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

body.dark-mode .snake-score-box {
    background: rgba(255, 255, 255, 0.05);
}

.snake-btn {
    background: var(--text-primary);
    border: none;
    color: var(--glass-bg);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-ui);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.snake-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.snake-btn:active {
    transform: translateY(0);
}

/* ==========================================
   APP: Terminal
   ========================================== */
.terminal-window {
    background: #0b071e;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    position: relative;
}

.terminal-matrix-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    z-index: 1;
}

.terminal-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: #8ec5fc;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.terminal-welcome {
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.terminal-output-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-input-row {
    display: flex;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    z-index: 2;
}

.terminal-prompt {
    margin-right: 8px;
    color: #e0c3fc;
    font-weight: 500;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #8ec5fc;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    outline: none;
    caret-color: #e0c3fc;
}

/* ==========================================
   APP: Customizer / Settings
   ========================================== */
.customizer-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: auto;
    width: 100%;
    max-width: 480px;
}

.customizer-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customizer-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 6px;
}

body.dark-mode .customizer-section-title {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.customizer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.customizer-input-text {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    transition: all 0.2s;
}

body.dark-mode .customizer-input-text {
    background: rgba(255, 255, 255, 0.06);
}

.customizer-input-text:focus {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

select.customizer-input-text {
    cursor: pointer;
    padding-right: 32px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8.5L2 4h8z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

body.dark-mode select.customizer-input-text {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8.5L2 4h8z' fill='%23ccc'/%3E%3C/svg%3E");
}

.wallpaper-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.wallpaper-card {
    height: 58px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.wallpaper-card:hover {
    transform: scale(1.05);
}

.wallpaper-card.active {
    border-color: var(--text-primary);
    transform: scale(1.02);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 4px 12px rgba(0,0,0,0.1);
}

.sound-board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sound-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.15s ease;
    font-family: var(--font-ui);
}

body.dark-mode .sound-btn {
    background: rgba(255, 255, 255, 0.05);
}

.sound-btn:hover {
    background: var(--text-primary);
    color: #fff;
}

body.dark-mode .sound-btn:hover {
    color: #000;
}

.sound-btn.active {
    background: var(--text-primary);
    color: #fff !important;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.1);
}
body.dark-mode .sound-btn.active {
    color: #000 !important;
}

.sound-btn:active {
    transform: scale(0.96);
}

/* ==========================================
   MACOS-STYLE APP LAUNCHER (START MENU)
   ========================================== */
#start-menu {
    position: fixed;
    bottom: 72px;
    left: 20px;
    width: 250px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(35px) saturate(180%);
    -webkit-backdrop-filter: blur(35px) saturate(180%);
    z-index: var(--z-menu);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 16px 45px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#start-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.start-menu-header {
    padding: 6px 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.dark-mode .start-menu-header {
    border-bottom-color: rgba(255,255,255,0.06);
}

.start-menu-user {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.start-menu-user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.start-menu-item:hover {
    background: rgba(255, 255, 255, 0.35);
}

body.dark-mode .start-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.start-menu-icon {
    font-size: 1.25rem;
}

.start-menu-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.start-menu-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 6px;
    padding-top: 8px;
}

body.dark-mode .start-menu-footer {
    border-top-color: rgba(255,255,255,0.06);
}

.start-menu-shutdown {
    background: transparent;
    border: none;
    color: var(--btn-red);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 10px;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-menu-shutdown:hover {
    background: rgba(255, 95, 86, 0.12);
}

/* ==========================================
   SCROLLBAR & DECORATIONS
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive Window Rules */
@media (max-width: 768px) {
    .window {
        max-width: 95%;
        max-height: 85%;
    }
    
    #dock-container {
        width: calc(100vw - 24px);
        padding: 0 10px;
        gap: 10px;
    }
    
    .dock-shortcuts {
        gap: 6px;
    }
    
    .dock-shortcut-btn {
        font-size: 1.4rem;
    }
    
    .devlog-app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .devlog-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
    
    .devlog-sidebar-title {
        display: none;
    }
    
    .devlog-nav-btn {
        white-space: nowrap;
    }
}

/* ==========================================
   AI HELP AGENT & POPUP
   ========================================== */
#ai-agent-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-ui);
}

.ai-agent-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-agent-fab:hover {
    transform: scale(1.08) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.ai-agent-fab:active {
    transform: scale(0.95);
}

.ai-agent-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.ai-agent-pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #34c759;
    border: 2px solid #fff;
    border-radius: 50%;
}

.ai-agent-chat-panel {
    display: none;
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 320px;
    height: 400px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px var(--glass-shadow);
    backdrop-filter: blur(35px) saturate(180%);
    -webkit-backdrop-filter: blur(35px) saturate(180%);
    flex-direction: column;
    overflow: hidden;
    animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-agent-chat-panel.open {
    display: flex;
}

.ai-chat-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-avatar {
    font-size: 1.4rem;
}

.ai-chat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-chat-status {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #34c759;
    border-radius: 50%;
    display: inline-block;
}

.ai-chat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
    padding: 2px;
}

.ai-chat-close-btn:hover {
    color: var(--text-primary);
}

.ai-chat-messages-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

.ai-message.system {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--text-primary);
    color: #fff !important;
    border-bottom-right-radius: 2px;
}

body.dark-mode .ai-message.user {
    color: #000 !important;
}

.ai-message.loading {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-tertiary);
    font-style: italic;
    border-bottom-left-radius: 2px;
}

.ai-chat-input-area {
    padding: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 8px;
}

.ai-chat-input-text {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.8rem;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.ai-chat-input-text:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.ai-chat-send-btn {
    width: 32px;
    height: 32px;
    background: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

body.dark-mode .ai-chat-send-btn {
    color: #000 !important;
}

.ai-chat-send-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.ai-chat-send-btn:active {
    transform: scale(0.95);
}

/* ==========================================
   APP: Specs & About
   ========================================== */
.specs-app {
    display: grid;
    grid-template-columns: 165px 1fr;
    height: 100%;
}

.specs-sidebar {
    background: rgba(0, 0, 0, 0.02);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.dark-mode .specs-sidebar {
    background: rgba(255, 255, 255, 0.01);
    border-right-color: rgba(255, 255, 255, 0.05);
}

.specs-nav-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.specs-nav-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

body.dark-mode .specs-nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.specs-nav-btn.active {
    background: var(--text-primary);
    color: #fff !important;
    font-weight: 600;
}

body.dark-mode .specs-nav-btn.active {
    color: #000 !important;
}

.specs-content-area {
    padding: 24px;
    overflow-y: auto;
    height: 100%;
}

@media (max-width: 768px) {
    .specs-app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .specs-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
}
