:root {
  --bg: #f4f0fb;
  --card: rgba(255, 255, 255, .82);
  --line: #ebe4f6;
  --ink: #2b2340;
  --muted: #7c7393;
  --accent: #8b6ad8;
  --accent2: #6c4cc4;
  --accent-soft: #ece5fb;
  --gold: #e3a93c;
  --gold-soft: #f8e7b5;
  --ok: #2fae7a;
  --shadow: 0 8px 28px rgba(91, 63, 153, .10);
  --r: 22px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; background: radial-gradient(120% 60% at 50% 0%, #fbf8ff 0%, var(--bg) 60%) fixed; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
#app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 0 12px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 75%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: #fff; background: linear-gradient(135deg, #a98be8, var(--accent2)); box-shadow: 0 6px 14px rgba(108, 76, 196, .3); flex: none; }
.b-title { font-weight: 750; font-size: 17px; }
.b-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-chip { flex: none; padding: 8px 12px; border-radius: 999px; background: linear-gradient(135deg, #fff1cc, var(--gold-soft)); color: #8a5a10; font-weight: 750; font-size: 14px; box-shadow: 0 4px 12px rgba(227, 169, 60, .25); }
.score-chip.bump { animation: bump .6s; }
@keyframes bump { 30% { transform: scale(1.18); } }

.screen { display: none; }
.screen.on { display: block; animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.card { background: var(--card); border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.eyebrow { font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 650; }
.c-title { font-weight: 750; font-size: 17px; margin-bottom: 6px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
p.muted { font-size: 14px; line-height: 1.45; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent2); font-weight: 650; white-space: nowrap; }
.primary { display: block; width: 100%; padding: 14px; border-radius: 16px; font-weight: 750; font-size: 16px; color: #fff; background: linear-gradient(135deg, #a083e6, var(--accent2)); box-shadow: 0 8px 18px rgba(108, 76, 196, .3); }
.primary:active, .do:active { transform: scale(.97); }
.ghost { padding: 8px 12px; border-radius: 999px; background: #fff; color: var(--accent2); font-weight: 650; font-size: 13px; border: 1px solid var(--line); }

/* пробный режим */
.demo-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 10px; border-radius: 14px; background: #fff7e3; border: 1px dashed #edc97a; font-size: 12.5px; color: #8a5a10; }
.demo-bar .grow { flex: 1; min-width: 0; }
.demo-bar button { padding: 5px 9px; border-radius: 9px; background: #fff; border: 1px solid #f0d9a6; font-size: 12.5px; }
.demo-bar:empty { display: none; }

/* сегодня */
.today .t-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.today .t-date { font-size: 12.5px; color: var(--muted); }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 18px; background: var(--accent-soft); }
.task.k-task .ic { background: #fdf0d6; }
.task .tx { flex: 1; min-width: 0; }
.task .tt { font-weight: 650; font-size: 15px; }
.task .tm { font-size: 12px; color: var(--muted); margin-top: 1px; }
.task .tm.late { color: #c2642c; }
.do { flex: none; padding: 9px 12px; border-radius: 12px; font-weight: 700; font-size: 13.5px; color: #fff; background: linear-gradient(135deg, #a083e6, var(--accent2)); transition: transform .15s; }
.task.done .ic { background: linear-gradient(135deg, #ffe7a3, var(--gold)); }
.task.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(124, 115, 147, .5); }
.task .ok { flex: none; font-size: 13px; color: var(--ok); font-weight: 700; }
.empty { text-align: center; padding: 14px 4px 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.countdown { text-align: center; padding: 6px 0 4px; }
.countdown b { display: block; font-size: 44px; line-height: 1; color: var(--accent2); }

/* карта */
.map-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .9); overflow: hidden; margin-bottom: 12px; }
.map-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; }
.mh-title { font-weight: 750; font-size: 16px; margin-top: 2px; }
.map3d { position: relative; height: 70vh; min-height: 420px; }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.map-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .8); font-size: 12px; color: var(--muted); pointer-events: none; animation: hintfade 1s 4s forwards; }
@keyframes hintfade { to { opacity: 0; } }
.map-scroll[hidden] { display: none; }
.map-scroll { height: 68vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.map-svg { display: block; width: 100%; height: auto; }
.dlabel text { stroke: rgba(255, 255, 255, .85); stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.dl-week { font-size: 10px; letter-spacing: .14em; fill: #8d83a6; font-weight: 700; }
.dl-name { font-size: 15px; fill: #3b3157; font-weight: 750; }
.dl-grow { font-size: 11.5px; fill: #b07a1e; font-weight: 700; }
.road-base { fill: none; stroke: #fff; stroke-width: 22; stroke-linecap: round; opacity: .9; }
.road-dash { fill: none; stroke: #e2d8f2; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.road-done { fill: none; stroke: url(#road); stroke-width: 8; stroke-linecap: round; opacity: .9; }

.pt { cursor: pointer; }
.pt .body { fill: #fff; stroke: #d9cfee; stroke-width: 2.5; filter: url(#sh); transition: fill .3s, stroke .3s; }
.pt .halo { fill: none; stroke: none; }
.pt .num { text-anchor: middle; font-size: 14px; font-weight: 800; fill: #9a90b2; pointer-events: none; }
.pt .num.small { font-size: 10.5px; letter-spacing: .04em; }
.pt-finish .num { font-size: 20px; }
.pt .badge { display: none; }
.pt .badge circle { fill: #fff; stroke: var(--gold); stroke-width: 1.5; }
.pt .badge text { text-anchor: middle; font-size: 10px; fill: var(--gold); font-weight: 800; }
.pt.s-locked { opacity: .55; }
.pt.s-open .body { stroke: var(--accent); stroke-width: 3; }
.pt.s-open .num { fill: var(--accent2); }
.pt.s-open .halo { stroke: var(--accent); stroke-width: 2; opacity: .5; animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
.pt.s-done .body { fill: url(#gold); stroke: #f7d68a; }
.pt.s-done .num { fill: #fff; }
.pt.s-done .badge { display: block; }
.pt.s-missed .body { fill: #ece8f2; stroke: #cfc8dc; stroke-dasharray: 4 3; }
.pt.s-missed .num { fill: #b4adc4; }
.pt-start.s-done .num, .pt-start.s-open .num { fill: var(--accent2); }
.pt-start.s-done .body { fill: #fff; stroke: var(--gold); }
.pt.pop .body { animation: popb .8s; transform-box: fill-box; transform-origin: center; }
@keyframes popb { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 70% { transform: scale(.92); } 100% { transform: scale(1); } }
.hero-mark { transition: transform 1.1s cubic-bezier(.5, 0, .2, 1); pointer-events: none; }
.hero-mark image { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.float-score { text-anchor: middle; font-weight: 800; font-size: 18px; fill: #c9861c; stroke: #fff; stroke-width: 3; paint-order: stroke; animation: floatup 1.3s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-38px); opacity: 0; } }
.spark { fill: #f2c25a; animation: spark .9s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

/* героиня */
.hero-card { position: relative; height: 58vh; min-height: 360px; border-radius: var(--r); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow);
  background: radial-gradient(90% 70% at 50% 35%, #ffffff 0%, #eef8f3 45%, #d7ece2 100%); }
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.hero-over { position: absolute; left: 16px; top: 14px; pointer-events: none; }
.h-name { font-size: 22px; font-weight: 800; margin-top: 2px; }
.h-sub { font-size: 13px; color: var(--muted); }
.h-level { position: absolute; right: 14px; top: 14px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .85); font-weight: 750; font-size: 14px; }
.h-level small { color: var(--muted); font-weight: 600; }
.no3d { display: none; position: absolute; inset: 0; place-items: center; padding: 30px; text-align: center; color: var(--muted); }
.bar { height: 10px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 12px 0 8px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #b29cec, var(--accent2)); transition: width .8s; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.stg { text-align: center; font-size: 11px; color: var(--muted); }
.stg .im { aspect-ratio: 3 / 4; border-radius: 14px; background: #f3eefb; display: grid; place-items: end center; overflow: hidden; margin-bottom: 4px; border: 2px solid transparent; }
.stg img { width: 100%; height: 100%; object-fit: contain; }
.stg.locked img { filter: grayscale(1) brightness(1.15); opacity: .35; }
.stg.cur .im { border-color: var(--accent); background: #fff; }
.stg.cur { color: var(--accent2); font-weight: 700; }

/* команда / награды */
.me-card { display: flex; gap: 12px; align-items: center; }
.me-card img { width: 64px; height: 86px; object-fit: contain; }
.big-score { font-size: 48px; font-weight: 800; color: var(--accent2); line-height: 1.1; margin: 4px 0; }
.prize { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.prize:first-of-type { border-top: 0; }
.medal { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.m1 { background: linear-gradient(135deg, #ffe08a, #e0a52e); } .m2 { background: linear-gradient(135deg, #e9e9f0, #a9a8b8); } .m3 { background: linear-gradient(135deg, #f3c6a0, #c4804e); }
.rule { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.rule:first-of-type { border-top: 0; }
.rule b { color: var(--accent2); }

/* нижнее меню */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(488px, calc(100% - 24px)); z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border-radius: 24px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(91, 63, 153, .18); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px; border-radius: 18px; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.tabs button span { font-size: 19px; }
.tabs button.on { color: #fff; background: linear-gradient(135deg, #a083e6, var(--accent2)); }

/* шторка точки */
.sheet-bg { position: fixed; inset: 0; background: rgba(43, 35, 64, .3); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
.sheet { position: fixed; left: 50%; bottom: 0; width: min(520px, 100%); transform: translate(-50%, 105%); transition: transform .3s cubic-bezier(.3, .8, .3, 1); z-index: 21;
  background: #fff; border-radius: 26px 26px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(43, 35, 64, .2); }
.sheet.on { transform: translate(-50%, 0); }
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: #e2dbef; margin: 0 auto 14px; }
.sheet .s-kind { font-size: 12px; letter-spacing: .12em; color: var(--muted); font-weight: 650; }
.sheet .s-title { font-size: 21px; font-weight: 800; margin: 4px 0 6px; }
.sheet .s-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.sheet .note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }

/* праздник роста */
.celebrate { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(43, 35, 64, .45); opacity: 0; pointer-events: none; transition: opacity .3s; }
.celebrate.on { opacity: 1; pointer-events: auto; }
.cel-card { position: relative; width: min(360px, 100%); background: #fff; border-radius: 28px; padding: 22px 20px 16px; text-align: center; overflow: hidden; transform: scale(.9); transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.celebrate.on .cel-card { transform: scale(1); }
.cel-rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(243, 205, 110, .22) 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.cel-card > *:not(.cel-rays) { position: relative; }
.cel-card img { width: 150px; height: 200px; object-fit: contain; animation: rise .9s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes rise { from { transform: translateY(30px) scale(.6); opacity: 0; } }
.cel-title { font-size: 22px; font-weight: 800; margin: 6px 0 4px; }
.cel-text { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; line-height: 1.4; }
.cel-card .ghost { margin-top: 8px; border: 0; }

.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 40;
  padding: 11px 18px; border-radius: 16px; background: #2b2340; color: #fff; font-weight: 650; font-size: 14px; transition: opacity .3s, transform .3s; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

/* вход и регистрация */
.onb { max-width: 520px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); }
.onb-head { text-align: center; margin-bottom: 22px; }
.onb-head h1 { font-size: 24px; line-height: 1.2; margin: 14px 0 8px; }
.onb-head p { color: var(--muted); font-size: 15px; line-height: 1.45; }
.logo.big { width: 64px; height: 64px; border-radius: 20px; font-size: 30px; margin: 0 auto; }
.field { display: block; margin-bottom: 18px; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .search, textarea, .adm-add input, .adm-row input { width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); outline: none; }
.field input:focus, .search:focus, textarea:focus, .adm-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; margin-bottom: 10px; }
.hgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.hcard { position: relative; text-align: center; padding: 10px 6px 10px; border-radius: 18px; background: #fff; border: 2px solid transparent; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.25; }
.hcard .av { width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; margin-bottom: 6px; display: grid; place-items: center; overflow: hidden; }
.hcard .av img { width: 100%; height: 100%; object-fit: contain; }
.hcard b { display: block; font-size: 13px; }
.hcard small { color: var(--muted); font-size: 11px; }
.hcard.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.hcard.taken { opacity: .45; filter: grayscale(.6); }
.hcard .tag { position: absolute; left: 6px; right: 6px; top: 8px; font-size: 10.5px; font-weight: 700; padding: 3px 6px; border-radius: 99px; background: rgba(43, 35, 64, .75); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
.reg-bar .primary { max-width: 488px; margin: 0 auto; }
.primary:disabled { opacity: .5; box-shadow: none; }

/* заглушка героини, пока её 3D не готово */
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 26px; text-shadow: 0 2px 6px rgba(0, 0, 0, .2); }

/* объявление */
.announce { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 10px; border-radius: 16px; background: linear-gradient(135deg, #f2ecff, #fff); border: 1px solid #e2d8f6; font-size: 14px; line-height: 1.4; }
.announce b { color: var(--accent2); }

/* команда */
.search { margin-bottom: 12px; }
.coach { display: flex; gap: 12px; align-items: center; }
.coach .av, .member .av { width: 52px; height: 68px; border-radius: 14px; overflow: hidden; flex: none; background: #f3eefb; }
.coach .av img, .member .av img { width: 100%; height: 100%; object-fit: contain; }
.member { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 8px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .9); }
.member.me { border-color: var(--accent); }
.member .mx { flex: 1; min-width: 0; }
.member .mn { font-weight: 750; font-size: 15.5px; display: flex; gap: 6px; align-items: center; }
.member .mh { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .bar { height: 7px; margin: 7px 0 0; }
.member .ms { text-align: right; flex: none; }
.member .ms b { display: block; font-size: 18px; color: var(--accent2); }
.member .ms small { font-size: 11px; color: var(--muted); }
.place { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; flex: none; }
.place.p1 { background: #fbecc0; color: #8a5a10; } .place.p2 { background: #ececf2; color: #626176; } .place.p3 { background: #f6dcc8; color: #8a4f22; }
.you { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent2); font-weight: 700; }

/* кабинет */
.adm-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.adm-row input { width: auto; flex: 1; min-width: 150px; padding: 10px 12px; }
.adm-add { display: flex; gap: 8px; margin-top: 8px; }
.adm-add .do { padding: 0 14px; }
.adm { padding: 14px; margin-bottom: 10px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.adm .an { font-weight: 750; font-size: 15.5px; }
.adm .ah { font-size: 12.5px; color: var(--muted); margin: 2px 0 10px; }
.adm .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.adm .btns button { padding: 7px 11px; border-radius: 11px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--accent2); }
.adm .btns .warn { color: #c0392b; }
.adm .btns .go { background: linear-gradient(135deg, #a083e6, var(--accent2)); color: #fff; border: 0; }
.adm .pend { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.adm .pend div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; gap: 8px; }
.adm .pend button { padding: 5px 10px; border-radius: 9px; background: var(--accent-soft); color: var(--accent2); font-weight: 700; font-size: 12.5px; }
.tabs.five { grid-template-columns: repeat(5, 1fr); }
.tabs.five button { font-size: 10.5px; }
.join-card { border: 1.5px solid #d9ccf6; background: linear-gradient(135deg, #fbf9ff, #f1ebff); }
.join-link { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px dashed #cdbdf2; font-size: 13px; color: var(--accent2); word-break: break-all; user-select: all; }

/* Добрыня */
.dobrynya { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); width: min(488px, calc(100% - 24px)); z-index: 25;
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 10px; border-radius: 20px; background: #fff; box-shadow: 0 12px 34px rgba(43, 35, 64, .22);
  border: 1.5px solid #f0d58f; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; font-size: 14px; line-height: 1.4; }
.dobrynya.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.dobrynya.warn { border-color: #f2b38a; }
.dob-av { width: 46px; height: 46px; flex: none; }
.dob-av svg { width: 100%; height: 100%; }
.dob-tx { flex: 1; min-width: 0; }
.dob-tx .do { margin-top: 8px; }
.dob-x { flex: none; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); font-size: 13px; }

/* общая миссия */
.mission { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #eafaf3, #fff); }
.mi-gem { font-size: 38px; filter: drop-shadow(0 4px 8px rgba(31, 154, 110, .35)); }
.mi-tx { flex: 1; }
.mi-tx b { display: block; font-size: 15.5px; margin: 2px 0; }
.mission .bar { margin: 8px 0 4px; }
.mission .bar i { background: linear-gradient(90deg, #5cc49b, #1f9a6e); }
.mi-note { color: #1f7a58; }

/* стаканы воды */
.cups { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.cups i { width: 10px; height: 13px; border-radius: 2px 2px 4px 4px; border: 1.5px solid #9fd3ea; display: block; }
.cups i.full { background: linear-gradient(#bfe7f7, #4fb3e0); border-color: #4fb3e0; }
.water-big { text-align: center; margin: 8px 0 16px; }
.water-big .cups { gap: 8px; justify-content: center; }
.water-big .cups i { width: 22px; height: 30px; border-width: 2px; border-radius: 4px 4px 8px 8px; }
.task.k-water.done .ic, .task.k-warm.done .ic, .task.k-food.done .ic { background: linear-gradient(135deg, #ffe7a3, var(--gold)); }
.task.k-food.done .tt, .task.k-water.done .tt { text-decoration: none; color: var(--ink); }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; font-weight: 650; font-size: 14.5px; }
.set-row > div { display: flex; align-items: center; gap: 10px; }
.set-row .ghost { min-width: 36px; }

/* разминка */
.wu-list { margin: 12px 0 16px 20px; font-size: 14px; }
.wu-list li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.wu-list li span { display: inline-block; width: calc(100% - 50px); }
.wu-list li b { color: var(--accent2); }
body.noscroll { overflow: hidden; }
.timer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; padding: calc(16px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 20%, #fdfbff, #ece4fb); text-align: center; }
.tm-top { width: 100%; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 650; font-size: 14px; }
.tm-x { width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); }
.tm-ring { position: relative; width: min(72vw, 300px); aspect-ratio: 1; margin: 4vh 0 2vh; }
.tm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tm-bg { fill: none; stroke: #e6dcf8; stroke-width: 14; }
.tm-fg { fill: none; stroke: var(--accent2); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.tm-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(48px, 16vw, 76px); font-weight: 800; color: var(--accent2); font-variant-numeric: tabular-nums; }
.tm-name { font-size: 24px; font-weight: 800; }
.tm-hint { color: var(--muted); margin-top: 6px; font-size: 15px; max-width: 340px; }
.tm-next { margin-top: 2.5vh; font-size: 13.5px; color: var(--accent2); font-weight: 650; }
.tm-total { width: 100%; max-width: 420px; height: 8px; border-radius: 99px; background: #e6dcf8; margin-top: auto; overflow: hidden; }
.tm-total i { display: block; height: 100%; background: linear-gradient(90deg, #b29cec, var(--accent2)); }
.tm-btns { display: flex; gap: 10px; margin-top: 16px; }
.tm-btns .ghost { padding: 12px 22px; font-size: 15px; }

/* питание */
.food-list { margin: 12px 0; }
.food { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.food img, .food-ph { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex: none; background: #f3eefb; display: grid; place-items: center; font-size: 24px; }
.food .fx { flex: 1; min-width: 0; word-break: break-word; }
.chips4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 10px; }
.chips4 .chip { padding: 9px 2px; font-size: 12.5px; font-weight: 650; border: 1px solid var(--line); }
.photo-pick { display: block; text-align: center; padding: 12px; border-radius: 14px; border: 1.5px dashed #cdbdf2; color: var(--accent2); font-weight: 700; margin-bottom: 10px; cursor: pointer; }

/* замеры */
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 12px; }
.m-grid .field { margin-bottom: 12px; }
.m-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 16px; }
.m-ph { aspect-ratio: 3 / 4; border-radius: 14px; border: 1.5px dashed #cdbdf2; display: grid; place-items: center; position: relative; overflow: hidden; cursor: pointer; font-size: 26px; }
.m-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-ph small { position: absolute; bottom: 6px; left: 0; right: 0; font-size: 11.5px; font-weight: 700; color: var(--accent2); text-shadow: 0 0 4px #fff, 0 0 4px #fff; }
.m-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.m-table th { font-size: 11px; color: var(--muted); font-weight: 650; text-align: right; padding: 4px; }
.m-table td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
.m-table td:first-child, .m-table th:first-child { text-align: left; }
.m-diff td { font-weight: 700; }
.diff { color: #c0642c; } .diff.good { color: var(--ok); }
.m-chart { width: 100%; height: auto; margin: 6px 0 2px; }
.m-chart polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.m-chart circle { fill: #fff; stroke: var(--accent2); stroke-width: 2; }
.m-chart text { font-size: 10px; text-anchor: middle; fill: var(--muted); font-weight: 650; }
.up-bar { height: 12px; }

/* карточка участницы в кабинете */
.ud-sec { margin-top: 16px; }
.ud-sec h4 { font-size: 13px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.ud-vid { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ud-vid video { width: 100%; max-height: 260px; border-radius: 12px; background: #000; margin-top: 6px; }
.ud-day { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ud-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ud-photos img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; }
.sheet { max-height: 88vh; overflow-y: auto; }

/* узкие экраны */
.brand > div:last-child { min-width: 0; }
.stages { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stg { min-width: 0; }
.stg .im img { max-width: 100%; }
@media (max-width: 340px) { #app { padding-left: 10px; padding-right: 10px; } .b-sub { display: none; } }
.m-sec { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 14px 0 4px; }
.field.wide { grid-column: 1 / -1; }
.field span small { font-weight: 500; }
.m-wrap { overflow-x: auto; margin: 8px -4px 0; -webkit-overflow-scrolling: touch; }
.m-wrap .m-table { min-width: 100%; width: max-content; }
.m-wrap .m-table td:first-child, .m-wrap .m-table th:first-child { position: sticky; left: 0; background: #fff; padding-right: 10px; white-space: nowrap; }
.m-wrap .m-table td.t { max-width: 110px; white-space: normal; font-size: 11.5px; text-align: left; }
.m-wrap .m-table th { white-space: nowrap; }
.tabs.two { grid-template-columns: repeat(2, 1fr); }

/* финал */
.podium { display: grid; gap: 8px; margin-top: 10px; }
.pod { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.pod.p1 { background: linear-gradient(135deg, #fff8e1, #fff); border-color: #f0d58f; }
.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.vote { text-align: center; padding: 8px; border-radius: 18px; background: #fff; border: 2px solid transparent; box-shadow: var(--shadow); font-size: 13px; }
.vote.on { border-color: #e86a8f; }
.vote b, .vote small { display: block; }
.vote .vimg { aspect-ratio: 1080 / 2400; max-height: 260px; border-radius: 12px; overflow: hidden; background: #f3eefb; display: grid; place-items: center; margin-bottom: 6px; cursor: zoom-in; }
.vote .vimg img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.vote button { margin-top: 6px; width: 100%; }
.collage-big { width: 100%; border-radius: 16px; display: block; margin-top: 8px; }
.honor-card { background: linear-gradient(135deg, #fff8e1, #fbf6ff); border: 1px solid #f0d58f; }
.honor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.hon { position: relative; text-align: center; font-size: 12px; cursor: pointer; }
.hon img, .hon-ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 14px; background: #f3eefb; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: var(--accent2); }
.hon .medal { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; font-size: 13px; }
.hon b, .hon small { display: block; }
.hon small { color: var(--muted); }
.reset-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e6b8b8; }
.warn-btn { color: #c0392b !important; border-color: #f0c9c9 !important; }
.res tr.win td { background: #fff8e1; }
.res td .ghost { padding: 4px 8px; font-size: 12px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin: 6px 0 14px; padding: 10px; border-radius: 12px; background: #f6f1ff; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent2); }
.hcard .av { background: radial-gradient(80% 70% at 50% 40%, #fff, #f1ebfb); }
.tabs button { position: relative; }
.tabs button[data-badge]:not([data-badge=""])::after { content: attr(data-badge); position: absolute; top: 2px; right: 14%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e8505b; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; }
.pending-box { border: 1.5px solid #f2b38a; background: linear-gradient(135deg, #fff6ee, #fff); }

.reg-consent { margin: 16px 0 0; }
.consent a, .doc-links a, .doc-foot a { color: var(--accent2); }
.doc-links { font-size: 13px; margin-top: 8px; }
.doc-foot { text-align: center; font-size: 13px; margin-top: 18px; }

/* общая ссылка — свёрнутый запасной способ */
#joinCommon summary{cursor:pointer;list-style:none}
#joinCommon summary::-webkit-details-marker{display:none}
#joinCommon summary .c-title::after{content:" ▾";color:var(--muted,#888)}
#joinCommon[open] summary .c-title::after{content:" ▴"}
