:root {
  --bg: #14111c;
  --panel: #1f1a2b;
  --panel-2: #2a2339;
  --line: #3a3150;
  --text: #f4f1fa;
  --muted: #a69cbd;
  --accent: #ff4f7b;
  --like: #2fd17a;
  --nope: #ff5a5f;
  --super: #3aa8ff;
  --maybe: #ffb020;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

#app { min-height: 100%; }

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 120px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand::before {
  content: '';
  width: 30px; height: 30px;
  background: url(/favicon.svg) center / contain no-repeat;
}

h1 { font-size: 28px; line-height: 1.15; margin: 22px 0 6px; letter-spacing: -0.02em; }
.lead { color: var(--muted); margin: 0 0 22px; }

.section { margin: 26px 0; }
.section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
}
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 15px;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.off { background: transparent; border-color: #5a2a35; color: #c47a87; text-decoration: line-through; }
.chip.big { padding: 12px 18px; font-size: 16px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 120px; }
.field label { font-size: 13px; color: var(--muted); }
.input, select.input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  width: 100%;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type='range'] { width: 100%; accent-color: var(--accent); }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
  background: var(--panel-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: 11px; }

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}
.sticky-cta .inner { max-width: 640px; margin: 0 auto; }
.pool-info { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 8px; min-height: 20px; }
.pool-info b { color: var(--text); }

.strip { display: flex; gap: 6px; overflow: hidden; margin-top: 12px; height: 84px; }
.strip img { height: 84px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--panel); }

.card-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* --- Swipe-Ansicht ------------------------------------------------------ */

.swipe {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
}

