/* ------------------------------------------------------------ Farben */
:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --card: #ffffff;
  --card-2: #f0efec;
  --card-3: #e6e5e1;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7d7c77;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #c2550c;
  --accent-strong: #9a3f08;
  --accent-ink: #ffffff;
  --accent-soft: rgba(194, 85, 12, 0.12);
  --home: #0f766e;
  --home-soft: rgba(15, 118, 110, 0.12);
  --vb: #6d5bd0;
  --vb-soft: rgba(109, 91, 208, 0.12);
  --spiel: #b91c1c;
  --spiel-soft: rgba(185, 28, 28, 0.1);
  --ok: #15803d;
  --danger: #c22f2f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-up: 0 -1px 0 rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.12);
  --backdrop: rgba(10, 10, 10, 0.38);
  --radius: 20px;
  --radius-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f0f0e;
    --card: #1a1a19;
    --card-2: #252523;
    --card-3: #31312e;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #8f8e86;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #f08a3e;
    --accent-strong: #f6a265;
    --accent-ink: #1a1a19;
    --accent-soft: rgba(240, 138, 62, 0.16);
    --home: #2dd4bf;
    --home-soft: rgba(45, 212, 191, 0.14);
    --vb: #a594f9;
    --vb-soft: rgba(165, 148, 249, 0.16);
    --spiel: #f87171;
    --spiel-soft: rgba(248, 113, 113, 0.14);
    --ok: #4cc46a;
    --danger: #ef7272;
    --shadow: none;
    --shadow-up: 0 -1px 0 rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(0, 0, 0, 0.6);
  }
}

