:root {
  --bg: #0d0a09;
  --bg2: #17110f;
  --panel: #1d1613;
  --line: #3a2c25;
  --ink: #f4ead5;
  --dim: #b5a68c;
  --mute: #7d6f5d;
  --red: #c8322b;
  --red2: #8f1f1a;
  --gold: #f2c14e;
  --green: #6fcf7f;
  --bad: #ff6b5e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(200, 50, 43, .25), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 Inter, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 8px 16px 40px; }

.top { display: flex; align-items: center; justify-content: space-between; max-width: 980px; width: 100%; margin: 0 auto; padding: 14px 16px; }
.brand { font-family: Limelight, serif; font-size: 22px; color: var(--gold); text-decoration: none; letter-spacing: .02em; }
.top nav a { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px; }
.top nav a:hover { color: var(--ink); }
.foot { color: var(--mute); font-size: 12px; text-align: center; padding: 24px 16px 32px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--dim); }

/* Marquee */
.marquee {
  position: relative; margin: 18px auto 26px; max-width: 640px; padding: 26px 20px 22px;
  background: linear-gradient(#22130f, #170d0b); border: 3px solid var(--gold); border-radius: 18px;
  text-align: center; box-shadow: 0 0 0 6px #2a1711, 0 0 60px rgba(242, 193, 78, .15);
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; left: 14px; right: 14px; height: 8px;
  background: radial-gradient(circle, var(--gold) 2.5px, transparent 3.5px) 0 0 / 18px 8px repeat-x;
  animation: bulbs 1.2s steps(2) infinite;
}
.marquee::before { top: 7px; }
.marquee::after { bottom: 7px; animation-delay: .6s; }
@keyframes bulbs { 50% { opacity: .35; } }
.marquee h1 { font-family: Limelight, serif; font-weight: 400; font-size: clamp(40px, 9vw, 72px); line-height: 1; margin: 6px 0 8px; color: var(--gold); text-shadow: 0 0 18px rgba(242, 193, 78, .45); }
.marquee p { margin: 0; color: var(--dim); font-size: 15px; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--gold); transform: translateY(-2px); }
.card h3 { margin: 0; font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 30px; letter-spacing: .03em; color: var(--ink); }
.card p { margin: 0; color: var(--dim); font-size: 14px; }
.card .tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bg); background: var(--gold); padding: 2px 8px; border-radius: 99px; }
.card.red .tag { background: var(--red); color: var(--ink); }

h2 { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 32px; letter-spacing: .03em; margin: 26px 0 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--mute); }
.dim { color: var(--dim); }

