:root {
  color-scheme: dark;
  --osd: #eaf6ff;
  --cyan: #37e6ff;
  --amber: #ffb43a;
  --phosphor: #46f08a;
  --deck: #17181c;
  --black: #050506;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #050506;
  overflow-x: hidden;
  font-family: "VT323", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(120% 90% at 50% 0%, #17171b, #050506 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
}

button,
a {
  font: inherit;
}

.osd-text {
  color: var(--osd);
  font-family: "VT323", ui-monospace, monospace;
  letter-spacing: .5px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.85), 0 0 8px rgba(120,200,255,.45);
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vh, 22px);
  padding: clamp(14px, 3vh, 34px);
}

.screen-shell {
  position: relative;
  width: min(92vw, calc((100vh - 230px) * 16 / 9));
  min-width: min(92vw, 340px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  box-shadow:
    0 0 0 2px #000,
    0 0 0 9px var(--deck),
    0 28px 60px rgba(0,0,0,.62);
}

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

.bars {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
}

.bars[hidden] {
  display: none;
}

.bar-row {
  display: flex;
}

.bar-row.top {
  flex: 0 0 67%;
}

.bar-row.bottom {
  flex: 1;
}

.bar-row i {
  flex: 1;
  display: block;
}

.standby {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(0,0,0,.45);
  text-align: center;
}

.standby[hidden] {
  display: none;
}

.standby-main {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 2px;
}

.standby-sub {
  max-width: 80%;
  font-size: clamp(18px, 2.4vw, 26px);
  opacity: .9;
}

.error-panel {
  background: rgba(0,0,0,.6);
}

.play-prompt {
  position: absolute;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: clamp(28px, 4.5vw, 52px);
  text-shadow: 3px 3px 0 rgba(0,0,0,.9), 0 0 14px rgba(120,200,255,.6);
}

.play-prompt[hidden],
.osd[hidden] {
  display: none;
}

.osd {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.osd-top-left,
.osd-top-right,
.stamp,
.title-band {
  position: absolute;
  z-index: 51;
}

.osd-top-left {
  top: 3.5%;
  left: 3%;
  line-height: 1;
  font-size: clamp(26px, 3.6vw, 42px);
}

.osd-small {
  margin-top: 4px;
  font-size: clamp(15px, 1.9vw, 22px);
  opacity: .9;
  white-space: nowrap;
}

.osd-top-right {
  top: 3.5%;
  right: 3%;
  text-align: right;
  line-height: 1;
  font-size: clamp(22px, 3vw, 34px);
}

.ampm {
  margin-left: 5px;
  font-size: .6em;
}

.cyan,
.timecode {
  color: var(--cyan);
}


.stamp {
  left: 3%;
  top: 48%;
  color: #ffe9b0;
  opacity: .82;
  font-size: clamp(14px, 1.7vw, 19px);
  text-shadow: 1px 1px 0 #000;
}

.title-band {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 7% 3% 3.5%;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
}

.title-copy {
  max-width: 66%;
  min-width: 0;
}

.title-copy h1 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: clamp(20px, 2.7vw, 32px);
  font-weight: 400;
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.title-copy p {
  margin: 7px 0 0;
  overflow: hidden;
  opacity: .82;
  font-size: clamp(15px, 1.8vw, 21px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-copy {
  flex: 0 0 auto;
  text-align: right;
  font-size: clamp(13px, 1.6vw, 19px);
}

.timecode {
  font-size: clamp(20px, 2.7vw, 32px);
}

.scanlines,
.snow,
.tracking-line,
.glare,
.flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanlines {
  z-index: 70;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.2) 0 1px, transparent 1px 3px);
}

.snow {
  z-index: 71;
  opacity: .06;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: snow .18s steps(3) infinite;
}

.snow.heavy {
  opacity: .16;
}

.tracking-line {
  left: 0;
  right: 0;
  height: 26px;
  z-index: 72;
  filter: blur(.5px);
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.1) 40%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.1) 60%, transparent);
  animation: track 7s linear infinite;
}

.glare {
  z-index: 73;
  background: radial-gradient(120% 80% at 50% 6%, rgba(255,255,255,.08), transparent 42%);
}

.flash {
  z-index: 80;
  background: #fff;
  opacity: 0;
}

.flash.on {
  animation: flash .5s ease-out;
}

.controls {
  width: min(92vw, calc((100vh - 230px) * 16 / 9));
  min-width: min(92vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.primary,
.ghost {
  min-height: 58px;
  border-radius: 7px;
  text-decoration: none;
}

.primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  border: 2px solid var(--cyan);
  background: linear-gradient(#10477a, #0a2f54);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  text-align: left;
  white-space: nowrap;
  transition: transform .05s, filter .15s;
}

.primary:hover {
  filter: brightness(1.12);
}

.primary:active {
  transform: translateY(1px);
}

.primary:disabled {
  cursor: progress;
  opacity: .65;
}

.select {
  color: var(--cyan);
  font-size: .82em;
}

.ghost {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border: 2px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.05);
  color: var(--osd);
  font-size: 24px;
  white-space: nowrap;
  transition: background .15s;
}

.ghost:hover {
  background: rgba(255,255,255,.12);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 34px;
  margin: 0;
  color: var(--osd);
  font-size: 20px;
  opacity: .85;
}

.meta div {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.meta dt,
.meta dd {
  margin: 0;
}

.meta dt {
  color: var(--cyan);
}

.meta dd {
  overflow-wrap: anywhere;
}

@keyframes blink {
  50% { opacity: .12; }
}

.blink {
  animation: blink 1.1s steps(1) infinite;
}

@keyframes snow {
  0% { background-position: 0 0; }
  33% { background-position: -90px 40px; }
  66% { background-position: 60px -70px; }
  100% { background-position: -30px 90px; }
}

@keyframes track {
  0% { top: 88%; opacity: 0; }
  6% { opacity: .9; }
  14% { opacity: 0; }
  100% { top: -8%; opacity: 0; }
}

@keyframes flash {
  0% { opacity: .85; }
  12% { opacity: .1; }
  30% { opacity: .5; }
  100% { opacity: 0; }
}

@media (max-width: 680px) {
  .stage {
    justify-content: flex-start;
  }

  .screen-shell,
  .controls {
    width: 94vw;
  }

  .control-row {
    flex-direction: column;
  }

  .primary {
    font-size: 22px;
  }

  .ghost {
    justify-content: center;
    font-size: 20px;
  }

  .meta {
    font-size: 17px;
  }
}
