/* ÆTHER OS — my theme, my rules. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; color: #ddd; font-family: "Segoe UI", system-ui, sans-serif; font-size: 13px; user-select: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: Consolas, "Courier New", monospace; color: inherit; outline: none; border: 1px solid #333; background: #1a1a1a; padding: 4px 6px; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #444; }
.hidden { display: none !important; }

/* backdrop — stars are fine, nebula tone it down */
.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.nebula { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.08; background: radial-gradient(ellipse at 70% 80%, #1a3a4a 0%, transparent 50%); }

/* desktop */
.desktop { position: fixed; inset: 0; z-index: 1; padding-top: 26px; padding-bottom: 48px; }
body.dock-side-left .desktop { padding-left: 56px; padding-bottom: 0; }
body.dock-side-right .desktop { padding-right: 56px; padding-bottom: 0; }
.desktop-icons { display: grid; grid-template-columns: repeat(auto-fill, 78px); grid-auto-rows: 86px; gap: 4px; padding: 10px; align-content: start; }
.dicon { width: 78px; height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.dicon:hover { background: #1a1a1a; }
.dicon.selected { background: #252525; outline: 1px solid #e8a030; }
.dicon .ico { font-size: 30px; }
.dicon .lbl { font-size: 10px; text-align: center; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #999; }
.dicon input { width: 70px; font-size: 10px; text-align: center; background: #1a1a1a; border: 1px solid #e8a030; padding: 2px; }

/* menubar */
.menubar { position: fixed; top: 0; left: 0; right: 0; height: 26px; z-index: 5000; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; background: #181818; border-bottom: 1px solid #2a2a2a; font-size: 11px; }
.menubar-left, .menubar-right { display: flex; align-items: center; gap: 10px; }
.menubar-logo { font-weight: 800; color: #e8a030; cursor: pointer; font-size: 12px; }
.menubar-app { font-weight: 600; }
.menubar-menu { cursor: pointer; color: #888; font-size: 11px; }
.menubar-menu:hover { color: #ddd; }
.menubar .sys { cursor: pointer; font-size: 12px; }
.menubar-clock { font-size: 11px; color: #e8a030; }
.menu-dropdown { position: absolute; top: 26px; left: 0; background: #181818; border: 1px solid #2a2a2a; min-width: 140px; z-index: 5001; padding: 2px 0; }
.menu-dropdown .mi { padding: 4px 10px; cursor: pointer; font-size: 11px; display: flex; justify-content: space-between; }
.menu-dropdown .mi:hover { background: #e8a030; color: #111; }
.menu-dropdown .mi.disabled { color: #444; pointer-events: none; }
.menu-dropdown .sep { height: 1px; background: #2a2a2a; margin: 1px 0; }
.menu-dropdown .kbd { font-size: 9px; color: #555; }
.vol-pop, .notif-pop { position: absolute; top: 28px; right: 0; background: #181818; border: 1px solid #2a2a2a; padding: 8px; z-index: 5001; }
.vol-pop { width: 140px; }
.vol-pop input { width: 100%; }
.notif-pop { width: 240px; max-height: 260px; overflow-y: auto; }
.notif-pop .n-item { padding: 5px; border-bottom: 1px solid #222; font-size: 11px; }
.notif-pop .n-empty { color: #555; font-size: 11px; padding: 8px; text-align: center; }

/* windows */
.windows { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.window { position: absolute; pointer-events: auto; background: #161616; border: 1px solid #2a2a2a; display: flex; flex-direction: column; min-width: 260px; min-height: 160px; }
.window.focused { border-color: #3a3a3a; }
.window.maximized { border: none; }
.window.closing { opacity: 0; transition: opacity 0.12s; }
.window.opening { animation: pop-in 0.15s; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.wt { height: 26px; display: flex; align-items: center; padding: 0 6px; gap: 5px; background: #1c1c1c; border-bottom: 1px solid #2a2a2a; cursor: default; flex-shrink: 0; }
.wt .dots { display: flex; gap: 3px; }
.wt .dot { width: 7px; height: 7px; }
.wt .dot.close { background: #e05050; }
.wt .dot.min { background: #d4a020; }
.wt .dot.max { background: #30aa60; }
.wt .dot:hover { filter: brightness(1.3); }
.wt .wtitle { flex: 1; text-align: center; font-size: 11px; color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt .wapp-icon { font-size: 11px; }
.wbody { flex: 1; overflow: hidden; position: relative; }

/* resize handles */
.rsz { position: absolute; z-index: 5; }
.rsz.r { top: 2px; bottom: 2px; right: -2px; width: 4px; cursor: ew-resize; }
.rsz.b { left: 2px; right: 2px; bottom: -2px; height: 4px; cursor: ns-resize; }
.rsz.br { right: -2px; bottom: -2px; width: 6px; height: 6px; cursor: nwse-resize; }
.rsz.l { top: 2px; bottom: 2px; left: -2px; width: 4px; cursor: ew-resize; }
.rsz.t { left: 2px; right: 2px; top: -2px; height: 4px; cursor: ns-resize; }
.rsz.bl { left: -2px; bottom: -2px; width: 6px; height: 6px; cursor: nesw-resize; }
.rsz.tr { right: -2px; top: -2px; width: 6px; height: 6px; cursor: nesw-resize; }
.rsz.tl { left: -2px; top: -2px; width: 6px; height: 6px; cursor: nwse-resize; }

/* dock */
.dock { position: fixed; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 4000; display: flex; align-items: center; gap: 1px; padding: 3px 5px; background: #181818; border: 1px solid #2a2a2a; }
.dock.dock-left { left: 4px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; }
.dock.dock-right { right: 4px; left: auto; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; }
.dock-inner { display: flex; align-items: center; gap: 1px; }
.dock.dock-left .dock-inner, .dock.dock-right .dock-inner { flex-direction: column; }
.dock-sep { width: 1px; height: 24px; background: #2a2a2a; }
.dock.dock-left .dock-sep, .dock.dock-right .dock-sep { width: 24px; height: 1px; }
.dock-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: background 0.08s; position: relative; --mag: 1.0; }
.dock-icon:hover { background: #222; transform: scale(var(--mag)) translateY(-2px); }
.dock.dock-left .dock-icon:hover, .dock.dock-right .dock-icon:hover { transform: scale(var(--mag)) translateX(-2px); }
.dock-icon .dot-ind { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 8px; height: 2px; background: #e8a030; }
.dock.dock-left .dock-icon .dot-ind, .dock.dock-right .dock-icon .dot-ind { bottom: 50%; left: 0; transform: translateY(-50%); width: 2px; height: 8px; }
.dock-icon.bouncing { animation: dock-bounce 0.35s; }
@keyframes dock-bounce { 25% { transform: translateY(-10px); } 50% { transform: translateY(-2px); } 75% { transform: translateY(-5px); } }
.dock-icon .tooltip { position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%); background: #181818; border: 1px solid #2a2a2a; padding: 2px 5px; font-size: 9px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.08s; color: #999; }
.dock-icon:hover .tooltip { opacity: 1; }
.dock.dock-left .dock-icon .tooltip { bottom: auto; top: 50%; left: 38px; transform: translateY(-50%); }
.dock.dock-right .dock-icon .tooltip { bottom: auto; top: 50%; left: auto; right: 38px; transform: translateY(-50%); }
.dock-trash { font-size: 16px; cursor: pointer; padding: 3px; }

/* boot */
.boot { position: fixed; inset: 0; z-index: 99999; background: #0d0d0d; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.boot-logo { font-family: Consolas, monospace; font-size: 10px; color: #e8a030; white-space: pre; }
.boot-log { font-family: Consolas, monospace; font-size: 10px; color: #555; max-width: 440px; max-height: 120px; overflow: hidden; }
.boot-bar { width: 180px; height: 2px; background: #222; }
.boot-bar-fill { height: 100%; background: #e8a030; transition: width 0.1s; }
.boot-status { font-size: 11px; color: #999; margin-top: 6px; }

/* lock */
.lock { position: fixed; inset: 0; z-index: 99998; background: #0d0d0d; display: flex; align-items: center; justify-content: center; }
.lock-inner { text-align: center; }
.lock-clock { font-size: 44px; font-weight: 200; }
.lock-date { font-size: 12px; color: #666; margin-top: 4px; }
.lock-user { margin-top: 20px; }
.lock-avatar { font-size: 22px; color: #e8a030; }
.lock-name { font-size: 11px; color: #555; margin-top: 4px; }
.lock-pass { margin-top: 14px; padding: 6px 10px; font-size: 12px; }
.lock-unlock { margin-top: 6px; background: #e8a030; color: #111; padding: 5px 14px; font-size: 11px; font-weight: 600; }
.lock-unlock:hover { background: #d49020; }
.lock-hint { font-size: 9px; color: #444; margin-top: 10px; }

/* context menu */
.ctx-menu { position: fixed; z-index: 9999; background: #181818; border: 1px solid #2a2a2a; min-width: 130px; padding: 1px 0; }
.ci { padding: 4px 10px; cursor: pointer; font-size: 11px; }
.ci:hover:not(.disabled) { background: #e8a030; color: #111; }
.ci.disabled { opacity: 0.3; cursor: default; }

/* spotlight */
.spotlight { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.75); display: flex; align-items: flex-start; justify-content: center; padding-top: 70px; }
.spot-inner { width: 420px; }
#spot-input { width: 100%; background: #1a1a1a; border: 1px solid #333; padding: 7px 10px; font-size: 13px; }
#spot-results { background: #181818; border: 1px solid #2a2a2a; border-top: none; }
.spot-row { padding: 5px 10px; cursor: pointer; font-size: 12px; }
.spot-row:hover, .spot-row.sel { background: #e8a030; color: #111; }

/* notifications */
.notif-area { position: fixed; top: 30px; right: 6px; z-index: 9998; display: flex; flex-direction: column; gap: 3px; }
.toast { background: #181818; border: 1px solid #2a2a2a; padding: 6px 10px; font-size: 11px; min-width: 180px; animation: slide-in 0.15s; }
.toast.success { border-left: 2px solid #30aa60; }
.toast.warning { border-left: 2px solid #d4a020; }
.toast.error { border-left: 2px solid #e05050; }
.toast.info { border-left: 2px solid #4a9ad4; }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; } }

/* alt+tab switcher */
.switcher { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; }
.switcher-inner { display: flex; gap: 6px; }
.sw-item { background: #181818; border: 1px solid #2a2a2a; padding: 10px 14px; font-size: 12px; min-width: 90px; text-align: center; }
.sw-item.sel { border-color: #e8a030; }

/* easter eggs */
body.noclip-mode .window { opacity: 0.4; }
body.barrel-roll { animation: barrel 1.2s ease-in-out; }
@keyframes barrel { to { transform: rotate(360deg); } }

/* ============ APPS ============ */

/* terminal */
.term { padding: 6px; font-size: 12px; height: 100%; overflow-y: auto; font-family: Consolas, monospace; }
.term .prompt { color: #30aa60; }
.term .err { color: #e05050; }
.input-line { display: flex; align-items: center; }
.input-line input { flex: 1; background: transparent; border: none; padding: 0; }

/* explorer */
.explorer { display: flex; height: 100%; }
.explorer-side { width: 130px; border-right: 1px solid #222; padding: 4px; overflow-y: auto; }
.explorer-tree-item { padding: 2px 5px; cursor: pointer; font-size: 11px; color: #999; }
.explorer-tree-item:hover { background: #1c1c1c; }
.explorer-tree-item.active { color: #e8a030; }
.explorer-main { flex: 1; padding: 6px; overflow-y: auto; }
.explorer-toolbar { display: flex; gap: 4px; padding: 4px 0; font-size: 11px; color: #888; }
.explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, 68px); grid-auto-rows: 76px; gap: 4px; }
.ficon { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 4px; }
.ficon:hover { background: #1c1c1c; }
.ficon .ico { font-size: 26px; }
.ficon .lbl { font-size: 9px; text-align: center; color: #999; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* editor */
.editor { display: flex; flex-direction: column; height: 100%; }
.editor-toolbar { height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 6px; border-bottom: 1px solid #222; font-size: 11px; }
.editor-main { flex: 1; display: flex; overflow: hidden; }
.editor-gutter { width: 34px; background: #131313; padding: 4px 4px; font-size: 11px; color: #444; text-align: right; overflow: hidden; font-family: Consolas, monospace; }
.editor-area { flex: 1; background: transparent; border: none; resize: none; padding: 4px 6px; font-size: 12px; line-height: 1.5; font-family: Consolas, monospace; white-space: pre; overflow: auto; }
.editor-minimap { width: 70px; background: #131313; border-left: 1px solid #222; overflow: hidden; }
.editor-find { padding: 4px 6px; background: #1c1c1c; border-bottom: 1px solid #222; display: flex; gap: 4px; align-items: center; }
.editor-find input { flex: 1; }

/* notes */
.notes { display: flex; height: 100%; }
.notes-side { width: 140px; border-right: 1px solid #222; padding: 4px; overflow-y: auto; }
.notes-list-item { padding: 5px 6px; cursor: pointer; }
.notes-list-item:hover { background: #1c1c1c; }
.notes-list-item.active { background: #252525; }
.notes-list-item .title { font-size: 11px; font-weight: 600; }
.notes-list-item .preview { font-size: 10px; color: #555; margin-top: 2px; }
.notes-main { flex: 1; display: flex; flex-direction: column; }
.notes-toolbar { height: 26px; display: flex; align-items: center; gap: 4px; padding: 0 6px; border-bottom: 1px solid #222; }
.notes-title-input { flex: 1; background: transparent; border: none; font-size: 13px; font-weight: 600; }
.notes-body { flex: 1; display: flex; }
.notes-editor { flex: 1; background: transparent; border: none; resize: none; padding: 6px; font-size: 12px; line-height: 1.5; }
.notes-preview { flex: 1; padding: 6px; border-left: 1px solid #222; font-size: 12px; line-height: 1.5; overflow-y: auto; }
.notes-preview h1, .notes-preview h2 { margin: 6px 0 3px; color: #e8a030; }
.notes-preview p { margin: 3px 0; }
.notes-preview code { background: #1a1a1a; padding: 1px 3px; font-size: 11px; }

/* calc */
.calc { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.calc-display { background: #1a1a1a; padding: 6px; text-align: right; }
.calc-display .expr { font-size: 11px; color: #555; min-height: 14px; }
.calc-display .val { font-size: 18px; }
.calc-toggle { display: flex; gap: 3px; }
.calc-toggle button { padding: 2px 6px; background: #1a1a1a; border: 1px solid #333; font-size: 10px; }
.calc-toggle button.active { background: #e8a030; border-color: #e8a030; color: #111; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.calc-grid button { background: #1a1a1a; border: 1px solid #2a2a2a; padding: 8px; font-size: 13px; }
.calc-grid button:hover { background: #222; }
.calc-grid button.op { color: #4a9ad4; }
.calc-grid button.clear { color: #e05050; }
.calc-grid button.eq { background: #e8a030; border-color: #e8a030; color: #111; }
.calc-history { flex: 1; overflow-y: auto; font-size: 11px; color: #555; }
.calc-history div { padding: 2px 0; border-bottom: 1px solid #1a1a1a; }

/* monitor */
.monitor { padding: 10px; display: flex; flex-direction: column; gap: 10px; height: 100%; overflow-y: auto; }
.monitor-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.monitor-chart { background: #1a1a1a; border: 1px solid #2a2a2a; padding: 4px; height: 90px; }
.monitor-procs { flex: 1; }
.monitor-procs table { width: 100%; font-size: 11px; border-collapse: collapse; }
.monitor-procs th { text-align: left; padding: 3px 5px; border-bottom: 1px solid #2a2a2a; color: #666; font-weight: 500; }
.monitor-procs td { padding: 2px 5px; border-bottom: 1px solid #1a1a1a; }
.monitor-procs .kill-btn { color: #e05050; cursor: pointer; font-size: 10px; }
.monitor-procs .kill-btn:hover { text-decoration: underline; }

/* settings */
.settings { display: flex; height: 100%; }
.settings-side { width: 110px; border-right: 1px solid #222; padding: 4px; }
.s-item { padding: 4px 6px; cursor: pointer; font-size: 11px; color: #888; }
.s-item:hover { background: #1c1c1c; }
.s-item.active { background: #e8a030; color: #111; }
.settings-main { flex: 1; padding: 10px; overflow-y: auto; }
.setting-group { margin-bottom: 14px; }
.setting-group h3 { font-size: 10px; color: #e8a030; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.swatches { display: flex; gap: 5px; }
.swatch { width: 24px; height: 24px; cursor: pointer; border: 2px solid transparent; }
.swatch.active { border-color: #ddd; }
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.wall-thumb { width: 100%; aspect-ratio: 16/9; cursor: pointer; border: 2px solid transparent; }
.wall-thumb.active { border-color: #e8a030; }
.toggle { width: 30px; height: 14px; background: #2a2a2a; cursor: pointer; position: relative; }
.toggle.on { background: #e8a030; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: #ddd; transition: transform 0.1s; }
.toggle.on::after { transform: translateX(16px); }

/* about */
.about { padding: 20px; text-align: center; height: 100%; overflow-y: auto; }
.about-logo { font-size: 32px; color: #e8a030; margin-bottom: 6px; }
.about-name { font-size: 15px; font-weight: 700; }
.about-tagline { font-size: 11px; color: #555; margin-top: 3px; }
.about-specs { margin-top: 20px; font-size: 11px; color: #999; line-height: 1.8; }
.about-credits { margin-top: 20px; font-size: 10px; color: #444; }

/* ============ FPS MODE ============ */

body.fps-mode .desktop,
body.fps-mode .dock,
body.fps-mode .menubar,
body.fps-mode .switcher { opacity: 0; pointer-events: none; }

#fps-hud { position: fixed; inset: 0; z-index: 99999; pointer-events: none; cursor: crosshair; }
#fps-crosshair-canvas { position: absolute; pointer-events: none; z-index: 100002; }
#fps-gun-canvas { position: absolute; bottom: -20px; right: 12%; pointer-events: none; z-index: 99998; transition: transform 0.06s; }

.fps-hud-bottom { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 16px; align-items: center; background: #161616; border: 1px solid #2a2a2a; padding: 5px 12px; }
.fps-stat { display: flex; flex-direction: column; align-items: center; }
.fps-label { font-size: 7px; color: #555; text-transform: uppercase; letter-spacing: 1px; }
.fps-stat span:last-child { font-size: 14px; color: #e8a030; }
.fps-health { width: 80px; height: 4px; background: #2a2a2a; }
.fps-health-bar { height: 100%; width: 100%; background: #30aa60; transition: width 0.2s; }

.fps-enemy { position: absolute; width: 64px; height: 72px; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: auto; cursor: crosshair; }
.fps-enemy-body { width: 48px; height: 48px; background: #1a1a1a; border: 1px solid var(--enemy-color); display: flex; align-items: center; justify-content: center; }
.fps-enemy-emoji { font-size: 22px; }
.fps-enemy-shape { display: none; }
.fps-enemy-name { font-size: 7px; color: var(--enemy-color); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.fps-enemy-hp { width: 40px; height: 2px; background: #222; }
.fps-enemy-hp-bar { height: 100%; width: 100%; background: var(--enemy-color); transition: width 0.15s; }
.fps-enemy-hit { animation: fps-hit 0.12s; }
@keyframes fps-hit { to { filter: brightness(2); } }
.fps-enemy-dying { animation: fps-die 0.3s forwards; }
@keyframes fps-die { to { transform: scale(0); opacity: 0; } }
.fps-enemy-spawn { animation: fps-spawn 0.4s; }
@keyframes fps-spawn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fps-enemy-bg { opacity: 0.3; pointer-events: none; }

.fps-hit-marker { position: absolute; transform: translate(-50%, -50%); font-size: 20px; color: #fff; pointer-events: none; z-index: 100001; }
.fps-hit-marker.hidden { display: none; }
.fps-bullet-impact { position: absolute; width: 6px; height: 6px; background: #e8a030; transform: translate(-50%, -50%); }
.fps-damage-flash { display: none; }
