/* =========================================================
   Team Movie Night – "Popcorn Night" theme
   Every colour lives here. Change the palette in one minute.
   ========================================================= */
:root {
  color-scheme: light;

  /* Base */
  --bg: #FFF5E1;             /* warm cream, like a popcorn bag */
  --surface: #FFFFFF;        /* cards and panels */
  --surface-2: #FFF9EE;      /* inputs, stubs */
  --text: #2B1B12;           /* dark cocoa */
  --text-muted: #6A5140;
  --line: #2B1B1224;

  /* Accents */
  --accent: #E23D28;         /* popcorn-box red: glows, icons, borders */
  --accent-ink: #C0301E;     /* darker red for text and buttons (5.7:1) */
  --on-accent: #FFFFFF;
  --butter: #F2B705;         /* butter yellow: glows, highlights */
  --butter-ink: #8A5A00;     /* darker butter for text (5.9:1) */
  --on-butter: #2B1B12;

  /* Poster art */
  --poster-1: #E23D28;
  --poster-2: #F2B705;
  --poster-3: #5A3521;
  --poster-4: #F28C28;
  --poster-light: #FFF5E1;
  --poster-dark: #2B1B12;

  /* Live background */
  --glow-1: #F2B705;
  --glow-2: #E23D28;
  --glow-opacity: 0.32;
  --dots: #F2B705;
  --dots-opacity: 0.22;
  --strip: #2B1B12;
  --strip-opacity: 0.07;
  --kernel: #FFFBF0;
  --kernel-edge: #E9B949;
  --kernel-opacity: 0.85;

  /* Shape and depth */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-color: #5A2D0F;
  --shadow: 0 10px 28px color-mix(in srgb, var(--shadow-color) 14%, transparent);
  --shadow-lift: 0 18px 40px color-mix(in srgb, var(--shadow-color) 22%, transparent);
  --focus: #1E6FD9;

  /* Type */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}

/* Dark palette: same family, toasted instead of just black */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1E1411;
  --surface: #2C1E18;
  --surface-2: #35251D;
  --text: #FBEBD3;
  --text-muted: #CDB59C;
  --line: #FBEBD324;
  --accent: #FF5A43;
  --accent-ink: #FF7A66;
  --on-accent: #1E1411;
  --butter: #FFC83D;
  --butter-ink: #FFC83D;
  --on-butter: #1E1411;
  --poster-1: #D8412C;
  --poster-2: #E8A93A;
  --poster-3: #7A4A30;
  --poster-4: #E27A2A;
  --glow-1: #FFB020;
  --glow-2: #FF4A30;
  --glow-opacity: 0.30;
  --dots: #FFC83D;
  --dots-opacity: 0.10;
  --strip: #FBEBD3;
  --strip-opacity: 0.06;
  --kernel: #FFF3D6;
  --kernel-edge: #FFC83D;
  --kernel-opacity: 0.55;
  --shadow-color: #000000;
  --shadow: 0 10px 28px color-mix(in srgb, var(--shadow-color) 40%, transparent);
  --shadow-lift: 0 18px 40px color-mix(in srgb, var(--shadow-color) 55%, transparent);
  --focus: #7DB8FF;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1E1411;
    --surface: #2C1E18;
    --surface-2: #35251D;
    --text: #FBEBD3;
    --text-muted: #CDB59C;
    --line: #FBEBD324;
    --accent: #FF5A43;
    --accent-ink: #FF7A66;
    --on-accent: #1E1411;
    --butter: #FFC83D;
    --butter-ink: #FFC83D;
    --on-butter: #1E1411;
    --poster-1: #D8412C;
    --poster-2: #E8A93A;
    --poster-3: #7A4A30;
    --poster-4: #E27A2A;
    --glow-1: #FFB020;
    --glow-2: #FF4A30;
    --glow-opacity: 0.30;
    --dots: #FFC83D;
    --dots-opacity: 0.10;
    --strip: #FBEBD3;
    --strip-opacity: 0.06;
    --kernel: #FFF3D6;
    --kernel-edge: #FFC83D;
    --kernel-opacity: 0.55;
    --shadow-color: #000000;
    --shadow: 0 10px 28px color-mix(in srgb, var(--shadow-color) 40%, transparent);
    --shadow-lift: 0 18px 40px color-mix(in srgb, var(--shadow-color) 55%, transparent);
    --focus: #7DB8FF;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}

h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 800; }
p { margin: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent-ink);
  color: var(--on-accent);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

main:focus { outline: none; }

