:root {
  --bg: #0b0e14;
  --fg: #c7d0dd;
  --dim: #5a6473;
  --grid: #1a1f2a;
  --bid: #4aa3ff;
  --ask: #ff6b6b;
  --inflight-bid: #2d6ea8;
  --inflight-ask: #a8483d;
  --cross: #e7eefb;
  --mod: #e6c86b;
  --ceiling: #e7eefb;
  --button: #1b2333;
  --button-hover: #263149;
  --accent: #6ab0ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; overflow: hidden; }

#hud {
  position: fixed; top: 0; left: 0; right: 0; height: 24px;
  display: flex; align-items: center; gap: 24px;
  padding: 0 12px; background: #0f1420; border-bottom: 1px solid var(--grid);
  z-index: 10;
}
#hud-symbol { color: var(--accent); font-weight: bold; }
#hud-session { color: var(--dim); }

#stage {
  position: absolute; top: 24px; left: 0; right: 0; bottom: 56px;
  overflow: hidden;
}

.pane {
  position: absolute; left: 0; right: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: 20px 100%;
}
#inflight { top: 0; height: 55%; }
#inflight-label {
  position: absolute; top: 4px; left: 8px;
  color: var(--dim); font-size: 10px; letter-spacing: 0.04em;
  text-transform: uppercase; pointer-events: none; z-index: 4;
}
#book     { top: 55%; bottom: 34px; }

#ceiling {
  position: absolute; left: 0; right: 0; top: 55%;
  height: 1px; background: var(--ceiling);
  box-shadow: 0 0 6px rgba(231,238,251,0.5);
  z-index: 5;
}
#ceiling span {
  position: absolute; right: 6px; top: -16px;
  color: var(--ceiling); font-size: 10px; opacity: 0.7;
  letter-spacing: 0.08em; text-transform: uppercase;
}

#overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
}

#xaxis {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  border-top: 1px solid var(--grid);
  color: var(--dim);
}
.tick-cents {
  position: absolute; top: 2px; transform: translateX(-50%);
  font-size: 10px; color: var(--dim);
}
.tick-handle {
  position: absolute; bottom: 2px; transform: translateX(-50%);
  font-size: 11px; color: var(--fg); font-weight: bold;
}
.tick-divider {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--dim); opacity: 0.6;
}

.tri {
  position: absolute;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  will-change: transform;
  transform-origin: bottom center;
}
.tri.bid { background: var(--bid); }
.tri.ask { background: var(--ask); }
.tri.inflight-bid { background: var(--inflight-bid); }
.tri.inflight-ask { background: var(--inflight-ask); }
.tri.cross { background: var(--cross); }

.tri-label {
  position: absolute; color: var(--fg); font-size: 9px; opacity: 0.7;
  pointer-events: none;
}

#transport {
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: #0f1420; border-top: 1px solid var(--grid);
  z-index: 10;
}
#transport button, #transport select {
  background: var(--button); color: var(--fg);
  border: 1px solid var(--grid); border-radius: 3px;
  font: inherit; padding: 4px 10px; cursor: pointer;
  min-width: 34px;
}
#transport button:hover, #transport select:hover { background: var(--button-hover); }
#transport button:active { background: var(--accent); color: #0b0e14; }
#btn-play { min-width: 40px; font-size: 14px; }
#scrub {
  flex: 1; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: var(--grid); border-radius: 3px; outline: none;
}
#scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
#scrub::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 0; cursor: pointer;
}
#clock { color: var(--accent); min-width: 100px; text-align: right; font-variant-numeric: tabular-nums; }

#config-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 14, 20, 0.96);
  display: flex; align-items: center; justify-content: center;
}
#config-box {
  min-width: 420px; max-width: 560px;
  background: #0f1420; border: 1px solid var(--grid); border-radius: 6px;
  padding: 24px 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.config-title { font-size: 22px; letter-spacing: 0.1em; color: var(--accent); text-transform: lowercase; }
.config-sub { color: var(--dim); margin: 4px 0 18px; }
.src-row {
  display: block; padding: 10px 12px; margin-bottom: 8px;
  background: #131a28; border: 1px solid var(--grid); border-radius: 4px; cursor: pointer;
}
.src-row:hover { background: #172134; }
.src-row input { margin-right: 8px; vertical-align: middle; }
.src-name { color: var(--fg); }
.src-meta { display: block; margin-top: 3px; margin-left: 20px; color: var(--dim); font-size: 11px; }
#replay-options {
  margin: 10px 0 0 22px; padding: 10px 12px; background: #0e1421;
  border: 1px solid var(--grid); border-radius: 4px;
}
#replay-options .cfg-row { margin: 6px 0; }
#replay-options input[type="time"] {
  background: var(--button); color: var(--fg);
  border: 1px solid var(--grid); border-radius: 3px;
  font: inherit; padding: 3px 6px;
  color-scheme: dark;
}
.cfg-hint { color: var(--dim); font-size: 11px; margin-top: 6px; }
.cfg-actions { margin-top: 16px; text-align: right; }
#config-go {
  background: var(--accent); color: #0b0e14; border: 0; border-radius: 4px;
  padding: 8px 20px; font: inherit; font-weight: bold; cursor: pointer;
}
#config-go:hover { background: #8dc4ff; }
#config-go:disabled { background: #2a3140; color: var(--dim); cursor: not-allowed; }
