:root {
  --sans: "Petrov Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --ink: #dffcf6;
  --ink-soft: #8fbfb9;
  --line: rgba(140, 255, 236, 0.22);
  --accent: #ff2614;
  --cyan: #7ff4ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #061316; font-family: var(--sans); color: var(--ink); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* thin chrome lettering, as on an early-2000s CD sleeve */
.chrome {
  background: linear-gradient(180deg, #ffffff 0%, #c9f6ff 45%, #5fa6b0 52%, #e9ffff 70%, #9fe9f2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(110, 240, 255, 0.55));
}
.path { font: 300 0.42em var(--mono); color: var(--cyan); letter-spacing: 0.04em; margin-left: 0.15em; text-shadow: 0 0 8px rgba(110, 240, 255, 0.6); }

.title { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0; text-align: center; pointer-events: none; }
.title h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); font-weight: 200; letter-spacing: 0.06em; }

.glass {
  background: linear-gradient(170deg, rgba(14, 46, 50, 0.72), rgba(6, 22, 26, 0.78));
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(160, 255, 240, 0.18);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 6px;
}
/* Firefox: backdrop-filter over the live WebGL canvas is the likely cause of whole tiles of the
   canvas going missing for a frame (sharp page-colour rectangles, "black flickers"). Plain tinted glass there. */
.gecko .glass {
  backdrop-filter: none;
  background: linear-gradient(170deg, rgba(14, 46, 50, 0.9), rgba(6, 22, 26, 0.93));
}
/* no filter layers over the canvas in Firefox either: the title glows with nothing but its gradient */
.gecko .chrome { filter: none; }
/* ?bare: canvas only, for testing the renderer without any overlay */
.bare .title, .bare .dock, .bare .card, .bare .hint, .bare .credits, .bare .loading, .bare .clock { display: none !important; }

.dock { position: fixed; left: 16px; top: 96px; bottom: 40px; width: 300px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.grip { display: none; }
.tabs { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.tab, .btn {
  flex: 1; border: 0; padding: 7px 12px; font: 500 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); cursor: pointer; background: transparent;
}
.tab.on { background: rgba(127, 244, 255, 0.14); color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }
.btn { flex: none; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); text-decoration: none; background: rgba(127, 244, 255, 0.06); }
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.pill { border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; font: 13px var(--mono); color: var(--ink); background: rgba(0, 0, 0, 0.25); outline: none; }
.pill:focus { border-color: var(--cyan); }
.pill::placeholder { color: var(--ink-soft); }
.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.list li { padding: 8px 10px; border-radius: 4px; cursor: pointer; display: flex; gap: 10px; align-items: center; border-left: 2px solid transparent; }
.list li:hover { background: rgba(127, 244, 255, 0.07); }
.list li.on { background: rgba(255, 38, 20, 0.12); border-left-color: var(--accent); }
.list .dot { width: 7px; height: 7px; flex: none; transform: rotate(45deg); box-shadow: 0 0 8px currentColor; }
.list .nm { font-weight: 500; font-size: 14px; }
.list .meta { font: 11.5px var(--mono); color: var(--ink-soft); }
.list .empty { color: var(--ink-soft); cursor: default; font-size: 13px; }

.card { position: fixed; right: 16px; top: 96px; width: 350px; max-height: calc(100% - 140px); overflow-y: auto; padding: 18px 18px 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.card h2 { margin: 0 34px 4px 0; font-size: 24px; font-weight: 300; letter-spacing: 0.01em; }
.card .meta { color: var(--ink-soft); font: 12px var(--mono); margin-bottom: 10px; }
.card p { font-size: 14px; line-height: 1.5; margin: 8px 0; color: #c4e6e1; }
.card .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card .x { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line); background: transparent; font-size: 16px; cursor: pointer; color: var(--ink-soft); }
.card .x:hover { color: var(--accent); border-color: var(--accent); }
.menu h3 { font: 500 11px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 16px 0 6px; }
.menu li { font-size: 13.5px; margin: 4px 0; }
.menu ul { padding-left: 14px; margin: 0; }
.menu li::marker { color: var(--ink-soft); }
.tag { display: inline-block; font: 700 10px var(--mono); border: 1px solid var(--cyan); border-radius: 3px; padding: 0 4px; margin-left: 5px; color: var(--cyan); }

.hint { position: fixed; left: 50%; transform: translateX(-50%); bottom: 34px; padding: 8px 16px; font: 12px var(--mono); color: var(--ink-soft); transition: opacity 1s; }
.credits { position: fixed; right: 10px; bottom: 6px; font: 10px var(--mono); color: rgba(160, 220, 212, 0.55); }
.loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 200; background: radial-gradient(ellipse at 50% 60%, #0f3a3f, #030a0c 70%); transition: opacity 0.8s; }
.loading.gone { opacity: 0; pointer-events: none; }

/* the clock (web/life/timectl.js): a chip that opens a slider and a Live button */
.clock { position: fixed; top: 18px; right: 16px; }
.clock-chip { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink); font: 500 14px var(--mono); letter-spacing: 0.06em; padding: 7px 12px; cursor: pointer; }
.clock-chip:hover { color: var(--cyan); }
.clock-mode { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.clock.is-live .clock-mode { color: var(--accent); }
.clock.is-live .clock-mode::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); margin-right: 5px; vertical-align: 1px; }
.clock-panel { width: 250px; padding: 2px 12px 12px; }
.clock-slider { width: 100%; accent-color: var(--cyan); margin: 4px 0 10px; }
.clock-row { display: flex; justify-content: space-between; align-items: center; font: 11.5px var(--mono); color: var(--ink-soft); }
.clock-row .btn { padding: 5px 10px; }

@media (max-width: 700px) {
  .clock { top: calc(max(8px, env(safe-area-inset-top)) + 44px); right: 8px; }
  .clock-chip { font-size: 13px; padding: 5px 10px; }
  .title { top: max(8px, env(safe-area-inset-top)); }
  .title h1 { font-size: 30px; }
  /* bottom sheet: the list folds down to just its tabs */
  .dock { left: 8px; right: 8px; top: auto; bottom: max(22px, env(safe-area-inset-bottom)); width: auto; height: 42vh; padding-top: 4px; transition: height .25s ease; }
  .dock.folded { height: 58px; overflow: hidden; }
  .dock.folded .pill, .dock.folded .list { display: none; }
  .grip { display: block; align-self: center; width: 60px; height: 14px; border: 0; background: none; padding: 4px 0; cursor: pointer; }
  .grip span { display: block; height: 4px; border-radius: 2px; background: var(--line); }
  .card { left: 8px; right: 8px; top: auto; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 66px); width: auto; max-height: 52vh; }
  .hint { display: none; }
  .credits { left: 8px; right: 8px; bottom: 4px; font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
}
/* Mine layer (web/mine.js): hover label and the list's Routes heading */
.mine-tip { position: fixed; z-index: 5; pointer-events: none; padding: 6px 10px; font-size: 13px; color: #dffcff; max-width: 260px; }
.mine-tip span { display: block; font: 11px var(--mono); color: var(--ink-soft); }
.list li.sub { cursor: default; font: 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); padding-top: 12px; }
