/*
 * win95.css
 *
 * Author       : Amey Thakur
 * GitHub       : https://github.com/Amey-Thakur
 * Repository   : https://github.com/Amey-Thakur/MINESWEEPER
 * Release Date : March 5, 2026
 * License      : MIT
 *
 * Tech Stack   : CSS3, CSS Custom Properties (Variables)
 *
 * Description  : Comprehensive design system replicating the Microsoft Windows 95
 *                visual language. Color paradigms, geometrical border measurements, 
 *                and typographic families are synthesized directly from legacy 
 *                Windows OS physical metrics.
 *                
 *                The system leverages CSS Custom Properties to establish a 
 *                single source of truth for chromatic theming. Physical depth 
 *                and the signature beveling effect is achieved via asymmetric 
 *                border color allocations to simulate a static, top-left 
 *                originating light source.
 */


/* 
 * Design System Tokens
 * Defines mutable physical and chromatic properties configured to directly 
 * map to legacy named system colors from the Windows 95 registry.
 */

:root {
    /* System colors (Win95 palette) */
    --win95-bg: #c0c0c0;
    /* Silver, the iconic background      */
    --win95-surface: #c0c0c0;
    /* Control face color                  */
    --win95-highlight: #ffffff;
    /* 3D highlight (top-left bevel)       */
    --win95-light: #dfdfdf;
    /* Inner highlight                     */
    --win95-shadow: #808080;
    /* 3D shadow (bottom-right bevel)      */
    --win95-dark-shadow: #000000;
    /* Outer shadow, window border         */
    --win95-title-active: #000080;
    /* Active window title bar, navy       */
    --win95-title-inactive: #808080;
    /* Inactive window title bar           */
    --win95-title-text: #ffffff;
    /* Title bar text                      */
    --win95-desktop: #008080;
    /* Teal, the classic desktop color     */
    --win95-text: #000000;
    /* Default text color                  */
    --win95-btn-face: #c0c0c0;
    /* Button face                         */
    --win95-menu-highlight: #000080;
    /* Selected menu item background       */
    --win95-menu-hl-text: #ffffff;
    /* Selected menu item text             */

    /* Typographical Standards */
    --font-system: 'Segoe UI', 'MS Sans Serif', Tahoma, Geneva, sans-serif;
    --font-lcd: 'VT323', 'Courier New', monospace;
    --fs-base: 12px;
    --fs-lcd: 24px;
    --fs-menu: 12px;
    --fs-title: 12px;

    /* Geometric Constraints */
    --border-w: 2px;
    --window-pad: 3px;
    --titlebar-h: 22px;
    --menubar-h: 24px;
    --statusbar-h: 22px;
    --taskbar-h: 32px;
}


/* 
 * Desktop Environment 
 * Provides the overarching background construct functioning as the host 
 * for absolute positioned window coordinates and grid execution.
 */

