/* Build Quest Board: Film Set look, "Red Carpet" palette (2026-10 redesign).
   Layout: wide 1280 spine. Hero = Cue's host panel + title/progress + Film next card,
   then a search/filter bar and two card grids (Up next, Filmed). Colors are role
   tokens on :root, so a palette change is a token swap, never a per-rule edit. */

:root {
  --bg: #140C10;
  --bg-2: #1A1015;
  --card: #21161B;
  --card-2: #2A1C23;
  --line: #3A2830;
  --line-hi: #5A3E4A;
  --ink: #F7EFE6;
  --muted: #BFAFA6;
  --primary: #F2BE4A;      /* marquee gold */
  --primary-l: #FFDB85;
  --primary-d: #C9952A;
  --on-primary: #2A1C00;
  --primary-glow: rgba(242, 190, 74, 0.38);
  --second: #FF6F86;       /* red-carpet pink: done, admin */
  --second-bg: #3A1520;
  --on-second: #2A0510;
  --stamp: #FF4D6A;
  --chip: #2C1E25;
  --chip-ink: #E6D6CC;
  --pool1: #C2213F;
  --pool2: #F2BE4A;
  --pool3: #6B2A6E;
  --sprocket: #0B0609;
  --sprocket-hole: #3A2A31;

  --font-head: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Figtree', 'Avenir Next', system-ui, sans-serif;
  --rad: 16px;
  --gutter: clamp(16px, 4vw, 40px);
  --spine: 1280px;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(16px, 0.9rem + 0.25vw, 19px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; z-index: 300; font-weight: 700; }
.skip-link:focus { left: 8px; }

/* ── Atmosphere: glow pools + two stage spotlights ── */
.stage-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.stage-fx b { position: absolute; border-radius: 50%; filter: blur(90px); mix-blend-mode: screen; opacity: 0.24; }
.stage-fx b:nth-child(1) { width: min(640px, 80vw); height: 520px; left: -160px; top: -160px; background: var(--pool1); animation: drift1 26s ease-in-out infinite alternate; }
.stage-fx b:nth-child(2) { width: min(560px, 70vw); height: 480px; right: -140px; top: 22vh; background: var(--pool2); opacity: 0.16; animation: drift2 30s ease-in-out infinite alternate; }
.stage-fx b:nth-child(3) { width: min(520px, 70vw); height: 420px; left: 30vw; bottom: -180px; background: var(--pool3); opacity: 0.26; animation: drift1 22s ease-in-out infinite alternate-reverse; }
.stage-fx i { position: absolute; top: -10vh; width: 60vw; height: 120vh; opacity: 0.55; transform-origin: 50% 0; }
.stage-fx i:nth-of-type(1) { left: -12vw; background: conic-gradient(from 160deg at 50% 0, transparent 0deg, rgba(242, 190, 74, 0.13) 14deg, transparent 30deg); animation: sweep1 18s ease-in-out infinite alternate; }
.stage-fx i:nth-of-type(2) { right: -12vw; background: conic-gradient(from 170deg at 50% 0, transparent 0deg, rgba(255, 111, 134, 0.11) 14deg, transparent 30deg); animation: sweep2 21s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(90px, 70px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-80px, 50px) scale(0.92); } }
@keyframes sweep1 { from { transform: rotate(-6deg); } to { transform: rotate(8deg); } }
@keyframes sweep2 { from { transform: rotate(6deg); } to { transform: rotate(-8deg); } }

