:root {
  --papier: #f6f1e9;
  --karte: #fffdf9;
  --tinte: #2e2a25;
  --gedaempft: #7b7166;
  --akzent: #9a7b4f;
  --akzent-dunkel: #7a5f3a;
  --linie: #e4dacb;
  --gruen: #5f7a5a;
  --rot: #a85b4f;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app { padding: 0 16px; }

.screen {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 0;
  animation: rein .5s ease both;
}
.screen.breit { max-width: 600px; justify-content: flex-start; }
[hidden] { display: none !important; }

@keyframes rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ornament { color: var(--akzent); font-size: 20px; margin-bottom: 18px; }
.kicker {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--akzent-dunkel); margin: 0 0 10px; font-weight: 500;
}
.display {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 11vw, 60px); line-height: 1.05;
  margin: 0 0 20px; letter-spacing: -.01em;
}
.display.klein { font-size: clamp(30px, 8vw, 40px); }
.lead { color: var(--gedaempft); margin: 0 0 28px; max-width: 34ch; }
.fein { font-size: 13px; color: var(--gedaempft); margin-top: 28px; max-width: 32ch; }

.btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 999px;
  padding: 15px 34px; font-weight: 500; letter-spacing: .02em;
  transition: transform .15s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--tinte); color: var(--papier); min-width: 220px; }
.btn.primary:hover { background: #000; }
.btn.link {
  background: none; color: var(--gedaempft); padding: 12px;
  text-decoration: underline; text-underline-offset: 4px; margin-top: 8px;
}

/* Kamera */
.kamera {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 3 / 4;
  border-radius: 24px; overflow: hidden; background: #ddd2c2; margin: 8px 0 18px;
}
.kamera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.oval {
  position: absolute; left: 50%; top: 46%; width: 62%; height: 62%;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px solid rgba(255, 253, 249, .85);
  box-shadow: 0 0 0 999px rgba(46, 42, 37, .28);
  transition: border-color .3s ease;
}
.oval.gefunden { border-color: var(--akzent); animation: puls 1.2s ease infinite; }
.oval.erkannt { border-color: var(--gruen); animation: none; }
@keyframes puls { 50% { transform: translate(-50%, -50%) scale(1.03); } }
.status { min-height: 3.2em; color: var(--gedaempft); margin: 0 0 8px; }

/* Formular */
.formular { width: 100%; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.formular label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gedaempft); }
.formular select, .formular input {
  font: inherit; color: var(--tinte); background: var(--karte);
  border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 14px 16px; width: 100%; -webkit-appearance: none; appearance: none; min-height: 52px;
}
.formular select:focus, .formular input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.formular .btn { align-self: center; margin-top: 6px; }
.fehler { color: var(--rot); margin: 0; font-size: 15px; text-align: center; }

/* Einladung */
.kopf { padding-top: 12px; }
.eckdaten { color: var(--gedaempft); margin: 0 0 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; }
.punkt { color: var(--akzent); }
.text { font-family: var(--serif); font-size: 22px; line-height: 1.5; max-width: 32ch; margin: 0 auto 44px; }
.text p { margin: 0 0 16px; }
.text p:first-child { font-size: 30px; font-style: italic; color: var(--akzent-dunkel); }

.video-block { margin: 0 0 40px; width: 100%; }
.video-block video {
  width: 100%; max-height: 75vh; border-radius: var(--radius); background: #000; display: block;
  box-shadow: 0 10px 30px rgba(46, 42, 37, .12);
}

.trenner { width: 100%; display: flex; align-items: center; gap: 14px; color: var(--akzent); margin: 8px 0 32px; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }
.spiel { width: 100%; display: flex; flex-direction: column; align-items: center; }

.fortschritt { width: 100%; margin: 4px 0 20px; }
.balken { height: 6px; border-radius: 6px; background: var(--linie); overflow: hidden; }
#balken-fill { height: 100%; width: 0; background: var(--akzent); transition: width .6s ease; }
#fortschritt-text { font-size: 14px; color: var(--gedaempft); margin: 8px 0 0; }

