:root {
  --bg: #0f0f14; --card: #1a1a22; --card2: #23232e; --line: #2c2c3a;
  --text: #f4f4f7; --muted: #9a9aa8; --accent: #ff5c7a; --accent-d: #d93f5c;
  --gold: #ffc24b; --ok: #3ecf8e; --heat: 239, 68, 68;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; }
#app { max-width: 480px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 18px; margin: 20px 0 10px; } h3 { font-size: 17px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: var(--text); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--card); font-size: 18px; }
.btn { display: block; width: 100%; padding: 14px; border-radius: 14px; background: var(--accent); font-weight: 700; text-align: center; }
.btn:active { background: var(--accent-d); }
.btn.ghost { background: var(--card2); }
.btn.sm { display: inline-block; width: auto; padding: 8px 14px; border-radius: 10px; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.bar { height: 10px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width .3s; }

/* login */
.login { min-height: 90dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; }
.dots { display: flex; gap: 14px; } .dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.keypad button { height: 76px; border-radius: 50%; background: var(--card); font-size: 28px; }
.keypad button:active { background: var(--card2); }
.keypad .blank { visibility: hidden; }

/* home */
.day { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.day .num { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--card2); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.day.next { border-color: var(--accent); } .day.next .num { background: var(--accent); }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--accent); }
.badge.gold { background: var(--gold); color: #1a1a22; }
.resume { border-color: var(--gold); }

/* workout */
.check { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.box { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; }
.on > .box, .box.on { background: var(--ok); border-color: var(--ok); color: #0b2a1c; }
.vid { padding: 8px 12px; border-radius: 10px; background: var(--card2); font-size: 14px; white-space: nowrap; }
.sug { margin: 8px 0 4px; font-size: 14px; color: var(--gold); }
.last { font-size: 13px; color: var(--muted); }
.set { display: grid; grid-template-columns: 24px 1fr 1fr 48px; gap: 8px; align-items: end; margin-top: 10px; }
.set .n { padding-bottom: 12px; color: var(--muted); font-weight: 700; }
.set label { display: block; font-size: 12px; color: var(--muted); }
.set input { width: 100%; margin-top: 2px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-size: 18px; text-align: center; }
.tick { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--line); font-size: 22px; font-weight: 800; color: var(--muted); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #0b2a1c; }
.fb { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.fb-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.fb-btns button { padding: 10px; border-radius: 12px; background: var(--card2); font-size: 14px; border: 2px solid transparent; }
.fb-btns button.on { border-color: var(--accent); }
.fb-msg { margin-top: 8px; font-size: 14px; color: var(--gold); }
.finish { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
.finish .btn { max-width: 448px; margin: 0 auto; }

/* summary */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-size: 24px; } .stat span { font-size: 13px; color: var(--muted); }
.bodies { display: flex; justify-content: center; gap: 8px; }
.bodies figure { margin: 0; flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.bodies svg { width: 100%; height: auto; }
.body-base { fill: #2c2c3a; }
.legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { padding: 4px 10px; border-radius: 99px; font-size: 13px; border: 1px solid rgba(var(--heat), .7); }

/* progress / achievements */
.weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.weeks i { height: 10px; border-radius: 99px; background: var(--card2); } .weeks i.on { background: var(--ok); }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ach { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.ach .ic { font-size: 30px; } .ach.lock { opacity: .4; filter: grayscale(1); }
.ach b { display: block; margin-top: 4px; font-size: 14px; } .ach span { font-size: 12px; color: var(--muted); }
.list-item { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.nav button { flex: 1; max-width: 150px; padding: 8px 0; border-radius: 12px; font-size: 13px; color: var(--muted); }
.nav button b { display: block; font-size: 20px; } .nav button.on { color: var(--text); background: var(--card2); }

/* toasts */
#toasts { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 440px; width: 100%; padding: 12px 16px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: pop .25s; }
.toast.gold { background: linear-gradient(135deg, #3a2c0a, #2a1f06); border-color: var(--gold); }
.toast.gold b { color: var(--gold); }
@keyframes pop { from { transform: translateY(-14px) scale(.96); opacity: 0; } }

/* video modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { width: 100%; max-width: 480px; background: var(--card); border-radius: 22px 22px 0 0; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); animation: up .25s; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tip { margin-top: 10px; font-size: 14px; color: var(--muted); }
.link { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 14px; }

/* öneri / geri bildirim ayrımı */
:root { --info: #6ab7ff; }
.fb-msg { color: var(--info); }
.sug.applied, .applied { color: var(--ok); }
.mini { margin-top: 6px; padding: 7px 12px; border-radius: 10px; background: var(--accent); font-size: 13px; font-weight: 700; color: #fff; }
.sug.applied .mini, .applied + .mini { background: var(--card2); font-weight: 500; }

/* dinlenme sayacı */
.rest { position: fixed; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 20; max-width: 456px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 16px;
  background: var(--card2); border: 2px solid var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.rest small { display: block; color: var(--muted); font-size: 12px; }
.rest b { font-size: 26px; font-variant-numeric: tabular-nums; }
.rest .btns { display: flex; gap: 6px; }
.rest .btns .mini { margin: 0; background: var(--line); }
.rest.done { border-color: var(--ok); } .rest.done b { color: var(--ok); }

/* sync etiketi, grafik */
.sync { color: var(--muted); }
.sync.err { color: var(--gold); }
.chart-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; text-align: center; }
.chart-stats div { background: var(--card2); border-radius: 12px; padding: 8px 2px; }
.chart-stats b { display: block; font-size: 16px; } .chart-stats span { font-size: 11px; color: var(--muted); }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .ax { stroke: var(--line); stroke-width: 1; }
.chart-svg text { fill: var(--muted); font-size: 10px; }
.chart-svg .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .ar { fill: rgba(255, 92, 122, .15); }
.chart-svg circle { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.hist { max-height: 34vh; overflow: auto; margin-top: 8px; }
.hist .list-item { font-size: 14px; }
.vid.chart { margin-left: 6px; }
.head-btns { display: flex; gap: 6px; }

.elapsed { min-width: 52px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* görselleştirme */
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-t b { font-size: 20px; } .ring-t span { font-size: 11px; color: var(--muted); }
.pips { display: flex; gap: 6px; margin: 8px 0; }
.pips i { flex: 1; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--card2); color: var(--muted); font-style: normal; font-weight: 700; font-size: 13px; }
.pips i.on { background: var(--ok); color: #0b2a1c; }
.mb { flex: none; width: 64px; opacity: .95; } .mb.big { width: 96px; }
.mini-body { width: 100%; height: auto; display: block; }

.card.ex { position: relative; overflow: hidden; }
.card.ex > *:not(.exbg) { position: relative; z-index: 1; }
.exbg { position: absolute; right: -2px; top: 30px; width: 42%; max-width: 160px; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%); mask-image: linear-gradient(to right, transparent, #000 45%); }
.move { width: 100%; height: auto; display: block; fill: none; }
.move .limb { stroke: rgba(255, 255, 255, .22); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.move .hd { fill: rgba(255, 255, 255, .22); }
.move .eq { stroke: rgba(255, 255, 255, .1); stroke-width: 3; stroke-linecap: round; }
.move .mk1 { fill: rgba(255, 92, 122, .22); } .move .mk2 { fill: rgba(255, 92, 122, .6); }
.sdots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 2px; }
.sdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); }
.sdots i.on { background: var(--ok); border-color: var(--ok); }

.video-move { display: flex; flex-direction: column; align-items: center; margin-top: 10px; }
.video-move .move { max-width: 220px; } .video-move small { color: var(--muted); font-size: 12px; }
.video-move .move .limb, .video-move .move .hd { stroke: rgba(255, 255, 255, .55); }
.video-move .move .hd { fill: rgba(255, 255, 255, .55); stroke: none; }
.video-move .move .eq { stroke: rgba(255, 255, 255, .2); }

:root { --d0: #ff5c7a; --d1: #ffc24b; --d2: #6ab7ff; --d3: #3ecf8e; }
.sbars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.sb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.sb i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; margin: 2px 0; }
.sb em { font-style: normal; font-size: 10px; color: var(--muted); }
.sb small { font-size: 9px; color: var(--muted); white-space: nowrap; }
i.d0 { background: var(--d0); } i.d1 { background: var(--d1); } i.d2 { background: var(--d2); } i.d3 { background: var(--d3); }
.mrow { display: grid; grid-template-columns: 78px 1fr 28px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.mrow .bar { height: 8px; } .mrow em { font-style: normal; color: var(--muted); text-align: right; }
.bar.thin { height: 5px; margin: 8px 0 3px; }
.ach small { display: block; font-size: 11px; color: var(--muted); }
.ach.got { border-color: rgba(255, 194, 75, .55); background: linear-gradient(160deg, #2a2412, var(--card) 60%); }
.ach.got .ic { filter: drop-shadow(0 0 8px rgba(255, 194, 75, .45)); }
.ach.lock { opacity: .62; }