.win95-desktop {
    width: 100vw;
    height: 100vh;
    background-color: var(--win95-desktop);
    background-image: url('../img/wallpaper.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: var(--font-system);
    font-size: var(--fs-base);
    color: var(--win95-text);
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    position: relative;
    /* Hardware power sequence animation */
    animation: crt-turn-on 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes crt-turn-on {
    0% {
        transform: scale(1, 0.001);
        filter: brightness(0);
        opacity: 0;
    }

    40% {
        transform: scale(1, 0.001);
        filter: brightness(2);
        opacity: 1;
    }

    100% {
        transform: scale(1, 1);
        filter: brightness(1);
        opacity: 1;
    }
}

@keyframes crt-turn-off {
    0% {
        transform: scale(1, 1);
        filter: brightness(1);
        opacity: 1;
    }

    60% {
        transform: scale(1, 0.001);
        filter: brightness(2);
        opacity: 1;
    }

    100% {
        transform: scale(1, 0.001);
        filter: brightness(0);
        opacity: 0;
    }
}

.win95-desktop.turning-off {
    animation: crt-turn-off 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* 
 * Shutdown Sequence Overlay
 * Manages the visibility and styling for the legacy safe-to-turn-off view. 
 */

.shutdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ff8c00;
    font-family: sans-serif;
    font-size: 24px;
    cursor: pointer;
}

.shutdown-overlay.hidden {
    display: none;
}

.shutdown-restart {
    margin-top: 60px;
    font-size: 16px;
    color: #aaa;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* 
 * Start Menu Architecture Navigation 
 * Container governing the system command palette accessed via the primary 
 * taskbar entry sequence. 
 */

.win95-start-menu {
    position: absolute;
    bottom: var(--taskbar-h);
    left: 0;
    width: 220px;
    background-color: var(--win95-surface);
    z-index: 99999;
    display: flex;
    flex-direction: row;

    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
}

.win95-start-menu.hidden {
    display: none;
}

.start-menu-sidebar {
    width: 28px;
    background: linear-gradient(0deg, #000080, #1084d0);
    display: flex;
    align-items: flex-end;
    padding-bottom: 8px;
    padding-left: 4px;
}

.sidebar-text {
    color: white;
    font-weight: bold;
    font-size: 16px;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    letter-spacing: 1px;
}

.start-menu-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2px;
}

.tab-icon-img,
.icon-img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.start-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: default;
    text-align: left;
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--win95-text);
}

.start-menu-item:hover {
    background-color: var(--win95-menu-highlight);
    color: var(--win95-menu-hl-text);
}

.sm-icon {
    font-size: 16px;
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.sm-text {
    flex: 1;
}

.sm-arrow {
    font-size: 10px;
}

.sm-arrow-icon {
    width: 10px;
    height: 10px;
    margin-left: auto;
    image-rendering: pixelated;
}

.start-menu-item:hover .sm-arrow-icon,
.start-menu-item:hover .sm-invert {
    filter: brightness(0) invert(1);
}

.sm-divider {
    height: 2px;
    margin: 4px 2px;
    border-top: 1px solid var(--win95-shadow);
    border-bottom: 1px solid var(--win95-highlight);
}

.start-menu-item-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.start-sub-menu {
    position: absolute;
    left: 100%;
    top: -2px;
    width: 200px;
    background-color: var(--win95-surface);
    display: flex;
    flex-direction: column;
    padding: 2px;
    z-index: 100000;

    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
}

.start-sub-menu.hidden {
    display: none;
}

.start-menu-item:hover,
.start-menu-item.active,
.start-menu-item.active-parent {
    background-color: var(--win95-menu-highlight);
    color: var(--win95-menu-hl-text);
}

.start-menu-item:hover .sm-invert,
.start-menu-item.active .sm-invert,
.start-menu-item.active-parent .sm-invert {
    filter: brightness(0) invert(1);
}


/* 
 * OS Taskbar 
 * Fixed anchoring bar maintaining global system controls including the clock
 * logic module and application minimization tabs.
 */

.win95-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-h);
    background-color: var(--win95-surface);
    border-top: 2px solid var(--win95-highlight);
    display: flex;
    align-items: center;
    padding: 2px 4px;
    z-index: 99999;
}

.win95-start-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    height: 26px;
    background-color: var(--win95-btn-face);
    font-weight: bold;
    font-size: var(--fs-base);

    /* Volumetric inset definition */
    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
}

.win95-start-button:active {
    /* Active depression state mutation */
    border-top-color: var(--win95-dark-shadow);
    border-left-color: var(--win95-dark-shadow);
    border-bottom-color: var(--win95-highlight);
    border-right-color: var(--win95-highlight);
}

.start-icon {
    font-size: 16px;
}

.taskbar-divider {
    width: 2px;
    height: 24px;
    margin: 0 4px;
    border-left: 1px solid var(--win95-shadow);
    border-right: 1px solid var(--win95-highlight);
}

.win95-clock {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 11px;

    /* Apply internal recession */
    border-top: 1px solid var(--win95-shadow);
    border-left: 1px solid var(--win95-shadow);
    border-bottom: 1px solid var(--win95-highlight);
    border-right: 1px solid var(--win95-highlight);
}

.win95-clock.menu-label:hover {
    background-color: transparent;
    color: var(--win95-text);
}

.menu-dropdown.clock-dropdown {
    position: fixed;
    top: auto;
    bottom: var(--taskbar-h);
    left: auto;
    right: 4px;
}


.sm-arrow-icon {
    width: 8px;
    height: 8px;
    margin-left: auto;
    filter: brightness(0.5);
    /* Muted directional glyph */
}

/* 
 * Application Container Envelope 
 * Establishes the z-index hierarchy and double-bevel physical borders 
 * for the floating window interface.
 */

.win95-window {
    background-color: var(--win95-surface);
    display: inline-flex;
    flex-direction: column;
    position: relative;

    /* Outer border constraints */
    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);

    box-shadow: 1px 1px 0 var(--win95-dark-shadow);

    max-width: calc(100vw - 20px);
    max-height: calc(100vh - var(--taskbar-h) - 20px);
    overflow: hidden;
    z-index: 1000;

    /* DOM insertion sequence */
    animation: window-open 0.2s ease-out;
}

