/* ============================================================================
   WM-App — Express-Tipp-Wizard Styles
   ----------------------------------------------------------------------------
   Namespace: .wiz-*
   - Alle Maße über Tokens (var(--fs-*), var(--space-*), var(--tap-min)) →
     Comfort-Mode skaliert automatisch.
   - Frosted-Glass-Card analog .tip-pop, aber als Inline-Card (kein Overlay).
   - Mobile-First: 360px-Viewport muss die Match-Karte tragen können.
   ============================================================================ */

/* ── Card-Container ────────────────────────────────────────────────────────── */
.wiz-card {
  background: linear-gradient(
    180deg,
    rgba(227, 165, 5, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(227, 165, 5, 0.18);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: var(--space-5) var(--space-4) var(--space-4);
  max-width: 560px;
  margin: var(--space-4) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: wizFadeIn 0.25s ease forwards;
}
@keyframes wizFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress-Indicator ───────────────────────────────────────────────────── */
.wiz-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.wiz-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.wiz-progress-fill {
  height: 100%;
  background: var(--c-gold);
  border-radius: var(--r-pill);
  transition: width 0.35s ease;
  box-shadow: 0 0 8px var(--c-gold-glow);
}
.wiz-progress-text {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-align: center;
}

/* ── Step-Frame: Flex column. Alles wird auf einer einzigen Mittelachse
   ausgerichtet, die deckungsgleich mit dem Baelz-Logo / Doppelpunkt liegt.
   Reihenfolge: Statusbar oben (full-width), darunter horizontale Action-Reihe
   (Gap zentriert auf der Achse), darunter Step-Body. */
.wiz-match-frame {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 560px;
  margin: 0 auto;
  /* Keine fixed-height — der Frame sized sich am Inhalt aus. Die einzige
     potenziell hohe Komponente, die Optionsliste, kappt sich selbst per
     `max-height` (siehe .wiz-options). So kann die Seite nicht aufplatzen. */
  animation: wizFadeIn 0.25s ease forwards;
}
.wiz-match-frame > .wiz-progress-bar-bare {
  margin: 0 var(--space-1);
}
.wiz-step-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: flex-start;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  order: 2;
}
.wiz-icon-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.wiz-icon-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.wiz-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.wiz-icon-btn-primary {
  background: var(--c-gold);
  color: #111;
  box-shadow: var(--shadow-gold);
}
.wiz-icon-btn-primary:hover:not(:disabled) {
  background: var(--c-gold-light);
}
.wiz-icon-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--c-text-2);
  border-color: var(--c-border);
}
.wiz-icon-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-text);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ── Stage + Datum-Zeile (Match) ──────────────────────────────────────────── */
.wiz-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.wiz-stage-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--c-gold);
  background: var(--c-gold-soft);
  border: 1px solid var(--c-gold-border);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.wiz-stage-date {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--c-text-2);
}

/* ── Match-Layout (Flagge | Score | Flagge) ───────────────────────────────── */
.wiz-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}
.wiz-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.wiz-flag {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.wiz-flag-blank {
  background: rgba(255, 255, 255, 0.04);
}
.wiz-team {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-lg);
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  text-align: center;
  line-height: var(--lh-tight);
  word-break: break-word;
  hyphens: auto;
}

/* ── Score-Inputs ─────────────────────────────────────────────────────────── */
.wiz-score {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.wiz-score-input {
  width: 64px;
  height: 80px;
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 900;
  text-align: center;
  /* Frosted-Panel-Standard: gleicher Look wie .match-row / Wizard-Karten. */
  background: linear-gradient(180deg, rgba(227,165,5,.06) 0%, rgba(255,255,255,.02) 100%);
  border: 1px solid rgba(227,165,5,.18);
  border-radius: var(--r-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--c-text);
  padding: 0;
  -moz-appearance: textfield;
  transition: border-color 0.18s ease, background 0.18s ease,
    box-shadow 0.18s ease;
}
.wiz-score-input::-webkit-outer-spin-button,
.wiz-score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wiz-score-input:focus {
  outline: none;
  border-color: var(--c-gold);
  background: linear-gradient(180deg, rgba(227,165,5,.14) 0%, rgba(227,165,5,.04) 100%);
  box-shadow: var(--focus-glow);
}
.wiz-score-colon {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-2xl);
  color: var(--c-gold);
}

/* ── Frage-Headline (Bonus + GW) ──────────────────────────────────────────── */
.wiz-question {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-2xl);
  color: var(--c-text);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  line-height: var(--lh-tight);
  padding: 0;
  flex-shrink: 0;
}

