/*
 * Screenalong: a movie-night app. Dark "theatre" palette, amber marquee accent.
 * Phone first; the desktop layout kicks in at 720px.
 */

:root {
  --bg: #120f0d;
  --bg-elev: #1c1815;
  --bg-elev-2: #26211d;
  --bg-elev-3: #312a25;
  --line: #3a322c;
  --line-soft: #2a241f;
  --text: #f4eee7;
  --text-2: #cfc5ba;
  --muted: #9d9186;
  --accent: #f2b544;
  --accent-2: #ffd27a;
  --accent-ink: #1a1305;
  --danger: #ef5b45;
  --ok: #7bd88f;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --tabbar-h: 64px;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  background: radial-gradient(900px 500px at 50% -200px, #2b2019 0%, var(--bg) 65%) var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.015em; margin: 0; line-height: 1.1; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
code { background: var(--bg-elev-2); padding: .1em .35em; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; color: var(--accent); font-weight: 600; margin: 0 0 .3rem; }
[hidden] { display: none !important; }

/* ---------- App chrome ---------- */

.container { max-width: 760px; margin: 0 auto; padding: 1rem 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }

.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: calc(.55rem + env(safe-area-inset-top)) 16px .55rem;
  background: rgba(18, 15, 13, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--text); display: inline-flex; gap: .4rem; align-items: center; }
