:root {
  --night: #1c1446;
  --night-deep: #0f0b2a;
  --dusk: #3a2a78;
  --horizon: #5a3a96;
  --neon: #ff2d6f;
  --neon-glow: rgba(255, 45, 111, .55);
  --teal: #44e3c8;
  --bulb: #ffd36b;
  --bulb-off: #6b5a2c;
  --board: #f2e8cd;
  --board-ink: #1d1a17;
  --text: #ece6ff;
  --muted: #a89fd0;
  --line: rgba(236, 230, 255, .14);
  --card-green: #a6e27a;
  --card-red: #c8352b;

  --display: "Monoton", "Bungee", Impact, sans-serif;
  --marquee: "Bungee", Impact, sans-serif;
  --type: "Special Elite", "Courier New", serif;
  --card: "Patua One", Georgia, serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--night-deep); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 17px/1.6 var(--type);
  /* Night sky: deep indigo overhead, purple toward a faintly glowing horizon. */
  background:
    radial-gradient(ellipse 120% 45% at 50% 100%, rgba(150, 90, 200, .35), transparent 70%),
    linear-gradient(180deg, var(--night-deep) 0, var(--night) 30%, var(--dusk) 70%, var(--horizon) 100%);
  background-attachment: fixed;
  isolation: isolate; /* lets the starfield below sit between this background and the content */
}

/* Starfield: one randomly scattered sky (site/stars.svg), stretched to cover the window, never tiled. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background: url("stars.svg") center top / cover no-repeat;
  /* Stars fade out toward the glowing horizon. */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 45%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0, #000 45%, transparent 90%);
}

