:root {
  --bg: #F6F5FB;
  --bg2: #EFEDF8;
  --card: #FFFFFF;
  --ink: #1D1A2F;
  --muted: #8C88A0;
  --line: #E9E6F3;
  --accent: #7B61FF;
  --accent2: #FF6FAE;
  --grad: linear-gradient(135deg, #8B6CFF 0%, #FF7EB3 100%);
  --water: #38A8FF;
  --water2: #8BDBFF;
  --ok: #2EC4A0;
  --fire: #FF7A45;
  --gold: #FFB547;
  --shadow: 0 1px 2px rgba(40, 25, 110, .04), 0 10px 28px -6px rgba(40, 25, 110, .08);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110F1B;
    --bg2: #1F1C2E;
    --card: #1A1727;
    --ink: #F3F1FB;
    --muted: #938FAA;
    --line: #2B2740;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-user-select: none; user-select: none;
}
body::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
  left: -30%; right: -30%; top: -25vh; height: 70vh;
  background:
    radial-gradient(closest-side at 25% 45%, rgba(139, 108, 255, .16), transparent),
    radial-gradient(closest-side at 78% 35%, rgba(255, 126, 179, .14), transparent);
}
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }

#view {
  max-width: 520px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 112px);
  animation: fadein .35s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.hello small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.hello small::first-letter { text-transform: uppercase; }
.hello h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin: 3px 0 0; line-height: 1.15; }
.avatar { position: relative; width: 58px; height: 58px; display: grid; place-items: center; flex: none; }
.avatar .ring { position: absolute; inset: 0; }
.avatar .face { font-size: 27px; }
.lvl-pill {
  position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: 10.5px; font-weight: 800; white-space: nowrap;
  border-radius: 99px; padding: 2px 7px; border: 2px solid var(--bg);
}
.ring-bg { stroke: var(--line); }
.ring-fg { transition: stroke-dashoffset .8s cubic-bezier(.3, .9, .3, 1); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; background: var(--grad);
  border-radius: 28px; padding: 20px; box-shadow: 0 16px 36px -14px rgba(139, 108, 255, .7);
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none;
}
.hero::before { width: 180px; height: 180px; right: -50px; top: -70px; }
.hero::after { width: 110px; height: 110px; right: 60px; bottom: -70px; background: rgba(255, 255, 255, .08); }
.hero-row { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.hero-ring { position: relative; width: 74px; height: 74px; flex: none; }
.hero-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800; }
.hero-ring b small { font-size: 12px; opacity: .8; font-weight: 700; }
.hero h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.hero p { margin: 4px 0 0; font-size: 13.5px; opacity: .9; font-weight: 500; line-height: 1.4; }
.hero-chips { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.hchip {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 99px; padding: 6px 11px; font-size: 12.5px; font-weight: 700;
}
.xpbar { position: relative; z-index: 1; margin-top: 14px; }
.xpbar-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; opacity: .92; margin-bottom: 6px; }
.xpbar .track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.xpbar .track i { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width .8s cubic-bezier(.3, .9, .3, 1); }

/* ---------- week strip ---------- */
.week { display: flex; gap: 4px; margin: 18px 0 4px; }
.wday {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 9px 0 10px;
  border-radius: 18px; font-size: 11px; color: var(--muted); font-weight: 700; transition: background .2s;
}
.wday.sel { background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.wday .mini { position: relative; width: 32px; height: 32px; }
.wday .mini b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ink); }
.wday.perfect .mini b { color: #fff; }
.wday.perfect .mini::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--grad); }

.pastbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  background: rgba(255, 181, 71, .14); color: #B7741A; border-radius: 16px; padding: 10px 14px; font-size: 13px; font-weight: 700;
}
@media (prefers-color-scheme: dark) { .pastbar { color: var(--gold); } }
.pastbar button { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- sections & cards ---------- */
.sec {
  display: flex; align-items: center; gap: 8px; margin: 24px 6px 10px;
  font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.sec .line { flex: 1; height: 1px; background: var(--line); }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 10px; }

.habit {
  width: 100%; display: flex; align-items: center; gap: 13px; text-align: left;
  background: var(--card); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow); margin-bottom: 10px;
  transition: transform .15s ease, background .3s;
}
.habit:active { transform: scale(.975); }
.h-emoji {
  width: 46px; height: 46px; border-radius: 15px; background: var(--bg2); flex: none;
  display: grid; place-items: center; font-size: 23px; transition: transform .3s;
}
.h-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.h-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.h-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub.nudge { color: var(--fire); font-weight: 700; }
.chip {
  flex: none; font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 99px;
  background: rgba(255, 122, 69, .12); color: var(--fire);
}
.h-xp { flex: none; font-size: 11px; font-weight: 800; color: var(--accent); opacity: .75; }
.check {
  width: 32px; height: 32px; flex: none; border-radius: 50%; border: 2.5px solid var(--line);
  display: grid; place-items: center; transition: background .25s, border-color .25s;
}
.check svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 3.4; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.habit.done { background: linear-gradient(135deg, rgba(139, 108, 255, .09), rgba(255, 126, 179, .09)), var(--card); }
.habit.done .check { background: var(--grad); border-color: transparent; box-shadow: 0 5px 14px -3px rgba(139, 108, 255, .65); }
.habit.done .check svg { opacity: 1; }
.habit.done .h-xp { display: none; }
.habit.done .h-emoji { background: var(--card); box-shadow: inset 0 0 0 1.5px rgba(139, 108, 255, .22); }
.habit.pop .check { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.habit.pop .check svg { stroke-dasharray: 24; animation: draw .4s .08s ease both; }
.habit.pop .h-emoji { animation: wiggle .55s ease; }
@keyframes pop { 0% { transform: scale(.55); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0) scale(1); } 30% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(9deg) scale(1.08); } }

