/* Geschenke-Swiper · smartphoto
   Marke von smartphoto.ch (Stylesheet 24.09.2026): Roboto, Blau #009fdc, Text #3e4551, Fläche #f4f4f4.
   Roboto bewusst trotz impeccable-Verbot: der Swiper soll auf smartphoto-Boden wie smartphoto wirken. */

:root {
  --blue: #009fdc;          /* smartphoto-Blau: Herz, Auswahl, Akzente */
  --blue-strong: #00709c;   /* für weisse Schrift und Text auf Weiss, Kontrast >= 4.5 */
  --blue-soft: #e3f3fb;
  --ink: #0c1725;
  --text: #3e4551;
  --muted: #5f6672;
  --line: #dde2e7;
  --bg: #f3f5f7;
  --surface: #fdfeff;
  --nope: #d9434b;
  --star: #f0c651;

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --r-sm: 8px;
  --r-md: 16px;
  --r-full: 999px;

  --shadow-card: 0 1px 2px rgb(12 23 37 / .06), 0 8px 24px -8px rgb(12 23 37 / .18);
  --shadow-float: 0 2px 6px rgb(12 23 37 / .08), 0 12px 28px -10px rgb(12 23 37 / .22);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --col: min(100vw, 440px);
  --body-h: 104px;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); overscroll-behavior: none; }
button, a, .chip, summary { touch-action: manipulation; }
button { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.i { width: 24px; height: 24px; flex: none; }
.i-sm { width: 18px; height: 18px; }

/* ---------- Gerüst ---------- */

.app {
  width: var(--col);
  margin: 0 auto;
  height: 100dvh;
  position: relative;
}

.view {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-md);
  padding-bottom: env(safe-area-inset-bottom);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 60px;
  padding-top: env(safe-area-inset-top);
  flex: none;
}

.logo { height: 24px; width: auto; }

.fav-btn {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  height: 44px; padding: 0 var(--space-sm);
  border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--ink);
  cursor: pointer;
  font-weight: 500; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.fav-btn:hover { background: rgb(12 23 37 / .05); }
.fav-btn .i { fill: none; }
.fav-btn.has-items { color: var(--blue-strong); }
.fav-btn.has-items .i { fill: var(--blue); }
.fav-btn.bump .i { animation: bump .5s var(--ease-out); }
@keyframes bump { 30% { transform: scale(1.35); } }

.bar-actions { display: flex; align-items: center; gap: var(--space-2xs); }
.filter-btn {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--ink); cursor: pointer;
}
.filter-btn:hover { background: rgb(12 23 37 / .05); }
.filter-btn.active { color: var(--blue-strong); }
.filter-badge {
  position: absolute; top: 4px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full);
  background: var(--blue-strong); color: #fdfeff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.card-loading { box-shadow: none; }
.card-loading .card-media { background: linear-gradient(90deg, #e9edf1 0%, #f3f6f8 50%, #e9edf1 100%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.summary {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  min-height: 44px; min-width: 0;
  padding: 0 var(--space-sm) 0 var(--space-2xs);
  margin-left: calc(var(--space-2xs) * -1);
  border: 0; border-radius: var(--r-full); background: transparent;
  cursor: pointer; color: var(--ink); font-weight: 500; font-size: 15px;
}
.summary:hover { background: rgb(12 23 37 / .05); }
.summary-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 48px; padding: 0 var(--space-lg);
  border: 1px solid transparent; border-radius: var(--r-full);
  font-size: 16px; font-weight: 500; text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s var(--ease-out);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue-strong); color: #fdfeff; }
