/* Noise Table — global design tokens & shared components */
@import url('fonts.css');
@import url('vcr-osd.css');
@import url('nt-channel.css');
@import url('nt-slider.css');

:root {
  --bg: #1c0a0a;
  --border: rgba(200, 212, 68, 0.28);
  --border-hover: #ffffff;
  --text: #c8d444;
  --text-hover: #ffffff;
  --text-dim: #6e7624;
  --text-hint: #3a3e14;
  --track: #3a1818;
  --thumb: #c8d444;
  --thumb-hover: #ffffff;
  --shadow: 2px 2px 0 #000000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  scrollbar-width: none;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: var(--font-mono);
  overflow: hidden;
}

/* Scan lines — overlays everything including canvases */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.09) 2px,
    rgba(0, 0, 0, 0.09) 4px
  );
  pointer-events: none;
  z-index: 99999;
}

/* VHS patina + grain (vhs.js mounts elements; styles live here for channel overrides) */
.nt-vhs-patina {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 46%,
    rgba(8, 6, 4, 0.1) 82%,
    rgba(4, 3, 2, 0.16) 100%
  );
}

.intro-body .nt-vhs-patina {
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 34%,
    rgba(120, 96, 24, 0.08) 74%,
    rgba(140, 108, 16, 0.14) 100%
  );
}

.nt-vhs-noise {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 501;
  opacity: 0.04;
  image-rendering: pixelated;
}

.intro-body .nt-vhs-noise {
  opacity: 0.08;
}

.nt-vhs-interlace {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 498;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, 0.45) 1px,
    rgba(0, 0, 0, 0.45) 2px
  );
}

.nt-vhs-bleed {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 497;
  mix-blend-mode: screen;
  box-shadow:
    inset 0 0 120px rgba(255, 255, 255, 0.025),
    inset 0 -40px 80px rgba(0, 0, 0, 0.12);
}

.nt-vhs-glitch {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 499;
  opacity: 0;
  image-rendering: pixelated;
  mix-blend-mode: screen;
}

.nt-vhs-headswitch {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(4px, 0.55vh, 9px);
  pointer-events: none;
  z-index: 502;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.62)
  );
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  .nt-vhs-glitch,
  .nt-vhs-interlace {
    display: none;
  }
}

/* ── UI panel ───────────────────────────────────────────── */
#ui {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 18px;
  z-index: 10;
}

/* ── Layout ─────────────────────────────────────────────── */
.row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Button ─────────────────────────────────────────────── */
button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
  letter-spacing: 0.05em;
  width: fit-content;
  text-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
}
button:hover {
  border-color: var(--border-hover);
  color: var(--text-hover);
}

/* ── Select ─────────────────────────────────────────────── */
select {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-shadow: var(--shadow);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
}
select:hover {
  border-color: var(--border-hover);
  color: var(--text-hover);
}
select option {
  background: var(--bg);
  color: var(--text);
  text-shadow: none;
}

/* ── Slider row ─────────────────────────────────────────── */
.ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctrl label {
  color: var(--text-dim);
  font-size: 16px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 64px;
}

/* Native range inputs are upgraded via nt-slider.js where used */

/* ── Text utilities ─────────────────────────────────────── */
.hint {
  color: var(--text-hint);
  font-size: 16px;
  letter-spacing: 0.03em;
}
.dim {
  color: var(--text-dim);
  font-size: 16px;
  letter-spacing: 0.04em;
}
