:root {
  color-scheme: light;
  /* barwy strony glownej ROD (dekret 03.09): krem, swieza zielen, slonce */
  --page: #fffdf6;
  --surface: #ffffff;
  --surface-2: #f6f1e3;
  --line: rgba(24, 58, 38, 0.14);
  --text: #172019;
  --muted: #59635b;
  --accent: #2e7d4f;
  --live: #2e7d4f;
  --danger: #c0392b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -15%, rgba(91, 135, 99, 0.28), transparent 36rem),
    var(--page);
  color: var(--text);
}

button { font: inherit; }

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 0 28px;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.quiet-button,
.footer-link,
.close-button {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.quiet-button {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.viewer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.viewer h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 620;
}

.live-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(46, 125, 79, 0.12);
}

.live-status[data-state="live"] { color: var(--live); }
.live-status[data-state="offline"] { color: var(--danger); }

.video-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  background: #020504;
  box-shadow: 0 24px 70px rgba(24, 58, 38, 0.14);
}

.player-host,
.player-host video-rtc,
.player-host video {
  display: block;
  width: 100%;
  height: 100%;
}

.player-host video { object-fit: contain; }

.signal-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 24px;
  background: rgba(2, 5, 4, 0.82);
  text-align: center;
}

.signal-message[hidden] { display: none; }
.signal-message strong { font-size: 1.4rem; }
.signal-message span { color: var(--muted); }

.fullscreen-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(24, 58, 38, 0.2);
  border-radius: 999px;
  background: rgba(2, 5, 4, 0.74);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.fullscreen-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.last-frame {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.camera-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.camera-card {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 37, 28, 0.76);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.camera-card:hover { transform: translateY(-2px); }
.camera-card.is-active { border-color: var(--accent); background: var(--surface-2); }

.camera-number {
  color: var(--accent);
  font: 1.25rem/1 Georgia, serif;
}

.camera-card strong,
.camera-card small { display: block; }
.camera-card strong { margin-bottom: 4px; }
.camera-card small { color: var(--muted); }

.stream-note {
  margin: 13px 0 48px;
  color: var(--muted);
  font-size: 0.84rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-link {
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

dialog {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(24, 58, 38, 0.18);
}

dialog::backdrop { background: rgba(1, 6, 3, 0.78); }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin-bottom: 18px; }
.close-button { font-size: 2rem; line-height: 1; }
dialog p { color: var(--muted); line-height: 1.55; }
.legal-warning { padding-top: 16px; border-top: 1px solid var(--line); color: var(--danger); }

@media (max-width: 700px) {
  .site-header,
  main,
  footer { width: min(100% - 24px, 1120px); }

  .site-header { align-items: start; padding: 26px 0 22px; }
  .quiet-button { font-size: 0.82rem; }
  .viewer { padding-top: 17px; }
  .video-shell { margin-inline: -12px; width: calc(100% + 24px); border-radius: 0; }

  .camera-picker {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .camera-picker::-webkit-scrollbar { display: none; }
  .camera-card { min-width: 72%; scroll-snap-align: start; }
  footer { flex-direction: column; }
  .footer-link { align-self: start; }
}

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