.btn { cursor: pointer; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 700; background: var(--gold); color: #1a1208; }
.btn:hover { filter: brightness(1.08); }
.btn.red { background: var(--red); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.field { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; outline: none; min-width: 0; }
.field:focus { border-color: var(--gold); }
.name-row { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 22px; flex-wrap: wrap; }
.name-row label { color: var(--dim); font-size: 14px; }
.code-input { text-transform: uppercase; letter-spacing: .3em; width: 130px; text-align: center; font-weight: 700; }

/* Bill: two posters */
.bill { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px; margin: 10px 0 16px; }
.poster {
  border-radius: 12px; padding: 18px 14px 20px; text-align: center; display: flex; flex-direction: column; justify-content: center; min-height: 150px;
  background: linear-gradient(160deg, #2a1410, #160c0a); border: 2px solid var(--red2); position: relative; overflow: hidden;
}
.poster:nth-child(3) { border-color: #6b5420; background: linear-gradient(200deg, #2a2210, #16120a); }
.poster small { font-size: 11px; letter-spacing: .25em; color: var(--dim); text-transform: uppercase; }
.poster strong { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: clamp(30px, 6vw, 50px); line-height: .95; margin-top: 6px; letter-spacing: .02em; }
.amp { align-self: center; font-family: Limelight, serif; font-size: 40px; color: var(--gold); }
.poster.blank strong { color: var(--mute); }
@media (max-width: 560px) {
  .bill { grid-template-columns: 1fr; gap: 6px; }
  .amp { font-size: 28px; line-height: 1; justify-self: center; }
  .poster { min-height: 96px; padding: 12px; }
}

/* HUD */
.hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hud .stat { font-family: "Bebas Neue", sans-serif; font-size: 26px; letter-spacing: .04em; }
.hud .stat span { color: var(--mute); font-family: Inter, sans-serif; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.lives { display: flex; gap: 6px; }
.ticket { width: 30px; height: 20px; border-radius: 4px; background: var(--red); position: relative; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); }
.ticket::before { left: -4px; }
.ticket::after { right: -4px; }
.ticket.lost { background: #3a2c25; }

.timer { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 99px; transform-origin: left; }
.timer.low i { background: var(--bad); }

/* Guess */
.guess { position: relative; display: flex; gap: 10px; }
.guess .field { flex: 1; font-size: 18px; padding: 14px 16px; }
.guess.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.ac { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow: auto; }
.ac li { padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.ac li.on, .ac li:hover { background: #2c211b; }
.ac li b { color: var(--gold); font-weight: 600; }
.feedback { min-height: 26px; margin: 10px 2px 0; font-weight: 600; }
.feedback.ok { color: var(--green); }
.feedback.bad { color: var(--bad); }

/* Reveal list */
.answers { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.answers li { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.answers li.hit { border-color: var(--green); }
.answers .who { font-weight: 700; }
.answers .films { font-size: 13px; color: var(--dim); margin-top: 2px; }
.answers .films em { color: var(--mute); font-style: normal; }

/* Players */
.layout { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } }
.players { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg2); border-radius: 9px; border: 1px solid transparent; }
.players li.me { border-color: var(--line); }
.players li.off { opacity: .45; }
.players .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .sc { font-family: "Bebas Neue", sans-serif; font-size: 22px; }
.players .ok { color: var(--green); font-weight: 700; }
.players .pts { color: var(--green); font-size: 12px; font-weight: 700; }
.players .ans { display: block; font-size: 12px; color: var(--dim); }
.crown { color: var(--gold); }

.roomcode { font-family: "Bebas Neue", sans-serif; font-size: 64px; letter-spacing: .15em; color: var(--gold); line-height: 1; }
.settings { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 14px 0; }
.settings label { display: grid; gap: 4px; font-size: 13px; color: var(--dim); }
.settings select { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.big-count { font-family: Limelight, serif; font-size: 120px; text-align: center; color: var(--gold); line-height: 1.2; animation: pop 1s infinite; }
@keyframes pop { from { transform: scale(1.15); opacity: 1; } to { transform: scale(.9); opacity: .6; } }

.rooms { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rooms li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.rooms li .grow { flex: 1; }

/* Leaderboard */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { cursor: pointer; background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: 14px; }
.tabs button.on { background: var(--gold); color: #1a1208; border-color: var(--gold); }
table.lb { width: 100%; border-collapse: collapse; }
table.lb th, table.lb td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.lb th { color: var(--mute); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
table.lb td.n { font-variant-numeric: tabular-nums; text-align: right; }
table.lb th.n { text-align: right; }
table.lb tr.me td { color: var(--gold); font-weight: 700; }

.over { text-align: center; }
.over .score { font-family: Limelight, serif; font-size: 72px; color: var(--gold); line-height: 1.1; }
.podium { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.podium li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.podium li:first-child { border-color: var(--gold); background: linear-gradient(90deg, rgba(242, 193, 78, .14), var(--panel)); }
.podium .place { font-family: Limelight, serif; font-size: 26px; width: 34px; color: var(--gold); }
.podium .nm { flex: 1; font-weight: 700; }
.podium .sc { font-family: "Bebas Neue", sans-serif; font-size: 28px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--gold); padding: 10px 16px; border-radius: 10px; z-index: 20; }

/* Poster spin-in on a correct answer */
.spin-stage {
  position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: auto;
  background: rgba(13, 10, 9, .975); animation: tagIn .25s both;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px 16px;
}
.spin-stage .reel { display: flex; gap: clamp(12px, 4vw, 48px); perspective: 1200px; }
.spin-stage .tag-line { text-align: center; font-family: "Bebas Neue", sans-serif; font-size: clamp(28px, 5vw, 44px); color: var(--green); animation: tagIn .4s .5s both; }
.spin-stage .blurb { max-width: 520px; min-height: 60px; display: flex; gap: 12px; align-items: flex-start; color: var(--dim); font-size: 14px; line-height: 1.45; }
.spin-stage .blurb:not(:empty) { animation: tagIn .4s both; }
.spin-stage .blurb img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; flex: none; }
.spin-stage .blurb p { margin: 0; }
.spin-stage.out { animation: stageOut .35s forwards; }
.film-poster {
  margin: 0; width: clamp(110px, 24vw, 200px); position: relative;
  animation: spinIn .9s cubic-bezier(.2,.8,.25,1.05) both;
}
.film-poster:nth-child(2) { animation-delay: .12s; --from: 1; }
.film-poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 2px rgba(242,193,78,.5); }
.film-poster figcaption { margin-top: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.film-poster figcaption span { display: block; font-weight: 400; font-size: 12px; color: var(--mute); }
.film-poster.printed { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 2px rgba(242,193,78,.5); display: flex; flex-direction: column; justify-content: space-between; padding: 14px 12px; text-align: center; }
.film-poster.printed .by { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.film-poster.printed .t { font-family: "Bebas Neue", sans-serif; font-size: clamp(22px, 4.4vw, 38px); line-height: .95; text-wrap: balance; }
.film-poster.printed .y { font-family: Limelight, serif; font-size: 14px; opacity: .85; }
@keyframes spinIn {
  from { transform: translateX(calc(var(--from, -1) * 60vw)) rotateY(calc(var(--from, -1) * -540deg)) scale(.3); opacity: 0; }
  60% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
@keyframes tagIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes stageOut { to { opacity: 0; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  .film-poster { animation: tagIn .3s both; }
}

/* Wikipedia tooltip on actor names */
.wk { cursor: help; border-bottom: 1px dotted var(--mute); }
.films .wk { border-bottom-color: #4a3c33; }
.wk:hover { color: var(--gold); border-bottom-color: var(--gold); }
.wiki-tip { position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--gold); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.wiki-tip img { float: left; width: 48px; height: 48px; object-fit: cover; border-radius: 50%; margin: 2px 10px 4px 0; }
.wiki-tip p { margin: 0 0 6px; }
.wiki-tip a { font-size: 12px; }

/* Hints */
.hints { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.hints li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg2); border: 1px dashed var(--line); border-radius: 9px; font-size: 14px; }
.hints img { width: 30px; height: 45px; object-fit: cover; border-radius: 3px; flex: none; }
.hints b { color: var(--gold); font-weight: 600; }
