/* Sphinx OS: the cat DJ's computer, in the browser. Sits on top of site.css (same colours and fonts). */

body.os {
    height: 100vh; height: 100dvh; overflow: hidden;
    font-size: 16px; line-height: 1.45;
    user-select: none; -webkit-user-select: none;
    --accent: var(--green);
    --accent-rgb: 0, 255, 65;
    --pink: #ff3d7f;
    --bar: 46px;
}
body.os.theme-cyan { --accent: var(--cyan); --accent-rgb: 61, 242, 255; }
body.os.theme-violet { --accent: var(--violet); --accent-rgb: 183, 108, 255; }
.os h1, .os h2, .os h3 { margin: 0; text-shadow: none; }
.os h2::before { content: none; }
.os section { padding: 0; }
/* :where() keeps these resets weaker than any class, so .btn, .cmd and the rest win. */
:where(.os) :where(input, textarea, button) { font: inherit; color: inherit; }
:where(.os) button { cursor: pointer; background: none; border: 0; }
:where(.os) a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Wallpaper ---- */
#wall { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.55; transition: opacity 0.6s; }
/* Orbit: the Cyber Sphiiinx: The Game trailer picture. */
body.os.wall-orbit { background: #020502 url('/assets/img/videos/XvBlSxOer_M.webp') center / cover no-repeat; }
body.os.wall-orbit #wall { opacity: 0.22; }
/* My painting: SphinxPaint's 'Set as wallpaper' (the picture itself is set from os.js). */
body.os.wall-paint { background-color: #000; background-position: center; background-size: cover; background-repeat: no-repeat; }
body.os.wall-paint #wall { opacity: 0.16; }
/* The vault prize: the Vault Cracker wallpaper. */
body.os.wall-vault { background: #020502 url('/assets/img/vault/vault-cracker-desktop.jpg') center / cover no-repeat; }
body.os.wall-vault #wall { opacity: 0.18; }
body.os.storm #wall { opacity: 1; }
body.os.storm .win { opacity: 0.55; }
body.os::after { /* faint scanlines over everything */
    content: ''; position: fixed; inset: 0; z-index: 9000; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

/* ---- The cursor: a neon arrow, and a cat paw over anything you can click ---- */
body.os, body.os * { cursor: url('/assets/img/cursor/arrow.png') 2 2, default; }
body.os :is(button, a, label, select, summary, .icon, .tile, input[type=range], input[type=color], input[type=radio], input[type=checkbox], .skate canvas, .boot) { cursor: url('/assets/img/cursor/paw.png') 16 3, pointer; }
body.os :is(input[type=text], input[type=email], input:not([type]), textarea, .term, .term-out, .mail-read) { cursor: text; }
body.os .paint-canvas { cursor: crosshair; }
body.os { -webkit-touch-callout: none; }

/* ---- Right-click menu ---- */
.ctx { position: fixed; z-index: 7600; min-width: 210px; padding: 4px; background: #020a05; border: 1px solid var(--accent); border-radius: 7px; box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.25), 0 14px 40px #000; animation: pop 0.1s ease-out; }
.ctx[hidden] { display: none; }
.ctx button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 12px 7px 6px; border-radius: 4px; color: var(--text); font-size: 14px; text-align: left; white-space: nowrap; }
.ctx button.bold { font-weight: 700; color: var(--accent); }
.ctx button:hover, .ctx button:focus-visible { background: rgba(var(--accent-rgb), 0.16); outline: none; }
.ctx .chk { width: 1.1em; color: var(--accent); text-align: center; }
.ctx hr { border: 0; border-top: 1px solid rgba(var(--accent-rgb), 0.22); margin: 4px 6px; }
.icon.petted svg, .icon.petted img { animation: purr 0.12s linear 5; }
@keyframes purr { 50% { transform: translateX(2px) rotate(3deg); } }

/* ---- Boot ---- */
.boot { position: fixed; inset: 0; z-index: 8000; background: #000; display: flex; flex-direction: column; padding: 1.4rem; cursor: pointer; }
.boot pre { font-family: var(--mono); font-size: 15px; color: var(--green-soft); white-space: pre-wrap; flex: 1; overflow: hidden; }
.boot pre .ok { color: var(--green); }
.boot pre .warn { color: #ffd23d; }
.boot pre .hi { color: var(--cyan); }
.boot-go { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; background: radial-gradient(circle at 50% 45%, rgba(0, 255, 65, 0.12), #000 60%); }
.boot-go[hidden] { display: none; }
.boot-go img { width: 128px; height: 128px; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(0, 255, 65, 0.45)); }
.boot-go h1 { font-family: var(--pixel); font-size: clamp(1.4rem, 6vw, 2.4rem); color: var(--green); text-shadow: 0 0 16px rgba(0, 255, 65, 0.6); letter-spacing: 0.08em; }
.boot-go .boot-ver { color: var(--muted); }
.boot-go .btn { margin-top: 0.8rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 34px rgba(0, 255, 65, 0.75); } }
.boot.gone { opacity: 0; transition: opacity 0.45s; pointer-events: none; }

.shutdown { position: fixed; inset: 0; z-index: 8500; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; text-align: center; padding: 1.5rem; }
.shutdown p { color: var(--muted); }
.shutdown .buttons { margin-top: 0.6rem; }
.shutdown h2 { font-family: var(--pixel); color: var(--green); font-size: 1rem; }

/* ---- Desktop ---- */
.desktop { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: calc(var(--vvh, 100dvh) - var(--bar)); z-index: 1; }
.icons {
    position: absolute; inset: 0; padding: 14px 10px; display: grid;
    grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 104px); grid-auto-columns: 96px; gap: 6px 10px;
    align-content: start;
}
.icon {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 6px;
    color: var(--accent); border: 1px solid transparent; position: relative;
}
.icon svg, .icon img { width: 48px; height: 48px; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.45)); transition: transform 0.15s; }
.icon span { font-size: 13px; line-height: 1.2; color: var(--text); text-align: center; text-shadow: 0 1px 3px #000, 0 0 6px #000; word-break: break-word; }
.icon:hover, .icon:focus-visible { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.35); outline: none; }
.icon:hover svg, .icon:hover img { transform: translateY(-2px) scale(1.06); }
.icon:active svg { transform: scale(0.94); }
.icon.selected { background: rgba(var(--accent-rgb), 0.22); border-color: rgba(var(--accent-rgb), 0.75); }
.marquee { position: absolute; z-index: 2; border: 1px solid var(--accent); background: rgba(var(--accent-rgb), 0.14); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35); pointer-events: none; }
.icon .dot { position: absolute; top: 6px; right: 20px; width: 11px; height: 11px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }

/* ---- Windows ---- */
#windows { position: absolute; inset: 0; pointer-events: none; }
.win {
    position: absolute; display: flex; flex-direction: column; pointer-events: auto;
    min-width: 260px; min-height: 160px; max-width: 100%; max-height: 100%;
    background: #020a05; border: 1px solid rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.6);
    border-radius: 8px; overflow: hidden; resize: both;
    animation: pop 0.16s ease-out; transition: opacity 0.3s;
}
.win.focused { border-color: var(--accent); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75), 0 0 22px rgba(var(--accent-rgb), 0.28); }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.win[hidden] { display: none; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.win-bar {
    display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; height: 34px; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.05));
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.3); cursor: grab; touch-action: none;
}
.win-bar:active { cursor: grabbing; }
.win-bar svg, .win-bar img { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.win-bar h2 { flex: 1; font-family: var(--pixel); font-size: 10px; letter-spacing: 0.05em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win:not(.focused) .win-bar h2 { color: var(--muted); }
.win-btns { display: flex; gap: 2px; }
.win-btns button { width: 30px; height: 26px; border-radius: 4px; color: var(--muted); font-family: var(--mono); font-size: 16px; line-height: 1; }
.win-btns button:hover, .win-btns button:focus-visible { background: rgba(var(--accent-rgb), 0.18); color: var(--text); }
.win-btns button.x:hover, .win-btns button.x:focus-visible { background: var(--pink); color: #fff; }
.win-body { flex: 1; overflow: auto; position: relative; user-select: text; -webkit-user-select: text; }
.win-body::-webkit-scrollbar { width: 10px; height: 10px; }
.win-body::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.3); border-radius: 5px; }
.pad { padding: 16px; }
.win-body.locked { overflow: hidden; }

/* ---- Taskbar ---- */
.taskbar {
    position: fixed; left: 0; right: 0; top: calc(var(--vvt, 0px) + var(--vvh, 100dvh) - var(--bar)); height: var(--bar); z-index: 5000; margin: 0;
    display: flex; align-items: center; gap: 6px; padding: 0 6px;
    background: rgba(1, 6, 3, 0.94); border-top: 1px solid rgba(var(--accent-rgb), 0.4); backdrop-filter: blur(8px);
}
.start { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border-radius: 6px; border: 1px solid rgba(var(--accent-rgb), 0.5); background: rgba(var(--accent-rgb), 0.1); }
.start img { width: 24px; height: 24px; }
.start span { font-family: var(--pixel); font-size: 10px; color: var(--accent); }
.start:hover, .start[aria-expanded="true"] { background: rgba(var(--accent-rgb), 0.24); }
.tasks { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tasks button {
    display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; max-width: 170px; flex-shrink: 0;
    border-radius: 5px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent;
}
.tasks button svg, .tasks button img { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.tasks button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasks button:hover { background: rgba(var(--accent-rgb), 0.12); }
.tasks button.active { background: rgba(var(--accent-rgb), 0.16); color: var(--text); border-bottom-color: var(--accent); }
.tray { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding-right: 6px; }
.tray button { width: 34px; height: 34px; border-radius: 5px; display: grid; place-items: center; color: var(--accent); }
.tray button:hover { background: rgba(var(--accent-rgb), 0.12); }
.tray svg { width: 20px; height: 20px; }
.tray time { white-space: nowrap; }

.startmenu {
    position: fixed; left: 6px; bottom: calc(var(--bar) + 6px); z-index: 5001; width: min(320px, calc(100vw - 12px));
    max-height: calc(100dvh - var(--bar) - 20px); overflow: auto;
    background: rgba(2, 10, 5, 0.97); border: 1px solid var(--accent); border-radius: 8px;
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.25), 0 20px 50px #000; animation: pop 0.14s ease-out;
}
.startmenu[hidden] { display: none; }
.sm-head { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.25); }
.sm-head img { width: 44px; height: 44px; }
.sm-head b { display: block; font-family: var(--pixel); font-size: 11px; color: var(--accent); font-weight: 400; }
.sm-head small { color: var(--muted); font-size: 13px; }
.sm-list { list-style: none; padding: 6px; }
.sm-list button, .sm-list a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 5px; color: var(--text); text-align: left; font-size: 15px; }
.sm-list svg, .sm-list img { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }
.sm-list button:hover, .sm-list a:hover, .sm-list button:focus-visible, .sm-list a:focus-visible { background: rgba(var(--accent-rgb), 0.15); outline: none; }
.sm-foot { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(var(--accent-rgb), 0.25); }
.sm-foot a, .sm-foot button { flex: 1; padding: 8px; border-radius: 5px; text-align: center; font-size: 13px; color: var(--muted); border: 1px solid rgba(var(--accent-rgb), 0.25); }
.sm-foot a:hover, .sm-foot button:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.12); }

