/* ============================================================
   Kraftrang · app.css
   Bewusst nur dunkles Design (Gym-/Gaming-Look).
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #0B0E13;
  --surface: #131821;
  --surface-2: #1A212C;
  --surface-3: #242D3A;
  --line: #252E3C;
  --line-2: #334052;
  --text: #E9EEF4;
  --muted: #8D98A9;
  --faint: #5E6879;
  --accent: #FF6A2B;
  --accent-hi: #FF8C52;
  --accent-ink: #1A0900;
  --accent-soft: rgba(255, 106, 43, .13);
  --good: #3DD68C;
  --good-soft: rgba(61, 214, 140, .12);
  --danger: #FF6166;
  --danger-soft: rgba(255, 97, 102, .12);
  --gold: #F4C14F;
  --heat0: #19202B; --heat1: #0E4429; --heat2: #006D32; --heat3: #26A641; --heat4: #39D353;
  --r: 16px;
  --fd: 'Chakra Petch', 'Barlow', ui-sans-serif, system-ui, sans-serif;
  --fb: 'Barlow', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 64px;
  --cell: 12px;
  --seg-bg: var(--surface);
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); }
body { font-family: var(--fb); font-size: 15.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.ic { flex: none; display: block; }

#app { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 14px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
.screen { display: flex; flex-direction: column; gap: 20px; animation: scr .26s ease both; }
.screen.still { animation: none; }
@keyframes scr { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.boot { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---- Typografie ---------------------------------------------------------- */
h1, h2, h3 { font-family: var(--fd); margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: .005em; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.eyebrow { font-family: var(--fd); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow.accent { color: var(--accent-hi); }
.eyebrow.gold { color: var(--gold); }
.sub { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.num-t { font-variant-numeric: tabular-nums; }
.up { color: var(--good); }
.down { color: var(--danger); }
.mt { margin-top: 16px; }
.mt-s { margin-top: 10px; }
.empty { color: var(--muted); padding: 6px 0; }
.card > .empty, p.empty.card { padding: 16px; }
.scr-h { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }

/* ---- Flächen ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.inner { background: var(--surface-2); padding: 14px; margin-bottom: 12px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-hi); font-weight: 600; font-size: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-sep { font-family: var(--fd); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 8px 2px 0; }
.stack-s { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row2 > .btn { min-width: 0; padding-inline: 10px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-2); transition: transform .12s ease, background .2s ease, opacity .2s; text-align: center; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); border: 0; font-family: var(--fd); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 10px 26px -12px rgba(255, 106, 43, .75), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-xl { width: 100%; min-height: 62px; font-size: 18px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.ghost.on { color: var(--accent-hi); border-color: rgba(255, 140, 82, .4); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-text { color: var(--muted); font-weight: 600; padding: 10px 6px; display: inline-flex; gap: 6px; align-items: center; }
.btn-text.danger { color: var(--danger); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); flex: none; }
.icon-btn:active { background: var(--surface-2); }

/* ---- Formulare ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field > span, .lbl { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.lbl { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font: 700 11px/1 var(--fd); padding: 3px 7px; }
.inp { width: 100%; min-height: 46px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font-size: 16px; }
textarea.inp { resize: vertical; }
.inp.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.err { color: var(--danger); font-weight: 600; margin: 10px 0; font-size: 14px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { min-height: 38px; border-radius: 9px; font-weight: 600; color: var(--muted); text-align: center; font-size: 14.5px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.seg button[disabled] { opacity: .35; }

/* ---- Rang-Abzeichen & Balken ---------------------------------------------- */
.rb { display: inline-flex; align-items: center; gap: 8px; font-family: var(--fd); font-weight: 600; color: var(--c); white-space: nowrap; }
.hexw { display: inline-grid; flex: none; }
.hex { width: 22px; height: 25px; display: grid; place-items: center; background: var(--c); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); color: #0B0E13; font: 700 9.5px/1 var(--fd); }
.hex b { transform: translateY(.5px); }
.rb-sm .hex { width: 17px; height: 19px; font-size: 7.5px; }
.rb-sm .rl { font-size: 13.5px; }
.rb-lg .hex { width: 58px; height: 66px; font-size: 19px; }
.tier-novice { --c: #98A2B0; }
.tier-novice .hex { background: #3A4351; color: #AEB7C4; }
.tier-platinum .hexw, .tier-diamond .hexw { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 55%, transparent)); }
.tier-master .hexw { filter: drop-shadow(0 0 8px rgba(216, 107, 255, .6)); }
.tier-master .hex { background: conic-gradient(from var(--ang, 0deg), #D86BFF, #7AA8FF, #4FD6C0, #F4C14F, #D86BFF); animation: spin 5s linear infinite; }
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --ang: 360deg; } }

.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: inherit; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.bar.seg::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--seg-bg) calc(10% - 2px) 10%); pointer-events: none; }
.bar.lg { height: 14px; border-radius: 5px; }

