/* Winter Arc – Bausteine: Checkliste, Ring, Raster, Rangliste, Dialoge */

/* ---------- Habit-Symbole ---------- */
.habit-icon {
  --c: var(--orange);
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent);
}
.habit-icon .icon { width: 21px; height: 21px; }
.c-yellow { --c: #f5c451; } .c-green { --c: #4ade80; } .c-teal { --c: #2dd4bf; } .c-orange { --c: #eb9373; }
.c-pink { --c: #f472b6; } .c-cyan { --c: #38bdf8; } .c-purple { --c: #a78bfa; } .c-indigo { --c: #818cf8; }
.c-red { --c: #f87171; } .c-amber { --c: #fbbf24; } .c-violet { --c: #c084fc; } .c-lime { --c: #a3e635; } .c-rose { --c: #fb7185; }

/* ---------- Checkliste ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.habit {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px 12px 12px 14px; transition: border-color 0.2s, background 0.2s;
}
.habit.done { border-color: rgba(217, 119, 87, 0.4); background: linear-gradient(rgba(217, 119, 87, 0.07), rgba(217, 119, 87, 0.07)), var(--card-2); }
.habit.optional:not(.done) { border-style: dashed; }
.habit.has-error { border-color: rgba(248, 113, 113, 0.55); }
.habit-row { display: flex; align-items: center; gap: 12px; }
.habit-main { flex: 1; min-width: 0; }
.habit-name { font-weight: 680; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.habit-hint { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.habit-value { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; font-size: 13px; }
.value-text { color: var(--text-2); font-variant-numeric: tabular-nums; }
.habit-note { font-size: 12.5px; color: var(--blue-2); margin-top: 5px; }
.habit-tags { margin-top: 6px; }
.check {
  width: 50px; height: 50px; flex: none; display: grid; place-items: center;
  border-radius: 15px; border: 2px solid var(--line-2); background: var(--bg-2); color: transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.12s, color 0.18s;
}
.check .icon { width: 26px; height: 26px; stroke-width: 3; }
.check:active:not(:disabled) { transform: scale(0.92); }
.check.on { background: var(--orange); border-color: var(--orange); color: var(--on-orange); animation: check-pop 0.32s ease; }
.check:disabled { opacity: 0.5; }
.habit.saving .check { opacity: 0.65; animation: pulse 1s infinite ease-in-out; }
@keyframes check-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: 0.4; } }
.training-controls { display: grid; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pill-choice {
  height: 36px; padding: 0 12px; border-radius: 999px; background: var(--bg-2);
  border: 1px solid var(--line-2); color: var(--muted); font-size: 13.5px; font-weight: 650;
}
.pill-choice.on { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-2); }
.stepper { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.stepper span { margin-right: auto; }
.stepper strong { min-width: 22px; text-align: center; color: var(--text); font-size: 16px; }
.step { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2); }
.step:disabled { opacity: 0.35; }
.step .icon { width: 18px; height: 18px; }
.value-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.value-editor input { flex: 1 1 120px; width: auto !important; }
.value-editor .unit { color: var(--muted); font-size: 14px; }
.habit-error {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: var(--red-soft); color: #fecaca; font-size: 13px;
}
.chip-error { background: rgba(248, 113, 113, 0.2); border-color: rgba(248, 113, 113, 0.4); color: #fee2e2; }
.row-actions { display: flex; gap: 6px; }
.preview .habit { padding: 10px 12px; }
.joker {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 12px;
  border-radius: 16px; border: 1px dashed var(--line-2); background: var(--bg-2);
}
.joker.on { border: 1px solid rgba(168, 85, 247, 0.55); background: linear-gradient(120deg, rgba(168, 85, 247, 0.2), rgba(91, 157, 255, 0.1)); }
.joker-icon { font-size: 24px; line-height: 1; }
.joker-text { flex: 1; min-width: 0; display: grid; }
.joker-text strong { font-size: 14.5px; }
.joker-text span { font-size: 12.5px; color: var(--muted); }
.joker-used { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.goals li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid transparent; }
.goals li.me { border-color: var(--orange); }
.goal-text { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.goal-text strong { font-size: 14.5px; }
.goal-text em { font-style: normal; font-size: 11px; color: var(--orange-2); background: var(--orange-soft); padding: 2px 7px; border-radius: 999px; }
.goal-text b { color: var(--muted); font-weight: 600; }

/* ---------- Hero, Ring, Balken ---------- */
.hero-title { font-size: 24px; font-weight: 850; margin-bottom: 4px; }
.hero-top { margin-bottom: 16px; }
.hero-body { display: flex; align-items: center; gap: 16px; }
.hero-stats { flex: 1; min-width: 0; display: grid; gap: 6px; }
.hero-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; background: var(--card-2); border-radius: 14px; padding: 8px 12px; min-width: 0; }
.hero-stats strong { font-size: 18px; font-weight: 850; font-variant-numeric: tabular-nums; order: 2; }
.hero-stats span { font-size: 12.5px; color: var(--muted); }
.hero .ring { width: 108px !important; height: 108px !important; }
.hero .ring-label strong { font-size: 22px; }
.stat-grid div { background: var(--card-2); border-radius: 16px; padding: 12px; min-width: 0; }
.stat-grid strong { display: block; font-size: 22px; font-weight: 850; font-variant-numeric: tabular-nums; }
.stat-grid span { font-size: 12px; color: var(--muted); }
.ring { position: relative; flex: none; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); }
.ring-fg { fill: none; stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 26px; font-weight: 850; line-height: 1.1; }
.ring-label span { font-size: 12px; color: var(--muted); }
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width 0.5s ease; }
.bar-thin { height: 6px; margin-top: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 4px; }
.final { border-color: rgba(217, 119, 87, 0.35); }
.countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.countdown-grid div { background: var(--card-2); border-radius: 16px; padding: 14px 4px; text-align: center; }
.countdown-grid strong { display: block; font-size: 30px; font-weight: 850; font-variant-numeric: tabular-nums; color: var(--blue-2); }
.countdown-grid span { font-size: 12px; color: var(--muted); }