/* ---------- Live background ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.scene__glow {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: var(--glow-opacity);
  will-change: transform;
}
.scene__glow--butter {
  background: var(--glow-1);
  top: -20vmax;
  left: -12vmax;
  animation: drift-a 26s ease-in-out infinite alternate;
}
.scene__glow--red {
  background: var(--glow-2);
  bottom: -28vmax;
  right: -18vmax;
  opacity: calc(var(--glow-opacity) * .7);
  animation: drift-b 32s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to { transform: translate3d(14vmax, 10vmax, 0) scale(1.1); }
}
@keyframes drift-b {
  to { transform: translate3d(-12vmax, -8vmax, 0) scale(0.92); }
}

/* Halftone dots, like old cinema print posters */
.scene__dots {
  position: absolute;
  inset: 0;
  background: radial-gradient(var(--dots) 1.2px, transparent 1.7px) 0 0 / 18px 18px;
  opacity: var(--dots-opacity);
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 55%, #000 100%);
  mask-image: linear-gradient(160deg, #000 0%, transparent 55%, #000 100%);
}

/* A slow film strip on the right edge */
.scene__strip {
  position: absolute;
  top: -20vh;
  right: 3vw;
  width: 78px;
  height: 140vh;
  transform: rotate(10deg);
  opacity: var(--strip-opacity);
  overflow: hidden;
}
.scene__strip-track {
  position: absolute;
  inset: -200px 0 0;
  background:
    repeating-linear-gradient(var(--strip) 0 10px, transparent 10px 20px) left / 12px 100% no-repeat,
    repeating-linear-gradient(var(--strip) 0 90px, transparent 90px 100px) center / 46px 100% no-repeat,
    repeating-linear-gradient(var(--strip) 0 10px, transparent 10px 20px) right / 12px 100% no-repeat;
  animation: strip-roll 12s linear infinite;
}
@keyframes strip-roll {
  to { transform: translate3d(0, 200px, 0); }
}

.scene__popcorn { position: absolute; inset: 0; }

/* One kernel: JS sets size, x, duration, delay, drift and spin */
.kernel {
  position: absolute;
  bottom: -60px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0;
  animation: kernel-rise var(--dur) linear var(--delay) infinite;
  will-change: transform, opacity;
}
.kernel svg { width: 100%; height: 100%; }
.kernel circle { fill: var(--kernel); stroke: var(--kernel-edge); stroke-width: 1.2; }

@keyframes kernel-rise {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--kernel-opacity); }
  85%  { opacity: var(--kernel-opacity); }
  100% { transform: translate3d(var(--drift), -115vh, 0) rotate(var(--spin)); opacity: 0; }
}

/* Popcorn that bursts out of the spin button */
.burst {
  position: fixed;
  width: 18px;
  height: 18px;
  z-index: 60;
  pointer-events: none;
  animation: burst 900ms cubic-bezier(.2, .7, .3, 1) forwards;
}
.burst circle { fill: var(--kernel); stroke: var(--kernel-edge); stroke-width: 1.2; }
@keyframes burst {
  0%   { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) rotate(var(--br)) scale(1); opacity: 0; }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand img { transition: transform .4s var(--ease-pop); }
.brand:hover img { transform: rotate(-12deg) scale(1.1); }

.theme-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(-8deg); box-shadow: var(--shadow-lift); }
.theme-toggle svg {
  position: absolute;
  inset: 11px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform .4s var(--ease-pop), opacity .3s ease;
}
.theme-toggle__moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
.is-dark .theme-toggle__sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.is-dark .theme-toggle__moon { opacity: 1; transform: none; fill: var(--butter); stroke: var(--butter); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 16px 56px;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px dashed var(--accent);
  margin-bottom: 20px;
}
h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: .98;
}
.hero__accent {
  color: var(--accent-ink);
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--butter) 55%, transparent) 62% 92%, transparent 92%);
}
.hero__lead {
  margin-top: 20px;
  max-width: 34ch;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* The marquee sign, with light bulbs around the edge */
.marquee {
  position: relative;
  background: var(--surface);
  border-radius: 22px;
  padding: 34px 28px 26px;
  box-shadow: var(--shadow-lift);
  text-align: center;
  isolation: isolate;
}
.marquee::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  background:
    radial-gradient(circle, var(--butter) 3px, transparent 3.5px) 0 0 / 22px 22px repeat-x,
    radial-gradient(circle, var(--butter) 3px, transparent 3.5px) 0 100% / 22px 22px repeat-x;
  z-index: -1;
  animation: bulbs 1.6s steps(2) infinite;
}
.marquee::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  background:
    radial-gradient(circle, var(--accent) 3px, transparent 3.5px) 11px 0 / 22px 22px repeat-x,
    radial-gradient(circle, var(--accent) 3px, transparent 3.5px) 11px 100% / 22px 22px repeat-x;
  z-index: -1;
  animation: bulbs 1.6s steps(2) .8s infinite;
}
@keyframes bulbs {
  50% { opacity: .25; }
}

