/* U-03 CRT-PLAYER — Geräte-OSD um cleanes Bild (§4b) */

:root {
  --bg: #0a0a0b;
  --ink: #e8e6e0;
  --dim: #6a6862;
  --ghost: #3a3936;
  --line: rgba(232, 230, 224, 0.14);
  --phosphor: #cfe8d8;
  --phosphor-dim: rgba(207, 232, 216, 0.45);
  --phosphor-glow: rgba(160, 255, 200, 0.35);
  --rec: #ff5a4e;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --micro: 120ms;
  --move: 650ms;
  --ease-move: cubic-bezier(0.25, 0.85, 0.3, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 55% 42% at 50% 42%, rgba(80, 100, 90, 0.07), transparent 70%),
    var(--bg);
}

.lab-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  padding: 22px 28px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  pointer-events: none;
}

.lab-meta {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.26em;
}

.stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 72px;
  gap: 22px;
}

/* —— Player chassis —— */
.player {
  position: relative;
  width: min(92vw, 1080px);
  aspect-ratio: 16 / 9;
  background: #050505;
  border-radius: 3px;
  box-shadow:
    0 0 0 10px #141416,
    0 0 0 11px #26262a,
    0 0 0 18px #0e0e10,
    0 36px 90px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  cursor: none;
}

.player:hover,
.player:focus-within,
.player.osd-on {
  cursor: default;
}

.player:fullscreen,
.player:-webkit-full-screen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.bezel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bezel-brand {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.18);
  opacity: 0;
  transition: opacity var(--micro) steps(2, end);
}

.player.osd-on .bezel-brand { opacity: 1; }

.screen {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.media[hidden] { display: none !important; }

/* —— OSD (device language; never paints the picture) —— */
.osd {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px 14px;
  font-family: var(--mono);
  color: var(--phosphor);
  text-shadow: 0 0 8px var(--phosphor-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--micro) steps(2, end);
}

.osd[data-visible="true"] {
  opacity: 1;
}

.osd[data-visible="true"] .osd-top,
.osd[data-visible="true"] .osd-bottom {
  pointer-events: auto;
}

.osd-top {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  letter-spacing: 0.28em;
}

.osd-state[data-playing="false"] {
  color: var(--rec);
  text-shadow: 0 0 8px rgba(255, 90, 78, 0.45);
}

.osd-tc {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.osd-badge {
  color: var(--phosphor-dim);
  letter-spacing: 0.2em;
}

.osd-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* thin signal scrubber */
.scrubber {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
}

.scrubber-track {
  position: relative;
  width: 100%;
  height: 2px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(207, 232, 216, 0.18) 0 1px,
      transparent 1px 4px
    );
}

.scrubber-signal {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor-glow);
  transition: width 40ms linear;
}

.scrubber-head {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border: 1px solid var(--phosphor);
  background: #0a0a0b;
  box-shadow: 0 0 8px var(--phosphor-glow);
  transition: left 40ms linear;
  opacity: 0.85;
}

.scrubber:focus-visible .scrubber-head,
.scrubber:hover .scrubber-head {
  opacity: 1;
  transform: scale(1.15);
}

.osd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.osd-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--phosphor);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px var(--phosphor-glow);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  opacity: 0.88;
}

.osd-btn:hover { opacity: 1; }
.osd-btn:active { opacity: 0.65; }
.osd-btn-end { margin-left: auto; font-size: 15px; }

.vol {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 2px;
  background: rgba(207, 232, 216, 0.22);
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 0;
  border: 1px solid var(--phosphor);
  background: #0a0a0b;
  box-shadow: 0 0 6px var(--phosphor-glow);
}

.vol-slider::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 0;
  border: 1px solid var(--phosphor);
  background: #0a0a0b;
  box-shadow: 0 0 6px var(--phosphor-glow);
}

.osd-dur {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--phosphor-dim);
  font-variant-numeric: tabular-nums;
}

.hint {
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ghost);
  line-height: 1.9;
}

.hint #srcLabel { color: var(--dim); }

@media (max-width: 640px) {
  .lab-chrome { padding: 16px 18px; }
  .osd { padding: 12px; }
  .osd-top { gap: 10px; font-size: 10px; }
  .vol-slider { width: 48px; }
  .osd-badge { display: none; }
  .hint { font-size: 8px; padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .osd,
  .bezel-brand,
  .scrubber-signal,
  .scrubber-head {
    transition: none;
  }
}