.appbar-right { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.group-switch { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; min-height: 40px; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); font-size: .88rem; font-weight: 600; }
.group-switch:hover { background: var(--bg-elev-2); }
.group-switch .chevron { color: var(--muted); font-size: .75rem; }
.appbar-me { display: inline-flex; align-items: center; border-radius: 999px; padding: .15rem; }
.appbar-me:hover, .appbar-me.active { background: var(--bg-elev-2); }
.appbar-group { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .brand-name { display: none; } .appbar-group { max-width: 58vw; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(28, 24, 21, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tab.active { color: var(--accent); }
.tab.active svg { stroke-width: 2.2; }

@media (min-width: 720px) {
  .tabbar {
    top: 0; bottom: auto; left: 50%; right: auto; transform: translateX(-50%);
    height: 57px; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
    display: flex; gap: .25rem; align-items: center;
  }
  .tab { flex-direction: row; gap: .45rem; font-size: .9rem; padding: .45rem .9rem; border-radius: 999px; }
  .tab svg { width: 18px; height: 18px; }
  .tab.active { background: var(--bg-elev-2); }
  .container { padding-top: 1.5rem; padding-bottom: 3rem; }
}

/* ---------- Avatars ---------- */

.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  font-weight: 700; font-size: .85rem; color: #1a1305; background: hsl(var(--hue, 40) 70% 66%);
}
.avatar.tiny { width: 18px; height: 18px; font-size: .62rem; vertical-align: -3px; }
.avatar.large { width: 40px; height: 40px; font-size: 1.05rem; }

/* ---------- Buttons & inputs ---------- */

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev-2); color: var(--text); padding: .6rem 1.1rem;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  transition: transform .06s ease, filter .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-lg { min-height: 54px; padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: .35rem .85rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.linkish { font: inherit; background: none; border: 0; color: var(--muted); padding: .35rem .2rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-row form, .actions form { display: contents; }

.input {
  font: inherit; width: 100%; min-height: 46px; padding: .6rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
select.input { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
label { display: grid; gap: .3rem; font-size: .88rem; color: var(--muted); }
.stack { display: grid; gap: .85rem; }

/* ---------- Flash ---------- */

.flash { padding: .7rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 500; cursor: pointer; animation: slide-in .25s ease-out; transition: opacity .25s, transform .25s; }
.flash-notice { background: rgba(123, 216, 143, .1); border: 1px solid rgba(123, 216, 143, .35); }
.flash-alert { background: rgba(239, 91, 69, .12); border: 1px solid rgba(239, 91, 69, .45); }
.flash-leaving { opacity: 0; transform: translateY(-6px); }

/* ---------- Page headings ---------- */

.page-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .2rem; }
.page-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.count { font-family: var(--font); font-size: .78rem; font-weight: 600; background: var(--bg-elev-2); color: var(--text-2); border-radius: 999px; padding: .15rem .6rem; }

/* ---------- Search bar & results ---------- */

.searchbar { position: relative; margin-bottom: .75rem; }
.searchbar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbar .input { padding-left: 44px; border-radius: 999px; background: var(--bg-elev); min-height: 50px; font-size: 1rem; }
.searchbar input[type=submit] { display: none; }

turbo-frame { display: block; }
.search-panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; margin-bottom: 1rem; }
.search-panel:not(:has(*)) { display: none; }
.search-note { padding: .3rem .4rem .6rem; }
.search-foot { padding: .6rem .4rem .2rem; display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.manual-add summary { cursor: pointer; color: var(--muted); font-size: .88rem; list-style: none; }
.manual-add summary::-webkit-details-marker { display: none; }
.manual-form { display: grid; grid-template-columns: 1fr 6.5rem; gap: .5rem; margin-top: .6rem; }
.manual-form .span-2 { grid-column: 1 / -1; }

.person-head { display: flex; align-items: center; gap: .75rem; padding: .4rem; }
.person-photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.person-name { font-size: 1.25rem; }
.other-people { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: 0 .4rem .6rem; margin: 0; }
.section-label { font-family: var(--font); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: .9rem .4rem .4rem; }

/* ---------- Chips (quick filters) ---------- */

.chips { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; margin: 0 -16px .9rem; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .85rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text-2);
  font-size: .86rem; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.chip .count { background: var(--accent-ink); color: var(--accent); padding: 0 .45rem; }
.chip.on .count { background: rgba(0,0,0,.15); color: var(--accent-ink); }

.filters-panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; margin: -.3rem 0 1rem; }
.filter-form { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.filter-form .span-2 { grid-column: 1 / -1; }
.filter-form .check { display: flex; align-items: center; gap: .55rem; color: var(--text); min-height: 40px; }
.filter-form .check input { width: 20px; height: 20px; accent-color: var(--accent); }
.filter-foot { display: flex; justify-content: space-between; align-items: center; }
@media (min-width: 720px) { .filter-form { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Movie rows ---------- */

.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.row {
  position: relative; display: grid; grid-template-columns: 58px 1fr auto; gap: .8rem; align-items: start;
  background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 14px; padding: .6rem .5rem .6rem .6rem;
  transition: border-color .15s, background .15s;
}
.row:hover { border-color: var(--line); background: #201b18; }
.row-poster { position: relative; }
.row-poster img, .poster-empty { width: 58px; height: 87px; object-fit: cover; border-radius: 8px; display: block; background: var(--bg-elev-2); }
.poster-empty { display: grid; place-items: center; font-size: 1.4rem; }
.rank {
  position: absolute; top: -7px; left: -7px; z-index: 1; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg-elev);
}
.row-body { min-width: 0; display: grid; gap: .22rem; }
.row-title { font-weight: 600; font-size: 1rem; line-height: 1.25; color: var(--text); }
/* The title link covers the whole row, so tapping anywhere opens details. */
.row-link { color: inherit; }
.row-link::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.row-link:focus-visible { outline: none; }
.row-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-size: .83rem; color: var(--muted); }
.row-meta .sep { opacity: .5; }
.runtime { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.row-overview { font-size: .84rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-side { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: .3rem; align-self: center; }
.row-side form { display: contents; }
.row .btn-sm { min-height: 34px; }
.shared-tag { color: var(--ok); font-weight: 600; }
.row-actions { position: relative; z-index: 2; }

.drag-handle { cursor: grab; touch-action: none; user-select: none; color: var(--muted); width: 36px; height: 44px; display: grid; place-items: center; border-radius: 10px; font-size: 1.25rem; }
.drag-handle:active { cursor: grabbing; background: var(--bg-elev-2); }
.drag-ghost { opacity: .35; }
.drag-chosen { box-shadow: var(--shadow); border-color: var(--accent); }

/* Scores and where-to-watch, compact */
.scores { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; font-size: .82rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.score { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.score b { font-weight: 700; color: var(--text); }
.score-imdb b { color: #f5c518; }
.logos { display: inline-flex; align-items: center; gap: .25rem; }
.logos img { width: 20px; height: 20px; border-radius: 5px; display: block; }
.logos .more { font-size: .75rem; color: var(--muted); font-weight: 600; }
.rent-only { font-size: .78rem; color: var(--muted); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-art { font-size: 2.6rem; margin-bottom: .4rem; }

/* ---------- Detail sheet ---------- */

/* The dialog itself stays put; only the inner frame scrolls, so the close
   button can be pinned to the corner (sticky/float in a scrolling dialog is
   unreliable in Safari). */
.sheet {
  width: 100%; max-width: 640px; margin: auto auto 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  background: var(--bg-elev); color: var(--text);
}
.sheet-scroll { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1); }
.sheet::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.sheet-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sheet-close:focus { outline: none; }
.sheet-close:focus-visible { outline: 2px solid var(--accent); }
@media (min-width: 720px) {
  .sheet { margin: auto; border-radius: 22px; border-bottom: 1px solid var(--line); }
  .sheet-scroll { max-height: 86dvh; }
}
.sheet-body { padding: 0 1.1rem 1.4rem; }
.sheet-hero { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 1rem; align-items: end; padding: 1.4rem 3.2rem 1rem 1.1rem; overflow: hidden; }
.sheet-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--backdrop); background-size: cover; background-position: center; filter: blur(28px) saturate(1.2); opacity: .35; transform: scale(1.3); }
.sheet-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--bg-elev)); }
.sheet-hero > * { position: relative; z-index: 1; }
.sheet-hero img, .sheet-hero .poster-empty { width: 104px; height: 156px; border-radius: 10px; object-fit: cover; box-shadow: var(--shadow); }
.sheet-title { font-size: 1.45rem; margin-bottom: .35rem; }
.sheet-section { padding: .9rem 0; border-top: 1px solid var(--line-soft); }
.sheet-section:first-child { border-top: 0; }
.sheet-section h3 { font-family: var(--font); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: .6rem; }
.tagline { font-style: italic; color: var(--muted); margin-bottom: .5rem; }
.facts { display: grid; gap: .35rem; font-size: .92rem; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0 0 .35rem; }
.actions { display: grid; gap: .5rem; }
.actions .btn { width: 100%; }

.ratings { display: flex; flex-wrap: wrap; gap: .4rem; }
.rating {
  display: inline-grid; gap: 0; padding: .4rem .7rem; border-radius: 12px; background: var(--bg-elev-2); border: 1px solid var(--line-soft);
  color: var(--text); min-width: 76px; text-decoration: none;
}
.rating b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rating span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.rating:hover { border-color: var(--line); }

.watch { display: grid; gap: .6rem; }
.watch-group { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.watch-label { width: 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.watch-stream .watch-label, .watch-free .watch-label { color: var(--ok); }
.provider { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .6rem .25rem .25rem; border-radius: 10px; background: var(--bg-elev-2); color: var(--text); font-size: .85rem; }
.provider img { width: 28px; height: 28px; border-radius: 7px; display: block; }

/* ---------- Tonight ---------- */

.tonight-date { color: var(--muted); font-size: .9rem; margin: .2rem 0 1.2rem; }

.envelope-card { position: relative; overflow: hidden; text-align: center; padding: 2rem 1.1rem 1.5rem; background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 22px; }
.envelope-card > * { position: relative; }
.envelope-card .empty-art { font-size: 3.4rem; margin-bottom: .6rem; }
/* A soft stage spotlight falling on the envelope. */
.spotlight::before {
  content: ""; position: absolute; inset: -40% -20% 30%; pointer-events: none;
  background: radial-gradient(closest-side at 50% 60%, rgba(255, 214, 140, .2), transparent 70%);
  animation: spotlight 6s ease-in-out infinite alternate;
}
.envelope { display: inline-block; margin-bottom: 1rem; animation: float 4s ease-in-out infinite; }
.envelope-art { width: 150px; height: auto; display: block; overflow: visible; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55)) drop-shadow(0 0 26px rgba(242, 181, 68, .25)); }
.envelope-flap { transform-box: fill-box; transform-origin: 50% 0; transition: transform .45s cubic-bezier(.3, .7, .3, 1); }
.envelope-seal { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .25s ease-in, opacity .25s ease-in; }
.opening .envelope { animation: none; }
.opening .envelope-seal { transform: scale(0); opacity: 0; }
.opening .envelope-flap { transform: perspective(300px) rotateX(180deg); transition-delay: .15s; }
.opening .draw-button { filter: brightness(1.1); }
.envelope-card h2 { margin-bottom: .4rem; }
.envelope-card .muted { max-width: 30ch; margin: 0 auto 1.2rem; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 999px; max-width: 380px; margin: 0 auto .6rem; }
.mode { position: relative; }
.mode input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.mode span { display: block; padding: .5rem .3rem; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--muted); text-align: center; }
.mode input:checked + span { background: var(--bg-elev-3); color: var(--text); }
.mode input:focus-visible + span { outline: 2px solid var(--accent); }
.mode-hints { min-height: 2.6em; font-size: .86rem; color: var(--muted); max-width: 34ch; margin: 0 auto 1rem; }
.mode-hint { display: none; }
.draw-form:has(input[value=top]:checked) .mode-hint-top,
.draw-form:has(input[value=random]:checked) .mode-hint-random,
.draw-form:has(input[value=alternate]:checked) .mode-hint-alternate { display: block; }
.draw-button { font-size: 1.1rem; min-height: 58px; width: 100%; max-width: 380px; box-shadow: 0 12px 30px -12px rgba(242, 181, 68, .55); letter-spacing: .01em; }

.hero { position: relative; border-radius: 22px; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--line-soft); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--backdrop); background-size: cover; background-position: center 30%; filter: blur(30px) saturate(1.25); opacity: .45; transform: scale(1.3); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(18,15,13,.1), var(--bg-elev) 85%); }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: grid; grid-template-columns: 118px 1fr; gap: 1rem; padding: 1.1rem; align-items: end; }
.hero-poster img, .hero-poster .poster-empty { width: 118px; height: 177px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow); display: block; }
.hero-title { font-size: 1.6rem; margin-bottom: .45rem; }
.hero-facts { display: grid; gap: .35rem; }
.hero-runtime { font-size: .95rem; color: var(--text); }
.hero-runtime .runtime { color: var(--accent-2); font-size: 1.05rem; }
.hero-body { padding: 0 1.1rem 1.2rem; display: grid; gap: 1rem; }
.hero-watch { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .9rem; color: var(--text-2); }
.hero-watch .logos img { width: 28px; height: 28px; border-radius: 7px; }
.hero-watch .muted { flex-basis: 100%; font-size: .82rem; }
@media (min-width: 720px) { .hero-watch .muted { flex-basis: auto; } }
@media (min-width: 720px) {
  .hero-top { grid-template-columns: 170px 1fr; padding: 1.5rem; gap: 1.5rem; }
  .hero-poster img, .hero-poster .poster-empty { width: 170px; height: 255px; }
  .hero-title { font-size: 2.2rem; }
  .hero-body { padding: 0 1.5rem 1.5rem; }
}

