:root {
  --bg: #140a18;
  --bg-2: #1d1026;
  --wood: #3a2416;
  --wood-edge: #5a3820;
  --gold: #f0c14b;
  --gold-2: #ffd978;
  --cream: #f7ead0;
  --muted: #cbbba0;
  --crimson: #c41e3a;
  --purple: #8a2be2;
  --pink: #ff7ad9;
  --ink: #1a1010;
  --card: #22162c;
  --radius: 14px;
  --tap: 44px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, #2a1438 0%, var(--bg) 42%),
    var(--bg);
  color: var(--cream);
  min-height: 100vh;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 10;
}

.masthead {
  text-align: center;
  padding: 28px 20px 10px;
}
.kicker {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
}
.masthead h1 {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  margin: 8px 0 6px;
  color: var(--gold-2);
  text-shadow: 0 0 24px rgba(240, 193, 75, 0.25);
  line-height: 0.95;
}
.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(to bottom, rgba(20,10,24,0.96), rgba(20,10,24,0.88) 70%, transparent);
}
.filters button {
  min-height: var(--tap);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(240, 193, 75, 0.35);
  background: #2a1b33;
  color: var(--cream);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.filters button[aria-pressed="true"],
.filters button:focus-visible {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  outline: none;
}

.shelf {
  margin: 12px auto 28px;
  max-width: 1280px;
  padding: 0 16px;
}
.shelf h2 {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  color: var(--gold);
  font-size: 1.35rem;
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background: linear-gradient(#2a1a12, #4a2e18);
  border: 6px solid var(--wood-edge);
  border-radius: 8px;
  padding: 14px;
  box-shadow: inset 0 8px 0 rgba(0,0,0,0.25), var(--shadow);
}

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1240px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.tile {
  appearance: none;
  border: 0;
  padding: 0;
  background: var(--ink);
  color: inherit;
  text-align: left;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: 0 8px 0 #1a0d08;
  position: relative;
  font: inherit;
}
.tile:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #111;
}
.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 4px;
  line-height: 1;
}
.badge-start { background: var(--gold); color: var(--ink); }
.badge-jd { background: var(--crimson); color: #fff; }

.tile-body {
  padding: 8px 9px 10px;
  background: var(--card);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}
.year { color: var(--gold); font-size: 0.78rem; font-weight: 700; }
.hook {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
  flex: 1;
}
.meters { display: grid; gap: 3px; }
.meter {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.pips { display: flex; gap: 3px; }
.pip {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #3a2a45;
}
.pip.on.cheese { background: var(--gold); }
.pip.on.beef { background: var(--pink); }
.pip.on.scare { background: var(--crimson); }

.watch {
  display: block;
  min-height: var(--tap);
  line-height: var(--tap);
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.82rem;
  background: var(--purple);
  color: #fff;
  border-radius: 0;
}
.watch.rent { background: #6a3a16; }
.watch.off { background: #3a3a3a; color: #bbb; pointer-events: none; }

.coming, .colophon {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px 32px;
}
.coming h2 {
  color: var(--gold);
  font-family: Palatino, Georgia, serif;
  font-size: 1.2rem;
}
.coming-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 800px) {
  .coming-row { grid-template-columns: repeat(4, 1fr); }
}
.empty-slot {
  border: 2px dashed rgba(240,193,75,0.35);
  border-radius: var(--radius);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--muted);
}
.empty-slot span { color: var(--gold); font-weight: 800; }
.colophon { color: var(--muted); font-size: 0.85rem; }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
}
@media (min-width: 800px) {
  .modal { place-items: center; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
}
.sheet {
  position: relative;
  background: var(--bg-2);
  width: min(920px, 100%);
  max-height: min(92vh, 100%);
  overflow: auto;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 800px) {
  .sheet { border-radius: 20px; padding: 22px; }
}
.close {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  float: right;
  margin: 0 0 10px 10px;
}
.sheet-grid {
  display: grid;
  gap: 16px;
  clear: both;
}
@media (min-width: 800px) {
  .sheet-grid { grid-template-columns: 260px 1fr; align-items: start; }
}
.sheet-grid img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.sheet h2 {
  font-family: Palatino, Georgia, serif;
  margin: 0 0 4px;
  font-size: 1.8rem;
  color: var(--gold-2);
}
.sheet .lead { color: var(--cream); font-size: 1.05rem; }
.commentary { color: var(--muted); line-height: 1.5; }
.sheet .watch { border-radius: 10px; margin-top: 8px; }
.sheet .badges { position: static; flex-direction: row; margin: 8px 0; }

.badge-seen { background: #6d6a62; color: #f7ead0; }
.shelf.lead-shelf h2 { font-size: 1.6rem; }
.shelf.lead-shelf .grid { border-color: var(--gold); }

.filters button .count {
  opacity: 0.7;
  font-weight: 600;
  font-size: 0.75em;
}
.tile-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 0 #1a0d08;
}
.tile-wrap .tile { box-shadow: none; border-radius: 0; flex: 1; }
.tile-wrap .watch { width: 100%; }

.own-words {
  max-width: 1280px;
  margin: 8px auto 28px;
  padding: 0 16px;
}
.own-words h2 {
  font-family: Palatino, Georgia, serif;
  color: var(--gold);
  font-size: 1.35rem;
  margin: 0 0 6px;
}
.own-lead {
  margin: 0 0 12px;
  color: var(--muted);
}
.words-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 700px) {
  .words-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .words-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.words-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  padding: 16px;
  background: var(--card);
  border: 2px solid rgba(240, 193, 75, 0.35);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.words-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.words-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.words-card h3 {
  margin: 0;
  font-family: Palatino, Georgia, serif;
  font-size: 1.15rem;
  color: var(--gold-2);
}
.words-card p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}
.words-go {
  display: block;
  min-height: var(--tap);
  line-height: var(--tap);
  text-align: center;
  font-weight: 800;
  font-size: 0.82rem;
  background: var(--purple);
  color: #fff;
  border-radius: 10px;
}