.toasts { position: fixed; right: 10px; bottom: calc(var(--bar) + 10px); z-index: 6000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { width: min(300px, calc(100vw - 20px)); padding: 12px 14px; background: rgba(2, 10, 5, 0.97); border: 1px solid var(--accent); border-left-width: 4px; border-radius: 6px; box-shadow: 0 10px 30px #000; animation: slide 0.25s ease-out; }
.toast b { display: block; font-family: var(--pixel); font-size: 10px; color: var(--accent); font-weight: 400; margin-bottom: 4px; }
.toast p { font-size: 14px; color: var(--text); }
.toast.out { opacity: 0; transform: translateX(30px); transition: 0.3s; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---- Terminal ---- */
.term { background: #010402; font-size: 15px; padding: 10px 12px 14px; cursor: text; display: flex; flex-direction: column; }
.term-out > div { white-space: pre-wrap; word-break: break-word; min-height: 1.45em; }
.term-out .dim { color: var(--muted); }
.term-out .acc { color: var(--accent); }
.term-out .cy { color: var(--cyan); }
.term-out .vi { color: var(--violet); }
.term-out .err { color: var(--pink); }
.term-out .ok { color: var(--green); }
.term-out .warn { color: #ffd23d; }
.term-out .big { font-family: var(--pixel); font-size: 12px; color: var(--accent); margin: 6px 0; }
.term-out a { text-decoration: underline; text-underline-offset: 3px; }
.cmd { color: var(--cyan); border-bottom: 1px dashed rgba(61, 242, 255, 0.5); padding: 0; }
.cmd:hover, .cmd:focus-visible { color: var(--text); background: rgba(61, 242, 255, 0.15); outline: none; }
.word { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); padding: 0 1px; }
.word:hover, .word:focus-visible { background: var(--accent); color: #000; outline: none; }
.word.used { color: var(--muted); background: none; text-decoration: line-through; }
.word:disabled { cursor: default; background: none; color: var(--muted); }
.term-line { display: flex; gap: 8px; align-items: baseline; }
.ps1 { color: var(--accent); white-space: nowrap; }
.ps1 i { font-style: normal; color: var(--cyan); }
.term-in { flex: 1; min-width: 0; background: none; border: 0; outline: none; caret-color: var(--accent); color: var(--text); font-size: 16px; padding: 0; }

/* ---- ICE Breaker ---- */
.ice { display: flex; flex-direction: column; height: 100%; }
.ice-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.2); font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.ice-top b { color: var(--text); font-weight: 400; }
.trace { flex: 1; min-width: 120px; height: 10px; background: rgba(255, 61, 127, 0.15); border-radius: 5px; overflow: hidden; }
.trace i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 0.1s linear, background 0.3s; }
.trace.low i { background: var(--pink); }
.ice-stage { flex: 1; display: grid; place-items: center; padding: 12px; position: relative; min-height: 0; }
.ice-grid { display: grid; gap: 3px; grid-auto-rows: 1fr; width: min(100%, 560px); }
.ice-stage { container-type: size; }
.ice-grid .tile { background: rgba(var(--accent-rgb), 0.05); border: 1px solid rgba(var(--accent-rgb), 0.15); border-radius: 4px; padding: 0; display: block; }
.ice-grid .tile:hover { background: rgba(var(--accent-rgb), 0.14); }
.ice-grid .tile svg { width: 100%; height: 100%; display: block; transition: transform 0.16s ease-out; }
.ice-grid .tile path { stroke: #2d5a44; stroke-width: 16; stroke-linecap: round; fill: none; }
.ice-grid .tile circle { fill: #2d5a44; }
.ice-grid .tile.live path { stroke: var(--accent); filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.9)); }
.ice-grid .tile.live circle { fill: var(--accent); }
.ice-grid .port { display: grid; place-items: center; font-family: var(--pixel); font-size: clamp(7px, 1.6vw, 10px); color: var(--cyan); text-align: center; }
.ice-grid .port.core { color: var(--violet); }
.ice-grid .port.core.on { color: var(--accent); text-shadow: 0 0 8px var(--accent); }
.ice-grid .port svg { width: 70%; height: 70%; }
.ice-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(1, 4, 2, 0.88); text-align: center; padding: 20px; }
.ice-cover[hidden] { display: none; }
.ice-cover h3 { font-family: var(--pixel); font-size: 14px; color: var(--accent); margin-bottom: 10px; }
.ice-cover h3.bad { color: var(--pink); }
.ice-cover p { color: var(--muted); max-width: 30rem; margin: 0 auto 16px; }
.ice-cover .btn { cursor: pointer; }

/* ---- Midnight Rush ---- */
.skate { background: #000; display: grid; place-items: center; container-type: size; touch-action: none; }
.skate canvas { display: block; width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9; outline: none; touch-action: none; cursor: pointer; }
.skate-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2, 4, 10, 0.72); text-align: center; padding: 18px; }
.skate-cover[hidden] { display: none; }
.skate-cover h3 { font-family: var(--pixel); font-size: clamp(14px, 3vw, 26px); color: var(--accent); text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.7); margin-bottom: 10px; }
.skate-cover h3.bad { color: var(--pink); text-shadow: 0 0 14px rgba(255, 61, 127, 0.7); }
.skate-cover .tag { color: var(--cyan); font-family: var(--pixel); font-size: 10px; margin-bottom: 12px; }
.skate-cover .rank { font-family: var(--pixel); font-size: 20px; color: #ffd23d; margin-bottom: 10px; }
.skate-cover p { color: var(--text); max-width: 34rem; margin: 0 auto 10px; }
.skate-cover p.small { color: var(--muted); font-size: 14px; }
.skate-cover b { color: var(--accent); font-weight: 400; }
.skate-cover .buttons { margin-top: 14px; }
.skate-cover .btn { cursor: pointer; }
.skate-cover { overflow: auto; }
/* The intro and the score screens: see-through, so the demo ride shows behind. */
.skate-cover.intro { background: linear-gradient(180deg, rgba(2, 4, 10, 0.7), rgba(2, 4, 10, 0.25) 60%, rgba(2, 4, 10, 0.55)); place-items: start center; padding-top: 4cqh; }
.sk-brand { display: flex; align-items: center; justify-content: center; gap: 0.6em; margin-bottom: 0.4em; font-family: var(--pixel); font-size: clamp(9px, 2.1cqw, 20px); color: var(--green); letter-spacing: 0.12em; text-shadow: 0 0 10px rgba(0, 255, 65, 0.7); }
.sk-brand img { width: 2.4em; height: 2.4em; filter: drop-shadow(0 0 8px rgba(0, 255, 65, 0.55)); }
.sk-logo { line-height: 1; margin-bottom: 10px; font-family: var(--pixel); }
.sk-logo span { display: block; font-size: clamp(20px, 6.4cqw, 66px); color: #e9fbff; letter-spacing: 0.04em; }
.sk-logo span:first-child { text-shadow: 0 0 6px #3df2ff, 0 0 22px #3df2ff, 0 0 44px rgba(61, 242, 255, 0.6); }
.sk-logo span:last-child { color: #ffe9f3; font-size: clamp(26px, 8.6cqw, 90px); transform: skewX(-8deg); text-shadow: 0 0 6px #ff3d7f, 0 0 24px #ff3d7f, 0 0 50px rgba(255, 61, 127, 0.6); animation: sk-flicker 5s infinite; }
@keyframes sk-flicker { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: 0.45; } }
.skate-cover.intro .buttons { gap: 10px; }
.sk-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: min(560px, 90cqw); margin: 6px auto 8px; text-align: left; }
.sk-tables h4 { font-family: var(--pixel); font-size: 11px; color: var(--cyan); margin-bottom: 6px; text-align: center; font-weight: 400; }
.sk-tables ol { list-style: none; background: rgba(2, 4, 10, 0.75); border: 1px solid rgba(var(--accent-rgb), 0.35); border-radius: 6px; padding: 6px; }
.sk-tables li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 6px; padding: 3px 6px; font-family: var(--pixel); font-size: clamp(9px, 1.5cqw, 12px); color: var(--text); border-radius: 3px; }
.sk-tables li i { font-style: normal; color: var(--muted); }
.sk-tables li:first-child b, .sk-tables li:first-child span { color: #ffd23d; }
.sk-tables li.me { background: var(--accent); animation: sk-me 0.8s steps(1) infinite; }
.sk-tables li.me, .sk-tables li.me i, .sk-tables li.me b, .sk-tables li.me span { color: #000; }
@keyframes sk-me { 50% { background: #ffd23d; } }
.skate-cover .hs { font-family: var(--pixel); font-size: 12px; color: #ffd23d; margin-top: 8px; }
.sk-name input { width: 5.2em; text-align: center; font-family: var(--pixel); font-size: 26px; letter-spacing: 0.3em; padding: 8px 4px 8px 12px; background: #000; color: var(--accent); border: 2px solid var(--accent); border-radius: 4px; text-transform: uppercase; }


/* ---- SphinxPaint ---- */
.paint { display: flex; flex-direction: column; height: 100%; }
.paint-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.2); }
.paint-tools, .paint-colors, .paint-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.paint-bar .tool { padding: 4px 9px; font-size: 13px; }
.paint-bar .tool.on { background: var(--accent); color: #000; border-color: var(--accent); }
.paint-bar .tool.hot { border-color: var(--accent); color: var(--accent); }
.swatch-btn { width: 22px; height: 22px; border-radius: 4px; border: 2px solid rgba(255, 255, 255, 0.18); padding: 0; }
.swatch-btn.on { border-color: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.paint-colors input[type=color] { width: 30px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; }
.paint-size { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.paint-size input { accent-color: var(--accent); width: 110px; }
.paint-size span { min-width: 2ch; color: var(--text); }
.paint-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px; background: #050807; container-type: size; }
.paint-canvas { width: min(100cqw, calc(100cqh * 1.6)); aspect-ratio: 8 / 5; border: 1px solid rgba(var(--accent-rgb), 0.3); cursor: crosshair; touch-action: none; display: block; }

/* ---- Karma Kat Games ---- */
.kk { display: flex; flex-direction: column; height: 100%; }
.kk-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.2); }
.kk-bar .tool { padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.kk-url { flex: 1; min-width: 0; padding: 4px 10px; border-radius: 14px; background: #010402; border: 1px solid rgba(var(--accent-rgb), 0.25); color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-url i { font-style: normal; }
.kk-stage { flex: 1; min-height: 0; position: relative; background: #fff; }
.kk-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kk-wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: #0b0614; color: var(--muted); }
.kk-wait[hidden] { display: none; }
.kk-wait img { width: 96px; height: 96px; animation: bob 2s ease-in-out infinite; }
.video-stage { background: #000; }
.gcard .art .art-img { width: 34%; height: auto; aspect-ratio: 1; }

/* ---- Music ---- */
.amp { display: grid; grid-template-columns: minmax(180px, 250px) 1fr; height: 100%; }
.amp-list { list-style: none; border-right: 1px solid rgba(var(--accent-rgb), 0.2); overflow: auto; padding: 6px; }
.amp-list li.label { font-family: var(--pixel); font-size: 9px; color: var(--cyan); padding: 10px 8px 6px; }
.amp-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 5px; text-align: left; }
.amp-list button img { width: 40px; height: 40px; border-radius: 3px; flex-shrink: 0; }
.amp-list button span { font-size: 14px; line-height: 1.25; }
.amp-list button small { display: block; color: var(--muted); font-size: 12px; }
.amp-list button:hover, .amp-list button[aria-current="true"] { background: rgba(var(--accent-rgb), 0.15); }
.amp-now { overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.amp-now > * { flex-shrink: 0; }
.amp-card { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.amp-card img { width: min(220px, 100%); aspect-ratio: 1; border-radius: 6px; box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.25); }
.amp-card h3 { font-family: var(--pixel); font-size: 13px; color: var(--accent); margin-bottom: 6px; line-height: 1.4; }
.amp-card p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.amp-card .btn { font-size: 10px; padding: 0.75rem 1rem; }
.viz { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.viz i { flex: 1; background: linear-gradient(0deg, var(--accent), var(--cyan)); border-radius: 2px 2px 0 0; height: 20%; animation: viz 0.9s ease-in-out infinite alternate; }
@keyframes viz { to { height: 100%; } }
.amp-now iframe { width: 100%; border: 0; border-radius: 12px; min-height: 152px; }

/* ---- Pictures ---- */
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; padding: 8px; }
.pics button { aspect-ratio: 1; overflow: hidden; border-radius: 4px; border: 1px solid rgba(var(--accent-rgb), 0.15); padding: 0; }
.pics button img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.pics button:hover img { transform: scale(1.06); }
.viewer { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px; gap: 6px; color: var(--muted); font-size: 14px; }
.viewer-bar button, .tool { padding: 6px 12px; border-radius: 4px; border: 1px solid rgba(var(--accent-rgb), 0.35); color: var(--text); font-size: 14px; }
.viewer-bar button:hover, .tool:hover { background: rgba(var(--accent-rgb), 0.15); }

/* ---- Lists, cards, mail, notepad, settings ---- */
.rows { list-style: none; display: grid; gap: 6px; }
.rows a, .rows button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 5px; border: 1px solid rgba(var(--accent-rgb), 0.18); color: var(--text); text-align: left; }
.rows a small, .rows button small { color: var(--muted); font-size: 13px; display: block; }
.rows a::after { content: '↗'; color: var(--accent); }
.rows a:hover, .rows button:hover { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.5); }
.group { font-family: var(--pixel); font-size: 9px; color: var(--cyan); margin: 16px 0 8px; }
.group:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gcard { border: 1px solid rgba(var(--accent-rgb), 0.2); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; background: rgba(var(--accent-rgb), 0.04); }
.gcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gcard .art { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--accent); background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), rgba(2, 10, 5, 0.9) 70%); }
.gcard .art svg { width: 38%; height: auto; filter: drop-shadow(0 0 14px rgba(var(--accent-rgb), 0.6)); }
.gcard div { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gcard h3 { font-family: var(--pixel); font-size: 10px; color: var(--accent); line-height: 1.5; }
.gcard p { font-size: 14px; color: var(--muted); flex: 1; }
.gcard .go { align-self: flex-start; font-size: 14px; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.4); padding: 4px 10px; border-radius: 4px; }
.gcard .go:hover { background: rgba(var(--accent-rgb), 0.15); }
.mail { display: grid; grid-template-columns: minmax(170px, 230px) 1fr; height: 100%; }
.mail-list { list-style: none; border-right: 1px solid rgba(var(--accent-rgb), 0.2); overflow: auto; }
.mail-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.1); }
.mail-list button b { display: block; font-weight: 400; color: var(--text); font-size: 14px; }
.mail-list button small { color: var(--muted); font-size: 13px; }
.mail-list button.unread b::before { content: '● '; color: var(--pink); }
.mail-list button:hover, .mail-list button[aria-current="true"] { background: rgba(var(--accent-rgb), 0.12); }
.mail-read { overflow: auto; padding: 16px 18px; }
.mail-read .from { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.mail-read h3 { font-size: 18px; color: var(--accent); margin-bottom: 12px; }
.mail-read p { margin-bottom: 10px; }
.mail-form { display: grid; gap: 8px; margin-top: 12px; max-width: 26rem; }
.mail-form label { font-size: 13px; color: var(--muted); }
.mail-form input { background: #010402; border: 1px solid rgba(var(--accent-rgb), 0.45); border-radius: 4px; padding: 10px; color: var(--text); }
.mail-form .btn { justify-content: center; cursor: pointer; }
.fine { font-size: 12px; color: var(--muted); }
.notepad { display: flex; flex-direction: column; height: 100%; }
.notepad .toolbar { display: flex; gap: 6px; padding: 6px 8px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.2); align-items: center; font-size: 13px; color: var(--muted); }
.notepad .toolbar span { margin-left: auto; }
.notepad textarea { flex: 1; resize: none; border: 0; outline: none; background: #010402; padding: 14px; line-height: 1.6; font-size: 15px; color: var(--text); }
.opts { display: grid; gap: 8px; }
.opts label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(var(--accent-rgb), 0.18); border-radius: 5px; cursor: pointer; }
.opts label:hover { background: rgba(var(--accent-rgb), 0.08); }
.opts input { accent-color: var(--accent); width: 18px; height: 18px; }
.swatch { width: 26px; height: 18px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.2); }
.vault-lock { text-align: center; padding: 26px 16px; }
.vault-lock svg { width: 84px; height: 84px; margin: 0 auto 12px; display: block; color: var(--pink); }
.vault-lock h3 { font-family: var(--pixel); font-size: 13px; color: var(--pink); margin-bottom: 10px; }
.vault-lock.open svg, .vault-lock.open h3 { color: var(--accent); }
.vault-lock p { color: var(--muted); max-width: 28rem; margin: 0 auto 12px; }
.say { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--accent); background: rgba(var(--accent-rgb), 0.07); font-size: 14px; }
.say[hidden] { display: none; }
.vault-prize { padding-top: 0; display: grid; gap: 12px; }
.vault-preview { justify-self: center; width: min(100%, 420px); padding: 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--accent); box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.35); }
.vault-preview img { width: 100%; height: auto; display: block; transition: transform 0.25s; }
.vault-preview:hover img { transform: scale(1.03); }
.vault-prize .btn { cursor: pointer; font-size: 10px; padding: 0.75rem 1rem; }
.vault-prize .group { margin: 6px 0 0; }

