/* Jaeggflix Web: Design A (Glas), Farben und Maße aus packages/design der Vorlage. */
:root {
  --bg: #090812;
  --text: #fff;
  --text2: rgba(255, 255, 255, 0.8);
  --text3: rgba(255, 255, 255, 0.6);
  --glass: rgba(40, 38, 56, 0.6);
  --glass-border: rgba(255, 255, 255, 0.18);
  --row: rgba(255, 255, 255, 0.08);
  --row-strong: rgba(255, 255, 255, 0.22);
  --section: rgba(255, 255, 255, 0.05);
  --ok: #33c759;
  --warn: #ffb340;
  --danger: #ff6b6b;
  --pad: 36px;
  --side: 252px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(64, 51, 191, 0.35), rgba(64, 51, 191, 0) 55%),
    radial-gradient(circle at 100% 100%, rgba(153, 51, 153, 0.22), rgba(153, 51, 153, 0) 55%);
}
body.playing { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.noscript { padding: 40px; text-align: center; }
.hidden { display: none !important; }

/* ---------- Gerüst */
.sidebar {
  position: fixed; left: 16px; top: 16px; width: 220px; z-index: 20; padding: 14px;
  display: flex; flex-direction: column; gap: 4px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; min-width: 0; border-radius: 14px; }
.side-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  color: #0a0a14; font-weight: 800;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 22px;
  color: var(--text2); font-weight: 500; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--row); color: #fff; }
.nav-item.active { background: #fff; color: #000; font-weight: 700; }
#view { margin-left: var(--side); padding: 24px var(--pad) 96px; min-height: 100vh; outline: none; }
.topbar, .tabbar { display: none; }
.wordmark { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }

/* ---------- Seiten */
.page { display: flex; flex-direction: column; gap: 36px; }
.page-title { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; }
.section-title { font-size: 21px; font-weight: 700; }
.muted { color: var(--text3); }
.empty { color: var(--text2); padding: 12px 0; max-width: 560px; }
.loading { display: flex; align-items: center; justify-content: center; min-height: 50vh; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.25); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rowwrap { display: flex; flex-direction: column; gap: 4px; }
.row {
  display: flex; gap: 20px; overflow-x: auto; padding: 12px var(--pad) 8px; margin: 0 calc(-1 * var(--pad));
  scroll-snap-type: x proximity; scroll-padding: 0 var(--pad); scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.row .card { flex: none; width: 268px; scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 20px; }

.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; border-radius: 12px; }
.card-img {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s; background: #222;
}
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-ph {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 12px 14px;
  font-weight: 700; font-size: 17px; line-height: 1.15; color: #fff;
}
.card:hover .card-img, .card:focus-visible .card-img { transform: scale(1.04); box-shadow: 0 0 0 3px #fff, 0 16px 40px rgba(0, 0, 0, 0.5); }
.card:focus-visible { outline: none; }
.card-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: -6px; font-size: 13px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: absolute; left: 10px; right: 10px; bottom: 9px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.bar-fill { height: 100%; background: #fff; }
.badge-watched {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--ok); color: #04210d;
}

/* ---------- Hero und Details */
.hero {
  position: relative; margin: -24px calc(-1 * var(--pad)) 0; min-height: min(62vh, 620px);
  display: flex; align-items: flex-end; padding: 48px var(--pad) 40px; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9, 8, 18, 0.94) 0%, rgba(9, 8, 18, 0.6) 46%, rgba(9, 8, 18, 0.15) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(9, 8, 18, 0) 45%);
}
.hero-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text2); }
.hero-title { font-size: clamp(34px, 5vw, 62px); font-weight: 800; line-height: 1.02; letter-spacing: -1px; overflow-wrap: anywhere; }
.meta { color: var(--text2); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 48px; padding: 0 24px;
  border: 0; border-radius: 24px; font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform 0.12s, background 0.15s;
}
.btn:hover { transform: scale(1.03); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary { background: #fff; color: #000; }
.btn-glass {
  background: rgba(255, 255, 255, 0.14); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.24); }
.btn-icon { width: 48px; padding: 0; border-radius: 50%; }
.btn-small { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 22px; }
.btn-danger { background: rgba(255, 107, 107, 0.16); color: #ffb3b3; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 22px; border: 0;
  background: var(--row); color: #fff; font-weight: 600; font-size: 15px;
}
.chip:hover { background: var(--row-strong); }
.chip.active { background: #fff; color: #000; }
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 179, 64, 0.12); color: #ffd9a0; font-size: 14px; max-width: 640px;
}

