:root {
  --bg: #1c1510;
  --bg-soft: #2a2118;
  --card: #352a20;
  --accent: #e8944a;
  --accent-soft: #f4c89a;
  --text: #faf3ea;
  --muted: #c4b5a3;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #4a3828 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}

.logo {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  letter-spacing: 0.02em;
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
}

section {
  margin-bottom: 2rem;
}

section h2 {
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--accent-soft);
}

.live-wrap {
  background: var(--card);
  border: 1px solid #4a3b2e;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px var(--shadow);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  background: rgba(0, 0, 0, 0.25);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fd97a;
  box-shadow: 0 0 8px #5fd97a;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.5; }
}

#live-player-host {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d0a08;
}

#live-player-host fox-live,
#live-player-host video {
  width: 100%;
  height: 100%;
  display: block;
}

#live-player-host fox-live video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d0a08;
}

/* Snapshot fallback — hidden until stream fails */
.live-fallback,
#live-img {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d0a08;
  object-fit: contain;
}

.live-wrap.is-fallback #live-player-host {
  display: none;
}

.live-wrap.is-fallback .live-fallback,
.live-wrap.is-fallback #live-img {
  display: block;
}

video {
  width: 100%;
  display: block;
  max-height: 70vh;
  background: #0d0a08;
  object-fit: contain;
}

.live-status {
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sightings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.sighting-card {
  background: var(--card);
  border: 1px solid #4a3b2e;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
  width: 100%;
}

.sighting-card:hover,
.sighting-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sighting-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #0d0a08;
  display: block;
}

.sighting-meta {
  padding: 0.55rem 0.65rem 0.65rem;
}

.sighting-label {
  font-size: 0.75rem;
  text-transform: capitalize;
  color: var(--accent);
}

.sighting-time {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px dashed #5a4a3a;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.82);
}

.modal.open {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #4a3b2e;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.modal video {
  width: 100%;
  max-height: 70vh;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (min-width: 600px) {
  .sightings {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