.marquee__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 24px;
}
.marquee__stats div {
  padding: 8px 4px;
  border-right: 2px dashed var(--line);
}
.marquee__stats div:last-child { border-right: 0; }
.marquee__stats dt {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.marquee__stats dd {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  line-height: 1;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.marquee__hint {
  margin-top: 14px;
  font-size: .9rem;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 12px 12px 18px 18px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s var(--ease-pop), box-shadow .18s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(1px) scale(.98); transition-duration: .06s; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Striped like a popcorn box */
.btn--primary {
  color: var(--on-accent);
  background:
    repeating-linear-gradient(90deg, transparent 0 16px, color-mix(in srgb, var(--on-accent) 12%, transparent) 16px 32px),
    var(--accent-ink);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--accent-ink) 60%, var(--shadow-color)), var(--shadow);
}
.btn--primary:hover {
  box-shadow: 0 9px 0 color-mix(in srgb, var(--accent-ink) 60%, var(--shadow-color)), var(--shadow-lift);
}
.btn--primary:active {
  box-shadow: 0 2px 0 color-mix(in srgb, var(--accent-ink) 60%, var(--shadow-color)), var(--shadow);
}

.btn--ghost {
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}
.btn--ghost:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }

.btn--small { min-height: 40px; padding: 8px 16px; font-size: .92rem; }

.btn--spin { width: 100%; font-size: 1.25rem; min-height: 60px; }

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
  transform: scale(0);
  animation: ripple .6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(1); opacity: 0; }
}

/* Popcorn icon: three kernels that jump on hover */
.popcorn-icon {
  position: relative;
  width: 26px;
  height: 26px;
}
.popcorn-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 13px;
  background: repeating-linear-gradient(90deg, var(--on-accent) 0 3px, transparent 3px 6px);
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
}
.popcorn-icon i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--butter);
  border: 1.5px solid var(--on-accent);
  top: 4px;
  transition: transform .3s var(--ease-pop);
}
.popcorn-icon i:nth-child(1) { left: 3px; }
.popcorn-icon i:nth-child(2) { left: 8px; top: 0; }
.popcorn-icon i:nth-child(3) { left: 13px; }
.btn:hover .popcorn-icon i:nth-child(1) { transform: translate(-3px, -7px) rotate(-30deg); }
.btn:hover .popcorn-icon i:nth-child(2) { transform: translate(0, -10px); transition-delay: .05s; }
.btn:hover .popcorn-icon i:nth-child(3) { transform: translate(3px, -6px) rotate(30deg); transition-delay: .1s; }

/* Ticket icon that tilts like it's being torn */
.ticket-icon {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  background: var(--on-accent);
  -webkit-mask: radial-gradient(circle 3.5px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 3.5px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 3.5px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle 3.5px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
  transition: transform .3s var(--ease-pop);
}
.btn:hover .ticket-icon { transform: rotate(-14deg) translateY(-2px); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
}
.panel--form {
  position: sticky;
  top: 16px;
  background:
    repeating-linear-gradient(90deg, var(--accent) 0 14px, var(--surface) 14px 28px) top / 100% 10px no-repeat,
    var(--surface);
  padding-top: 34px;
}
.panel h2 { margin-bottom: 18px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.field label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}
input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--surface-2);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input::placeholder { color: var(--text-muted); opacity: 1; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
input:focus-visible, select:focus-visible {
  border-color: var(--accent);
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
input[aria-invalid="true"] { border-color: var(--accent-ink); }
.field__error { font-size: .85rem; color: var(--accent-ink); font-weight: 600; min-height: 0; }
.field__error:empty { display: none; }
.form .btn { margin-top: 6px; }
.form__note { margin: 16px 0 12px; font-size: .88rem; color: var(--text-muted); }

/* ---------- Lineup ---------- */
.lineup__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.field--inline { width: 150px; }
.field--inline input, .field--inline select { min-height: 42px; padding: 8px 10px; background: var(--surface); }
.lineup__status { min-height: 1.5em; margin-bottom: 8px; color: var(--text-muted); font-size: .92rem; }

.tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

/* A cinema ticket: poster · info · tear-off vote stub.
   The <li> carries the shadow, the inner card is cut with notches. */
.ticket {
  filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--shadow-color) 16%, transparent));
  transition: transform .25s var(--ease-pop), filter .25s ease;
}
.ticket:hover {
  transform: translateY(-5px) rotate(-.6deg);
  filter: drop-shadow(0 16px 22px color-mix(in srgb, var(--shadow-color) 24%, transparent));
}
.ticket__card {
  --notch: 11px;
  display: grid;
  grid-template-columns: 84px 1fr 72px;
  gap: 14px;
  height: 100%;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
}
.ticket.is-leader .ticket__card { background: linear-gradient(135deg, color-mix(in srgb, var(--butter) 18%, var(--surface)), var(--surface) 60%); }

