:root {
  color-scheme: dark;
  --bg: #071114;
  --panel: #101d22;
  --panel-2: #14272e;
  --text: #f2f7f8;
  --muted: #9fb0b7;
  --line: #29434c;
  --ready: #66d18f;
  --warn: #f1c45b;
  --danger: #ff7c7c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--line);
}

body.cast-active {
  overflow: hidden;
}

body.video-cast-active {
  background: #000;
}

body.video-cast-active .display-header {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
}

.display-header p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 18px;
}

.clock {
  font-size: 44px;
  font-weight: 700;
  white-space: nowrap;
}

.display-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.8fr;
  gap: 18px;
  padding: 20px 32px 32px;
}

#boardDisplay[hidden],
body.cast-active #boardDisplay {
  display: none !important;
}

.cast-display {
  min-height: calc(100vh - 105px);
  display: grid;
  place-items: center;
  padding: 36px;
}

body.video-cast-active .cast-display {
  min-height: 100vh;
  padding: 0;
  background: #000;
}

.cast-display[hidden] {
  display: none;
}

.cast-panel {
  width: min(1180px, 92vw);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: clamp(32px, 6vw, 78px);
  text-align: center;
}

.cast-panel.video-cast {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #000;
  padding: 0;
}

.cast-kicker {
  display: block;
  color: var(--ready);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}

.cast-panel h2 {
  margin: 18px 0 0;
  color: var(--text);
  font-size: clamp(42px, 7vw, 92px);
  line-height: 1;
  text-transform: none;
}

.cast-panel p,
.cast-link {
  display: block;
  margin: 26px auto 0;
  max-width: 980px;
  color: var(--text);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 800;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.cast-link {
  color: var(--ready);
}

.cast-secondary-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.cast-video-frame {
  width: min(1120px, 82vw);
  aspect-ratio: 16 / 9;
  margin: 28px auto 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.video-cast .cast-video-frame {
  width: min(100vw, calc(100vh * 16 / 9));
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.video-cast .cast-secondary-link {
  position: fixed;
  right: 18px;
  bottom: 14px;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  text-decoration: none;
}

.cast-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

h2 {
  color: var(--muted);
  font-size: 20px;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.load-column {
  display: grid;
  gap: 16px;
}

.load-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.load-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--panel-2);
}

.load-card strong {
  display: block;
}

.load-number {
  font-size: 42px;
  line-height: 1;
}

.load-meta {
  color: var(--muted);
  font-size: 18px;
  margin-top: 5px;
}

.load-timer {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #21343b;
  color: var(--warn);
  font-size: 18px;
  font-weight: 800;
}

.load-timer.overdue {
  border-color: var(--danger);
  background: #331a1a;
  color: var(--danger);
}

.status {
  font-size: 24px;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
}

.slot {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.slot.open {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
}

.slot.camera-slot {
  background: #101f27;
}

.slot-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer {
  font-size: 32px;
  line-height: 1.05;
  min-width: 0;
  overflow-wrap: anywhere;
}

.offering-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instructor {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ready);
}

.media {
  display: inline-flex;
  margin-top: 12px;
  border-radius: 999px;
  padding: 5px 11px;
  background: #21343b;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.media.paid {
  color: var(--ready);
}

.slot-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.slot-fact {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid #385660;
  border-radius: 7px;
  padding: 6px 9px;
  background: #21343b;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.05;
}

.slot-fact strong {
  display: inline;
  color: var(--text);
}

.slot-fact.paid,
.slot-fact.media {
  border-color: #3d755c;
  color: var(--ready);
}

.slot-fact.warn,
.slot-fact.load_type {
  border-color: #7b6530;
  background: #2b2718;
  color: var(--warn);
}

.slot-fact.camera {
  border-color: #3d6175;
  color: #8ed0ff;
}

.slot-fact.muted {
  color: var(--muted);
}

.validation {
  display: grid;
  gap: 6px;
  padding: 10px 18px;
  background: #261f10;
  border-top: 1px solid var(--line);
  font-size: 16px;
  font-weight: 700;
}

.validation .error {
  color: var(--danger);
}

.validation .warning {
  color: var(--warn);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  font-size: 20px;
}

.empty.error {
  border-color: var(--danger);
  color: var(--danger);
}

.compact .load-number {
  font-size: 30px;
}

.compact .customer {
  font-size: 22px;
}

.compact .instructor {
  font-size: 19px;
}

@media (max-width: 980px) {
  .display-header,
  .display-grid {
    padding-left: 18px;
    padding-right: 18px;
  }

  .display-grid {
    grid-template-columns: 1fr;
  }
}