.btn-primary:hover { background: #006b99; }
.btn-primary:disabled { background: var(--line); color: var(--text); cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #b9c2cb; }
.btn-outline { background: transparent; border-color: #9fd3ea; color: var(--blue-strong); }
.btn-outline:hover { background: var(--blue-soft); border-color: var(--blue); }
.btn-text { background: none; color: var(--muted); min-height: 40px; font-size: 14px; }
.btn-text:hover { color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 var(--space-md); font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Einstieg ---------- */

.start-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--space-lg);
  margin: 0 calc(var(--space-md) * -1);
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  scrollbar-width: none;
}
.start-scroll::-webkit-scrollbar { display: none; }

.start-intro { padding: var(--space-md) 0 var(--space-lg); }
.eyebrow { margin: 0 0 var(--space-xs); font-size: 14px; font-weight: 500; color: var(--blue-strong); }
h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px; line-height: 1.12; font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.group { border: 0; margin: 0; padding: 0; min-width: 0; }
.group + .group { margin-top: var(--space-xl); }
.group-title {
  display: block; padding: 0; margin: 0 0 var(--space-sm);
  font-size: 17px; font-weight: 500; color: var(--ink);
}
.opt { font-weight: 400; font-size: 14px; color: var(--muted); margin-left: var(--space-2xs); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.chips-scroll {
  flex-wrap: nowrap; overflow-x: auto;
  margin: 0 calc(var(--space-md) * -1); padding: 2px var(--space-md) var(--space-xs);
  scroll-snap-type: x proximity; scroll-padding-inline: var(--space-md); scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { scroll-snap-align: start; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 var(--space-md);
  border: 1px solid var(--line); border-radius: var(--r-full);
  background: var(--surface); color: var(--ink);
  font-size: 15px; cursor: pointer; user-select: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: #b9c2cb; }
.chip[aria-pressed="true"] {
  background: var(--blue-soft); border-color: var(--blue); color: #004f73;
  font-weight: 500;
}
.chip .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .n { color: #0a6a95; }
.chip:disabled { opacity: .45; cursor: default; }

/* Empfänger: grösser, zweispaltig, weil das die eigentliche Frage ist */
.chips-who { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
.chips-who .chip {
  justify-content: space-between;
  min-height: 48px; border-radius: var(--r-md);
  font-size: 16px; text-align: left;
}
.chips-who .chip-more {
  grid-column: 1 / -1; justify-content: center;
  border-style: dashed; background: transparent; color: var(--blue-strong); font-weight: 500; font-size: 15px;
}

.segmented {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: var(--space-2xs); gap: var(--space-2xs);
  background: #e7ebef; border-radius: var(--r-full);
}
.seg {
  min-height: 40px; border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--text); cursor: pointer;
  font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: background-color .2s, color .2s;
}
.seg[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(12 23 37 / .14); }

.more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-2xs); min-height: 44px; margin-bottom: 0; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after {
  content: ""; width: 8px; height: 8px; margin-left: auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease-out);
}
.more[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.more[open] summary { margin-bottom: var(--space-sm); }

.start-cta {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2xs);
  padding: var(--space-sm) 0 var(--space-md);
  border-top: 1px solid var(--line);
  margin: 0 calc(var(--space-md) * -1);
  padding-left: var(--space-md); padding-right: var(--space-md);
  background: var(--bg);
}
#btn-start { font-variant-numeric: tabular-nums; }

/* ---------- Stapel ---------- */

.view-deck { user-select: none; }

.deck-meta { flex: none; min-height: 24px; display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-xs); }
.progress, .learn { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.learn { color: var(--blue-strong); font-weight: 500; animation: fadeUp .5s var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }

.deck {
  flex: 1;
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}

.card {
  --x: 0px; --y: 0px; --rot: 0deg;
  position: absolute;
  /* Volle Breite, Höhe bis zum Hochformat 4:5 fürs Foto plus Textblock, sonst was Platz hat */
  width: 100cqw;
  height: min(calc(100cqh - 14px), calc(100cqw * 1.5));
  display: flex; flex-direction: column;
  transform-origin: 50% 100%;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--rot));
  will-change: transform;
}
.card.dragging { cursor: grabbing; transition: none; }
.card.settle { transition: transform .45s var(--ease-out); }
.card.leaving { z-index: 5; pointer-events: none; }
.card.fly { transition: transform .38s cubic-bezier(.4, 0, .9, .6), opacity .38s; opacity: 0; pointer-events: none; }
.card.behind {
  transform: translate3d(0, 12px, 0) scale(.94);
  box-shadow: 0 1px 2px rgb(12 23 37 / .08);
  pointer-events: none;
  transition: transform .4s var(--ease-out);
}
.card.behind .card-body { opacity: .6; }
.card.behind .stamp { opacity: 0 !important; }
.card.enter { animation: enter .5s var(--ease-out); }
@keyframes enter { from { transform: translate3d(0, 12px, 0) scale(.94); } }
.card.returning { animation: back .45s var(--ease-out); }
@keyframes back { from { transform: translate3d(var(--from-x, -120%), 0, 0) rotate(var(--from-rot, -12deg)); opacity: .3; } }

.card-media {
  position: absolute; inset: 0;
  background: #e9edf1;
  overflow: hidden;
}
.card-media img, .card-media video {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-user-drag: none; pointer-events: none;
}

.card-label, .card .card-label {
  display: inline-block; margin: 0;
  padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--blue-strong); color: #fdfeff;
  font-size: 12px; font-weight: 500; line-height: 1.3;
}
.card-media .card-label { position: absolute; left: var(--space-sm); top: var(--space-sm); max-width: calc(100% - 24px); z-index: 2; }

.card-body {
  /* Name und Fakten liegen unten auf dem Foto; der Verlauf ist nur für die Lesbarkeit da */
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 64px var(--space-md) var(--space-md);
  display: grid; gap: var(--space-xs);
  background: linear-gradient(to top, rgb(12 23 37 / .82) 0%, rgb(12 23 37 / .55) 45%, rgb(12 23 37 / 0) 100%);
  pointer-events: none;
}
.card-title {
  margin: 0; color: #fdfeff;
  font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em;
  text-shadow: 0 1px 2px rgb(12 23 37 / .3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fact {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px; padding: 0 10px; border-radius: var(--r-full);
  background: rgb(253 254 255 / .18); color: #fdfeff;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.fact .i { width: 14px; height: 14px; color: var(--star); }
.fact-soft { font-weight: 400; opacity: .85; }
.fact-price { background: var(--surface); color: var(--blue-strong); font-size: 14px; font-weight: 700; }
.fact-price small { font-size: 12px; font-weight: 500; }

.price { margin: 0; color: var(--blue-strong); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.price small { font-size: 14px; font-weight: 400; }
.meta { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); font-weight: 500; }
.stars .i { width: 14px; height: 14px; color: var(--star); }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.stamp {
  position: absolute; top: var(--space-lg); z-index: 3;
  padding: 6px 12px;
  border: 3px solid currentColor; border-radius: var(--r-sm);
  font-size: 26px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgb(253 254 255 / .9);
  opacity: 0; pointer-events: none;
}
.stamp-like { left: var(--space-lg); color: var(--blue-strong); transform: rotate(-12deg); }
.stamp-nope { right: var(--space-lg); color: var(--nope); transform: rotate(12deg); }

.card.hint { animation: hint 1.6s var(--ease-out) .6s 1; }
@keyframes hint {
  25% { transform: translate3d(48px, 0, 0) rotate(4deg); }
  55% { transform: translate3d(-36px, 0, 0) rotate(-3deg); }
  80%, 100% { transform: none; }
}

/* Platzhalter und Endzustände im Stapel */
.deck-state {
  width: 100cqw;
  text-align: center;
  display: grid; justify-items: center; gap: var(--space-sm);
  padding: var(--space-xl) var(--space-lg);
}
.deck-state h2 { margin: 0; color: var(--ink); font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.deck-state p { margin: 0; max-width: 32ch; line-height: 1.5; }
.deck-state .btn { margin-top: var(--space-xs); }
.deck-state .thumbs { display: flex; margin-bottom: var(--space-xs); }
.deck-state .thumbs img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); margin-left: -12px; }
.deck-state .thumbs img:first-child { margin-left: 0; }


.controls {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: var(--space-md);
  padding: var(--space-md) 0 var(--space-sm);
}
.ctl {
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s, opacity .2s;
}
.ctl:hover { transform: scale(1.04); }
.ctl:active { transform: scale(.92); }
.ctl:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; }
.ctl-sm { width: 48px; height: 48px; }
.ctl-sm .i { width: 22px; height: 22px; }
.ctl-lg { width: 68px; height: 68px; }
.ctl-lg .i { width: 30px; height: 30px; }
.ctl-nope { color: var(--nope); }
.ctl-like { background: var(--blue); color: #fdfeff; }
.ctl-like:hover { background: #0092cb; }

.keys { display: none; margin: 0 0 var(--space-md); text-align: center; font-size: 12px; color: var(--muted); }
.keys kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 2px 0 8px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-sm);
  background: var(--surface); font: 500 11px/1.6 Roboto, sans-serif; color: var(--text);
}
.keys kbd:first-child { margin-left: 0; }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }

/* ---------- Ihre Auswahl ---------- */

.list-scroll { flex: 1; overflow-y: auto; padding: var(--space-xs) 0 var(--space-2xl); scrollbar-width: thin; }
.list-sub { margin: var(--space-xs) 0 var(--space-lg); color: var(--muted); font-size: 15px; }

.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.fav-item {
  display: grid; grid-template-columns: 88px 1fr; gap: var(--space-md);
  padding: var(--space-sm);
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgb(12 23 37 / .06);
  animation: fadeUp .4s var(--ease-out) backwards;
}
.fav-item.removing { transition: opacity .25s, transform .25s var(--ease-out); opacity: 0; transform: translateX(-12px); }
.fav-thumb { width: 88px; height: 88px; border-radius: var(--r-sm); overflow: hidden; background: #e9edf1; }
.fav-thumb img, .fav-thumb video { width: 100%; height: 100%; object-fit: cover; }
.fav-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fav-info h2 { margin: 0; font-size: 16px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.fav-info .price { font-size: 15px; }
.fav-info .changed { font-size: 12px; color: var(--muted); }
.fav-actions { display: flex; align-items: center; gap: var(--space-xs); margin-top: auto; padding-top: var(--space-xs); }
.fav-actions .btn { min-height: 36px; padding: 0 var(--space-sm); font-size: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: rgb(12 23 37 / .06); color: var(--nope); }

.empty { text-align: center; padding: var(--space-2xl) var(--space-md); display: grid; justify-items: center; gap: var(--space-lg); }
.empty p { margin: 0; max-width: 34ch; line-height: 1.5; }

/* ---------- Detailansicht ---------- */

.sheet {
  width: var(--col); max-width: 100vw; max-height: 92dvh;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--surface); color: var(--text);
  overflow: hidden;
}
.sheet[open] { animation: sheetIn .42s var(--ease-out); }
.sheet.closing { animation: sheetOut .25s ease-in forwards; }
.sheet::backdrop { background: rgb(12 23 37 / .45); animation: fade .3s; }
.sheet.closing::backdrop { animation: fade .25s reverse forwards; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-inner { max-height: 92dvh; overflow-y: auto; position: relative; padding-bottom: env(safe-area-inset-bottom); }
.sheet-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgb(253 254 255 / .8); z-index: 3; box-shadow: 0 0 0 1px rgb(12 23 37 / .08); }
.sheet-close {
  position: absolute; top: var(--space-sm); right: var(--space-sm); z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgb(253 254 255 / .92); color: var(--ink);
  cursor: pointer; box-shadow: 0 1px 4px rgb(12 23 37 / .15);
}
.sheet-close .i { width: 18px; height: 18px; }

.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  aspect-ratio: 780 / 537; background: #e9edf1; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img, .gallery video { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery .square { object-fit: contain; background: #e9edf1; }
.dots { display: flex; justify-content: center; gap: 6px; height: 20px; align-items: center; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background-color .2s, transform .2s; }
.dots span.on { background: var(--blue); transform: scale(1.2); }

.sheet-body { padding: var(--space-xs) var(--space-lg) var(--space-lg); display: grid; gap: var(--space-xs); }
.sheet-body h2 { margin: var(--space-2xs) 0 0; color: var(--ink); font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.sheet-body .price { font-size: 19px; }
.sheet-body .card-label { justify-self: start; }
.desc { margin: var(--space-xs) 0 var(--space-sm); line-height: 1.55; max-width: 60ch; min-height: 3em; }
.desc.loading { color: var(--muted); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); margin-top: var(--space-2xs); }
.sheet-actions .i { color: var(--nope); }
.btn-like-soft .i { color: var(--blue); }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(var(--col) - 32px);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--r-sm);
  background: var(--ink); color: #fdfeff; font-size: 14px; line-height: 1.4;
  box-shadow: var(--shadow-float);
  animation: fadeUp .35s var(--ease-out);
  z-index: 10;
}