@keyframes window-open {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}




/* 
 * Window Title Bar Component
 * Secures interactive drag capability bounds and active gradient identification.
 */

.win95-title-bar {
    display: flex;
    align-items: center;
    height: var(--titlebar-h);
    padding: 2px 3px;
    background: var(--win95-title-inactive);
    color: var(--win95-light);
    cursor: default;
}

.win95-window.active .win95-title-bar {
    background: linear-gradient(90deg, var(--win95-title-active), #1084d0);
    color: var(--win95-title-text);
}

.title-bar-icon {
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.title-bar-icon img {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

.title-bar-text {
    font-size: var(--fs-title);
    font-weight: bold;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-btn {
    width: 18px;
    height: 16px;
    font-size: 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--win95-btn-face);
    color: var(--win95-text);

    border-top: 1px solid var(--win95-highlight);
    border-left: 1px solid var(--win95-highlight);
    border-bottom: 1px solid var(--win95-dark-shadow);
    border-right: 1px solid var(--win95-dark-shadow);
}

.title-btn:active {
    border-top-color: var(--win95-dark-shadow);
    border-left-color: var(--win95-dark-shadow);
    border-bottom-color: var(--win95-highlight);
    border-right-color: var(--win95-highlight);
}


/* 
 * Configuration Menu Navigation
 * Nested sub-menu interaction zone handling core parameter reconfiguration.
 */

.win95-menu-bar {
    display: flex;
    height: var(--menubar-h);
    padding: 0 2px;
    background-color: var(--win95-surface);
    border-bottom: 1px solid var(--win95-shadow);
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-label {
    padding: 2px 8px;
    font-size: var(--fs-menu);
    cursor: default;
}

.menu-label:hover {
    background-color: var(--win95-menu-highlight);
    color: var(--win95-menu-hl-text);
}

/* Absolute positioned command list */

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--win95-surface);
    z-index: 1000;
    padding: 2px;

    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
}

.menu-item.active .menu-dropdown {
    display: block;
}

.menu-item.active .menu-label {
    background-color: var(--win95-menu-highlight);
    color: var(--win95-menu-hl-text);
}

.menu-item.active .win95-clock.menu-label {
    background-color: transparent;
    color: var(--win95-text);
}

.menu-option {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 2px 8px;
    font-size: var(--fs-menu);
    white-space: nowrap;
    background: none;
    border: none;
}

.menu-option:hover {
    background-color: var(--win95-menu-highlight);
    color: var(--win95-menu-hl-text);
}

.menu-option:hover .menu-invert,
.menu-option:hover .sm-invert {
    filter: brightness(0) invert(1);
}

.menu-icon-img {
    image-rendering: pixelated;
    display: block;
    object-fit: contain;
}

.menu-separator {
    height: 1px;
    margin: 2px 0;
    border-top: 1px solid var(--win95-shadow);
    border-bottom: 1px solid var(--win95-highlight);
}


/* 
 * System Status Bar Container 
 * Defines the footer boundaries delivering read-only string mutations.
 */

.win95-status-bar {
    display: flex;
    align-items: center;
    height: var(--statusbar-h);
    padding: 1px;
    margin-top: 2px;
    gap: 2px;
}

.win95-status-bar span {
    padding: 2px 6px;
    font-size: 11px;
    border-top: 1px solid var(--win95-shadow);
    border-left: 1px solid var(--win95-shadow);
    border-bottom: 1px solid var(--win95-highlight);
    border-right: 1px solid var(--win95-highlight);
    background: var(--win95-surface);
    white-space: nowrap;
}

#status-text {
    flex: 1;
    /* Main message takes more space */
}

#status-seed {
    width: 100px;
    /* Fixed width prevents jitter */
    flex-shrink: 0;
}

#status-seed:empty {
    display: none;
}




/* 
 * Global Prompt Modals 
 * Forces blocking layout patterns to capture focused input streams 
 * during parameter adjustments.
 */

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.15);
    z-index: 10000;
}

.win95-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--win95-surface);
    z-index: 10001;
    min-width: 280px;

    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
    box-shadow: 2px 2px 0 var(--win95-dark-shadow);
}

