/* Galerie & Momente · Gästeseite */
:root {
  --grund: #0C241D;
  --grund2: #102E25;
  --flaeche: #16392E;
  --flaeche2: #1D4638;
  --linie: rgba(200, 164, 77, 0.28);
  --gold: #C8A44D;
  --gold-hell: #E2C77E;
  --auf-gold: #16170C;
  --text: #F2ECDD;
  --text2: #B9C6BB;
  --alarm: #E8876B;
  --schatten: 0 10px 30px rgba(0, 0, 0, 0.35);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #0C241D; --grund2: #102E25; --flaeche: #16392E; --flaeche2: #1D4638;
    --text: #F2ECDD; --text2: #B9C6BB; --gold: #C8A44D; --gold-hell: #E2C77E;
  }
}
:root[data-theme="dark"] {
  --grund: #0C241D; --grund2: #102E25; --flaeche: #16392E; --flaeche2: #1D4638;
  --text: #F2ECDD; --text2: #B9C6BB; --gold: #C8A44D; --gold-hell: #E2C77E;
}
:root[data-theme="light"] {
  --grund: #E9EFE9; --grund2: #DDE7DF; --flaeche: #FFFFFF; --flaeche2: #F1F5F1;
  --text: #10261E; --text2: #3F5A4D; --gold: #8A6A1F; --gold-hell: #6E5316;
  --auf-gold: #FFFFFF; --linie: rgba(138, 106, 31, 0.3); --alarm: #B2462C;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--grund); color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--gold-hell); }
:focus-visible { outline: 2px solid var(--gold-hell); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 92px; position: relative; }

/* Kopf */
.kopf {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--grund) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linie);
}
.marke { font-family: var(--serif); font-size: 17px; letter-spacing: 0.02em; line-height: 1.1; }
.marke small { display: block; font-family: var(--sans); font-size: 12px; color: var(--text2); letter-spacing: 0; }
.goals {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 22px; border: 1px solid var(--linie); background: var(--flaeche);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.goals .ball { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(200,164,77,.18); }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 24px; border: 0;
  background: var(--gold); color: var(--auf-gold); font-weight: 650; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.knopf:active { transform: scale(0.98); }
.knopf svg { width: 18px; height: 18px; flex: none; }
.knopf--leise { background: transparent; color: var(--text); border: 1px solid var(--linie); }
.knopf--breit { width: 100%; }
.knopf[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Anmeldung */
.tor { min-height: 100vh; display: flex; flex-direction: column; }
.tor-bild { position: relative; height: 46vh; min-height: 280px; overflow: hidden; }
.tor-bild img { width: 100%; height: 100%; object-fit: cover; }
.tor-bild::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,36,29,0) 35%, var(--grund) 100%); }
.tor-titel { position: absolute; left: 22px; right: 22px; bottom: 18px; z-index: 1; }
.tor-titel h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 10vw, 46px); line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
.tor-titel p { margin: 8px 0 0; color: var(--text2); }
.tor-form { padding: 8px 22px 32px; display: grid; gap: 14px; }
.feld label { display: block; font-size: 14px; color: var(--text2); margin-bottom: 6px; }
.feld input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); font-size: 16px;
}
.feld input:focus { border-color: var(--gold); outline: none; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.haken { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text2); line-height: 1.45; }
.haken input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--gold); }
.haken strong { color: var(--text); font-weight: 600; }
.hinweis { font-size: 13px; color: var(--text2); margin: 0; }
.fehler { color: var(--alarm); font-size: 14px; margin: 0; }
.trenner { display: flex; align-items: center; gap: 12px; color: var(--text2); font-size: 13px; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }

/* Postfach */
.post { padding: 32px 22px; display: grid; gap: 18px; }
.post h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 0; }
.brief { border: 1px solid var(--linie); border-radius: 18px; background: var(--flaeche); padding: 18px; display: grid; gap: 10px; }
.brief-kopf { font-size: 13px; color: var(--text2); }
.brief h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 21px; }

/* Galerie-Start */
.held { position: relative; margin: 0; }
.held img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.held::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,36,29,.15) 0%, rgba(12,36,29,0) 40%, rgba(12,36,29,.92) 100%); }
.held-text { position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 1; }
.held-text h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 11vw, 54px); line-height: 0.98; margin: 0 0 6px; letter-spacing: -0.015em; }
.held-text p { margin: 0 0 16px; color: var(--text2); }
.held-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; }

.abschnitt { padding: 26px 18px 6px; }
.abschnitt h2 { font-family: var(--serif); font-weight: 500; font-size: 25px; margin: 0 0 4px; }
.abschnitt > p { margin: 0 0 14px; color: var(--text2); font-size: 15px; }