.ticket__poster svg { width: 84px; height: 120px; border-radius: 8px; }
.p-1 { fill: var(--poster-1); }
.p-2 { fill: var(--poster-2); }
.p-3 { fill: var(--poster-3); }
.p-4 { fill: var(--poster-4); }
.p-light { fill: var(--poster-light); }
.p-dark { fill: var(--poster-dark); }

.ticket__body { min-width: 0; display: flex; flex-direction: column; }
.ticket__no {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent-ink);
}
.ticket__title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.ticket__meta { font-size: .88rem; color: var(--text-muted); margin-top: 4px; }
.ticket__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }

.icon-btn {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--butter-ink); color: var(--butter-ink); }
.icon-btn--danger:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

.ticket__stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-left: 2.5px dashed var(--line);
  margin: -14px -14px -14px 0;
  padding: 10px 4px;
  background: var(--surface-2);
}
.ticket__votes {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--butter-ink);
  font-variant-numeric: tabular-nums;
}
.ticket__votes.bump { animation: bump .35s var(--ease-pop); }
@keyframes bump { 50% { transform: scale(1.35); } }

.vote-btn {
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s var(--ease-pop), background-color .15s ease, color .15s ease;
}
.vote-btn:hover { background: color-mix(in srgb, var(--butter) 30%, transparent); color: var(--text); transform: translateY(-2px); }
.vote-btn[data-action="down"]:hover { transform: translateY(2px); }
.vote-btn:active { transform: scale(.9); }

.empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  border: 2.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

/* Watched stubs */
.watched-title { margin: 48px 0 16px; }
.stubs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stub {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 4px dotted var(--accent);
  box-shadow: var(--shadow);
  font-weight: 600;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s var(--ease-pop);
}
.stub:hover { transform: rotate(0) translateY(-3px); }
.stub .icon-btn { font-size: .75rem; }
.stubs .empty { width: 100%; padding: 18px; }

/* ---------- Reel dialog ---------- */
.reel-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 28px 24px 24px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lift);
  text-align: center;
}
.reel-dialog::backdrop {
  background: color-mix(in srgb, var(--poster-dark) 60%, transparent);
  backdrop-filter: blur(4px);
}
.reel-dialog[open] { animation: dialog-in .35s var(--ease-pop); }
@keyframes dialog-in {
  from { transform: translateY(24px) scale(.94); opacity: 0; }
}
.reel-dialog h2 { font-size: 1.5rem; }

.reel {
  margin: 20px auto;
  padding: 0 22px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(var(--text) 0 8px, transparent 8px 16px) left 6px top / 10px 100% no-repeat,
    repeating-linear-gradient(var(--text) 0 8px, transparent 8px 16px) right 6px top / 10px 100% no-repeat,
    var(--surface-2);
  border: 2px solid var(--line);
}
.reel__window {
  --row: 56px;
  position: relative;
  height: calc(var(--row) * 3);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.reel__window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--row);
  height: var(--row);
  border-block: 2px solid var(--accent);
  pointer-events: none;
}
.reel__track { list-style: none; margin: 0; padding: 0; will-change: transform; }
.reel__track li {
  height: var(--row);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel-dialog__result { min-height: 3em; font-size: 1.05rem; }
.reel-dialog__result strong { color: var(--accent-ink); }
.reel-dialog__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }

/* ---------- Footer ---------- */
.footer {
  padding: 28px 16px 36px;
  text-align: center;
  font-size: .9rem;
  color: var(--text-muted);
  border-top: 2px dashed var(--line);
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s var(--ease-pop); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; }
  .layout { grid-template-columns: 1fr; }
  .panel--form { position: static; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .hero { padding-bottom: 40px; }
  .hero__lead { font-size: 1.05rem; }
  .marquee { padding: 30px 16px 22px; }
  .marquee__stats dt { font-size: .68rem; }
  .toolbar { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar .field--inline { width: auto; }
  .toolbar .field--inline:first-child { grid-column: 1 / -1; }
  .tickets { grid-template-columns: 1fr; }
  .ticket__card { grid-template-columns: 64px 1fr 60px; gap: 12px; }
  .ticket__poster svg { width: 64px; height: 92px; }
  .scene__strip { right: -30px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .scene__popcorn { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* New tickets pop in (only the first time they appear) */
.ticket.is-new { animation: ticket-in .55s var(--ease-pop) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes ticket-in {
  from { opacity: 0; transform: translateY(26px) rotate(1.5deg) scale(.96); }
}
