/* def.mov — black VHS tape, green phosphor type. One dark look on purpose. */
:root {
  --void: #000;
  --phos: #5cff8f;              /* old school digital green */
  --phos-dim: #2f9a57;
  --phos-glow: rgba(92, 255, 143, .55);
  --term: "VT323", "Lucida Console", "Courier New", monospace;
  color-scheme: dark;
}

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

html, body { height: 100%; margin: 0; }

body {
  background: var(--void);
  color: var(--phos);
  font-family: var(--term);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px dashed var(--phos); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* the tape itself */
#cv { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }

/* scanlines */
.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 1px, transparent 1px 3px);
}

/* black edges of the tube */
.glass {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.8) 100%);
}

/* green terminal readout */
.hud {
  position: fixed; z-index: 4; inset: 0; pointer-events: none;
  display: grid; grid-template-rows: auto 1fr auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  text-shadow: 0 0 6px var(--phos-glow), 0 0 1px var(--phos);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.1;
  letter-spacing: .04em;
}

.row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-width: 0; }
.row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.by {
  place-self: end center; text-align: center; margin: 0 0 8vh;
  font-size: clamp(20px, 2.8vw, 32px);
}
.by small {
  display: block; color: var(--phos-dim); font-size: .7em; margin-top: 6px; text-shadow: none;
}

.cursor {
  display: inline-block; width: .55em; height: .9em; background: var(--phos);
  vertical-align: -.1em; margin-left: 2px; box-shadow: 0 0 8px var(--phos-glow);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.ctl { pointer-events: auto; display: flex; gap: 18px; flex-shrink: 0; }
.ctl button { color: var(--phos-dim); text-shadow: none; }
.ctl button:hover,
.ctl button[aria-pressed="true"] { color: var(--phos); text-shadow: 0 0 6px var(--phos-glow); }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
