/* FLYNN-LiDAR demo, dark, minimal, no gradients */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #0b0e13;
  color: #e8eef8;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 20px 28px;
}
.mono, .note, .tagline, .cap, .hud { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

h1 { font-size: 20px; font-weight: 650; margin: 2px 0 4px; }
h1 .dash { color: #8fa0b8; font-weight: 400; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: #8fa0b8; margin: 16px 0 8px; }
.tagline { color: #8fa0b8; font-size: 12.5px; max-width: 1100px; margin: 0 0 6px; }
.note { color: #8fa0b8; font-size: 12px; margin: 6px 0; }
.dim { color: #8fa0b8; }
.warn { color: #ffb454; font-size: 12.5px; }
.error { color: #ff5566; font-size: 13px; }

a { color: #69c8ff; text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  background: #1a2230; color: #e8eef8; border: 1px solid #2b3650;
  border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer;
}
button:hover { background: #223050; }
button:disabled { opacity: .4; cursor: default; }
button.mini { padding: 4px 10px; font-size: 13px; }
button.ghost { background: transparent; border-color: #2b3650; color: #8fa0b8; }
button.primary {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  font-size: 17px; font-weight: 650; background: #1d3a5f; border-color: #2f5588;
}
button.primary:hover { background: #264c7c; }
select, input[type="number"] {
  background: #141a24; color: #e8eef8; border: 1px solid #2b3650;
  border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 13px;
}
input[type="number"] { width: 90px; }

/* ---------- setup ---------- */
.setup-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; }
.world-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.world-col { flex: 0 1 560px; min-width: 0; }
.flicker-col { flex: 1 1 250px; min-width: 250px; }
#setup-map { width: 100%; max-width: 540px; aspect-ratio: 1; border: 1px solid #232c3d; border-radius: 8px; cursor: crosshair; touch-action: none; }
.place-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.step-pill {
  flex: 1 1 0; text-align: center;
  font-family: ui-monospace, monospace; font-size: 11.5px; color: #55617a;
  border: 1px solid #232c3d; border-radius: 12px; padding: 3px 10px;
}
.step-pill.active { color: #0b0e13; background: #69c8ff; border-color: #69c8ff; font-weight: 650; }
.world-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.world-controls .or { color: #55617a; font-size: 12px; }
.flicker-sentence { margin: 8px 0 0; font-size: 13px; color: #c7d3e8; }
.flicker-sentence.disabled { opacity: .45; }
.flicker-sentence select { margin: 0 4px; }

.panel-card {
  background: #141a24; border: 1px solid #232c3d; border-left-width: 3px;
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.panel-card-head { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #8fa0b8; }
.check { display: flex; gap: 7px; align-items: center; font-size: 13.5px; cursor: pointer; }
.check.disabled { color: #55617a; cursor: help; }
.quality { display: flex; gap: 18px; }
.flicker-modes { flex-wrap: wrap; gap: 6px 16px; }

/* ---------- load / compute ---------- */
.load-row { margin: 14px 0; }
.load-row span { font-size: 12.5px; color: #8fa0b8; font-family: ui-monospace, monospace; }
.bar { height: 10px; background: #141a24; border: 1px solid #232c3d; border-radius: 5px; margin-top: 5px; overflow: hidden; }
.bar > .fill { height: 100%; width: 0; background: #2f6fb8; transition: width .15s; }

/* ---------- playback ---------- */
.play-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 16px; }
#play-scrub { flex: 1; min-width: 140px; accent-color: #69c8ff; }
.panel-scrub { width: 100%; margin-top: 6px; accent-color: #69c8ff; }
#play-grid { display: grid; gap: 16px; }
.panel {
  background: #141a24; border: 1px solid #232c3d; border-top-width: 3px;
  border-radius: 10px; padding: 12px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14.5px; }
.panel-sub { color: #8fa0b8; font-size: 12px; font-family: ui-monospace, monospace; margin: 2px 0 8px; }
.map { width: 100%; aspect-ratio: 1; border: 1px solid #232c3d; border-radius: 6px; }
.panel-row { display: flex; gap: 10px; margin-top: 10px; }
.panel-row .col { flex: 1; min-width: 0; }
#play-grid .map { width: min(100%, 400px); display: block; margin: 0 auto; }
.cap { color: #55617a; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; margin: 6px 0 3px; }
.cap.sub { text-transform: none; letter-spacing: 0; font-size: 10px; margin: 2px 0 0; }
.panel-row canvas, #play-grid details.brain canvas, #play-grid canvas[id^="whisk-"] { width: 100%; border: 1px solid #232c3d; border-radius: 6px; }
#play-grid canvas[id^="eyes-"] { width: 100%; }
.hud { font-size: 11.5px; color: #8fa0b8; margin-top: 6px; }
.badge { font-size: 11px; font-family: ui-monospace, monospace; padding: 3px 8px; border-radius: 10px; }
.badge.ok { background: #123a26; color: #39d98a; border: 1px solid #1f6b43; }
.badge.fail { background: #3a1620; color: #ff7a8a; border: 1px solid #6b2536; }
details.brain summary { cursor: pointer; color: #8fa0b8; font-size: 12px; font-family: ui-monospace, monospace; margin-top: 8px; }
.eye-toggles { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #8fa0b8; }
button.eye.off { opacity: 0.45; }
.chip.warn { font-size: 10px; font-family: ui-monospace, monospace; padding: 2px 7px; border-radius: 9px; background: #3a2f16; color: #ffb454; border: 1px solid #6b5225; cursor: help; }
#live-map { display: block; width: min(50%, 560px); margin: 10px auto 0; border: 1px solid #232c3d; border-radius: 8px; }
#live-map[hidden] { display: none; }
#live-label { text-align: center; margin-top: 10px; }

/* vision ON/OFF indicator (HUD + live label) */
.vs-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin: 0 5px 0 2px; vertical-align: -1px;
}
.vs-dot.on { background: #39d98a; box-shadow: 0 0 6px #39d98a; }
.vs-dot.off { background: #ff5566; box-shadow: 0 0 6px #ff5566; }

/* ---------- footer link placeholders ---------- */
.link-shelf { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-link {
  display: inline-flex; gap: 7px; align-items: center;
  border: 1px dashed #2b3650; border-radius: 8px; padding: 5px 11px;
  color: #8fa0b8; font-size: 12.5px; font-family: ui-monospace, monospace;
}
.icon-link:hover { color: #e8eef8; border-color: #69c8ff; text-decoration: none; }
.icon-link svg { display: block; }
.icon-link .sub-link {
  color: #69c8ff; border: 1px solid #2b3650; border-radius: 4px;
  padding: 0 5px; font-weight: 700; text-decoration: none;
}
.icon-link .sub-link:hover { border-color: #69c8ff; background: #162032; }
.kaggle-k {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px;
  background: #20beff; color: #0b0e13; font-weight: 800; font-size: 13px;
}
.arxiv-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 5px; border-radius: 4px;
  background: #b31b1b; color: #fff; font-weight: 700; font-size: 10.5px;
  letter-spacing: .03em;
}

/* ---------- footer ---------- */
footer {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  border-top: 1px solid #232c3d; margin-top: 22px; padding-top: 12px; font-size: 13px;
}

/* ---------- intro overlay ---------- */
#intro-overlay {
  position: fixed; inset: 0; z-index: 50; background: #0b0e13;
  opacity: 1; transition: opacity .5s;
}
#intro-overlay.fade { opacity: 0; pointer-events: none; }
#intro-overlay canvas { width: 100vw; height: 100vh; display: block; }
.intro-start {
  position: absolute; left: 50%; top: 62%; transform: translateX(-50%);
  padding: 16px 42px; font-size: 22px; font-weight: 650;
  font-family: ui-monospace, monospace;
  background: #1d3a5f; border: 1px solid #2f5588; border-radius: 12px;
}
.intro-start:hover { background: #264c7c; }
.intro-done-btns {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%);
  display: flex; gap: 14px; padding: 10px 14px;
  background: rgba(11,14,19,0.88); border: 1px solid #232c3d; border-radius: 14px;
}
.intro-next {
  padding: 12px 34px; font-size: 18px; font-weight: 650;
  font-family: ui-monospace, monospace;
  background: #1d3a5f; border: 1px solid #2f5588; border-radius: 10px;
}
.intro-next:hover { background: #264c7c; }
.intro-replay {
  padding: 12px 22px; font-size: 15px;
  font-family: ui-monospace, monospace;
  background: transparent; border: 1px solid #2b3650; color: #8fa0b8; border-radius: 10px;
}
.intro-replay:hover { color: #e8eef8; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .setup-grid { grid-template-columns: 300px 1fr; gap: 18px; }
  .world-row { gap: 14px; }
  #setup-map { max-width: 480px; }
  .world-col { flex-basis: 480px; }
  .flicker-col { flex-basis: 210px; min-width: 210px; }
}
@media (max-width: 900px) {
  .setup-grid { grid-template-columns: 1fr; }
  #setup-map { max-width: 560px; }
  .world-col { flex-basis: 560px; }
  #play-grid { grid-template-columns: 1fr !important; }
}