.galerie { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kachel {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 18px 16px; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .15s ease, border-color .2s ease;
}
.kachel:active { transform: scale(.97); }
.kachel .name { font-family: var(--serif); font-size: 23px; line-height: 1.15; }
.kachel .zustand { font-size: 13px; color: var(--gedaempft); display: flex; align-items: center; gap: 6px; }
.kachel.frei { border-color: var(--akzent); }
.kachel.frei .zustand { color: var(--akzent-dunkel); }

.fuss { margin-top: 48px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(46, 42, 37, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10;
  animation: einblenden .2s ease both;
}
@keyframes einblenden { from { opacity: 0; } }
.modal-karte {
  position: relative; background: var(--papier); border-radius: 20px; width: 100%; max-width: 460px;
  max-height: calc(100svh - 32px); overflow-y: auto; padding: 36px 22px 26px; text-align: center;
  animation: rein .3s ease both;
}
.schliessen {
  position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 30px;
  color: var(--gedaempft); cursor: pointer; width: 44px; height: 44px; line-height: 1;
}
.modal .display.klein { font-size: 30px; margin-bottom: 12px; }
.modal video { width: 100%; max-height: 70vh; border-radius: var(--radius); background: #000; display: block; margin-top: 8px; }

.frage-nr { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--akzent-dunkel); margin: 0 0 8px; }
.frage { font-family: var(--serif); font-size: 26px; line-height: 1.25; margin: 0 0 22px; }
.antworten { display: flex; flex-direction: column; gap: 10px; }
.antwort {
  font: inherit; color: inherit; cursor: pointer; text-align: left;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 15px 18px; min-height: 54px; transition: background .2s ease, border-color .2s ease;
}
.antwort:disabled { cursor: default; }
.antwort.richtig { background: #e6eee3; border-color: var(--gruen); }
.antwort.falsch { background: #f4e2de; border-color: var(--rot); }
.rueckmeldung { min-height: 1.6em; margin: 16px 0 0; color: var(--gedaempft); }
.punkte { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.punkte span { width: 9px; height: 9px; border-radius: 50%; background: var(--linie); }
.punkte span.ok { background: var(--gruen); }
.punkte span.jetzt { background: var(--akzent); }
.modal .btn.primary { margin-top: 18px; }

/* Ablauf */
.ablauf { width: 100%; margin: 0 0 44px; text-align: left; }
.ablauf > .kicker { text-align: center; margin-bottom: 18px; }
.tag { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; }
.tag-titel { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 0 0 8px; }
.tag ul { list-style: none; margin: 0; padding: 0; }
.tag li { display: flex; gap: 14px; padding: 6px 0; border-top: 1px solid var(--linie); }
.tag li:first-child { border-top: 0; }
.zeit { flex: 0 0 64px; color: var(--akzent-dunkel); font-weight: 500; font-size: 15px; padding-top: 1px; }
.was { display: flex; flex-direction: column; line-height: 1.35; }
.was strong { font-weight: 500; }
.was small { color: var(--gedaempft); font-size: 14px; }
.hinweis { font-size: 14px; color: var(--gedaempft); margin: 14px 4px 0; text-align: center; }

.video-text { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.35; margin: 0 auto 16px; max-width: 30ch; text-align: center; }
.video-text:empty { display: none; }
.modal .video-text { font-size: 20px; margin-bottom: 12px; }
.debug { font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--gedaempft); background: var(--karte); border: 1px solid var(--linie); border-radius: 8px; padding: 6px 10px; margin: 0 0 8px; }

.titelbild { margin: 0 0 40px; width: 100%; }
.titelbild img { width: 100%; max-height: 78vh; object-fit: cover; object-position: center 30%; border-radius: var(--radius); display: block; box-shadow: 0 10px 30px rgba(46, 42, 37, .12); }

/* Song-Link unter Videos */
.song { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); color: inherit; text-decoration: none; text-align: left; }
.song:active { transform: scale(.99); }
.song .note { flex: 0 0 34px; height: 34px; border-radius: 50%; background: #1db954; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.song-info { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.song-info strong { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-info small { color: var(--gedaempft); font-size: 13px; }
.song .spotify { font-size: 12px; color: var(--akzent-dunkel); white-space: nowrap; }

/* Video speichern */
.download { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 14px; font-size: 14px; color: var(--gedaempft); text-decoration: none; border: 1px solid var(--linie); border-radius: 999px; background: transparent; }
.download:active { transform: scale(.97); }
/* Kalender-Symbol */
.kal { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: 6px; color: var(--akzent-dunkel); border-radius: 50%; vertical-align: middle; }
.kal:hover { background: var(--linie); }

.galerie-titel { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--akzent-dunkel); font-weight: 500; margin: 22px 0 10px; text-align: left; width: 100%; }
.galerie-titel:first-of-type { margin-top: 4px; }
.galerie + .galerie-titel { margin-top: 26px; }
/* Titelbild kleiner */
.titelbild { max-width: 340px; margin-left: auto; margin-right: auto; }
.titelbild img { max-height: 52vh; }
.tag li .was { flex: 1; }
.tag li .kal { flex: 0 0 30px; margin: -2px 0 0 4px; align-self: center; }

/* Wetter */
.wetter { margin: 16px 0 0; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; text-align: center; }
.wetter-titel { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--akzent-dunkel); font-weight: 500; margin: 0 0 8px; }
.wetter-info { margin: 0; color: var(--gedaempft); font-size: 14px; }
.wetter-tage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wetter-tag { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wt-tag { font-weight: 500; font-size: 14px; }
.wt-sym { font-size: 26px; line-height: 1.2; }
.wt-temp { font-size: 16px; font-weight: 500; }
.wt-temp small { color: var(--gedaempft); font-weight: 400; font-size: 13px; }
.wt-extra { font-size: 11px; color: var(--gedaempft); }
.geduld { margin: 0 0 10px; }

/* Kontaktkarten im Popup */
.kontakte { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin: 4px 0 18px; }
.kontakt { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; }
.profil { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--linie); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 28px; color: var(--akzent-dunkel); box-shadow: 0 2px 8px rgba(46, 42, 37, .12); }
.profil img { width: 100%; height: 100%; object-fit: cover; }
.k-name { font-size: 13px; line-height: 1.25; text-align: center; }
.k-speichern { font-size: 12px; color: var(--akzent-dunkel); text-decoration: none; border: 1px solid var(--linie); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
