/* =========================================================
   Dahin – Kulturkalender Braunschweig
   Basis-Styles + Screen-System (Mobile Web App)
   ========================================================= */

/* --- Schrift: Protest Grotesk --- */
@font-face {
  font-family: "Protest Grotesk";
  src: url("../assets/fonts/ProtestGrotesk-Book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Protest Grotesk";
  src: url("../assets/fonts/ProtestGrotesk-Medium.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Protest Grotesk";
  src: url("../assets/fonts/ProtestGrotesk-Heavy.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Protest Grotesk";
  src: url("../assets/fonts/ProtestGrotesk-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Protest Grotesk Mono";
  src: url("../assets/fonts/ProtestGroteskMono-Book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Reset / Grundlagen --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Papierfarbe der Textur – als Hintergrund, damit es an den Rändern
     (Overscroll, Notch) keine weißen Blitzer gibt */
  --papier: #eeede9;
  --tinte: #111111;
  --orange: #d0411f;        /* Markenorange (wie in der Kulturkarte) */
  --hell: rgba(245, 245, 245, 0.9);
  --app-max: 480px; /* am Desktop wird die App auf Handybreite begrenzt */
}

html, body {
  height: 100%;
  background: var(--papier);
  color: var(--tinte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; /* kein „Gummiband"-Effekt beim Scrollen */
}

body {
  display: flex;
  justify-content: center; /* App am Desktop zentrieren */
}

/* --- Passwort-Gate (sofort sichtbar, deckt die App bis zur Freigabe ab) --- */
.pwgate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  /* gleiche Papier-Textur wie der Splash-Screen (background-color als Fallback,
     bis das Bild geladen ist – kein weißer Blitz) */
  background-color: var(--papier);
  background-image: url("../assets/splash-bg.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px calc(24px + env(safe-area-inset-right)) 24px calc(24px + env(safe-area-inset-left));
  font-family: "Protest Grotesk", -apple-system, sans-serif;
}
.pwgate__box {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pwgate__logo {
  width: 58%;
  max-width: 190px;
  height: auto;
  align-self: center;
  margin-bottom: 10px;
}
.pwgate__input {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 16px; /* 16px verhindert das iOS-Zoomen beim Fokus */
  color: var(--tinte);
  background: #fff;
  border: 2px solid var(--tinte);
  border-radius: 6px;
  outline: none;
  -webkit-appearance: none;
}
.pwgate__input::placeholder { color: rgba(17, 17, 17, 0.4); }
.pwgate__btn {
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--orange);
  color: #f5f5f5;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 100ms ease;
}
.pwgate__btn:active { transform: scale(0.98); }
.pwgate__err {
  margin: 0;
  text-align: center;
  color: var(--orange);
  font-weight: 600;
  font-size: 14px;
}

/* --- App-Rahmen --- */
.app {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  height: 100vh;   /* Fallback */
  height: 100dvh;  /* moderne Browser */
  height: 100lvh;  /* iOS: große (stabile) Viewport-Höhe – Footer bleibt beim Start unten */
  overflow: hidden;
}

/* --- Screen-System ---
   Alle Screens liegen übereinander; nur der aktive ist sichtbar. */
.screen {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100lvh;
  display: none;
  flex-direction: column;
}

.screen.is-active {
  display: flex;
}

/* =========================================================
   SCREEN 1: Splash / Startbild
   ========================================================= */
.screen--splash {
  align-items: center;
  justify-content: center;
  /* Papier-Textur als vollflächiger Hintergrund */
  background-color: var(--papier);
  background-image: url("../assets/splash-bg.jpg");
  background-size: cover;
  background-position: center;
}

.splash__logo {
  width: 76%;
  max-width: 320px;
  height: auto;
  /* Logo sitzt leicht über der Mitte (wie in Figma, ~52px höher) */
  transform: translateY(-6vh);
  /* sanftes Einblenden beim Start */
  animation: logoAuf 900ms ease-out both;
}

@keyframes logoAuf {
  from { opacity: 0; transform: translateY(-6vh) scale(0.96); }
  to   { opacity: 1; transform: translateY(-6vh) scale(1); }
}

/* =========================================================
   SCREEN 2: Home / Kalender
   ========================================================= */
.screen--home {
  background-color: var(--orange);
  font-family: "Protest Grotesk", -apple-system, sans-serif;
  color: var(--tinte);
  /* Aufteilung: Kopf oben, Inhalt scrollbar, Leiste unten */
}

/* --- Kopfzeile --- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px; /* gleiche linke/rechte Kante wie der Inhalt darunter */
  padding-top: calc(12px + env(safe-area-inset-top)); /* unter dem Notch */
}
.topbar__menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 20px;
  color: var(--tinte);
  padding: 5px 5px 5px 0; /* links bündig mit "Deine Veranstaltungen im" */
}
.topbar__menu-icon { width: 20px; height: 20px; display: block; }
.topbar__brand { height: 26px; width: auto; display: block; }

/* --- Scrollbarer Inhalt --- */
.home__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 24px; /* oben Abstand zur Menü-Leiste; unten kleiner, da die Leiste jetzt eine eigene Zeile ist */
  /* Monatsblock beginnt oben, direkt unter der Kopfzeile */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* --- Kalender-Kopf (Deine Veranstaltungen im … / Monat) --- */
.cal__head {
  position: relative;
  margin-bottom: 64px; /* Abstand zum Kalenderbereich (Toggle + Raster) */
  opacity: 0.8;        /* gesamter Container in 80 % Deckkraft */
}
.cal__label {
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.4px;
  color: #f5f5f5;
  margin-bottom: 6px;
}
.cal__monthrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.cal__month {
  font-size: 25px;
  color: #f5f5f5;
  line-height: 1;
  text-transform: uppercase;
  font-weight: 800; /* Heavy */
}
.cal__year {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: "Protest Grotesk Mono", monospace;
  font-size: 15px;
  letter-spacing: 0.45px;
  color: #f5f5f5;
  padding: 2px 4px;
}
.cal__year-chevron { width: 12px; height: 11px; display: block; }

/* Umschalter + Kalender: als Block vertikal auf dem Screen zentriert */
.cal__center {
  margin: auto 0; /* zentriert den Block im freien Raum unter dem Monatskopf */
}

/* Toggle Kalender / Liste – rechtsbündig über dem Kalender */
.cal__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 24px;  /* Abstand der Toggle-Bar zum Kalender */
  margin-right: -4px;   /* Icon-Padding ausgleichen: rechte Kante bündig zur äußersten Kalenderzahl */
}
.cal__toggle-btn {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;            /* größere Tipp-Fläche fürs Handy (40px) */
  opacity: 0.45;
  transition: opacity 120ms ease, transform 100ms ease;
}
.cal__toggle-btn.is-active { opacity: 1; }
.cal__toggle-btn:active { transform: scale(0.88); } /* Druck-Feedback */
.cal__toggle-btn img { width: 24px; height: 24px; display: block; }

/* --- Das Kalender-Raster --- */
.cal__grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 16px;
  column-gap: 6px;
}
.cal__day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  /* Identisch zur Kulturkarte: Form + Zahl gemeinsam bei 50 % Deckkraft
     (dadurch Kreis lachsfarben, Zahl gedimmt – wie die Karten-Pins). */
  opacity: 0.5;
  transition: opacity 120ms ease;
}
.cal__day--empty { visibility: hidden; pointer-events: none; }

/* hinterlegter Stempel = Tag mit Veranstaltung(en) – gleiche Form wie Karten-Pin */
.cal__day .cal__stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  height: 82%;
  pointer-events: none;
}
.cal__day .cal__num {
  position: relative;
  z-index: 1;
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 800;          /* Heavy – wie die Zahlen in der Karte */
  font-size: 17px;
  color: #000000;
  line-height: 1;
}
/* ausgewählter Tag: wie ausgewählter Karten-Pin (80 % statt 50 %) */
.cal__day.is-selected { opacity: 0.8; }

