@import url('https://fonts.googleapis.com/css2?family=Anton&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root {
  --bg: #0c0f14;
  --bg-2: #141922;
  --card: #171d27;
  --card-2: #1e2633;
  --line: #273142;
  --ink: #f3f6fa;
  --muted: #8d99ad;
  --lime: #c6ff3d;
  --lime-ink: #14210a;
  --fire: #ff6b2c;
  --fire-2: #ffb02e;
  --sky: #45b6ff;
  --violet: #a97bff;
  --red: #ff5a5f;
  --radius: 18px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --big: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; background:
  radial-gradient(600px 300px at 90% -10%, rgba(198,255,61,.10), transparent 60%),
  radial-gradient(500px 300px at -10% 10%, rgba(69,182,255,.08), transparent 60%), var(--bg); background-attachment: fixed; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.big { font-family: var(--big); font-weight: 400; letter-spacing: .01em; line-height: .95; }

#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 0 12px; }
.brand { font-family: var(--big); font-size: 26px; letter-spacing: .02em; text-transform: uppercase; }
.brand i { font-style: normal; color: var(--lime); }
.brand small { font-family: var(--font); font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 6px; letter-spacing: .04em; text-transform: none; }
.me-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 700; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--card-2); color: var(--lime); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.viewing { background: rgba(69,182,255,.12); color: var(--sky); border: 1px solid rgba(69,182,255,.3); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.viewing button { border: 0; background: none; color: var(--sky); font-weight: 700; text-decoration: underline; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0 12px calc(10px + env(safe-area-inset-bottom)); z-index: 10; pointer-events: none; }
.tabs .in { display: flex; width: 100%; max-width: 520px; background: rgba(23,29,39,.92); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(14px); padding: 6px; pointer-events: auto; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 0; font-size: 11px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 16px; letter-spacing: .03em; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--lime-ink); background: var(--lime); }

