:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-2: #222226;
  --surface-3: #2c2c31;
  --line: #2f2f35;
  --text: #f4f4f5;
  --text-2: #b4b4bb;
  --text-3: #7c7c85;
  --fire: #ff5a1f;
  --fire-2: #ff8a3d;
  --fire-deep: #c93d0c;
  --danger: #ef4444;
  --radius: 18px;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
svg { display: block; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
#view { padding: calc(var(--safe-t) + 14px) 16px calc(var(--tab-h) + var(--safe-b) + 24px); }
.spacer { height: 24px; }

/* Typo */
h1, h2, h3, .streak-num, .bal, .next-name {
  font-weight: 900; font-style: italic; letter-spacing: -.01em; text-transform: uppercase; margin: 0;
}
h1 { font-size: 30px; line-height: 1.05; }
h2 { font-size: 17px; }
h3 { font-size: 16px; }
h2.section, h4.section { margin: 26px 0 10px; font-size: 15px; color: var(--text-2); }
h4.section { font-style: normal; text-transform: none; font-weight: 700; }
.eyebrow { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.eyebrow.accent { color: var(--fire); }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.center { text-align: center; justify-content: center; }
p { margin: 6px 0 14px; }

/* Bausteine */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; flex: none; position: relative;
}
.icon-btn svg { width: 22px; height: 22px; fill: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 9px; background: transparent; }
.icon-btn.xs svg { width: 18px; height: 18px; fill: var(--text-3); }
.icon-btn.accent { background: var(--fire); }
.icon-btn.flip svg { transform: scaleX(-1); }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; background: var(--fire); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 18px; border-radius: 14px;
  font-weight: 700; background: var(--surface-2); white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.sm { height: 34px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn.primary { background: linear-gradient(180deg, var(--fire-2), var(--fire)); color: #fff; box-shadow: 0 6px 18px -8px var(--fire); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row > * { flex: 1; }
.link { color: var(--fire); font-weight: 700; font-size: 14px; padding: 6px 2px; }
.link.muted { color: var(--text-3); }
.chip { padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--text-2); }
.chip.on { background: var(--fire); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px; padding: 0 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.badge { display: inline-block; white-space: nowrap; font-size: 10px; font-style: normal; background: var(--fire); color: #fff; border-radius: 6px; padding: 2px 6px; margin-left: 8px; vertical-align: 2px; letter-spacing: .03em; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .search {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 14px; outline: none;
}
.field input:focus, .search:focus, .set-grid input:focus, .reps:focus { border-color: var(--fire); }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; margin: 12px 0 6px; }
.seg button { flex: 1; height: 32px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.seg.mini { margin: 0; }
.seg.mini button { flex: none; width: 38px; height: 28px; }

/* Streak */
.streak { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: linear-gradient(135deg, #26262b, #1b1b1f); }
.streak.hot { background: radial-gradient(120% 140% at 0% 0%, #ff7a2f 0%, #e5480f 45%, #8f2a07 100%); border-color: transparent; box-shadow: 0 12px 30px -16px var(--fire); }
.flame { width: 56px; height: 56px; border-radius: 16px; background: rgba(0,0,0,.22); display: grid; place-items: center; flex: none; }
.flame svg { width: 34px; height: 34px; fill: #ffd8b8; }
.streak:not(.hot) .flame svg { fill: var(--text-3); }
.streak.hot .flame svg { animation: flicker 1.6s ease-in-out infinite; fill: #fff3e6; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.streak-main { flex: 1; min-width: 0; }
.streak-num { font-size: 40px; line-height: 1; display: flex; align-items: baseline; gap: 8px; }
.streak-num small { font-size: 14px; font-weight: 800; opacity: .9; }
.streak-sub { font-size: 13px; margin-top: 4px; color: rgba(255,255,255,.82); }
.streak:not(.hot) .streak-sub { color: var(--text-2); }
.goal-dots { display: flex; flex-direction: column; gap: 5px; }
.goal-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.18); }
.goal-dots i.on { background: #fff; }
.streak:not(.hot) .goal-dots i.on { background: var(--fire); }

/* Wochenstreifen */
.week { margin: 18px 0 14px; }
.week .row-head { margin-bottom: 10px; }
.week-nav { display: flex; gap: 6px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  aspect-ratio: 3 / 4; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; position: relative; overflow: hidden;
  border: 1px solid transparent;
}
.day b { font-size: 13px; color: var(--text-3); font-weight: 700; }
.day.future b { opacity: .5; }
.day.today { border-color: var(--text-3); }
.day.on { background: linear-gradient(180deg, var(--fire-2), var(--fire) 55%, var(--fire-deep)); box-shadow: 0 6px 16px -10px var(--fire); }
.day.on.today { border-color: #fff; }
.day .body { width: 86%; height: auto; margin-top: -11px; }
.day.on span { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 9.5px; font-weight: 800; color: rgba(255,255,255,.9); }

/* Heute dran / Stats */
.next { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.next-name { font-size: 22px; line-height: 1.1; margin: 2px 0; }
.next.empty .next-name { font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-weight: 900; font-style: italic; }
.stat b small { font-size: 12px; margin-left: 2px; font-style: normal; color: var(--text-2); }
.stat span { font-size: 11.5px; color: var(--text-3); }

/* Diagramm */
.chart-wrap { position: relative; margin-top: 8px; touch-action: pan-y; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #2a2a30; stroke-width: 1; }
.chart .grid.zero { stroke: #4a4a52; }
.chart .ax { fill: var(--text-3); font-size: 9.5px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end { stroke: var(--surface); stroke-width: 2; }
.chart .series { transition: opacity .2s; }
.chart .series.dim { opacity: .15; }
.chart .xhair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.tip {
  display: none; position: absolute; top: -6px; transform: translateY(-100%); min-width: 170px; max-width: 240px; pointer-events: none; z-index: 3;
  background: #2b2b31; border: 1px solid #3a3a42; border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.tip-date { color: var(--text-3); margin-bottom: 4px; }
.tip div:not(.tip-date) { display: flex; align-items: center; gap: 6px; }
.tip i, .lg i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tip b { margin-left: auto; padding-left: 8px; }
.legend { display: grid; gap: 2px; margin-top: 8px; }
.lg { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 8px; text-align: left; transition: opacity .2s; }
.lg.dim { opacity: .4; }
.lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.lg-val { font-weight: 800; font-size: 13.5px; }
.lg-delta { font-size: 12px; color: var(--text-2); min-width: 74px; text-align: right; }
.chart-empty { text-align: center; padding: 26px 10px 10px; color: var(--text-3); }
.chart-empty svg { width: 40px; height: 40px; fill: var(--surface-3); margin: 0 auto 6px; }

/* Training */
.ptabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { padding: 8px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 13.5px; white-space: nowrap; color: var(--text-2); }
.ptab.on { background: var(--text); color: var(--bg); }
.ptab.add { display: grid; place-items: center; padding: 0 10px; }
.ptab.add svg { width: 16px; height: 16px; fill: var(--text-2); }
.plan { padding: 14px 16px; }
.plan.is-next { border-color: rgba(255,90,31,.55); box-shadow: 0 0 0 1px rgba(255,90,31,.25) inset; }
.plan-head { display: flex; align-items: center; gap: 8px; }
.plan-head > div { flex: 1; min-width: 0; }
.plan-list { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: ex; }
.plan-list li { counter-increment: ex; display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.plan-list li span:first-child::before { content: counter(ex); display: inline-block; width: 22px; color: var(--text-3); font-weight: 700; }
.plan-list li span:last-child { white-space: nowrap; }
.empty-plans { display: grid; gap: 10px; }
.cta { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: left; margin: 0; align-items: center; }
.cta-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 13px; background: rgba(255,90,31,.14); display: grid; place-items: center; }
.cta-ic svg { width: 22px; height: 22px; fill: var(--fire); }
.hist { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; margin-bottom: 8px; }
.hist-body { width: 46px; flex: none; }
.hist-body .body { width: 100%; height: auto; }
.hist-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hist-h { font-weight: 800; color: var(--fire); font-size: 13px; }
.menu-item { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item small { display: block; color: var(--text-3); font-size: 12.5px; }
.mi-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.mi-ic svg { width: 20px; height: 20px; fill: var(--fire); }

/* Plan-Editor */
.pe-list { display: grid; gap: 8px; margin: 14px 0 4px; }
.pe-row { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.pe-main { display: flex; flex-direction: column; margin-bottom: 8px; }
.pe-ctrl { display: flex; align-items: center; gap: 6px; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 10px; height: 34px; }
.stepper button { width: 32px; height: 34px; font-size: 18px; font-weight: 700; color: var(--fire); }
.stepper span { font-size: 13px; font-weight: 700; min-width: 58px; text-align: center; }
.reps { width: 70px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; outline: none; font-size: 13px; margin-right: auto; }
.search { margin-top: 4px; }
.pick-list { display: grid; gap: 4px; }
.pick { display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.pick > span { flex: 1; display: flex; flex-direction: column; }
.pick small { color: var(--text-3); font-size: 12px; }
.pick i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface-3); display: grid; place-items: center; flex: none; }
.pick i svg { width: 16px; height: 16px; fill: transparent; }
.pick.on { border-color: rgba(255,90,31,.6); }
.pick.on i { background: var(--fire); border-color: var(--fire); }
.pick.on i svg { fill: #fff; }

/* Assistent */
.wz-bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin: 4px 0 26px; overflow: hidden; }
.wz-bar i { display: block; height: 100%; background: var(--fire); transition: width .3s; }
.wz-q { font-size: 22px; margin-bottom: 2px; }
.wz-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.wz-opts.row { display: grid; grid-template-columns: repeat(5, 1fr); }
.opt { padding: 13px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }
.opt.on { background: var(--fire); border-color: var(--fire); color: #fff; }
.wz-foot { margin-top: 26px; }

/* Workout */
.workout .panel-body { padding-bottom: 120px; }
.wo-head-mid { flex: 1; min-width: 0; text-align: center; }
.wo-head-mid h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; color: var(--fire); font-weight: 800; font-size: 14px; }
.wo-progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin: 4px 0 14px; }
.wo-progress i { display: block; height: 100%; background: var(--fire); transition: width .3s; }
.manual { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.manual .field { margin: 0 0 10px; }
.wo-block { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.wo-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.wo-title > div { display: flex; flex-direction: column; }
.set-grid { display: grid; grid-template-columns: 34px 1fr 68px 58px 40px; gap: 6px; align-items: center; padding: 4px 0; border-radius: 10px; }
.set-grid.head { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 0; }
.set-grid.head span:nth-child(3), .set-grid.head span:nth-child(4) { text-align: center; }
.set-n { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.set-grid input { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; outline: none; width: 100%; font-weight: 700; font-size: 15px; }
.set-grid input::placeholder { color: #5a5a63; font-weight: 600; }
.chk { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.chk svg { width: 20px; height: 20px; fill: var(--text-3); }
.set-grid.done { background: rgba(255,90,31,.1); }
.set-grid.done .chk { background: var(--fire); }
.set-grid.done .chk svg { fill: #fff; }
.set-grid.done .set-n { background: var(--fire); color: #fff; }
.wo-actions { display: flex; gap: 16px; margin-top: 4px; }
.rest {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: min(448px, calc(100% - 32px));
  display: flex; align-items: center; gap: 8px; background: #26262b; border: 1px solid #3a3a42; border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.rest > span { font-size: 12px; color: var(--text-3); text-transform: uppercase; font-weight: 700; }
.rest b { font-size: 22px; font-variant-numeric: tabular-nums; margin-right: auto; }
#workoutBar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 8px); width: min(448px, calc(100% - 32px)); z-index: 20; }
#workoutBar button { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--fire); color: #fff; border-radius: 14px; padding: 12px 14px; font-weight: 700; box-shadow: 0 10px 24px -8px var(--fire); }
#workoutBar span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#workoutBar b { font-variant-numeric: tabular-nums; }
#workoutBar svg { width: 20px; height: 20px; fill: #fff; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.sum-grid div { background: var(--surface-2); border-radius: 14px; padding: 12px; text-align: center; }
.sum-grid b { display: block; font-size: 22px; font-weight: 900; font-style: italic; }
.sum-grid span { font-size: 12px; color: var(--text-3); }
.prs { display: grid; gap: 6px; margin-bottom: 8px; }
.prs div { display: flex; align-items: center; gap: 8px; background: rgba(252,196,25,.1); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.prs svg { width: 18px; height: 18px; fill: #fcc419; flex: none; }
.prs span { flex: 1; }
.earn { display: flex; align-items: center; gap: 10px; background: rgba(255,90,31,.12); border-radius: 12px; padding: 12px; margin: 6px 0 4px; }
.earn svg { width: 22px; height: 22px; fill: var(--fire); flex: none; }
.earn b { color: var(--fire); }

/* Tag-Detail */
.big-body { width: 220px; margin: 6px auto 0; }
.big-body .body { width: 100%; height: auto; }
.wo { background: var(--surface-2); border-color: transparent; }
.wo-ex { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--line); }
.wo-ex .muted { text-align: right; font-size: 12.5px; }
.wo .row-head { margin-bottom: 8px; }
.onb { width: 170px; margin: 0 auto 6px; }
.onb .body { width: 100%; height: auto; }

/* Gym */
.balance { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bal { font-size: 34px; line-height: 1; color: var(--fire); }
.rank { text-align: right; min-width: 0; flex: 1; max-width: 190px; }
.rank .bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin: 6px 0 4px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--fire); border-radius: 3px; }
.room-card {
  position: relative; border-radius: var(--radius); padding: 10px 8px 8px; margin-bottom: 8px; overflow: hidden;
  background: radial-gradient(90% 70% at 50% 35%, #2a2a30 0%, #151518 70%); border: 1px solid var(--line);
}
.room { width: 100%; height: auto; }
.room .item { cursor: pointer; transition: filter .2s; }
.room .item.selected { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px var(--fire)); }
.room-card.placing .item { opacity: .55; pointer-events: none; }
.room .hit { cursor: pointer; stroke-width: 1; }
.room .hit.ok { fill: rgba(64,192,87,.22); stroke: rgba(64,192,87,.7); }
.room .hit.ok:hover { fill: rgba(64,192,87,.45); }
.room .hit.no { fill: rgba(0,0,0,0); stroke: none; }
.room .person { transition: transform 1.6s ease-in-out; cursor: pointer; }
.room .person-inner { animation: bob 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; transition: transform .3s; }
@keyframes bob { 50% { translate: 0 -1.2px; } }
.room .neon { filter: drop-shadow(0 0 2px #ff5a1f) drop-shadow(0 0 6px #ff5a1f); }
.room-bar { display: flex; align-items: center; gap: 8px; padding: 8px 6px 2px; font-size: 13.5px; }
.room-bar > span { flex: 1; }
.room-hint { text-align: center; padding: 4px 8px 4px; }
.shop-cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; text-align: left; }
.cat-head b { flex: 1; font-style: italic; text-transform: uppercase; font-weight: 900; }
.cat-head svg { width: 20px; height: 20px; fill: var(--text-3); }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.shop-cat > .shop-row:first-child { border-top: 0; }
.shop-ic { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; padding: 6px; flex: none; }
.shop-ic svg { width: 100%; height: 100%; }
.shop-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cost {
  min-width: 70px; height: 36px; padding: 0 12px; border-radius: 11px; background: var(--fire); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.cost.locked { background: var(--surface-3); color: var(--text-2); height: 42px; }
.cost small { font-size: 10px; font-weight: 600; color: var(--text-3); }
.cost.ghost { background: var(--surface-3); color: var(--text); }
.owned { font-size: 12.5px; font-weight: 700; color: var(--text-3); min-width: 70px; text-align: center; }

/* Tabbar */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 18px calc(8px + var(--safe-b));
  background: rgba(14,14,16,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
#tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 14px; color: var(--text-3); font-size: 11.5px; font-weight: 700; }
#tabbar svg { width: 24px; height: 24px; fill: currentColor; }
#tabbar button.active { color: #fff; }
#tabbar button.active svg { fill: var(--fire); }

/* Ebenen */
#sheetLayer { position: relative; z-index: 50; }
.layer { position: fixed; inset: 0; }
.layer .backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .25s; }
.layer.open .backdrop { opacity: 1; }
.layer .panel { position: absolute; left: 50%; width: 100%; max-width: 480px; transition: transform .26s cubic-bezier(.2,.8,.2,1); background: var(--bg); }
.layer.sheet .panel {
  bottom: 0; transform: translate(-50%, 100%); border-radius: 22px 22px 0 0; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
}
.layer.sheet.open .panel { transform: translate(-50%, 0); }
.layer.sheet .panel::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
.layer.sheet .panel-body { overflow-y: auto; padding: 8px 18px calc(22px + var(--safe-b)); }
.layer.screen .backdrop { background: var(--bg); }
.layer.screen .panel { top: 0; bottom: 0; transform: translate(-50%, 0) translateX(100vw); }
.layer.screen.open .panel { transform: translate(-50%, 0); }
.layer.screen.workout .panel { transform: translate(-50%, 100%); }
.layer.screen.workout.open .panel { transform: translate(-50%, 0); }
.layer.screen .panel-body { height: 100%; overflow-y: auto; padding: calc(var(--safe-t) + 10px) 16px calc(24px + var(--safe-b)); }
.sheet-title { font-size: 20px; margin: 10px 0 8px; }
.screen-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; position: sticky; top: calc(-10px - var(--safe-t)); background: var(--bg); padding: 6px 0; z-index: 2; }
.screen-head h2 { flex: 1; font-size: 18px; }

#toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, -140%); z-index: 100; max-width: calc(100% - 32px);
  background: #2b2b31; border: 1px solid #3a3a42; border-radius: 14px; padding: 11px 16px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .3s cubic-bezier(.2,.8,.2,1); display: flex; align-items: center; gap: 8px;
}
#toast svg { width: 18px; height: 18px; fill: var(--fire); }
#toast.show { transform: translate(-50%, 0); }

/* ---------- 3D-Gym ---------- */
.room-card { background: radial-gradient(120% 95% at 50% 28%, #4a4440 0%, #2d2a27 58%, #1c1a19 100%); padding: 0 0 6px; }
.room3d { position: relative; width: 100%; aspect-ratio: 1 / .92; }
.gym3d-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; touch-action: pan-y; }
.room-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.room-bar, .room-hint { padding-left: 12px; padding-right: 12px; }
.shop-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shop-ic img:not([src]) { visibility: hidden; }
.top-actions { display: flex; gap: 8px; }
#tabbar button { position: relative; }
#tabbar button.has-dot::after { content: ""; position: absolute; top: 4px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: var(--fire); }

/* ---------- Gym Buddies ---------- */
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-style: italic; flex: none; color: #fff; }
.av.m { background: linear-gradient(135deg, #3f6fd8, #26407e); }
.av.f { background: linear-gradient(135deg, #ef5f7d, #9c2f4a); }
.bud-list { display: grid; gap: 6px; margin: 10px 0; }
.bud-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.bud-name { flex: 1; min-width: 0; text-align: left; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buddy-card { display: flex; align-items: center; gap: 12px; }
.buddy-card .av { width: 52px; height: 52px; font-size: 22px; }
.acct { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 12px; margin: 6px 0 4px; }

/* ---------- Code & Anmeldung ---------- */
body.locked #app, body.locked #sheetLayer { visibility: hidden; }
#authLayer:empty { display: none; }
.auth { position: fixed; inset: 0; z-index: 80; overflow-y: auto; background: radial-gradient(90% 60% at 50% 0%, #3a1a0c 0%, var(--bg) 60%); }
.auth-inner { max-width: 400px; margin: 0 auto; padding: calc(var(--safe-t) + 48px) 24px calc(var(--safe-b) + 32px); display: flex; flex-direction: column; }
.auth-logo { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 14px; display: grid; place-items: center; background: linear-gradient(180deg, var(--fire-2), var(--fire-deep)); box-shadow: 0 14px 36px -12px var(--fire); }
.auth-logo svg { width: 58px; height: 58px; }
.auth-title { text-align: center; font-size: 34px; margin-bottom: 4px; }
.auth h2 { margin: 10px 0 4px; }
.auth-err { min-height: 20px; color: #ff8b8b; text-align: center; font-size: 13.5px; margin: 6px 0; }
.auth-actions { margin-top: 30px; }
.pin { display: flex; justify-content: center; gap: 18px; margin: 26px 0 4px; }
.pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-3); transition: background .15s, border-color .15s; }
.pin i.on { background: var(--fire); border-color: var(--fire); }
.pin.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; justify-content: center; margin-top: 18px; }
.keypad button { width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2); font-size: 28px; font-weight: 600; display: grid; place-items: center; }
.keypad button:active { background: var(--surface-3); }
.keypad button svg { width: 26px; height: 26px; fill: var(--text); }
.auth-form { margin-top: 10px; }
.gender-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gp { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border-radius: 16px; background: var(--surface-2); border: 2px solid transparent; }
.gp.on { border-color: var(--fire); background: rgba(255,90,31,.1); }
.gp-av { width: 64px; height: 64px; }
.inline-row { display: flex; gap: 8px; align-items: center; }
.inline-row input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 14px; outline: none; }
.inline-row input:focus { border-color: var(--fire); }
.inline-row .btn { height: 46px; }
.link.forgot { display: block; margin: -4px 0 6px auto; font-size: 13.5px; }