/* --- Untere schwebende Leiste --- */
.tabbar {
  flex: 0 0 auto;            /* normale Zeile unten im Screen – NICHT position:fixed.
                               Verhindert den iOS-Startsprung des Bottom-Bars. */
  z-index: 20;   /* liegt über der sticky Tages-Überschrift */
  display: flex;
  align-items: center;      /* Icons bleiben vertikal mittig im Container */
  justify-content: center;
  gap: 45px;
  padding: 16px 8px 34px;   /* 16px über den Icons, 34px darunter (Home-Indikator frei) */
  box-sizing: border-box;
  background: var(--orange); /* solide Fläche (kein Verlauf) */
}
.tabbar__btn {
  pointer-events: auto; /* … Buttons aber schon */
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
  opacity: 0.9;
  transition: transform 120ms ease, opacity 120ms ease;
}
.tabbar__btn.is-active { opacity: 1; }
.tabbar__btn:active { transform: scale(0.9); }
.tabbar__btn img { width: 40px; height: 40px; display: block; }

/* =========================================================
   SCREEN 4: Hinzufügen (Plus)
   ========================================================= */
.screen--plus {
  background-color: var(--orange);
  font-family: "Protest Grotesk", -apple-system, sans-serif;
  color: #000;
}
.plus__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 30px 24px; /* linke Kante wie im Figma (30px) */
  display: flex;
  flex-direction: column;
}
.plus__title {
  font-weight: 900; /* Heavy/Black – wie die Veranstaltungs-Headlines (.ecard__title) */
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.9px;
  color: #000;
  max-width: 330px;
  margin-bottom: 56px;
}
.plus__options {
  display: flex;
  flex-direction: column;
  gap: 45px;
}
.plus__option {
  display: flex;
  align-items: center;
  gap: 16px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: #000;
}
.plus__stamp {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: block;
  color: #000; /* „Stempel"-Plus (wie das Add-Icon in der App) */
}
.plus__label {
  font-weight: 400;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.54px;
}
.plus__option:active { transform: scale(0.98); }

