/* polices embarquées (licence OFL, voir fonts/) : le jeu marche hors ligne et sans appel externe */
@font-face { font-family: 'VT323'; src: url('fonts/vt323.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Share Tech Mono'; src: url('fonts/share-tech-mono.woff2') format('woff2'); font-display: swap; }

:root {
  --neon: #ff2fd6;
  --cyan: #2ff2ff;
  --amber: #ffb52f;
  --bg: #05020c;
  --panel: rgba(8, 4, 24, 0.86);
  --text: #e9e3ff;
  --mono: 'Share Tech Mono', 'VT323', monospace;
  --pixel: 'VT323', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--mono);
  user-select: none;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* CRT overlay */
#crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: multiply;
}
#crt::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

.hidden { display: none !important; }

kbd {
  display: inline-block; padding: 0 6px; border: 1px solid var(--cyan);
  color: var(--cyan); border-radius: 2px; font-family: var(--mono); font-size: 0.9em;
  box-shadow: 0 0 6px rgba(47,242,255,0.35);
}

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: 15px; }
#hud-top { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; justify-content: space-between; }
.hud-box {
  background: var(--panel); border: 1px solid var(--neon); padding: 8px 14px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--neon) 35%, transparent), inset 0 0 12px color-mix(in srgb, var(--neon) 8%, transparent);
  display: flex; flex-direction: column; gap: 2px; min-width: 160px;
}
.hud-label { font-size: 11px; letter-spacing: 3px; color: var(--neon); opacity: 0.9; }
#hud-location-name, #hud-signal-value { font-family: var(--pixel); font-size: 24px; color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }

#hud-ship { position: absolute; bottom: 70px; left: 18px; display: flex; flex-direction: column; gap: 8px; width: 240px; }
.gauge .bar { height: 10px; border: 1px solid var(--cyan); background: rgba(0,0,0,0.5); margin-top: 3px; }
.gauge .bar > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--neon)); box-shadow: 0 0 10px var(--cyan); transition: width 0.08s linear; }

#hud-prompt {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--cyan); padding: 8px 16px;
  font-family: var(--pixel); font-size: 22px; color: var(--cyan);
  box-shadow: 0 0 14px rgba(47,242,255,0.4);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.6 } }

#hud-hint {
  position: absolute; left: 50%; top: 90px; transform: translateX(-50%);
  font-family: var(--pixel); font-size: 22px; color: var(--amber); text-shadow: 0 0 10px var(--amber);
  opacity: 0; transition: opacity 0.4s; text-align: center; max-width: 80vw;
}
#hud-hint.show { opacity: 1; }

#hud-help { position: absolute; bottom: 18px; left: 18px; right: 18px; text-align: center; color: rgba(233,227,255,0.55); font-size: 13px; }

/* Dialogue */
#dialogue {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  width: min(860px, 92vw); z-index: 20;
  background: var(--panel); border: 1px solid var(--neon);
  box-shadow: 0 0 24px rgba(255,47,214,0.35), inset 0 0 20px rgba(255,47,214,0.06);
  padding: 18px 24px 34px;
}
#dialogue-name { font-size: 12px; letter-spacing: 4px; color: var(--neon); margin-bottom: 8px; }
#dialogue-text { font-family: var(--pixel); font-size: 26px; line-height: 1.25; min-height: 2.6em; color: var(--text); }
#dialogue-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
#dialogue-choices button {
  text-align: left; background: transparent; border: 1px solid rgba(47,242,255,0.4); color: var(--cyan);
  font-family: var(--pixel); font-size: 22px; padding: 6px 12px; cursor: pointer;
}
#dialogue-choices button:hover, #dialogue-choices button.sel { border-color: var(--cyan); background: rgba(47,242,255,0.12); box-shadow: 0 0 10px rgba(47,242,255,0.4); }
#dialogue-next { position: absolute; right: 16px; bottom: 8px; font-size: 13px; color: var(--cyan); animation: pulse 1.2s infinite; }

