/* ---------- CRT monitor shell ---------- */

.crt {
  background: linear-gradient(180deg, #2b2b27, #191916 70%, #111110);
  border-radius: 20px;
  padding: 20px 20px 16px;
  border: 1px solid #000;
  box-shadow:
    0 30px 60px -25px rgba(0,0,0,.8),
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -6px 14px rgba(0,0,0,.6);
  position: relative;
}

.crt-bezel { position: relative; }

.drive-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--chrome);
  font-size: 9px;
  letter-spacing: 1px;
  color: #8a8a7e;
  padding: 0 4px 10px;
}
.drive-led {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3a2200;
  box-shadow: 0 0 4px rgba(0,0,0,.6) inset;
  transition: background .2s, box-shadow .2s;
}
.drive-led.on {
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor), 0 0 3px var(--phosphor);
}

.screen-wrap {
  background: #000;
  border-radius: 10px;
  padding: 16px;
  box-shadow: inset 0 0 0 2px #000, inset 0 0 46px rgba(0,0,0,.9);
}

.screen {
  position: relative;
  overflow: hidden;
  background: #030402;
  border-radius: 14px / 10px;
  width: 100%;
  aspect-ratio: 4 / 3;
  filter: url(#crt-barrel);
  box-shadow: 0 0 34px var(--phosphor-glow);
  transition: box-shadow .4s ease;
}

.screen canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* scanlines */
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 1px,
    rgba(0,0,0,.24) 2px, rgba(0,0,0,0) 3px);
  mix-blend-mode: multiply;
}

/* vignette */
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 70px 16px rgba(0,0,0,.8);
}

/* flicker */
.flicker {
  position: absolute; inset: 0; pointer-events: none;
  background: rgba(255,255,255,.03);
  animation: flicker 6.2s infinite;
}
@keyframes flicker {
  0%, 96%, 100% { opacity: 0; }
  97% { opacity: 1; }
  98% { opacity: .3; }
}

/* chromatic aberration, edge-weighted via radial mask */
.chroma-edge {
  position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: screen;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 62%, #000 96%);
  mask-image: radial-gradient(ellipse at center, transparent 62%, #000 96%);
  background:
    linear-gradient(90deg, rgba(255,40,40,.55) 0%, transparent 6%, transparent 94%, rgba(80,220,255,.55) 100%),
    linear-gradient(180deg, rgba(255,40,40,.35) 0%, transparent 6%, transparent 94%, rgba(80,220,255,.35) 100%);
}

.empty-state[hidden] { display: none; }
.empty-state {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--chrome);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--phosphor-dim);
  text-align: center;
  padding: 0 20px;
}

.crt-caption {
  display: flex; justify-content: space-between;
  font-size: 13px; color: #8a8a7e; letter-spacing: .06em; text-transform: uppercase;
  padding: 10px 4px 0;
}
.crt-caption span:first-child { color: var(--phosphor); }

/* ---------- transport ---------- */

.transport {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
}
.transport input[type="range"] {
  flex: 1; min-width: 120px;
  accent-color: var(--phosphor);
}
.loop-toggle {
  color: var(--ink-dim); font-size: 15px; display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.loop-toggle input { accent-color: var(--phosphor); }
.framecount {
  color: var(--ink-dim); font-size: 15px; min-width: 78px; text-align: right; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .flicker, .drive-led.on { animation: none; }
}