.topbar { display: flex; align-items: center; gap: 10px; padding: 4px 2px 10px; }
.topbar .brand { font-size: 18px; }
.topbar .brand::before { width: 24px; height: 24px; }
.topbar .spacer { flex: 1; }
.pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.pill.match { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

.players { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 2px 10px; font-size: 13px; color: var(--muted); }
.progress { height: 4px; background: var(--panel); border-radius: 4px; overflow: hidden; margin: 0 2px 10px; }
.progress > div { height: 100%; background: var(--accent); transition: width 0.3s; }

.invite-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.invite-banner span { flex: 1; }

.stack { position: relative; flex: 1; min-height: 0; }

.card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  touch-action: none;
  user-select: none;
  will-change: transform;
}
.card:not(.top) { transform: scale(0.95) translateY(12px); filter: brightness(0.7); }
.card.top { cursor: grab; }
.card.anim { transition: transform 0.3s ease, opacity 0.3s; }
.card .poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.card .info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 80px 18px 16px;
  background: linear-gradient(transparent, rgba(10, 8, 16, 0.85) 30%, rgba(10, 8, 16, 0.97));
  max-height: 100%;
  overflow: hidden;
}
.card.expanded .info { overflow-y: auto; padding-top: 30%; }
.card h2 { margin: 6px 0 4px; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.badge { background: rgba(255, 255, 255, 0.14); border-radius: 6px; padding: 2px 8px; backdrop-filter: blur(4px); }
.badge.rating { background: #f5c518; color: #000; font-weight: 700; }
.genres { color: #d6cde8; font-size: 14px; }
.desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: #e3dcef;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card.expanded .desc { -webkit-line-clamp: unset; display: block; }
.credits { display: none; font-size: 13px; color: var(--muted); margin-top: 8px; }
.card.expanded .credits { display: block; }
.links { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.links .btn { padding: 8px 12px; font-size: 13px; background: rgba(255, 255, 255, 0.15); }
.links .btn.trailer { background: #ff0033; color: #fff; }
.more-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.stamp {
  position: absolute;
  top: 28px;
  padding: 4px 12px;
  border: 4px solid;
  border-radius: 10px;
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.25);
}
.stamp.like { left: 22px; color: var(--like); transform: rotate(-14deg); }
.stamp.nope { right: 22px; color: var(--nope); transform: rotate(14deg); }
.stamp.super { left: 50%; top: auto; bottom: 45%; color: var(--super); transform: translateX(-50%) rotate(-6deg); }
.stamp.maybe { left: 50%; top: 22%; color: var(--maybe); transform: translateX(-50%) rotate(4deg); font-size: 22px; }

.actions { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 14px; }
.act {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  font-size: 26px;
  display: grid; place-items: center;
  position: relative;
  transition: transform 0.1s;
}
.act:active { transform: scale(0.9); }
.act.sm { width: 46px; height: 46px; font-size: 20px; }
.act.nope { color: var(--nope); }
.act.like { color: var(--like); }
.act.super { color: var(--super); }
.act.maybe { color: var(--maybe); }
.act.undo { color: var(--muted); }
.act .count {
  position: absolute; top: -4px; right: -4px;
  background: var(--super); color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: grid; place-items: center;
}
.act-legend { display: flex; justify-content: center; gap: 14px; font-size: 11px; color: var(--muted); padding-top: 6px; }
.act-legend span { width: 58px; text-align: center; }
.act-legend span.sm { width: 46px; }

.empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; padding: 20px;
  background: var(--panel); border-radius: var(--radius);
}
.empty .big { font-size: 56px; }

/* --- Overlays ----------------------------------------------------------- */

.overlay {
  position: fixed; inset: 0;
  background: rgba(8, 6, 12, 0.85);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fade 0.2s;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 18px;
  position: relative;
}
.close {
  position: sticky; top: 0; float: right;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--panel-2); font-size: 18px;
  z-index: 2;
}

.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 12px; background: #000; }

.match-pop { text-align: center; }
.match-pop h2 {
  font-size: 44px; margin: 0;
  font-style: italic; font-weight: 900;
  background: linear-gradient(90deg, #ff4f7b, #ffb020);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.match-pop img { width: 180px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 14px; margin: 16px 0; box-shadow: 0 10px 40px rgba(255, 79, 123, 0.4); animation: pop 0.4s cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(0.4); } }

.result { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.result img { width: 74px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; flex: none; background: var(--panel); }
.result .meta { flex: 1; min-width: 0; }
.result h4 { margin: 0 0 2px; font-size: 17px; }
.result .sub { font-size: 13px; color: var(--muted); }
.result .who { font-size: 13px; margin-top: 4px; }
.result .links { margin-top: 8px; }
.result .links .btn { background: var(--panel-2); }
.result.picked { background: linear-gradient(90deg, rgba(255, 79, 123, 0.25), transparent); border-radius: 12px; padding-left: 8px; }

.result.vetoed { opacity: 0.55; }
.result.vetoed img { filter: grayscale(1); }
.result .links .btn.veto { background: #3a1d24; color: #ff9aa5; }
.btn[hidden], .pill[hidden] { display: none; }

/* --- Finale ------------------------------------------------------------- */

.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.vs { font-weight: 900; font-style: italic; color: var(--accent); font-size: 18px; }
.duel-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px 8px 10px;
  text-align: center;
  font-size: 14px;
  min-width: 0;
  transition: transform 0.1s, border-color 0.15s;
}
.duel-card:hover { border-color: var(--accent); }
.duel-card:active { transform: scale(0.96); }
.duel-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 9px; background: var(--panel-2); }
.duel-card b { line-height: 1.2; overflow-wrap: anywhere; }
.duel-card .sub { color: var(--muted); font-size: 12px; }
.duel-card .trailer { background: #ff0033; color: #fff; padding: 5px 10px; font-size: 12px; }

.empty-inline { text-align: center; padding: 18px 0 6px; color: var(--muted); }

.final-winner { text-align: center; }
.final-winner .trophy { font-size: 54px; line-height: 1; animation: pop 0.5s cubic-bezier(.3,1.6,.6,1); }
.final-winner img {
  width: 190px; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 14px; margin: 14px 0 10px;
  box-shadow: 0 10px 40px rgba(255, 176, 32, 0.45);
  animation: pop 0.5s cubic-bezier(.3,1.6,.6,1);
}
.final-winner h2 { margin: 0 0 4px; font-size: 26px; }
.final-winner .sub { color: var(--muted); font-size: 14px; }

.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; margin-left: 6px; vertical-align: middle; }
.tag.strong { background: var(--like); color: #062; }
.tag.weak { background: var(--maybe); color: #420; }

details summary { cursor: pointer; color: var(--muted); padding: 10px 0; }

#toast {
  position: fixed; left: 50%; bottom: 120px;
  transform: translateX(-50%) translateY(20px);
  background: #000c; color: #fff;
  padding: 10px 16px; border-radius: 12px;
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: 0.25s; z-index: 100;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

.center-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.spinner { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
