/* Filmabend – warmes Kino-Dunkel. Farben zentral hier anpassen. */
:root {
  --bg: #140b09;
  --bg-2: #1d100c;
  --card: #261612;
  --card-hi: #311c16;
  --line: rgba(255, 214, 170, 0.12);
  --text: #f7e9da;
  --muted: #c9a98f;
  --faint: #8f7362;
  --amber: #f4a940;
  --amber-soft: rgba(244, 169, 64, 0.16);
  --red: #a8322d;
  --red-deep: #6e1c1a;
  --ok: #8fc79a;
  --radius: 20px;
  --radius-sm: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .25, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* warmer Lichtschein wie von einer Leinwand */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(244, 169, 64, .20), transparent 60%),
    radial-gradient(90% 50% at 100% 110%, rgba(168, 50, 45, .22), transparent 60%),
    radial-gradient(70% 40% at 0% 100%, rgba(110, 28, 26, .25), transparent 60%);
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--amber); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.topbar[hidden] { display: none; }
.back {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .15s var(--ease), background .2s;
}
.back:active { transform: scale(.92); background: var(--card-hi); }
.progress { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.progress-bar { height: 6px; border-radius: 99px; background: var(--card-hi); overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--red), var(--amber));
  border-radius: inherit; transition: width .5s var(--ease);
}
.progress-label { font-size: 13px; color: var(--muted); letter-spacing: .02em; }

/* ---------- Grundlayout ---------- */
main {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: 8px 16px calc(120px + env(safe-area-inset-bottom));
  overflow-x: clip;
}
.loading { font-size: 48px; text-align: center; padding-top: 40vh; animation: pulse 1.4s ease-in-out infinite; }
.screen { animation: enter .45s var(--ease) both; }
.screen.back-anim { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .7; } }

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 8.5vw, 40px); }
h2 { font-size: clamp(26px, 7vw, 32px); }
.lead { color: var(--muted); margin: 10px 0 22px; }
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 10px;
}

/* ---------- Begrüssung ---------- */
.welcome { min-height: calc(100dvh - 160px); display: flex; flex-direction: column; justify-content: center; padding-top: 40px; }
.marquee {
  display: flex; gap: 10px; justify-content: center; margin-bottom: 28px;
}
.marquee i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 12px var(--amber); animation: blink 2.4s infinite ease-in-out;
}
.marquee i:nth-child(2n) { animation-delay: .6s; }
.marquee i:nth-child(3n) { animation-delay: 1.2s; }
@keyframes blink { 50% { opacity: .25; box-shadow: none; } }
.welcome .big-emoji { font-size: 76px; text-align: center; line-height: 1; margin-bottom: 18px; animation: rise .8s var(--ease) both; }
.welcome h1 { text-align: center; animation: rise .8s .1s var(--ease) both; }
.welcome .lead { text-align: center; font-size: 18px; animation: rise .8s .2s var(--ease) both; }
.ticket {
  margin: 8px auto 0; padding: 14px 18px; max-width: 320px; text-align: center;
  border: 1.5px dashed rgba(244, 169, 64, .4); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px; animation: rise .8s .3s var(--ease) both;
}
.ticket strong { color: var(--text); display: block; font-family: var(--serif); font-size: 18px; }