/* ---------- Grössere Bildschirme ---------- */

@media (min-width: 600px) {
  body { background: #e8ecf0; }
  .app { background: var(--bg); box-shadow: 0 0 0 1px rgb(12 23 37 / .05); }
}

/* Desktop: Stapel links, Auswahl rechts */
@media (min-width: 960px) {
  .app.with-side {
    width: calc(440px + 400px + 1px);
    display: grid; grid-template-columns: 440px 400px; column-gap: 1px;
    background: var(--line);
  }
  .app.with-side > .view { background: var(--bg); }
  .view-list.as-side .bar .summary { visibility: hidden; }
  .view-list.as-side h1 { font-size: 24px; }
  .view-list.as-side .empty { padding-top: var(--space-lg); }
  .view-list.as-side .empty .btn { display: none; }
  .view-list.as-side .fav-item { grid-template-columns: 72px 1fr; }
  .view-list.as-side .fav-thumb { width: 72px; height: 72px; }
}

@media (max-height: 640px) {
  .start-intro { padding: var(--space-xs) 0 var(--space-md); }
  h1 { font-size: 27px; }
  .controls { padding: var(--space-sm) 0 var(--space-xs); gap: var(--space-sm); }
  .ctl-lg { width: 60px; height: 60px; }
  .ctl-sm { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .card.leaving { z-index: 5; pointer-events: none; }
.card.fly { transition: opacity .2s !important; }
}

/* ---------- Bilder durchtippen ---------- */

.slides, .slide { position: absolute; inset: 0; }
.slide { opacity: 0; transition: opacity .18s ease-out; }
.slide.on { opacity: 1; }
.slide > img, .slide > video { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
/* Karussellbilder sind quer: ganz zeigen, Rand mit derselben Aufnahme unscharf füllen */
.slide .slide-bg { position: absolute; inset: 0; filter: blur(18px) saturate(1.1); transform: scale(1.15); opacity: .85; }
.slide .slide-fg { position: absolute; inset: 0; object-fit: contain; }
.bars {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3;
  display: flex; gap: 4px;
}
.bars span { flex: 1; height: 3px; border-radius: var(--r-full); background: rgb(253 254 255 / .45); box-shadow: 0 0 2px rgb(12 23 37 / .25); }
.bars span.on { background: #fdfeff; }
.card.has-slides .card-media .card-label { top: 20px; }
.card.bump-right { animation: bumpR .3s var(--ease-out); }
.card.bump-left { animation: bumpL .3s var(--ease-out); }
@keyframes bumpR { 40% { transform: perspective(900px) rotateY(-4deg); } }
@keyframes bumpL { 40% { transform: perspective(900px) rotateY(4deg); } }

/* ---------- Einführung ---------- */

.view-deck { position: relative; }
.intro {
  position: absolute; inset: 0; z-index: 20;
  background: rgb(12 23 37 / .74);
  color: #fdfeff;
  animation: fade .25s ease-out;
}
.intro.closing { animation: fade .22s reverse forwards; }
.intro-top { position: absolute; left: var(--space-md); right: var(--space-md); top: calc(64px + env(safe-area-inset-top)); }
.view-deck:has(.intro:not([hidden])) .deck-meta { visibility: hidden; }
.intro-top h2 { margin: 0 0 var(--space-2xs); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.intro-top p { margin: 0; font-size: 14px; line-height: 1.45; color: rgb(253 254 255 / .85); max-width: 34ch; }
/* Zonen liegen genau auf der Karte, Position setzt app.js */
.intro-card {
  position: absolute;
  display: grid; grid-template-columns: 2fr 3fr; grid-template-rows: 1fr 28%;
  gap: 6px;
}
.zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-xs);
  border: 2px dashed rgb(253 254 255 / .6); border-radius: var(--r-md);
  font-size: 15px; font-weight: 500; text-align: center; line-height: 1.3;
}
.zone-info { grid-column: 1 / -1; flex-direction: row; }
.tap { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid #fdfeff; position: relative; }
.tap::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fdfeff; }
.intro-bottom {
  position: absolute; left: var(--space-md); right: var(--space-md);
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  display: grid; gap: var(--space-sm);
}
.intro-swipes { display: flex; justify-content: space-between; gap: var(--space-sm); margin: 0; font-size: 15px; font-weight: 500; line-height: 1.3; }
.intro-swipes span { display: inline-flex; align-items: center; gap: 6px; }
.intro-swipes .r { text-align: right; }
.intro-swipes .flip { transform: scaleX(-1); }
@media (max-height: 640px) {
  .intro-top { display: none; }
  .intro-bottom { gap: var(--space-xs); bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); }
  .intro-swipes { font-size: 14px; }
  .intro-bottom .btn { min-height: 44px; }
  .zone { font-size: 14px; }
}

/* Touch: kein Bildmenü und keine Textauswahl beim langen Drücken auf der Karte */
.card, .card img, .fav-thumb img, .intro { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
