:root {
  --bg: #F2F8F3;
  --ink: #1D2B24;
  --muted: #56665D;
  --accent: #1FA971;
  --accent-ink: #167A50;
  --accent-soft: rgba(31, 169, 113, 0.14);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.95);
  --line: rgba(60, 140, 100, 0.16);
  --track: rgba(60, 140, 100, 0.15);
  --shadow: 0 10px 30px rgba(40, 120, 80, 0.12);
  --danger: #B3402E;
  --blob1: #BFEFD6; --blob2: #D9F5B8; --blob3: #CDEBFF;
  --radius: 22px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
.dark {
  --bg: #0F1A15;
  --ink: #E8F3EC;
  --muted: #9DB3A6;
  --accent: #2CC487;
  --accent-ink: #5BDCA5;
  --accent-soft: rgba(44, 196, 135, 0.16);
  --glass: rgba(30, 48, 40, 0.62);
  --glass-strong: rgba(34, 54, 45, 0.85);
  --glass-border: rgba(120, 200, 160, 0.14);
  --line: rgba(120, 200, 160, 0.14);
  --track: rgba(120, 200, 160, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --danger: #FF8A73;
  --blob1: #12513A; --blob2: #2A4A1A; --blob3: #123B52;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blobs i { position: absolute; width: 300px; height: 300px; border-radius: 50%; filter: blur(60px); opacity: .9; }
.blobs i:nth-child(1) { background: var(--blob1); left: -90px; top: -60px; }
.blobs i:nth-child(2) { background: var(--blob2); right: -100px; top: 260px; }
.blobs i:nth-child(3) { background: var(--blob3); left: -40px; bottom: -40px; }

.view { position: relative; z-index: 1; padding: 20px 16px 120px; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px; }

h1, h2 { font-family: var(--display); font-weight: 600; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 15px; margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 800; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 14px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; padding: 10px 12px; border-radius: 18px; }
.list { display: flex; flex-direction: column; gap: 8px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border); font-weight: 800; font-size: 14px; }
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 700; color: #1D2B24; white-space: nowrap; }
.xp { font-size: 12px; font-weight: 800; color: var(--accent-ink); background: var(--accent-soft);
  padding: 4px 8px; border-radius: 999px; white-space: nowrap; }

.ring { --p: 0; --c: var(--accent); width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0); display: grid; place-items: center; }
.ring > div { width: 80%; height: 80%; border-radius: 50%; background: var(--glass-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring.sm { width: 52px; height: 52px; }
.ring .big { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1; }

.bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }

.spheres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 4px; }
.sphere { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  text-align: center; }

.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--c, var(--accent)); flex-shrink: 0;
  display: grid; place-items: center; transition: transform .15s, background .2s; }
.check:active { transform: scale(.88); }
.check.on { background: var(--c, var(--accent)); }
.check.on svg { display: block; }
.check svg { display: none; }
.item { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.title { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 16px; border-radius: 16px; font-weight: 800; background: var(--accent); color: #fff; }
.btn.ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--glass-border); }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-border); flex-shrink: 0; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 14px; text-align: left; width: 100%; }

.tabbar { position: fixed; z-index: 5; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 536px; margin: 0 auto; height: 64px; display: flex; justify-content: space-around; align-items: center;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 24px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: var(--shadow); }
.tab { width: 56px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 10px; font-weight: 700; position: relative; }
.tab.on { color: var(--accent-ink); }
.tab .badge { position: absolute; top: 2px; right: 8px; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
.fab { width: 52px; height: 52px; border-radius: 18px; background: var(--accent); display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(31, 169, 113, 0.35); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--glass-strong); font-size: 15px; font-weight: 600; color: var(--ink); outline: none; }
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 80px; resize: vertical; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 12px; border-radius: 12px; background: var(--glass);
  border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--ink); }
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg.spheres-pick button.on { color: #1D2B24; border-color: transparent; }

.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(10, 25, 18, 0.35); display: flex;
  align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--bg);
  border-radius: 28px 28px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; animation: up .25s ease-out; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; z-index: 30; left: 50%; top: 18px; transform: translate(-50%, -80px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 800;
  transition: transform .3s; max-width: 90vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; z-index: 25; pointer-events: none; width: 100%; height: 100%; }

.path { display: flex; flex-direction: column; gap: 6px; }
.node { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; min-height: 56px; }
.node .dot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--track); border: 3px solid transparent; }
.node.done .dot { background: var(--accent); }
.node.cur .dot { background: var(--glass-strong); border-color: var(--accent); }

.dots { display: flex; gap: 5px; }
.dots i { width: 22px; height: 22px; border-radius: 7px; background: var(--track); display: grid; place-items: center;
  font-style: normal; font-size: 9px; font-weight: 800; color: var(--muted); }
.dots i.off { opacity: .35; }
.dots i.on { background: var(--accent); color: #fff; }

.badges { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.badge-card { flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px;
  text-align: center; font-size: 12px; font-weight: 700; }
.badge-card .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); }
.badge-card.locked { opacity: .5; }
.badge-card.locked .ic { background: var(--track); }
.empty { text-align: center; padding: 24px 12px; color: var(--muted); font-weight: 600; }
.verdict { font-size: 13px; font-weight: 800; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent-ink); }
details summary { cursor: pointer; font-weight: 700; color: var(--muted); list-style: none; padding: 6px 0; }
details summary::-webkit-details-marker { display: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