/* ---------- Formulare, Einstellungen */
.panel {
  background: var(--section); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 22px; padding: 22px;
  display: flex; flex-direction: column; gap: 16px; max-width: 760px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text2); }
.input {
  height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 16px; width: 100%; min-width: 0;
}
.input::placeholder { color: var(--text3); }
.input:focus { outline: 3px solid #fff; outline-offset: 1px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1 1 200px; }
.msg-error { color: #ffb3b3; font-size: 14px; }
.msg-ok { color: #9be7b1; font-size: 14px; }
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); min-width: 0;
}
.list-item:first-child { border-top: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; overflow-wrap: anywhere; }
.list-sub { font-size: 13px; color: var(--text3); overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--row-strong); margin-left: 6px; }
.tag-off { background: rgba(255, 107, 107, 0.2); color: #ffb3b3; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--row); border-radius: 14px; padding: 12px 14px; }
.stat-num { font-size: 26px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text3); }

.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; padding: 32px 28px; border-radius: 28px; display: flex; flex-direction: column; gap: 18px;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
}
.auth-card .wordmark { font-size: 34px; }
.auth-card .btn { width: 100%; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 200; max-width: min(90vw, 480px);
  padding: 12px 18px; border-radius: 16px; background: rgba(40, 38, 56, 0.95); border: 1px solid var(--glass-border); font-size: 14px;
}

