/* Avantgarde CI: Lato, AVA Blue #2457F6, Grau #EEEEEE, Dunkelblau #002A43, Türkis #0AF3DB */
@font-face { font-family: 'Lato'; font-weight: 300; src: url('assets/fonts/Lato-Light.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Lato'; font-weight: 400; src: url('assets/fonts/Lato-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Lato'; font-weight: 700; src: url('assets/fonts/Lato-Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Lato'; font-weight: 900; src: url('assets/fonts/Lato-Black.ttf') format('truetype'); font-display: swap; }

:root {
  --blau: #2457F6; --blau-dunkel: #1a44c7; --nacht: #002A43; --nacht-tief: #00182a;
  --grau: #EEEEEE; --tuerkis: #0AF3DB; --text: #111; --text-hell: #c9d6e3;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: 'Lato', Arial, sans-serif; font-weight: 300; color: var(--text); background: #fff; line-height: 1.55; font-size: 17px; }
h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: 1.15rem; }
.blau { color: var(--blau); }
.kopf .blau { color: #6f93ff; }
.klein { font-size: .9rem; color: #555; }
.hinweis-suche { min-height: 1.3em; margin-top: -.3rem; color: var(--blau); font-weight: 600; }
.hell { color: var(--text-hell); }
a { color: var(--blau); }
[hidden] { display: none !important; }

/* Kopf */
.kopf { background: radial-gradient(1200px 600px at 75% 40%, #0b3b63 0%, var(--nacht) 45%, var(--nacht-tief) 100%); color: #fff; overflow: hidden; }
.kopf-leiste { max-width: 1120px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; gap: 10px; }
.marke { height: 20px; width: auto; }
.marke-zusatz { color: var(--tuerkis); font-weight: 700; letter-spacing: .04em; font-size: .9rem; }
.kopf-inhalt { max-width: 1120px; margin: 0 auto; padding: 10px 20px 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; }
.kopf-text .unterzeile { color: var(--text-hell); font-size: 1.15rem; max-width: 34em; }
.dachzeile { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--tuerkis); font-weight: 700; margin: 0 0 .8em; }
.kopf-wuerfel { aspect-ratio: 1; width: 100%; max-width: 460px; justify-self: center; }
@media (max-width: 760px) {
  .kopf-inhalt { grid-template-columns: 1fr; padding-bottom: 32px; }
  .kopf-wuerfel { order: -1; max-width: 300px; }
}

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .5em; background: var(--blau); color: #fff; border: 0; border-radius: 999px; padding: .8em 1.4em; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s, transform .15s; min-height: 48px; }
.knopf:hover { background: var(--blau-dunkel); }
.knopf:active { transform: scale(.98); }
.knopf.zweit { background: #fff; color: var(--blau); box-shadow: inset 0 0 0 2px var(--blau); }
.knopf.zweit:hover { background: #f1f5ff; }
.knopf.gross { font-size: 1.1rem; padding: .9em 1.8em; }
.knopf:disabled { opacity: .5; cursor: default; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.knopfreihe.mitte { justify-content: center; }

/* Schritte */
.schritt { background: var(--grau); padding: 40px 0; }
.rahmen { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.rahmen.mitte { text-align: center; }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 860px) { .zweispaltig { grid-template-columns: 1fr; } .zweispaltig .buehne { order: -1; } }
.schritt-nr { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700; color: var(--blau); margin: 0 0 .4em; }
.buehne { aspect-ratio: 1; width: 100%; max-width: 520px; justify-self: center; background: radial-gradient(circle at 50% 45%, #fff 0%, #e4e8ef 70%); border-radius: 24px; }
.buehne canvas, .kopf-wuerfel canvas { width: 100%; height: 100%; display: block; }

/* Fotokacheln */
.kacheln { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 20px 0 6px; }
@media (max-width: 640px) { .kacheln { grid-template-columns: repeat(3, 1fr); } }
.kachel { position: relative; aspect-ratio: 1; border-radius: var(--radius); background: #fff; border: 2px dashed #b8c2d3; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #8a96a8; font-weight: 700; }
.kachel canvas { width: 100%; height: 100%; object-fit: cover; }
.kachel.voll { border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); cursor: pointer; }
.kachel .etikett { position: absolute; left: 6px; right: 6px; bottom: 6px; background: rgba(0,24,42,.82); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 8px; padding: 3px 6px; text-align: center; }
.kachel .etikett.warn { background: #b42318; }
.kachel .weg { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 26px; cursor: pointer; }
.meldungen { display: grid; gap: 10px; }
.meldung { background: #fff; border-left: 4px solid var(--blau); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.meldung.warn { border-color: #e4572e; }
.meldung img { width: 52px; height: 52px; border-radius: 8px; flex: none; }

/* Ausrichten */
.dialog { position: fixed; inset: 0; background: rgba(0,15,28,.78); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); }
.dialog-inhalt { background: #fff; border-radius: 18px; padding: 16px; width: min(720px, 100%); max-height: 100%; overflow: auto; }
.ausricht-flaeche { position: relative; background: #111; border-radius: 12px; overflow: hidden; touch-action: none; }
.ausricht-flaeche canvas { display: block; width: 100%; height: auto; touch-action: none; }
.vorschau-zeile { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.vorschau-zeile canvas { width: 96px; height: 96px; border-radius: 8px; flex: none; }

/* Haltung */
.haltung { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 10px; }
.haltung li { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 8px 12px 8px 8px; }
.haltung img { width: 48px; height: 48px; border-radius: 8px; flex: none; }
.zugzahl { font-weight: 700; }

/* Anleitung */
.fortschritt { height: 8px; background: #dfe4ec; border-radius: 99px; overflow: hidden; margin: 6px 0 10px; }
.fortschritt div { height: 100%; width: 0; background: linear-gradient(90deg, var(--blau), var(--tuerkis)); transition: width .4s; }
.zaehler { font-weight: 700; color: #555; margin: 0; }
#zugTitel { margin-top: .3em; }
#zugText { font-size: 1.1rem; }

/* Gelöst */
.geloest { position: relative; background: radial-gradient(circle at 50% 30%, #0b3b63, var(--nacht) 60%, var(--nacht-tief)); color: #fff; padding: 72px 0; overflow: hidden; }
.geloest p { color: var(--text-hell); max-width: 40em; margin-left: auto; margin-right: auto; }
.riesig { font-size: clamp(3rem, 12vw, 6rem); font-weight: 900; background: linear-gradient(90deg, #fff, var(--tuerkis)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .7s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#konfetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Story */
.story { padding: 56px 0; }
.karten { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
@media (max-width: 900px) { .karten { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .karten { grid-template-columns: 1fr; } }
.karte { background: var(--grau); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--blau); }
.karte p { margin: 0; }
.story-schluss { font-size: 1.15rem; font-weight: 400; max-width: 46em; }

.fuss { background: var(--nacht-tief); color: var(--text-hell); padding: 24px 20px; text-align: center; font-size: .85rem; }
.fuss a { color: #fff; }

.laden { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: dreh 0.8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Sprache */
.sprache { margin-left: auto; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .85rem; }
.sprache option { color: #111; }

/* Kamera mit Rahmen */
.kamera-dialog { padding: 0; background: #000; }
.kamera-flaeche { position: relative; width: 100%; height: 100%; overflow: hidden; }
.kamera-flaeche video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kamera-rahmen { position: absolute; left: 50%; top: 45%; width: min(72vw, 52vh); aspect-ratio: 1; transform: translate(-50%, -50%); box-shadow: 0 0 0 200vmax rgba(0,10,20,.55); border-radius: 6px; }
.kamera-rahmen::before, .kamera-rahmen::after { content: ''; position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(10,243,219,.7) calc(33.33% - 1px), rgba(10,243,219,.7) calc(33.33% + 1px), transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(10,243,219,.7) calc(66.66% - 1px), rgba(10,243,219,.7) calc(66.66% + 1px), transparent calc(66.66% + 1px)); }
.kamera-rahmen::after { transform: rotate(90deg); }
.kamera-rahmen i { position: absolute; width: 26px; height: 26px; border: 4px solid #0AF3DB; }
.kamera-rahmen i:nth-child(1) { left: -4px; top: -4px; border-right: 0; border-bottom: 0; }
.kamera-rahmen i:nth-child(2) { right: -4px; top: -4px; border-left: 0; border-bottom: 0; }
.kamera-rahmen i:nth-child(3) { right: -4px; bottom: -4px; border-left: 0; border-top: 0; }
.kamera-rahmen i:nth-child(4) { left: -4px; bottom: -4px; border-right: 0; border-top: 0; }
.kamera-text { position: absolute; left: 0; right: 0; top: max(16px, env(safe-area-inset-top)); text-align: center; color: #fff; display: grid; gap: 4px; padding: 0 16px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.kamera-knoepfe { position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; gap: 12px; }
.kamera-knoepfe .knopf { justify-self: start; }
.ausloeser { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: var(--blau); cursor: pointer; }
.ausloeser:active { transform: scale(.94); }
.kamera-zahl { justify-self: end; color: #fff; font-weight: 700; }

.kamera-status { position: absolute; left: 50%; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 92px); transform: translateX(-50%); width: min(560px, calc(100% - 32px)); background: rgba(0,24,42,.86); color: #fff; border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; font-size: .92rem; }
.kamera-status:empty { display: none; }
.kamera-status .ok { color: #0AF3DB; font-weight: 700; }
.kamera-status .fehlend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kamera-status .fehlend img { width: 40px; height: 40px; border-radius: 6px; border: 2px solid rgba(255,255,255,.6); }
.ausloeser:disabled { opacity: .5; }