/* =========================================================
   SCREEN 5: Veranstaltung hinzufügen (Scan)
   ========================================================= */
.screen--addev {
  background-color: var(--orange);
  font-family: "Protest Grotesk", -apple-system, sans-serif;
  color: #000;
}
.addev__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 37px;
}
.addev__overline {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.36px;
  color: rgba(245, 245, 245, 0.8);
}
/* Scan-Fläche: 2px schwarzer Rahmen, leicht aufgehellte „Kamera"-Fläche */
.scanbox {
  flex: 1 1 auto;
  min-height: 260px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0, 0, 0, 0.8);
  border-radius: 5px;
  background: rgba(245, 245, 245, 0.12);
  cursor: pointer;
  padding: 0;
  overflow: hidden; /* Live-Video an die abgerundeten Ecken beschneiden */
  font-family: inherit;
}
.scanbox:active { transform: scale(0.99); }
/* Live-Kamerabild bzw. aufgenommenes Foto füllen die Box */
.scanbox__video,
.scanbox__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.scanbox__frame {
  position: relative;
  z-index: 2; /* Eck-Rahmen liegt über dem Kamerabild */
  width: 102px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanbox__brackets {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scanbox__hint {
  position: relative;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.36px;
  text-align: center;
  color: rgba(245, 245, 245, 0.8);
}
/* Bei laufender Kamera nur die Eck-Klammern zeigen, keinen „Plakat scannen"-Text */
.scanbox.is-live .scanbox__hint { display: none; }
/* Auslöser (Foto aufnehmen) */
.scanbox__shutter {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 4px solid rgba(0, 0, 0, 0.55);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.scanbox__shutter:active { transform: translateX(-50%) scale(0.92); }

/* Kamera-Erlaubnis-Dialog */
.camdialog {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.camdialog[hidden] { display: none; }
.camdialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.camdialog__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  background: #f5f5f5;
  color: #111;
  border-radius: 14px;
  padding: 22px 20px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.camdialog__title {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.camdialog__text {
  font-size: 14px;
  line-height: 1.45;
  color: #333;
  margin-bottom: 20px;
}
.camdialog__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.camdialog__btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  border: 0;
  border-radius: 9px;
  padding: 11px 16px;
  cursor: pointer;
}
.camdialog__btn--ghost { background: transparent; color: #111; }
.camdialog__btn--ghost:active { background: rgba(0, 0, 0, 0.06); }
.camdialog__btn--primary { background: var(--orange); color: #f5f5f5; }
.camdialog__btn--primary:active { filter: brightness(0.94); }
/* untere Alternative erbt .plus__option; nur oberer Abstand raus (gap regelt es) */
.addev__manual { align-self: flex-start; }

/* =========================================================
   SCREEN 3: Listenansicht
   ========================================================= */
.screen--list {
  background-color: var(--orange);
  font-family: "Protest Grotesk", -apple-system, sans-serif;
  color: #000;
}
.list__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 24px;
}

/* --- Fixe Kopf-Zeile: Suche (links) + Umschalter (rechts) --- */
.list__bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--orange);   /* hinterlegt, damit Karten sauber druntergleiten */
  padding: 8px 0;
  min-height: 56px;            /* konstante Höhe -> kein Spalt, auch bei offener Suche */
  box-sizing: border-box;
  transition: transform 260ms ease;
}
/* beim Runterscrollen ausblenden (nach oben wegfahren), beim Hochscrollen zeigen */
.list__body.bar-hidden .list__bar { transform: translateY(-100%); }
/* Tages-Überschrift rückt dann ganz nach oben (füllt die Lücke) */
.list__body.bar-hidden .list__day { top: 0; }
.list__toggle { margin: 0; }
/* aufgeklappte Suche belegt die ganze Zeile -> Umschalter ausblenden */
.list__bar.search-open .list__toggle { display: none; }

/* Suchleiste (Ästhetik der Kulturkarte): zu = nur Lupe, auf = volles Feld */
.searchbar { position: relative; display: flex; align-items: center; }
.searchbar.is-open { flex: 1 1 auto; }

/* Lupe-Button im zugeklappten Zustand (linksbündig) */
.searchbar__open {
  display: flex;
  align-items: center;
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  color: #000; /* Such-Icon (zugeklappt): 100 % Schwarz */
}
.searchbar__open svg { display: block; height: 22px; width: auto; }
.searchbar.is-open .searchbar__open { display: none; }

/* Eingabefeld – nur im aufgeklappten Zustand */
.searchbar__input { display: none; }
.searchbar.is-open .searchbar__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 40px 0 12px;
  background: rgba(245, 245, 245, 0.5);
  border: 2px solid #000; /* Kontur (unausgewählt): 100 % Schwarz */
  border-radius: 6px;
  font-family: "Protest Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #403f3f;
  outline: none;
  -webkit-appearance: none;
}
.searchbar__input::placeholder { color: #403f3f; opacity: 0.5; }
.searchbar.is-active .searchbar__input { background: rgba(245, 245, 245, 0.8); border-color: #403f3f; } /* ausgewählt: Füllung 80 % */

/* Lupe / X im Feld (rechts) – nur im aufgeklappten Zustand */
.searchbar__icon,
.searchbar__clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  color: #403f3f;
}
.searchbar__icon svg,
.searchbar__clear svg { display: block; height: 18px; width: auto; }
.searchbar.is-open .searchbar__icon { display: flex; opacity: 1; color: #000; pointer-events: none; } /* Such-Icon (unausgewählt): 100 % Schwarz */
.searchbar.is-open.is-active .searchbar__icon { display: none; }
.searchbar__clear { border: 0; background: none; padding: 0; cursor: pointer; }
.searchbar.is-open.is-active .searchbar__clear { display: flex; }

/* --- Kartenliste, gruppiert nach Tag --- */
.list__cards { display: flex; flex-direction: column; gap: 14px; }
.list__group { display: flex; flex-direction: column; gap: 20px; }

/* --- Tages-Überschrift: sticky direkt unter der Such-/Toggle-Zeile,
       orange hinterlegt; wird erst vom nächsten Tag abgelöst. --- */
.list__day {
  position: sticky;
  top: 56px;                 /* Höhe der fixen Such-/Toggle-Zeile */
  z-index: 5;
  background: var(--orange);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 0 8px;
  margin: 0;
  transition: top 260ms ease; /* wandert synchron mit der Leiste (keine Lücke) */
}
.list__empty {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  padding: 20px 2px;
}

/* =========================================================
   Event-Karte (mit Umdreh-Effekt)
   ========================================================= */
.ecard { position: relative; perspective: 1400px; }
.ecard__inner {
  position: relative;
  transition: transform 520ms cubic-bezier(0.4, 0.1, 0.2, 1);
  transform-style: preserve-3d;
}
.ecard.is-flipped .ecard__inner { transform: rotateY(180deg); }
.ecard__front,
.ecard__back {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Vorderseite */
.ecard__front {
  position: relative;
  background: rgba(245, 245, 245, 0.8); /* Kartenfüllung 80 % */
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* oranger Kopfstreifen */
.ecard__strip {
  position: relative;
  background: var(--orange);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 48px 9px 14px; /* rechts Platz für den Stern */
  min-height: 35px;
}
.ecard__date {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.45px;
  color: #f5f5f5;
}
.ecard__termin {
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.36px;
  color: rgba(245, 245, 245, 0.8);
  white-space: nowrap;
  margin-left: auto;      /* schiebt TERMIN nach rechts, Datum bekommt den Platz */
  padding-right: 4px;
}
.ecard__strip { align-items: flex-start; }

/* Kartenkörper */
.ecard__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px 16px 16px; /* oben Platz für die Merken-Ecke */
}

/* --- Merken-Ecke oben rechts (Eintrittskarten-Look) --- */
.ecard__ticket {
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
/* orange Ecke – bei Hover und wenn gemerkt */
.ecard__ticket::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 0, 100% 100%); /* obere rechte Ecke */
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.ecard__ticket:hover::after,
.ecard.is-gemerkt .ecard__ticket::after { opacity: 1; }
/* eingefaltete Ecke (gespiegelt nach innen) – nach dem Wegfliegen des Sterns */
.ecard__ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #a8341a;                          /* dunkleres Orange = Falz */
  clip-path: polygon(0 0, 0 100%, 100% 100%);   /* untere linke Ecke = gespiegelt */
  opacity: 0;
  transform: scale(0);
  transform-origin: 100% 0;                     /* faltet von der Diagonale nach innen */
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.4, 0.1, 0.2, 1);
  pointer-events: none;
}
.ecard.is-gefaltet .ecard__ticket::before { opacity: 1; transform: scale(1); }
/* Stern als schwarze Outline; bei Hover weiß (F5F5F5) */
.ecard__ticket { color: #000; }
.ecard__ticket:hover { color: #f5f5f5; }
.ecard__star {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  overflow: visible; /* Strich der Spitzen nie abschneiden */
  z-index: 1;
  transition: fill 160ms ease, opacity 160ms ease;
}
/* Hover: Stern gefüllt in F5F5F5 mit 80 % Deckkraft */
.ecard__ticket:hover .ecard__star {
  fill: #f5f5f5;
  fill-opacity: 0.8;
  stroke: #f5f5f5;
}
.ecard.is-gemerkt .ecard__star { opacity: 0; }

/* fliegender Stern (Karte -> Footer): gefüllt, landet im schwarzen Footer-Stern */
.fly-star {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  fill: #000;
  stroke: none;
  transition: transform 650ms cubic-bezier(0.34, 0.1, 0.24, 1), opacity 650ms ease;
}
/* kurzer Puls des Footer-Sterns beim Ankommen */
.tabbar__btn.pulse { animation: starPulse 550ms ease; }
@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.45); }
}
.ecard__title {
  font-weight: 900;
  font-size: 32px;
  line-height: 36px;
  letter-spacing: 0.96px;
  color: #000;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.ecard__venue {
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.54px;
  color: #000;
}
.ecard__chips { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }

/* Chips */
.chip {
  display: inline-block;
  border: 2px solid #000;
  border-radius: 3px;
  padding: 6px 12px;
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1.2px;
  line-height: 1;
  text-transform: uppercase;
  color: #000;
  background: none;
}
.chip--cat { border-color: var(--orange); color: var(--orange); transform: rotate(-2deg); }
.chip--genre { border-color: #000; color: #000; }
.chip--cost { border-color: #000; background: #000; color: #f5f5f5; }
.chip--freq { border-color: var(--orange); background: var(--orange); color: #f5f5f5; }

/* zweite Ebene (Auffalten) */
.ecard__more { display: flex; flex-direction: column; gap: 12px; }
.ecard__more[hidden] { display: none; }
.ecard__chips2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ecard__time {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  font-family: "Protest Grotesk", sans-serif;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #000;
  white-space: nowrap;
  line-height: 1.3;
}
.ecard__time-date { font-weight: 700; }   /* Datum (obere Zeile) */
.ecard__time-uhr { font-weight: 500; }    /* Uhrzeit (untere Zeile) */
.ecard__sep { border: 0; border-top: 1.5px dotted #000; margin: 2px 0; }
.ecard__desc {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.45;
  color: #111;
}
.ecard__addr {
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: #000;
}
.ecard__actions { display: flex; align-items: center; gap: 18px; padding-top: 2px; }
.ecard__share,
.ecard__source {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #000;
}
.ecard__share img,
.ecard__source img { width: 22px; height: 22px; display: block; }
.ecard__share:active { transform: scale(0.9); }
.ecard__share.is-copied { opacity: 0.5; }

/* Fußzeile */
.ecard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1.5px dotted #000;
  padding: 9px 14px;
}
.ecard__foot button {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #000;
}

/* Rückseite (Flyer) */
.ecard__back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background: var(--orange);
  border: 2px solid #f5f5f5;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: #f5f5f5;
}
.ecard__back-title { font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: 1px; }
.ecard__back-note { font-weight: 400; font-size: 14px; line-height: 1.45; opacity: 0.9; max-width: 240px; }
.ecard__flip-back {
  margin-top: 6px;
  background: none;
  border: 2px solid #f5f5f5;
  border-radius: 3px;
  color: #f5f5f5;
  cursor: pointer;
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 14px;
}

/* =========================================================
   Tages-Detail-Sheet (Kalendertag angetippt)
   ========================================================= */
.daysheet {
  position: absolute;
  inset: 0;
  z-index: 30;                 /* über der Tabbar (z 20) */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* Panel klebt unten */
}
.daysheet[hidden] { display: none; }

.daysheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  opacity: 0;
  transition: opacity 260ms ease;
}
.daysheet.is-open .daysheet__backdrop { opacity: 1; }

.daysheet__panel {
  position: relative;
  z-index: 1;
  background: var(--orange);
  border-radius: 4px 4px 0 0;
  max-height: 86%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.28);
  transform: translateY(100%);
  transition: transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.daysheet.is-open .daysheet__panel { transform: translateY(0); }

.daysheet__head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}
.daysheet__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 800;
  font-size: 19px;
  line-height: 1.15;
  color: #f5f5f5;
}
.daysheet__count {
  font-weight: 600;
  font-size: 13px;
  opacity: 0.75;
}
.daysheet__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  background: none;            /* keine kreisförmige Umrandung */
  padding: 0;
  color: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease;
}
.daysheet__close:active { transform: scale(0.9); }
.daysheet__close svg { width: 20px; height: 20px; display: block; opacity: 0.8; }

