/* Wiesn-Jagd – Oktoberfest-Look, mobil zuerst.
   Keine externen Schriften: am Festplatz ist das Netz launisch.

   Gestaltungsregel: Banner, blaue Titelleiste, darunter genau eine Fläche.
   Auf dieser Fläche steht alles direkt auf dem Hintergrund – keine Karten,
   keine Rahmen, keine Trennlinien. Umrandet wird nur, was ohne eigene Kante
   nicht lesbar wäre (die Leaflet-Karte, Bilder, Antwortknöpfe). */

:root {
  --blau: #0b5ca8;
  --blau-hell: #1a72c9;
  --creme: #fdf6e8;
  --papier: #fffcf5;
  /* Dunkle Akzentfarbe (Titelleiste, Überschriften).
     Hieß mal "holz" und war braun – jetzt ein tiefes Bayernblau. */
  --holz: #0d4a7d;
  --holz-dunkel: #142c44;
  --gold: #d9a520;
  --rot: #c8102e;
  --gruen: #2f6b3f;
  --grau: #5d6d7e;
  --radius: 14px;
  --schatten: 0 2px 10px rgba(20, 44, 68, .14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--creme);
  color: var(--holz-dunkel);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Spalte aus Banner und Fläche: die Fläche bekommt die ganze Resthöhe,
   damit der Countdown sie wirklich füllen kann. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* Das hidden-Attribut muss immer gewinnen, auch gegen eigene display-Regeln. */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Banner */

.banner {
  position: relative;
  flex: 0 0 auto;
  background: var(--blau);
}

/* Bayerische Raute als Grundlage – trägt auch, wenn banner.jpeg fehlt.
   Seitenverhältnis statt fester Höhe: so bleibt das Banner auf dem Handy
   vollständig sichtbar und wird erst auf breiten Schirmen leicht beschnitten. */
.banner__img {
  /* width:100% ist Pflicht: mit aspect-ratio würde max-height sonst die
     BREITE auf 628px begrenzen (Größenübertragung durchs Verhältnis). */
  width: 100%;
  min-height: 120px;              /* Rückfall für Browser ohne aspect-ratio */
  aspect-ratio: 1600 / 560;
  max-height: 220px;
  background-color: var(--blau);
  position: relative;
  overflow: hidden;
}

/* Bayerische Raute, schräg wie im Original: das aufrechte Rautenmuster wird
   auf einer übergroßen Ebene endlos gekachelt und die ganze Ebene gedreht –
   so bleibt das Muster perfekt nahtlos. Kachel 22×30 px (blaue Raute auf
   weißer Kachel), der Überstand von 360 px deckt die Drehung bis ca.
   2000 px Banner-Breite ab. */
.banner__img::before {
  content: '';
  position: absolute;
  inset: -360px;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='30'%3E%3Crect width='22' height='30' fill='%23ffffff'/%3E%3Cpath d='M11 0L22 15 11 30 0 15Z' fill='%230b5ca8'/%3E%3C/svg%3E");
  background-size: 22px 30px;
  transform: rotate(-16deg);
}

/* Die Stoffbahn hängt zentriert über dem Muster.
   Wer lieber das Originalfoto möchte: banner.svg durch banner.jpeg ersetzen. */
.banner__img::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("../img/banner.svg") center / auto 100% no-repeat;
}

/* Titelleiste: geht ohne Trennlinie direkt in die Fläche über. */
.banner__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--holz);
  color: var(--creme);
}

.banner__bar h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: .3px;
}