.shell { width: 100%; max-width: var(--spine); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Top nav ── */
.topnav { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 0.8rem; background: linear-gradient(135deg, var(--primary-l), var(--primary)); color: var(--on-primary); box-shadow: 0 4px 14px var(--primary-glow); }
.navlinks { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.navlinks a { font-weight: 600; font-size: 0.92rem; color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.navlinks a:hover { color: var(--ink); background: var(--card); }
.navlinks a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--primary); border-radius: 10px 10px 2px 2px; }

/* ── Admin bar ── */
.adminbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; background: var(--second-bg); border: 1px solid rgba(255, 111, 134, 0.45); border-radius: 12px; padding: 8px 8px 8px 14px; font-size: 0.92rem; margin-bottom: 18px; }
.adminbar b { color: var(--second); }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(18px, 3vw, 32px); align-items: center; padding-block: 8px 28px; }
@media (max-width: 1100px) { .hero { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); } .film-next { grid-column: 1 / -1; } }
@media (max-width: 660px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.host { display: grid; justify-items: center; gap: 8px; position: relative; }
.host::before { content: ''; position: absolute; inset: 14% 4% 18%; background: radial-gradient(ellipse, rgba(242, 190, 74, 0.26), transparent 70%); z-index: -1; animation: hostGlow 4s ease-in-out infinite; border-radius: 50%; }
@keyframes hostGlow { 50% { opacity: 0.55; transform: scale(1.06); } }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 9px 14px; font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; text-align: center; max-width: 250px; position: relative; min-height: 48px; display: grid; place-items: center; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.cue-btn { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 20px; display: block; }
.cue-btn .cue { width: min(200px, 56vw); height: auto; display: block; animation: idleSway 3.4s ease-in-out infinite; transform-origin: 50% 92%; }
.cue-btn:hover .cue { filter: drop-shadow(0 0 14px rgba(242, 190, 74, 0.35)); }
@keyframes idleSway { 50% { transform: rotate(-2deg) translateY(-3px); } }
.cue .cue-clap { transform-origin: 34px 74px; transform: rotate(var(--open)); transition: transform 0.3s var(--bounce); }
.cue.snap .cue-clap { animation: clapSnap 0.5s ease-in-out 2; }
@keyframes clapSnap { 40% { transform: rotate(0deg); } 100% { transform: rotate(var(--open)); } }
.cue .cue-eyes { transform-origin: 110px 118px; animation: blink 5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.cue .cue-star { animation: twinkle 2.4s ease-in-out infinite; animation-delay: var(--d); transform-box: fill-box; transform-origin: center; }
@keyframes twinkle { 50% { opacity: 0.45; } }
.cue .cue-zzz { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); opacity: 0.6; } }
.cue-btn.pleased .cue { animation: pleased 0.5s ease-in-out 2; }
@keyframes pleased { 50% { transform: translateY(-10px) scale(1.04); } }
.rank-pill { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--second); background: var(--second-bg); border-radius: 999px; padding: 4px 12px; }
.rank-next { font-size: 0.82rem; color: var(--muted); text-align: center; }

.title h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.98; color: var(--primary); text-shadow: 0 0 22px rgba(242, 190, 74, 0.4); }
.marquee { height: 8px; margin: 12px 0 4px; max-width: 460px; background-image: radial-gradient(circle, var(--primary-l) 2.4px, transparent 3px); background-size: 16px 8px; filter: drop-shadow(0 0 4px var(--primary)); animation: bulbs 1.6s steps(2) infinite; }
@keyframes bulbs { 50% { opacity: 0.7; } }
.title p { margin-top: 10px; color: var(--muted); max-width: 52ch; }
.prog { margin-top: 18px; display: grid; gap: 8px; max-width: 460px; }
.prog-label { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.prog-label em { font-style: normal; font-size: 1.7rem; color: var(--primary); }
.track { height: 16px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); overflow: hidden; background-image: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0, 0, 0, 0.35) 10px 14px); }
.fill { height: 100%; min-width: 8px; border-radius: inherit; background: linear-gradient(90deg, var(--primary-d), var(--primary), var(--primary-l)); box-shadow: 0 0 12px var(--primary-glow); transition: width 0.6s var(--bounce); }