/* ---- Dashboard ------------------------------------------------------------ */
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid rgba(255, 106, 43, .3); color: var(--accent-hi); border-radius: 12px; padding: 4px 6px 4px 14px; font-weight: 600; font-size: 14px; }
.demo-bar .btn-text { color: var(--text); font-size: 13.5px; }
.dash-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 6px; }
.dash-h h1 { margin-top: 4px; }
.streak { display: inline-flex; align-items: baseline; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px 7px 10px; color: var(--faint); }
.streak .ic { align-self: center; }
.streak b { font: 700 18px/1 var(--fd); color: var(--muted); }
.streak small { font-size: 12px; }
.streak.on { color: var(--accent); border-color: rgba(255, 106, 43, .35); background: var(--accent-soft); }
.streak.on b { color: var(--text); }
.streak.on .ic { animation: flicker 2.4s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12) rotate(-4deg); } }
.status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }
.status .ic { margin-top: 1px; }
.status b { color: var(--text); }
.status.ok { background: var(--good-soft); border-color: rgba(61, 214, 140, .3); }
.status.ok .ic { color: var(--good); }
.welcome { border-color: rgba(255, 106, 43, .35); background: linear-gradient(160deg, rgba(255, 106, 43, .10), var(--surface) 55%); display: flex; flex-direction: column; gap: 6px; }
.welcome h2 { font-size: 22px; margin-top: 4px; }
.welcome .row2 { margin-top: 14px; }