.banner__meta { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

.chip--group { background: var(--gold); color: var(--holz-dunkel); }
.chip--score { background: var(--gruen); color: #fff; }
.chip--round { background: rgba(253, 246, 232, .18); color: var(--creme); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Fläche */

/* Die eine Fläche. Alles Weitere steht direkt darauf. */
.canvas {
  position: relative;              /* Bezug für den Countdown */
  flex: 1 1 auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
}

.screen { display: block; }

/* Schritte, die nur aus Ansage und einem Knopf bestehen, dürfen mittig
   in der Fläche stehen statt oben zu kleben. */
.screen--center {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.screen--center .btn { margin-top: 8px; }

h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--holz);
}

.lead { margin: 0 0 18px; }
.muted { color: var(--grau); }
.small { font-size: .87rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Meldung statt Toast: erscheint in der Fläche und schiebt den Inhalt. */
.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #f7e7bd;
  color: var(--holz-dunkel);
  font-size: .95rem;
}

.notice--bad { background: #f7dde0; color: #8d1122; }

/* ---------------------------------------------------------------- Hinweise */

/* Der Hinweistext ist der Star der Fläche – groß, ohne Kasten drumherum. */
.hint {
  margin: 0 0 18px;
  font-size: 1.2rem;
  line-height: 1.55;
}

.hint--rescue { color: #8d1122; }

/* Bilder bekommen eine Kante, sonst fransen sie in die Fläche aus. */
.figure {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

/* Nebenbemerkung mit Symbol – Zeile, kein Kasten. */
.cue {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  font-size: .95rem;
  color: var(--grau);
}

.cue__icon { font-size: 1.7rem; line-height: 1.1; flex: 0 0 auto; }

.rescue { margin: 22px 0; }

/* Notweg ohne QR-Code */
.manual { margin-top: 22px; text-align: center; }
.manual__form { display: flex; gap: 8px; margin-top: 10px; }
.manual__form input { flex: 1; }
.manual__form .btn { width: auto; white-space: nowrap; }

/* ---------------------------------------------------------------- Karte */

/* Die Karte ist der eine Inhalt, der eine Box braucht. */
.map {
  height: 280px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--schatten);
  overflow: hidden;
}

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

.btn {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn--primary { background: var(--blau); color: #fff; }
.btn--primary:active { background: var(--blau-hell); }
.btn--big { padding: 22px; font-size: 1.3rem; }

.btn--ghost { background: rgba(20, 44, 68, .07); color: var(--holz); }
.btn--ghost:active { background: rgba(20, 44, 68, .14); }

.btn[disabled] { opacity: .5; cursor: default; }

input[type="text"] {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-family: inherit;
  border: 0;
  border-radius: var(--radius);
  background: var(--papier);
  color: inherit;
  box-shadow: inset 0 0 0 2px rgba(20, 44, 68, .12);
}

input[type="text"]:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blau);
}

/* ---------------------------------------------------------------- Frage */

.timer { margin-bottom: 22px; }

/* Großer Countdown fürs Punktefenster – reine Spannung, ohne Konsequenz. */
.timer__count {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: var(--gruen);
  transition: color .3s;
}

.timer__count.is-warn { color: var(--gold); animation: count-pulse 1s ease-in-out infinite; }
.timer__count.is-late { color: var(--rot); }

@keyframes count-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .timer__count.is-warn { animation: none; }
}

.timer__bar {
  height: 10px;
  background: rgba(20, 44, 68, .12);
  border-radius: 999px;
  overflow: hidden;
}

.timer__fill {
  height: 100%;
  width: 100%;
  background: var(--gruen);
  border-radius: 999px;
  transition: width .5s linear, background-color .5s linear;
}

.timer__fill.is-warn { background: var(--gold); }
.timer__fill.is-late { background: var(--rot); }

.timer__labels {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--grau);
  margin-top: 6px;
}

.timer__points { font-weight: 700; color: var(--holz); }

.question {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 20px;
}

.options { display: flex; flex-direction: column; gap: 10px; }

/* Antwortknöpfe brauchen eine sichtbare Fläche, aber keinen Rahmen. */
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: var(--papier);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  color: inherit;
  font-size: 1.05rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.option__letter {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blau);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}

.option.is-wrong {
  background: #f7dde0;
  box-shadow: none;
  color: var(--grau);
  text-decoration: line-through;
  cursor: default;
}

.option.is-wrong .option__letter { background: var(--rot); }

.option.is-right { background: #e2efe5; }
.option.is-right .option__letter { background: var(--gruen); }
.option[disabled] { cursor: default; }

/* ---------------------------------------------------------------- Ergebnis */

.result__icon { font-size: 3.4rem; text-align: center; line-height: 1; margin-bottom: 6px; }

/* Punkteaufstellung: Abstand statt Trennlinien. */
.breakdown {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  text-align: left;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}

.breakdown li:last-child {
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gruen);
}

.breakdown .label { color: var(--grau); }

/* ---------------------------------------------------------------- Abmelden */

.unbind-line { text-align: center; margin: 34px 0 0; }

.unbind-ask {
  display: block;
  font-size: .85rem;
  color: var(--grau);
}

.linklike {
  background: none;
  border: 0;
  color: var(--grau);
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 10px;
}

.linklike--warn { color: var(--rot); font-weight: 600; }
.linklike:active { color: var(--holz); }

/* ---------------------------------------------------------------- Countdown */

/* Zählt ganzseitig in der Fläche, statt als Overlay über allem zu liegen. */
.count {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  background: var(--creme);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.count.is-on { opacity: 1; pointer-events: auto; }

.count__num {
  font-size: 7.5rem;
  font-weight: 800;
  color: var(--blau);
  text-align: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.count__num.is-pop { animation: count-pop 1s ease-out; }
.count__num.is-go { color: var(--gruen); animation: count-pop .6s ease-out; }

.count__label {
  color: var(--grau);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
}

@keyframes count-pop {
  0% { transform: scale(1.5); opacity: .4; }
  35% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .count__num.is-pop, .count__num.is-go { animation: none; }
}

/* ---------------------------------------------------------------- Breit */

@media (min-width: 700px) {
  .canvas { padding: 30px 24px 40px; }
}
