:root {
  --matte-blue: #3d5ee3;
  --frame-blue: #1f3ab8;
  --header-blue: #2036a8;
  --guide-blue: #071b7b;
  --guide-blue-deep: #05145b;
  --line-white: #d8e4ff;
  --line-dark: #0a1556;
  --clock-white: #d7e2ff;
  --time-green: #8ab316;
  --chan-green: #86ad14;
  --chan-yellow: #d8cf57;
  --text-white: #e8eefc;
  --ink: #020617;
  --panel-blue: #101e66;
  --panel-blue-dark: #0a1446;
  --focus: #fff5a0;
  --guide-scale: 1;
  --row-height: calc(100px * var(--guide-scale));
  --channel-col-width: calc(130px * var(--guide-scale));
  --slot-col-width: calc(255px * var(--guide-scale));
  --guide-grid-width: calc(var(--channel-col-width) + (var(--slot-col-width) * 3));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text-white);
  background: #000;
  font-family: "Teko", "Arial Narrow", sans-serif;
}

.page {
  width: min(1300px, 100% - 16px);
  margin: 0 auto;
  padding: 10px 0 16px;
}

.masthead {
  margin: 0 0 6px;
  padding: 2px 0 0;
}

.masthead-logo {
  display: block;
  height: clamp(72px, 10vw, 148px);
  width: auto;
  max-width: min(96vw, 980px);
  margin-inline: auto;
  filter:
    drop-shadow(0 0 3px rgba(143, 239, 255, 0.35)) drop-shadow(0 0 9px rgba(102, 223, 255, 0.24));
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.broadcast-shell {
  position: relative;
  border: 2px solid #87a4ff;
  background: var(--matte-blue);
  padding: 7px;
  box-shadow:
    inset 0 0 0 2px #0c1d76,
    inset 0 0 0 4px #5175ff,
    0 18px 30px rgba(0, 0, 0, 0.46);
  min-width: 0;
}

.broadcast-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.broadcast-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #010616;
  border: 2px solid #bcd0ff;
  box-shadow: inset 0 0 0 1px #162f97;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.promo-video-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

.retro-frame-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.video-controls-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  z-index: 5;
}

.video-volume-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: min(340px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(203, 219, 255, 0.68);
  background: linear-gradient(180deg, rgba(18, 36, 114, 0.9), rgba(8, 22, 80, 0.88));
  box-shadow: inset 0 0 0 1px rgba(132, 158, 255, 0.35);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.video-controls-zone:hover .video-volume-controls,
.video-controls-zone:focus-within .video-volume-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.video-control-btn {
  border: 1px solid #b4c5ff;
  background: linear-gradient(180deg, #2f4fc8, #1c308a);
  color: #eef3ff;
  font-family: "Teko", "Arial Narrow", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 4px 9px;
  cursor: pointer;
}

.video-control-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.video-volume-slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  color: #d6e3ff;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.video-volume-label {
  color: #dbe8ff;
}

#volumeSlider {
  flex: 1;
  min-width: 64px;
  accent-color: #8ab316;
  cursor: pointer;
}

.video-volume-readout {
  width: 34px;
  text-align: right;
  color: #f0f5ff;
  letter-spacing: 0.03em;
}

.control-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: min(620px, 100%);
  margin-inline: auto;
}

.control-card {
  background: linear-gradient(180deg, var(--panel-blue), var(--panel-blue-dark));
  border: 2px solid #8ea5ff;
  box-shadow: inset 0 0 0 1px #111f6f;
  padding: 8px;
}

.control-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  letter-spacing: 0.07em;
  color: #e7eeff;
  text-transform: uppercase;
}

.control-card label {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  color: #cfdbff;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}

.control-card input,
.control-card select {
  width: 100%;
  border: 2px solid #5f78e4;
  background: #08124a;
  color: #edf2ff;
  padding: 5px;
  font: inherit;
}

.control-card input:focus,
.control-card select:focus,
.control-card button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.control-card button {
  width: 100%;
  border: 2px solid #b7c7ff;
  background: linear-gradient(180deg, #3555d3, #213697);
  color: #f2f6ff;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding: 4px 6px;
  cursor: pointer;
}

.queue-list {
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
  max-height: 270px;
  overflow: auto;
}

.queue-item {
  background: #070f44;
  border: 2px solid #4961cb;
  padding: 5px;
}

.queue-main {
  display: grid;
  gap: 1px;
  margin-bottom: 5px;
}

.queue-main strong {
  font-size: 0.95rem;
  line-height: 0.9;
}

.queue-meta {
  color: #a7b8ef;
  font-size: 0.72rem;
}

.queue-actions {
  display: flex;
  gap: 5px;
}

.queue-actions button {
  margin: 0;
}

.queue-actions .danger {
  background: linear-gradient(180deg, #8d3042, #622230);
  border-color: #dc9cad;
}

.status {
  min-height: 14px;
  margin: 5px 0 0;
  color: #f6e68f;
  font-size: 0.76rem;
}

.availability-panel {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid rgba(142, 165, 255, 0.5);
}

.availability-panel h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #dce7ff;
}

.availability-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.availability-matrix-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #4961cb;
}

.availability-table th,
.availability-table td {
  border: 1px solid #4961cb;
  padding: 4px 6px;
  text-align: left;
  font-size: 0.82rem;
}

.availability-table th {
  background: #0e1c5e;
  color: #dce7ff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.availability-table th:first-child {
  left: 0;
  z-index: 3;
}

.availability-table tbody tr:nth-child(odd) {
  background: rgba(7, 15, 68, 0.68);
}

.time-cell {
  position: sticky;
  left: 0;
  background: #0e1c5e;
  color: #dce7ff;
  z-index: 1;
  white-space: nowrap;
}

.slot-open {
  color: #b9edaf;
}

.slot-taken {
  color: #ffb8c6;
}

.slot-na {
  color: #8898cc;
}

.slot-clickable {
  cursor: pointer;
}

.slot-clickable:hover {
  background: rgba(97, 145, 255, 0.22);
}

@media (max-width: 640px) {
  .masthead-logo {
    height: clamp(54px, 14vw, 100px);
  }

  .video-volume-controls {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 6px;
    padding: 4px 6px;
  }

  .video-control-btn {
    font-size: 0.78rem;
    padding: 3px 7px;
  }

  .video-volume-slider-wrap {
    font-size: 0.72rem;
  }

  .video-volume-readout {
    width: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .retro-frame-canvas {
    image-rendering: auto;
  }
}
