:root {
  --ink: #e8e6df;
  --dim: #8a857a;
  --hot: #ff5a3c;
  --cold: #4be0d2;
  --bg: #050505;
  --panel: rgba(10,10,10,0.55);
  --line: rgba(255,255,255,0.08);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  background: var(--bg); color: var(--ink);
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#c {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  cursor: grab;
  background: #000;
  touch-action: none;
}
#c.dragging { cursor: grabbing; }

.ui {
  position: fixed;
  pointer-events: none;
  z-index: 5;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  user-select: none;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.ui .row { display: flex; gap: 10px; align-items: baseline; }
.ui .k { color: var(--dim); }
.ui .v { color: var(--ink); }
.ui .pill {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#tl  { top: 14px; left: 16px;  }
#tr  { top: 14px; right: 16px; text-align: right; }
#bl  { bottom: 14px; left: 16px;  max-width: 60vw; }
#br  { bottom: 14px; right: 16px; text-align: right; }
#title { font-size: 13px; letter-spacing: 0.22em; color: var(--ink); }
#title em { color: var(--hot); font-style: normal; }

.panel {
  position: fixed; z-index: 6;
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  font: 11px/1.4 ui-monospace, monospace;
}
#panel-help {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  padding: 18px 20px 16px;
}
#panel-help h2 {
  margin: 0 0 10px;
  font-size: 12px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink);
}
#panel-help p { margin: 6px 0; color: var(--dim); }
#panel-help kbd {
  display: inline-block;
  min-width: 18px; padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  font: 10px/1.2 ui-monospace, monospace;
  color: var(--ink);
  background: rgba(255,255,255,0.04);
}
#panel-help .start {
  margin-top: 14px;
  width: 100%;
  padding: 10px 0;
  background: var(--hot); color: #0a0a0a;
  border: 0; border-radius: 3px;
  font: 600 11px/1 ui-monospace, monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}
#panel-help .start:hover { filter: brightness(1.1); }
#panel-help .small { font-size: 10px; color: var(--dim); }

.corner-marks::before, .corner-marks::after,
.corner-marks > i::before, .corner-marks > i::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--dim); border-style: solid; border-width: 0;
}
.corner-marks::before { top: -1px; left: -1px;  border-top-width: 1px; border-left-width: 1px; }
.corner-marks::after  { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.corner-marks > i::before { bottom: -1px; left: -1px;  border-bottom-width: 1px; border-left-width: 1px; }
.corner-marks > i::after  { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

/* The little toggleable bars on the right */
.vbar {
  position: fixed; right: 16px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
  z-index: 5;
}
.vbar .seg {
  width: 4px; height: 22px;
  background: rgba(255,255,255,0.12);
  border-radius: 1px;
  transition: background 120ms ease, transform 120ms ease;
}
.vbar .seg.on { background: var(--hot); transform: scaleX(1.6); }

.scanline {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02) 0px,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.4;
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  opacity: 0.08; mix-blend-mode: overlay;
  will-change: transform;
}

.flash {
  position: fixed; inset: 0; z-index: 7; pointer-events: none;
  background: white; opacity: 0;
}
.flash.on { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { opacity: 0.7; } 100% { opacity: 0; } }

.toast {
  position: fixed; left: 50%; top: 16px;
  transform: translate(-50%, -10px);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: 3px;
  font: 11px ui-monospace, monospace; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity 200ms ease, transform 200ms ease;
  z-index: 8;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--dim); }
a:hover { color: var(--hot); border-bottom-color: var(--hot); }