.win95-dialog-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--titlebar-h);
    padding: 2px 3px;
    background: linear-gradient(90deg, var(--win95-title-active), #1084d0);
    color: var(--win95-title-text);
    font-size: var(--fs-title);
    font-weight: bold;
}

.win95-dialog-body {
    padding: 16px;
}

.about-body ul {
    list-style: disc;
    padding-left: 20px;
    margin: 8px 0;
}

.about-body ul li {
    margin-bottom: 4px;
    font-size: 11px;
}

.about-body h2 {
    font-size: 14px;
    margin-bottom: 8px;
}

.about-body p {
    font-size: 12px;
    margin-bottom: 4px;
}

.dialog-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.dialog-field label {
    min-width: 120px;
    font-size: var(--fs-base);
}

.dialog-field input {
    width: 80px;
    padding: 2px 4px;
    font-size: var(--fs-base);
    background: white;

    /* Recessed input matrix styling */
    border-top: 2px solid var(--win95-shadow);
    border-left: 2px solid var(--win95-shadow);
    border-bottom: 2px solid var(--win95-highlight);
    border-right: 2px solid var(--win95-highlight);
}

.dialog-note {
    font-size: 11px;
    color: var(--win95-shadow);
    margin: 8px 0;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* Reusable elevated control button instance */

.win95-btn {
    padding: 4px 24px;
    font-size: var(--fs-base);
    background-color: var(--win95-btn-face);

    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
}

.win95-btn:active {
    border-top-color: var(--win95-dark-shadow);
    border-left-color: var(--win95-dark-shadow);
    border-bottom-color: var(--win95-highlight);
    border-right-color: var(--win95-highlight);
}


/* Overriding Helper Utilities */

.hidden {
    display: none !important;
}

.win95-link {
    color: #0000ee;
    text-decoration: underline;
    cursor: pointer;
}

.win95-link:hover {
    color: #551a8b;
}

.win95-link:active {
    color: #ee0000;
}

/* 
 * Navigational System Nodes 
 * Desktop coordinate points allowing immediate application or resource opening.
 */

.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.desktop-icon {
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
}

.icon-img-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.icon-img,
.retro-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    display: block;
}

.icon-label {
    color: white;
    font-size: 11px;
    padding: 2px 4px;
    text-shadow: 1px 1px 1px black;
}

.desktop-icon:hover .icon-label {
    background-color: var(--win95-title-active);
}

.desktop-icon.selected .icon-label {
    background-color: var(--win95-title-active);
    outline: 1px dotted white;
}

/*
 * Foreground Application Access Nodes 
 * Defines the minimizing queue structure mounted in the OS generic bar.
 */

.taskbar-apps {
    display: flex;
    gap: 4px;
    flex: 1;
    padding: 0 4px;
}

.taskbar-app-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 160px;
    width: 160px;
    max-width: 160px;
    height: 26px;
    padding: 2px 8px;
    background-color: var(--win95-btn-face);
    font-size: 11px;
    font-weight: bold;
    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-bottom: 2px solid var(--win95-dark-shadow);
    border-right: 2px solid var(--win95-dark-shadow);
    cursor: default;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.taskbar-app-tab.active {
    background-color: var(--win95-surface);
    border-top: 2px solid var(--win95-dark-shadow);
    border-left: 2px solid var(--win95-dark-shadow);
    border-bottom: 2px solid var(--win95-highlight);
    border-right: 2px solid var(--win95-highlight);
    box-shadow: inset 1px 1px 0 var(--win95-shadow);
}

.tab-icon {
    font-size: 14px;
}

/* 
 * Coordinate Transformations
 * Overwrites specific spatial properties for minimization/maximization.
 */

.win95-window.maximized {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--taskbar-h)) !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    z-index: 1000;
}

.win95-window.minimized,
.win95-window.hidden {
    display: none !important;
}

.tab-icon-img,
.tab-retro-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    display: block;
}

/* 
 * Seed Manager Modal 
 */
.seed-tab-strip {
    display: flex;
    position: relative;
    z-index: 2;
    margin-bottom: -2px;
    padding-left: 8px;
    /* Classic Win95 offset */
}

.seed-tab {
    padding: 3px 12px;
    margin-right: -1px;
    background: var(--win95-surface);
    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-right: 2px solid var(--win95-dark-shadow);
    border-bottom: 2px solid var(--win95-highlight);
    /* Merges with panel top border */
    box-shadow: inset -1px 0 var(--win95-shadow);
    cursor: default;
    font-size: 11px;
    position: relative;
    top: 0;
    z-index: 1;
}

