/* Bottom-Sheet (Detail-Drawer, NOO-121 ff.) — Maße/Radien aus dem Design-Prototyp */

/* Verdunkler und Panel hängen an derselben Feder (sheet.js): --scrim wird pro
   Frame gesetzt, damit die Verdunklung dem Finger 1:1 folgt statt erst beim
   Loslassen zu schalten. Deshalb hier bewusst keine transition/animation. */
#sheet-backdrop {
  position: fixed; inset: 0;
  background: rgb(0 0 0 / calc(.42 * var(--scrim, 1)));
  z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
#sheet-backdrop[hidden] { display: none; }

.sheet-panel {
  background: var(--card);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 20px 20px 0 0;
  padding: 0 18px calc(26px + env(safe-area-inset-bottom));
  will-change: transform;
}

/* Garantierte Ziehflächen: hier gewinnt die Geste immer gegen das Scrollen.
   Im Inhalt übernimmt sie erst, wenn oben angekommen ist (siehe sheet.js). */
.sheet-grabber, .sheet-header { touch-action: none; }

.sheet-grabber {
  width: 36px; height: 5px; border-radius: 3px;
  background: var(--sep);
  margin: 10px auto 12px;
  cursor: grab;
}
.sheet-panel:active .sheet-grabber { cursor: grabbing; }
.sheet-header {
  position: sticky; top: 0; background: var(--card);
  padding: 0 0 10px; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.sheet-badge {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--sheet-color, var(--acc));
  margin-bottom: 2px;
}
.sheet-header-text h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sheet-date { font-size: 12px; color: var(--sec); }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fill); border: none; color: var(--sec);
  display: grid; place-items: center; flex-shrink: 0;
}

.sheet-meta { font-size: 13px; color: var(--sec); margin: 0 0 10px; }
.sheet-hint { font-size: 12px; color: var(--sec); margin-bottom: 8px; }
.sheet-centered-hint { text-align: center; padding: 30px 20px; color: var(--sec); font-size: 14px; }

/* ── Tabs (Segmented Control) ────────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 2px; overflow-x: auto;
  background: var(--fill); border-radius: 9px; padding: 2px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  border: none; background: transparent; border-radius: 7px;
  padding: 7px 4px; font-size: 13px; font-weight: 600; color: var(--sec);
  white-space: nowrap;
}
.tab-btn.active { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); color: var(--fg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Score-Header (Fußball/Handball) ─────────────────────────────────────── */
.score-header {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; padding: 10px 0 16px;
}
.score-header .team { flex: 1; font-size: 16px; font-weight: 600; }
.score-header .team-a { text-align: right; }
.score-header .center { text-align: center; }
.score-header .score { font-size: 34px; font-weight: 800; letter-spacing: -.024em; line-height: 1.08; }
.score-header .status { font-size: 11px; font-weight: 700; color: var(--sec); }
.score-header .status.live { color: var(--bad); }