.kapitel { display: grid; gap: 12px; }
.kap {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center;
  width: 100%; padding: 10px; border-radius: 18px; border: 1px solid var(--linie);
  background: var(--flaeche); text-align: left; cursor: pointer;
}
.kap img { width: 92px; height: 116px; object-fit: cover; border-radius: 12px; }
.kap h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 21px; }
.kap p { margin: 2px 0 10px; font-size: 14px; color: var(--text2); }
.balken { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.balken i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 2px; transition: width .4s ease; }
.kap-stand { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); margin-top: 6px; }
.kap--fertig { border-color: var(--gold); }
.kap--fertig .kap-stand b { color: var(--gold-hell); }

.reihe { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 18px 8px; margin: 0 -18px; scrollbar-width: none; }
.reihe::-webkit-scrollbar { display: none; }
.reihe button { flex: 0 0 38%; scroll-snap-align: start; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; overflow: hidden; }
.reihe img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.karte { border: 1px solid var(--linie); border-radius: 18px; background: var(--flaeche); padding: 18px; }
.karte h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 21px; }
.karte p { margin: 0 0 14px; color: var(--text2); font-size: 15px; }

.fuss { padding: 28px 18px 10px; color: var(--text2); font-size: 12px; text-align: center; }

/* Raster (Album, Abstimmung) */
.raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.raster button { padding: 0; border: 0; background: none; cursor: pointer; }
.raster img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.leer { text-align: center; padding: 48px 12px; color: var(--text2); }
.leer strong { display: block; color: var(--text); font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 6px; }

.wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wahl button { position: relative; padding: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden; background: var(--flaeche); cursor: pointer; text-align: left; }
.wahl img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.wahl .anteil { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.75)); color: #fff; font-size: 14px; font-weight: 600; }
.wahl .anteil i { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--gold); width: 0; transition: width .6s ease; }
.wahl button.gewaehlt { border-color: var(--gold); }

/* Profil */
.profil-kopf { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 24px 18px 8px; }
.ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--anteil, 0) * 1%), rgba(255,255,255,.1) 0); }
.ring span { width: 80px; height: 80px; border-radius: 50%; background: var(--grund); display: grid; place-items: center; font-family: var(--serif); font-size: 28px; }
.profil-kopf h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 26px; }
.profil-kopf p { margin: 2px 0 0; color: var(--text2); font-size: 14px; }
.plaketten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plakette { border-radius: 16px; padding: 14px 8px 12px; text-align: center; border: 1px dashed var(--linie); color: var(--text2); background: transparent; }
.plakette b { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; border: 1px solid var(--linie); font-family: var(--serif); font-size: 20px; }
.plakette span { display: block; font-size: 13px; line-height: 1.25; }
.plakette small { display: block; font-size: 11px; margin-top: 3px; opacity: .8; }
.plakette--da { border-style: solid; border-color: var(--gold); color: var(--text); background: linear-gradient(160deg, rgba(200,164,77,.18), rgba(200,164,77,.04)); }
.plakette--da b { background: var(--gold); color: var(--auf-gold); border-color: var(--gold); }
.pass { margin-top: 14px; }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
.zeile span { font-size: 15px; }
.zeile small { display: block; color: var(--text2); font-size: 13px; }

/* Kipp-Schalter */
.kipp { position: relative; flex: none; width: 52px; height: 32px; }
.kipp input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.kipp-bahn { position: absolute; inset: 0; border-radius: 16px; background: rgba(255,255,255,.14); transition: background .2s; }
.kipp-bahn::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.kipp input:checked + .kipp-bahn { background: var(--gold); }
.kipp input:checked + .kipp-bahn::after { transform: translateX(20px); }
.kipp input:focus-visible + .kipp-bahn { outline: 2px solid var(--gold-hell); outline-offset: 2px; }

/* Untere Leiste */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--grund2) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linie);
}
.leiste nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.leiste button { min-height: 62px; border: 0; background: none; display: grid; place-items: center; gap: 2px; font-size: 12px; color: var(--text2); cursor: pointer; padding: 6px 0; }
.leiste svg { width: 24px; height: 24px; }
.leiste button[aria-current="page"] { color: var(--gold-hell); }

