:root {
    --os-bg: #020205;
    --acc-cyan: #00f3ff;
    --acc-cyan-glow: rgba(0, 243, 255, 0.4);
    --acc-yellow: #f3ff00;
    --acc-red: #ff3e3e;
    --glass-bg: rgba(5, 5, 10, 0.7);
    --glass-border: rgba(0, 243, 255, 0.2);
    --text-primary: #e0e0f0;
    --text-dim: #666688;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
}

body {
    background-color: var(--os-bg);
    color: var(--text-primary);
    font-family: var(--font-mono);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Boot Sequence */
.boot-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 20000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.boot-log {
    font-size: 0.7rem;
    color: var(--acc-cyan);
    white-space: pre-wrap;
    line-height: 1.5;
    overflow-y: hidden;
}

.auth-box {
    margin: auto;
    border: 1px solid var(--acc-cyan);
    padding: 3rem;
    text-align: center;
    background: rgba(0, 243, 255, 0.05);
    box-shadow: 0 0 30px var(--acc-cyan-glow);
}

.auth-header {
    font-size: 0.8rem;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.access-trigger {
    background: transparent;
    border: 1px solid var(--acc-cyan);
    color: var(--acc-cyan);
    padding: 1rem 2rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.access-trigger:hover {
    background: var(--acc-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--acc-cyan);
}

/* Hidden Terminal */
.terminal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 15000;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.term-header {
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.7rem;
    color: #888;
    display: flex;
    justify-content: space-between;
}

.term-view {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.8rem;
    color: var(--acc-cyan);
}

.term-input-row {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

#term-input {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-family: inherit;
    width: 100%;
}

/* Background Effects */
#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.1;
}

.crt-scanlines {
    position: fixed;
    inset: 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: 10001;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: 0.1;
}

.vignette-fx {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 20%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Dashboard Desktop */
.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    padding: 2rem;
}

/* Window System */
.window {
    position: absolute;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    border-radius: 4px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.window.active {
    z-index: 100 !important;
    border-color: var(--acc-cyan);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.win-header {
    background: linear-gradient(to bottom, #1a1a25, #0a0a0f);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    border-bottom: 2px solid #222;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.win-header:active {
    cursor: grabbing;
}

.win-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--acc-cyan);
    text-shadow: 0 0 5px var(--acc-cyan-glow);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.win-controls {
    display: flex;
    gap: 10px;
}

.ctrl {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #252525;
    cursor: pointer;
    border: 1px solid #333;
    transition: all 0.2s;
}

.ctrl.close:hover {
    background: var(--acc-red);
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
}

.ctrl.max:hover {
    background: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.ctrl.min:hover {
    background: var(--acc-yellow);
    border-color: var(--acc-yellow);
    box-shadow: 0 0 10px rgba(243, 255, 0, 0.4);
}

.win-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.win-content.no-padding {
    padding: 0;
}

/* Chronos Module Styling */
.chronos-display {
    text-align: center;
    padding: 1.5rem 0;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.c-time {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    font-variant-numeric: tabular-nums;
}

.c-period {
    font-size: 0.8rem;
    color: var(--acc-cyan);
    font-weight: 800;
    letter-spacing: 2px;
}

.chronos-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.m-item span {
    color: var(--acc-cyan);
}

/* Core System Styles */
.core-branding {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.avatar-box {
    width: 70px;
    height: 70px;
    border: 1px solid var(--acc-cyan);
    background: #000;
    overflow: hidden;
}

.avatar-glitch {
    width: 100%;
    height: 100%;
    background: url('https://api.dicebear.com/7.x/pixel-art/svg?seed=Sudip');
    background-size: cover;
    animation: glitch 5s infinite;
}

.user-name {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.user-status {
    font-size: 0.6rem;
    color: var(--text-dim);
}

.code-module {
    background: #000;
    border: 1px solid #222;
}

.module-bar {
    background: #111;
    font-size: 0.6rem;
    padding: 4px 8px;
    color: #555;
}

.typing-target {
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--acc-cyan);
}

/* Archive EXE Styles */
.exe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.exe-item {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    transition: background 0.2s;
    cursor: pointer;
}

.exe-item:hover {
    background: rgba(0, 243, 255, 0.05);
}

.exe-item svg {
    color: var(--acc-cyan);
    opacity: 0.6;
}

.exe-item span {
    font-size: 0.65rem;
    font-weight: 700;
    color: #888;
}

/* Resource Monitor Styles */
.res-item {
    margin-bottom: 1.5rem;
}

.res-label {
    font-size: 0.6rem;
    margin-bottom: 6px;
    color: var(--text-dim);
}

.st-green {
    color: #00ff88;
}

.st-yellow {
    color: var(--acc-yellow);
}

.res-bar {
    height: 4px;
    background: #111;
    border-radius: 2px;
    position: relative;
}

.res-fill {
    height: 100%;
    background: var(--acc-cyan);
    box-shadow: 0 0 10px var(--acc-cyan);
    border-radius: 2px;
}

canvas#radar-canvas {
    width: 100%;
    height: 100px;
    margin-top: 1rem;
}

/* Dock Navigation */
.os-dock {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.dock-inner {
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    display: flex;
    gap: 1rem;
    border-radius: 12px;
}

.dock-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: all 0.2s;
    cursor: pointer;
}

.dock-icon:hover {
    color: var(--acc-cyan);
    transform: translateY(-5px);
}

.dock-icon.active {
    color: var(--acc-cyan);
}

/* System Tray */
.system-tray {
    position: absolute;
    bottom: 1rem;
    right: 2rem;
    display: flex;
    gap: 2rem;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.tray-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Project Viewer Window */
.proj-window {
    top: 20%;
    left: 30%;
    border-color: var(--acc-yellow);
}

.p-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #222;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.p-title {
    font-size: 1.4rem;
    color: #fff;
}

.p-status {
    font-size: 0.6rem;
    background: var(--acc-cyan);
    color: #000;
    padding: 2px 8px;
    height: fit-content;
}

.d-row {
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.d-row strong {
    color: var(--acc-cyan);
    display: block;
    margin-bottom: 4px;
    font-size: 0.65rem;
}

.p-link {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--acc-cyan);
    color: var(--acc-cyan);
    padding: 8px 12px;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.p-link:hover {
    background: var(--acc-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--acc-cyan-glow);
}

.p-link svg {
    width: 14px;
    height: 14px;
}

/* Animations */
@keyframes glitch {
    0% {
        filter: none;
    }

    5%,
    10% {
        filter: contrast(200%) hue-rotate(90deg);
        transform: skew(3deg);
    }

    15% {
        filter: none;
        transform: none;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
}

/* Network HUD Styling */
.network-hud {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.speed-readout {
    text-align: center;
}

.s-val {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--acc-cyan);
    text-shadow: 0 0 15px var(--acc-cyan-glow);
}

.s-unit {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.signal-visual {
    flex-grow: 1;
    height: 60px;
}

canvas#signal-canvas {
    width: 100%;
    height: 100%;
}

.device-telemetry {
    background: rgba(20, 243, 255, 0.03);
    padding: 1rem;
    border-left: 2px solid var(--acc-cyan);
}

.t-row {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.t-row .v {
    color: #fff;
    font-weight: 700;
}

/* Mobile Fallback Overhaul */
@media (max-width: 768px) {
    .desktop {
        padding: 1rem;
        padding-bottom: 6rem;
        height: 100vh;
        overflow: hidden;
        /* Prevent body scroll, use window scroll */
    }

    .window {
        width: 94% !important;
        left: 3% !important;
        top: 5% !important;
        height: 80vh !important;
        position: fixed !important;
        display: none;
        /* Controlled by JS dock clicks */
    }

    .window.active {
        display: flex !important;
    }

    .win-header {
        padding: 15px;
        /* Larger touch target */
        cursor: default;
    }

    .win-content {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        max-height: calc(80vh - 50px);
    }

    /* Core branding mobile */
    .core-branding {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .avatar-box {
        margin: 0 auto;
    }

    /* Exe Grid Mobile */
    .exe-grid {
        grid-template-columns: 1fr;
    }

    /* Dock Mobile */
    .os-dock {
        bottom: 1rem;
        width: 95%;
    }

    .dock-inner {
        justify-content: space-around;
        padding: 10px;
    }

    .dock-icon {
        width: 50px;
        height: 50px;
    }

    .system-tray {
        top: 10px;
        right: 15px;
        bottom: auto;
    }
}