a { color: var(--teal); }
a:hover { color: #fff; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Constellations: fixed in the sky like the starfield, behind everything. */
.sky-figures { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.constellation { position: absolute; overflow: visible; }
.c-hat { left: 2.5vw; top: 34px; width: clamp(150px, 16vw, 240px); transform: rotate(-5deg); }
.c-bolo { right: 3vw; top: 22px; width: clamp(80px, 9vw, 130px); transform: rotate(7deg); }
.c-lines line { stroke: rgba(205, 190, 255, .28); stroke-width: 1; vector-effect: non-scaling-stroke; }
.c-stars circle { fill: #fff; filter: drop-shadow(0 0 3px rgba(220, 210, 255, .9)); }

@media (max-width: 720px) {
  .sky-figures { opacity: .55; }
  .c-hat { left: -10px; top: 6px; width: 110px; }
  .c-bolo { right: -4px; top: 4px; width: 56px; }
}

/* ---- Neon sign ---- */

.sign { text-align: center; padding: 48px 16px 8px; }

.neon { margin: 0; font-weight: 400; line-height: 1; }

.neon-small {
  display: block;
  font: 400 clamp(22px, 4vw, 34px)/1 var(--marquee);
  color: var(--teal);
  text-shadow: 0 0 6px rgba(68, 227, 200, .7), 0 0 22px rgba(68, 227, 200, .4);
  transform: rotate(-4deg);
  margin-bottom: 8px;
}

.neon-big {
  display: block;
  font: 400 clamp(34px, 8.5vw, 92px)/1.05 var(--display);
  color: #ffd9e5;
  text-shadow:
    0 0 4px #fff,
    0 0 10px var(--neon),
    0 0 26px var(--neon),
    0 0 60px var(--neon-glow);
  animation: flicker 2.6s ease-out 1 both;
}

/* The first T's tube is shot: it lights with the sign, sputters a few seconds later, then dies for good. */
.tube { animation: burnout 2.4s step-end 4s 1 forwards; }

@keyframes burnout {
  0%, 18%, 30%, 58% { color: inherit; text-shadow: inherit; }
  15%, 22%, 50%, 62%, 100% {
    color: #4a2a3a;
    text-shadow: 0 0 2px rgba(255, 45, 111, .15);
  }
}

@keyframes flicker {
  0%, 8%, 12%, 30%, 34% { opacity: .15; text-shadow: none; }
  10%, 32%, 100% { opacity: 1; }
}

/* ---- Picker ---- */

.picker {
  display: flex; flex-wrap: wrap; gap: 10px;
  max-width: 880px; margin: 28px auto 0; padding: 0 16px;
}

.combo { position: relative; flex: 1 1 300px; min-width: 0; }

.picker input,
.picker select,
.picker button {
  font: 16px/1.2 var(--type);
  color: var(--text);
  background: rgba(12, 10, 29, .75);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  min-height: 48px;
}

.picker input { width: 100%; }
.picker input::placeholder { color: var(--muted); }
.picker input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(68, 227, 200, .25); }

.picker select { flex: 0 1 250px; min-width: 0; cursor: pointer; }

.picker button {
  font-family: var(--marquee);
  color: var(--board-ink);
  background: var(--bulb);
  border-color: var(--bulb);
  cursor: pointer;
}
.picker button:hover { background: #ffe39b; }

#results {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  max-height: min(60vh, 420px); overflow-y: auto;
  background: var(--night-deep);
  border: 2px solid var(--teal);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}

#results li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
}
#results li[aria-selected="true"] { background: var(--dusk); }
#results .r-title { flex: 1; }
#results .r-year { color: var(--muted); }
#results .r-stars { color: var(--bulb); white-space: nowrap; font-size: 14px; }
#results .r-empty { color: var(--muted); cursor: default; }

/* ---- Feature ---- */

main { max-width: 1040px; margin: 40px auto 0; padding: 0 16px; }

.loading, .error { text-align: center; color: var(--muted); }

/* The marquee: a letter board ringed with chaser bulbs. */
.marquee {
  --bulb-gap: 22px;
  position: relative;
  padding: 26px;
  background: #3b1020;
  border-radius: 10px;
  box-shadow: 0 0 0 4px #1d0710, 0 20px 60px rgba(0, 0, 0, .55), 0 0 80px rgba(255, 45, 111, .18);
}

.marquee::before,
.marquee::after {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 6px;
  pointer-events: none;
  background:
    radial-gradient(circle, var(--bulb) 0 4px, transparent 5px) 0 0 / var(--bulb-gap) var(--bulb-gap) repeat-x,
    radial-gradient(circle, var(--bulb) 0 4px, transparent 5px) 0 100% / var(--bulb-gap) var(--bulb-gap) repeat-x,
    radial-gradient(circle, var(--bulb) 0 4px, transparent 5px) 0 0 / var(--bulb-gap) var(--bulb-gap) repeat-y,
    radial-gradient(circle, var(--bulb) 0 4px, transparent 5px) 100% 0 / var(--bulb-gap) var(--bulb-gap) repeat-y;
  filter: drop-shadow(0 0 4px var(--bulb));
}
/* Second ring is offset by half a bulb and blinks against the first, so the lights chase. */
.marquee::after {
  inset: 8px calc(8px + var(--bulb-gap) / 2);
  background:
    radial-gradient(circle, var(--bulb) 0 4px, transparent 5px) 0 0 / var(--bulb-gap) var(--bulb-gap) repeat-x,
    radial-gradient(circle, var(--bulb) 0 4px, transparent 5px) 0 100% / var(--bulb-gap) var(--bulb-gap) repeat-x;
  animation: chase 1.1s steps(1) infinite;
}
.marquee::before { animation: chase 1.1s steps(1) infinite reverse; }

@keyframes chase { 50% { opacity: .25; } }

.board {
  position: relative;
  background:
    repeating-linear-gradient(180deg, transparent 0 62px, rgba(0, 0, 0, .09) 62px 64px),
    var(--board);
  border-radius: 3px;
  padding: 22px 20px 20px;
  text-align: center;
  color: var(--board-ink);
  box-shadow: inset 0 0 30px rgba(120, 90, 30, .25);
}

.board h2 {
  margin: 0;
  font: 400 clamp(26px, 5.4vw, 56px)/1.15 var(--marquee);
  letter-spacing: .04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.board .tagline {
  margin: 10px 0 0;
  font: 400 clamp(15px, 2.2vw, 20px)/1.3 var(--marquee);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9c1b3f;
}

/* ---- Feature body ---- */

.feature-body {
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: 36px;
  margin-top: 36px;
  align-items: start;
}

.poster {
  margin: 0;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: var(--night-deep);
  border: 2px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .no-poster {
  height: 100%; display: grid; place-items: center; padding: 16px;
  text-align: center; color: var(--muted);
}

.imdb { margin-top: 18px; font-size: 15px; }
.imdb p { margin: 0 0 10px; }
.imdb .facts { color: var(--muted); }
.imdb .plot { color: var(--text); }
.imdb .score { font-family: var(--marquee); color: var(--bulb); font-size: 15px; }
.imdb .score span { font-family: var(--type); color: var(--muted); }

.imdb-link {
  display: inline-block; margin-top: 4px; padding: 8px 14px;
  font: 15px/1.2 var(--marquee);
  color: var(--board-ink); background: var(--bulb);
  border-radius: 4px; text-decoration: none;
}
.imdb-link:hover { color: var(--board-ink); background: #ffe39b; }

.noms h3 {
  margin: 0 0 14px;
  font: 400 clamp(26px, 3.6vw, 36px)/1.1 var(--display);
  color: #ffd9e5;
  text-shadow: 0 0 8px var(--neon), 0 0 22px var(--neon-glow);
}

/* Totals mirror the on-screen card (same face and colors as the cytube totals card):
   green title, red rule, centered cream lines. */
.totals {
  padding: 8px 24px 0;
  text-align: center;
}

.totals h3 {
  margin: 0;
  font: 400 clamp(32px, 4.4vw, 46px)/1.02 var(--card);
  color: var(--card-green);
  text-shadow: 2px 2px 0 #10140c, 0 0 10px rgba(0, 0, 0, .75);
}

.totals h3::after {
  content: "";
  display: block;
  width: min(80%, 360px); height: 3px;
  margin: 10px auto 14px;
  background: var(--card-red);
  box-shadow: 1px 1px 0 #000;
}

.totals ul {
  margin: 0; padding: 0; list-style: none;
  font-family: var(--card);
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.22;
  color: #fff;
  text-shadow: 2px 2px 0 #000, 0 0 6px rgba(0, 0, 0, .85);
}
.totals li { margin-top: .32em; text-wrap: balance; }

.rating {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  margin: 26px 0 0;
}
.stars { display: inline-flex; gap: 4px; }
.star {
  width: 34px; height: 34px;
  background: linear-gradient(90deg, var(--bulb) var(--fill), var(--bulb-off) var(--fill));
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.stars[data-lit="true"] { filter: drop-shadow(0 0 6px rgba(255, 211, 107, .6)); }
.rating .said { font-size: 20px; }
.rating .unrated { color: var(--muted); }

.noms { margin-top: 36px; }
.noms h3 { font-size: clamp(22px, 3vw, 30px); }
.noms p { margin: 0; }
.hall {
  display: inline-block; margin-top: 14px; padding: 6px 12px;
  font: 15px/1.2 var(--marquee);
  color: var(--teal);
  border: 2px solid var(--teal);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(68, 227, 200, .35), inset 0 0 12px rgba(68, 227, 200, .2);
}

.aired {
  margin-top: 36px; padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.aired p { margin: 0 0 4px; }

/* ---- Footer ---- */

.credits {
  max-width: 720px; margin: 80px auto 0; padding: 0 16px 48px;
  text-align: center; color: var(--muted); font-size: 14px;
}
.signoff {
  margin-top: 18px;
  font: 400 22px/1.2 var(--marquee);
  color: var(--teal);
  text-shadow: 0 0 10px rgba(68, 227, 200, .5);
}

/* ---- Small screens ---- */

@media (max-width: 720px) {
  .sign { padding-top: 32px; }
  .picker select, .picker button { flex: 1 1 140px; }
  .neon-big { font-size: clamp(30px, 10.5vw, 44px); }
  .marquee { --bulb-gap: 18px; padding: 20px; }
  .feature-body { grid-template-columns: 1fr; gap: 28px; }
  .poster-col { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
  .imdb { margin-top: 0; }
  .star { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .neon-big, .marquee::before, .marquee::after { animation: none; }
  .tube { animation: none; color: #4a2a3a; text-shadow: 0 0 2px rgba(255, 45, 111, .15); }
}