.vetoes { display: flex; flex-wrap: wrap; gap: .45rem; }
.veto-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .3rem; border-radius: 999px; background: var(--bg-elev-2); font-size: .85rem; color: var(--text-2); }
.veto-chip .avatar { width: 26px; height: 26px; font-size: .75rem; }
.veto-used { opacity: .55; }
.veto-used .veto-state { text-decoration: line-through; }

.decide { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.decide:has(> :nth-child(2)) { grid-template-columns: 1.5fr 1fr; }
.decide form { display: contents; }
.decide .btn { width: 100%; padding-inline: .6rem; }
.locked-note { font-size: .88rem; color: var(--accent-2); }

.about { margin-top: 1rem; background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 22px; padding: .3rem 1.1rem 1rem; }
.tonight-foot { text-align: center; margin-top: 1rem; }

.watched-banner { text-align: center; padding: .9rem; border-radius: 14px; background: rgba(242,181,68,.1); border: 1px solid rgba(242,181,68,.35); color: var(--accent-2); font-weight: 600; }

/* Fun: the announcement and reveal after a draw or veto, popcorn when you commit. */
.reveal-card {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(closest-side, rgba(40, 30, 20, .96), rgba(18, 15, 13, .98));
  animation: announce-out .35s 1.05s ease-in forwards;
}
.reveal-card p { font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--accent-2); margin: 0; animation: announce-in .5s ease-out both; }
.reveal .hero-poster { animation: reveal .6s 1.1s cubic-bezier(.2, .9, .3, 1.2) both; }
.reveal .hero-title, .reveal .hero-facts { animation: fade-up .4s 1.25s ease-out both; }
.celebrate { position: relative; }
.popcorn { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.popcorn i { position: absolute; bottom: 30%; font-style: normal; font-size: 1.4rem; animation: pop 1.4s ease-out forwards; opacity: 0; }

@keyframes reveal { 0% { transform: perspective(600px) rotateY(90deg) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes fade-up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes spotlight { from { transform: translateX(-6%); opacity: .8; } to { transform: translateX(6%); opacity: 1; } }
@keyframes announce-in { from { opacity: 0; letter-spacing: .12em; } to { opacity: 1; letter-spacing: 0; } }
@keyframes announce-out { to { opacity: 0; visibility: hidden; } }
@keyframes pop { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), -220px) rotate(var(--rot)); opacity: 0; } }
@keyframes slide-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- History & settings ---------- */