/* Panels */
#journal, #keypad, #help, #multiverse, #map, #dev { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(2,0,8,0.55); }
.panel {
  width: min(760px, 92vw); max-height: 86vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--cyan); padding: 24px 32px;
  box-shadow: 0 0 30px rgba(47,242,255,0.3), inset 0 0 30px rgba(47,242,255,0.05);
}
.panel.small { width: min(420px, 92vw); text-align: center; }
.panel h2 { margin: 0 0 16px; font-family: var(--pixel); font-size: 34px; color: var(--cyan); letter-spacing: 3px; text-shadow: 0 0 12px var(--cyan); }
.panel h3 { margin: 0 0 8px; color: var(--neon); font-size: 14px; letter-spacing: 3px; }
.panel p { margin: 4px 0; font-size: 15px; }
.panel-foot { margin-top: 16px !important; color: rgba(233,227,255,0.6); font-size: 13px !important; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.journal-entry { border-left: 2px solid var(--neon); padding: 6px 12px; margin-bottom: 12px; }
.journal-entry h4 { margin: 0 0 4px; font-family: var(--pixel); font-size: 22px; color: var(--amber); }
.journal-entry p { margin: 0; color: rgba(233,227,255,0.85); }
.journal-empty { color: rgba(233,227,255,0.5); font-style: italic; }

#keypad-display { font-family: var(--pixel); font-size: 48px; color: var(--amber); letter-spacing: 12px; margin: 8px 0 16px; text-shadow: 0 0 12px var(--amber); }
#keypad-display.err { color: #ff3b3b; animation: shake 0.3s; }
#keypad-display.ok { color: #4dff8a; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
#keypad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#keypad-keys button {
  background: transparent; border: 1px solid var(--cyan); color: var(--cyan);
  font-family: var(--pixel); font-size: 28px; padding: 8px; cursor: pointer;
}
#keypad-keys button:hover { background: rgba(47,242,255,0.15); box-shadow: 0 0 10px var(--cyan); }

/* Title */
#title {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(5,2,12,0.72) 0%, rgba(5,2,12,0.25) 38%, rgba(5,2,12,0.25) 62%, rgba(5,2,12,0.85) 100%);
  transition: opacity 0.8s;
}
#title.fade { opacity: 0; pointer-events: none; }
#title-inner { text-align: center; }
#title-logo {
  font-family: var(--pixel); font-size: clamp(56px, 12vw, 120px); color: var(--cyan); letter-spacing: 6px;
  text-shadow: 0 0 20px var(--cyan), 0 0 60px rgba(47,242,255,0.5);
  animation: flicker 4s infinite;
}
#title-logo span { color: var(--neon); text-shadow: 0 0 20px var(--neon); }
@keyframes flicker { 0%,97%,100%{opacity:1} 98%{opacity:0.6} 99%{opacity:0.9} }
#title-sub { margin: 8px 0 32px; font-size: 16px; color: rgba(233,227,255,0.75); letter-spacing: 1px; }
#title-start, #title-continue {
  background: transparent; border: 1px solid var(--neon); color: var(--neon);
  font-family: var(--pixel); font-size: 30px; padding: 12px 32px; cursor: pointer; letter-spacing: 2px;
  box-shadow: 0 0 20px rgba(255,47,214,0.4);
  transition: all 0.2s;
}
#title-start:hover, #title-continue:hover { background: rgba(255,47,214,0.15); color: #fff; box-shadow: 0 0 30px var(--neon); }
#title-foot { margin-top: 24px; font-size: 12px; color: rgba(233,227,255,0.4); letter-spacing: 2px; }

/* Première personne */
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%);
  pointer-events: none;
}
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: var(--cyan); opacity: 0.8; box-shadow: 0 0 6px var(--cyan);
}
#crosshair::before { left: 6px; top: 0; width: 2px; height: 14px; }
#crosshair::after { top: 6px; left: 0; width: 14px; height: 2px; }
#lock-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  pointer-events: auto; cursor: pointer;
  background: var(--panel); border: 1px solid var(--amber); color: var(--amber);
  font-family: var(--pixel); font-size: 24px; padding: 10px 22px;
  box-shadow: 0 0 16px rgba(255,181,47,0.4);
}

/* Multivers */
.panel-sub { color: rgba(233,227,255,0.7); margin-bottom: 16px !important; }
#multiverse-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.uni {
  --c: var(--cyan);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name coords" "tag tag";
  text-align: left; background: rgba(0,0,0,0.35); border: 1px solid var(--c); color: var(--text);
  padding: 12px 16px; cursor: pointer; transition: all 0.15s; font-family: var(--mono);
}
.uni:hover { background: color-mix(in srgb, var(--c) 15%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 50%, transparent); }
.uni.current { opacity: 0.45; cursor: default; }
.uni.current .uni-name::after { content: ' · ICI'; font-size: 18px; opacity: 0.8; }
.uni-name { grid-area: name; font-family: var(--pixel); font-size: 28px; color: var(--c); text-shadow: 0 0 10px var(--c); }
.uni-coords { grid-area: coords; font-size: 12px; letter-spacing: 2px; color: rgba(233,227,255,0.55); align-self: center; }
.uni-tag { grid-area: tag; font-size: 14px; color: rgba(233,227,255,0.8); margin-top: 4px; }

