:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #ddd;
  --accent: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --fg: #e8e8e8;
    --muted: #9a9a9a;
    --border: #333;
    --accent: #ff6b5e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem;
  max-width: 900px;
  margin-inline: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

header h1 {
  margin-bottom: 0.25rem;
}

.updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0;
}

.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.filters input,
.filters select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg);
  color: var(--fg);
}

.filters input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
}

.filters select {
  flex: 0 1 220px;
}

#no-results {
  color: var(--muted);
  font-style: italic;
  margin: 2rem 0;
}

.theater {
  margin: 2rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.theater h2 {
  margin-bottom: 0.1rem;
}

.address {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0;
}

.source-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
}

.cross-check-note {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 0.75rem;
  vertical-align: middle;
  margin-left: 0.35rem;
  white-space: nowrap;
  cursor: help;
}

.badge-verified { background: #1e7a3c22; color: #1e7a3c; }
.badge-partial { background: #b3872622; color: #b38726; }
.badge-mismatch, .badge-unverified { background: #66666622; color: var(--muted); }

@media (prefers-color-scheme: dark) {
  .badge-verified { background: #3ddc8433; color: #3ddc84; }
  .badge-partial { background: #ffcc4d33; color: #ffcc4d; }
}

.imdb-link {
  font-size: 0.7rem;
  font-weight: 700;
  color: #f5c518;
  background: #1a1a1a;
  padding: 0.05rem 0.3rem;
  border-radius: 0.2rem;
  text-decoration: none;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.imdb-link:hover { opacity: 0.85; }
.imdb-link.imdb-ambiguous { border: 1px dashed #f5c518; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.5rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.title { font-weight: 600; }
.meta, .cinema { color: var(--muted); }
.price { white-space: nowrap; }
.price-unavailable {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  cursor: help;
}
.empty { color: var(--muted); font-style: italic; }

.theater-error {
  color: var(--accent);
  font-size: 0.9rem;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

footer a { color: inherit; }

.back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
  body { padding: 1rem; }
  header h1 { font-size: 1.5rem; }

  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }

  td {
    border: none;
    padding: 0.15rem 0;
    white-space: normal;
    word-break: break-word;
  }
  td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: block;
  }
  td.title[data-label]::before { display: none; }

  tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }

  .back-to-top.visible { display: flex; }
}
