:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1a1f24; --muted: #6b7280;
  --line: #e5e7eb; --brand: #5b21b6; --brand-ink: #4c1d95;
  --like: #15803d; --nope: #b91c1c; --star: #d97706;
  --radius: 14px; --shadow: 0 1px 3px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f1014; --card:#181a20; --ink:#e7e9ee; --muted:#9aa0ad;
    --line:#2a2e38; --brand:#a78bfa; --brand-ink:#c4b5fd; --star:#fbbf24; --shadow:none; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top)); background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .topbar { background: #241b3d; } }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand span { opacity: .8; font-weight: 500; }
.ctx { font-size: 14px; opacity: .95; text-align: right; }
.ctx button { background: rgba(255,255,255,.18); color: #fff; padding: 5px 10px; font-size: 13px; }
.app { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
.loading, .empty { color: var(--muted); text-align: center; padding: 32px; }
.error { color: var(--nope); font-size: 14px; margin: 8px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 4px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; font: inherit; font-size: 16px;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
button { font: inherit; cursor: pointer; border: none; border-radius: 10px; padding: 11px 16px; font-weight: 600; }
.btn { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn { color: #17121f; } }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-link { background: none; color: var(--muted); padding: 4px; font-weight: 500; }
button[disabled] { opacity: .5; cursor: default; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--muted);
  padding: 10px 6px; font-size: 14px; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .tabs button.active { color: #17121f; } }

.list { list-style: none; margin: 0; padding: 0; }
.movie { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line);
  text-align: left; background: none; width: 100%; color: inherit; font-weight: 400; border-radius: 0; }
.movie:first-child { border-top: none; }
.poster { width: 56px; height: 84px; flex: none; border-radius: 8px; object-fit: cover;
  background: var(--bg); border: 1px solid var(--line); }
.poster.ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; }
.sub { font-size: 13px; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.muted { color: var(--muted); }
.pill { display: inline-block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--muted); }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
/* Passgenauigkeit im Reiter „Vorschläge" */
.score { flex: none; align-self: center; text-align: center; min-width: 58px;
  border-radius: 10px; padding: 6px 4px; border: 1px solid var(--line); background: var(--bg); }
.score b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.score span { font-size: 11px; color: var(--muted); }
.score.hoch { border-color: var(--like); color: var(--like); }
.score.mittel { border-color: var(--star); color: var(--star); }
.score.niedrig { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .chip.on { color: #17121f; } }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.check input { width: auto; }
.check label { margin: 0; color: var(--ink); font-size: 15px; }

/* --- Detail-Sheet ------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center; }
/* display:flex überstimmt sonst das hidden-Attribut – das unsichtbare Overlay
   läge dann über der Seite und würde jeden Klick abfangen. */
.sheet[hidden] { display: none; }
.sheet-inner { background: var(--card); width: 100%; max-width: 720px; max-height: 92vh;
  overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.sheet-head { display: flex; gap: 14px; margin-bottom: 14px; }
.sheet-head .poster { width: 92px; height: 138px; }
.rate-row { display: flex; gap: 2px; margin: 6px 0 2px; }
.rate-row button { background: none; padding: 2px; font-size: 26px; line-height: 1; color: var(--line); }
.rate-row button.on { color: var(--star); }
.castlist { font-size: 14px; color: var(--muted); }

/* --- Swipe-Deck --------------------------------------------------------- */
.deck { position: relative; height: 68vh; min-height: 420px; margin: 8px 0 14px; }
.swipe-card { position: absolute; inset: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; touch-action: pan-y; user-select: none; }
.swipe-card img { width: 100%; flex: 1; object-fit: cover; min-height: 0; background: var(--bg); }
.swipe-card .meta { padding: 12px 14px 14px; }
.swipe-card.behind { transform: scale(.96) translateY(10px); box-shadow: none; opacity: .7; }
.swipe-card .stamp { position: absolute; top: 18px; font-size: 22px; font-weight: 800;
  padding: 6px 14px; border-radius: 10px; border: 3px solid; opacity: 0; transition: opacity .1s; }
.stamp.yes { left: 16px; color: var(--like); border-color: var(--like); transform: rotate(-12deg); }
.stamp.no { right: 16px; color: var(--nope); border-color: var(--nope); transform: rotate(12deg); }
.swipe-actions { display: flex; gap: 12px; justify-content: center; }
.swipe-actions button { width: 64px; height: 64px; border-radius: 50%; font-size: 26px; padding: 0; }
.swipe-actions .no { background: var(--card); color: var(--nope); border: 2px solid var(--nope); }
.swipe-actions .yes { background: var(--card); color: var(--like); border: 2px solid var(--like); }
.swipe-actions .info { background: var(--card); color: var(--muted); border: 2px solid var(--line); font-size: 20px; }
.match-banner { background: var(--like); color: #fff; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; }
.match-banner strong { font-size: 18px; }
.sharebox { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.sharebox input { font-size: 14px; }
.progress { font-size: 13px; color: var(--muted); }