/* ── Spielverlauf-Timeline ─────────────────────────────────────────────────── */
.evt-line { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--sep); }
.evt-line .min { width: 32px; font-size: 13px; text-align: right; color: var(--sec); flex-shrink: 0; }
.evt-line .icon { width: 20px; height: 20px; display: grid; place-items: center; flex-shrink: 0; background: var(--fill); border-radius: 50%; font-size: 10px; }
.evt-line .icon.card-yellow { background: #ffd60a; border-radius: 3px; }
.evt-line .icon.card-red { background: var(--bad); border-radius: 3px; }
.evt-line .text { flex: 1; font-size: 14px; min-width: 0; }
.evt-line .text .main { font-weight: 600; }
.evt-line .text .sub { color: var(--sec); }
.evt-line .evt-score { font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* ── Formkurve (FORM · LETZTE 5 SPIELE, Prototyp) ──────────────────────────── */
.form-label { font-size: 13px; font-weight: 600; color: var(--sec); letter-spacing: .05em; margin: 20px 0 8px; }
.form-row { padding: 10px 0; border-bottom: 1px solid var(--sep); }
.form-row .head { display: flex; align-items: center; justify-content: space-between; }
.form-row .team { font-size: 14px; font-weight: 600; }
.form-row .chips { display: flex; gap: 4px; }
.form-chip {
  width: 22px; height: 22px; border-radius: 50%; color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.form-chip.win { background: var(--good); }
.form-chip.draw { background: #8e8e93; }
.form-chip.loss { background: var(--bad); }
.form-row .last { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.form-row .last span { font-size: 12px; color: var(--sec); }

/* ── Kategorie-Chips (Turnier/Liga-Tab) ────────────────────────────────────── */
.cat-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; }
.cat-chip {
  flex-shrink: 0; border: none; border-radius: 16px; padding: 7px 13px;
  font-size: 13px; font-weight: 600; background: var(--fill); color: var(--fg);
  white-space: nowrap;
}
.cat-chip.active { background: var(--acc); color: #fff; }
.cat-panel { display: none; }
.cat-panel.active { display: block; }

/* ── Ranking-Grid (# / Name / Sub / Wert) ──────────────────────────────────── */
.rank-grid {
  display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 2px 10px; align-items: center;
  font-variant-numeric: tabular-nums;
}
.rank-grid .rg-head {
  font-size: 11px; font-weight: 600; color: var(--sec);
  padding-bottom: 5px; border-bottom: 1px solid var(--sep);
}
.rank-grid .num { text-align: right; }
.rank-grid .rg-rank { font-size: 13px; font-weight: 700; color: var(--sec); padding: 5px 0; }
.rank-grid .rg-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 0; }
.rank-grid .rg-sub { font-size: 12px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 0; }
.rank-grid .rg-val { font-size: 13px; font-weight: 700; padding: 5px 0; white-space: nowrap; }
.rg-muted { color: var(--sec); font-weight: 400; }
.rg-highlight { color: var(--acc); }

.back-link {
  border: none; background: none; color: var(--acc);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 2px;
  padding: 2px 0 10px;
}

/* ── PUBG-Rangliste + Spieler-Detail ───────────────────────────────────────── */
.pubg-grid-head, .pubg-grid-row {
  display: grid; grid-template-columns: 22px 1fr 44px 40px 44px 40px 58px;
  gap: 4px; align-items: center;
  padding: 11px 2px; border-bottom: 1px solid var(--sep);
  font-variant-numeric: tabular-nums; font-size: 14px;
}
.pubg-grid-head { color: var(--sec); font-weight: 600; font-size: 11px; padding: 0 2px 6px; }
.pubg-grid-head .num, .pubg-grid-row .num { text-align: right; }
.pubg-grid-row { cursor: pointer; }
.pubg-grid-row .rank { color: var(--sec); font-weight: 700; }
.pubg-grid-row.rank-1 .rank { color: var(--mod-pubg); }
.pubg-grid-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pubg-grid-row .kills { font-weight: 600; }
.pubg-grid-row .sec { color: var(--sec); }
.pubg-player-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.kpi-tile { background: var(--fill); border-radius: 12px; padding: 12px 10px; }
.kpi-tile .value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.kpi-tile .label { font-size: 11px; color: var(--sec); margin-top: 2px; }

.locked-state { text-align: center; padding: 36px 20px; color: var(--sec); }
.locked-state svg { width: 28px; height: 28px; margin-bottom: 10px; }
.locked-state .title { font-size: 14px; font-weight: 600; }
.locked-state .sub { font-size: 13px; margin-top: 4px; line-height: 1.5; }

/* ── ICS-Export-Button (sticky footer) ────────────────────────────────────── */
.sheet-footer {
  position: sticky; bottom: 0;
  background: linear-gradient(to top, var(--card) 70%, transparent);
  padding: 18px 0 2px; margin-top: 14px;
}
.export-btn {
  width: 100%; height: 50px; border-radius: 14px; border: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600;
  background: var(--export-bg, var(--acc));
  color: var(--export-fg, #fff);
}
.export-btn svg { width: 18px; height: 18px; }

/* ── Quiz-Sheet ────────────────────────────────────────────────────────────── */
.quiz-hint { font-size: 12px; font-weight: 600; color: var(--sec); margin: 2px 0 6px; }
.quiz-question { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 14px; }
#quiz-answers { display: flex; flex-direction: column; gap: 8px; }
.quiz-answer {
  display: block; width: 100%; text-align: left;
  border: 1.5px solid var(--sep); border-radius: 12px; padding: 12px 14px;
  background: transparent; color: var(--fg); font-size: 15px; font-weight: 500;
  /* Farbwechsel (richtig/falsch) darf ruhig laufen, das Druckfeedback muss
     sofort kommen — deshalb beide Eigenschaften getrennt getaktet. */
  transition: transform var(--press-out), background-color var(--press-out), border-color 150ms ease-out;
}
.quiz-answer.correct { border-color: var(--good); background: rgba(48, 209, 88, .12); color: var(--good); }
.quiz-answer.wrong { border-color: var(--bad); background: rgba(255, 69, 58, .10); color: var(--bad); }
.quiz-next {
  width: 100%; margin-top: 14px; height: 44px;
  border: none; border-radius: 12px;
  background: var(--acc); color: #fff; font-size: 15px; font-weight: 600;
}
.quiz-done { text-align: center; padding: 30px 20px; }
.quiz-done .check-circle {
  width: 52px; height: 52px; border-radius: 50%; background: var(--good);
  color: #fff; display: grid; place-items: center; margin: 0 auto 12px;
}
.quiz-done .title { font-size: 17px; font-weight: 700; }
.quiz-done .sub { font-size: 14px; color: var(--sec); margin-top: 4px; }
