:root {
  --bg: #0c0a0d;
  --bg-raised: #17131a;
  --bg-sunken: #100d12;
  --border: #2a2230;
  --text: #ece6e1;
  --text-dim: #9a8f99;
  --accent: #e2362b;
  --accent-glow: rgba(226, 54, 43, 0.35);
  --radius: 12px;

  --r-fantastic: #22c55e;
  --r-great: #84cc16;
  --r-good: #eab308;
  --r-okay: #f59e0b;
  --r-meh: #f97316;
  --r-bad: #dc2626;
  --r-trash: #7f1d1d;
  --r-other: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, rgba(120, 20, 30, 0.25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 48px 16px 24px;
}
.logo {
  font-family: Creepster, Impact, fantasy;
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--accent);
  text-shadow: 0 0 24px var(--accent-glow), 0 4px 0 #3a0b0b;
}
.logo span { color: var(--text); font-size: 0.6em; }
.tagline { color: var(--text-dim); margin: 8px 0 28px; }

.years {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.years button {
  font: inherit;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 20px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.years button:hover { color: var(--text); border-color: var(--accent); }
.years button[aria-current="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}

.demo-banner {
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 8px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

/* ---------- Tonight banner ---------- */
.tonight {
  max-width: 760px;
  margin: 0 auto 32px;
  padding: 20px;
  border: 2px solid var(--accent);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(226, 54, 43, .16), var(--bg-raised) 60%);
  box-shadow: 0 0 32px var(--accent-glow);
}
.tonight-label {
  margin: 0 0 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tonight-heading {
  font-family: Creepster, Impact, fantasy;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  letter-spacing: .04em;
  color: var(--accent);
  line-height: 1.1;
}
.tonight-date {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text);
  padding: 6px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px;
  background: rgba(226, 54, 43, .12);
}
.tonight .feature {
  display: flex;
  align-items: center;
  gap: 20px;
}
.tonight .feature + .feature { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.feature-poster {
  position: relative;
  flex: 0 0 150px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
}
.feature-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.feature-body h2 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.15; }
.feature-year { margin: -4px 0 0; font-size: clamp(1.1rem, 3vw, 1.35rem); color: var(--text-dim); }
.feature-body .where { font-size: 15px; color: var(--text); }

@media (max-width: 480px) {
  .tonight { padding: 16px; }
  .tonight .feature { flex-direction: column; text-align: center; }
  .feature-poster { flex-basis: auto; width: 60%; }
  .feature-body { align-items: center; }
}

/* ---------- Summary chips ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 0 16px 48px; }
.summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  min-height: 32px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rating-color); }
.chip b { color: var(--text); font-weight: 600; }

/* ---------- Grid & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.card {
  --rating-color: var(--r-other);
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--rating-color) 60%, var(--border));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg-sunken);
}
.poster-art { position: absolute; inset: 0; display: block; }
.poster-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 16px;
  background:
    linear-gradient(to top, rgba(0,0,0,.85), transparent 70%),
    radial-gradient(circle at 30% 20%, hsl(var(--hue) 70% 30%), hsl(var(--hue) 60% 8%) 70%);
}
.placeholder .ph-title {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.placeholder .ph-year { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.day {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  padding: 4px 6px 6px;
  border-radius: 8px;
  background: rgba(12, 10, 13, .85);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(4px);
  line-height: 1;
}
.day small { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.day b { font-size: 20px; margin-top: 2px; }
.day.off-month small { color: var(--text-dim); }

.body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.body h2 { font-size: 15px; margin: 0; line-height: 1.3; }
.body h2 .yr { color: var(--text-dim); font-weight: 400; }
/* Keep "(1978)" together; the non-breaking space before it (app.js) ties it to the last word. */
.yr { white-space: nowrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.where { margin: 0; font-size: 12px; color: var(--text-dim); }

.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 999px;
  color: #0c0a0d;
  background: var(--rating-color);
}
.badge.unrated { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }

.synopsis {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.synopsis.missing { font-style: italic; opacity: .7; }
.card.expanded .synopsis { -webkit-line-clamp: unset; }
.more {
  align-self: flex-start;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.tier-0 { --rating-color: var(--r-fantastic); }
.tier-1 { --rating-color: var(--r-great); }
.tier-2 { --rating-color: var(--r-good); }
.tier-3 { --rating-color: var(--r-okay); }
.tier-4 { --rating-color: var(--r-meh); }
.tier-5 { --rating-color: var(--r-bad); }
.tier-6 { --rating-color: var(--r-trash); }
.tier-6 .badge { color: #fecaca; }
.tier-off { --rating-color: var(--r-other); }
.tier-off .badge { color: var(--text); }
.tier-na { --rating-color: transparent; }
.chip.tier-na .dot { border: 1px solid var(--text-dim); }

/* Loading skeleton / errors */
.skeleton { aspect-ratio: 2 / 3.9; border-radius: var(--radius); background: var(--bg-raised); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.message { grid-column: 1 / -1; text-align: center; color: var(--text-dim); padding: 48px 0; }

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 0 16px 32px;
}
.site-footer a { color: inherit; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .body { padding: 10px 10px 12px; }
  .placeholder .ph-title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
