:root {
  --blue: #03799e;
  --blue-deep: #004a80;
  --blue-sky: #00b0e0;
  --blue-soft: #e8f6fb;
  --ink: #1d2a33;
  --muted: #5b6b75;
  --line: #d7e3ea;
  --paper: #f3f7fa;
  --panel: #ffffff;
  --live: #c62828;
  --ok: #116d39;
  --warn: #c47a12;
  --offline: #7a8580;
  --shadow: 0 10px 28px rgba(0, 74, 128, 0.1);
  --font-display: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Open Sans", "Segoe UI", sans-serif;
  --radius: 12px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: linear-gradient(90deg, var(--blue-deep), var(--blue) 55%, var(--blue-sky));
  color: #fff;
  font-size: 0.82rem;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.45rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.topbar-tagline {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.topbar-links a {
  opacity: 0.95;
  border-bottom: 1px solid transparent;
}

.topbar-links a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.site-header {
  background: var(--panel);
  border-bottom: 3px solid var(--blue);
  box-shadow: 0 2px 10px rgba(3, 121, 158, 0.08);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: min(100%, 300px);
  object-fit: contain;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  justify-content: flex-end;
  flex: 1;
  min-width: 240px;
}

.page-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.page-title {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1.1;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

.player-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.55s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.player-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--blue-soft));
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--live);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
}

.live-badge[data-state="offline"] {
  background: var(--offline);
}

.live-badge[data-state="reconnecting"] {
  background: var(--warn);
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
}

.live-badge[data-state="live"] .live-dot {
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.65);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.status-pill.subtle {
  font-weight: 500;
  color: var(--muted);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--warn);
}

#connection-status[data-state="live"] .status-dot {
  background: var(--ok);
}

#connection-status[data-state="offline"] .status-dot {
  background: var(--offline);
}

#connection-status[data-state="reconnecting"] .status-dot,
#connection-status[data-state="connecting"] .status-dot {
  background: var(--warn);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

.video-wrap {
  position: relative;
  background: #0b1410;
  aspect-ratio: 16 / 10;
}

.player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0b1410;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(0, 40, 64, 0.72);
  color: #f4f7f4;
}

.overlay[hidden] {
  display: none;
}

.overlay-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.overlay-detail {
  margin: 0.45rem 0 0;
  color: rgba(244, 247, 244, 0.85);
}

.player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--blue-soft);
}

.mode-btn,
.toolbar-btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 0;
}

.mode-btn {
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-btn.is-active {
  background: var(--blue);
  color: #fff;
}

.toolbar-btn {
  background: var(--blue-deep);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease;
}

.toolbar-btn:hover {
  background: var(--blue);
}

.toolbar-btn:active {
  transform: scale(0.98);
}

.site-footer {
  background: var(--blue-deep);
  color: rgba(255, 255, 255, 0.92);
  margin-top: auto;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.35rem 1.25rem 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.footer-brand img {
  border-radius: 50%;
  background: #fff;
  padding: 0.2rem;
}

.footer-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
}

.footer-brand p {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.8);
}

.footer-note {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 720px) {
  .brand-logo {
    height: 58px;
  }

  .header-right {
    justify-content: flex-start;
  }

  .video-wrap {
    aspect-ratio: 4 / 3;
  }

  .player-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