/* Story */
.ueber { position: fixed; inset: 0; z-index: 50; background: #050D0A; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); touch-action: none; }
.story-balken { display: flex; gap: 4px; padding: 10px 12px 6px; }
.story-balken span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; }
.story-balken i { display: block; height: 100%; width: 0; background: #fff; }
.story-kopf { display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 8px; color: #fff; }
.story-kopf b { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.story-kopf small { display: block; color: rgba(255,255,255,.7); font-size: 13px; }
.rund { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.rund svg { width: 22px; height: 22px; }
.story-buehne { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* Ganzes Bild zeigen: Logo und Credit im Bild bleiben immer sichtbar */
.story-rahmen { position: relative; display: inline-block; max-width: min(100%, 560px); }
.story-rahmen img { display: block; max-width: 100%; max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); width: auto; height: auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.goldball { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF3C4, #C8A44D 55%, #7A5F1F); box-shadow: 0 0 0 6px rgba(200,164,77,.25), 0 4px 12px rgba(0,0,0,.5); cursor: pointer; animation: puls 1.6s ease-in-out infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 12px rgba(200,164,77,.08), 0 4px 12px rgba(0,0,0,.5); } }
.story-leiste { display: flex; justify-content: space-around; padding: 10px 8px 12px; }
.story-leiste button { min-width: 64px; min-height: 56px; border: 0; background: none; color: #fff; display: grid; place-items: center; gap: 2px; font-size: 12px; cursor: pointer; }
.story-leiste svg { width: 26px; height: 26px; }
.story-leiste .an { color: var(--gold-hell); }
.story-leiste .an svg { fill: currentColor; }

/* Kino */
.kino-bild { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.kino-bild.sichtbar { opacity: 1; }
.kino-bild img { position: absolute; inset: 0; width: 100%; height: 100%; }
.kino-bild .kino-hinten { object-fit: cover; filter: blur(28px) brightness(0.5); transform: scale(1.2); }
.kino-bild .kino-vorn { object-fit: contain; }
.kino-bild.sichtbar .kino-vorn { animation: kenburns 5s ease-out forwards; }
/* Sanft: höchstens 4 % Zoom, damit Logo und Credit nie aus dem Bild fallen */
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.04); } }
.kino-tafel { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; opacity: 0; transition: opacity .8s; padding: 24px; }
.kino-tafel.sichtbar { opacity: 1; }
.kino-tafel h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 12vw, 64px); margin: 0; line-height: 1; }
.kino-tafel p { margin: 10px 0 0; color: var(--gold-hell); }
.kino-unten { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; align-items: center; color: rgba(255,255,255,.8); font-size: 13px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.6)); }

/* Blätter (Bottom Sheets) */
.blatt-grund { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.blatt { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--grund2); color: var(--text); border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--schatten); animation: hoch .25s ease-out; }
@keyframes hoch { from { transform: translateY(24px); opacity: .6; } }
.blatt-griff { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 12px; }
.blatt h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 24px; }
.blatt > p { margin: 0 0 14px; color: var(--text2); font-size: 15px; }
.blatt-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wahlreihe { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.wahlreihe button { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--linie); background: var(--flaeche); cursor: pointer; }
.wahlreihe button[aria-pressed="true"] { background: var(--gold); color: var(--auf-gold); border-color: var(--gold); font-weight: 600; }
.studio-vorschau { display: flex; justify-content: center; margin-bottom: 14px; background: var(--grund); border-radius: 14px; padding: 12px; }
.studio-vorschau canvas { max-width: 100%; max-height: 46vh; border-radius: 6px; box-shadow: var(--schatten); }
.studio-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.gruende { display: grid; gap: 8px; margin-bottom: 14px; }
.gruende label { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); cursor: pointer; }
.gruende input { width: 22px; height: 22px; accent-color: var(--gold); margin: 0; }
.sichern-bild { width: 100%; border-radius: 10px; margin-bottom: 12px; }

/* Meldung */
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: var(--gold); color: var(--auf-gold); font-weight: 600; box-shadow: var(--schatten); animation: toast .3s ease-out; text-align: center; }
.toast small { display: block; font-weight: 500; }
@keyframes toast { from { transform: translate(-50%, 16px); opacity: 0; } }
.abzeichen-neu { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0,0,0,.65); padding: 24px; }
.abzeichen-neu div { text-align: center; background: var(--grund2); border: 1px solid var(--gold); border-radius: 24px; padding: 28px 24px; max-width: 320px; animation: hoch .35s ease-out; }
.abzeichen-neu b { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: var(--gold); color: var(--auf-gold); font-family: var(--serif); font-size: 36px; }
.abzeichen-neu h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 6px; font-size: 26px; }
.abzeichen-neu p { margin: 0 0 18px; color: var(--text2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  body { background: radial-gradient(circle at 50% 0%, var(--grund2), var(--grund) 60%); }
  .app { border-left: 1px solid var(--linie); border-right: 1px solid var(--linie); background: var(--grund); }
}

/* Sprachwahl */
.sprachen { display: inline-flex; gap: 4px; padding: 4px; border-radius: 24px; background: color-mix(in srgb, var(--grund) 70%, transparent); border: 1px solid var(--linie); }
.sprachen button { min-width: 44px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 20px; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; }
.sprachen button[aria-pressed="true"] { background: var(--gold); color: var(--auf-gold); }
.sprachen--oben { position: absolute; top: 12px; right: 14px; z-index: 2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sprachen--breit { display: flex; width: 100%; }
.sprachen--breit button { flex: 1; min-height: 44px; }
.post > .sprachen { justify-self: end; }
.einladung-hinweis { margin: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--gold); background: rgba(200, 164, 77, 0.1); font-size: 15px; line-height: 1.45; }
.feld input[readonly] { opacity: 0.75; }
