:root {
  color-scheme: dark;
  --ground: #0b0e14;
  --panel: rgba(13, 17, 26, 0.86);
  --line: #2a3448;
  --text: #dbe2ec;
  --muted: #8d9ab0;
  --cool: #63c6ef;
  --warm: #f1a35d;
  --ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--ground); color: var(--text); font: 14px/1.45 var(--ui); }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#view { image-rendering: auto; }
#overlay { pointer-events: none; }
[hidden] { display: none !important; }

.w { background: linear-gradient(90deg, var(--cool), #e6ecf4 55%, var(--warm)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.dim { color: var(--muted); }
kbd { font: 500 11.5px var(--mono); border: 1px solid #3a4866; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-right: 2px; color: var(--text); background: rgba(255, 255, 255, 0.04); }

.hud {
  position: fixed; left: 16px; top: 14px; pointer-events: none;
  font: 12.5px/1.6 var(--mono); color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
}
.hud .title { font: 600 16px var(--ui); margin-bottom: 2px; }
.hud .title #mode { font: 500 12px var(--mono); color: var(--muted); margin-left: 6px; }

.hint {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  font-size: 13.5px; pointer-events: none;
}

.panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  padding: 22px 24px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.panel h1 { font-size: 34px; margin: 0 0 4px; }
.panel h2 { font-size: 13px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.panel h2:not(:first-child) { margin-top: 18px; }
.panel p { margin: 0 0 10px; max-width: 62ch; }
.panel pre { white-space: pre-wrap; font: 12px var(--mono); color: #ffb4a8; }
.help { top: auto; bottom: 16px; transform: translateX(-50%); }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; align-items: baseline; }
.help dt { white-space: nowrap; font: 12px var(--mono); color: var(--muted); }
.help dd { margin: 0; }
.settings { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; max-width: 360px; }
.settings label { font: 12px var(--mono); color: var(--muted); }
.settings input[type=range] { width: 100%; accent-color: var(--cool); }
.settings input[type=checkbox] { justify-self: start; accent-color: var(--cool); }
.settings select, .buttons button { font: 12.5px var(--ui); color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid #3a4866; border-radius: 6px; padding: 4px 10px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.buttons button { cursor: pointer; }
.buttons button:hover { background: rgba(255, 255, 255, 0.1); }
.panel a { color: var(--cool); }
.console { width: min(760px, calc(100% - 32px)); background: rgba(8, 10, 16, 0.92); border-color: #2c5a56; }
.console .dials { display: grid; grid-template-columns: 4em 1fr 4em 1fr; gap: 8px 12px; align-items: center; font: 15px var(--mono); color: #9fe3d8; }
.console .dials input[type=range] { width: 100%; accent-color: #52dcc8; }
.console .dials label { white-space: nowrap; }
.console .src { display: grid; grid-template-columns: 9em 1fr; gap: 10px; margin-top: 12px; height: 46vh; }
.console #console-files { display: flex; flex-direction: column; gap: 3px; overflow: auto; }
.console #console-files button { font: 11.5px var(--mono); text-align: left; background: none; border: 0; color: #9fb6c9; cursor: pointer; padding: 2px 4px; }
.console #console-files button:hover { color: #fff; }
.console pre { margin: 0; overflow: auto; font: 11px/1.45 var(--mono); color: #c9d6e3; background: rgba(255, 255, 255, 0.03); padding: 8px; white-space: pre; }
.fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.bar { height: 6px; border-radius: 3px; background: #1d2535; overflow: hidden; margin: 16px 0 10px; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--cool), #e6ecf4, var(--warm)); transition: width 0.15s; }

@media (max-width: 700px) {
  .hud { font-size: 11px; }
}

/* U: nothing over the view, for pictures */
body.bare #hud, body.bare #hint, body.bare #help { display: none !important; }