/* Navigation vaisseau */
#hud-nav {
  position: absolute; right: 18px; bottom: 70px; width: 260px;
  background: var(--panel); border: 1px solid var(--cyan); padding: 8px 12px;
  box-shadow: 0 0 12px rgba(47,242,255,0.3);
}
#hud-nav .hud-label { color: var(--cyan); }
.nav-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 20px; margin-top: 4px; }
.nav-row .arrow { display: inline-block; width: 22px; height: 22px; text-align: center; color: var(--amber); text-shadow: 0 0 8px var(--amber); transition: transform 0.1s linear; }
.nav-row .name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-row .dist { color: rgba(233,227,255,0.6); font-size: 16px; }
.nav-row.near .name { color: #4dff8a; }

/* Cockpit */
#cockpit { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#cockpit .canopy {
  position: absolute; left: 0; right: 0; top: 0; height: 7%;
  background: linear-gradient(180deg, #07041a 0%, #0c0824 70%, transparent 100%);
}
#cockpit .strut {
  position: absolute; top: 0; bottom: 0; width: 18%;
  background: linear-gradient(90deg, #07041a 0%, #0c0824 45%, transparent 100%);
  clip-path: polygon(0 0, 100% 0, 40% 100%, 0 100%);
}
#cockpit .strut.l { left: 0; }
#cockpit .strut.r { right: 0; transform: scaleX(-1); }
#cockpit .dash {
  position: absolute; left: 0; right: 0; bottom: 0; height: 24%;
  background: linear-gradient(180deg, transparent 0%, #0a0620 18%, #05020c 100%);
  clip-path: polygon(0 40%, 22% 0, 78% 0, 100% 40%, 100% 100%, 0 100%);
}
#cockpit .dash-line {
  position: absolute; left: 22%; right: 22%; top: 18%; height: 2px;
  background: var(--cyan); box-shadow: 0 0 12px var(--cyan), 0 0 30px rgba(47,242,255,0.5); opacity: 0.8;
}

/* Jetpack */
#hud-jet { position: absolute; bottom: 70px; left: 18px; width: 200px; }
#hud-jet .bar > div { background: linear-gradient(90deg, var(--amber), var(--neon)); box-shadow: 0 0 10px var(--amber); }
#hud-jet.low .bar > div { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; }

/* Santé, stats */
#hud-hp { position: absolute; top: 90px; left: 18px; width: 200px; }
#hud-hp .bar > div { background: linear-gradient(90deg, #4dff8a, var(--cyan)); box-shadow: 0 0 10px #4dff8a; }
#hud-hp.low .bar > div { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; }
#hud-stats { position: absolute; top: 90px; right: 18px; font-family: var(--pixel); font-size: 20px; color: var(--amber); text-shadow: 0 0 8px var(--amber); }
#hurt { position: fixed; inset: 0; pointer-events: none; z-index: 6; background: radial-gradient(ellipse at center, transparent 40%, rgba(255,40,40,0.55) 100%); opacity: 0; transition: opacity 0.35s; }

/* Titre : deuxième bouton */
#title-studio {
  display: block; margin: 14px auto 0; background: transparent; border: 1px solid var(--cyan); color: var(--cyan);
  font-family: var(--pixel); font-size: 22px; padding: 8px 22px; cursor: pointer; letter-spacing: 2px;
  box-shadow: 0 0 14px rgba(47,242,255,0.3); transition: all 0.2s;
}
#title-studio:hover { background: rgba(47,242,255,0.12); color: #fff; }

/* Arcade */
#arcade { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(2,0,8,0.8); }
#arcade-frame { background: var(--panel); border: 2px solid var(--neon); padding: 14px 18px 12px; box-shadow: 0 0 40px rgba(255,47,214,0.4), inset 0 0 30px rgba(255,47,214,0.06); text-align: center; }
#arcade-title { font-family: var(--pixel); font-size: 30px; color: var(--neon); letter-spacing: 4px; text-shadow: 0 0 12px var(--neon); margin-bottom: 8px; }
#arcade-canvas { width: min(640px, 80vw); height: auto; aspect-ratio: 4 / 3; image-rendering: pixelated; border: 1px solid rgba(47,242,255,0.5); background: #000; }
#arcade-help { margin-top: 8px; font-family: var(--pixel); font-size: 20px; color: var(--cyan); }
#arcade-foot { margin-top: 4px; font-size: 12px; color: rgba(233,227,255,0.6); }

