@font-face {
  font-family: Manrope;
  src: url("manrope-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --canvas: #101011;
  --ink: #f8f7f7;
  --muted: #b7b4b7;
  --red: #cc2935;
  --display: Manrope, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 1rem/1.5 system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #ff8890; outline-offset: 4px; }
.shell { width: min(74rem, calc(100% - 4rem)); margin-inline: auto; }
.masthead { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: flex; align-items: center; gap: .6rem; font-weight: 750; letter-spacing: -.025em; }
.wordmark-icon { color: #f34e56; font-size: 1.35rem; }

h1, h2, h3, p { margin: 0; }
main { padding-bottom: 3rem; }
.draw-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: clamp(22rem, 35vw, 28rem);
  padding: 2.5rem clamp(1.4rem, 5.9vw, 4.8rem);
  overflow: hidden;
  border-radius: .7rem;
  background: #1a1518;
}
.draw-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 94% 35%, #771b29, #3b1822 34%, transparent 72%),
              linear-gradient(112deg, #181719 18%, #22171c 80%);
  transition: opacity .68s, transform .8s;
}
.draw-stage[data-spinning]::before { opacity: .65; }
.draw-stage[data-won]::before { transform: scale(1.2); }
.stage-content { max-width: 51rem; min-width: 0; }
.stage-label { margin-bottom: .64rem; color: #efa3a8; font-size: .85rem; font-weight: 650; }
.stage-label:empty { display: none; }
h1 {
  font: 600 clamp(3rem, 7vw, 6.25rem)/1.02 var(--display);
  letter-spacing: -.064em;
  word-spacing: .02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.stage-description { margin-top: .9rem; color: #ddd7da; overflow-wrap: anywhere; }
.stage-action { margin-top: 1.6rem; }
.button {
  min-height: 2.75rem;
  padding: .5rem .9rem;
  border: 1px solid #484548;
  border-radius: .35rem;
  background: #242325;
  color: var(--ink);
  font-weight: 650;
  transition: background .16s;
}
.button:hover { background: #343235; }
.button-primary {
  min-height: 3rem;
  padding-inline: 1.18rem;
  border-color: transparent;
  background: var(--red);
  color: #fff;
  font-weight: 750;
}
.button-primary:hover { background: #d52d39; }
.button[aria-disabled="true"] { opacity: .62; cursor: default; }

.roster { margin-top: 2rem; }
.lineup-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.lineup-heading h2 { font: 600 clamp(1.38rem, 3vw, 1.8rem)/1.15 var(--display); letter-spacing: -.045em; }
#count { color: var(--muted); font-size: .875rem; }
#lineup { margin: 0; padding: 0; list-style: none; }
#lineup li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .55fr);
  align-items: baseline;
  gap: .6rem 1rem;
  min-height: 3rem;
  padding: .75rem .1rem;
  border-top: 1px solid #2b292c;
  overflow-wrap: anywhere;
}
#lineup h3 { font-size: 1rem; font-weight: 650; }
#lineup p { color: var(--muted); font-size: .875rem; text-align: right; }
#lineup li[data-won] h3 { color: #ff888e; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nomination-dialog { width: min(29rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.5rem; border: 1px solid #47434a; border-radius: .65rem; background: #1b191c; color: var(--ink); }
dialog::backdrop { background: #0c0a0cbd; backdrop-filter: blur(5px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-header h2 { font: 600 1.65rem var(--display); letter-spacing: -.04em; }
.icon-button { padding: .2rem .6rem; border: 0; background: transparent; color: var(--ink); font-size: 1.5rem; }
.nomination-form { display: grid; gap: 1rem; margin-top: 1.2rem; }
.nomination-form label { display: block; margin-bottom: .25rem; font-weight: 650; }
.nomination-form input { width: 100%; min-height: 2.8rem; padding: .5rem .75rem; border: 1px solid #615962; border-radius: .35rem; background: #141315; color: var(--ink); }
.nomination-form input::placeholder { color: var(--muted); }
.form-status { color: #ff9ca2; }
.form-status:empty, .toast:empty { display: none; }
.toast { position: fixed; bottom: 1rem; left: 50%; max-width: calc(100% - 2rem); padding: .6rem .9rem; transform: translateX(-50%); border-radius: .35rem; background: var(--ink); color: #201920; overflow-wrap: anywhere; }

@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .masthead { min-height: 4rem; }
  .draw-stage { min-height: 20rem; }
  .roster { margin-top: 1.5rem; }
  #lineup li { grid-template-columns: 1fr; gap: .15rem; }
  #lineup p { text-align: left; }
}

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


/* Lineup and draw */
.shell { width: min(69rem, calc(100% - 4rem)); }
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(16rem, 1fr);
  align-items: start;
  gap: 1.2rem;
  margin-top: clamp(1rem, 3.5vw, 2.75rem);
}
.roster, .draw-stage { border-radius: .9rem; }
.roster { margin: 0; padding: clamp(1.25rem, 3vw, 2rem); background: #1d1c20; border: 1px solid #383439; }
.roster-head { margin-bottom: 1.15rem; }
.lineup-heading { align-items: end; margin-bottom: 1.15rem; }
.lineup-heading h1 { font-size: clamp(2rem, 4.3vw, 3.2rem); }
#count { margin-top: .42rem; }
.nominate-action { width: min(100%, 19rem); min-height: 3.3rem; font-size: 1.04rem; }
.nominate-action span { margin-right: .28rem; font-size: 1.15em; }
#admin-toggle[aria-pressed="true"] { border-color: #ff8890; color: #ffc2c5; }
#lineup li { min-height: 3.75rem; align-items: center; }
#lineup li[data-admin] { grid-template-columns: minmax(0, 1fr) minmax(0, .55fr) 2.75rem; padding-block: .35rem; }
.remove-movie {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: #eec2c6;
  font-size: 1.5rem;
}
.remove-movie:hover { background: #452329; }
button:disabled { opacity: .45; cursor: default; }
.empty-lineup { padding-block: 1rem; border-top: 1px solid #2b292c; color: var(--muted); }

.draw-stage {
  min-height: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid #7f3946;
  background: #46202a;
}
.draw-stage::before {
  background: radial-gradient(ellipse at 95% 0%, #802c3e, transparent 76%), #431c28;
}
.stage-content { display: grid; gap: 1.25rem; }
.draw-stage h2 { font: 600 clamp(1.65rem, 3vw, 2.15rem)/1.12 var(--display); letter-spacing: -.04em; overflow-wrap: anywhere; }
.stage-action { margin: 0; min-height: 2.9rem; border-color: transparent; background: #fff1f2; color: #381923; }
.stage-action:hover { background: #ffdde2; }
.stage-description { margin-top: .5rem; font-size: .94rem; }
.stage-description:empty { display: none; }
.draw-stage[data-won] .stage-content { display: block; }
#reset-description { margin-top: .5rem; color: var(--muted); }
.reset-actions { display: flex; justify-content: end; gap: .5rem; margin-top: 1.25rem; }

@media (max-width: 44rem) {
  .shell { width: calc(100% - 2rem); }
  .dashboard { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "draw" "list"; gap: .8rem; }
  .roster { display: contents; }
  .roster-head, .roster-list { background: #1d1c20; border: 1px solid #383439; border-radius: .72rem; }
  .roster-head { grid-area: head; margin: 0; padding: 1rem; }
  .roster-list { grid-area: list; padding: 0 .9rem; }
  #lineup li:first-child, .empty-lineup { border-top: 0; }
  .nominate-action { width: 100%; }
  .draw-stage { grid-area: draw; padding: .9rem 1rem; }
  .stage-content { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
  .draw-stage h2 { font-size: 1.3rem; }
  .stage-description { margin-top: .25rem; font-size: .86rem; }
  .stage-action { padding-inline: .55rem; font-size: .88rem; }
  .draw-stage[data-spinning] .stage-content, .draw-stage[data-won] .stage-content { grid-template-columns: minmax(0, 1fr); }
  #lineup li[data-admin] { grid-template-columns: minmax(0, 1fr) 2.75rem; }
  #lineup li[data-admin] p { grid-column: 1; grid-row: 2; }
  #lineup li[data-admin] .remove-movie { grid-column: 2; grid-row: 1 / 3; }
}


/* Ambient light and transitions */
:root { --canvas: #1b1b23; }
body { min-height: 100vh; isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 16% 12%, #3a364c 0%, transparent 58%),
              radial-gradient(ellipse at 90% 68%, #3d2c38 0%, transparent 54%);
  animation: ambient-light 30s ease-in-out infinite alternate;
}
@keyframes ambient-light {
  from { opacity: .62; }
  to { opacity: 1; }
}
.roster, .roster-head, .roster-list { background-color: #24232b; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
#undo-changes:not([hidden]), #reset-lineup:not([hidden]), .toast:not(:empty) {
  animation: glide-in .22s ease-out both;
}
@keyframes glide-in {
  from { opacity: 0; transform: translateY(.25rem); }
}
.nomination-dialog {
  opacity: 0;
  transform: translateY(.55rem) scale(.985);
  transition: opacity .23s ease, transform .23s ease,
              display .23s allow-discrete, overlay .23s allow-discrete;
}
.nomination-dialog[open] { opacity: 1; transform: none; }
dialog::backdrop { opacity: 0; transition: opacity .23s ease, display .23s allow-discrete, overlay .23s allow-discrete; }
dialog[open]::backdrop { opacity: 1; }
@starting-style {
  .nomination-dialog[open] { opacity: 0; transform: translateY(.55rem) scale(.985); }
  dialog[open]::backdrop { opacity: 0; }
}
.draw-stage[data-won] .draw-copy { animation: glide-in .35s ease-out both; }
@media (max-width: 27rem) {
  .masthead { flex-wrap: wrap; padding-block: .5rem; }
}


/* Admin mode and responsive feedback */
.admin-notice {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .26s ease, opacity .2s ease;
}
.admin-notice-inner { min-height: 0; overflow: hidden; }
.admin-notice p {
  margin-bottom: 1rem;
  padding: .58rem .75rem;
  border-left: 3px solid #e9ad60;
  border-radius: .25rem;
  background: #b7864620;
  color: #ffdca7;
  font-size: .86rem;
}
.admin-notice strong { margin-right: .35rem; }
body[data-admin-mode] .admin-notice { grid-template-rows: 1fr; opacity: 1; }
.roster, .roster-head, .roster-list { transition: border-color .24s, background-color .24s, box-shadow .24s; }
body[data-admin-mode] :is(.roster, .roster-head, .roster-list) {
  border-color: #9b7349;
  background-color: #2b2529;
  box-shadow: 0 0 24px #dbab5020;
}
body[data-admin-mode] #admin-toggle { background: #e9ad60; border-color: #e9ad60; color: #282018; }
.button { transition: background .16s, border-color .18s, color .18s, transform .16s, opacity .16s; }
.button:active:not(:disabled) { transform: scale(.985); }

#lineup { position: relative; }
#lineup li[data-leaving] {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  background: #2b2529;
  pointer-events: none;
}
#lineup li .remove-movie {
  opacity: 1;
  transform: translateX(0);
  transition: opacity .18s ease, transform .18s ease, background .18s ease, display .18s allow-discrete;
}
#lineup li .remove-movie[hidden] { opacity: 0; transform: translateX(.3rem); }
@starting-style {
  #lineup li .remove-movie:not([hidden]) { opacity: 0; transform: translateX(.3rem); }
}
.empty-lineup:not([hidden]) { animation: glide-in .24s ease-out both; }


/* A dedicated showtime panel and centered roulette */
.header-actions { justify-content: flex-end; flex-shrink: 0; }
@media (max-width: 25rem) {
  .masthead { flex-wrap: nowrap; }
  .wordmark { gap: .35rem; font-size: .88rem; }
  .header-actions .button { padding-inline: .5rem; font-size: .84rem; }
}

.draw-stage {
  border-color: #a84d5c;
  background: #4d1726;
  box-shadow: 0 10px 34px #1b091047;
}
.draw-stage::before {
  background: radial-gradient(ellipse at 95% -18%, #aa3e53, transparent 68%),
              linear-gradient(138deg, #661d32, #391727 85%);
}
.draw-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-radial-gradient(circle at 95% -25%, transparent 0 28px, #fff2f40b 29px 30px);
  pointer-events: none;
}
.stage-action { width: 100%; min-height: 3.2rem; font-weight: 750; }
.draw-stage[data-won] .stage-action { margin-top: 1rem; }

.draw-dialog {
  width: min(43rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  padding: clamp(1rem, 4vw, 2rem);
  border-color: #945260;
  border-radius: 1rem;
  background: radial-gradient(ellipse at 50% -44%, #723144, transparent 75%), #201721;
  box-shadow: 0 24px 100px #0b080cd9;
}
.draw-dialog::backdrop { background: #090609e8; backdrop-filter: blur(7px); }
.draw-dialog .dialog-header h2 { font-size: 1.12rem; color: #eed1d9; }
.draw-dialog[data-spinning] .draw-result,
.draw-dialog:not([data-spinning]) .roulette { display: none; }

.roulette { margin-top: .95rem; text-align: center; --reel-row: 3.1rem; }
.roulette-label { color: #eed1db; font-size: .95rem; }
.roulette-window {
  position: relative;
  height: calc(var(--reel-row) * 3);
  overflow: hidden;
  margin-top: .75rem;
  border-block: 1px solid #694752;
  background: #1d141d;
}
.roulette-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#1d141d, #1d141d00 36% 64%, #1d141d);
  pointer-events: none;
}
.roulette-track { position: absolute; top: var(--reel-row); inset-inline: 0; }
.roulette-row {
  height: var(--reel-row);
  padding-inline: .75rem;
  overflow: hidden;
  color: #f9e8ef;
  font: 600 clamp(1rem, 4vw, 1.5rem)/var(--reel-row) var(--display);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roulette-focus {
  position: absolute;
  top: var(--reel-row);
  inset-inline: .55rem;
  height: var(--reel-row);
  border: 1px solid #b96d82;
  border-radius: .4rem;
  box-shadow: 0 0 22px #ee8da129;
}
.draw-result { text-align: center; padding-top: 1.05rem; }
.draw-result-copy { padding: .95rem 0 1rem; animation: glide-in .35s ease-out both; }
.draw-result-copy p { color: #ebc4d1; }
#draw-result-title {
  margin-block: .6rem;
  font: 600 clamp(2rem, 6vw, 4rem)/1.05 var(--display);
  letter-spacing: -.055em;
  word-spacing: .03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.draw-result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; margin-top: .7rem; }


/* The draw is a title screen below the lineup. */
.dashboard {
  width: min(57rem, calc(100% - 4rem));
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "lineup" "draw";
  gap: 1.15rem;
}
.roster { grid-area: lineup; }
.draw-stage {
  grid-area: draw;
  display: block;
  padding: clamp(1.55rem, 4vw, 2.8rem) 1rem 1.9rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}
.draw-stage::before {
  background: radial-gradient(ellipse at 50% 68%, #6b263866, #38233f45 37%, transparent 68%);
}
.draw-stage::after { content: none; }
.draw-stage .stage-content,
.draw-stage[data-won] .stage-content,
.draw-stage[data-spinning] .stage-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: .75rem;
  max-width: none;
}
.draw-stage h2 { font-size: clamp(1.65rem, 5vw, 2.65rem); }
.draw-stage .stage-description { margin-top: .35rem; }
.spin-dial {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: clamp(13rem, 34vw, 17rem);
  aspect-ratio: 1;
}
.spin-dial::before, .spin-dial::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}
.spin-dial::before {
  inset: 0;
  background: repeating-conic-gradient(from -1deg, #e897a576 0deg 1deg, transparent 1deg 7.2deg);
  mask: radial-gradient(farthest-side, transparent 96%, #000 96%);
  transition: opacity .24s;
  opacity: .58;
}
.spin-dial::after {
  z-index: -1;
  inset: 5.5%;
  border: 1px solid #c877895c;
  background: radial-gradient(circle, #4e2536 48%, #2c202c 80%);
  box-shadow: 0 0 36px #d1436340, inset 0 0 15px #ed829729;
  transition: box-shadow .24s;
}
.spin-dial:has(.spin-button:enabled:hover)::before,
.spin-dial:has(.spin-button:focus-visible)::before { opacity: 1; }
.spin-dial:has(.spin-button:enabled:hover)::after,
.spin-dial:has(.spin-button:focus-visible)::after {
  box-shadow: 0 0 46px #ec6d8070, inset 0 0 19px #ff92a440;
}
#draw.spin-button {
  display: grid;
  place-items: center;
  width: 73%;
  aspect-ratio: 1;
  min-height: 0;
  margin: 0;
  padding: 1rem 1.24rem;
  border: 1px solid #ff9caa;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 24%, #f7828e, #e34560 56%, #9f1b3f 100%);
  color: #28141f;
  font: 600 clamp(1.4rem, 4vw, 2rem)/1.08 var(--display);
  letter-spacing: -.052em;
  text-wrap: balance;
  box-shadow: 0 6px 0 #67162e, 0 13px 23px #190d21a8, inset 0 1px 10px #ffc8cf96;
  transform: translateY(-3px);
  transition: transform .14s ease, filter .19s, box-shadow .16s;
}
#draw.spin-button:enabled:hover { filter: brightness(1.12); transform: translateY(-5px); }
#draw.spin-button:enabled:active {
  transform: translateY(4px) scale(.98);
  box-shadow: 0 1px 0 #67162e, 0 5px 15px #190d21a8, inset 0 2px 11px #812d5459;
}
#draw.spin-button:disabled { filter: saturate(.45); opacity: .54; cursor: default; }
#draw.spin-button:focus-visible { outline-offset: 7px; }

.draw-dialog {
  isolation: isolate;
  width: min(49rem, calc(100% - 1.5rem));
  border: 0;
  background: radial-gradient(ellipse at 50% 52%, #572b48cc, #2d182d73 40%, transparent 70%);
  box-shadow: none;
}
.draw-dialog::backdrop { background: #0a070eea; backdrop-filter: blur(10px); }
.draw-dialog .draw-result-copy { animation: title-reveal .52s cubic-bezier(.16, .75, .23, 1) both; }
#draw-result-title { font-size: clamp(2.7rem, 8vw, 5.4rem); }
@keyframes title-reveal {
  from { opacity: 0; transform: translateY(1rem) scale(.96); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 44rem) {
  .dashboard { width: calc(100% - 2rem); gap: .8rem; }
  .roster { display: block; padding: 1rem; }
  .roster-head, .roster-list,
  body[data-admin-mode] :is(.roster-head, .roster-list) {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .roster-head { margin-bottom: 1rem; }
  #lineup li:first-child { border-top: 1px solid #2b292c; }
  .draw-stage { padding: 1.25rem .4rem 1.2rem; }
}
