:root {
  color-scheme: light dark;
  --bg: #fbf7f2;
  --fg: #2b2320;
  --accent: #d6633c;
  --card-bg: #ffffff;
  --border: #e8ddd2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1815;
    --fg: #f2ece5;
    --accent: #e8875a;
    --card-bg: #262019;
    --border: #3a3128;
  }
}

* {
  box-sizing: border-box;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}

.nav-links a {
  color: var(--fg);
  text-decoration: none;
  margin-left: 1.25rem;
}

.nav-links a:hover {
  color: var(--accent);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.85;
  margin-bottom: 1.5rem;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.section {
  margin-top: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.status {
  opacity: 0.7;
  margin: 1.5rem 0;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.cat-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.cat-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--border);
}

.cat-info {
  padding: 1rem;
}

.cat-info h3 {
  margin: 0 0 0.25rem;
}

.cat-breed {
  margin: 0;
  opacity: 0.8;
}

.cat-meta {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.tv-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.tv-round-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.tv-round-label {
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  opacity: 0.6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tv-round-value {
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  font-weight: 800;
  color: var(--accent);
}

.bingo-tv {
  display: grid;
  grid-template-columns: 2fr 3fr;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.tv-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  text-align: center;
  padding: 1rem 1rem 4rem;
  overflow: hidden;
}

.call-letter {
  font-size: min(16vw, 22vh);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.call-number {
  font-size: min(32vw, 46vh);
  font-weight: 900;
  line-height: 1;
}

.tv-history {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.5rem 1.25rem 5rem;
}

.tv-history-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  opacity: 0.7;
  font-weight: 600;
}

.tv-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.625rem, 1fr));
  gap: 0.6rem;
  align-content: start;
  padding-right: calc(var(--example-w, 0px) + 0.5rem);
  padding-bottom: calc(var(--example-w, 0px) * 1.28 + 2.5rem);
}

.history-chip {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.6rem 0.22rem;
  text-align: center;
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
  font-weight: 700;
}

.history-chip.latest {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tv-example-video {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  width: var(--example-w, min(33vw, 480px));
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 5;
}

.tv-example-label {
  display: block;
  text-align: center;
  font-size: 1.7rem;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 0.35rem;
}

.tv-example-video video,
.tv-example-video img {
  display: block;
  width: 100%;
  aspect-ratio: 1122 / 1402;
  object-fit: cover;
  border-radius: 8px;
}

.tv-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.tv-controls .cta {
  border: none;
  font-size: 1.1rem;
  padding: 0.75rem 1.75rem;
  cursor: pointer;
}

.tv-controls .cta:disabled {
  opacity: 0.5;
  cursor: default;
}

.tv-controls .secondary-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
}

.round-select {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  max-width: 16rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  opacity: 0.6;
  font-size: 0.9rem;
}