.daysheet__cards {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* Wischen: neuer Tag gleitet leicht aus der Wischrichtung ein */
.daysheet__cards.slide-l { animation: daySlideFromRight 220ms ease; }
.daysheet__cards.slide-r { animation: daySlideFromLeft 220ms ease; }
@keyframes daySlideFromRight {
  from { transform: translateX(26px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes daySlideFromLeft {
  from { transform: translateX(-26px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   Onboarding / Präferenzen (Kategorie-Auswahl)
   ========================================================= */
.screen--onboard {
  background: #f5f5f5;
  color: #111;
  font-family: "Protest Grotesk", -apple-system, sans-serif;
}
.onboard__header {
  flex: 0 0 auto;
  padding: 16px 25px 8px;
  padding-top: calc(16px + env(safe-area-inset-top));
  background: #f5f5f5;
}
.onboard__brand { height: 26px; width: auto; display: block; }

.onboard__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.onboard__intro { padding: 24px 30px 4px; }
.onboard__overline {
  font-size: 12px;
  letter-spacing: 0.36px;
  font-weight: 400;
  color: #000;
  margin: 0 0 18px;
}
.onboard__title {
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.9px;
  color: var(--orange);
  margin: 0 0 16px;
}
.onboard__text {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.45px;
  color: #000;
  margin: 0;
}

.onboard__cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 30px 24px; /* Footer ist jetzt eine eigene Zeile – kein Extra-Platz nötig */
}

/* --- Kategorie-Karte --- */
.katcard {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 331 / 221;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  background: #f5f5f5;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 140ms ease;
}
.katcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  pointer-events: none;
}
/* schwarzes Label, bündig am linken Rand (Ticket-Tab-Look) */
.katcard__label {
  position: absolute;
  top: 22px;
  left: 0;
  z-index: 1;
  background: #000;
  color: #f5f5f5;
  border: 2.4px solid #000;
  border-left: 0;
  padding: 4px 10px;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
/* Add/Saved-Button unten rechts */
.katcard__add {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  padding: 8px;
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  color: var(--orange);
  transition: background 140ms ease, color 140ms ease;
}
.katcard__add svg { width: 22px; height: 22px; display: block; }
/* gewählt: orange Rahmen + gefüllter Button */
.katcard.is-selected { box-shadow: 0 0 0 3px var(--orange); }
.katcard.is-selected .katcard__add { background: var(--orange); color: #f5f5f5; }
.katcard:active { box-shadow: 0 0 0 3px rgba(208, 65, 31, 0.5); }

/* --- Footer „weiter" (am echten Bildschirmrand verankert) --- */
.onboard__footer {
  flex: 0 0 auto;             /* normale Zeile unten – NICHT position:fixed (iOS-Startsprung) */
  z-index: 20;
  display: flex;
  justify-content: center;
  background: #f5f5f5;
  padding: 14px 0 34px;
}
.onboard__next {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: "Protest Grotesk", sans-serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.72px;
  color: #000;
  padding: 8px 16px;
  transition: transform 120ms ease;
}
.onboard__next:active { transform: scale(0.96); }