.lvl-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px; border-radius: var(--r); background: radial-gradient(120% 140% at 0% 0%, rgba(255, 106, 43, .16), transparent 55%), var(--surface); border: 1px solid var(--line); --seg-bg: #171b22; }
.lvl-crest { width: 76px; height: 86px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, var(--accent-hi), #B8401A); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--accent-ink); }
.lvl-crest span { font: 700 10px/1 var(--fd); letter-spacing: .16em; text-transform: uppercase; }
.lvl-crest b { font: 700 32px/1 var(--fd); margin-top: 2px; }
.lvl-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lvl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lvl-row b { font: 700 24px/1 var(--fd); }
.lvl-foot { font-size: 13px; color: var(--muted); }
.start-btn { gap: 10px; }
.start-btn.live { background: linear-gradient(180deg, #52E3A0, var(--good)); box-shadow: 0 10px 26px -12px rgba(61, 214, 140, .7); color: #04160D; }
.start-t { font-variant-numeric: tabular-nums; opacity: .75; font-size: 15px; }

.mm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mm { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; transition: border-color .2s, transform .12s; }
.mm:active { transform: scale(.98); }
.mm-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mm-n { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-r { font: 600 13px/1.2 var(--fd); color: var(--c); }
.tier-novice-c { color: var(--muted); }
.mm-x { font-size: 12px; color: var(--faint); }
.mm-grid .mm:last-child:nth-child(odd) { grid-column: 1 / -1; }

.rw { display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: 100%; }
.rw small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; font-weight: 500; }
.rw-d b { font-family: var(--fd); font-size: 14.5px; }
.rw-m { font-weight: 600; font-size: 14.5px; min-width: 0; }
.rw-x { font: 700 17px/1 var(--fd); color: var(--accent-hi); text-align: right; }
.rw-x small { font-size: 10.5px; letter-spacing: .1em; color: var(--muted); }
.rw.tpl { grid-template-columns: auto 1fr auto; color: var(--text); }
.rw.tpl > .ic:last-child { color: var(--faint); }
.tpl-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); }

/* ---- Aktivitätskarte ---------------------------------------------------- */
.hm-scroll { overflow-x: auto; margin-inline: -4px; padding: 0 4px 4px; scrollbar-width: none; }
.hm-scroll::-webkit-scrollbar { display: none; }
.hm-grid { display: grid; grid-template-columns: 22px auto; grid-template-rows: auto auto; column-gap: 4px; row-gap: 4px; width: max-content; margin-left: auto; }
.hm-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), var(--cell)); column-gap: 3px; font-size: 10.5px; color: var(--faint); height: 14px; }
.hm-months span { white-space: nowrap; }
.hm-wd { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(7, var(--cell)); row-gap: 3px; font-size: 9.5px; color: var(--faint); line-height: var(--cell); }
.hm { grid-column: 2; grid-row: 2; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); grid-auto-columns: var(--cell); gap: 3px; }
.hc { width: var(--cell); height: var(--cell); border-radius: 3px; background: var(--heat0); display: block; padding: 0; }
.hc.l1 { background: var(--heat1); } .hc.l2 { background: var(--heat2); } .hc.l3 { background: var(--heat3); } .hc.l4 { background: var(--heat4); }
.hc.fut { background: transparent; }
.hc.today { outline: 1.5px solid var(--accent-hi); outline-offset: 1px; }
button.hc:active { transform: scale(1.3); }
.hm-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.hm-legend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--faint); }
.hm-legend span { margin: 0 3px; }
.hm-legend .hc { width: 10px; height: 10px; border-radius: 2px; }

/* ---- Training: Start --------------------------------------------------- */
.mchips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mchip { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; min-height: 56px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--line); transition: border-color .15s, background .15s; min-width: 0; }
.mchip .dot { grid-row: 1 / span 2; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.mchip .mc-n { font-weight: 700; }
.mchip small { color: var(--muted); font-size: 12px; }
.mchip.on { border-color: var(--accent); background: var(--accent-soft); }
.mchip.on .mc-n::after { content: ' ✓'; color: var(--accent-hi); }

/* ---- Training: laufend ---------------------------------------------------- */
.live-h { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; margin: -14px -16px 0; padding: 12px 16px 12px; background: rgba(11, 14, 19, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.live-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.live-state { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/1 var(--fd); letter-spacing: .12em; text-transform: uppercase; color: var(--good); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, .6); } 50% { box-shadow: 0 0 0 6px rgba(61, 214, 140, 0); } }
.live-timer { font: 700 26px/1 var(--fd); }
.live-muscles { display: flex; gap: 6px; flex-wrap: wrap; }
.mtag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; }
.mtag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.mtag.add { padding: 5px 9px; color: var(--muted); }
.mtag.add::before { display: none; }

