/* MiddleFilm - dunkel, handy-first, kein Framework */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f1116;
  color: #ecedef;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
.view { min-height: 100dvh; display: none; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.view.active { display: flex; }

.hidden { display: none !important; }
.err { color: #ff6b81; min-height: 1.4em; margin-top: 10px; text-align: center; }
.center { text-align: center; }
.hint { color: #8b8f9a; font-size: 14px; }
.hint.small { font-size: 12px; }
.lbl { color: #8b8f9a; font-size: 13px; margin: 14px 0 6px; }

.logo { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.logo span { color: #ff3d5a; }
.logo.small { font-size: 20px; }

input, select {
  width: 100%;
  background: #171a21;
  border: 1px solid #262a35;
  color: #ecedef;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  margin-top: 8px;
  outline: none;
}
input:focus, select:focus { border-color: #ff3d5a; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b8f9a 50%), linear-gradient(135deg, #8b8f9a 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }

.btn {
  display: block;
  width: 100%;
  border: 1px solid #262a35;
  background: #1c202b;
  color: #ecedef;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: #ff3d5a; border-color: #ff3d5a; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small-txt { font-size: 13px; font-weight: 500; width: auto; padding: 8px 12px; margin-top: 0; }
.btn.big { font-size: 18px; padding: 15px; }

.center-box { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px; }
.center-box.wide { width: 100%; max-width: 380px; margin: 0 auto; }
.center-box .logo { margin-bottom: 8px; }
.center-box .hint { margin-bottom: 18px; }

.foot-links { display: flex; gap: 18px; justify-content: center; padding: 18px 0 26px; }
.foot-links a { color: #565b66; font-size: 12px; text-decoration: none; }

/* ---------- Pin/Passwort mit Anzeigen-Button ---------- */
.pw-wrap { position: relative; width: 100%; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  bottom: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  opacity: 0.75;
}
.pw-toggle:active { opacity: 1; }

/* ---------- Auth ---------- */
.tabs3 { display: flex; gap: 6px; width: 100%; margin-bottom: 14px; }
.tab3 { flex: 1; background: #171a21; border: 1px solid #262a35; color: #8b8f9a; padding: 10px 0; border-radius: 12px; font-weight: 600; font-size: 14px; }
.tab3.active { background: #262a35; color: #fff; border-color: #3a4050; }

/* ---------- Home ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; gap: 10px; }
.head-right { display: flex; align-items: center; gap: 8px; }
.head-txt { color: #8b8f9a; font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.hello { font-size: 18px; }
.card-box { background: #171a21; border: 1px solid #262a35; border-radius: 16px; padding: 16px; }
.card-box h2 { font-size: 16px; margin-bottom: 4px; }

/* ---------- Lobby ---------- */
.lobby-body { flex: 1; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; }
.big-code { font-size: 56px; font-weight: 800; letter-spacing: 10px; margin: 4px 0 12px; color: #fff; cursor: pointer; user-select: none; }
.lobby-share-row { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.btn.small-share { flex: 1; font-size: 14px; padding: 11px 6px; margin-top: 0; }
.user-list { list-style: none; width: 100%; max-width: 380px; margin-top: 4px; }
.user-list li { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: #171a21; border: 1px solid #262a35; border-radius: 12px; margin-top: 8px; }
.user-list .owner-tag { color: #ffb020; font-size: 12px; font-weight: 700; }
.user-list .sw-cnt { color: #565b66; font-size: 12px; }
#owner-controls { width: 100%; max-width: 380px; }

/* ---------- Swipe ---------- */
.stack-wrap { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; padding: 8px 0; }
.stack { position: relative; width: 100%; max-width: 360px; height: 100%; min-height: 420px; }
.card {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(74dvh, 560px);
  background: #171a21;
  border: 1px solid #262a35;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
}
.card img.poster { flex: 1; width: 100%; object-fit: cover; min-height: 0; pointer-events: none; }
.card .info { padding: 12px 14px; background: linear-gradient(transparent, rgba(10,12,16,0.92) 30%); position: relative; }
.card .title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card .film-title { font-size: 17px; font-weight: 700; }
.card .film-year { color: #8b8f9a; font-size: 13px; }
.card .rating { color: #ffb020; font-size: 13px; font-weight: 600; }
.card .genres-line { color: #8b8f9a; font-size: 12px; margin-top: 4px; }
.card .ov { color: #b9bcc6; font-size: 13px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .chip-row { margin-top: 8px; }

.stamp {
  position: absolute;
  top: 18px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 2px;
  border: 4px solid;
  border-radius: 10px;
  padding: 2px 12px;
  opacity: 0;
  transition: opacity 0.1s;
}
.stamp.no { left: 16px; color: #ff3d5a; border-color: #ff3d5a; transform: rotate(-14deg); }
.stamp.yes { right: 16px; color: #2ee06f; border-color: #2ee06f; transform: rotate(14deg); }
.card.leaving { transition: transform 0.3s ease, opacity 0.3s ease; }

.stack-empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }

.likes-badge { text-align: center; min-height: 24px; font-size: 14px; color: #8b8f9a; padding: 0 12px; }

.swipe-btns { display: flex; justify-content: center; gap: 22px; padding: 12px 0 18px; }
.round-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 26px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.round-btn:active { transform: scale(0.92); }
.round-btn.nope { background: #3a2229; color: #ff6b81; }
.round-btn.like { background: #16351f; color: #2ee06f; font-size: 30px; }
.round-btn.undo { background: #1c202b; color: #8b8f9a; width: 52px; height: 52px; font-size: 22px; align-self: center; }
.round-btn.undo:disabled { opacity: 0.35; }

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid #262a35;
  background: #171a21;
  color: #b9bcc6;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.on { background: #262a35; color: #fff; border-color: #3a4050; }
.chip-serv.p-netflix { border-color: #e50914; }
.chip-serv.p-netflix.on { background: #e50914; border-color: #e50914; color: #fff; }
.chip-serv.p-prime-video { border-color: #00a8e1; }
.chip-serv.p-prime-video.on { background: #00a8e1; border-color: #00a8e1; color: #fff; }
.chip-serv.p-disney { border-color: #3f6fb5; }
.chip-serv.p-disney.on { background: #113ccf; border-color: #113ccf; color: #fff; }
.chip-serv.p-apple-tv { border-color: #888; }
.chip-serv.p-apple-tv.on { background: #555; border-color: #555; color: #fff; }
.chip-serv.p-crunchyroll { border-color: #f47521; }
.chip-serv.p-crunchyroll.on { background: #f47521; border-color: #f47521; color: #fff; }
.chip-serv.p-kostenlos { border-color: #2ee06f; }
.chip-serv.p-kostenlos.on { background: #1d7a45; border-color: #1d7a45; color: #fff; }

/* ---------- Watchlist ---------- */
.stats-row { display: flex; gap: 10px; padding: 14px 16px 6px; }
.stat { flex: 1; background: #171a21; border: 1px solid #262a35; border-radius: 14px; padding: 10px; text-align: center; }
.stat b { font-size: 20px; display: block; }
.stat span { font-size: 11px; color: #8b8f9a; }
.match-list { padding: 10px 16px 30px; display: flex; flex-direction: column; gap: 12px; }
.match-row { display: flex; gap: 12px; background: #171a21; border: 1px solid #262a35; border-radius: 14px; padding: 10px; }
.match-row img { width: 64px; height: 96px; object-fit: cover; border-radius: 8px; background: #262a35; }
.match-row .mr-body { flex: 1; min-width: 0; }
.match-row .film-title { font-size: 15px; font-weight: 700; }
.match-row .meta { color: #8b8f9a; font-size: 12px; margin-top: 2px; }
.match-row .likes-note { color: #b9bcc6; font-size: 12px; margin-top: 6px; }
.watched-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; font-size: 13px; color: #8b8f9a; }
.watched-check input { width: 22px; height: 22px; margin: 0; accent-color: #2ee06f; }

/* ---------- Filter-Sheet ---------- */
.sheet {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 40;
}
.sheet-inner {
  width: 100%; max-width: 560px;
  max-height: 86dvh;
  overflow-y: auto;
  background: #12151c;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 18px; }
.seg-row { display: flex; gap: 6px; }
.seg { flex: 1; background: #171a21; border: 1px solid #262a35; color: #8b8f9a; padding: 9px 0; border-radius: 10px; font-size: 13px; font-weight: 600; }
.seg.on { background: #262a35; color: #fff; border-color: #3a4050; }
.year-row { display: flex; gap: 10px; align-items: center; }
.year-row span { color: #8b8f9a; }
.year-row input { margin-top: 0; }

/* ---------- Match-Effekt ---------- */
.matchfx { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(8,9,13,0.82); }
#fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.match-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; }
.match-card img { width: 180px; height: 270px; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 40px rgba(255,61,90,0.35); }
.match-word {
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 24px rgba(255,61,90,0.9);
  letter-spacing: 4px;
}
.match-title { font-size: 17px; font-weight: 700; text-align: center; }
.fx-pop { animation: fxpop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes fxpop {
  0% { transform: scale(0.2) rotate(-18deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
