:root { color-scheme:light; --phosphor:#8bfb5e; }
html, body.retro-video { width:100%; height:100%; min-height:100%; overflow:hidden; background:#fff; }
body.retro-video { color:#161616; font-family:Consolas,'Liberation Mono',monospace; }
body.retro-video .site-header { position:absolute; top:0; left:50%; transform:translateX(-50%); width:min(1120px,100%); z-index:5; transition:opacity .35s,translate .5s; }
body.retro-video .site-header nav a { font-size:15px; min-height:40px; }
body.retro-video .site-header nav a.active { color:#7b7b7b; }
.retro-video main { position:relative; width:100%; height:100%; }
.scene-shell { position:absolute; inset:0; overflow:hidden; background:#fff; touch-action:pan-y; }
#computer-scene { display:block; width:100%; height:100%; touch-action:none; cursor:grab; -webkit-tap-highlight-color:transparent; outline:none; }
#computer-scene:focus-visible { outline:1px dotted #bbb; outline-offset:-8px; }
#computer-scene.pointer-focus { outline:none; }
.start-computer { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.start-computer:focus-visible { width:auto; height:auto; left:50%; bottom:25px; transform:translateX(-50%); clip-path:none; margin:0; padding:10px 16px; background:#eeeadd; color:#30382e; border:1px solid #acae9c; border-radius:20px; z-index:8; }
body[data-state="opening"] .site-header,body[data-state="on"] .site-header,body[data-state="closing"] .site-header { opacity:0; translate:0 -20px; pointer-events:none; visibility:hidden; }
body.retro-video:not([data-state="off"]) .language-switch { visibility:hidden; pointer-events:none; }
.screen-panel { position:absolute; overflow:hidden; background:#090e0c; color:var(--phosphor); border-radius:4px; isolation:isolate; }
.idle-screen { display:flex; align-items:center; justify-content:center; width:100%; height:100%; padding:8%; background:radial-gradient(ellipse at 50% 40%,#121c16,#080c0a); }
.idle-screen p { color:var(--phosphor); font:400 clamp(11px,1.8vw,23px)/1.6 Consolas,'Liberation Mono',monospace; text-shadow:0 0 10px #76ff6b65; text-align:left; }
.terminal-cursor { display:inline-block; width:.5em; height:1em; vertical-align:-.12em; margin-left:.5em; background:var(--phosphor); opacity:0; }
.terminal-cursor.blinking { opacity:1; animation:blink 1.25s step-end infinite; }
#prompt-dots { display:inline-block; width:1.8em; }
@keyframes blink { 50% { opacity:0; } }
.screen-glass { position:absolute; inset:0; pointer-events:none; z-index:2; background:linear-gradient(145deg,#ffffff05,transparent 50%),repeating-linear-gradient(0deg,transparent 0,transparent 3px,#00000010 4px); box-shadow:inset 0 0 20px 8px #00000035; }
.screen-panel.playing .screen-glass { opacity:.23; }
#film { display:block; width:100%; height:100%; object-fit:contain; background:#050706; }
/* Minimal video overlay: fully absent during idle playback. */
.player-controls { position:absolute; z-index:8; inset:auto 0 0; width:100%; padding:22px 16px max(8px,env(safe-area-inset-bottom)); color:#fff; background:linear-gradient(transparent,#000b); border:0; border-radius:0; box-shadow:none; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .25s,visibility 0s .25s; font-family:Consolas,monospace; }
.player-controls.revealed { opacity:1; visibility:visible; pointer-events:auto; transition-delay:0s; }
.screen-panel.controls-idle { cursor:none; }
.control-row { position:relative; display:flex; min-height:40px; align-items:center; justify-content:space-between; }
.control-row button { display:grid; place-content:center; flex:none; width:38px; height:40px; min-height:40px; padding:8px; color:inherit; border:0; border-radius:0; background:transparent; box-shadow:none; cursor:pointer; }
.control-row button:hover { opacity:.65; }
.player-controls :focus-visible { outline:1px solid #fff; outline-offset:2px; }
.control-row button svg { display:block; width:20px; height:20px; fill:currentColor; }
.transport-controls { position:absolute; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:4px; }
.transport-controls #play-pause svg { width:24px; height:24px; }
.volume-group { display:flex; align-items:center; width:100px; gap:3px; }
.player-tools { display:flex; align-items:center; }
.player-timeline { display:flex; align-items:center; gap:10px; height:25px; }
.player-timeline output { flex:none; font:10px/1 Consolas,monospace; font-variant-numeric:tabular-nums; min-width:32px; color:#fff; }
.player-timeline #duration { text-align:right; }
.retro-video input[type="range"] { appearance:none; -webkit-appearance:none; background:transparent; cursor:pointer; height:28px; padding:0; margin:0; border:0; min-width:0; touch-action:none; }
.retro-video .seek { flex:1; width:0; }
.retro-video input[type="range"]::-webkit-slider-runnable-track { height:2px; background:#fff6; border:0; }
.retro-video input[type="range"]::-webkit-slider-thumb { appearance:none; width:8px; height:8px; margin-top:-3px; background:#fff; border:0; border-radius:50%; }
.retro-video input[type="range"]::-moz-range-track { height:2px; background:#fff6; border:0; }
.retro-video input[type="range"]::-moz-range-thumb { width:8px; height:8px; background:#fff; border:0; border-radius:50%; }
#volume { flex:1; width:0; }
.player-settings { position:absolute; bottom:88px; right:12px; width:155px; padding:10px; background:#111; color:#fff; border:1px solid #fff4; font:12px Consolas,monospace; }
.player-settings label { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.player-settings select { background:#111; color:inherit; border:1px solid #fff4; padding:4px; }
.floppy-inspector { position:fixed; inset:0; max-width:none; max-height:none; width:100%; height:100%; padding:0; margin:0; border:0; overflow:hidden; background:transparent; color:#536052; }
.floppy-inspector::backdrop { background:#fff; transition:background .45s; }
.floppy-inspector.returning::backdrop { background:#ffffff00; }
.floppy-view { position:absolute; width:min(88vw,82dvh,760px); aspect-ratio:1; left:0; right:0; top:0; bottom:0; margin:auto; transform-origin:center; }
.floppy-view canvas { width:100%; height:100%; display:block; touch-action:none; cursor:grab; outline:none; -webkit-tap-highlight-color:transparent; }
.floppy-view canvas:active { cursor:grabbing; }
.floppy-view canvas:focus-visible { outline:1px dotted #aaa; outline-offset:6px; }
.floppy-view canvas.pointer-focus { outline:none; }
.floppy-hint { position:absolute; bottom:max(24px,env(safe-area-inset-bottom)); width:100%; margin:0; text-align:center; color:#899087; font:11px Consolas,monospace; pointer-events:none; }
.floppy-close { position:absolute; right:20px; top:20px; width:40px; height:40px; padding:0; border:0; border-radius:50%; background:transparent; color:#7c8479; font:28px Arial,sans-serif; cursor:pointer; }
.floppy-inspector.returning .floppy-hint,.floppy-inspector.returning .floppy-close { opacity:0; }
@media(max-width:700px) {
 .player-controls { padding:18px 8px 5px; }
 .volume-group { width:34px; }
 #volume { display:none; }
 .control-row button { width:32px; height:40px; padding:6px; }
 .transport-controls { gap:0; }
 .player-timeline { gap:6px; }
 .floppy-view { width:min(96vw,82dvh); }
}

.power-off { position:absolute; z-index:6; width:44px; height:44px; min-height:44px; padding:10px; border:0; color:#4e5448; background:transparent; transform:translate(-50%,-50%); }
.power-off svg { display:block; width:100%; height:100%; }
.power-off:hover { color:#20261b; background:none; }
.power-off:focus-visible { outline:1px solid #47772d; outline-offset:-4px; }
.video-shelf { position:absolute; z-index:7; top:0; right:0; bottom:0; width:clamp(190px,21vw,280px); padding:28px 24px 28px 12px; display:flex; align-items:center; background:#fff; opacity:0; transform:translateX(20px); transition:opacity .3s,transform .45s; }
body[data-state="on"] .video-shelf { opacity:1; transform:none; }
.video-thumbnails { width:100%; display:flex; flex-direction:column; gap:22px; }
.video-thumb { width:100%; display:block; padding:0; border:0; background:none; color:#777; text-align:left; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.thumb-preview { display:block; width:100%; aspect-ratio:16/9; overflow:hidden; background:#f1f1f1; transition:opacity .2s; }
.thumb-preview img { display:block; width:100%; height:100%; object-fit:cover; }
.thumb-caption { display:block; padding-top:8px; font:12px/1.4 Consolas,monospace; }
.video-thumb:not(:disabled):hover .thumb-preview { opacity:.8; }
.video-thumb[aria-pressed="true"] { color:#111; }
.video-thumb[aria-pressed="true"] .thumb-caption { text-decoration:underline; text-underline-offset:4px; }
.video-thumb:focus-visible { outline:1px dotted #555; outline-offset:5px; }
.video-thumb:disabled { cursor:default; color:#666; opacity:1; }
.video-message { position:absolute; inset:40% 8% auto; z-index:5; text-align:center; color:#b2dba6; font:12px/1.5 Consolas,monospace; background:#080c0ae0; padding:12px; }
.scene-error { position:absolute; inset:42% 20% auto; text-align:center; font-size:13px; line-height:1.6; }
.scene-error button { display:block; margin:15px auto; background:#fff; border:1px solid #ddd; padding:8px 15px; }
.screen-panel:fullscreen { position:fixed!important; inset:0!important; width:100vw!important; height:100vh!important; border-radius:0; background:#000; }
.screen-panel:fullscreen .screen-glass { display:none; }

body.no-webgl[data-state="on"] .screen-panel { left:4%!important; top:10%!important; width:calc(92% - clamp(190px,21vw,280px))!important; height:75%!important; }
body.no-webgl .power-off { left:50%!important; top:90%!important; }
@media(max-width:700px) {
 .video-shelf { top:auto; left:0; right:0; bottom:0; width:100%; height:min(205px,26dvh); padding:18px 16px max(30px,env(safe-area-inset-bottom)); align-items:flex-start; transform:translateY(15px); }
 .video-thumbnails { flex-direction:row; gap:12px; }
 .video-thumb { flex:1; min-width:0; }
 .thumb-caption { font-size:10px; overflow-wrap:anywhere; }
 body.no-webgl[data-state="on"] .screen-panel { left:4%!important; top:8%!important; width:92%!important; height:60%!important; }
 body.no-webgl .power-off { top:72%!important; }
}
@media(max-height:570px) and (min-width:701px) { .video-thumbnails { gap:10px; } .video-shelf { width:190px; padding:12px 22px; } .thumb-preview { max-height:90px; } }
@media(prefers-reduced-motion:reduce) { .video-shelf,.thumb-preview,.player-controls { transition:none; } .terminal-cursor { animation:none; } }
[hidden] { display:none!important; }