.seed-tab.active {
    top: -2px;
    padding-top: 5px;
    padding-bottom: 4px;
    z-index: 3;
    border-bottom: 2px solid var(--win95-surface);
    /* Masks panel top border */
    box-shadow: none;
}

.seed-tab-panel {
    display: none;
    padding: 16px;
    background: var(--win95-surface);
    border-top: 2px solid var(--win95-highlight);
    border-left: 2px solid var(--win95-highlight);
    border-right: 2px solid var(--win95-dark-shadow);
    border-bottom: 2px solid var(--win95-dark-shadow);
    box-shadow: inset -1px -1px 0 var(--win95-shadow);
    position: relative;
    z-index: 1;
    height: 230px;
    /* Balanced height for Technical Note content */
}

.seed-tab-panel.active {
    display: block;
}

.seed-share-group {
    margin-bottom: 12px;
}

.seed-share-label {
    font-size: 11px;
    margin-bottom: 4px;
    color: #444;
}

.seed-share-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seed-share-value {
    font-weight: bold;
    font-size: 13px;
    color: #000;
    background: transparent;
    border: none;
}

.seed-share-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 2px 12px;
    font-size: 11px;
    min-width: 60px;
}

.seed-copy-feedback {
    position: absolute;
    bottom: -28px;
    left: 45%;
    transform: translateX(-50%);
    background: #ffffe1;
    border: 1px solid #000;
    padding: 4px 8px;
    font-size: 11px;
    color: #000;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 1000;
}

/* 
 * Doc System: Folder and Document Explorer 
 */

.folder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
}

.folder-item {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
    border: 1px solid transparent;
    padding: 4px;
}

.folder-item:hover {
    background-color: rgba(0, 0, 128, 0.05);
    border: 1px dotted var(--win95-shadow);
}

.folder-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    image-rendering: pixelated;
}

.folder-item span {
    font-size: 11px;
    word-break: break-all;
}

.win95-window-body {
    display: flex;
    flex-direction: column;
}

.win95-status-bar {
    height: var(--statusbar-h);
    background-color: var(--win95-surface);
    border-top: 1px solid var(--win95-shadow);
    display: flex;
    align-items: center;
    padding: 0 2px;
    font-size: 11px;
}

.status-bar-pane {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 4px;
    border-right: 1px solid var(--win95-highlight);
    border-left: 1px solid var(--win95-shadow);
}

.status-bar-pane:first-child {
    border-left: none;
}

.status-bar-pane:last-child {
    flex: 0 0 100px;
    border-right: none;
}

.doc-window h1 {
    font-family: var(--font-system);
    font-weight: bold;
}

.mermaid-diagram {
    user-select: text;
}

/* 
 * Responsive adjustments for mobile environments 
 * Optimizes the desktop layout for narrow viewports by hiding non-essential 
 * legacy icons and scaling specialized UI nodes.
 */
@media screen and (max-width: 600px) {
    /* Restore and scale desktop icons for mobile density */
    .desktop-icons {
        left: 10px;
        top: 10px;
        gap: 10px;
    }

    .desktop-icon {
        width: 50px;
    }

    .desktop-icon .retro-icon,
    .desktop-icon .icon-img {
        width: 24px;
        height: 24px;
    }

    .desktop-icon .icon-label {
        font-size: 9px;
    }

    /* Scaling taskbar for accessibility */
    .taskbar-app-tab {
        min-width: 36px;
        width: auto;
        flex: 1;
        padding: 2px 4px;
        font-size: 10px;
    }

    .taskbar-app-tab span,
    .start-button span {
        display: none;
    }

    .start-button {
        padding: 2px 4px;
        min-width: 32px;
    }

    /* Centering for dialogs without forcing gaps */
    .win95-dialog {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: auto !important;
        max-width: 95vw !important;
        min-width: 250px;
        position: fixed !important;
    }

    /* Ensure windows fit their content tightly on mobile */
    .win95-window:not(.maximized) {
        width: auto !important;
        max-width: 95vw !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        position: relative !important; /* Allow desktop flex centering to work */
    }

    /* Prevent content overflow in small containers by forcing wrap/scroll */
    .win95-dialog-body,
    .win95-window-body {
        width: auto !important;
        max-width: 100% !important;
        overflow-x: auto;
    }

    .title-btn {
        width: 22px;
        height: 20px;
        font-size: 14px;
    }
    
    .status-bar-pane:last-child {
        display: none;
    }
}