:root {
  --bg: #0d1c19;
  --bg2: #133029;
  --card: #172f2a;
  --card2: #1e3d36;
  --card3: #24493f;
  --line: #2a4d45;
  --text: #eef6f3;
  --muted: #94b3aa;
  --accent: #5fe0a8;
  --accent2: #3cc4d6;
  --grad: linear-gradient(135deg, #5fe0a8, #3cc4d6);
  --sos: linear-gradient(135deg, #ff9a6b, #ff6f91);
  --gold: linear-gradient(90deg, #ffd166, #ffb347);
  --on-accent: #08201a;
  --warn: #ff8a7a;
  --lost: #ff8a7a;
  --radius: 22px;
  --shadow: 0 10px 30px -18px #000;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f8f6;
    --bg2: #e2f1ea;
    --card: #ffffff;
    --card2: #eef5f2;
    --card3: #e2eeea;
    --line: #d7e6e0;
    --text: #12302a;
    --muted: #5d7a72;
    --accent: #1fb57a;
    --accent2: #1a9fb3;
    --grad: linear-gradient(135deg, #2bc386, #1fa8bd);
    --on-accent: #ffffff;
    --warn: #d4513f;
    --lost: #f08c7c;
    --shadow: 0 10px 30px -20px #12302a55;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(120% 50% at 50% -8%, var(--bg2), var(--bg) 62%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 23px; }
h3 { font-size: 17px; }
p { margin: 0 0 10px; }
small { display: block; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; }

.top { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
main.enter > * { animation: rise-in .35s ease-out both; }
main.enter > *:nth-child(2) { animation-delay: .03s; }
main.enter > *:nth-child(3) { animation-delay: .06s; }
main.enter > *:nth-child(4) { animation-delay: .09s; }
main.enter > *:nth-child(n+5) { animation-delay: .12s; }
.page-title { font-size: 30px; margin-top: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.glow { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 15%, var(--card)), var(--card) 70%); }

/* Приветствие и отметка дня */
.hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hello h1 { font-size: 28px; margin: 4px 0 2px; }
.hello p { margin: 0; }
.streak-pill, .wins-pill { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: 15px; }
.wins-pill { margin-left: auto; font-size: 13px; padding: 4px 10px; }
.checkin h3 { margin-bottom: 10px; }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood { border: 1px solid var(--line); background: var(--card2); border-radius: 16px; padding: 10px 2px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s; }
.mood span { font-size: 28px; line-height: 1; }
.mood small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mood:active { transform: scale(.92); }
.done-ci { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.ci-mood { font-size: 34px; }

.phrase .label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 800; margin-bottom: 6px; }
.phrase p { font-size: 19px; font-weight: 650; margin: 0 0 4px; text-wrap: pretty; }
.icon-btn { border: 0; background: var(--card2); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 15px; }

.sos {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 0; border-radius: var(--radius); padding: 18px 16px; cursor: pointer;
  background: var(--sos); color: #2a0d12;
  box-shadow: 0 14px 34px -14px #ff6f91;
  position: relative; overflow: hidden;
}
.sos::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #ffffff40 50%, transparent 70%); transform: translateX(-100%); animation: shine 4s ease-in-out infinite 1s; }
.sos b { font-size: 19px; display: block; }
.sos small { opacity: .85; }
.sos-icon { font-size: 32px; }
.sos-arrow { margin-left: auto; font-size: 24px; font-weight: 800; }
.sos:active { transform: scale(.98); }

/* Привычки */
.list { display: flex; flex-direction: column; gap: 12px; }
.habit { display: block; transition: transform .15s; }
.habit:active { transform: scale(.99); }
.habit-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emoji { flex: none; font-size: 32px; width: 54px; height: 54px; display: grid; place-items: center; background: var(--card2); border-radius: 18px; }
.habit-name { font-weight: 800; font-size: 19px; }
.habit-name small { font-weight: 500; font-size: 13px; color: var(--muted); }
.habit-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.habit-foot b { color: var(--text); }
.saved { color: var(--accent); font-weight: 800; }
.planned { border-style: dashed; }
.countdown { background: var(--card2); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
.countdown b { color: var(--accent); }
.countdown.big { font-size: 20px; margin: 12px 0; }

.timer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.timer span { background: var(--card2); border-radius: 14px; padding: 7px 0 6px; }
.timer b { display: block; font-size: 25px; font-variant-numeric: tabular-nums; font-weight: 850; }
.timer small { font-size: 11px; color: var(--muted); }
.timer.big b { font-size: 36px; }
.timer.big span { padding: 12px 0 9px; background: color-mix(in srgb, var(--card2) 80%, transparent); }

.bar { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .9s linear; }
.bar.gold i { background: var(--gold); }

.hero { text-align: center; }
.hero h1 { font-size: 27px; }
.big-emoji { font-size: 58px; line-height: 1; margin-bottom: 8px; }
.big-emoji.locked { filter: grayscale(1); opacity: .4; }
.back { color: var(--muted); font-size: 15px; align-self: flex-start; padding: 4px 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px; position: relative; }
.stat b { font-size: 21px; display: block; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 13px; }
.stat-ico { position: absolute; top: 12px; right: 12px; font-size: 18px; opacity: .8; }

.milestones, .history, .prep { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 10px; }
.milestones li { display: flex; gap: 12px; align-items: center; opacity: .5; }
.milestones li.done { opacity: 1; }
.milestones small, .history small { color: var(--muted); font-size: 13px; }
.history li { display: flex; gap: 10px; align-items: flex-start; }
.prep li { background: var(--card2); border-radius: 14px; padding: 10px 12px; font-size: 15px; }
.dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.done .dot { background: var(--grad); border-color: transparent; color: var(--on-accent); }
.insight { display: flex; gap: 12px; align-items: flex-start; }
.insight > span { font-size: 28px; }
.helpline { display: flex; align-items: center; gap: 12px; }
.helpline > span { font-size: 26px; }

/* Цель и награды */
.goal { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.goal-head { display: flex; align-items: center; gap: 12px; }
.goal-head b { font-size: 18px; }
.goal-emoji { font-size: 30px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--card2); border-radius: 16px; flex: none; }
.goal-pct { margin-left: auto; font-weight: 850; font-size: 20px; color: #ffc15e; }
.goal .btn { align-self: flex-start; margin-top: 6px; }
.badge-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.badge-emoji { font-size: 30px; }
.chev { margin-left: auto; color: var(--muted); font-size: 24px; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge { border: 1px solid var(--line); background: var(--card2); border-radius: 16px; padding: 10px 4px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.badge span { font-size: 28px; filter: grayscale(1); opacity: .35; }
.badge small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.15; }
.badge.got { background: linear-gradient(160deg, color-mix(in srgb, #ffd166 18%, var(--card2)), var(--card2)); border-color: color-mix(in srgb, #ffd166 40%, var(--line)); }
.badge.got span { filter: none; opacity: 1; }
.badge.got small { color: var(--text); }

/* Кнопки */
.btn {
  border: 1px solid transparent; border-radius: 15px; padding: 13px 16px; font-weight: 750; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; transition: transform .12s, opacity .2s;
}
.btn.primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 10px 24px -14px var(--accent); }
.btn.ghost { background: var(--card); border-color: var(--line); }
.btn.danger { color: var(--warn); }
.btn.danger-fill { background: var(--warn); color: #fff; }
.btn.small { padding: 9px 13px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.big-btn { padding: 16px; font-size: 17px; }
.btn.dashed { border-style: dashed; background: transparent; color: var(--muted); }
.btn.muted-btn { background: transparent; border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.center-btn { align-self: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

/* Отвлечься */
.group-title { margin: 8px 0 -4px; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 14px; position: relative; transition: transform .15s; }
.tile-emoji { font-size: 30px; margin-bottom: 4px; line-height: 1.1; }
.tile b { font-size: 16px; }
.tile small { color: var(--muted); font-size: 13px; }
.tile-best { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 11px; font-weight: 700; background: var(--card2); border-radius: 99px; padding: 2px 7px; color: var(--muted); }
.tile:active { transform: scale(.97); }
.grid.small .tile { padding: 10px 12px; flex-direction: row; align-items: center; gap: 8px; }
.grid.small .tile-emoji { font-size: 22px; margin: 0; }
.grid.small .tile b { font-size: 14px; }

.empty { text-align: center; padding: 28px 18px; }

/* Мотивация */
.reasons { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.reasons li { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card2); border-radius: 12px; padding: 9px 12px; }
.x { border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact .btn { grid-column: 1 / -1; }
input, select, textarea {
  background: var(--card2); border: 1px solid var(--line); border-radius: 13px; padding: 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.hours { display: flex; gap: 8px; align-items: center; margin: 10px 0; color: var(--muted); }
.hours select { width: auto; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 650; }
.switch input { display: none; }
.switch span { flex: none; width: 50px; height: 30px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); position: relative; transition: .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 23px; background: #fff; }
.letter { font-size: 18px; line-height: 1.6; text-align: left; white-space: normal; }
.letter small { margin-top: 12px; text-align: right; }
.steps-list { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 0 0 8px; }

/* Прогресс */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 130px; margin-top: 8px; }
.chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.chart .stack { width: 100%; min-height: 2px; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: var(--card2); }
.chart .stack i { display: block; min-height: 0; }
.chart small { font-size: 10px; color: var(--muted); }
i.won { background: var(--accent); }
i.lost { background: var(--lost); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.insight-line { background: var(--card2); border-radius: 12px; padding: 9px 12px; font-size: 14px; margin: 8px 0 0; }
.hours-map { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 6px; }
.hours-map i { height: 30px; border-radius: 4px; background: var(--accent); }
.hours-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.trig-bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.trig-bars li { display: grid; grid-template-columns: 130px 1fr 26px; align-items: center; gap: 8px; font-size: 14px; }
.trig-bars .bar { margin: 0; }
.trig-bars b { text-align: right; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal small { font-size: 11px; color: var(--muted); }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--card2); font-size: 12px; color: var(--muted); }
.cal-day.has { background: color-mix(in srgb, var(--accent) 22%, var(--card2)); font-size: 18px; }
.cal-day.today { outline: 2px solid var(--accent); }
.cal-day.future { opacity: .35; }

/* Нижняя навигация */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; z-index: 30;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; color: var(--muted); padding: 5px 2px; border-radius: 14px; transition: background .2s; }
.tab span { font-size: 22px; filter: grayscale(1); opacity: .65; transition: .2s; }
.tab.on { color: var(--text); background: var(--card); }
.tab.on span { filter: none; opacity: 1; transform: translateY(-1px); }

#toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  width: min(92vw, 480px); background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 16px;
  font-weight: 650; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; text-align: center; box-shadow: 0 12px 30px -10px #0008;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Листы */
.sheet-wrap { position: fixed; inset: 0; background: #000a; z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-wrap.out { opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; background: var(--bg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; overscroll-behavior: contain;
  border-radius: 26px 26px 0 0; padding: 26px 16px calc(22px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2, .9, .3, 1.1);
  display: flex; flex-direction: column; gap: 12px; transition: transform .15s;
}
.sheet.tall { max-height: 94vh; }
.grip { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 99px; background: var(--line); }
.sheet h2 { padding-right: 44px; }
.close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; cursor: pointer; z-index: 2; line-height: 1; }
.sheet form { display: flex; flex-direction: column; gap: 12px; }
.field-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
div.field-label { flex-direction: row; align-items: baseline; gap: 4px; margin-top: 4px; }
.field-label b { color: var(--text); font-size: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 8px 13px; cursor: pointer; font-size: 14px; transition: .15s; }
.chip.on { background: var(--grad); color: var(--on-accent); border-color: transparent; font-weight: 750; }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.emo { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.emo.on { border-color: var(--accent); background: var(--card2); box-shadow: 0 0 0 2px var(--accent); }
.reason-pop { background: var(--card2); border-radius: 16px; padding: 12px 14px; font-weight: 650; }
.tip-card { background: color-mix(in srgb, #ffd166 12%, var(--card)); border: 1px solid color-mix(in srgb, #ffd166 30%, var(--line)); border-radius: 16px; padding: 12px 14px; margin: 0; font-size: 15px; }
.celebrate { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: stretch; padding-top: 6px; }
.celebrate h2 { padding: 0; }

/* Ползунок силы тяги */
.lvl { -webkit-appearance: none; appearance: none; height: 12px; padding: 0; border: 0; border-radius: 99px; background: linear-gradient(90deg, #5fe0a8, #ffd166 50%, #ff6f91) ; position: relative; }
.lvl::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid var(--bg); box-shadow: 0 2px 8px #0006; cursor: pointer; }
.lvl::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--bg); box-shadow: 0 2px 8px #0006; cursor: pointer; }
.lvl:focus { outline: none; }
.lvl-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: -4px; }

/* Подсказанные занятия */
.sug { display: flex; flex-direction: column; gap: 8px; }
.sug-item { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 12px 14px; cursor: pointer; }
.sug-item small { color: var(--muted); font-size: 13px; }
.sug-item .tile-emoji { margin: 0; }
.sug-item.first { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 20%, var(--card)), var(--card)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.all-acts summary { cursor: pointer; color: var(--muted); font-weight: 650; padding: 6px 0; list-style: none; }
.all-acts summary::after { content: ' ▾'; }
.all-acts[open] summary::after { content: ' ▴'; }
.all-acts .grid { margin-top: 8px; }

/* Знакомство */
.onboard { position: fixed; inset: 0; z-index: 80; background: radial-gradient(120% 60% at 50% 0%, var(--bg2), var(--bg) 65%), var(--bg); overflow: auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.onboard.out { opacity: 0; transition: opacity .25s; }
.ob-top { max-width: 520px; margin: 0 auto 10px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 10px; min-height: 40px; }
.ob-back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 18px; }
.ob-body { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.ob-hero { text-align: center; padding: 16px 0 4px; }
.ob-hero h1 { font-size: 36px; margin-top: 12px; }
.lead { font-size: 19px; color: var(--muted); }
.ob-points, .ob-plan { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ob-points li, .ob-plan li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.ob-points li > span, .ob-plan li > span { font-size: 26px; line-height: 1.1; }
.ob-points small, .ob-plan small { color: var(--muted); font-size: 14px; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ob-grid.small { grid-template-columns: 1fr 1fr 1fr; }
.ob-tile { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 16px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; transition: .15s; text-align: center; }
.ob-tile span { font-size: 34px; line-height: 1; }
.ob-grid.small .ob-tile { padding: 12px 6px; font-size: 13px; }
.ob-grid.small .ob-tile span { font-size: 26px; }
.ob-tile.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); box-shadow: 0 0 0 2px var(--accent) inset; }
.ob-tile:active { transform: scale(.96); }
.ob-options { display: flex; flex-direction: column; gap: 8px; }
.ob-opt { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px 16px; cursor: pointer; }
.ob-opt b { font-size: 17px; }
.ob-opt small { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ob-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.switch.card { padding: 14px 16px; }
.steps { display: flex; gap: 6px; justify-content: center; }
.steps i { display: block; height: 6px; flex: 1; max-width: 44px; border-radius: 99px; background: var(--card3); transition: .3s; }
.steps i.done { background: var(--accent); opacity: .55; }
.steps i.on { background: var(--grad); }

/* Занятия */
.activity {
  position: fixed; inset: 0; z-index: 50; background: radial-gradient(120% 60% at 50% 0%, var(--bg2), var(--bg) 65%), var(--bg); overflow: auto; animation: fade .2s;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
}
.activity.out { opacity: 0; transition: opacity .18s; }
.activity > .close { position: fixed; top: calc(14px + env(safe-area-inset-top)); }
.act-body { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; padding-top: 34px; }
.finish { display: flex; flex-direction: column; gap: 10px; margin-top: 4vh; }
.finish .field-label { justify-content: center; }

.ring { position: relative; width: min(70vw, 270px); aspect-ratio: 1; margin: 16px auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: var(--card2); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1s linear; }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-emoji { font-size: 40px; animation: bob 3s ease-in-out infinite; }
.ring-num { font-size: 48px; font-variant-numeric: tabular-nums; }
.tip { font-size: 18px; font-weight: 650; min-height: 3em; text-wrap: pretty; }

.breath { position: relative; height: min(84vw, 330px); display: grid; place-items: center; }
.orb-ring { position: absolute; width: 66%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.orb { position: absolute; width: 44%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9f9e5, var(--accent) 45%, var(--accent2)); box-shadow: 0 0 70px -6px color-mix(in srgb, var(--accent) 70%, transparent); transition: transform 4s ease-in-out; transform: scale(.62); }
.orb.grow, .orb.hold { transform: scale(1.45); }
.orb.shrink, .orb.rest { transform: scale(.62); }
.breath-text { position: relative; font-size: 22px; color: var(--on-accent); color: #08201a; display: flex; flex-direction: column; align-items: center; }
.breath-text small { font-size: 34px; font-weight: 850; }

.game-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 16px; }
.combo { color: #ffc15e; font-weight: 800; }
.field { position: relative; height: 64vh; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; touch-action: manipulation; }
.bubble {
  position: absolute; bottom: -100px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 30% 30%, #ffffffdd, #9ff2d9 22%, #3cc4d688 60%, #3cc4d633);
  box-shadow: inset 0 0 12px #ffffff55;
  animation: rise linear forwards;
}
.bubble.gold { background: radial-gradient(circle at 30% 30%, #fff, #ffe27a 30%, #ffb02099 70%); }
.bubble.pop { animation: pop .18s ease-out forwards !important; }

.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; perspective: 800px; align-items: start; }
.mcard { display: block; width: 100%; aspect-ratio: 1 / 1; border: 0; background: none; padding: 0; cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform .35s; }
.mcard span { position: absolute; inset: 0; border-radius: 14px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mcard .mback { background: var(--grad); }
.mcard .mback::after { content: '✦'; color: var(--on-accent); opacity: .5; font-size: 20px; }
.mcard .mface { background: var(--card2); border: 1px solid var(--line); font-size: 34px; transform: rotateY(180deg); }
.mcard.open { transform: rotateY(180deg); }
.mcard.ok .mface { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--card)); }

.react { border: 0; border-radius: var(--radius); height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 30px; color: #fff; transition: background .1s; touch-action: manipulation; }
.react small { font-size: 15px; opacity: .85; }
.react.wait { background: #b24a5a; }
.react.go { background: #2bb673; }
.react.early { background: #d98a2b; }
.react.show { background: var(--card2); color: var(--text); }

.mq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 10px; }
.mq-text { font-size: 44px; font-variant-numeric: tabular-nums; }
.mopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mopt { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 20px 0; font-size: 26px; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums; }
.mopt.ok { background: var(--accent); color: var(--on-accent); }
.mopt.bad { background: var(--lost); color: #fff; }

.ex { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 2vh; }
.ex-emoji { font-size: 84px; animation: bob 1.2s ease-in-out infinite; }
.ex-name { font-size: 24px; }
.ex-time { font-size: 80px; font-weight: 850; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }

.task { padding: 30px 18px; }
.task-text { font-size: 22px; font-weight: 750; margin: 0; }
.ground { margin: 4vh 0 1vh; }
.ground b { font-size: 100px; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ground p { font-size: 22px; font-weight: 650; }
.reason-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.reason-list li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; font-size: 18px; font-weight: 650; animation: rise-in .4s ease-out both; }
.letter-input { min-height: 180px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.2s ease-in forwards; }

.fade-in { animation: fade .4s ease-out; }
.pop-in { animation: popin .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes rise { to { transform: translateY(calc(-64vh - 120px)); } }
@keyframes pop { to { transform: scale(1.6); opacity: 0; } }
@keyframes fall { to { top: 105vh; transform: translateX(40px) rotate(720deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(60px); opacity: .4; } }
@keyframes rise-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes shine { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

@media (max-width: 360px) {
  .timer b { font-size: 21px; }
  .ob-grid.small { grid-template-columns: 1fr 1fr; }
  .trig-bars li { grid-template-columns: 110px 1fr 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Профиль Family */
.account { display: flex; flex-direction: column; gap: 10px; }
.account.on { background: linear-gradient(160deg, color-mix(in srgb, var(--accent2) 14%, var(--card)), var(--card) 70%); }
.acc-head { display: flex; align-items: center; gap: 12px; }
.acc-ico { font-size: 26px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--card2); border-radius: 16px; flex: none; }