/* Bett-Szene hinter der Begrüssung */
.welcome { position: relative; z-index: 1; justify-content: flex-start; padding-top: 6vh; }
.welcome h1, .welcome .lead { text-shadow: 0 2px 18px rgba(20, 11, 9, .9); }
.bedroom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 0; pointer-events: none;
  height: min(46vh, 420px);
  -webkit-mask-image: linear-gradient(transparent, #000 30%);
  mask-image: linear-gradient(transparent, #000 30%);
  animation: fadein 1.2s .2s var(--ease) both;
}
.bedroom svg { width: 100%; height: 100%; display: block; }
.bedroom .bulb { animation: bulb 3s ease-in-out infinite; }
@keyframes bulb { 50% { opacity: .45; } }
@keyframes fadein { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.ticket { background: rgba(20, 11, 9, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* ---------- Kategorie-Karten ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat {
  position: relative; min-height: 148px; padding: 18px 14px 16px;
  display: flex; flex-direction: column; justify-content: flex-end; text-align: left;
  background: linear-gradient(160deg, var(--card-hi), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .18s var(--ease), border-color .2s, box-shadow .2s;
  animation: rise .5s var(--ease) both;
}
.cat:active { transform: scale(.96); }
.cat .emoji { font-size: 40px; line-height: 1; margin-bottom: auto; }
.cat .name { font-family: var(--serif); font-size: 21px; font-weight: 600; margin-top: 14px; }
.cat .tagline { font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.cat[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 8px 30px rgba(244, 169, 64, .18); }

/* ---------- Film-Karten ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.movie {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  transition: transform .18s var(--ease), border-color .2s, background .2s, box-shadow .25s;
  animation: rise .5s var(--ease) both;
}
.movie:active { transform: scale(.985); }
.movie[aria-checked="true"] {
  border-color: var(--amber); background: linear-gradient(160deg, #3a2118, var(--card));
  box-shadow: 0 0 0 1px var(--amber), 0 10px 34px rgba(244, 169, 64, .16);
}
.movie .head { display: flex; gap: 12px; align-items: flex-start; }
.movie .title { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; flex: 1; }
.radio {
  flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--faint); display: grid; place-items: center; transition: all .2s;
}
.movie[aria-checked="true"] .radio { border-color: var(--amber); background: var(--amber); }
.movie[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); }
.meta { font-size: 14px; color: var(--muted); margin: 6px 0 10px; }
.meta .dot { margin: 0 6px; opacity: .6; }
.desc { margin: 0 0 12px; font-size: 15.5px; line-height: 1.5; color: #ead6c4; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--amber-soft); color: #ffd39a; }
.tag.lang { background: rgba(255, 255, 255, .06); color: var(--muted); }
.netflix {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  font-size: 14px; font-weight: 600; color: var(--amber); text-decoration: none;
}
.netflix:active { opacity: .7; }

/* ---------- Snacks ---------- */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px;
  border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line);
  text-align: left; font-size: 15.5px; line-height: 1.25;
  transition: transform .15s var(--ease), border-color .2s, background .2s;
  animation: rise .45s var(--ease) both;
}
.chip:active { transform: scale(.95); }
.chip .emoji { font-size: 26px; flex: none; transition: transform .3s var(--ease); }
.chip[aria-pressed="true"] { border-color: var(--amber); background: #3a2118; }
.chip[aria-pressed="true"] .emoji { transform: scale(1.18) rotate(-6deg); }
.section-title { font-family: var(--serif); font-size: 22px; margin: 30px 0 12px; }
.section-title small { font-family: var(--sans); font-size: 14px; color: var(--faint); font-weight: 400; }
.field { margin-top: 26px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.field textarea {
  width: 100%; min-height: 92px; resize: vertical; padding: 14px;
  border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line);
  font-size: 16px; line-height: 1.4;
}
.field textarea:focus { outline: none; border-color: var(--amber); }
.counter { text-align: right; font-size: 12.5px; color: var(--faint); margin-top: 4px; }

/* ---------- Zusammenfassung ---------- */
.summary { display: flex; flex-direction: column; gap: 12px; }
.sum-card {
  padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  animation: rise .5s var(--ease) both;
}
.sum-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--amber); }
.sum-card .value { font-family: var(--serif); font-size: 21px; margin-top: 4px; line-height: 1.25; }
.sum-card .sub { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.sum-card .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.edit {
  flex: none; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 99px;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { padding: 6px 12px; border-radius: 99px; background: var(--card-hi); font-size: 14.5px; }
.error {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(168, 50, 45, .2); border: 1px solid rgba(168, 50, 45, .5); font-size: 15px;
}

/* ---------- Danke ---------- */
.thanks { min-height: calc(100dvh - 120px); display: flex; flex-direction: column; justify-content: center; text-align: center; padding-top: 30px; }
.thanks .big-emoji { font-size: 84px; animation: rise .8s var(--ease) both, heartbeat 2.4s 1s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.08); } 48% { transform: scale(1); } }
.thanks h1 { margin-top: 18px; }
.thanks .lead { font-size: 18px; }
.thanks .recap { margin: 8px auto 24px; max-width: 340px; color: var(--muted); font-size: 15px; }
.link-btn { background: none; border: none; color: var(--faint); text-decoration: underline; min-height: 44px; font-size: 14.5px; }
.hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.hearts span { position: absolute; bottom: -40px; font-size: 22px; opacity: 0; animation: float 7s linear infinite; }
@keyframes float { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .8; } 100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

/* ---------- Haupt-Button (unten fixiert) ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 40%);
  display: flex; justify-content: center;
}
.btn {
  width: 100%; max-width: 528px; min-height: 56px; padding: 0 24px;
  border: none; border-radius: 99px; font-size: 17.5px; font-weight: 700; letter-spacing: .01em;
  color: #2a1206; background: linear-gradient(135deg, #ffc56b, var(--amber) 55%, #e48a2a);
  box-shadow: 0 10px 30px rgba(244, 169, 64, .28), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .15s var(--ease), opacity .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { background: var(--card-hi); color: var(--faint); box-shadow: none; cursor: default; }
.btn.inline { margin-top: 26px; }

.noscript { padding: 24px; text-align: center; }

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .chips { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hearts { display: none; }
}

/* ---------- Admin ---------- */
.admin main { max-width: 640px; }
.admin .card { padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); margin-bottom: 14px; }
.admin .muted { color: var(--muted); font-size: 14.5px; }
.check {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 17px;
}
.check:last-child { border-bottom: none; }
.check input { width: 24px; height: 24px; accent-color: var(--amber); flex: none; }
.check span, .hist-item, .sum-card .sub, .pill { overflow-wrap: anywhere; min-width: 0; }
.admin main { padding-top: calc(24px + env(safe-area-inset-top)); }
.check.done span { text-decoration: line-through; color: var(--faint); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.btn-ghost {
  min-height: 48px; padding: 0 18px; border-radius: 99px; background: var(--card);
  border: 1px solid var(--line); font-weight: 600;
}
.btn-danger { border-color: rgba(168, 50, 45, .6); color: #ffb4a8; }
details.history summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.hist-item { padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.empty { text-align: center; padding: 60px 10px; color: var(--muted); }
.empty .big-emoji { font-size: 56px; margin-bottom: 10px; }