/* ── Buttons ── */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 10px 16px; font-family: var(--font-head); font-weight: 800; font-size: 0.95rem; cursor: pointer; min-height: 44px; text-decoration: none; transition: transform 0.2s var(--bounce), box-shadow 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary-l), var(--primary)); color: var(--on-primary); box-shadow: 0 4px 16px var(--primary-glow), inset 0 1px 1px rgba(255, 255, 255, 0.3); }
.btn-primary::before, .btn-admin::before { content: ''; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent); pointer-events: none; }
.btn-admin { background: linear-gradient(135deg, #FF95A6, var(--second)); color: var(--on-second); box-shadow: 0 4px 16px rgba(255, 111, 134, 0.35); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-hi); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-sm { min-height: 36px; padding: 6px 11px; font-size: 0.82rem; border-radius: 9px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Film next ── */
.film-next { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; position: relative; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4); }
.film-next .tag { position: absolute; top: 18px; left: 12px; z-index: 3; background: var(--primary); color: var(--on-primary); font-family: var(--font-head); font-weight: 800; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.film-next .pic { aspect-ratio: 1200 / 630; background: var(--card-2); position: relative; }
.film-next .pic img { width: 100%; height: 100%; object-fit: cover; }
.film-next .body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.film-next h2 { font-size: 1.35rem; }
.film-next p { color: var(--muted); font-size: 0.95rem; }
.film-next.shuffling .body h2 { color: var(--primary); }

/* Film-strip sprockets along the top and bottom of every picture */
.pic::before, .pic::after { content: ''; position: absolute; left: 0; right: 0; height: 10px; z-index: 1; background-color: var(--sprocket); background-image: radial-gradient(ellipse at center, var(--sprocket-hole) 0 2.6px, transparent 3px); background-size: 16px 10px; }
.pic::before { top: 0; }
.pic::after { bottom: 0; }

/* ── Toolbar ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-block: 8px 26px; }
.search { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.search:focus-within { border-color: var(--primary); }
.search input { border: 0; background: transparent; color: var(--ink); font-size: 1rem; padding: 10px 0; flex: 1; min-width: 0; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--chip); color: var(--chip-ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; min-height: 38px; }
.chip small { opacity: 0.7; font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--line-hi); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.filter-hint { font-size: 0.82rem; color: var(--muted); align-self: center; }

/* ── Zones + cards ── */
.zone { display: grid; gap: 14px; margin-bottom: 36px; }
.zone h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.zone h2 small { font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.grid-empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line-hi); border-radius: 14px; }
.show-all { justify-self: center; }

.quest-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; display: flex; flex-direction: column; position: relative; cursor: pointer; transition: transform 0.25s var(--bounce), box-shadow 0.25s, border-color 0.25s; }
.quest-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); border-color: var(--line-hi); }
.quest-card .pic { aspect-ratio: 1200 / 630; background: var(--card-2); position: relative; overflow: hidden; }
.quest-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.quest-card .pic .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; color: var(--muted); background: radial-gradient(circle at 30% 30%, rgba(242, 190, 74, 0.16), transparent 60%), var(--card-2); }
.quest-card__main { all: unset; display: grid; gap: 5px; padding: 12px 14px 0; cursor: pointer; }
.quest-card__main:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; border-radius: 10px; }
.quest-card .type { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--second); }
.quest-card h3 { font-size: 1.05rem; font-weight: 700; }
.quest-card .hook { font-size: 0.88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quest-card .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 14px 14px; margin-top: auto; }
.card-link { font-size: 0.8rem; font-weight: 800; border-radius: 9px; padding: 6px 11px; border: 1px solid var(--line-hi); color: var(--ink); text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; background: transparent; cursor: pointer; font-family: var(--font-head); }
.card-link:hover { border-color: var(--primary); color: var(--primary-l); }
.card-link--admin { background: var(--second); border-color: var(--second); color: var(--on-second); }
.card-link--admin:hover { color: var(--on-second); filter: brightness(1.08); }
.private-tag { font-size: 0.76rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; border: 1px solid var(--line-hi); color: var(--muted); }
.quest-card.is-draggable { cursor: grab; }
.quest-card.dragging { opacity: 0.45; }
.quest-card.drop-before { box-shadow: -4px 0 0 var(--primary); }
.quest-card.drop-after { box-shadow: 4px 0 0 var(--primary); }