/* ---------- Wochenkästchen & Kalender ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-col { display: grid; gap: 6px; justify-items: center; }
.week-day { font-size: 12px; color: var(--muted); font-weight: 600; }
.day-cell { width: 100%; display: flex; justify-content: center; }
.day-box {
  width: 100%; max-width: 46px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px;
  font-size: 12px; font-weight: 650; color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.day-box .icon { width: 16px; height: 16px; stroke-width: 3; }
.st-future .day-box { background: transparent; border-style: dashed; color: var(--faint); }
.st-inactive .day-box { background: transparent; border-color: transparent; color: var(--faint); opacity: 0.4; }
.lv-0 .day-box { border-color: rgba(248, 113, 113, 0.3); }
.st-today.lv-0 .day-box { border-color: var(--line); }
.lv-1 .day-box { background: rgba(91, 157, 255, 0.2); color: var(--text-2); }
.lv-2 .day-box { background: rgba(91, 157, 255, 0.42); color: #fff; }
.lv-3 .day-box { background: rgba(91, 157, 255, 0.7); color: #fff; }
.lv-4 .day-box { background: var(--blue); color: #0b1424; border-color: var(--blue); }
.st-today .day-box { outline: 2px solid var(--orange); outline-offset: 2px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .day-box { max-width: none; border-radius: 10px; }
.cal-head { font-size: 11px; color: var(--muted); text-align: center; font-weight: 650; }
.heat { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; }
.heat .day-box { max-width: none; border-radius: 6px; font-size: 0; }
.heat .day-box .icon { width: 12px; height: 12px; }
.heat-label { font-size: 11px; color: var(--faint); }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }
.legend i.lv-1 { background: rgba(91, 157, 255, 0.2); } .legend i.lv-2 { background: rgba(91, 157, 255, 0.42); }
.legend i.lv-3 { background: rgba(91, 157, 255, 0.7); } .legend i.lv-4 { background: var(--blue); }

/* ---------- Kennzahlen ---------- */
.kv { display: grid; gap: 8px; margin-top: 14px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; }
.compare { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
.compare.up strong { color: var(--green); }
.compare.down strong { color: var(--red); }
.streaks { display: flex; gap: 10px; }
.streak-main, .streak-side { flex: 1; border-radius: 16px; padding: 14px; }
.streak-main { background: var(--orange-soft); }
.streak-side { background: var(--card-2); }
.streaks strong { display: block; font-size: 34px; font-weight: 850; line-height: 1.1; }
.streak-main strong { color: var(--orange-2); }
.streaks span { font-size: 13px; color: var(--muted); }
.training-sum { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.training-sum strong { font-size: 34px; font-weight: 850; }
.training-sum small { font-size: 18px; color: var(--muted); }
.training-sum span { color: var(--muted); font-size: 14px; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-2); }
.dots i.on { background: var(--blue); border-color: var(--blue); }
.dots i.extra { border-style: dashed; }
.dots i.extra.on { background: var(--blue-2); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-width: 0; }
.tile span { font-size: 12px; color: var(--muted); }
.tile strong { display: block; font-size: 24px; font-weight: 850; font-variant-numeric: tabular-nums; }
.tile small { font-size: 12px; color: var(--faint); }
.progress-list, .training-weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.progress-list li { display: flex; align-items: center; gap: 12px; }
.progress-main { flex: 1; min-width: 0; }
.progress-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.progress-top span { overflow-wrap: anywhere; }
.training-weeks li { background: var(--card-2); border-radius: 14px; padding: 12px; }
.tw-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tw-head .tag { margin-left: auto; }
.tw-body { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.period-nav { display: flex; align-items: center; gap: 8px; }
.period-label { display: grid; text-align: center; min-width: 150px; }
.period-label strong { font-size: 15px; }
.period-label span { font-size: 12px; color: var(--muted); }

/* ---------- Rangliste & Mitglieder ---------- */
.board, .members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 26px 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--card-2); border: 1px solid transparent; }
.board li.me, .members li.me { border-color: var(--orange); background: linear-gradient(var(--orange-soft), var(--orange-soft)), var(--card-2); }
.rank { font-weight: 850; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-1 .rank { color: #fbbf24; } .top-2 .rank { color: #cbd5e1; } .top-3 .rank { color: #e0a17f; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2); font-weight: 750; flex: none; }
.board-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.board-name em { font-style: normal; font-size: 11px; color: var(--orange-2); background: var(--orange-soft); padding: 2px 7px; border-radius: 999px; margin-left: 4px; }
.board-points { font-weight: 850; font-size: 16px; font-variant-numeric: tabular-nums; }
.board-points small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.board li.leader {
  padding: 12px; border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.24), rgba(217, 119, 87, 0.12) 55%, rgba(251, 191, 36, 0.08)), var(--card-2);
  background-size: 200% 100%; animation: leader-shine 6s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 10px 26px rgba(251, 191, 36, 0.14);
}
.board li.leader .rank { color: #fbbf24; display: grid; place-items: center; }
.board li.leader .rank .icon { width: 22px; height: 22px; fill: rgba(251, 191, 36, 0.3); animation: crown-bob 2.4s ease-in-out infinite; }
.board li.leader .avatar { background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #1c1310; border-color: transparent; }
.board li.leader .board-points { color: #fcd34d; font-size: 18px; }
.leader-tag {
  display: inline-block; font-size: 11px; font-weight: 750; color: #1c1310; background: #fbbf24;
  padding: 2px 8px; border-radius: 999px; margin-left: 4px; vertical-align: middle;
}
@keyframes leader-shine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes crown-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.members { margin-top: 16px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--card-2); border: 1px solid transparent; flex-wrap: wrap; }
.members .board-name { flex: 1; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 14px !important; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plain-list li:last-child { border-bottom: 0; }
.rules-mini strong { white-space: nowrap; }

/* ---------- Anmeldung ---------- */
.auth { max-width: 440px; margin: 0 auto; }
.auth.wide { max-width: 640px; }
.auth-hero { text-align: center; margin: 20px 0 22px; }
.auth-hero h1 { font-size: 38px; font-weight: 900; letter-spacing: -0.03em; }
.auth-hero p { color: var(--muted); margin-top: 4px; }
.brand-mark { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-2); }
.brand-mark .icon { width: 36px; height: 36px; }
.auth .card h2 { margin-bottom: 8px; }
.link-center { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; color: var(--muted); }

/* ---------- Regeln ---------- */
.rules-grid { display: grid; gap: 16px; margin-top: 16px; }
.rules .card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rules .card h2 .icon { color: var(--orange-2); }
.rules ul, .rules ol { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); }
.rules li { margin: 6px 0; }
.rules .plain-list { margin-bottom: 8px; }
.rule-habits { list-style: none; padding: 0 !important; display: grid; gap: 8px; margin: 10px 0 !important; }
.rule-habits li { display: flex; align-items: center; gap: 10px; margin: 0; }
.rule-habits .habit-icon { width: 32px; height: 32px; border-radius: 10px; }
.rule-habits .habit-icon .icon { width: 17px; height: 17px; }

/* ---------- Hinweise & Dialoge ---------- */
.toasts {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 26px + var(--safe-b)); width: min(92vw, 440px); display: grid; gap: 8px;
}
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border-radius: 16px; background: #2e3137; border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 14px; animation: fade-up 0.25s ease; transition: opacity 0.25s, transform 0.25s;
}
.toast-error { border-color: rgba(248, 113, 113, 0.55); }
.toast-ok { border-color: rgba(74, 222, 128, 0.4); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-action { background: none; border: 0; color: var(--orange-2); font-weight: 750; padding: 4px; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, 0.58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease; transition: opacity 0.2s;
}
.modal-backdrop.out { opacity: 0; }
.modal {
  width: min(100%, 460px); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: pop-in 0.28s cubic-bezier(0.2, 1.1, 0.3, 1);
}
.modal-title { font-size: 20px; font-weight: 850; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.beast { position: relative; overflow: hidden; text-align: center; padding: 30px 22px 22px; }
.beast-badge {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 36px;
  background: var(--orange-soft); box-shadow: 0 0 0 10px rgba(217, 119, 87, 0.07); animation: badge-pop 0.7s cubic-bezier(0.2, 1.4, 0.3, 1);
}
.beast-title { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 6px; }
.beast-text { color: var(--text-2); margin-bottom: 18px; }
.beast-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.beast-stats div { background: var(--card-2); border-radius: 16px; padding: 12px; }
.beast-stats strong { display: block; font-size: 28px; font-weight: 900; color: var(--orange-2); }
.beast-stats span { font-size: 12px; color: var(--muted); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  --a: calc(var(--i) * 22.5deg);
  position: absolute; left: 50%; top: 88px; width: 6px; height: 11px; margin-left: -3px; border-radius: 2px;
  background: var(--orange); opacity: 0; animation: burst 1.3s ease-out 0.1s forwards;
}
.confetti i:nth-child(3n) { background: var(--blue); }
.confetti i:nth-child(4n) { background: #fff; }
@keyframes burst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.5); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-120px) scale(1); }
}
@keyframes badge-pop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pop-in { from { transform: translateY(12px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 600px) {
  .hero .ring { width: 132px !important; height: 132px !important; }
  .hero .ring-label strong { font-size: 26px; }
  .hero-body { gap: 20px; }
  .hero-stats div { padding: 10px 14px; }
  .hero-stats strong { font-size: 22px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .toasts { bottom: 28px; }
  .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .card { padding: 16px; }
  .check { width: 46px; height: 46px; }
  .countdown-grid strong { font-size: 24px; }
}