/* ---------- Player */
.player { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; overflow: hidden; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.hide-ui { cursor: none; }
.player.hide-ui .p-ui { opacity: 0; pointer-events: none; }
.p-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; transition: opacity 0.25s; }
.p-top {
  display: flex; align-items: center; gap: 14px; padding: calc(18px + env(safe-area-inset-top)) 22px 40px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.p-titles { min-width: 0; }
.p-title { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { font-size: 14px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 6vw, 56px); }
.p-bottom {
  display: flex; flex-direction: column; gap: 10px; padding: 48px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
}
.p-time { display: flex; align-items: center; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.p-seek { flex: 1; height: 28px; margin: 0; accent-color: #fff; cursor: pointer; }
.p-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-tools > div { display: flex; align-items: center; gap: 10px; }
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; height: 48px; padding: 0 12px;
  border: 0; border-radius: 24px; background: rgba(60, 60, 70, 0.55); color: #fff; font-weight: 700; font-size: 15px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.pbtn:hover { background: rgba(110, 110, 125, 0.7); }
.pbtn-big { width: 84px; height: 84px; border-radius: 50%; }
.pbtn-mid { width: 60px; height: 60px; border-radius: 50%; }
.p-next {
  position: absolute; right: 22px; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 3;
  background: #fff; color: #000; height: 48px; padding: 0 22px; border-radius: 24px; border: 0; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
}
.p-wait { position: absolute; left: 50%; top: 50%; margin: -20px 0 0 -20px; pointer-events: none; }
.p-error {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center; background: rgba(0, 0, 0, 0.85);
}

/* ---------- Profile, Poster, Vorschau */
.pimg { flex: none; border-radius: 50%; object-fit: cover; background: #222; display: block; }
.who { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; padding: 40px 20px; }
.who-title { font-size: clamp(30px, 5vw, 48px); font-weight: 800; letter-spacing: -1px; text-align: center; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; max-width: 900px; }
.who-item {
  display: flex; flex-direction: column; align-items: center; gap: 12px; width: 150px; padding: 8px; border: 0; background: none; color: var(--text2);
  font-size: 17px; font-weight: 600; border-radius: 20px;
}
.who-item .pimg, .who-plus { width: 132px; height: 132px; transition: transform 0.15s, box-shadow 0.15s; }
.who-item:hover, .who-item:focus-visible { color: #fff; outline: none; }
.who-item:hover .pimg, .who-item:focus-visible .pimg, .who-item:hover .who-plus, .who-item:focus-visible .who-plus {
  transform: scale(1.06); box-shadow: 0 0 0 4px #fff, 0 0 40px rgba(255, 255, 255, 0.35);
}
.who-plus { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--row); color: #fff; }
.who-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-edit { font-size: 13px; color: var(--text3); margin-top: -8px; }
.who-actions { justify-content: center; }
.who-form { display: flex; flex-direction: column; gap: 22px; width: 100%; max-width: 640px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px; }
.avatar-pick { padding: 0; border: 0; background: none; border-radius: 50%; width: 84px; height: 84px; justify-self: center; }
.avatar-pick .pimg { width: 84px; height: 84px; opacity: 0.75; transition: opacity 0.15s, box-shadow 0.15s; }
.avatar-pick:hover .pimg { opacity: 1; }
.avatar-pick.active .pimg { opacity: 1; box-shadow: 0 0 0 4px #fff; }

.card-img.poster { aspect-ratio: 2 / 3; }
.card-ph-over { z-index: 1; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 60%); font-size: 15px; }
.row.row-poster .card { width: 172px; }
.grid.grid-poster { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 18px; }
.card-logo { position: absolute; left: 12px; bottom: 12px; width: 46% !important; height: 36% !important; inset: auto auto 12px 12px !important; object-fit: contain !important; object-position: left bottom; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8)); }
.card-img::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.card-img:has(.card-logo)::after { background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 55%); }
.card-img .bar, .card-img .badge-watched, .card-img .card-logo { z-index: 2; }

.preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s; pointer-events: none; z-index: 0; background: #000; }
.previewing > .preview-video { opacity: 1; }
.card-img.previewing .card-logo { opacity: 0; }
.hero-body { z-index: 2; }
.hero::after { z-index: 1; }
.hero-logo { display: block; max-width: min(460px, 70vw); max-height: 170px; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.7)); }
.hero-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 560px; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 3; display: flex; justify-content: center; gap: 4px; }
.hero-dot { width: 28px; height: 28px; padding: 0; border: 0; background: none; display: flex; align-items: center; justify-content: center; }
.hero-dot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.45); transition: width 0.2s, background 0.2s; }
.hero-dot.active::before { width: 24px; background: #fff; }
.hero-sound { position: absolute; right: var(--pad); top: 24px; z-index: 3; }

.review { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.review:first-child { border-top: 0; }
.review .list-item { border-top: 0; flex-wrap: wrap; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-search { padding: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.cand-img { flex: none; width: 46px; height: 69px; border-radius: 6px; object-fit: cover; background: var(--row); display: block; }

/* ---------- Handy und schmale Fenster */
@media (max-width: 900px) {
  :root { --pad: 16px; --side: 0px; }
  .sidebar { display: none; }
  #view { padding: 8px var(--pad) calc(92px + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) var(--pad) 8px;
  }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(15, 14, 28, 0.86); border-top: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 52px;
    color: var(--text3); font-size: 11px; font-weight: 600; border-radius: 14px;
  }
  .tab.active { color: #fff; }
  .hero { margin-top: -8px; min-height: 58vh; padding-bottom: 24px; }
  .page { gap: 28px; }
  .page-title { font-size: 28px; }
  .row { gap: 12px; }
  .row .card { width: 62vw; max-width: 260px; }
  .row.row-poster .card { width: 34vw; max-width: 150px; }
  .grid.grid-poster { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 10px; }
  .who-item { width: 128px; }
  .who-item .pimg, .who-plus { width: 104px; height: 104px; }
  .hero-sound { top: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 12px; }
  .pbtn-big { width: 72px; height: 72px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01s !important; }
}