/* hero: level + streak */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 12px; }
.level { background: linear-gradient(135deg, #1d2838, #171d27); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.level .title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.level .name { font-family: var(--big); font-size: 30px; margin: 4px 0 2px; text-transform: uppercase; }
.level .name em { font-style: normal; color: var(--lime); }
.xpbar { height: 10px; background: #0d1219; border-radius: 99px; overflow: hidden; margin-top: 8px; border: 1px solid var(--line); }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), #7cf0a1); border-radius: 99px; box-shadow: 0 0 12px rgba(198,255,61,.6); }
.xpnote { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.flame { width: 104px; background: linear-gradient(180deg, rgba(255,107,44,.22), rgba(255,107,44,.05)); border: 1px solid rgba(255,107,44,.4); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; }
.flame svg { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(255,107,44,.7)); }
.flame.cold { background: var(--card); border-color: var(--line); }
.flame.cold svg { filter: none; opacity: .35; }
.flame b { font-family: var(--big); font-size: 34px; line-height: 1; color: var(--fire-2); }
.flame.cold b { color: var(--muted); }
.flame span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* quest */
.quest { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px dashed rgba(198,255,61,.45); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.quest .q-ico { width: 38px; height: 38px; border-radius: 12px; background: rgba(198,255,61,.14); color: var(--lime); display: grid; place-items: center; flex: none; }
.quest b { display: block; font-size: 15px; }
.quest span { font-size: 13px; color: var(--muted); }
.quest.done { border-style: solid; border-color: var(--lime); background: rgba(198,255,61,.08); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.setno { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 14px; }
.setno .big { font-size: 46px; text-transform: uppercase; }
.setno .big em { font-style: normal; color: var(--lime); }
.setno small { color: var(--muted); font-weight: 600; font-size: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card-2); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 15px; min-height: 44px; white-space: nowrap; transition: transform .12s; }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); box-shadow: 0 0 18px rgba(198,255,61,.35); }
.chip.ghost { color: var(--muted); border-style: dashed; background: none; }
.chips.small .chip { padding: 7px 12px; font-size: 13px; min-height: 36px; border-radius: 12px; }
.chips.small .chip.on { background: var(--sky); border-color: var(--sky); color: #04121d; box-shadow: none; }

/* rep counter */
.counter { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0 6px; }
.counter .step { width: 54px; height: 54px; border-radius: 16px; border: 1px solid var(--line); background: var(--card-2); font-size: 26px; font-weight: 700; color: var(--ink); }
.counter .step:active { transform: scale(.92); }
.tapper { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 40%, #232d3c, #141a23); box-shadow: inset 0 0 0 3px var(--line), 0 0 0 6px rgba(198,255,61,.06); display: grid; place-items: center; padding: 0; transition: transform .08s; }
.tapper:active { transform: scale(.96); }
.tapper svg.ring { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); }
.tapper svg.ring circle { fill: none; stroke-width: 8; }
.tapper .val { font-family: var(--big); font-size: 76px; line-height: 1; }
.tapper .u { position: absolute; bottom: 30px; left: 0; right: 0; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.tapper.bump .val { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(1.18); color: var(--lime); } }
.tap-hint { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.tap-hint b { color: var(--fire-2); }

.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.date-btn { position: relative; border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.date-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; }

.btn { border: 0; border-radius: 16px; padding: 17px 18px; font-weight: 800; font-size: 18px; background: var(--lime); color: var(--lime-ink); width: 100%; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 8px 24px rgba(198,255,61,.25); transition: transform .1s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; }
.btn.light { background: var(--card-2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 16px; }
.btn.danger { background: none; color: var(--red); border: 1px solid rgba(255,90,95,.4); box-shadow: none; text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 16px; }
.link { border: 0; background: none; color: var(--lime); font-weight: 700; padding: 6px 0; }
.link.muted { color: var(--muted); font-weight: 600; }

.today-list { margin: 0; padding: 0; list-style: none; }
.today-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.today-list li:last-child { border-bottom: 0; }
.today-list .n { color: var(--muted); font-size: 13px; margin-right: 6px; }
.today-list b { font-family: var(--big); font-size: 22px; font-weight: 400; color: var(--lime); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-family: var(--big); font-weight: 400; font-size: 30px; line-height: 1; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat.lime b { color: var(--lime); } .stat.fire b { color: var(--fire-2); } .stat.sky b { color: var(--sky); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.bars .b i { display: block; width: 100%; background: linear-gradient(180deg, var(--lime), #4aa36a); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.bars .b.now i { box-shadow: 0 0 16px rgba(198,255,61,.5); }
.bars .b small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.bars .b em { font-size: 12px; font-style: normal; font-weight: 700; }

.pbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pb-card { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.pb-card b { font-family: var(--big); font-weight: 400; font-size: 34px; line-height: 1; color: var(--fire-2); display: block; }
.pb-card strong { display: block; font-size: 14px; margin-top: 4px; }
.pb-card span { font-size: 12px; color: var(--muted); }

.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { text-align: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px 10px; }
.badge .medal { width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 210deg, var(--c1), var(--c2), var(--c1)); color: #0c0f14; box-shadow: 0 0 16px color-mix(in srgb, var(--c1) 45%, transparent); }
.badge .medal svg { width: 22px; height: 22px; }
.badge b { display: block; font-size: 12px; line-height: 1.2; }
.badge span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.badge.locked .medal { background: #222a37; box-shadow: none; color: #4a5568; }
.badge.locked b { color: var(--muted); }

.byex { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.byex:last-child { border-bottom: 0; }
.byex b { font-family: var(--big); font-weight: 400; font-size: 20px; }

/* book */
.filter { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.filter .chip { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.book { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.book .month { background: var(--bg-2); padding: 11px 14px; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); }
.book .month b { font-family: var(--big); font-weight: 400; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
.book .month span { color: var(--muted); font-weight: 600; font-size: 13px; }
.line { display: grid; grid-template-columns: 46px 1fr 50px 52px; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 15px; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: var(--ink); }
.line:last-child { border-bottom: 0; }
.line .no { color: var(--muted); font-size: 13px; font-weight: 600; }
.line .amt { text-align: right; font-family: var(--big); font-size: 20px; color: var(--lime); }
.line .dt { text-align: right; color: var(--muted); font-size: 13px; }
.line .var { color: var(--muted); font-size: 13px; }
.line .pb { display: inline-block; margin-left: 6px; background: var(--fire); color: #1b0a02; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; vertical-align: 2px; letter-spacing: .04em; }
.line.check { background: rgba(255,176,46,.08); }
.line.check .no { color: var(--fire-2); }
.line.check .no::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fire-2); margin-left: 4px; vertical-align: middle; }
.line.skip { grid-template-columns: 1fr; color: var(--muted); font-style: italic; font-size: 14px; }
.line.skip b { color: var(--fire-2); font-style: normal; }
.line.note { grid-template-columns: 1fr auto; color: var(--violet); font-weight: 600; font-size: 14px; }
.line.mile { grid-template-columns: 1fr; text-align: center; color: var(--lime); font-family: var(--big); font-size: 16px; letter-spacing: .08em; background: rgba(198,255,61,.06); }

/* family */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 8px 0 16px; }
.pod { text-align: center; border: 0; background: none; padding: 0; color: var(--ink); }
.pod .avatar { width: 54px; height: 54px; margin: 0 auto 6px; font-size: 18px; border: 3px solid var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 50%, transparent); }
.pod.p1 .avatar { width: 68px; height: 68px; font-size: 22px; }
.pod .crown { color: var(--fire-2); height: 22px; display: grid; place-items: center; }
.pod .crown svg { width: 26px; height: 20px; filter: drop-shadow(0 0 8px rgba(255,176,46,.7)); }
.pod .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .block { margin-top: 8px; border-radius: 14px 14px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 35%, #171d27), #171d27); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); padding: 10px 4px; }
.pod .block b { font-family: var(--big); font-weight: 400; font-size: 30px; display: block; line-height: 1; }
.pod .block span { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.pod.p1 .block { height: 118px; } .pod.p2 .block { height: 92px; } .pod.p3 .block { height: 74px; }
.fam { display: grid; grid-template-columns: 26px 40px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; color: var(--ink); }
.fam.me { border-color: rgba(198,255,61,.5); }
.fam .rank { font-family: var(--big); color: var(--muted); font-size: 20px; text-align: center; }
.fam .who b { display: block; font-size: 15px; }
.fam .who span { font-size: 12px; color: var(--muted); }
.fam .who .fire { color: var(--fire-2); font-weight: 700; }
.fam .score { text-align: right; }
.fam .score b { display: block; font-family: var(--big); font-weight: 400; font-size: 24px; color: var(--lime); }
.fam .score span { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.fam .avatar { width: 40px; height: 40px; }

/* sheets */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px); }
.sheet { background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0 0 14px; font-family: var(--big); font-weight: 400; font-size: 28px; text-transform: uppercase; letter-spacing: .02em; }
.sheet p.sub { margin: -6px 0 14px; color: var(--muted); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: var(--card); font-size: 16px; color-scheme: dark; }
.field input:focus, .field select:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.stack { display: grid; gap: 8px; margin-top: 8px; }
.days { display: flex; gap: 6px; }
.days button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 0; font-weight: 700; }
.days button.on { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.member { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member span { font-size: 13px; color: var(--muted); }

/* toast + celebration */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--card-2); border: 1px solid var(--line); color: var(--ink); padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 30; max-width: 90vw; text-align: center; animation: pop .2s ease-out; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px); } }
.celebrate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--c, #c6ff3d) 22%, #0c0f14), rgba(12,15,20,.97) 65%); backdrop-filter: blur(6px); animation: fade .2s ease-out; text-align: center; padding: 24px; }
@keyframes fade { from { opacity: 0; } }
.celebrate .kicker { font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: var(--c, var(--lime)); }
.celebrate .huge { font-family: var(--big); font-size: 120px; line-height: .9; color: var(--c, var(--lime)); text-shadow: 0 0 40px color-mix(in srgb, var(--c, var(--lime)) 60%, transparent); animation: slam .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } }
.celebrate .what { font-family: var(--big); font-size: 30px; text-transform: uppercase; margin-top: 6px; }
.celebrate .msg { color: var(--muted); font-weight: 600; margin-top: 10px; max-width: 300px; }
.celebrate .tapclose { margin-top: 28px; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; }

/* sign in */
.signin { min-height: 92dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; }
.signin .logo { width: 96px; height: 96px; border-radius: 28px; background: var(--lime); display: grid; place-items: center; color: var(--lime-ink); box-shadow: 0 0 50px rgba(198,255,61,.35); margin-bottom: 10px; }
.signin .logo svg { width: 56px; height: 56px; }
.signin h1 { font-family: var(--big); font-weight: 400; font-size: 64px; margin: 0; text-transform: uppercase; line-height: 1; }
.signin h1 i { font-style: normal; color: var(--lime); }
.signin p { color: var(--muted); margin: 0 0 18px; max-width: 290px; font-weight: 500; }
.signin .err { color: var(--red); font-weight: 600; max-width: 320px; }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