/* ------------------------------------------------------------ Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.warn { color: var(--danger); }
code { font-size: 0.92em; background: var(--card-2); padding: 1px 5px; border-radius: 6px; }
svg { display: block; }
[hidden] { display: none !important; }
h1 { font-size: 28px; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 22px; margin: 4px 0 2px; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 0 0 4px; }
p { margin: 4px 0; }

.view {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 170px);
  outline: none;
}
.boot { padding: 40px 0; text-align: center; color: var(--text-3); }
.top { margin: 4px 4px 14px; }
.top .bar { margin-top: 10px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card.slim { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hero.home .kicker { color: var(--home); }
.hero .btn.big { margin-top: 12px; }
.hero .btn.ghost { margin-top: 8px; width: 100%; }
.note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }

/* ------------------------------------------------------------ Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 18px; border-radius: 14px;
  background: var(--card-2); font-weight: 600;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
.btn.big { width: 100%; min-height: 54px; font-size: 17px; }
.btn.wide { width: 100%; margin-top: 8px; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.link.danger { color: var(--danger); }
.link.on { color: var(--danger); }
.icon { width: 44px; height: 44px; border-radius: 12px; font-size: 26px; line-height: 1; color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--card-2); font-size: 15px; font-weight: 600; color: var(--text-2);
}
.chip.rec { box-shadow: inset 0 0 0 2px var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 14px; }
.flags .chip { min-height: 34px; font-size: 14px; }

/* ------------------------------------------------------------ Woche */
.weekhead { display: flex; align-items: center; justify-content: space-between; margin: -4px -4px 8px; }
.wk { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.wk span { font-size: 13px; color: var(--text-3); }
.week { display: flex; flex-direction: column; }
.day { display: flex; gap: 12px; padding: 9px 6px; border-top: 1px solid var(--line); align-items: flex-start; }
.day:first-child { border-top: 0; }
.day.today { background: var(--accent-soft); border-radius: 12px; border-color: transparent; }
.day.today + .day { border-color: transparent; }
.dn { width: 72px; flex: none; font-weight: 600; font-size: 14px; padding-top: 3px; }
.di { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.it { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.it small { color: var(--text-3); font-size: 13px; width: 100%; }
.it .muted { font-size: 14px; padding-top: 3px; }
.ok { color: var(--ok); font-weight: 700; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.pill.home { background: var(--home-soft); color: var(--home); }
.pill.vb { background: var(--vb-soft); color: var(--vb); }
.pill.spiel { background: var(--spiel-soft); color: var(--spiel); }
.pill.opt { opacity: 0.65; }

/* ------------------------------------------------------------ Einheit */
.bar { height: 6px; border-radius: 3px; background: var(--card-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.warm summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.warm summary::-webkit-details-marker { display: none; }
.warm ul { margin: 10px 0 0; padding-left: 20px; }
.warm li { margin: 4px 0; font-size: 15px; }

.item.done { opacity: 0.72; }
.item.ss-a { margin-bottom: 4px; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.item.ss-b { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.ihead { display: flex; gap: 12px; align-items: flex-start; }
.lbl { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--text-2); }
.ihead h3 { margin: 2px 0 0; }
.ihead p { font-size: 14px; margin: 2px 0 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--card-2); color: var(--text-2); margin: 8px 0 0; }
.badge.alt { background: var(--accent-soft); color: var(--accent); margin: 0 0 0 4px; vertical-align: middle; }
.hint { font-size: 14px; color: var(--text-2); margin: 8px 0 0; }
.sug { font-size: 14px; color: var(--text-2); margin: 12px 0 0; }
.ramp { font-size: 14px; color: var(--text-2); background: var(--card-2); border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.weight .stepper { margin-top: 4px; }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; background: var(--card-2); font-size: 22px; font-weight: 600; }
.stepper span { min-width: 92px; text-align: center; font-size: 17px; }
.stepper.sm button { width: 40px; height: 40px; font-size: 20px; }
.stepper.sm span { min-width: 74px; font-size: 16px; }

.sets { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.set { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.sn { width: 22px; text-align: center; font-weight: 700; color: var(--text-3); }
.set .muted { flex: 1; text-align: right; font-size: 14px; }
.check {
  margin-left: auto; flex: none; width: 52px; height: 44px; border-radius: 12px;
  background: var(--card-2); color: var(--text-3); font-size: 22px; font-weight: 700;
}
.set.done .check { background: var(--ok); color: #fff; }
.set .muted + .check { margin-left: 0; }

.ladders { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.ladder { display: flex; align-items: center; gap: 8px; }
.ladder .muted { width: 64px; font-size: 14px; }
.rung { width: 52px; height: 46px; border-radius: 12px; background: var(--card-2); font-size: 18px; font-weight: 700; color: var(--text-2); }
.rung.done { background: var(--home); color: #fff; }

.feel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.finish { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }

/* ------------------------------------------------------------ Verlauf und Mehr */
.log .logrow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.log .logrow:first-of-type { margin-top: 8px; }
.log .logrow span:last-child { text-align: right; color: var(--text-2); }
.games { display: flex; flex-direction: column; margin-top: 8px; }
.game { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.game input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.game small { display: block; color: var(--text-3); font-size: 13px; }
.game.past { opacity: 0.5; }

/* ------------------------------------------------------------ Pausentimer */
.timer {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 78px);
  width: min(568px, calc(100% - 24px));
  background: var(--card); box-shadow: var(--shadow-up); border-radius: 18px;
  padding: 10px 12px 10px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; z-index: 20;
}
.timer .tl { display: flex; flex-direction: column; line-height: 1.15; }
.timer .tl b { font-size: 30px; }
.timer .tb { display: flex; gap: 6px; }
.timer .tb button { min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--card-2); font-weight: 600; }
.timer .tb button:last-child { background: var(--accent); color: var(--accent-ink); }
.timer .bar { grid-column: 1 / -1; height: 4px; }

/* ------------------------------------------------------------ Navigation */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 12px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--card); box-shadow: var(--shadow-up);
}
.tab { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab circle { fill: currentColor; stroke: none; }
.tab.on { color: var(--accent); }
.tab[hidden] { display: none; }

/* ------------------------------------------------------------ Dialoge und Hinweise */
dialog { border: 0; padding: 0; color: var(--text); background: var(--card); }
dialog::backdrop { background: var(--backdrop); }
.sheet { width: 100%; max-width: 600px; margin: auto auto 0; border-radius: 22px 22px 0 0; max-height: 85vh; }
.sheet-body { padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); text-align: left; }
.option.on { box-shadow: inset 0 0 0 2px var(--accent); }
.option .muted { font-size: 14px; }
.modal { border-radius: 20px; padding: 18px; width: min(420px, calc(100% - 32px)); }
.modal p { margin: 0 0 16px; }
.toasts { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 15px; max-width: calc(100% - 32px); box-shadow: var(--shadow-up); }
.toast button { color: var(--accent-strong); font-weight: 700; }
