/* JoeBall95: a Windows 95 style desktop built on 98.css.
   Without JavaScript the windows simply stack as a readable page (see html:not(.js)). */

:root {
    --desktop: #008080;
    --silver: #c0c0c0;
    --navy: #000080;
    --grey: #808080;
    --accent: #f78cbd;
    --taskbar-h: 30px;
    --bevel-out: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
    --bevel-in: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey;
    --font: "Pixelated MS Sans Serif", Arial, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
    margin: 0;
    background: var(--desktop);
    color: #000;
    font-family: var(--font);
    font-size: 11px;
    -webkit-font-smoothing: none;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.honeypot-field {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; top: -100px; left: 8px; z-index: 10000;
    padding: 6px 10px; background: var(--silver); color: #000; box-shadow: var(--bevel-out);
}
.skip-link:focus { top: 8px; }

/* Win95 title bars are flat navy (98 added the gradient). */
.title-bar { background: var(--navy); padding: 3px 3px 3px 4px; }
.title-bar.inactive { background: var(--grey); }
.title-bar-text { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-right: 12px; }
.title-bar-text img { flex: none; image-rendering: pixelated; }
.title-bar-controls { flex: none; }
.title-bar-controls button + button.close { margin-left: 2px; }

img { image-rendering: pixelated; }
:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ------------------------------------------------------------ wallpaper
   A vaporwave sunset behind a slowly turning wireframe bust (js/wallpaper.js). */
.wallpaper { display: none; }
html.js .wallpaper { display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
html.js .desktop-icons { position: relative; }
.wallpaper-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
.wallpaper.is-ready .wallpaper-canvas { opacity: 1; }
.wallpaper-sun {
    position: absolute; left: 50%; top: 50%;
    width: min(56%, 66vh / var(--ui-scale, 1)); aspect-ratio: 1;
    transform: translate(-50%, -66%);
    border-radius: 50%;
    background: linear-gradient(180deg, #fff3a0 0%, #ffb36b 26%, #ff5fa8 56%, #c03bff 100%);
    opacity: 0.92;
    /* The classic sliced-sun stripes: gaps widen towards the bottom. */
    -webkit-mask-image: linear-gradient(180deg, #000 48%, transparent 48% 50%, #000 50% 59%, transparent 59% 62%, #000 62% 70%, transparent 70% 74%, #000 74% 81%, transparent 81% 86%, #000 86% 91%, transparent 91%);
    mask-image: linear-gradient(180deg, #000 48%, transparent 48% 50%, #000 50% 59%, transparent 59% 62%, #000 62% 70%, transparent 70% 74%, #000 74% 81%, transparent 81% 86%, #000 86% 91%, transparent 91%);
}
.wallpaper-sun::after {
    content: ""; position: absolute; inset: -18%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 113, 206, 0.45), rgba(255, 113, 206, 0) 70%);
    z-index: -1;
}

/* ------------------------------------------------------------ desktop icons */
.desktop-icons {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(auto-fill, 74px);
    grid-auto-columns: 78px;
    gap: 6px 4px;
    padding: 8px 4px;
    align-content: start;
}
.desktop-icon {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 4px;
    padding: 2px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}
.desktop-icon span { padding: 1px 2px; line-height: 13px; max-width: 74px; overflow-wrap: anywhere; }
.desktop-icon:focus { outline: none; }
.desktop-icon:focus-visible span { outline: 1px dotted #ff0; }
.desktop-icon.is-selected img { filter: brightness(0.55) sepia(1) hue-rotate(185deg) saturate(6); }
.desktop-icon.is-selected span { background: var(--navy); outline: 1px dotted #ff0; }

/* ------------------------------------------------------------ windows: shared */
.app-window { display: flex; flex-direction: column; min-width: 0; }
.window-body { margin: 3px; display: flex; flex-direction: column; gap: 4px; min-height: 0; flex: 1; }
.window-body p { margin: 0; }

.menu-bar { display: flex; gap: 2px; padding: 1px 0 2px; }
.menu-bar span { padding: 1px 6px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0 4px; border-bottom: 1px solid var(--grey); box-shadow: 0 1px #fff; }
.toolbar label { white-space: nowrap; }
.toolbar input[type="search"] { flex: 1 1 140px; min-width: 0; }
.toolbar-note { color: #333; }

.status-bar { margin: 0; flex: none; }
.status-bar-field { padding: 2px 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.sunken-panel { background: #fff; box-shadow: var(--bevel-in); padding: 2px; overflow: auto; flex: 1; min-height: 60px; }
table.interactive { width: 100%; }
table.interactive tbody tr { cursor: default; }
table.interactive tbody tr:focus { outline: 1px dotted #000; outline-offset: -1px; }

/* Explorer-style folder */
.file-grid {
    list-style: none; margin: 0; padding: 10px; flex: 1; overflow: auto;
    display: flex; flex-wrap: wrap; align-content: flex-start; gap: 14px 10px;
    background: #fff; box-shadow: var(--bevel-in);
}
.file-icon { display: grid; justify-items: center; gap: 4px; width: 86px; padding: 2px; color: #000; text-decoration: none; text-align: center; cursor: default; }
.file-icon span { padding: 0 2px; line-height: 13px; }
.file-icon:focus { outline: none; }
.file-icon:focus-visible span { outline: 1px dotted #000; }
.file-icon.is-selected img { filter: brightness(0.55) sepia(1) hue-rotate(185deg) saturate(6); }
.file-icon.is-selected span { background: var(--navy); color: #fff; outline: 1px dotted #ff0; }

/* Notepad */
.notepad-page {
    flex: 1; overflow: auto; padding: 6px 8px;
    background: #fff; box-shadow: var(--bevel-in);
    font: 13px/1.45 "Courier New", Courier, monospace;
    -webkit-font-smoothing: auto;
    user-select: text;
}
.notepad-page h2, .notepad-page p, .notepad-page ul { font: inherit; margin: 0 0 1.45em; padding: 0; }
.notepad-page ul { list-style: none; }
.notepad-page li::before { content: "- "; }
.notepad-page:focus { outline: none; }

/* Welcome */
.welcome { padding: 10px 12px 6px; gap: 10px; }
.welcome-heading { font: 24px/1.1 Arial, sans-serif; -webkit-font-smoothing: auto; letter-spacing: -0.5px; }
.welcome-heading b { font-weight: 900; }
.welcome-95 { margin-left: 2px; color: #fff; font-weight: 900; -webkit-text-stroke: 1.5px #000; paint-order: stroke; }
.welcome-main { display: grid; grid-template-columns: 1fr 112px; gap: 12px; }
.welcome-tip { display: grid; grid-template-columns: 40px 1fr; gap: 4px; padding: 12px 10px; min-height: 140px; background: #ffffe1; box-shadow: var(--bevel-in); }
.welcome-tip img { margin-top: 2px; }
.welcome-tip-label { font-weight: 700; margin-bottom: 8px !important; font-size: 12px; }
.welcome-tip p { line-height: 1.5; }
.welcome-actions { display: grid; gap: 6px; align-content: start; }
.welcome-actions button { min-width: 0; width: 100%; }
.welcome-actions hr { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--grey); border-bottom: 1px solid #fff; }

/* Film reviews */
.reviews-table { flex: 1 1 50%; }
.reviews-table td:nth-child(n+2), .reviews-table th:nth-child(n+2) { white-space: nowrap; }
.review-detail { flex: 0 0 auto; min-height: 92px; max-height: 40%; overflow: auto; padding: 6px 8px; background: #fff; box-shadow: var(--bevel-in); line-height: 1.5; user-select: text; }
.review-detail h3 { margin: 0 0 2px; font-size: 12px; }
.review-detail .meta { color: #444; margin-bottom: 6px; }
.review-detail .stars { color: #b8467c; font-family: Arial, sans-serif; letter-spacing: 1px; }
.review-detail .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.review-detail .tags span { padding: 0 4px; box-shadow: var(--bevel-out); background: var(--silver); }

/* Mail compose */
.mail { gap: 6px; }
.mail-fields { display: grid; grid-template-columns: 56px 1fr; gap: 4px 6px; align-items: center; }
.mail .mail-fields label, .mail .mail-fields input[readonly] { color: #000; }
.mail-fields input[readonly] { background: var(--silver); }
.mail textarea { flex: 1; min-height: 120px; resize: none; padding: 4px; font: 13px/1.4 "Courier New", Courier, monospace; -webkit-font-smoothing: auto; }
.tool-button { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 0 10px; }
.status-bar-field.is-error { color: #a00; }
.status-bar-field.is-success { color: #060; }

.bin-table td:first-child { white-space: nowrap; }

/* Display Properties */
.display-settings { padding: 8px 10px 6px; gap: 10px; }
.display-preview { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 6px; }
.display-settings fieldset { display: grid; gap: 8px; padding: 10px 12px; margin: 0; }
.display-current { color: #333; min-height: 13px; }
.display-buttons { display: flex; justify-content: flex-end; }
.wallpaper-credit { color: #444; line-height: 1.4; margin-top: 2px !important; }
.wallpaper-credit a { color: var(--navy); }

/* Music: a Media Player. Transport glyphs are drawn in CSS so they stay crisp. */
.player { gap: 4px; }
.player-screen { flex: 1 1 auto; min-height: 120px; display: flex; padding: 2px; background: #000; box-shadow: var(--bevel-in); }
.player-screen video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #000; cursor: default; }
.player-seek { flex: none; height: 26px; padding: 9px 4px 0; }
.player-seek input { display: block; margin: 0; }
.player-controls { flex: none; display: flex; align-items: center; gap: 3px; padding: 2px 0 4px; border-bottom: 1px solid var(--grey); box-shadow: 0 1px #fff; }
.mp-button { display: inline-grid; place-items: center; width: 28px; min-width: 0; height: 24px; min-height: 0; padding: 0; flex: none; }
.mp-button:active { padding: 0; }
.mp-button:active .glyph { transform: translate(1px, 1px); }
.mp-button:disabled .glyph { color: var(--grey); filter: drop-shadow(1px 1px 0 #fff); }
.mp-divider { flex: none; width: 2px; height: 20px; margin: 0 3px; border-left: 1px solid var(--grey); border-right: 1px solid #fff; }
.mp-time {
    flex: none; min-width: 92px; margin-left: 4px; padding: 3px 6px;
    background: #000; color: var(--accent); box-shadow: var(--bevel-in);
    font: 12px/1 "Courier New", Courier, monospace; text-align: center; white-space: nowrap;
}
.mp-volume { flex: 0 1 130px; min-width: 70px; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.mp-volume input { flex: 1; min-width: 0; margin: 0; }

.glyph { display: block; color: #000; }
.glyph-play { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.glyph-pause { width: 8px; height: 9px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.glyph-stop { width: 8px; height: 8px; background: currentColor; }
.glyph-prev, .glyph-next { display: flex; align-items: center; }
.glyph-prev::before, .glyph-next::after { content: ""; width: 2px; height: 9px; background: currentColor; }
.glyph-prev::after, .glyph-next::before { content: ""; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.glyph-prev::after { border-right: 7px solid currentColor; }
.glyph-next::before { border-left: 7px solid currentColor; }
.glyph-full { width: 12px; height: 10px; border: 1px solid currentColor; border-top-width: 3px; }

.playlist { flex: 0 0 auto; height: 88px; }
.playlist td:nth-child(n+3), .playlist th:nth-child(n+3) { white-space: nowrap; width: 1%; }
.player-nojs { margin: auto; padding: 24px; color: var(--accent); text-align: center; }
html.js .player-nojs { display: none; }
.playlist tr.is-current td:first-child { font-weight: 700; }

/* ------------------------------------------------------------ taskbar */
.taskbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5000;
    height: var(--taskbar-h);
    display: flex; align-items: center; gap: 4px;
    padding: 2px;
    background: var(--silver);
    box-shadow: inset 0 1px #dfdfdf, inset 0 2px #fff;
}
.taskbar button { min-width: 0; min-height: 0; height: 24px; }
.start-button { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px 0 4px; font-weight: 700; flex: none; }
.start-button[aria-expanded="true"] { box-shadow: var(--bevel-in); padding: 1px 5px 0 5px; }
.taskbar-tasks { display: flex; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
.task {
    display: inline-flex; align-items: center; gap: 4px;
    flex: 0 1 160px; min-width: 40px;
    padding: 0 6px; justify-content: flex-start; text-align: left;
}
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task img { flex: none; }
.task[aria-pressed="true"] {
    box-shadow: var(--bevel-in);
    background: repeating-conic-gradient(#fff 0 25%, var(--silver) 0 50%) 0 0 / 2px 2px;
    font-weight: 700;
    padding-top: 1px;
}
.tray { flex: none; display: flex; align-items: center; height: 24px; padding: 0 10px; box-shadow: inset -1px -1px #fff, inset 1px 1px var(--grey); }

/* Start menu */
.start-menu {
    position: absolute; left: 2px; bottom: calc(var(--taskbar-h) - 2px);
    display: flex; min-width: 210px;
    padding: 3px;
    background: var(--silver);
    box-shadow: var(--bevel-out);
}
.start-banner {
    flex: none; width: 24px;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 6px;
    background: var(--grey);
}
.start-banner span {
    writing-mode: vertical-rl; transform: rotate(180deg);
    font: 18px/1 Arial, sans-serif; letter-spacing: 0.5px; color: var(--silver);
    -webkit-font-smoothing: auto;
}
.start-banner b { color: #fff; font-weight: 900; }
.start-banner i { font-style: normal; font-weight: 900; color: var(--accent); }
.start-menu ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.start-menu a, .start-menu ul button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; height: auto; min-height: 34px; padding: 3px 18px 3px 6px;
    color: #000; text-decoration: none; text-align: left;
    background: none; box-shadow: none; border: 0;
    font: inherit; cursor: default;
}
.start-menu a:hover, .start-menu a:focus, .start-menu ul button:hover, .start-menu ul button:focus {
    background: var(--navy); color: #fff; outline: none;
}
.start-menu ul button:active { box-shadow: none; padding: 3px 18px 3px 6px; }
.start-sep { height: 2px; margin: 3px 2px; border-top: 1px solid var(--grey); border-bottom: 1px solid #fff; }

/* Shut down screen */
.shutdown {
    position: fixed; inset: 0; z-index: 9000;
    display: grid; place-content: center; gap: 14px; text-align: center;
    background: #000; color: #ff8c1a;
    font: 28px/1.3 Arial, sans-serif; -webkit-font-smoothing: auto;
    cursor: default;
}
.shutdown p { margin: 0; }
.shutdown .shutdown-sub { font-size: 14px; color: #c06a14; }
.shutdown:focus { outline: none; }

/* ------------------------------------------------------------ JS desktop mode */
html.js, html.js body { overflow: hidden; }
html.js .desktop { position: fixed; inset: 0 0 var(--taskbar-h) 0; overflow: hidden; }
html.js .window-layer { position: absolute; inset: 0; pointer-events: none; }
html.js .window-layer:focus { outline: none; }
html.js .desktop-icons { height: 100%; }
html.js .app-window { position: absolute; display: none; pointer-events: auto; max-width: 100%; max-height: 100%; }
html.js .app-window.is-open { display: flex; }
html.js .app-window.is-minimized { display: none; }
html.js .app-window.is-resizable { resize: both; overflow: hidden; min-width: 260px; min-height: 160px; }
html.js .app-window.is-maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; resize: none; }
html.js .app-window.is-dragging { user-select: none; }
html.js .app-window .title-bar { cursor: default; touch-action: none; user-select: none; }

/* ------------------------------------------------------------ no-JS: plain page */
html:not(.js) .taskbar,
html:not(.js) .shutdown,
html:not(.js) #welcome,
html:not(.js) .title-bar-controls { display: none; }
html:not(.js) body { padding: 12px 12px 24px; }
html:not(.js) .desktop-icons { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, 78px); padding: 0 0 8px; }
html:not(.js) .window-layer { display: grid; gap: 16px; max-width: 720px; margin: 0 auto; }
html:not(.js) .file-grid, html:not(.js) .notepad-page { flex: none; }
html:not(.js) .player-seek, html:not(.js) .player-controls { display: none; }
html:not(.js) .player-screen video, html:not(.js) .playlist { display: none; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 640px), (max-height: 480px) {
    :root { --taskbar-h: 36px; }
    .taskbar button { height: 30px; }
    .tray { height: 30px; }
    html.js .desktop-icons {
        grid-auto-flow: row; grid-template-rows: none;
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        gap: 14px 4px; padding: 14px 8px;
    }
    html.js .app-window.is-open { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; resize: none; }
    html.js .app-window.is-open:not(.is-resizable) { left: 6px !important; top: 10px !important; width: calc(100% - 12px) !important; height: auto !important; }
    .title-bar-controls .maximize { display: none; }
    .title-bar-controls button { min-width: 22px; min-height: 20px; background-position: center !important; }
    .welcome-main { grid-template-columns: 1fr; }
    .welcome-actions { grid-template-columns: 1fr 1fr; }
    .welcome-actions hr { display: none; }
    .welcome-heading { font-size: 20px; }
    .task { flex-basis: 120px; }
    .mp-volume { display: none; }
    .player-screen { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
    .playlist { flex: 1 1 auto; height: auto; }
    .mp-time { margin-left: auto; }
    .mp-button { width: 34px; height: 30px; }
    .start-menu { min-width: 230px; }
    .start-menu a, .start-menu ul button { min-height: 42px; }
    input, select, textarea { font-size: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
