:root {
  --bg: #0d0a0e;
  --bg-2: #151017;
  --panel: #1b151e;
  --panel-2: #241c28;
  --line: #33293a;
  --text: #f5eee6;
  --muted: #a99eaa;
  --gold: #f2c14e;
  --gold-2: #ffdf8a;
  --red: #e63946;
  --red-2: #ff6b74;
  --green: #4cc38a;
  --radius: 16px;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 18px 40px -18px rgb(0 0 0 / .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: var(--gold); }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h2 { font: 400 1.9rem/1 var(--display); letter-spacing: .02em; }
h3 { font-size: 1rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; letter-spacing: .12em; }
.error { color: var(--red-2); }
.pad { padding: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* velvet curtain glow at the top of the page */
.curtain {
  position: fixed; inset: 0 0 auto; height: 420px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(60% 100% at 50% 0%, rgb(230 57 70 / .28), transparent 70%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / .018) 0 18px, transparent 18px 36px);
  mask-image: linear-gradient(#000, transparent);
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel-2); color: var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s, background .2s, border-color .2s, opacity .2s;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #f04652; border-color: #f04652; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #261a00; }
.btn.gold:hover:not(:disabled) { background: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn.big { min-height: 56px; padding: 14px 32px; font-size: 1.1rem; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

input:not([type=checkbox]) {
  min-height: 46px; padding: 10px 14px; width: 100%;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
}
input:focus { border-color: var(--gold); outline: none; }

/* --- auth ---------------------------------------------------------------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(400px, 100%); padding: 32px 28px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.logo-big { font: 400 3.6rem/1 var(--display); text-align: center; letter-spacing: .03em; }
.tagline { text-align: center; color: var(--muted); margin: 8px 0 24px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.auth-switch { text-align: center; color: var(--muted); margin: 18px 0 0; }
.auth-invite { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: rgb(242 193 78 / .1); border: 1px solid rgb(242 193 78 / .35); font-size: .95rem; }

/* --- layout -------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: rgb(13 10 14 / .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { font: 400 1.9rem/1 var(--display); color: var(--text); text-decoration: none; letter-spacing: .03em; white-space: nowrap; }
.user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.username { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { width: min(1040px, 100%); margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 20px; }
.credit { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 28px; }
.credit .tmdb { color: #01b4e4; font-weight: 700; text-decoration: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; align-content: start; }
.panel h2 { font-size: 1.7rem; }
.panel p { margin: 0; }
.notice { margin: 0; padding: 12px 16px; border-radius: 12px; background: rgb(242 193 78 / .1); border: 1px solid rgb(242 193 78 / .35); }
.error-notice { background: rgb(230 57 70 / .12); border-color: rgb(230 57 70 / .45); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* --- home ---------------------------------------------------------------- */

.hero { text-align: center; padding: 16px 0 4px; }
.hero h1 { font: 400 clamp(2.8rem, 9vw, 5.4rem)/.95 var(--display); letter-spacing: .02em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { max-width: 620px; margin: 14px auto 0; color: var(--muted); }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.join-row, .search-row { display: flex; gap: 10px; }
.code-input { text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; letter-spacing: .3em; text-align: center; font-size: 1.2rem; }
.quick-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.quick {
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); font-size: .9rem;
}
.quick.on { background: rgb(242 193 78 / .16); border-color: var(--gold); color: var(--gold-2); }
.random-panel > .btn { justify-self: start; }
.random-card {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start;
  padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line);
}
.random-card .poster { width: 120px; border-radius: 10px; }
.random-card h3 { font: 400 1.8rem/1 var(--display); letter-spacing: .02em; }
.random-card p { margin: 6px 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.room-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.room-list a {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px;
  color: var(--text); text-decoration: none; background: var(--bg-2); border: 1px solid transparent;
}
.room-list a:hover { border-color: var(--line); }
.room-line { display: grid; min-width: 0; font-size: .92rem; }
.room-line > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-poster { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; font-size: 1.2rem; }

/* --- posters & tiles ----------------------------------------------------- */

.poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--panel-2); }
.poster-empty {
  display: grid; place-items: center; text-align: center; padding: 10px; overflow: hidden;
  background: linear-gradient(160deg, #3a1d2a, #1b151e 60%), var(--panel-2);
  color: var(--gold-2); font: 400 1.3rem/1 var(--display); letter-spacing: .03em;
}
.mini-poster.poster-empty span { display: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.tiles.row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 130px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.tiles.row > * { scroll-snap-align: start; }
.tile {
  display: grid; gap: 6px; align-content: start; text-align: left; padding: 0;
  background: none; border: 0; cursor: pointer; color: var(--text);
}
.tile:hover .poster { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile .poster { transition: transform .2s, box-shadow .2s; }
.tile-title { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.tile-meta { font-size: .82rem; color: var(--muted); }
.tile-alt { font-size: .78rem; color: var(--muted); font-style: italic; line-height: 1.25; margin-top: -4px; }
.rating { color: var(--gold); font-weight: 700; white-space: nowrap; }

/* --- loading reel -------------------------------------------------------- */

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 28px 12px; text-align: center; }
.loading.big { flex-direction: column; font-size: 1.1rem; padding: 60px 12px; }
.reel {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 22%, var(--bg) 0 4px, transparent 5px),
    radial-gradient(circle at 78% 50%, var(--bg) 0 4px, transparent 5px),
    radial-gradient(circle at 50% 78%, var(--bg) 0 4px, transparent 5px),
    radial-gradient(circle at 22% 50%, var(--bg) 0 4px, transparent 5px),
    var(--gold);
  animation: spin 1s linear infinite;
}
.loading.big .reel { width: 56px; height: 56px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- room ---------------------------------------------------------------- */

.room { display: grid; gap: 20px; }
.room-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.room-id { display: flex; align-items: center; gap: 10px; }
.room-id strong { font-size: 1.25rem; color: var(--gold); }
.room-actions { display: flex; gap: 8px; }
.room-actions .btn { white-space: nowrap; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.players li {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: .9rem;
}
.players li.away { opacity: .55; }
.players li.online .avatar { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--green); }
.pstat { color: var(--muted); font-size: .8rem; }
.pstat.ok { color: var(--green); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; color: #fff;
  background: hsl(var(--hue) 55% 42%);
}

.stage { display: grid; gap: 16px; justify-items: center; text-align: center; padding: 12px 0; }
.stage h2 { font-size: 2.2rem; }
.stage p { margin: 0; max-width: 640px; }
.stage .tiles { width: 100%; text-align: left; }
.waiting { color: var(--muted); }
.waiting::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: .15; } }

.big-code {
  font-size: clamp(2.6rem, 12vw, 4.4rem); font-weight: 700; color: var(--gold);
  padding: 10px 26px; border-radius: 18px; border: 2px dashed rgb(242 193 78 / .5); background: rgb(242 193 78 / .06);
}
.seats { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.seat {
  display: grid; justify-items: center; gap: 6px; width: 110px; padding: 14px 8px;
  border-radius: 14px; border: 1px dashed var(--line); font-size: .9rem;
}
.seat.taken { border-style: solid; background: var(--panel); }
.seat .avatar { width: 46px; height: 46px; font-size: 1.2rem; }
.seat-empty { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--muted); color: var(--muted); }

/* --- criteria cards -------------------------------------------------------- */

.cat-gold { --c: #f2c14e; }
.cat-violet { --c: #a78bfa; }
.cat-teal { --c: #2dd4bf; }
.cat-blue { --c: #60a5fa; }
.cat-rose { --c: #f472b6; }
.cat-green { --c: #4ade80; }

.rules { color: var(--muted); font-size: .95rem; }
.t-wish { color: var(--gold); }
.t-veto { color: var(--red-2); }
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 18px 0 8px; perspective: 900px; }
.dealing .hand-slot { animation: deal .5s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes deal { from { opacity: 0; transform: translateY(60px) rotate(-8deg) scale(.8); } }

.cc {
  position: relative; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; gap: 6px;
  width: 148px; height: 214px; padding: 12px 10px; text-align: center; cursor: pointer;
  border-radius: 14px; border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%),
    linear-gradient(180deg, #221a26, #161118);
  box-shadow: 0 10px 24px -14px #000, inset 0 0 0 4px rgb(0 0 0 / .25);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1.3), box-shadow .2s, border-color .2s, filter .2s;
}
button.cc:hover { transform: translateY(-6px) rotate(-1deg); }
.cc-cat { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--c); }
.cc-icon { font-size: 2.6rem; line-height: 1; align-self: center; }
.cc-label { font: 400 1.45rem/1 var(--display); letter-spacing: .03em; display: grid; }
.cc-no { font-size: .8rem; color: var(--red-2); letter-spacing: .14em; }
.cc-text { font-size: .74rem; line-height: 1.3; color: var(--muted); }
.cc-badge {
  position: absolute; top: -10px; right: -8px; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.cc.wish { transform: translateY(-14px); border-color: var(--gold); box-shadow: 0 0 0 3px rgb(242 193 78 / .3), 0 18px 34px -12px rgb(242 193 78 / .55); }
.cc.wish .cc-badge { background: var(--gold); color: #261a00; }
.cc.veto { transform: translateY(-14px) rotate(2deg); border-color: var(--red); filter: saturate(.6); box-shadow: 0 0 0 3px rgb(230 57 70 / .3), 0 18px 34px -12px rgb(230 57 70 / .6); }
.cc.veto .cc-badge { background: var(--red); color: #fff; }
.cc.veto .cc-icon { filter: grayscale(1); position: relative; }
.cc.veto .cc-icon::after { content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 3px; background: var(--red); transform: rotate(-35deg); border-radius: 2px; }
.small-hand { padding-top: 22px; }
.hand.ten { max-width: 820px; } /* 5 + 5 on wide screens */

/* "open" mode: the whole deck, one row per category */
.catalog { width: 100%; display: grid; gap: 18px; text-align: left; }
.cat-section h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--c);
  padding-bottom: 6px; margin-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.cat-cards { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
.cc.compact { width: 112px; height: 124px; grid-template-rows: 1fr auto; padding: 10px 6px; gap: 4px; }
.cc.compact .cc-cat, .cc.compact .cc-text { display: none; }
.cc.compact .cc-icon { font-size: 1.9rem; }
.cc.compact .cc-label { font-size: 1.08rem; }
.cc.compact.wish, .cc.compact.veto { transform: translateY(-6px); }
.cc.compact .cc-badge { top: -9px; right: -6px; font-size: .64rem; padding: 2px 8px; }

/* selection summary + buttons, kept in view while scrolling through cards */
.draft-bar {
  position: sticky; bottom: 12px; z-index: 5; width: min(720px, 100%);
  display: grid; gap: 4px; justify-items: center; padding: 12px 14px;
  background: rgb(27 21 30 / .94); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.draft-bar .actions { margin-top: 4px; }
.draft-picked { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 26px; align-items: center; font-size: .9rem; }

/* game mode picker (lobby, and for the next round on the result screen) */
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin-top: 6px; }
.section-title .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; width: min(620px, 100%); }
.mode {
  display: grid; gap: 4px; justify-items: center; text-align: center; padding: 16px 14px; cursor: pointer;
  background: var(--panel); border: 2px solid var(--line); border-radius: 16px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.mode:hover:not(:disabled) { border-color: var(--muted); }
.mode:disabled { cursor: default; }
.mode:disabled:not(.on) { opacity: .45; }
.mode.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(242 193 78 / .2); }
.mode-icon { font-size: 2rem; line-height: 1; }
.mode strong { font: 400 1.5rem/1 var(--display); letter-spacing: .03em; }
.mode-text { color: var(--muted); font-size: .88rem; }
.mode-limits { font-size: .78rem; color: var(--gold); font-weight: 700; }
.modes.compact { display: flex; flex-wrap: wrap; justify-content: center; width: auto; gap: 8px; }
.modes.compact .mode { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; }
.modes.compact .mode-icon { font-size: 1.2rem; }
.modes.compact .mode strong { font: 700 .9rem var(--body); }
.next-mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }

.cc-mini {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: .8rem; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.cc-mini.veto { border-color: var(--red); background: rgb(230 57 70 / .14); color: var(--red-2); }

/* --- table & voting ---------------------------------------------------------- */

.table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.table h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.table ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.table li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tname { font-weight: 700; margin-right: 4px; }
.tcards { display: flex; flex-wrap: wrap; gap: 6px; }
.note { margin: 0; font-size: .88rem; color: var(--muted); }

.progress-line { text-align: center; color: var(--muted); margin: 0; font-weight: 500; }
.deck { display: grid; justify-items: center; }
.swipe-card {
  position: relative; width: min(380px, 100%); overflow: hidden; touch-action: pan-y; user-select: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  transition: transform .25s, opacity .25s;
  animation: rise .35s cubic-bezier(.2, .8, .3, 1.2);
  --yes: 0; --no: 0;
}
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card.gone-yes { transform: translateX(130%) rotate(18deg); opacity: 0; }
.swipe-card.gone-no { transform: translateX(-130%) rotate(-18deg); opacity: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.swipe-poster { width: 100%; aspect-ratio: 2 / 3; max-height: 52vh; object-fit: cover; display: block; pointer-events: none; }
.swipe-poster.poster-empty { display: grid; font-size: 2.4rem; }
@media (min-width: 720px) {
  .swipe-card { width: min(680px, 100%); display: grid; grid-template-columns: 260px 1fr; }
  .swipe-poster { max-height: none; height: 100%; }
  .swipe-info { align-content: center; padding: 24px; }
  .swipe-info .clamp { -webkit-line-clamp: 7; }
}
.swipe-info { padding: 14px 18px 18px; display: grid; gap: 6px; text-align: left; }
.swipe-info h3 { font: 400 2rem/1 var(--display); letter-spacing: .02em; }
.swipe-info p { margin: 0; }
.swipe-info .link { justify-self: start; font-size: .92rem; }
.stamp {
  position: absolute; top: 22px; z-index: 2; padding: 4px 14px; border: 4px solid; border-radius: 10px;
  font: 400 2.2rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; pointer-events: none;
}
.stamp.yes { left: 18px; color: var(--green); transform: rotate(-14deg); opacity: var(--yes); }
.stamp.no { right: 18px; color: var(--red-2); transform: rotate(14deg); opacity: var(--no); }
.gone-yes .stamp.yes, .gone-no .stamp.no { opacity: 1; }
.vote-buttons { display: flex; justify-content: center; gap: 28px; }
.vote {
  width: 72px; height: 72px; border-radius: 50%; cursor: pointer; font-size: 1.9rem; font-weight: 700;
  background: var(--panel); border: 2px solid; transition: transform .12s, background .2s;
}
.vote:active { transform: scale(.9); }
.vote.no { color: var(--red-2); border-color: rgb(230 57 70 / .6); }
.vote.yes { color: var(--green); border-color: rgb(76 195 138 / .6); }
.vote.no:hover { background: rgb(230 57 70 / .12); }
.vote.yes:hover { background: rgb(76 195 138 / .12); }

.tile.voted { position: relative; }
.tile-open { display: grid; gap: 6px; padding: 0; background: none; border: 0; cursor: pointer; text-align: left; }
.tile.voted:not(.liked) .poster { filter: grayscale(.8) brightness(.6); }
.revote { padding: 6px; border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 700; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.liked .revote { color: var(--green); border-color: rgb(76 195 138 / .5); }

/* --- result ----------------------------------------------------------------- */

.result { display: grid; gap: 14px; }
.kicker { margin: 0; text-align: center; font: 400 clamp(2.4rem, 8vw, 3.6rem)/1 var(--display); letter-spacing: .03em; color: var(--gold); }
.result > .muted { margin: 0; }
.result-sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -30px rgb(242 193 78 / .35); }
.flip-in { animation: flip .7s cubic-bezier(.2, .8, .3, 1.1) both; transform-origin: 50% 0; }
@keyframes flip { from { opacity: 0; transform: perspective(900px) rotateX(-70deg) translateY(-20px); } }
.tally { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.tally summary { cursor: pointer; font-weight: 700; }
.tally ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tally li { display: flex; justify-content: space-between; gap: 12px; }
.tally li span { color: var(--red-2); letter-spacing: .1em; }

.burst { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.burst span { position: absolute; left: 50%; bottom: -40px; font-size: 2rem; animation: pop 2.2s cubic-bezier(.15, .7, .4, 1) both; }
@keyframes pop {
  60% { opacity: 1; }
  to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; }
}

/* --- film sheet --------------------------------------------------------------- */

.sheet { display: grid; }
.sheet-hero {
  position: relative; display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: end;
  padding: 90px 24px 22px;
  background:
    linear-gradient(180deg, rgb(27 21 30 / .35), var(--panel) 92%),
    var(--backdrop, linear-gradient(160deg, #3a1d2a, var(--panel))) center / cover;
}
.sheet-poster { width: 180px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }
.sheet-head { display: grid; gap: 6px; min-width: 0; }
.sheet-head h2 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: .95; }
.sheet-head p { margin: 0; }
.original { color: var(--muted); font-style: italic; }
.sheet-meta { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: 999px; font-size: .8rem; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .12); }
.chip.ghost { background: none; color: var(--muted); }
.sheet-score { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: 1.05rem; }
.sheet-score .muted { font-size: .85rem; }
.tagline-quote { font-style: italic; color: var(--gold-2); }
.sheet-block { padding: 18px 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.sheet-block h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.overview { margin: 0; font-size: 1.02rem; max-width: 70ch; }
.trailer {
  position: relative; width: min(560px, 100%); aspect-ratio: 16 / 9; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--thumb) center / cover, #000;
}
.trailer .play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; background: var(--red); color: #fff; font-size: 1.4rem;
  transition: transform .15s;
}
.trailer:hover .play { transform: scale(1.1); }
.trailer-frame { width: min(560px, 100%); aspect-ratio: 16 / 9; }
.trailer-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 14px; }
.prov-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prov-label { width: 90px; color: var(--muted); font-size: .88rem; }
.prov { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: .88rem; }
.prov img { width: 26px; height: 26px; border-radius: 6px; }
.prov:not(:has(img)) { padding-left: 10px; }
.small-link { font-size: .88rem; justify-self: start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.cast { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.cast figure { margin: 0; display: grid; gap: 6px; }
.cast img, .cast-empty { width: 104px; height: 140px; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.cast-empty { display: grid; place-items: center; font: 400 2rem var(--display); color: var(--muted); }
.cast figcaption { display: grid; font-size: .8rem; line-height: 1.3; }
.cast figcaption span { color: var(--muted); }
.keywords { margin-top: 4px; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 18px; padding: 16px 24px 22px; margin: 0; border-top: 1px solid var(--line); }

/* --- dialog & toast ---------------------------------------------------------- */

.movie-dialog {
  width: min(860px, calc(100% - 24px)); max-height: calc(100% - 32px); padding: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  overflow: hidden;
}
.movie-dialog[open] { display: grid; animation: rise .3s; }
.movie-dialog::backdrop { background: rgb(5 3 6 / .78); backdrop-filter: blur(4px); }
.dialog-body { overflow-y: auto; max-height: calc(100vh - 34px); overscroll-behavior: contain; }
.dialog-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .2); background: rgb(13 10 14 / .7); cursor: pointer; font-size: 1.1rem;
}

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--shadow);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* --- small screens ------------------------------------------------------------- */

@media (max-width: 900px) {
  .room-head { grid-template-columns: 1fr auto; }
  .players { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

@media (max-width: 720px) {
  .room-id .btn { display: none; }
}

@media (max-width: 560px) {
  .view { padding-top: 16px; }
  .topbar .btn { padding-inline: 10px; }
  .hand { gap: 10px; }
  .cc { width: calc((100vw - 32px - 20px) / 3); max-width: 148px; height: auto; aspect-ratio: 148 / 214; padding: 10px 6px; gap: 4px; }
  .cc-icon { font-size: 2rem; }
  .cc-label { font-size: 1.15rem; }
  .cc-text { display: none; }
  .cc.wish, .cc.veto { transform: translateY(-8px); }
  .cat-cards { gap: 8px; }
  .cc.compact { width: calc((100vw - 32px - 24px) / 4); max-width: 112px; height: auto; aspect-ratio: 112 / 124; padding: 8px 4px; }
  .cc.compact .cc-icon { font-size: 1.5rem; }
  .cc.compact .cc-label { font-size: .9rem; }
  .random-card { grid-template-columns: 90px 1fr; }
  .random-card .poster { width: 90px; }
  .sheet-hero { grid-template-columns: 110px 1fr; padding: 70px 16px 16px; gap: 14px; }
  .sheet-poster { width: 110px; }
  .sheet-block { padding: 16px; }
  .sheet-links { padding: 14px 16px 18px; }
  .movie-dialog { width: 100%; max-height: 100%; height: 100%; border-radius: 0; margin: 0; max-width: 100%; }
  .dialog-body { max-height: 100vh; }
  .room-actions .btn { padding-inline: 10px; }
}

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

/* --- language switch ------------------------------------------------------------ */

.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.lang-switch button {
  min-width: 38px; padding: 4px 9px; border: 0; border-radius: 999px; cursor: pointer;
  background: none; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .06em;
}
.lang-switch button[aria-pressed="true"] { background: var(--gold); color: #261a00; }
.auth-lang { display: flex; width: fit-content; margin: -14px -12px 10px auto; }
@media (max-width: 560px) {
  .username { display: none; }
}
