/* ====================================================================
   Film-Tombola – Styles
   Linke Seite = düster (Horror), rechte Seite = hell (Komödie)
   ==================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --night:        #080e1c;
  --bar:          #0b1423;
  --surface:      #0e1a2b;
  --card:         #142338;
  --raised:       #20334b;
  --line:         #344861;
  --control-line: #61748a;
  --txt:          #eff4ff;
  --muted:        #b4c1d4;
  --gold:         #f4d491;
  --gold-deep:    #d0a55d;
  --gold-line:    #ad8b53;
  --gold-surface: #343122;
  --dark-acc:     #b3122b;
  --accent:       #9b5de5; /* Profilfarbe */
}

html {
  min-height: 100%;
  overflow-x: clip;
  scrollbar-color: #465b75 var(--bar);
}

body {
  min-height: 100vh;
  background: var(--night);
  color: var(--txt);
  font-family: 'Nunito', system-ui, sans-serif;
}

.hidden { display: none !important; }
.muted  { color: var(--muted); }

/* Winternacht hinter der App und der Profilauswahl. */
.winter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #080e1c;
  background-image: linear-gradient(90deg, #080e1c22, #080e1c55 50%, #080e1c08), url('../assets/scenes/winter-night.webp?v=2');
  --winter-image-width: max(100vw, 150vh);
  --winter-image-width: max(100vw, 150dvh);
  --winter-image-left: calc(100vw - var(--winter-image-width));
  background-position: center, var(--winter-image-left) center;
  background-size: cover, var(--winter-image-width) auto;
  background-repeat: no-repeat;
}
.winter-backdrop::before, .winter-backdrop::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.winter-backdrop::before {
  inset: -181px -12px 0;
  background-image:
    radial-gradient(circle at 19px 22px, #d7e6ff9e 0 .8px, transparent 1.45px),
    radial-gradient(circle at 112px 41px, #d7e6ff91 0 .7px, transparent 1.4px),
    radial-gradient(circle at 53px 96px, #d7e6ff8f 0 .85px, transparent 1.5px),
    radial-gradient(circle at 156px 127px, #d7e6ffad 0 .9px, transparent 1.55px),
    radial-gradient(circle at 80px 158px, #d7e6ff85 0 .8px, transparent 1.45px);
  background-size: 181px 181px;
  animation: winter-snow-distant 6.4s linear infinite;
}
.winter-backdrop::after {
  inset: -263px -20px 0;
  background-image:
    radial-gradient(circle at 40px 52px, #f3f7ffb8 0 1px, transparent 2.05px),
    radial-gradient(circle at 157px 122px, #e2edffc4 0 1.35px, transparent 2.3px),
    radial-gradient(circle at 234px 223px, #ebf3ffa3 0 1.1px, transparent 1.95px);
  background-size: 263px 263px;
  opacity: .75;
  animation: winter-snow-near 4.7s linear infinite;
}
.winter-backdrop.snow-canvas-active::before, .winter-backdrop.snow-canvas-active::after { display: none; }
@keyframes winter-snow-distant {
  0% { transform: translate3d(0, 0, 0); }
  35% { transform: translate3d(9px, 63.35px, 0); }
  70% { transform: translate3d(4px, 126.7px, 0); }
  100% { transform: translate3d(0, 181px, 0); }
}
@keyframes winter-snow-near {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-5px, 65.75px, 0); }
  60% { transform: translate3d(-17px, 157.8px, 0); }
  100% { transform: translate3d(0, 263px, 0); }
}

/* Schneeflocken zwischen Hintergrundfoto und App. */
.fx-layer {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 12px;
  padding: 11px 18px;
  font: inherit; font-weight: 700;
  cursor: pointer;
  background: var(--raised); color: var(--txt);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:hover   { filter: brightness(1.12); }
.btn:active  { transform: translateY(1px) scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #1d1a12; }
.btn-dark    { background: linear-gradient(135deg, #63233a, #a5243f); color: #fff; }
.btn-light   { background: linear-gradient(135deg, #e0a760, var(--gold)); color: #241908; }
.btn-ghost   { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center;
  background: transparent; border: 0;
  border-radius: 10px; width: 40px; height: 40px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--raised); color: var(--txt); }
.icon-btn svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.sound-off, #sound-toggle[aria-pressed="true"] .sound-on { display: none; }
#sound-toggle[aria-pressed="true"] .sound-off { display: inline; }

input, select {
  font: inherit;
  background: var(--surface); color: var(--txt);
  border: 1px solid var(--control-line); border-radius: 10px;
  padding: 10px 12px;
}
input::placeholder { color: #91a5bd; }
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ====================================================================
   PROFIL-GATE
   ==================================================================== */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: #080e1c1f;
  padding: 20px;
}
.gate-card {
  width: min(720px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.gate-title { color: var(--gold); font-size: clamp(29px, 7vw, 40px); letter-spacing: .5px; }
.gate-sub   { color: var(--muted); margin: 6px 0 22px; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { position: relative; z-index: 1; width: min(420px, 100%); text-align: center; }
.login-logo { font-size: 48px; }
.login-card form { display: grid; gap: 12px; }
.login-card input { min-width: 0; text-align: center; }
.login-error {
  background: #3a0f18; border: 1px solid var(--dark-acc); color: #ffd0d8;
  border-radius: 10px; padding: 10px; margin-bottom: 14px; font-weight: 700;
}

.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.profile-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--line);
  cursor: pointer; transition: transform .1s, border-color .15s;
  position: relative;
}
.profile-tile:hover { transform: translateY(-3px); }
.profile-tile .pf-avatar { font-size: 34px; line-height: 1; }
.profile-tile .pf-name   { font-weight: 800; }
.profile-tile .pf-del {
  position: absolute; top: 6px; right: 8px;
  background: transparent; border: none; color: #91a5bd; cursor: pointer; font-size: 14px;
}
.profile-tile .pf-del:hover { color: var(--dark-acc); }
.profile-tile .pf-edit {
  position: absolute; top: 6px; left: 8px;
  background: transparent; border: none; color: #91a5bd; cursor: pointer; font-size: 13px;
}
.profile-tile .pf-edit:hover { color: var(--txt); }

.pe-row { display: flex; gap: 8px; margin-bottom: 12px; }
.pe-row #pe-name { flex: 1; min-width: 120px; }

.gate-new h3 { margin-bottom: 10px; }
.new-profile-row { display: flex; gap: 8px; flex-wrap: wrap; }
.new-profile-row #np-name { flex: 1; min-width: 160px; }
.avatar-input { width: 56px; text-align: center; font-size: 22px; }
input[type=color] { width: 48px; padding: 4px; cursor: pointer; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.emoji-pick button {
  font-size: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; padding: 4px 6px;
}
.emoji-pick button:hover { background: var(--raised); }
.gate-legal { margin-top: 22px; font-size: 13px; color: #91a5bd; }
.gate-legal a { color: var(--gold); text-decoration: none; }
.gate-legal a:hover { color: #fff; }

/* ====================================================================
   TOPBAR + TABS
   ==================================================================== */
.app { position: relative; z-index: 2; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  padding: 12px 20px;
  background: var(--bar);
  box-shadow: 0 5px 20px #080e1c35;
}
.brand { color: var(--gold); font-weight: 900; font-size: 20px; white-space: nowrap; text-shadow: 0 0 16px #d0a55d44; }
.topbar-menu { display: contents; }
#mobile-nav-toggle, #attendance-toggle { display: none; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-width: 0; margin: 0 auto; }
.tab {
  background: transparent; border: 1px solid transparent;
  color: var(--muted); padding: 8px 14px; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.tab:hover  { color: var(--txt); }
.tab.active {
  color: var(--gold);
  background: #f4d49118;
}
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.topbar-right .icon-btn, .topbar-right .notif-wrap { flex: none; }
.profile-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 0;
  border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer;
  min-width: 0; overflow-wrap: anywhere;
  color: var(--txt); font: inherit; font-weight: 700;
}
.profile-chip .chip-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex: none; font-size: 16px;
}

.tab-panel { padding: 22px; max-width: 1500px; margin: 0 auto; }

/* ====================================================================
   TOMBOLA – SPLIT
   ==================================================================== */
.attendance {
  background: #142338b8;
  border-radius: 16px;
  margin-bottom: 24px;
  padding: 16px 20px;
}
.attendance-head, .attendance-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.attendance-head h2 { font-size: 21px; line-height: 1.25; }
.attendance-tools p, .attendance-summary { color: var(--muted); font-size: 14px; }
#attendance-all { min-height: 44px; padding: 8px 12px; color: var(--gold); border: 0; background: #f4d49114; }
#attendance-all:disabled { opacity: .6; cursor: default; filter: none; }
.attendance-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attendance-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: #080e1c63;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.attendance-option:has(input:checked) { background: #f4d49126; color: var(--txt); }
.attendance-option:hover:not(:has(input:disabled)) { filter: brightness(1.16); }
.attendance-option:has(input:disabled) { cursor: default; }
.attendance-option input { flex: none; width: 18px; height: 18px; accent-color: var(--gold); cursor: inherit; }
.attendance-name { min-width: 0; overflow-wrap: anywhere; }
.category-nav { display: none; }
.attendance-option:focus-within, #attendance-all:focus-visible, .category-nav-button:focus-visible, .spin-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.attendance-option input:focus-visible { outline: 0; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 2vw, 34px); }
.side {
  min-width: 0; position: relative; color: var(--txt);
}

.side-dark { --scene-art: url('../assets/scenes/horror-garden.webp?v=2'); }
.side-light { --scene-art: url('../assets/scenes/lakeside-camp.webp?v=3'); }

/* Das Rad liegt mittig auf der Fotokulisse. Die Motive liegen am Bildrand. */
.side-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.scene-stage {
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 28px #080e1c54;
}
.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: center / cover no-repeat;
}
.scene::before, .scene::after { content: ''; position: absolute; }
.scene-dark {
  background-color: #101c30;
  background-image: var(--scene-art);
}
.scene-dark::before {
  inset: 44% -29% -7%;
  background:
    radial-gradient(ellipse 31% 13% at 23% 36%, #c4d3d491, #a4bec851 42%, transparent 85%),
    radial-gradient(ellipse 33% 12% at 42% 48%, #d2dfe0a8, #a8becb40 48%, transparent 88%),
    radial-gradient(ellipse 30% 17% at 74% 55%, #c5d4d78c, #a5b8cb49 41%, transparent 90%),
    radial-gradient(ellipse 37% 15% at 49% 80%, #b5c5d377, #9fb2c53a 47%, transparent 90%);
  filter: blur(2px);
  opacity: .78;
  animation: garden-mist 9s ease-in-out infinite alternate;
}
.scene-dark::after {
  left: 16.5%;
  top: 52%;
  width: 19%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, #ffd28a80, #f3aa5445 25%, transparent 67%);
  mix-blend-mode: screen;
  opacity: .42;
  animation: window-glow 8s ease-in-out infinite;
}
.garden-ghost {
  position: absolute; z-index: 1; left: 11.5%; top: 61%;
  width: clamp(19px, 5.2cqi, 60px); aspect-ratio: .55;
  opacity: 0;
  filter: drop-shadow(0 0 5px #c5dfec72) blur(.55px);
  animation: garden-ghost-drift 24s .7s ease-in-out infinite;
}
.garden-ghost::before, .garden-ghost::after { content: ''; position: absolute; }
.garden-ghost::before {
  inset: 21% 0 0;
  background: radial-gradient(ellipse at 50% 15%, #e2f2ff, #a2bcd1 52%, #718fa9);
  clip-path: polygon(36% 0, 64% 0, 79% 17%, 86% 41%, 84% 61%, 96% 86%, 100% 100%, 70% 88%, 54% 99%, 39% 77%, 14% 94%, 22% 70%, 6% 73%, 15% 47%, 20% 20%);
  mask-image: linear-gradient(#000 12%, #000b 58%, transparent);
}
.garden-ghost::after {
  inset: 0 25% 58%;
  border-radius: 53% 52% 44% 44%;
  background: radial-gradient(ellipse 31% 38% at 53% 58%, #334158 24%, #4e657b 65%, transparent 100%),
    linear-gradient(145deg, #e7f5ff, #a4bed1 73%, #d7e9f5);
  mask-image: linear-gradient(#000 78%, transparent);
}
@keyframes garden-ghost-drift {
  0%, 4% { opacity: 0; transform: translate(0, .6cqi) rotate(-5deg); }
  11% { opacity: .74; transform: translate(3.8cqi, -1.1cqi) rotate(-2deg); }
  18% { opacity: .68; transform: translate(7.9cqi, -.6cqi) rotate(3deg); }
  25%, 100% { opacity: 0; transform: translate(12cqi, -2.3cqi) rotate(-2deg); }
}
/* Die Krallen stehen auf dem linken Torpfosten im Hintergrundfoto. */
.garden-raven {
  position: absolute; z-index: 1;
  left: 78.6%; top: 50.6%;
  width: clamp(21px, 5.1cqi, 78px); aspect-ratio: 1.24;
  translate: -46% -95%;
  transform-origin: 46% 95%;
  filter: drop-shadow(0 0 1px #9baec268);
  opacity: 0;
  --raven-cycle: 26s -5s linear infinite;
  animation: raven-flight var(--raven-cycle);
}
.garden-raven::before, .garden-raven::after, .raven-head::before, .raven-head::after {
  content: '';
  position: absolute;
}
.garden-raven::before {
  z-index: 1; inset: 0;
  background: linear-gradient(146deg, #1a2732, #0a111b 47%, #04070b 82%);
  clip-path: polygon(
    29% 24%, 42% 21%, 53% 30%, 65% 36%, 74% 49%, 78% 60%,
    99% 88%, 92% 88%, 95% 94%, 80% 86%, 65% 73%, 51% 71%,
    39% 66%, 30% 57%, 25% 44%, 24% 34%
  );
}
.garden-raven::after {
  inset: 64% 34% 3% 37%;
  background: #0d1117;
  clip-path: polygon(20% 0, 38% 1%, 33% 76%, 76% 82%, 84% 96%, 6% 94%, 12% 78%,
    25% 75%, 65% 0, 81% 2%, 70% 78%, 97% 93%, 93% 100%, 50% 91%);
}
.raven-head {
  position: absolute; z-index: 2; inset: 0 43% 52% 0;
  transform-origin: 77% 79%;
  animation: raven-head-tilt var(--raven-cycle);
}
.raven-head::before {
  inset: 0;
  background: linear-gradient(145deg, #192632, #070d15 60%);
  clip-path: polygon(0 61%, 7% 47%, 27% 41%, 41% 18%, 57% 8%, 77% 11%,
    92% 24%, 100% 42%, 100% 71%, 87% 97%, 62% 97%, 47% 82%, 36% 62%, 12% 64%, 2% 71%);
}
.raven-head::after {
  z-index: 1; left: 49%; top: 34%;
  width: clamp(2px, .38cqi, 5px); aspect-ratio: 1;
  border-radius: 50%;
  background: #ff343b;
  box-shadow: 0 0 4px #ff2739, 0 0 8px #ef152d99;
}
.raven-wings {
  position: absolute; inset: 0;
  transform-origin: 51% 39%;
  animation: raven-wing-fold var(--raven-cycle);
}
.raven-wings span {
  position: absolute; width: 82%; height: 97%; left: 46%; top: -46%;
  transform-origin: 4% 87%;
  background: linear-gradient(160deg, #1d2a35, #050a11 55%);
  clip-path: polygon(0 87%, 13% 63%, 29% 42%, 42% 17%, 62% 0, 59% 17%, 73% 5%,
    68% 26%, 88% 14%, 81% 35%, 98% 28%, 87% 49%, 100% 48%, 82% 66%, 63% 75%, 42% 90%, 10% 100%);
  animation: raven-wingbeat .37s ease-in-out infinite alternate;
}
.raven-wings span:first-child { left: 36%; top: -58%; opacity: .65; animation-delay: -.11s; }
@keyframes raven-flight {
  0%, 23% { opacity: 0; transform: translate(25cqi, -18cqi) rotate(-20deg); }
  26% { opacity: 1; transform: translate(17cqi, -12cqi) rotate(-16deg); }
  32% { transform: translate(4cqi, -4cqi) rotate(-10deg); }
  35% { transform: translate(.2cqi, -.6cqi) rotate(7deg); }
  37%, 50% { opacity: 1; transform: none; }
  52% { transform: translate(-1cqi, -1.4cqi) rotate(12deg); }
  57% { opacity: 1; transform: translate(-12cqi, -12cqi) rotate(18deg); }
  64%, 100% { opacity: 0; transform: translate(-33cqi, -23cqi) rotate(17deg); }
}
@keyframes raven-wing-fold {
  0%, 33% { opacity: 1; transform: none; }
  37%, 49% { opacity: 0; transform: scale(.22, .35); }
  52%, 100% { opacity: 1; transform: none; }
}
@keyframes raven-wingbeat {
  from { transform: rotate(-38deg) scaleY(1.06); }
  to { transform: rotate(68deg) scaleY(.78); }
}
@keyframes raven-head-tilt {
  0%, 38%, 49%, 100% { transform: none; }
  41% { transform: rotate(-11deg); }
  46% { transform: rotate(8deg); }
}
.garden-tracks, .garden-bats { position: absolute; z-index: 1; inset: 0; }
.garden-tracks span {
  position: absolute;
  left: var(--x); top: var(--y);
  width: clamp(8px, 1.8cqi, 26px); aspect-ratio: .61;
  transform: translate(-50%, -50%) rotate(var(--angle)) scale(var(--size));
  filter: drop-shadow(0 1px 1px #9aabc68c);
  opacity: 0;
  animation: garden-footstep 14s var(--delay) linear infinite;
}
.garden-tracks span::before, .garden-tracks span::after {
  content: ''; position: absolute;
  background: repeating-linear-gradient(0deg, #091321 0 22%, #3c495b 24% 29%, #101a28 31% 46%);
}
.garden-tracks span::before { inset: 0 0 35%; border-radius: 57% 50% 28% 26% / 35% 34% 16% 26%; }
.garden-tracks span::after { inset: 74% 14% 0; border-radius: 21% 24% 41% 50%; }
.garden-tracks span:nth-child(1) { --x: 36%; --y: 91%; --angle: -42deg; --size: 1; --delay: .2s; }
.garden-tracks span:nth-child(2) { --x: 33%; --y: 87%; --angle: -33deg; --size: .94; --delay: .72s; }
.garden-tracks span:nth-child(3) { --x: 28%; --y: 84%; --angle: -43deg; --size: .87; --delay: 1.24s; }
.garden-tracks span:nth-child(4) { --x: 25%; --y: 80%; --angle: -30deg; --size: .80; --delay: 1.76s; }
.garden-tracks span:nth-child(5) { --x: 21%; --y: 77%; --angle: -40deg; --size: .72; --delay: 2.28s; }
.garden-tracks span:nth-child(6) { --x: 18%; --y: 73%; --angle: -29deg; --size: .64; --delay: 2.8s; }
@keyframes garden-footstep {
  0% { opacity: 0; }
  1%, 28% { opacity: .94; }
  50%, 100% { opacity: 0; }
}
.garden-bats span {
  position: absolute;
  left: 97%; top: 23%;
  width: clamp(17px, 3.25cqi, 40px); aspect-ratio: 2.7;
  background: radial-gradient(ellipse 10% 48% at center, #080c16 90%, transparent);
  filter: drop-shadow(0 0 1px #a8bfd5bd);
  opacity: 0;
  animation: garden-bat-flight 18s -15.5s linear infinite;
  --flight-x: -16cqi;
  --flight-y: -4.5cqi;
  --flight-tilt: -12deg;
}
.garden-bats span:nth-child(2) { top: 27%; width: clamp(13px, 2.5cqi, 31px); animation-delay: -14.9s; }
.garden-bats span:nth-child(3) {
  left: 1%; top: 23%; width: clamp(14px, 2.8cqi, 34px); animation-delay: -15s;
  --flight-x: 15cqi; --flight-y: -5.5cqi; --flight-tilt: 12deg;
}
.garden-bats span::before, .garden-bats span::after {
  content: ''; position: absolute; top: 4%; width: 50%; height: 94%;
  background: #080c16;
  clip-path: polygon(0 25%, 32% 0, 64% 22%, 100% 52%, 93% 96%, 74% 66%, 52% 78%, 35% 52%, 18% 58%);
  animation: garden-bat-wings .31s ease-in-out infinite alternate;
}
.garden-bats span::before { left: 0; transform-origin: right 54%; }
.garden-bats span::after {
  right: 0; transform-origin: left 54%;
  clip-path: polygon(100% 25%, 68% 0, 36% 22%, 0 52%, 7% 96%, 26% 66%, 48% 78%, 65% 52%, 82% 58%);
}
@keyframes garden-bat-wings {
  from { transform: scaleY(.52) skewY(13deg); }
  to { transform: scaleY(1.2) skewY(-10deg); }
}
@keyframes garden-bat-flight {
  0%, 84% { opacity: 0; transform: none; }
  87% { opacity: .95; }
  90% { transform: translate(calc(var(--flight-x) * .38), calc(var(--flight-y) * .27)) rotate(var(--flight-tilt)); }
  94% { opacity: .95; transform: translate(calc(var(--flight-x) * .68), calc(var(--flight-y) * .74)); }
  98%, 100% { opacity: 0; transform: translate(var(--flight-x), var(--flight-y)) rotate(var(--flight-tilt)); }
}
.scene-light {
  background-color: #192338;
  background-image: var(--scene-art);
}
.scene-light::before {
  inset: 33% -12% 24%;
  background:
    radial-gradient(ellipse 18% 4% at 31% 30%, #fff0c975, transparent),
    radial-gradient(ellipse 23% 5% at 34% 42%, #ffcf8e55, transparent),
    radial-gradient(ellipse 20% 5% at 32% 53%, #ffe0b044, transparent);
  mix-blend-mode: screen;
  opacity: .52;
  animation: lake-shimmer 8s ease-in-out infinite alternate;
}
/* Flammen oberhalb des fotografierten Glutbetts. */
.scene-fire {
  position: absolute;
  left: 78%;
  top: 46%;
  width: 15%;
  height: 31%;
  pointer-events: none;
  object-fit: fill;
  mix-blend-mode: screen;
  mask-image: linear-gradient(#000 88%, transparent);
}
.camp-fireflies { position: absolute; z-index: 1; inset: 0; }
.camp-fireflies span {
  position: absolute; left: var(--x); top: var(--y);
  animation: firefly-drift var(--drift) var(--phase) ease-in-out infinite alternate;
}
.camp-fireflies span::after {
  content: ''; display: block;
  width: clamp(3px, .61cqi, 6px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fffce1 30%, #ffe680 70%);
  box-shadow: 0 0 6px 2px #ffd85cba, 0 0 13px 3px #ffb43e64;
  animation: firefly-glow var(--glow) var(--phase) ease-in-out infinite;
}
.camp-fireflies span:nth-child(1) { --x: 14%; --y: 69%; --dx: 4cqi; --dy: -2cqi; --drift: 5.8s; --glow: 5.2s; --phase: -1.9s; }
.camp-fireflies span:nth-child(2) { --x: 9%; --y: 78%; --dx: 5cqi; --dy: -3cqi; --drift: 8.6s; --glow: 6.7s; --phase: -4.7s; }
.camp-fireflies span:nth-child(3) { --x: 21%; --y: 84%; --dx: -5cqi; --dy: 3cqi; --drift: 6.2s; --glow: 5.9s; --phase: -3.8s; }
.camp-fireflies span:nth-child(4) { --x: 80%; --y: 82%; --dx: 4cqi; --dy: -2cqi; --drift: 7.3s; --glow: 4.8s; --phase: -.6s; }
.camp-fireflies span:nth-child(5) { --x: 87%; --y: 88%; --dx: -4cqi; --dy: 2.5cqi; --drift: 8.7s; --glow: 7.1s; --phase: -5.4s; }
@keyframes firefly-drift {
  0% { transform: none; }
  48% { transform: translate(calc(var(--dx) * .46), calc(var(--dy) * -.55)); }
  100% { transform: translate(var(--dx), var(--dy)); }
}
@keyframes firefly-glow {
  0%, 58%, 100% { opacity: .16; }
  20% { opacity: 1; }
  37% { opacity: .62; }
  76% { opacity: .83; }
}
.lake-birds { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.lake-birds span {
  position: absolute; left: 73%; top: 8%;
  width: clamp(11px, 1.95cqi, 23px); aspect-ratio: 2.7;
  opacity: 0;
  animation: lake-bird-flight 26s -17s linear infinite;
}
.lake-birds span:nth-child(2) { top: 10%; animation-delay: -16.45s; }
.lake-birds span:nth-child(3) { top: 7%; width: clamp(9px, 1.6cqi, 18px); animation-delay: -15.85s; }
.lake-birds span::before, .lake-birds span::after {
  content: ''; position: absolute; top: 9%; width: 51%; height: 90%;
  border-top: clamp(1.5px, .21cqi, 2.5px) solid #39252a;
  border-radius: 72% 80% 0 0;
  animation: lake-bird-wings .52s ease-in-out infinite alternate;
}
.lake-birds span::before { left: 0; transform-origin: right center; }
.lake-birds span::after { right: 0; transform-origin: left center; }
.lake-birds span:nth-child(2)::before, .lake-birds span:nth-child(2)::after { animation-delay: -.2s; }
@keyframes lake-bird-wings {
  from { transform: scaleY(.34); }
  to { transform: scaleY(1.28); }
}
@keyframes lake-bird-flight {
  0%, 67% { opacity: 0; transform: none; }
  70% { opacity: .94; }
  79% { transform: translate(-21cqi, -3.1cqi); }
  91% { opacity: .94; transform: translate(-41cqi, -.7cqi); }
  97%, 100% { opacity: 0; transform: translate(-48cqi, 4cqi) scale(.65); }
}
@keyframes garden-mist {
  from { opacity: .72; transform: translate3d(-13%, 7%, 0); }
  to { opacity: 1; transform: translate3d(16%, -5%, 0); }
}
@keyframes window-glow {
  0%, 100% { opacity: .34; }
  43% { opacity: .76; }
  61% { opacity: .48; }
  78% { opacity: .66; }
}
@keyframes lake-shimmer {
  from { opacity: .33; transform: translateX(-3%); }
  to { opacity: .74; transform: translateX(3%); }
}
.scene-stage::after {
  content: ''; position: absolute; inset: auto 0 0; height: 24%;
  background: linear-gradient(0deg, #07101acc, transparent);
  pointer-events: none;
}
.scene-caption {
  position: absolute; z-index: 2; inset: auto 0 0;
  display: flex; align-items: end; justify-content: space-between; gap: 8px;
  padding: 0 clamp(9px, 2.1cqi, 17px) clamp(7px, 1.9cqi, 15px);
  pointer-events: none;
  text-shadow: 0 1px 3px #050913, 0 2px 8px #050913;
}
.wheel-count {
  flex: none;
  margin-inline-start: auto;
  color: #eff4ff;
  font-size: clamp(11px, 2.25cqi, 14px);
  font-weight: 600;
  line-height: 1.2;
  text-align: end;
}
.side-dark .scene-title {
  font: 1rem/1.05 'Creepster', cursive;
  font-size: clamp(15px, 4.5cqi, 32px);
  letter-spacing: .045em; color: #ff768b;
}
.side-light .scene-title {
  font: 600 1rem/1.05 'Fredoka', sans-serif;
  font-size: clamp(14px, 3.9cqi, 28px);
  color: var(--gold);
}

html.draw-open { overflow: hidden; }
.side-top.scene-lifted::before { content: ''; aspect-ratio: 3 / 2; }
.draw-view {
  position: fixed; inset: 0; z-index: 70;
  overflow: hidden; isolation: isolate; touch-action: none;
  background: var(--night);
}
.draw-view > .scene-stage {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto; container-type: size;
  border-radius: 0; box-shadow: none;
}
/* Bild und Effekte auf derselben Fläche proportional skalieren und am Viewport abschneiden. */
.draw-view .scene {
  inset: auto; left: var(--scene-focus, 50%); top: 50%;
  width: max(100cqw, 150cqh); aspect-ratio: 3 / 2;
  transform: translate(calc(-1 * var(--scene-focus, 50%)), -50%);
  container-type: inline-size;
}
@media (max-aspect-ratio: 1/1) {
  .draw-view .scene-dark { --scene-focus: 13%; }
  .draw-view .scene-light { --scene-focus: 87%; }
}
.draw-view .wheel-wrap { width: min(62%, 74cqh); }
.draw-view .spin-btn:disabled { opacity: 1; }
.draw-view[inert] :is(.wheel-wrap, .draw-cancel, .scene-caption) { visibility: hidden; }
.draw-cancel {
  position: absolute; z-index: 2;
  top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  width: 44px; height: 44px; padding: 0;
  border: 1px solid #eff4ff55; border-radius: 50%;
  background: #080e1cbf; color: var(--txt);
  font: 28px/1 system-ui, sans-serif; cursor: pointer;
}
.draw-cancel:hover { background: var(--raised); }
.draw-cancel:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Rad */
.wheel-wrap { position: relative; z-index: 1; width: 43%; aspect-ratio: 1; }
.wheel {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 0 clamp(3px, 1.1cqi, 8px) var(--wheel-ring), 0 0 clamp(16px, 7cqi, 45px) var(--wheel-glow);
}
.side-dark .wheel { --wheel-ring: #131928; --wheel-glow: rgba(179,18,43,.45); }
.side-light .wheel { --wheel-ring: #182236; --wheel-glow: rgba(255,140,80,.4); }
.wheel-blood { position: absolute; inset: 0; pointer-events: none; }
.wheel-blood::before {
  content: ''; position: absolute; inset: -1.3%; border-radius: 50%;
  border: clamp(2px, .72cqi, 5px) solid transparent;
  border-bottom-color: #90142a; border-left-color: #571024;
  transform: rotate(-15deg);
}
.wheel-blood span {
  position: absolute; left: var(--x); top: var(--start); height: var(--length);
  width: clamp(2px, .7cqi, 5px); border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #511023, #b11635 70%, #781628);
}
.wheel-blood span:nth-child(1) { --x: 24%; --start: 92%; --length: 10%; --delay: -1.4s; }
.wheel-blood span:nth-child(2) { --x: 47%; --start: 100%; --length: 9%; --delay: -3.1s; }
.wheel-blood span:nth-child(3) { --x: 67%; --start: 97%; --length: 7%; --delay: -.6s; }
.wheel-blood span::after {
  content: ''; position: absolute; left: -18%; top: 92%;
  width: 136%; aspect-ratio: .78; border-radius: 70% 70% 58% 58%;
  background: radial-gradient(circle at 68% 66%, #c12442, #811229 60%, #501321);
  animation: wheel-blood-drop 3.6s var(--delay) ease-in infinite;
}
@keyframes wheel-blood-drop {
  0%, 35% { opacity: 0; transform: scale(.6); }
  49% { opacity: 1; transform: scale(1, 1.15); }
  72% { opacity: .9; transform: translateY(clamp(5px, 1.8cqi, 11px)) scale(.88, 1.15); }
  100% { opacity: 0; transform: translateY(clamp(12px, 4cqi, 24px)) scale(.68, 1.18); }
}
.pointer {
  position: absolute; top: clamp(-8px, -1.5cqi, -4px); left: 50%; transform: translateX(-50%);
  z-index: 4; width: 0; height: 0;
  border-inline: clamp(7px, 2.4cqi, 13px) solid transparent;
  border-top: clamp(12px, 4cqi, 22px) solid #fff;
}
.side-dark  .pointer { border-top-color: #e0143c; filter: drop-shadow(0 0 7px rgba(224,20,60,.95)); }
.side-light .pointer { border-top-color: #ffb24d; filter: drop-shadow(0 0 8px rgba(255,170,70,.85)); }
.spin-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: clamp(50px, 37%, 96px);
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  border: clamp(2px, .6cqi, 4px) solid rgba(255,255,255,.85);
  font-weight: 900;
  font-size: clamp(10px, 3cqi, 16px);
  letter-spacing: .035em;
  cursor: pointer;
  z-index: 3; color: #fff;
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: transform .12s ease, filter .15s ease;
}
.spin-btn:hover:not(:disabled) { transform: translate(-50%,-50%) scale(1.06); }
.spin-btn:disabled { opacity: .55; cursor: not-allowed; }
.spin-dark  { background: radial-gradient(circle at 35% 30%, #d01d49, #7a0a1c); }
.spin-light { background: radial-gradient(circle at 35% 30%, var(--gold), #c7843e); color: #211608; }
.wheel-status {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Filme hinzufügen */
.add-movie { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.movie-quota { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.add-movie input:disabled, .add-movie button:disabled { cursor: not-allowed; opacity: .65; }
.add-movie .mv-title { flex: 1; min-width: 160px; }
.add-movie .mv-note  { flex: 1; min-width: 120px; }

/* Filmliste */
.movie-list { display: flex; flex-direction: column; }
.movie-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #0d1829ad;
}
.movie-card + .movie-card { box-shadow: inset 0 1px #c0d7ff14; }
.movie-card:first-child { border-radius: 12px 12px 0 0; }
.movie-card:last-child { border-radius: 0 0 12px 12px; }
.movie-card:only-child { border-radius: 12px; }
.movie-card:hover { background: #20334be8; }
.movie-card .mc-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; flex: none; }
.movie-card .mc-main { flex: 1; min-width: 0; }
.movie-card .mc-title { font-weight: 800; }
.movie-card .mc-sub { font-size: 12px; opacity: .7; }
.movie-card .mc-actions { display: flex; gap: 4px; }
.movie-card .mc-actions button {
  background: transparent; border: 0;
  border-radius: 8px; padding: 5px 8px; cursor: pointer; color: var(--muted);
  filter: grayscale(1);
}
.movie-card .mc-actions button:hover { background: var(--raised); color: var(--txt); }
.empty-hint { opacity: .6; font-size: 14px; padding: 8px 2px; }

/* ====================================================================
   GESEHENE FILME
   ==================================================================== */
.panel-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { color: var(--gold); font-size: 26px; }
.seen-controls { margin-left: auto; }
.seen-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.col-dark  { color: #ff5470; margin-bottom: 10px; }
.col-light { color: var(--gold); margin-bottom: 10px; }
.seen-list { display: flex; flex-direction: column; gap: 12px; }
.seen-card {
  display: grid; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.sc-summary { display: flex; align-items: flex-start; gap: 12px; }
.sc-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.sc-title { flex: 1 1 150px; min-width: 0; font-weight: 900; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.sc-tools { display: flex; align-items: center; gap: 8px; }
.sc-avg { font-size: 14px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.sc-avg-empty { font-size: 12px; font-weight: 600; color: var(--muted); }
.sc-meta { font-size: 12px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }

/* Eigene Wertung und Stimmen aus der Runde. */
.stars { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 24px; align-items: center; }
.star {
  display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 5px; background: transparent;
  color: #8294aa; font: inherit; font-size: 20px; line-height: 1;
}
.star.on { color: var(--gold); }
button.star { min-height: 32px; cursor: pointer; }
button.star:hover { background: #25374d; }
.stars.readonly .star { font-size: 15px; color: #61748a; }
.stars.readonly .star.on { color: var(--gold); }

.rate-row { display: grid; gap: 6px; padding: 8px 10px 10px; background: #0b1829b0; border-radius: 9px; }
.rate-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 8px; }
.rr-label { font-size: 13px; font-weight: 800; color: var(--txt); }
.rate-comment {
  width: 100%; min-width: 0; min-height: 34px; max-height: 140px;
  field-sizing: content; resize: vertical; padding: 7px 9px;
  color: var(--txt); background: #0c1728; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; font-size: 13px; line-height: 1.4;
}
.rate-comment::placeholder { color: var(--muted); }
.rate-comment:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.rating-others { display: grid; gap: 9px; padding: 0 10px; list-style: none; }
.ro {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center; gap: 4px 8px; font-size: 13px;
}
.ro-av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; }
.ro-name { font-weight: 800; overflow-wrap: anywhere; }
.ro-comment { grid-column: 2 / -1; color: var(--muted); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 400px) {
  .seen-card { padding: 10px; }
  .sc-summary { gap: 10px; }
  .sc-summary .sc-poster { width: 52px; height: 78px; }
}

/* ====================================================================
   BESTENLISTEN
   ==================================================================== */
.tops-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.top-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.top-card .tc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.top-card .tc-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.top-card .tc-name { font-weight: 900; font-size: 18px; }
.top-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.top-row:last-child { border-bottom: none; }
.top-row .tr-rank { width: 22px; text-align: center; font-weight: 900; color: var(--muted); }
.top-row .tr-title { flex: 1; min-width: 0; }
.top-row .tr-cat { font-size: 12px; }
.top-row .tr-avg { font-weight: 800; color: var(--gold); white-space: nowrap; }

/* ====================================================================
   GEWINNER-OVERLAY
   ==================================================================== */
.result {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: safe center; padding: 24px;
  overflow: auto; overscroll-behavior: contain;
}
.result.theme-dark  { background: radial-gradient(900px 700px at 50% 30%, #2c1728, var(--night) 73%); }
.result.theme-light { background: radial-gradient(900px 700px at 50% 28%, #31302a, var(--night) 73%); }
.draw-view:not(.hidden) + .result {
  background: radial-gradient(ellipse at center, #080e1ce0 10%, #080e1c49 82%);
}
.result-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.result-inner { position: relative; text-align: center; z-index: 2; width: min(100%, 900px); }
.result-kicker { font-size: clamp(12px, 2.5vw, 17px); letter-spacing: 3px; text-transform: uppercase; opacity: .85; margin-bottom: 10px; }
.result-title {
  font-size: clamp(23px, 4.2vw, 48px); line-height: 1.12; font-weight: 900;
  text-wrap: balance; overflow-wrap: anywhere;
  animation: pop .5s cubic-bezier(.2,1.4,.3,1) both;
}
.result.theme-dark  .result-kicker { color: #ff869a; }
.result.theme-dark  .result-title  { font-family: 'Creepster', cursive; color: #ff2d55; text-shadow: 0 0 30px rgba(179,18,43,.8), 0 3px 0 #3a0410; letter-spacing: .045em; }
.result.theme-light .result-kicker { color: #ffb27a; }
.result.theme-light .result-title  { font-family: 'Fredoka', sans-serif; color: #ff9e5e; text-shadow: 0 0 30px rgba(255,140,80,.7), 0 4px 0 #3a1c10; }
.result-by { margin-top: 8px; font-size: clamp(14px, 2.8vw, 17px); font-weight: 700; opacity: .9; }
.result.theme-light .result-by { color: #e9c8a8; }
.result-actions { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.result-actions button:disabled { cursor: not-allowed; opacity: .55; filter: none; }
@keyframes pop { from { transform: scale(.3) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ====================================================================
   MODAL + TOAST
   ==================================================================== */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: 20px; }
.modal-card { width: min(440px, 96vw); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.modal-card h3 { margin-bottom: 14px; }
.modal-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.modal-card label input { width: 100%; margin-top: 5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--raised); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 20px; border-radius: 12px; z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); font-weight: 700;
  animation: toastIn .25s ease;
}
.toast.err { background: #3a0f18; border-color: var(--dark-acc); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ====================================================================
   POSTER + TMDb-VORSCHLÄGE
   ==================================================================== */
.suggest-wrap { position: relative; flex: 1; min-width: 160px; }
.suggest-wrap .mv-title { width: 100%; }
.suggest-box {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  max-height: 330px; overflow-y: auto; display: none;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.suggest-box.open { display: block; }
.suggest-item { display: flex; gap: 10px; padding: 8px 10px; cursor: pointer; align-items: center; }
.suggest-item + .suggest-item { border-top: 1px solid var(--line); }
.suggest-item:hover, .suggest-item.active { background: var(--raised); }
.suggest-item img { width: 34px; height: 51px; object-fit: cover; border-radius: 5px; background: var(--night); flex: none; }
.suggest-item .si-noimg { width: 34px; height: 51px; border-radius: 5px; background: var(--night); display: grid; place-items: center; color: #91a5bd; flex: none; }
.suggest-item .si-main { min-width: 0; color: var(--txt); }
.suggest-item .si-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .si-year { font-size: 12px; color: var(--muted); }
.suggest-hint { padding: 8px 10px; font-size: 12px; color: var(--muted); }

/* Poster in Filmkarten */
.mc-poster { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; flex: none; background: var(--night); }
.mc-poster.empty { display: grid; place-items: center; font-size: 20px; color: #91a5bd; }
.side-light .mc-poster.empty { background: var(--night); color: #91a5bd; }

/* Großes Poster im Gewinner-Fenster */
.result-poster {
  max-height: min(54vh, 580px);
  max-height: min(54dvh, 580px);
  max-width: 100%; width: auto; height: auto; object-fit: contain;
  display: block; margin: 4px auto 12px;
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.6);
}

/* Poster in der Gesehen-Liste */
.sc-poster { width: 64px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; background: var(--night); }
.sc-poster.empty { display: grid; place-items: center; font-size: 26px; color: #91a5bd; }
.sc-body { flex: 1; min-width: 0; }

/* Poster in den Bestenlisten */
.tr-poster { width: 28px; height: 42px; object-fit: cover; border-radius: 4px; flex: none; background: var(--night); }
.tr-poster.empty { display: grid; place-items: center; font-size: 14px; color: #91a5bd; }

.tmdb-credit { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* Eigene Filme oben hervorheben */
.movie-card.mc-mine {
  position: relative;
  background: color-mix(in srgb, var(--accent) 15%, #0d1829e8);
}
.movie-card.mc-mine::before {
  content: ''; position: absolute; inset-block: 8px; inset-inline-start: 0;
  width: 3px; border-radius: 999px; background: var(--accent); pointer-events: none;
}
.movie-card.mc-mine:hover { background: color-mix(in srgb, var(--accent) 20%, var(--raised)); }
.mc-you {
  display: inline-block; background: color-mix(in srgb, var(--accent) 32%, var(--raised));
  color: #fff; font-size: 11px; font-weight: 800; padding: 1px 7px;
  border-radius: 999px; margin-right: 5px; vertical-align: middle;
}

/* Hover-Vorschau: großes Poster + Streaming-Anbieter */
.hover-card {
  position: fixed; z-index: 95; width: auto; max-width: 94vw; display: flex; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.6);
  max-height: calc(100vh - 20px); overflow-y: auto;
}
.hover-card .hc-poster { width: 240px; height: 360px; object-fit: cover; border-radius: 10px; flex: none; background: var(--night); }
.hover-card .hc-poster.empty { display: grid; place-items: center; font-size: 52px; color: #91a5bd; }
.hover-card .hc-body { width: 190px; flex: none; }
.hover-card .hc-title { font-weight: 800; margin-bottom: 8px; line-height: 1.2; }
.hover-card .hc-year { color: var(--muted); font-weight: 600; }
.hover-card .hc-prov { font-size: 12px; color: var(--muted); }
.hc-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.hc-label { font-size: 11px; color: var(--muted); margin-right: 2px; }
.hc-chip { background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: 11px; color: var(--txt); text-decoration: none; cursor: pointer; transition: border-color .12s, background .12s; }
.hc-chip:hover { background: #29425d; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.hc-links { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.hc-link { display: inline-block; color: var(--gold); font-size: 12px; text-decoration: none; font-weight: 700; }
.hc-link:hover { text-decoration: underline; }

/* Streaming-Buttons (nur Netflix / Amazon Prime / Disney+ / YouTube) */
.stream-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; justify-content: center; }
.stream-btn { text-decoration: none; font-size: 12px; font-weight: 800; color: #fff; padding: 5px 12px; border-radius: 999px; }
.stream-btn.s-netflix { background: #e50914; }
.stream-btn.s-amazon  { background: #00a8e1; color: #042a3d; }
.stream-btn.s-disney  { background: #1a48e0; }
.stream-btn.s-youtube { background: #ff0000; }
.stream-btn:hover { filter: brightness(1.12); }

/* Streaming im Gewinner-Fenster */
.result-streaming { position: relative; z-index: 2; margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.result-streaming .rs-label { font-size: 13px; opacity: .85; }

/* Gesehen: Aktionen (entfernen / zurück) */
.sc-actions { display: inline-flex; gap: 4px; }
.sc-actions button { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; cursor: pointer; font-size: 12px; }
.sc-actions button:hover { border-color: var(--dark-acc); }

/* Merkliste */
.note-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.note-cat { display: inline-flex; gap: 4px; }
.ncat { background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 9px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.ncat.active { color: var(--gold); background: var(--gold-surface); border-color: var(--gold-line); }
.note-add .suggest-wrap { flex: 1; min-width: 180px; }
.note-add #note-title, .note-add #note-note { width: 100%; }
.note-add #note-note { flex: 1; min-width: 140px; }
.note-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.note-filter label { color: var(--muted); font-weight: 700; }
.note-filter select { min-width: min(13rem, 100%); max-width: 100%; min-height: 44px; }
.notes-list { display: flex; flex-direction: column; }
.notes-list .mc-main { overflow-wrap: anywhere; }
.note-cat-tag { font-size: 13px; }

/* Benachrichtigungen */
#notif-btn { position: relative; }
.notif-badge { position: absolute; top: -3px; right: -3px; background: var(--dark-acc); color: #fff; font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.notif-panel { position: absolute; top: calc(100% + 8px); right: 20px; width: min(290px, calc(100% - 40px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.55); z-index: 60; overflow: hidden; }
.np-head { padding: 10px 12px; font-weight: 800; border-bottom: 1px solid var(--line); }
.np-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.np-row:last-child { border-bottom: none; }
.np-item { flex: 1; display: block; text-align: left; background: transparent; border: none; color: var(--txt); padding: 10px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.np-item:hover { background: var(--raised); }
.np-dismiss { flex: none; background: transparent; border: none; border-left: 1px solid var(--line); color: #5fe0a0; font-size: 15px; font-weight: 800; padding: 0 12px; cursor: pointer; }
.np-dismiss:hover { background: var(--raised); }
.np-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* Verfügbarkeits-Tag in den Tippvorschlägen */
.suggest-item .si-main { flex: 1; min-width: 0; }
.si-avail { flex: none; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.si-avail.loading { color: var(--muted); }
.si-avail.ok   { background: rgba(46,196,120,.18); color: #5fe0a0; }
.si-avail.rent { background: rgba(255,180,60,.16); color: #ffc46b; }
.si-avail.no   { background: rgba(150,140,170,.14); color: #9b93ac; }

/* Empfehlungen */
.recs-list { display: flex; flex-direction: column; gap: 12px; }
.rec-card { display: flex; gap: 12px; background: #142338d9; border-radius: 12px; padding: 12px; }
.rec-poster { width: 70px; height: 105px; object-fit: cover; border-radius: 8px; flex: none; background: var(--night); }
.rec-poster.empty { display: grid; place-items: center; font-size: 26px; color: #91a5bd; }
.rec-body { flex: 1; min-width: 0; }
.rec-title { font-weight: 800; margin-bottom: 4px; }
.rec-ov { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.rec-actions { display: flex; flex-direction: column; gap: 6px; }
.rec-actions button {
  width: 42px; height: 42px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--txt); font-size: 20px; cursor: pointer;
}
.rec-actions button:hover:not(:disabled) { border-color: var(--gold-line); }
.rec-actions button:disabled { opacity: .55; cursor: default; }

/* ====================================================================
   RESPONSIV
   ==================================================================== */
@media (min-width: 1100px) {
  .winter-backdrop {
    --winter-image-width: max(105vw, 150dvh);
    --winter-image-left: min(calc(.82 * (100vw - var(--winter-image-width))),
      calc(100vw - .94 * var(--winter-image-width)));
  }
  .tab-panel { width: calc(100% - clamp(188px, 20vw, 400px)); }
}

@media (max-width: 1000px) {
  .topbar { padding: 6px 10px; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 15px; }
  .tabs { order: 3; width: 100%; justify-content: center; gap: 4px; margin: 2px auto 0; }
  .tab { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
  .icon-btn { width: 34px; height: 36px; }
  .topbar-right { margin-inline-start: auto; }
  .notif-panel { right: 10px; width: min(290px, calc(100% - 20px)); }
  .profile-chip { padding: 3px 10px 3px 4px; font-size: 13px; }
  .profile-chip .chip-av { width: 24px; height: 24px; font-size: 14px; }
}

@media (max-width: 880px) {
  .tab-panel { padding: 12px; }
  .winter-backdrop {
    --winter-image-left: min(0px, calc(100vw - var(--winter-image-width) + clamp(52px, 11.75dvh, 132px)));
  }

  .topbar { justify-content: space-between; }
  #mobile-nav-toggle { display: inline-grid; width: 44px; height: 44px; }
  .topbar-menu {
    display: none; position: absolute; top: 100%; inset-inline: 8px; z-index: 1;
    max-height: calc(100dvh - 64px); overflow-y: auto;
    padding: 8px; background: var(--bar); border-radius: 0 0 14px 14px;
    box-shadow: 0 16px 32px #080e1c88;
  }
  #mobile-nav-toggle[aria-expanded="true"] + .topbar-menu { display: grid; gap: 6px; }
  .topbar-menu .tabs { display: grid; order: 0; margin: 0; }
  .topbar-menu .tab { min-height: 44px; text-align: left; padding-inline: 12px; }
  .topbar-right { flex-wrap: wrap; gap: 6px; padding-top: 6px; margin: 0; border-top: 1px solid var(--line); }
  .notif-wrap { display: contents; }
  .notif-panel { position: static; order: 1; width: 100%; }

  .attendance { padding: 8px 12px; margin-bottom: 12px; }
  .attendance-head { position: relative; display: grid; gap: 2px; min-height: 44px; padding-inline-end: 32px; }
  .attendance-head h2 { font-size: 17px; }
  .attendance-summary { font-size: 13px; }
  #attendance-toggle {
    display: flex; align-items: center; justify-content: flex-end;
    position: absolute; inset: 0; width: 100%; padding-inline-end: 6px;
    border: 0; border-radius: 8px; background: transparent; color: var(--gold); cursor: pointer;
  }
  #attendance-toggle span {
    width: 9px; height: 9px; border-right: 2px solid; border-bottom: 2px solid;
    transform: translateY(-2px) rotate(45deg);
  }
  #attendance-toggle[aria-expanded="true"] span { transform: translateY(2px) rotate(225deg); }
  .attendance:has(#attendance-toggle[aria-expanded="false"]) #attendance-details { display: none; }
  .attendance-tools { padding-top: 8px; }
  .category-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .category-nav-button {
    min-height: 44px;
    border: 1px solid var(--control-line);
    border-radius: 11px;
    padding: 7px 8px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
  }
  .category-nav-button[aria-pressed="true"] { border-color: var(--gold-line); background: var(--gold-surface); color: var(--txt); }

  /* Räder bleiben zusätzlich horizontal wischbar. */
  .split {
    display: flex; overflow-x: auto; overflow-y: visible; gap: 0;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    border-radius: 16px;
  }
  .side {
    flex: 0 0 100%; min-width: 100%;
    padding-inline: 2px;
    scroll-snap-align: start; scroll-snap-stop: always;
  }
  .seen-cols { grid-template-columns: 1fr; }
  .hover-card { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spin-btn, #attendance-all { transition: none; }
  .result-title { animation: none; }
  .garden-ghost, .garden-raven, .garden-tracks, .garden-bats, .camp-fireflies, .lake-birds { display: none; }
  .scene::before, .scene::after, .winter-backdrop::before, .winter-backdrop::after { animation: none; }
  .wheel-blood span::after { animation: none; }
}
