:root {
  --sky-0: #0b1c33;
  --sky-1: #16365c;
  --sky-2: #2a6aa5;
  --gold: #e2b93b;
  --gold-2: #f3d57a;
  --grass: #1f3a2e;
  --ink: #102018;
  --paper: #fffaf0;
  --muted: #5c6758;
  --line: #d9cfb8;
  --danger: #a33b2c;
  --ok: #1f7a45;
  --warn: #b36b12;
  --shadow: 0 12px 40px rgba(11, 28, 51, 0.18);
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cambria Math", "Segoe UI", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e8efe4;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.login-body {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 10% -10%, #fff4cc, transparent 50%),
    linear-gradient(180deg, #16365c 0%, #2a6aa5 42%, #7eb56a 42.1%, #1f3a2e 100%);
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--paper);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px 26px 22px;
}
.login-card h1 { margin: 0 0 4px; font-size: 1.45rem; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.login-card label { display: block; font-size: 0.85rem; margin: 10px 0 4px; color: var(--muted); }
.login-card input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.login-card .btn { width: 100%; margin-top: 16px; }
.login-err { color: var(--danger); min-height: 1.2em; margin-top: 8px; font-size: 0.9rem; }

.btn {
  border: 0;
  background: var(--sky-1);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 650;
}
.btn:hover { filter: brightness(1.08); }
.btn.gold { background: var(--gold); color: #1c241c; }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.ghost {
  background: transparent;
  color: var(--sky-1);
  border: 1px solid var(--line);
}
.btn.small { padding: 7px 10px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.stage-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #05080d;
  overflow: hidden;
}
.stage {
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(180deg, #0d2748 0%, #1d4f86 46%, #87b7e6 46%, #cfe6a8 72%, #2d5644 100%);
  user-select: none;
}
.stage.preview {
  pointer-events: none;
}
.stage-sky {
  position: absolute; inset: 0 0 38% 0;
  background:
    radial-gradient(420px 180px at 78% 28%, rgba(255, 244, 204, 0.55), transparent 60%),
    linear-gradient(180deg, #0b1c33, #2a6aa5);
}
.kite {
  position: absolute;
  width: 70px; height: 70px;
  background: conic-gradient(from 45deg, #c0392b, #e2b93b, #c0392b);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0.85;
}
.header-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: linear-gradient(180deg, rgba(8,18,32,0.72), transparent);
  z-index: 4;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand strong { font-size: 34px; letter-spacing: 0.04em; }
.brand span { font-size: 18px; opacity: 0.85; }
.clock {
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: rgba(0,0,0,0.28);
  padding: 8px 18px;
  border-radius: 14px;
}
.scene-body {
  position: absolute;
  top: 110px;
  left: 48px;
  right: 48px;
  bottom: 110px;
  z-index: 3;
  display: grid;
  place-items: center;
}
.stage.ticker-off .scene-body {
  bottom: 36px;
}
.stage.ticker-off .sponsor-caption {
  bottom: 48px;
}
.sponsor-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: stretch;
}
.sponsor-layout.with-sidebar {
  grid-template-columns: minmax(0, 1fr) 420px;
}
.sponsor-slide {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 20px 40px;
  min-width: 0;
}
.sponsor-layout.with-sidebar .sponsor-slide {
  padding: 12px 8px 12px 20px;
}
.sponsor-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.25));
}
.sponsor-caption {
  position: absolute;
  bottom: 132px;
  left: 0; right: 0;
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}
.next-up {
  background: rgba(255,250,240,0.94);
  color: var(--ink);
  border-radius: 24px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.nu-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 20px;
  color: var(--sky-1);
  font-weight: 800;
}
.nu-title { font-size: 40px; font-weight: 800; margin: 10px 0 8px; line-height: 1.1; }
.nu-time { font-size: 34px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--sky-1); }
.nu-count {
  margin-top: 16px;
  font-size: 52px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.program-board {
  width: min(1500px, 100%);
  background: rgba(255,250,240,0.94);
  color: var(--ink);
  border-radius: 28px;
  padding: 36px 42px;
  box-shadow: var(--shadow);
}
.program-board h2 { margin: 0 0 18px; font-size: 42px; }
.program-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid #eadfc8;
  font-size: 32px;
}
.program-row .time { font-weight: 800; color: var(--sky-1); font-variant-numeric: tabular-nums; }
.program-row .st { font-size: 18px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.program-row.cancelled { opacity: 0.45; text-decoration: line-through; }
.program-row.delayed .st { color: var(--warn); }
.program-row.cancelled .st { color: var(--danger); }
.countdown-card {
  text-align: center;
  width: min(1400px, 100%);
}
.countdown-card .label { font-size: 36px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.countdown-card h2 { margin: 10px 0 18px; font-size: 64px; }
.digits {
  font-size: 180px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.digits.done { font-size: 120px; }
.subnote { margin-top: 18px; font-size: 28px; opacity: 0.88; }
.message-card {
  width: min(1500px, 100%);
  text-align: center;
  background: rgba(11, 28, 51, 0.72);
  border: 3px solid var(--gold);
  border-radius: 28px;
  padding: 56px 48px;
}
.message-card h2 { margin: 0 0 18px; font-size: 72px; color: var(--gold-2); }
.message-card p { margin: 0; font-size: 42px; line-height: 1.25; }
.ticker {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 92px;
  background: #0b1c33;
  color: #fff;
  overflow: hidden;
  z-index: 6;
  display: flex;
  align-items: center;
  border-top: 6px solid var(--gold);
}
.ticker.hidden, .stage.ticker-off .ticker {
  display: none !important;
}
.ticker-track {
  white-space: nowrap;
  will-change: transform;
  font-size: 36px;
  font-weight: 650;
  padding-left: 100%;
}
.popup-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.popup-banner {
  position: absolute;
  top: 110px;
  left: 80px;
  right: 80px;
  background: #a33b2c;
  color: #fff;
  padding: 22px 28px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.popup-banner h3, .popup-center h3, .popup-full h3 { margin: 0 0 8px; }
.popup-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  width: min(1100px, 86%);
  background: var(--paper);
  color: var(--ink);
  padding: 42px 40px;
  border-radius: 24px;
  border: 6px solid var(--gold);
  text-align: center;
}
.popup-full {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 28, 0.94);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 80px;
  text-align: center;
}
.popup-full .box { max-width: 1400px; }
.popup-full h3 { font-size: 80px; color: var(--gold-2); margin-bottom: 24px; }
.popup-full p { font-size: 44px; }
.popup-center h3 { font-size: 48px; }
.popup-center p { font-size: 30px; margin: 0; }
.popup-banner h3 { font-size: 34px; }
.popup-banner p { margin: 0; font-size: 26px; }
.ice-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #7a1212;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 72px;
  text-align: center;
}
.ice-card { max-width: 1600px; }
.ice-kicker {
  display: inline-block;
  background: #fff;
  color: #7a1212;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 10px;
  margin-bottom: 28px;
  font-size: 28px;
}
.ice-card h2 { margin: 0 0 24px; font-size: 96px; line-height: 1.05; }
.ice-card p { margin: 0; font-size: 48px; line-height: 1.2; font-weight: 650; }
.ice-admin {
  border: 2px solid #a33b2c;
  background: #fff5f3;
  border-radius: 14px;
  padding: 12px;
  margin-top: 14px;
}
.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.seg button.active { background: var(--gold); color: #1c241c; }
.day-group h3 { margin: 16px 0 6px; font-size: 15px; }
.missing-date { border-color: var(--warn); background: #fff8e8; }
.timer-chip {
  position: absolute;
  right: 40px;
  top: 110px;
  z-index: 7;
  background: rgba(0,0,0,0.45);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 12px 18px;
  font-variant-numeric: tabular-nums;
  font-size: 28px;
}
.offline-flag {
  position: absolute;
  left: 40px;
  bottom: 108px;
  z-index: 8;
  background: rgba(179, 107, 18, 0.92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 18px;
  display: none;
}
.offline-flag.on { display: block; }

.player-page, .live-page {
  background: #05080d;
  height: 100%;
  overflow: hidden;
}
.live-chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  background: rgba(5,8,13,0.82);
  color: #fff;
  font-size: 13px;
}
.live-chrome .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #888;
}
.live-chrome .dot.on { background: #3ddc84; }
.live-chrome .dot.warn { background: var(--gold); }
.live-chrome .dot.off { background: #c0392b; }
.live-page .stage-wrap { padding-top: 36px; height: calc(100% - 0px); }

.admin-body { background: #e7eee3; }
.admin {
  min-height: 100%;
  display: grid;
  grid-template-rows: 58px 1fr;
}
.top {
  background: var(--sky-0);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}
.top .brand-mini { font-weight: 800; letter-spacing: 0.04em; }
.top .spacer { flex: 1; }
.pill {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(380px, 1fr);
  min-height: 0;
}
.preview-col, .ctrl-col {
  min-height: 0;
  padding: 12px;
}
.panel {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.preview-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05080d;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.preview-frame .stage { position: absolute; top: 50%; left: 50%; }
.scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.status-grid b { color: var(--ink); display: block; }
.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.tabs button.active { background: var(--gold); color: #1c241c; }
.ctrl-col { overflow: auto; }
.section { padding: 14px; }
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0;
}
.stack { display: grid; gap: 8px; }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; min-width: 140px; }
input[type="text"], input[type="number"], input[type="time"], input[type="date"], input[type="file"], textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0;
  background: #fff;
}
.item h3 { margin: 0 0 6px; font-size: 15px; }
.sponsor-thumb {
  height: 48px; width: 96px;
  object-fit: contain;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
  border-radius: 8px;
}
.hidden { display: none !important; }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.ok { color: var(--ok); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .program-row { font-size: 22px; grid-template-columns: 110px 1fr; }
  .digits { font-size: 96px; }
}