.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 120px; }
.ex-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-left: 4px; }
.ex-h h3 { font-size: 17.5px; }
.ex-m { font-size: 13px; color: var(--accent-hi); font-weight: 600; }
.rm.armed { width: auto; padding: 0 10px; background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: 13px; }
.last { font-size: 13.5px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.last b { color: var(--text); }
.set-head, .set-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr) 48px; gap: 7px; align-items: center; }
.set-head { font: 600 11px/1 var(--fd); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 4px 0 0; }
.set-head span:nth-child(n+3) { text-align: center; }
.sn { font: 700 15px/1 var(--fd); color: var(--muted); text-align: center; }
.prev { font-size: 13px; color: var(--muted); min-height: 44px; border-radius: 10px; text-align: left; padding: 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prev:not([disabled]):active { background: var(--surface-2); }
.num { width: 100%; height: 48px; background: var(--surface-2); border: 1.5px solid var(--line-2); border-radius: 11px; text-align: center; font: 700 19px/1 var(--fd); padding: 0 4px; font-variant-numeric: tabular-nums; }
.num::placeholder { color: var(--faint); font-weight: 600; }
.num:focus { border-color: var(--accent); outline: none; background: #1F2733; }
.num.dis { display: grid; place-items: center; color: var(--faint); border-style: dashed; }
.chk { height: 48px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--faint); transition: background .15s, color .15s; }
.set-row.done .chk { background: var(--good); border-color: var(--good); color: #04160D; }
.set-row.done .num { border-color: rgba(61, 214, 140, .45); background: var(--good-soft); }
.set-row.done .sn { color: var(--good); }
.ex-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ex-notes { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.empty-ex { color: var(--muted); text-align: center; padding: 22px 16px; border-style: dashed; }
.quick .lbl { margin-bottom: 8px; }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; }
.qchip:active { background: var(--accent-soft); border-color: var(--accent); }
.add-ex { width: 100%; min-height: 54px; border-style: dashed; background: transparent; color: var(--muted); }
.finish { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }

/* ---- Bottom-Sheet --------------------------------------------------------- */
.sheet-bd { position: fixed; inset: 0; background: rgba(3, 5, 8, .62); z-index: 60; animation: fade .2s ease both; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 560px; margin: 0 auto; max-height: calc(100% - 40px - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 16px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; animation: up .28s cubic-bezier(.2, .8, .2, 1) both; --seg-bg: var(--surface); }
.sheet.no-anim { animation: none; }
.sheet.tall { min-height: 70%; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 2px; flex: none; }
.sheet-x { position: absolute; top: 10px; right: 10px; }
.sheet-h { padding-right: 40px; }
.sheet-h h2 { font-size: 22px; margin-top: 3px; }

.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .inp { padding-left: 38px; }
.fchips { display: flex; gap: 6px; overflow-x: auto; margin-inline: -16px; padding: 0 16px 2px; scrollbar-width: none; flex: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; padding: 7px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.fchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ex-list { display: flex; flex-direction: column; }
.ex-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); min-height: 58px; }
.ex-item small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.ex-add { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); font-size: 11px; font-weight: 700; flex: none; }
.ex-item[disabled] { opacity: .5; }
.ex-item[disabled] .ex-add { background: var(--surface-2); color: var(--muted); }
.cx { border: 1px dashed var(--line-2); border-radius: 12px; padding: 0 12px; }
.cx summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 600; cursor: pointer; }
.cx summary::-webkit-details-marker { display: none; }
.cx-form { padding-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.cx-form .btn { margin-top: 12px; }

/* ---- Ergebnis nach dem Training ------------------------------------------- */
.res-hero { text-align: center; padding: 10px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.res-big { font: 700 54px/1 var(--fd); color: var(--accent-hi); text-shadow: 0 0 28px rgba(255, 106, 43, .45); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.res-big span { font-size: 22px; color: var(--text); }
@keyframes pop { from { transform: scale(.6); opacity: .2; } to { transform: none; opacity: 1; } }
.res-sub { color: var(--muted); font-size: 14px; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.lvl-up { margin-top: 4px; background: var(--accent-soft); border: 1px solid rgba(255, 106, 43, .35); border-radius: 99px; padding: 6px 14px; font-weight: 600; }
.rankup { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%); animation: pop .6s .15s cubic-bezier(.2, 1.4, .4, 1) both; }
.rankup b { font-family: var(--fd); font-size: 18px; }
.ru-path { color: var(--muted); font-size: 14px; }
.res-list { display: flex; flex-direction: column; gap: 14px; }
.res-row { display: flex; flex-direction: column; gap: 6px; }
.res-top { display: flex; align-items: center; gap: 10px; }
.res-n { font-weight: 700; flex: 1; }
.res-x { font-family: var(--fd); color: var(--accent-hi); }
.res-foot { font-size: 12.5px; color: var(--muted); }

.pr-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: linear-gradient(120deg, rgba(244, 193, 79, .14), transparent 75%); border: 1px solid rgba(244, 193, 79, .35); }
.pr-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(244, 193, 79, .18); color: var(--gold); flex: none; }
.pr-main { font-weight: 600; margin-top: 2px; }
.pr-main b { font-family: var(--fd); }
.pr-prev { font-size: 13px; color: var(--muted); }
.pr-card.compact { padding: 10px 12px; }

/* ---- Trainingsdetails ------------------------------------------------------ */
.wd-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; align-items: center; }
.wd-meta span { display: inline-flex; align-items: center; gap: 5px; }
.xp-total { font: 700 15px/1 var(--fd); color: var(--accent-hi) !important; }
.xp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.xp-chip { padding: 5px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); font-size: 13px; font-weight: 600; }
.xp-chip b { font-family: var(--fd); color: var(--c); }
.wd-list { display: flex; flex-direction: column; gap: 10px; }
.wd-ex { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.wd-exh { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.wd-exh span { color: var(--muted); font-size: 13px; }
.wd-sets, .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { padding: 5px 9px; border-radius: 8px; background: var(--surface-3); font: 600 13.5px/1.1 var(--fd); font-variant-numeric: tabular-nums; }
.wd-note { color: var(--muted); font-size: 14px; margin-top: 6px; font-style: italic; }
.danger-zone { display: flex; justify-content: center; }
.confirm { width: 100%; background: var(--danger-soft); border: 1px solid rgba(255, 97, 102, .3); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }

/* ---- Muskel-Details ------------------------------------------------------- */
.ms-head { display: flex; align-items: center; gap: 16px; padding-right: 40px; }
.ms-head h2 { font-size: 26px; }
.ms-rank { font: 700 18px/1.2 var(--fd); margin-top: 2px; }
.xp-block { display: flex; flex-direction: column; gap: 8px; }
.xp-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.xp-line b { color: var(--text); font-family: var(--fd); font-size: 16px; }
.tiles { display: grid; gap: 8px; }
.tiles.t2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.t4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.screen > .tiles .tile { background: var(--surface); }
.tile b { font: 700 20px/1.15 var(--fd); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12.5px; color: var(--muted); hyphens: manual; }
.tile.big b { font-size: 28px; }
.tile.fire b { color: var(--accent-hi); }
.trend { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.trend .ic { color: var(--muted); }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
.row-btn > span:not(.rank-n) { flex: 1; min-width: 0; }
.row-btn small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row-btn > .ic { color: var(--faint); }
.rank-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font: 700 13px/1 var(--fd); color: var(--muted); flex: none; }

/* ---- Statistik ---------------------------------------------------------- */
.kv4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.kv4 > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv4 b { font: 700 17px/1.1 var(--fd); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.kv4 b .ic { color: var(--accent); }
.kv4 span { font-size: 11.5px; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-base { stroke: var(--line-2); stroke-width: 1; }
.ch-yl, .ch-xl { fill: var(--faint); font: 500 10.5px var(--fb); }
.ch-yl { text-anchor: end; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.ch-end { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.ch-val { fill: var(--text); font: 700 12.5px var(--fd); }
.ch-bar { fill: var(--surface-3); }
.ch-bar.hi { fill: var(--accent); }
.ch-bv { fill: var(--muted); font: 600 10.5px var(--fd); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb-row { display: grid; grid-template-columns: 96px 1fr 56px; gap: 10px; align-items: center; font-size: 14px; }
.hb-l { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.hb-v { text-align: right; font: 600 13.5px var(--fd); color: var(--muted); font-variant-numeric: tabular-nums; }
.callout { font-size: 14.5px; margin-bottom: 12px; color: var(--muted); }
.callout b { font-family: var(--fd); }
.prog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; font-size: 13.5px; }
.prog-head b { font-family: var(--fd); }
.mb-list { display: flex; flex-direction: column; margin-top: 6px; }
.mb-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.mb-row:last-child { border-bottom: 0; }
.mb-row b { font-family: var(--fd); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Körper -------------------------------------------------------------- */
.body-stage { position: relative; display: grid; place-items: center; padding: 14px 8px 18px; background: radial-gradient(60% 50% at 50% 42%, #1B2331 0%, var(--surface) 75%); }
.body-svg { width: 100%; max-width: 280px; height: auto; display: block; }
.body-svg .bn path, .body-svg .bn ellipse { fill: #1E2531; stroke: #2C3646; stroke-width: 1; }
.body-svg .mz { stroke: #0B0E13; stroke-width: 1.3; cursor: pointer; fill-opacity: .93; transition: filter .2s, fill-opacity .2s; }
.body-svg .mz:active { fill-opacity: 1; filter: brightness(1.25); }
.body-svg .mz.glow { filter: drop-shadow(0 0 4px var(--c)); }
.body-svg .ln { stroke: #0B0E13; stroke-opacity: .5; stroke-width: 1.2; fill: none; pointer-events: none; }
.flip-btn { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; color: var(--muted); }
.lg-i { display: inline-flex; align-items: center; gap: 6px; }
.lg-i i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.lg-i.tier-novice i { background: #3A4351; }
.lg-i.tier-master i { background: linear-gradient(135deg, #D86BFF, #7AA8FF, #F4C14F); }
.body-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: 100%; }
.br-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.br-top { display: flex; justify-content: space-between; gap: 8px; }
.br-r { font: 600 13.5px/1.2 var(--fd); color: var(--c); }
.body-row .tier-novice + .br-main .br-r { color: var(--muted); }
.br-x { font: 700 16px/1 var(--fd); text-align: right; min-width: 52px; }
.br-x small { display: block; font-size: 10px; color: var(--faint); letter-spacing: .1em; margin-top: 2px; }

/* ---- Profil ----------------------------------------------------------------- */
.prof-h { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding-top: 6px; --seg-bg: var(--bg); }
.avatar { width: 80px; height: 90px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, var(--accent-hi), #9E3614); display: grid; place-items: center; }
.avatar span { font: 700 28px/1 var(--fd); color: var(--accent-ink); }
.prof-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.name-inp { background: transparent; border: 0; border-bottom: 1px dashed var(--line-2); font: 700 24px/1.2 var(--fd); padding: 2px 0; width: 100%; }
.name-inp:focus { outline: none; border-bottom-color: var(--accent); }
.prof-lvl { font-size: 14.5px; color: var(--muted); }
.prof-lvl b { color: var(--text); font-family: var(--fd); }
.pr-ranks { display: flex; flex-direction: column; }
.pr-rank { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.pr-rank:last-child { border-bottom: 0; }
.pr-rank .tier-novice .rl { color: var(--muted); }
.rules { padding: 0; }
.rules summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px; cursor: pointer; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary .ic { transition: transform .2s; color: var(--muted); }
.rules[open] summary .ic { transform: rotate(90deg); }
.rules-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; color: #C5CEDA; }
.rules-b b { color: var(--text); }
.rank-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 4px; }
.rr { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rr b { margin-left: auto; font-family: var(--fd); color: var(--muted); font-weight: 600; }
.rb-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.sync-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.sync-line i { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--faint); }
.sync-line.ok i { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.sync-line.busy i { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.sync-line.warn i { background: var(--gold); }

/* ---- Battle ---------------------------------------------------------------- */
.battle-gate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; background: radial-gradient(90% 70% at 50% 0%, rgba(244, 193, 79, .12), transparent 70%), var(--surface); }
.battle-gate .btn { width: 100%; }
.bg-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--gold); background: rgba(244, 193, 79, .14); margin-bottom: 6px; }
.lb { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); width: 100%; }
.lb-row.me { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, .35); }
.lb-pl { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font: 700 15px/1 var(--fd); background: var(--surface-3); color: var(--muted); }
.lb-row.p1 .lb-pl { background: var(--gold); color: #1A1200; }
.lb-row.p2 .lb-pl { background: #C9D3DE; color: #11161D; }
.lb-row.p3 .lb-pl { background: #D08D5B; color: #1A0D04; }
.lb-n { min-width: 0; }
.lb-n small, .fr-row small, .acct small, .code-box small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.you { font: 700 10px/1 var(--fd); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-hi); background: var(--accent-soft); padding: 3px 6px; border-radius: 6px; vertical-align: 2px; }
.lb-x { font: 700 18px/1 var(--fd); text-align: right; }
.lb-x small { display: block; font-size: 10px; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }
.sel-s { min-height: 38px; width: auto; max-width: 55%; font-size: 14px; padding: 6px 30px 6px 10px; }
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.cmp-name { font: 700 16px/1.2 var(--fd); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-name.me { text-align: left; color: var(--accent-hi); }
.cmp-score { font: 700 28px/1 var(--fd); color: var(--muted); }
.cmp-score b:first-child { color: var(--accent-hi); }
.cmp-score b:last-child { color: var(--text); }
.cmp-verdict { text-align: center; margin: 6px 0 12px; }
.cmp-list { display: flex; flex-direction: column; }
.cmp-row { display: grid; grid-template-columns: 1fr 88px 1fr; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-m { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cmp-side { display: flex; align-items: center; gap: 8px; min-width: 0; opacity: .6; }
.cmp-side.r { justify-content: flex-end; text-align: right; }
.cmp-side.win { opacity: 1; }
.cmp-side b { font: 600 13px/1.2 var(--fd); display: block; white-space: nowrap; }
.cmp-side small { font-size: 11.5px; color: var(--muted); }
.code-box, .acct { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.code-box b { font: 700 24px/1.2 var(--fd); letter-spacing: .08em; color: var(--gold); }
.acct b { font-size: 14.5px; word-break: break-all; }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.add-row .inp { text-transform: uppercase; font-family: var(--fd); letter-spacing: .06em; }
.fr-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }

/* ---- Navigation --------------------------------------------------------- */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(11, 14, 19, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
#tabbar .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, 1fr); height: var(--nav-h); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 10.5px; min-width: 0; font-weight: 600; letter-spacing: .02em; position: relative; text-align: center; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .ic { color: var(--accent); }
.tab[aria-current="page"]::before { content: ''; position: absolute; top: -1px; left: 32%; right: 32%; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; }
.tab .live { position: absolute; top: 9px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--bg); }

/* ---- Toasts --------------------------------------------------------------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast { display: flex; align-items: center; gap: 12px; max-width: 460px; width: max-content; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 14px; padding: 11px 16px; font-size: 14.5px; font-weight: 500; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); animation: tin .3s cubic-bezier(.2, 1.2, .4, 1) both; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .3s; }
.toast.pr { background: linear-gradient(120deg, #3A2E12, var(--surface-3) 70%); border-color: rgba(244, 193, 79, .5); }
.toast.err { border-color: rgba(255, 97, 102, .5); }
.toast small { color: var(--muted); }
.t-ic.gold { color: var(--gold); }
@keyframes tin { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }

@media (min-width: 420px) {
  .tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mm-grid .mm:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 360px) {
  .set-head, .set-row { grid-template-columns: 22px minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 5px; }
  .kv4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw { grid-template-columns: 74px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