/* ── Vertikale Optionsliste (Top-Scorer / Tournament-Winner)
   Frei stehende Einträge ohne Hintergrund, scrollbar mit Fade-Maske oben/unten. */
.wiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Harter Cap direkt am Element — keine Abhängigkeit von Flex- oder
     Grid-Sizing der Eltern. Reserve = .hdr (~80–100) + .page-Padding
     (15–24+90=105–114) + .bulk-tip-header (~50–60) + Progressbar+Gap (~12)
     + Action-Row (~44+12) + Frage-Headline (~50–70) + Mask-Fade+Sicherheit
     (~80) ≈ 540 px. Endet komfortabel über dem Footer, auch im Comfort-Mode. */
  max-height: calc(100vh - 540px);
  max-height: calc(100dvh - 540px);
  padding: var(--space-3) 0;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black 28px,
    black calc(100% - 28px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black 28px,
    black calc(100% - 28px),
    transparent 100%
  );
}
.wiz-option {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: var(--space-2) var(--space-3);
  min-height: var(--tap-min);
  text-align: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.wiz-option:hover {
  color: var(--c-text-2);
}
.wiz-option.is-selected {
  color: var(--c-gold);
  border-color: var(--c-gold);
  font-weight: 800;
}

/* Bestätigen + Skip horizontal nebeneinander; der Gap zwischen ihnen liegt
   exakt auf der Mittelachse (= Doppelpunkt = Baelz-Logo). Damit ist die
   Action-Reihe in jedem Step (Match, Bonus, GW) gleich positioniert und
   visuell mit dem Score-Doppelpunkt verbunden.
   Order: direkt unter der Statusbar — fixe Y-Position über alle Step-Typen. */
.wiz-row-actions {
  display: flex;
  flex-direction: row;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  order: 1;
}

/* ── 2×2-Kachelraster für Gruppensieger ───────────────────────────────────── */
.wiz-gw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.wiz-gw-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  cursor: pointer;
  min-height: var(--tap-min);
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.wiz-gw-tile:hover {
  border-color: rgba(255, 255, 255, 0.20);
}
.wiz-gw-tile.is-selected {
  border-color: var(--c-gold);
}
.wiz-gw-flag {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.wiz-gw-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-base);
  color: var(--c-text);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  line-height: var(--lh-tight);
  word-break: break-word;
}
.wiz-gw-tile.is-selected .wiz-gw-name {
  color: var(--c-gold);
}

/* ── Actions (Primary + Ghost) ────────────────────────────────────────────── */
.wiz-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
}
.wiz-btn {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-base);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
}
.wiz-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.wiz-btn-primary {
  background: var(--c-gold);
  color: #111;
  box-shadow: var(--shadow-gold);
}
.wiz-btn-primary:hover:not(:disabled) {
  background: var(--c-gold-light);
}
.wiz-btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border-color: var(--c-border);
}
.wiz-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-text);
}

/* ── Done-Card (Abschluss) ────────────────────────────────────────────────── */
.wiz-done {
  align-items: center;
  text-align: center;
  padding: var(--space-7) var(--space-5);
}
.wiz-done-logo {
  width: 180px;
  max-width: 60%;
  height: auto;
  margin: var(--space-2) auto var(--space-4);
  filter: drop-shadow(0 8px 24px rgba(227, 165, 5, 0.15));
}
.wiz-done-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-2xl);
  color: var(--c-gold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  line-height: var(--lh-tight);
}
.wiz-done-text {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  color: var(--c-text-2);
  margin-top: var(--space-2);
}
.wiz-done-btn {
  margin-top: var(--space-5);
  align-self: center;
  width: 240px;
  max-width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .wiz-match {
    gap: var(--space-2);
  }
  .wiz-flag {
    width: 78px;
    height: 52px;
  }
  .wiz-team {
    font-size: var(--fs-base);
  }
  .wiz-score-input {
    width: 52px;
    height: 68px;
    font-size: var(--fs-2xl);
  }
  .wiz-gw-flag {
    width: 60px;
    height: 40px;
  }
}

@media (min-width: 600px) {
  .wiz-actions {
    flex-direction: row-reverse;
    justify-content: stretch;
  }
  .wiz-actions .wiz-btn {
    flex: 1;
  }
  .wiz-flag {
    width: 120px;
    height: 80px;
  }
  .wiz-score-input {
    width: 80px;
    height: 96px;
  }
}
