:root {
  --bg: #0e1420;
  --panel: #171f2e;
  --panel-2: #1d2739;
  --text: #e8edf5;
  --muted: #93a1b8;
  --accent: #38bdf8;
  --live: #ef4444;
  --ok: #34d399;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }

/* ---------- header ---------- */

.site-header {
  background: linear-gradient(90deg, #0b1f33, #10314f 60%, #0b1f33);
  border-bottom: 1px solid #223349;
  padding: 18px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 2.2rem;
  color: var(--accent);
  transform: rotate(-20deg);
}

.site-header h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--panel-2);
  border: 1px solid #2b3b55;
  white-space: nowrap;
}

.status-chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.status-chip.online .dot { background: var(--ok); }
.status-chip.live .dot { background: var(--live); animation: blink 1s infinite; }
.status-chip.offline .dot { background: #f59e0b; }

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid #2b3b55;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.sound-toggle:hover { border-color: var(--accent); }
.sound-toggle.muted { opacity: 0.6; }
.sound-toggle .sound-icon { font-size: 0.95rem; }

/* ---------- stage (banner / live) ---------- */

.stage {
  position: relative;
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  min-height: 200px;
}

.stage-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 6;
  object-fit: cover;
}

#liveFeed { aspect-ratio: 16 / 9; }

.live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--live);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.live-badge .pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
  animation: blink 1s infinite;
}

.live-info {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: #e6f6ff;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

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

/* ---------- meta line ---------- */

.meta-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 10px 4px;
}

/* ---------- live control monitor ---------- */

.monitor {
  background: var(--panel);
  border: 1px solid #223047;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 6px;
}

.monitor-head h2 {
  font-size: 1.05rem;
  margin: 0 0 2px;
}

.monitor-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.monitor-body {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  align-items: flex-start;
}

.monitor-frame {
  position: relative;
  flex: 0 1 560px;
  max-width: 560px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid #2b3b55;
}

#monitorFeed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.monitor-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(10, 14, 22, 0.6);
}

.monitor-status {
  flex: 1 1 200px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid #2b3b55;
  border-radius: 10px;
  padding: 8px 12px;
}

.mon-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.mon-value {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mon-divider {
  margin-top: 6px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid #2b3b55;
}

.mon-value.neutral { color: var(--muted); }
.mon-value.ok { color: var(--ok); }
.mon-value.live { color: var(--live); }
.mon-value.warn { color: #f59e0b; }

/* ---------- archive ---------- */

.archive { margin: 26px 0 40px; }

.archive-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.archive h2 {
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.archive-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.archive-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 16px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.gallery .empty {
  grid-column: 1 / -1;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed #2b3b55;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.card {
  margin: 0;
  background: var(--panel);
  border: 1px solid #223047;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #000;
}

.card figcaption {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.card figcaption strong { color: var(--text); }

.card .conf {
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.load-more {
  margin: 18px auto 0;
  display: block;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid #2b3b55;
  border-radius: 10px;
  padding: 10px 26px;
  font-size: 0.9rem;
  cursor: pointer;
}

.load-more:hover { border-color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid #223349;
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 50;
  cursor: zoom-out;
  padding: 24px;
}

.lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  color: var(--text);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .status-chip { display: none; }
  .stage-media { aspect-ratio: 16 / 9; }
}