/* ---- meow.exe ---- */
.pet { position: fixed; left: 0; top: 0; width: 84px; height: 84px; z-index: 7000; cursor: pointer; filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.8)); }

/* ---- Small screens: every window fills the desktop ---- */
@media (max-width: 720px) {
    .icons { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); grid-template-rows: none; grid-auto-rows: 100px; grid-auto-columns: auto; overflow: auto; }
    .win { resize: none; }
    .win-bar { cursor: default; }
    .start span { display: none; }
    .tasks button span { display: none; }
    .amp, .mail { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .amp-list, .mail-list { border-right: 0; border-bottom: 1px solid rgba(var(--accent-rgb), 0.2); max-height: 34vh; }
    .tray time { font-size: 12px; }
}

/* Touch screens: fingers need bigger targets. */
@media (pointer: coarse) {
    body.os { --bar: 52px; }
    .win-bar { height: 44px; }
    .win-bar h2 { font-size: 11px; }
    .win-btns button { width: 44px; height: 38px; font-size: 20px; }
    .start, .tasks button { height: 42px; }
    .tray button { width: 42px; height: 42px; }
    .sm-list button, .sm-list a { padding: 11px 10px; }
    .ctx button { padding: 12px 14px 12px 8px; font-size: 15px; }
    .tool, .paint-bar .tool, .kk-bar .tool { padding: 8px 12px; }
    .swatch-btn { width: 30px; height: 30px; }
    .cmd, .word { padding: 2px 3px; }
    .term-in { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .win, .startmenu, .toast { animation: none; }
    .viz i, .boot-go img, .boot-go .btn { animation: none; }
}

.nojs { position: fixed; inset: 0; z-index: 9999; background: #000; display: grid; place-items: center; text-align: center; padding: 2rem; }