/* Marqueurs (GPS vaisseau / moto) */
#hud-markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; letter-spacing: 2px; text-shadow: 0 0 8px currentColor; white-space: nowrap; transition: opacity 0.3s; }
.marker .ico { width: 14px; height: 14px; border: 2px solid currentColor; transform: rotate(45deg); box-shadow: 0 0 10px currentColor; }
.marker.edge .ico { border-radius: 50%; transform: none; width: 10px; height: 10px; }
.marker .arrow { font-size: 16px; line-height: 12px; }
.marker.ship { color: var(--amber); }
.marker.bike { color: var(--neon); }
.marker .dist { opacity: 0.8; }

/* Carte */
.panel.wide { width: min(1240px, 96vw); }
#map-canvas { width: 100%; height: auto; max-height: 60vh; object-fit: contain; display: block; background: #05030f; border: 1px solid rgba(47,242,255,0.35); image-rendering: pixelated; }
#map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; letter-spacing: 2px; color: rgba(233,227,255,0.8); }
#map-legend span::before { content: '■'; margin-right: 6px; color: var(--c); }
#recall-bar { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: 220px; height: 6px; border: 1px solid #ffb52f; background: rgba(0,0,0,0.5); }
#recall-bar div { height: 100%; background: #ffb52f; box-shadow: 0 0 10px #ffb52f; width: 0; }