.filmed-stamp { position: absolute; right: 8px; top: 14px; width: 78px; height: 78px; color: var(--stamp); background: none; border: 0; padding: 0; cursor: pointer; transform: rotate(-12deg); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); z-index: 2; transition: transform 0.2s var(--bounce); }
.filmed-stamp:hover { transform: rotate(-4deg) scale(1.06); }
.filmed-stamp svg { width: 100%; height: 100%; }

/* ── Footer ── */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; font-size: 0.84rem; color: var(--muted); border-top: 1px solid var(--line); padding-block: 20px 36px; margin-top: 12px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ── Overlays: quest popup + PIN box ── */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 4, 6, 0.72); backdrop-filter: blur(6px); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.panel { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line-hi); border-radius: 20px; position: relative; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); animation: popIn 0.35s var(--bounce); }
@keyframes popIn { from { transform: scale(0.92) translateY(10px); opacity: 0; } }
.panel .pic { aspect-ratio: 1200 / 630; position: relative; background: var(--card-2); }
.panel .pic img { width: 100%; height: 100%; object-fit: cover; }
.panel-body { padding: 18px 20px 20px; display: grid; gap: 10px; }
.panel .type { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--second); }
.panel h2 { font-size: clamp(1.4rem, 3.4vw, 1.8rem); }
.panel .hook { color: var(--muted); }
.panel .status-line { font-size: 0.86rem; color: var(--muted); }
.panel .status-line b { color: var(--primary); }
.close-btn { position: absolute; top: 14px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-hi); background: rgba(20, 12, 16, 0.85); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.close-btn:hover { border-color: var(--primary); }
.admin-zone { border-top: 1px dashed var(--line-hi); padding-top: 12px; display: grid; gap: 10px; }
.admin-zone .lbl { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--second); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 700; }
.field input { background: var(--card-2); border: 1px solid var(--line-hi); border-radius: 10px; color: var(--ink); font-size: 1rem; padding: 10px 12px; min-width: 0; width: 100%; }
.field input:focus { outline: none; border-color: var(--primary); }
.field .err { color: #FF9AAA; font-size: 0.86rem; min-height: 1.2em; }
.pin-panel { width: min(400px, 100%); }
.pin-panel .panel-body { padding-top: 22px; }

/* ── Toast ── */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 400; background: var(--card-2); border: 1px solid var(--line-hi); color: var(--ink); border-radius: 14px; padding: 11px 16px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); max-width: calc(100vw - 32px); animation: toastIn 0.35s var(--bounce); }
@keyframes toastIn { from { transform: translate(-50%, 16px); opacity: 0; } }

/* ── Quest complete moment ── */
.qc { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(242, 190, 74, 0.22), rgba(8, 4, 6, 0.86) 60%); cursor: pointer; overflow: hidden; animation: fadeIn 0.2s ease; }
.qc__inner { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 16px; }
.qc__cue .cue { width: min(240px, 60vw); height: auto; animation: qcSlam 0.55s var(--bounce); }
@keyframes qcSlam { from { transform: scale(2.2) rotate(-10deg); opacity: 0; } }
.qc__banner { font-family: var(--font-head); font-weight: 800; font-size: clamp(2rem, 7vw, 4rem); text-transform: uppercase; color: var(--primary); text-shadow: 0 0 26px var(--primary-glow); letter-spacing: 0.02em; line-height: 1; animation: popIn 0.5s 0.15s var(--bounce) both; }
.qc__name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.05rem, 2.6vw, 1.35rem); }
.qc__rank { background: var(--second-bg); color: var(--second); font-weight: 800; border-radius: 999px; padding: 6px 14px; animation: popIn 0.5s 0.35s var(--bounce) both; }
.qc__confetti { position: absolute; left: 50%; top: 45%; width: 10px; height: 14px; border-radius: 2px; animation: confetti var(--dur) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
@keyframes confetti { to { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 0; } }
.particle { position: fixed; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; z-index: 450; animation: confetti var(--dur) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