.card { background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.card h2 { margin-bottom: .8rem; }
.card h3 { font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.2rem 0 .5rem; }
.member-list { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.member-list li { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .8rem .25rem .25rem; border-radius: 999px; background: var(--bg-elev-2); font-size: .9rem; }
.invite { display: flex; gap: .5rem; margin-bottom: .25rem; }
.invite .input { flex: 1; min-width: 0; font-size: .85rem; color: var(--text-2); }
.mode-form { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.mode-form legend { margin-bottom: .5rem; color: var(--muted); font-size: .88rem; }
.mode-option { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; padding: .8rem; border-radius: 12px; border: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-size: .9rem; }
.mode-option strong { color: var(--text); display: block; }
.mode-option input { accent-color: var(--accent); margin-top: .2rem; }
.mode-option:has(input:checked) { border-color: var(--accent); background: rgba(242,181,68,.06); }
.settings-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

.veto-log { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.veto-log li { display: flex; align-items: center; gap: .5rem; padding: .55rem .1rem; border-bottom: 1px solid var(--line-soft); font-size: .92rem; flex-wrap: wrap; }
.history-section { margin-top: 1.6rem; }
.history-section h2 { margin-bottom: .7rem; }

/* ---------- Sign in / sign up ---------- */

.session-body { display: grid; place-items: center; padding: 1rem; min-height: 100dvh; }
.session-card { width: 100%; max-width: 390px; background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 22px; padding: 1.6rem 1.4rem; box-shadow: var(--shadow); }
.session-title { text-align: center; font-size: 1.7rem; margin-bottom: .4rem; }
.session-sub { text-align: center; color: var(--muted); margin-bottom: 1.4rem; }
.session-form { display: grid; gap: .9rem; }
.session-links { text-align: center; margin: 1.1rem 0 0; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Trailer player ---------- */

.trailer-dialog { width: min(960px, calc(100vw - 16px)); max-width: none; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev); color: var(--text); overflow: hidden; }
.trailer-dialog::backdrop { background: rgba(0,0,0,.85); backdrop-filter: blur(4px); }
.trailer-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .35rem .35rem 1rem; }
.trailer-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.trailer-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer-foot { margin: 0; padding: .6rem 1rem; }
.role { color: var(--accent); }

/* Groups */
.group-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.group-row { display: flex; align-items: center; gap: .4rem; background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 14px; padding: .35rem .4rem .35rem .35rem; }
.group-row.current { border-color: var(--accent); }
.group-row form { flex: 1; min-width: 0; display: flex; }
.group-pick { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; text-align: left; font: inherit; color: var(--text); background: none; border: 0; padding: .45rem .5rem; border-radius: 10px; cursor: pointer; }
.group-pick:hover { background: var(--bg-elev-2); }
.group-row-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-row-members { grid-column: 1; display: inline-flex; align-items: center; gap: .2rem; }
.group-current { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--accent); font-weight: 800; }
.new-group { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.sheet-groups { padding-top: 1.4rem; }
.share-groups { display: grid; gap: .4rem; }
.share-groups h3 { font-family: var(--font); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: .3rem 0 .1rem; }
.share-groups form { display: block; }
.share-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem; font: inherit; font-weight: 600; min-height: 46px; padding: .5rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elev-2); color: var(--text); cursor: pointer; }
.share-toggle.on { border-color: rgba(123, 216, 143, .5); background: rgba(123, 216, 143, .08); color: var(--ok); }
.share-toggle-action { font-size: .8rem; font-weight: 500; color: var(--muted); }
.share-toggle:not(.on) .share-toggle-action { color: var(--accent); }
.watched-tag { color: var(--accent-2); }