/* ---- Thèmes d'interface par univers -------------------------------------- */
/* clean : la Salle, réaliste. Sobre, sans lueur, sans police pixel, sans CRT */
body[data-theme="clean"] {
  --neon: #c9ced6; --cyan: #e8ecf2; --amber: #f0c060;
  --panel: rgba(18, 19, 22, 0.82); --text: #e6e8ec; --pixel: var(--mono);
}
body[data-theme="clean"] #crt { display: none; }
body[data-theme="clean"] #hud *, body[data-theme="clean"] .panel, body[data-theme="clean"] .panel *, body[data-theme="clean"] #dialogue * { text-shadow: none !important; box-shadow: none !important; }
body[data-theme="clean"] .hud-box, body[data-theme="clean"] .panel, body[data-theme="clean"] #dialogue, body[data-theme="clean"] #hud-prompt { border-color: rgba(255,255,255,0.25) !important; }
body[data-theme="clean"] #hud-location-name, body[data-theme="clean"] #hud-signal-value { font-size: 20px; letter-spacing: 1px; }
body[data-theme="clean"] .gauge .bar > div { background: #e6e8ec !important; }
body[data-theme="clean"] kbd { border-color: rgba(255,255,255,0.4); color: #fff; }

/* code : terminal vert */
body[data-theme="code"] { --neon: #4dff8a; --cyan: #9dffb8; --amber: #d8ff70; --panel: rgba(0, 12, 4, 0.86); --text: #c8ffd8; }
/* white : encre sur papier */
body[data-theme="white"] { --neon: #1a1a1e; --cyan: #111114; --amber: #444448; --panel: rgba(255, 255, 255, 0.86); --text: #111114; }
body[data-theme="white"] #hud *, body[data-theme="white"] .panel * { text-shadow: none !important; }
body[data-theme="white"] #crt { opacity: 0.35; }
body[data-theme="white"] kbd { border-color: #111; color: #111; }
/* dark : rouge sang */
body[data-theme="dark"] { --neon: #ff2040; --cyan: #ff6a7a; --amber: #ff9a80; --panel: rgba(20, 2, 8, 0.86); --text: #ffd6dc; }
/* sand : désert ambré */
body[data-theme="sand"] { --neon: #ff8a2a; --cyan: #ffd28a; --amber: #ffb52f; --panel: rgba(30, 14, 4, 0.86); --text: #ffe8c8; }
/* concrete : béton, gris froid */
body[data-theme="concrete"] { --neon: #9aa4b8; --cyan: #d6dde8; --amber: #ffb52f; --panel: rgba(12, 14, 18, 0.9); --text: #e0e4ea; }

/* Menu développeur */
#dev .panel { max-height: 90vh; }
#dev h3 { margin: 14px 0 6px; }
.dev-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dev-btn { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; padding: 6px 10px; background: rgba(0,0,0,0.35); border: 1px solid var(--cyan); color: var(--text); cursor: pointer; }
.dev-btn:hover { background: color-mix(in srgb, var(--cyan) 20%, transparent); }
.dev-btn.on { border-color: var(--neon); color: var(--neon); box-shadow: 0 0 8px var(--neon); }
#title-dev { display: block; margin: 10px auto 0; background: none; border: 1px solid rgba(233,227,255,0.35); color: rgba(233,227,255,0.8); font-family: var(--mono); font-size: 13px; letter-spacing: 2px; padding: 8px 16px; cursor: pointer; }
#title-dev:hover { border-color: var(--cyan); color: var(--cyan); }
/* psy : rêve acidulé */
body[data-theme="psy"] { --neon: #ff40a0; --cyan: #ffff40; --amber: #60ffc0; --panel: rgba(40, 0, 60, 0.8); --text: #fff0ff; }
body[data-theme="psy"] .hud-box, body[data-theme="psy"] .panel { animation: psyhue 12s linear infinite; }
@keyframes psyhue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

/* Chargement */
#loading { position: fixed; inset: 0; z-index: 60; background: #05020c; display: flex; align-items: center; justify-content: center; }
#loading-inner { text-align: center; width: min(520px, 80vw); }
#loading-logo { font-family: var(--pixel); font-size: 48px; color: var(--cyan); letter-spacing: 6px; text-shadow: 0 0 18px var(--cyan); }
#loading-logo span { color: var(--neon); }
#loading-text { margin: 14px 0 10px; font-size: 13px; letter-spacing: 3px; color: rgba(233,227,255,0.7); }
#loading-track { height: 6px; border: 1px solid var(--cyan); background: rgba(0,0,0,0.5); }
#loading-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--neon)); box-shadow: 0 0 12px var(--cyan); transition: width 0.25s; }

/* Cycle */
#hud-cycle { position: absolute; top: 90px; right: 18px; width: 160px; text-align: right; }
#hud-cycle-value { display: block; font-family: var(--pixel); font-size: 26px; color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
#hud-cycle .bar { height: 4px; border: 1px solid var(--cyan); margin-top: 4px; }
#hud-cycle .bar > div { height: 100%; width: 0; background: var(--cyan); }
#hud-cycle.low #hud-cycle-value { color: #ff3b3b; text-shadow: 0 0 10px #ff3b3b; animation: blink 0.5s steps(2) infinite; }
@keyframes blink { to { opacity: 0.4; } }
/* Signaloscope */
#scope { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); text-align: center; pointer-events: none; }
#scope-dial { width: 110px; height: 110px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--amber); background: radial-gradient(circle, rgba(0,0,0,0.55), rgba(0,0,0,0.2)); position: relative; box-shadow: 0 0 16px color-mix(in srgb, var(--amber) 40%, transparent); }
#scope-needle { position: absolute; left: 50%; top: 50%; width: 3px; height: 46px; background: var(--amber); transform-origin: 50% 100%; margin-left: -1.5px; margin-top: -46px; box-shadow: 0 0 8px var(--amber); transition: transform 0.08s linear; }
#scope-center { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--amber); }
#scope-dist { font-family: var(--pixel); font-size: 22px; color: var(--amber); margin-top: 4px; }
#scope.hot #scope-dial { animation: blink 0.25s steps(2) infinite; }
/* Scanner */
#scan-card { position: absolute; right: 18px; top: 160px; width: 300px; background: var(--panel); border: 1px solid var(--cyan); padding: 12px 16px; box-shadow: 0 0 16px color-mix(in srgb, var(--cyan) 35%, transparent); }
#scan-title { font-family: var(--pixel); font-size: 24px; color: var(--cyan); margin: 4px 0 6px; }
#scan-text { font-size: 13px; line-height: 1.45; color: var(--text); }
/* Options */
#options { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(2,0,8,0.55); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0; font-size: 13px; letter-spacing: 1px; }
.opt-row input[type=range] { width: 260px; accent-color: var(--cyan); }
#title-continue { display: block; margin: 0 auto 12px; border-color: var(--cyan) !important; color: var(--cyan) !important; }

/* compteur d'images (options) */
#hud-fps { position: absolute; left: 18px; bottom: 44px; font-size: 11px; letter-spacing: 1px; opacity: 0.75; color: var(--hud-fg, #cfe); pointer-events: none; }

/* repères d'événements connus sur la barre de cycle */
#hud-cycle .bar { position: relative; }
#hud-cycle-marks { position: absolute; inset: 0; pointer-events: none; }
#hud-cycle-marks i { position: absolute; top: -3px; width: 2px; height: calc(100% + 6px); background: #fff; opacity: 0.85; box-shadow: 0 0 4px #fff; }
#title-cycle { font-size: 12px; letter-spacing: 4px; opacity: 0.7; margin: -6px 0 14px; min-height: 14px; }

/* terminal interactif */
#shell { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); z-index: 40; }
#shell-box { width: min(760px, 92vw); height: min(460px, 80vh); background: #050806; border: 1px solid #3aff8a; box-shadow: 0 0 30px rgba(58, 255, 138, 0.25), inset 0 0 60px rgba(58, 255, 138, 0.05); color: #9dffb8; font-family: 'Share Tech Mono', monospace; font-size: 15px; display: flex; flex-direction: column; }
#shell-head { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid rgba(58, 255, 138, 0.35); letter-spacing: 2px; font-size: 12px; }
#shell-head .shell-hint { opacity: 0.55; letter-spacing: 1px; }
#shell-out { flex: 1; overflow-y: auto; padding: 10px 12px; white-space: pre-wrap; line-height: 1.35; }
#shell-out .cmd { color: #e8ffe0; }
#shell-out .err { color: #ff6a6a; }
#shell-line { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid rgba(58, 255, 138, 0.35); }
#shell-in { flex: 1; background: transparent; border: none; outline: none; color: #e8ffe0; font: inherit; caret-color: #3aff8a; }

/* générique de fin */
#credits { position: absolute; inset: 0; background: #000; z-index: 60; display: flex; align-items: center; justify-content: center; transition: opacity 1.5s; opacity: 1; }
#credits.fade { opacity: 0; }
#credits-body { text-align: center; color: #e6e6f0; font-family: 'Share Tech Mono', monospace; }
#credits-body > div { opacity: 0; animation: creditIn 1.4s forwards; margin: 6px 0; }
#credits-body .h1 { font-size: 42px; letter-spacing: 8px; }
#credits-body .h2 { font-size: 18px; letter-spacing: 4px; opacity: 0.9; margin-top: 14px; }
#credits-body .p { font-size: 14px; letter-spacing: 1px; opacity: 0.8; }
#credits-body .sp { height: 10px; }
#credits-skip { position: absolute; bottom: 24px; right: 30px; font-size: 11px; letter-spacing: 2px; opacity: 0.45; color: #fff; font-family: 'Share Tech Mono', monospace; }
@keyframes creditIn { to { opacity: 1; } }

/* écran titre : plans des univers en fond */
#attract-fade { position: fixed; inset: 0; background: #000; opacity: 1; pointer-events: none; z-index: 39; transition: opacity 0.12s linear; }
#attract-caption { position: fixed; left: 28px; bottom: 26px; z-index: 41; font-family: 'Share Tech Mono', monospace; font-size: 13px; letter-spacing: 6px; color: #fff; opacity: 0; pointer-events: none; text-shadow: 0 0 8px rgba(0,0,0,0.9); }
#attract-caption.show { animation: captionIn 7s ease forwards; }
@keyframes captionIn { 0% { opacity: 0; transform: translateY(6px); } 12% { opacity: 0.8; transform: none; } 85% { opacity: 0.8; } 100% { opacity: 0; } }
body.playing #attract-fade, body.playing #attract-caption { display: none; }
#title-inner .title-small { display: block; margin: 10px auto 0; font-size: 14px; padding: 8px 22px; opacity: 0.8; }
#title-inner .title-small.hidden { display: none; }
#title-version { position: fixed; right: 16px; bottom: 12px; z-index: 41; font-family: 'Share Tech Mono', monospace; font-size: 11px; letter-spacing: 2px; color: #fff; opacity: 0.35; pointer-events: none; }
body.playing #title-version { display: none; }
#nogl { position: fixed; inset: 0; z-index: 100; background: #05020c; color: #e6e6f0; display: flex; align-items: center; justify-content: center; text-align: center; font-family: 'Share Tech Mono', monospace; padding: 24px; }
#nogl > div { max-width: 520px; line-height: 1.5; }
#nojs { position: fixed; inset: 0; background: #05020c; color: #fff; display: flex; align-items: center; justify-content: center; font-family: monospace; z-index: 100; }
html.touch #title-foot::after { content: ' · ce jeu se joue au clavier et à la souris'; color: #ffb52f; }
body:not(.playing) #hud, body:not(.playing) #lock-hint, body:not(.playing) #crosshair { visibility: hidden; }