/* ---------- water ---------- */
.water-head { display: flex; align-items: center; gap: 13px; }
.water-amt { font-size: 13px; color: var(--muted); font-weight: 600; }
.water-amt b { color: var(--ink); font-size: 17px; font-weight: 800; }
.wbtns { display: flex; gap: 8px; }
.wbtn {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  background: var(--bg2); font-size: 22px; font-weight: 600; line-height: 1; transition: transform .15s;
}
.wbtn.plus { background: linear-gradient(135deg, var(--water2), var(--water)); color: #fff; box-shadow: 0 6px 14px -5px rgba(56, 168, 255, .8); }
.wbtn:active { transform: scale(.9); }
.glasses { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0 12px; }
.glass {
  position: relative; overflow: hidden; aspect-ratio: 1 / 1.05; border-radius: 9px 9px 15px 15px;
  background: var(--bg2); transition: transform .15s;
}
.glass::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, var(--water2), var(--water)); border-radius: 0 0 15px 15px;
  transition: height .45s cubic-bezier(.3, 1.4, .5, 1);
}
.glass.full::after { height: 82%; }
.glass.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.glass:active { transform: scale(.92); }
.wbar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.wbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--water2), var(--water)); transition: width .5s; }
.water.done .wbar i { background: linear-gradient(90deg, var(--water), #2EC4A0); }
.wfoot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- run card ---------- */
.runcard {
  position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: 18px; margin-bottom: 10px;
  background: linear-gradient(140deg, #FF9F7A 0%, #FF6FAE 100%); box-shadow: 0 14px 30px -14px rgba(255, 111, 140, .8);
}
.runcard.rest { background: linear-gradient(140deg, #A495FF 0%, #78A6FF 100%); box-shadow: 0 14px 30px -14px rgba(120, 140, 255, .8); }
.runcard.ran { background: linear-gradient(140deg, #34D1A8 0%, #22A7D1 100%); box-shadow: 0 14px 30px -14px rgba(34, 167, 209, .8); }
.runcard::after { content: '👟'; position: absolute; right: -8px; bottom: -18px; font-size: 92px; opacity: .18; transform: rotate(-18deg); }
.runcard .kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.runcard h3 { margin: 4px 0 2px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.runcard p { margin: 0; font-size: 13.5px; opacity: .92; font-weight: 500; line-height: 1.4; max-width: 85%; }
.runcard .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; position: relative; z-index: 1; }
.pillbtn {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #FF5E8E;
  font-weight: 800; font-size: 15px; padding: 11px 18px; border-radius: 99px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.runcard.rest .pillbtn { color: #6E7BFF; }
.runcard.ran .pillbtn { color: #1C9BB8; }
.pillbtn:active { transform: scale(.95); }
.wdots { display: flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 700; }
.wdots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.wdots i.on { background: #fff; }

.quote { text-align: center; color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 26px 20px 6px; line-height: 1.5; }

/* ---------- buttons & forms ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 16px; border-radius: 18px; font-weight: 800; font-size: 16px;
  background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(139, 108, 255, .8); transition: transform .15s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--bg2); color: var(--ink); box-shadow: none; }
.btn.danger { background: rgba(255, 90, 110, .12); color: #E5485F; box-shadow: none; }
.btn + .btn { margin-top: 10px; }
.link { display: block; margin: 14px auto 0; color: var(--muted); font-size: 13.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; padding-bottom: 2px; }
.field:first-child { padding-top: 2px; }
.field label { font-weight: 700; font-size: 15px; }
.field small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.input, .select {
  background: var(--bg2); border: 1.5px solid transparent; border-radius: 13px; padding: 10px 12px; font-size: 15px; font-weight: 600;
  outline: none; min-width: 0; transition: border-color .2s;
}
.input:focus, .select:focus { border-color: var(--accent); }
.select { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--line); flex: none; transition: background .25s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s cubic-bezier(.3, 1.3, .5, 1); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

.addrow { display: flex; gap: 8px; margin-top: 12px; }
.addrow .emoji-in { width: 52px; text-align: center; font-size: 20px; padding: 8px 4px; }
.addrow .name-in { flex: 1; }
.seg { display: flex; background: var(--bg2); border-radius: 14px; padding: 4px; gap: 4px; margin-top: 10px; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.mylist .item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mylist .item:last-child { border-bottom: 0; }
.mylist .item .e { font-size: 22px; width: 32px; text-align: center; }
.mylist .item .n { flex: 1; font-weight: 700; }
.mylist .item .n small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.xbtn { width: 34px; height: 34px; border-radius: 11px; background: var(--bg2); color: var(--muted); font-size: 18px; display: grid; place-items: center; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 13px; line-height: 1.55; font-weight: 500; }
.note b { color: var(--ink); }

/* ---------- run tab ---------- */
.pagetitle { font-size: 28px; font-weight: 800; letter-spacing: -.025em; margin: 6px 4px 4px; }
.pagesub { color: var(--muted); font-weight: 600; font-size: 14px; margin: 0 4px 16px; }
.prog { display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; align-items: center; gap: 10px; }
.prow .wk { width: 44px; font-size: 12px; font-weight: 800; color: var(--muted); }
.prow .dots { flex: 1; display: grid; gap: 8px; }
.sdot {
  height: 44px; border-radius: 14px; background: var(--bg2); display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--muted); transition: transform .15s;
}
.sdot:active { transform: scale(.94); }
.sdot.done { background: linear-gradient(135deg, rgba(46, 196, 160, .2), rgba(34, 167, 209, .2)); color: var(--ok); }
.sdot.next { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.sdot.sel { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px rgba(139, 108, 255, .9); }
.timeline { display: flex; gap: 2px; height: 34px; border-radius: 12px; overflow: hidden; margin: 14px 0 10px; }
.timeline i { display: block; min-width: 2px; }
.t-run { background: linear-gradient(180deg, #FF9F7A, #FF6FAE); }
.t-walk { background: linear-gradient(180deg, #5EE0BE, #2BB5D8); }
.t-warm, .t-cool { background: linear-gradient(180deg, #B4A6FF, #8DA2FF); }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 700; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.detail h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.detail .meta { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 3px; }
.detail .desc { font-weight: 600; font-size: 15px; margin-top: 12px; line-height: 1.45; }
.runlog .r { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.runlog .r:last-child { border-bottom: 0; }
.runlog .r .e { width: 38px; height: 38px; border-radius: 12px; background: var(--bg2); display: grid; place-items: center; font-size: 18px; }
.runlog .r .n { flex: 1; font-weight: 700; font-size: 14.5px; }
.runlog .r .n small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- timer ---------- */
.timer {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; color: #fff;
  padding: calc(env(safe-area-inset-top) + 14px) 22px calc(env(safe-area-inset-bottom) + 26px);
  background: linear-gradient(160deg, #A495FF, #7D8EFF); transition: background .6s;
}
.timer[hidden] { display: none; }
.timer[data-phase="run"] { background: linear-gradient(160deg, #FF9A72, #FF5C98); }
.timer[data-phase="walk"] { background: linear-gradient(160deg, #36D3A9, #1E9FCB); }
.timer[data-phase="done"] { background: var(--grad); }
.t-top { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.t-x { width: 40px; height: 40px; border-radius: 14px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 18px; }
.t-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.t-phase { font-size: 46px; font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; line-height: 1; }
.t-sub { font-size: 15px; font-weight: 600; opacity: .9; }
.t-ring { position: relative; width: min(70vw, 300px); aspect-ratio: 1; margin: 18px 0 8px; }
.t-ring svg { width: 100%; height: 100%; }
.t-ring circle { fill: none; }
.t-ring .bg { stroke: rgba(255, 255, 255, .22); }
.t-ring .fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.t-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.t-time b { font-size: 66px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.t-time span { font-size: 14px; font-weight: 700; opacity: .85; margin-top: 6px; }
.t-next { font-size: 15px; font-weight: 700; opacity: .92; min-height: 22px; }
.t-bar { display: flex; gap: 3px; height: 8px; margin: 20px 0 6px; }
.t-bar i { position: relative; display: block; border-radius: 99px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.t-bar i u { position: absolute; inset: 0 auto 0 0; background: #fff; text-decoration: none; }
.t-bar-meta { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; opacity: .88; font-variant-numeric: tabular-nums; }
.t-ctrl { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 22px; }
.t-btn { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.t-btn svg { width: 24px; height: 24px; fill: #fff; }
.t-play { width: 84px; height: 84px; background: #fff; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .35); }
.t-play svg { width: 32px; height: 32px; fill: #FF5C98; }
.timer[data-phase="walk"] .t-play svg { fill: #1E9FCB; }
.timer[data-phase="warm"] .t-play svg, .timer[data-phase="cool"] .t-play svg { fill: #7D8EFF; }
.timer.paused .t-ring { opacity: .6; }
.t-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.t-done .big { font-size: 84px; animation: pop .7s cubic-bezier(.3, 1.6, .5, 1); }
.t-done h2 { font-size: 32px; margin: 6px 0 0; font-weight: 800; letter-spacing: -.02em; }
.t-done p { margin: 0; font-size: 16px; font-weight: 600; opacity: .92; }
.t-done .xp { margin-top: 14px; background: rgba(255, 255, 255, .22); border-radius: 99px; padding: 8px 18px; font-weight: 800; font-size: 18px; }
.timer .btn.white { background: #fff; color: #7B61FF; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .4); }

/* ---------- stats ---------- */
.lvlcard { text-align: center; padding: 24px 18px 20px; }
.lvlcard .bigav { position: relative; width: 112px; height: 112px; margin: 0 auto 10px; display: grid; place-items: center; }
.lvlcard .bigav .ring { position: absolute; inset: 0; }
.lvlcard .bigav span { font-size: 52px; }
.lvlcard h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.lvlcard .t { color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 2px; }
.gbar { height: 10px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: 16px 0 8px; }
.gbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tile { background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.tile .e { font-size: 20px; }
.tile b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.tile span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--bg2); }
.heat i.l1 { background: rgba(139, 108, 255, .25); }
.heat i.l2 { background: rgba(139, 108, 255, .5); }
.heat i.l3 { background: rgba(139, 108, 255, .78); }
.heat i.l4 { background: var(--grad); }
.heat i.fut { background: transparent; }
.heat i.today { box-shadow: 0 0 0 2px var(--accent2); }
.heatleg { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.heatleg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hrow .e { font-size: 20px; width: 28px; text-align: center; }
.hrow .n { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.hrow .n small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; }
.hdots { display: flex; gap: 4px; }
.hdots i { width: 12px; height: 12px; border-radius: 50%; background: var(--bg2); }
.hdots i.on { background: var(--grad); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  background: var(--card); border-radius: 20px; padding: 14px 8px 12px; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.badge .e {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, rgba(139, 108, 255, .16), rgba(255, 126, 179, .16));
}
.badge b { font-size: 12.5px; font-weight: 800; line-height: 1.2; }
.badge small { font-size: 10.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.badge.locked .e { filter: grayscale(1); opacity: .35; background: var(--bg2); }
.badge.locked b { color: var(--muted); }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px); width: min(calc(100% - 24px), 440px);
  display: flex; padding: 7px; gap: 4px; border-radius: 26px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border: 1px solid var(--line); box-shadow: 0 14px 34px -12px rgba(40, 25, 110, .25);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px;
  border-radius: 19px; font-size: 10.5px; font-weight: 700; color: var(--muted); transition: background .2s, color .2s;
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--accent); background: rgba(139, 108, 255, .11); }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(16, 10, 36, .38); opacity: 0; transition: opacity .3s; }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; max-height: 88dvh; overflow: auto;
  background: var(--card); border-radius: 30px 30px 0 0; padding: 12px 22px calc(env(safe-area-inset-bottom) + 22px);
  transform: translateY(105%); transition: transform .42s cubic-bezier(.2, .9, .3, 1);
}
.sheet-card::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 16px; }
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-card { transform: none; }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; text-align: center; }
.sheet p { margin: 0 0 18px; color: var(--muted); font-weight: 500; font-size: 14.5px; line-height: 1.5; text-align: center; }
.sheet .bigemoji { font-size: 72px; text-align: center; margin: 4px 0 6px; animation: pop .7s cubic-bezier(.3, 1.6, .5, 1); }
.sheet .input { width: 100%; margin-bottom: 14px; padding: 14px; text-align: center; font-size: 17px; }

/* ---------- toasts / fx ---------- */
.toasts { position: fixed; z-index: 70; top: calc(env(safe-area-inset-top) + 10px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: 420px; width: 100%;
  background: var(--card); color: var(--ink); border-radius: 20px; padding: 12px 16px;
  box-shadow: 0 14px 36px -10px rgba(40, 25, 110, .35); border: 1px solid var(--line);
  animation: tin .45s cubic-bezier(.2, 1.3, .4, 1) both;
}
.toast.out { animation: tout .3s ease forwards; }
.toast .e { font-size: 28px; }
.toast b { display: block; font-size: 14.5px; font-weight: 800; }
.toast small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
@keyframes tin { from { opacity: 0; transform: translateY(-20px) scale(.95); } }
@keyframes tout { to { opacity: 0; transform: translateY(-14px) scale(.96); } }
.fx {
  position: fixed; z-index: 65; pointer-events: none; font-weight: 800; font-size: 15px; color: var(--accent);
  animation: rise 1s cubic-bezier(.2, .8, .3, 1) forwards; text-shadow: 0 2px 10px rgba(139, 108, 255, .35);
}
.fx.water { color: var(--water); }
@keyframes rise { 0% { opacity: 0; transform: translateY(6px) scale(.8); } 20% { opacity: 1; transform: translateY(-8px) scale(1.1); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 🛡️ omejitve (cigarete, sladkarije, OH) ---------- */
.limit .h-sub b { color: var(--ink); font-weight: 800; }
.limit.ok { background: linear-gradient(135deg, rgba(46, 196, 160, .08), rgba(56, 168, 255, .06)), var(--card); }
.limit.over { background: linear-gradient(135deg, rgba(255, 90, 110, .1), rgba(255, 159, 122, .08)), var(--card); }
.limit.over .h-sub { color: #E5485F; font-weight: 600; }
.limit.pop .shield-ic { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.shield-ic { font-size: 20px; flex: none; }
.chip.shield { background: rgba(46, 196, 160, .14); color: var(--ok); }
.lrow { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.lbtn {
  flex: 1; padding: 10px 6px; border-radius: 13px; background: var(--bg2); font-size: 14px; font-weight: 800;
  transition: transform .15s; white-space: nowrap;
}
.lbtn:active { transform: scale(.93); }
.lbtn.minus { flex: .8; color: var(--muted); }
.lbtn.on { background: rgba(255, 90, 110, .12); color: #E5485F; }
.wbtn.warm { background: linear-gradient(135deg, #FFB08A, #FF7A8A); box-shadow: 0 6px 14px -5px rgba(255, 122, 138, .8); }
.cigs { flex: 1; display: flex; gap: 6px; }
.cigs i { flex: 1; max-width: 34px; height: 12px; border-radius: 99px; background: var(--bg2); transition: background .3s; }
.cigs i.on { background: linear-gradient(90deg, #FFC58A, #FF9F7A); }
.cigs i.over { background: #FF5A6E; }
.cbar { position: relative; height: 10px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 12px; }
.cbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7EE0B5, #2EC4A0); transition: width .5s; }
.limit.over .cbar i { background: linear-gradient(90deg, #FF9F7A, #FF5A6E); }

/* ---------- ⚖️ teža ---------- */
.kgrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.kgrow .input { margin: 0; flex: 1; font-size: 26px; font-weight: 800; }
.kgrow .wbtn { width: 52px; height: 52px; font-size: 26px; }
.wstat { display: flex; gap: 24px; margin-bottom: 8px; }
.wstat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.wstat b.down { color: var(--ok); }
.wstat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.wchart { width: 100%; height: auto; overflow: visible; }
.wchart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.wchart .ax { fill: var(--muted); font-size: 10px; font-weight: 600; }
.wchart .wline { fill: none; stroke: url(#gg); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wchart .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.wchart .hit { fill: transparent; }
.wchart .tip { fill: var(--ink); font-size: 11px; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .15s; paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
.wchart .wpt:hover .tip, .wchart .wpt:focus .tip, .wchart .wpt:last-of-type .tip { opacity: 1; }
.wchart .wpt:focus { outline: none; }
.wchart .wpt:hover .dot, .wchart .wpt:focus .dot { r: 6; }

/* ---------- 🎮 igra: liga, izzivi, combo, trgovina ---------- */
button.hchip { color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; }
.hchip.hot { background: rgba(255, 255, 255, .34); }
.hero-hint { position: relative; z-index: 1; margin-top: 10px; font-size: 12px; font-weight: 700; opacity: .9; }
.gamestrip { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 12px; }
.gtile {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 12px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow); min-width: 0; transition: transform .15s;
}
.gtile:active { transform: scale(.97); }
.gtile .ge {
  width: 38px; height: 38px; border-radius: 13px; flex: none; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, var(--c1, #B4A6FF), var(--c2, #8B6CFF));
}
.gtile.chall .ge { background: linear-gradient(135deg, #FFD66B, #FF9F7A); }
.gtile b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtile small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtile > span:last-child { min-width: 0; }

.combo {
  display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; padding: 9px 14px; border-radius: 16px;
  border: 1.5px dashed var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.combo .cl { flex: 1; }
.combo .ci { display: flex; gap: 4px; }
.combo .ci i { font-style: normal; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--bg2); filter: grayscale(1); opacity: .5; font-size: 14px; }
.combo .ci i.on { filter: none; opacity: 1; background: rgba(139, 108, 255, .15); }
.combo b { color: var(--accent); font-weight: 800; white-space: nowrap; }
.combo.done { border-style: solid; border-color: transparent; background: linear-gradient(135deg, rgba(139, 108, 255, .14), rgba(255, 126, 179, .14)); color: var(--ink); }

.moodcard .mlabel { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 2px 6px; }
.mrow { display: flex; gap: 6px; }
.mbtn { flex: 1; height: 44px; border-radius: 14px; background: var(--bg2); font-size: 22px; transition: transform .15s, background .2s; filter: grayscale(.6); }
.mbtn:active { transform: scale(.9); }
.mbtn.on { background: linear-gradient(135deg, rgba(139, 108, 255, .22), rgba(255, 126, 179, .22)); filter: none; transform: scale(1.06); box-shadow: inset 0 0 0 2px var(--accent); }
.moodcard.done { background: linear-gradient(135deg, rgba(139, 108, 255, .07), rgba(255, 126, 179, .07)), var(--card); }

.cigmeta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cigmeta b { color: var(--ink); }

.leaguehero {
  display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 28px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 16px 34px -16px var(--c2);
}
.leaguehero .lh-e { font-size: 54px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
.leaguehero h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 1px 8px rgba(0, 0, 0, .15); }
.leaguehero p { margin: 3px 0 0; font-weight: 700; font-size: 14px; text-shadow: 0 1px 6px rgba(0, 0, 0, .15); }
.leaguehero .lh-s { font-size: 12.5px; opacity: .92; }
.tiers { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 14px 0; }
.tiers span { font-size: 20px; filter: grayscale(1); opacity: .35; }
.tiers span.past { opacity: .7; filter: none; }
.tiers span.on { filter: none; opacity: 1; font-size: 30px; }
.tiers i { width: 14px; height: 2px; background: var(--line); border-radius: 2px; }
.ltable { padding: 8px 10px; }
.lrow2 { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 14px; font-size: 14px; }
.lrow2 .pos { width: 26px; text-align: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.lrow2 .av { width: 32px; height: 32px; border-radius: 11px; background: var(--bg2); display: grid; place-items: center; font-size: 17px; }
.lrow2 .nm { flex: 1; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow2 b { font-weight: 800; font-variant-numeric: tabular-nums; }
.lrow2.me { background: linear-gradient(135deg, rgba(139, 108, 255, .16), rgba(255, 126, 179, .16)); box-shadow: inset 0 0 0 1.5px rgba(139, 108, 255, .4); }
.lrow2.me .nm { color: var(--accent); }
.zline { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 6px 8px 4px; display: flex; align-items: center; gap: 8px; }
.zline::after { content: ''; flex: 1; height: 1.5px; border-radius: 2px; background: currentColor; opacity: .3; }
.zline.up { color: var(--ok); }
.zline.down { color: #E5485F; }

.chcard { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 13px 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.chcard .ce { width: 42px; height: 42px; border-radius: 14px; background: var(--bg2); display: grid; place-items: center; font-size: 21px; flex: none; }
.chcard .cb { flex: 1; min-width: 0; }
.chcard .cb b { font-size: 14.5px; font-weight: 700; }
.chcard .cb small { color: var(--muted); font-weight: 700; font-size: 12px; }
.cbar2 { height: 7px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: 7px 0 4px; }
.cbar2 i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFD66B, #FF9F7A); transition: width .5s; }
.chcard .cx { font-size: 12px; font-weight: 800; color: var(--accent); }
.chcard.done { background: linear-gradient(135deg, rgba(46, 196, 160, .1), rgba(56, 168, 255, .08)), var(--card); }
.chcard.done .cbar2 i { background: linear-gradient(90deg, #7EE0B5, #2EC4A0); }

.coins { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.coins .cbig { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.coins small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.sitem { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sitem .se { width: 40px; height: 40px; border-radius: 13px; background: var(--bg2); display: grid; place-items: center; font-size: 20px; flex: none; }
.sitem .sn { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; }
.sitem .sn small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.buy { padding: 9px 12px; border-radius: 13px; background: linear-gradient(135deg, #FFD66B, #FFAE5C); color: #6B3F00; font-weight: 800; font-size: 13.5px; white-space: nowrap; box-shadow: 0 6px 14px -8px rgba(240, 168, 48, .9); }
.buy.off { background: var(--bg2); color: var(--muted); box-shadow: none; }
.hist { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.hist:last-child { border-bottom: 0; }
.hist small { color: var(--muted); font-weight: 600; font-size: 12px; text-align: right; }

.ins { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ins:last-child { border-bottom: 0; }
.ins span { font-size: 22px; }
.ins p { margin: 0; font-size: 14px; line-height: 1.45; font-weight: 500; }

.wrap { background: var(--bg2); border-radius: 18px; padding: 6px 14px; margin-bottom: 14px; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.wrow:last-child { border-bottom: 0; }
.wrow .e { width: 24px; text-align: center; }
.wrow .l { flex: 1; font-weight: 600; color: var(--muted); }
.wrow b { font-weight: 800; }
.cmp { font-size: 12px; font-weight: 800; min-width: 54px; text-align: right; }
.cmp.up { color: var(--ok); }
.cmp.down { color: #E5485F; }
.cmp.eq { color: var(--muted); }
.wrap-league { text-align: center; font-weight: 800; font-size: 14.5px; padding: 12px; border-radius: 16px; margin-bottom: 12px; background: var(--bg2); }
.wrap-league.up { background: linear-gradient(135deg, rgba(46, 196, 160, .18), rgba(56, 168, 255, .14)); color: var(--ok); }
.wrap-league.down { background: rgba(255, 90, 110, .1); color: #E5485F; }
.sheet .wrap-note { text-align: left; color: var(--ink); font-size: 14px; }
