/* Живой рисунок — яркий детский стиль */
:root {
  --ink: #2b1b4a;
  --purple: #7c3aed;
  --purple-d: #5b21b6;
  --pink: #ff5fa2;
  --pink-d: #d63a7f;
  --yellow: #ffd23f;
  --yellow-d: #e0a800;
  --blue: #1fb3e6;
  --blue-d: #0f86b3;
  --green: #22c55e;
  --green-d: #15803d;
  --orange: #ff9f43;
  --orange-d: #d97706;
  --card: #ffffff;
  --muted: #6b5b8a;
  --radius: 28px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Nunito", "Baloo 2", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-weight: 800;
  color: var(--ink);
  background: #ffe9f3;
  overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { display: block; }

/* ---------- Живой фон ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(160deg, #ffe0f0 0%, #fff4c2 45%, #d6f4ff 100%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55;
  animation: float 14s ease-in-out infinite;
}
.blob.b1 { width: 260px; height: 260px; background: #ffd23f; top: -60px; left: -50px; }
.blob.b2 { width: 200px; height: 200px; background: #7fe3ff; bottom: 10%; right: -40px; animation-delay: -4s; }
.blob.b3 { width: 140px; height: 140px; background: #ff9ccc; bottom: -30px; left: 20%; animation-delay: -8s; }
.blob.b4 { width: 90px; height: 90px; background: #b9a3ff; top: 30%; right: 22%; animation-delay: -2s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-20px, 20px) scale(.95); }
}

/* ---------- Кнопки-конфетки ---------- */
.btn {
  --c: var(--purple); --cd: var(--purple-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 26px; border-radius: 999px;
  background: var(--c); color: #fff; font-size: 22px; font-weight: 900; letter-spacing: .2px;
  box-shadow: 0 7px 0 var(--cd), 0 12px 24px rgba(43, 27, 74, .18);
  transition: transform .15s var(--spring), box-shadow .15s;
  touch-action: manipulation;
}
.btn svg { width: 28px; height: 28px; }
.btn:active { transform: translateY(6px) scale(.97); box-shadow: 0 1px 0 var(--cd), 0 4px 10px rgba(43, 27, 74, .18); }
.btn.pink { --c: var(--pink); --cd: var(--pink-d); }
.btn.yellow { --c: var(--yellow); --cd: var(--yellow-d); color: var(--ink); }
.btn.blue { --c: var(--blue); --cd: var(--blue-d); }
.btn.green { --c: var(--green); --cd: var(--green-d); }
.btn.orange { --c: var(--orange); --cd: var(--orange-d); }
.btn.white { --c: #fff; --cd: #d9cdf2; color: var(--purple); }
.btn.big { min-height: 78px; font-size: 26px; padding: 0 34px; }
.btn.wide { width: 100%; }
.btn[disabled] { filter: grayscale(.6); opacity: .7; pointer-events: none; }

.round {
  --c: #fff; --cd: #d9cdf2;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c); color: var(--purple);
  box-shadow: 0 6px 0 var(--cd), 0 10px 20px rgba(43, 27, 74, .2);
  transition: transform .15s var(--spring), box-shadow .15s, opacity .4s;
}
.round svg { width: 30px; height: 30px; }
.round:active { transform: translateY(5px) scale(.94); box-shadow: 0 1px 0 var(--cd); }
.round.small { width: 52px; height: 52px; }
.round.small svg { width: 24px; height: 24px; }

/* ---------- Появление ---------- */
.pop { animation: pop .6s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(30px); } to { opacity: 1; transform: none; } }
.wiggle { animation: wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.jelly:active { animation: jelly .5s; }
@keyframes jelly {
  0% { transform: scale(1, 1); } 30% { transform: scale(1.12, .88); } 50% { transform: scale(.9, 1.1); }
  70% { transform: scale(1.04, .96); } 100% { transform: scale(1, 1); }
}

/* ---------- Экран входа ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, calc(env(safe-area-inset-top) + 12px)) 16px max(24px, env(safe-area-inset-bottom)); }
.auth-box { width: min(440px, 100%); text-align: center; }
.mascot { display: block; width: 230px; height: auto; margin: 0 auto 4px; animation: swimY 3s ease-in-out infinite; overflow: visible; }
.mascot .m-tail { transform-origin: 52px 80px; animation: tail .5s ease-in-out infinite alternate; }
.mascot .m-fin { transform-origin: 112px 100px; animation: tail .7s ease-in-out infinite alternate; }
@keyframes tail { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes swimY { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.logo {
  font-size: clamp(40px, 10vw, 58px); line-height: 1; margin: 6px 0 4px; font-weight: 900;
  background: linear-gradient(90deg, #ff5fa2, #ff9f43, #ffd23f, #22c55e, #1fb3e6, #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: rainbow 6s linear infinite;
  filter: drop-shadow(0 3px 0 rgba(43, 27, 74, .15));
}
@keyframes rainbow { to { background-position: 200% 0; } }
.tagline { color: var(--muted); font-size: 19px; margin: 8px 0 22px; }
.panel {
  background: rgba(255, 255, 255, .92); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 10px 0 rgba(124, 58, 237, .15), 0 20px 50px rgba(43, 27, 74, .12);
}
.tabs { display: flex; background: #f1eaff; border-radius: 999px; padding: 5px; margin-bottom: 16px; }
.tabs button { flex: 1; min-height: 46px; border-radius: 999px; font-size: 18px; color: var(--muted); transition: all .3s var(--spring); }
.tabs button.on { background: #fff; color: var(--purple); box-shadow: 0 3px 0 #d9cdf2; }
.field {
  width: 100%; min-height: 58px; border-radius: 20px; border: 3px solid #e6dcfb; background: #fff;
  padding: 0 18px; font: inherit; font-size: 20px; color: var(--ink); outline: none; margin-bottom: 12px;
  transition: border-color .2s, transform .2s var(--spring);
}
.field:focus { border-color: var(--purple); transform: scale(1.02); }
.err { color: #e11d48; min-height: 24px; font-size: 16px; margin: 2px 0 10px; }
.shake { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.small-note { color: var(--muted); font-size: 14px; font-weight: 700; margin-top: 14px; }

/* ---------- Главное меню ---------- */
.menu { min-height: 100dvh; padding: max(18px, calc(env(safe-area-inset-top) + 10px)) 16px max(40px, env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.topbar .hello { flex: 1; font-size: clamp(22px, 5vw, 32px); }
.topbar .hello span { color: var(--pink); }
.menu h2 { font-size: clamp(28px, 6vw, 44px); text-align: center; margin: 10px 0 22px; }
.worlds { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.world {
  position: relative; border-radius: 34px; overflow: hidden; text-align: left;
  background: #fff; box-shadow: 0 10px 0 var(--wd), 0 18px 34px rgba(43, 27, 74, .18);
  transition: transform .25s var(--spring), box-shadow .25s;
  border: 5px solid #fff;
}
.world:hover { transform: translateY(-6px) rotate(-1deg); }
.world:active { transform: translateY(6px) scale(.97); box-shadow: 0 3px 0 var(--wd); }
.world .art { aspect-ratio: 200 / 140; }
.world .art svg { width: 100%; height: 100%; }
.world .label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px 16px; background: var(--w); color: #fff;
}
.world .label b { font-size: 30px; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.world .label .count { background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 4px 14px; font-size: 18px; }
.world.sea { --w: #1fb3e6; --wd: #0f86b3; }
.world.savanna { --w: #ff9f43; --wd: #d97706; }
.world.home { --w: #ff5fa2; --wd: #d63a7f; }
.world:nth-child(2) { animation-delay: .1s; }
.world:nth-child(3) { animation-delay: .2s; }

.art .sway { transform-origin: 30px 130px; animation: sw 3s ease-in-out infinite; }
.art .sway.d2 { transform-origin: 172px 130px; animation-delay: -1.5s; }
@keyframes sw { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.art .swim { animation: swimX 4s ease-in-out infinite; }
@keyframes swimX { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(14px, -6px); } }
.art .rise { animation: rise 3s linear infinite; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-30px); opacity: 0; } }
.art .spin { animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.art .bob { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.art .beat { animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

.grown { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.grown .btn { font-size: 17px; min-height: 50px; padding: 0 20px; }
.grown .btn svg { width: 22px; height: 22px; }

/* ---------- Экран-сцена ---------- */
.stage { position: fixed; inset: 0; background: #000; touch-action: none; }
html:has(.stage) { background-color: #0b3a5c; } html:has(.stage), html:has(.stage) body { overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 12px; padding: max(14px, calc(env(safe-area-inset-top) + 6px)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); pointer-events: none; transition: opacity .6s; }
.hud > * { pointer-events: auto; }
.hud .sp { flex: 1; }
.counter {
  align-self: center; background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 8px 16px; font-size: 18px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
}
.fab {
  position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom));
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--yellow); color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 8px 0 var(--yellow-d), 0 14px 30px rgba(0, 0, 0, .3);
  animation: pulse 2s ease-in-out infinite; transition: opacity .6s, transform .15s var(--spring);
}
.fab svg { width: 46px; height: 46px; }
.fab:active { transform: translateY(6px) scale(.94); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 0 var(--yellow-d), 0 0 0 0 rgba(255, 210, 63, .7), 0 14px 30px rgba(0, 0, 0, .3); }
  50% { box-shadow: 0 8px 0 var(--yellow-d), 0 0 0 18px rgba(255, 210, 63, 0), 0 14px 30px rgba(0, 0, 0, .3); }
}
.idle .hud, .idle .fab { opacity: .25; }
.empty {
  position: absolute; inset: 0; margin: auto; height: fit-content;
  width: min(460px, calc(100% - 32px)); text-align: center; pointer-events: none;
  background: rgba(255, 255, 255, .9); border-radius: 30px; padding: 24px 22px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .1); animation: pop .7s var(--spring) both;
}
.empty .big { font-size: 30px; margin-bottom: 6px; }
.empty p { margin: 0; color: var(--muted); font-size: 19px; }
.arrow-hint {
  position: absolute; right: 130px; bottom: 50px; font-size: 22px; color: #fff; pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4); animation: nudge 1s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(12px); } }
.toast {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 5;
  background: #fff; color: var(--purple); border-radius: 999px; padding: 14px 26px; font-size: 26px;
  box-shadow: 0 8px 0 #d9cdf2, 0 16px 40px rgba(0, 0, 0, .25); white-space: nowrap;
  animation: toast 3s var(--spring) forwards;
}
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -30px) scale(.5); }
  15%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -20px) scale(.9); }
}

/* ---------- Окно добавления рисунка ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 20; background: rgba(43, 27, 74, .45);
  display: grid; place-items: end center; animation: fade .25s both;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(560px, 100%); max-height: 96dvh; overflow: auto;
  background: #fff; border-radius: 34px 34px 0 0; padding: 18px 20px max(24px, env(safe-area-inset-bottom));
  animation: up .45s var(--spring) both; position: relative;
}
@media (min-width: 640px) { .sheet-bg { place-items: center; } .sheet { border-radius: 34px; } }
@keyframes up { from { transform: translateY(100%); } }
.sheet .x { position: absolute; right: 14px; top: 14px; }
.sheet h3 { font-size: 30px; margin: 6px 60px 4px 4px; }
.sheet .hint { color: var(--muted); font-size: 18px; margin: 0 4px 18px; }
.pick { display: grid; gap: 14px; }
.steps { display: flex; gap: 10px; margin: 0 4px 16px; }
.steps div { flex: 1; text-align: center; font-size: 14px; color: var(--muted); }
.steps div b { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 18px; font-size: 26px; color: #fff; }
.steps div:nth-child(1) b { background: var(--pink); transform: rotate(-6deg); }
.steps div:nth-child(2) b { background: var(--orange); transform: rotate(4deg); }
.steps div:nth-child(3) b { background: var(--green); transform: rotate(-3deg); }
.preview {
  position: relative; border-radius: 24px; overflow: hidden; height: 260px; margin-bottom: 14px;
  display: grid; place-items: center;
}
.preview.sea { background: linear-gradient(#5ee7f5, #1279c9); }
.preview.savanna { background: linear-gradient(#8fdcff 0 55%, #ffd166 55%); }
.preview.home { background: linear-gradient(#ffe9a8 0 60%, #f2b880 60%); }
.preview img, .preview canvas { max-width: 78%; max-height: 80%; animation: alive 1.4s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .2)); }
@keyframes alive { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
.preview .flipbtn { position: absolute; right: 12px; bottom: 12px; }
.preview .dir {
  position: absolute; left: 12px; bottom: 14px; background: rgba(255, 255, 255, .9); border-radius: 999px;
  padding: 6px 14px; font-size: 15px; color: var(--muted);
}
.preview canvas.anim { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; animation: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.motions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.motions button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px;
  border-radius: 20px; background: #f4effd; color: var(--muted); font-size: 15px;
  box-shadow: 0 4px 0 #e6dcfb; transition: transform .2s var(--spring), background .2s, color .2s;
}
.motions button svg { width: 34px; height: 34px; }
.motions button.on { background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-d); transform: scale(1.06); }
.motions button:active { transform: translateY(3px) scale(.96); }
.loader { display: grid; place-items: center; gap: 10px; color: #fff; font-size: 20px; }
.loader .spinner { width: 70px; height: 70px; animation: spin 1s linear infinite; }
.row { display: flex; gap: 10px; align-items: center; }
.slider { width: 100%; accent-color: var(--purple); height: 30px; }
.tune { color: var(--muted); font-size: 15px; margin: 0 4px 12px; }
.tune summary { cursor: pointer; padding: 4px 0; }
.tune .row span { white-space: nowrap; }

/* ---------- Взрослый раздел ---------- */
.page { min-height: 100dvh; padding: max(18px, calc(env(safe-area-inset-top) + 10px)) 16px max(40px, env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }
.page h2 { font-size: clamp(26px, 5vw, 38px); margin: 12px 0 14px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.seg button { min-height: 48px; padding: 0 20px; border-radius: 999px; background: #fff; font-size: 18px; color: var(--muted); box-shadow: 0 4px 0 #e6dcfb; }
.seg button.on { background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-d); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { position: relative; background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 6px 0 #e6dcfb; text-align: center; }
.tile .pic { height: 110px; display: grid; place-items: center; background: repeating-conic-gradient(#f4effd 0 25%, #fff 0 50%) 0 0 / 18px 18px; border-radius: 14px; }
.tile img { max-width: 92%; max-height: 100px; }
.tile .nm { font-size: 15px; margin-top: 6px; min-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .on-screen { position: absolute; left: 8px; top: 8px; background: var(--green); color: #fff; font-size: 11px; border-radius: 999px; padding: 2px 8px; }
.tile .del { position: absolute; right: -6px; top: -6px; --c: #fff; --cd: #fecdd3; color: #e11d48; }
.note { background: #fff; border-radius: 22px; padding: 16px 18px; color: var(--muted); font-size: 16px; font-weight: 700; box-shadow: 0 6px 0 #e6dcfb; margin-bottom: 16px; }
.note b { color: var(--ink); }

.note.warn { color: #be123c; background: #fff1f2; box-shadow: 0 6px 0 #fecdd3; }

/* ---------- Замок для родителей ---------- */
.gate { text-align: center; }
.gate h3 { margin-right: 60px; text-align: left; }
.gate .hint { text-align: left; }
.task { display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 44px; margin: 4px 0 18px; }
.task .ans { min-width: 96px; padding: 6px 14px; border-radius: 20px; background: #f1eaff; color: var(--purple); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 360px; margin: 0 auto; }
.keys button {
  min-height: 66px; border-radius: 22px; background: #fff; font-size: 30px; color: var(--ink);
  box-shadow: 0 6px 0 #e6dcfb, 0 0 0 3px #efe7ff inset; transition: transform .12s var(--spring), box-shadow .12s;
  display: grid; place-items: center;
}
.keys button svg { width: 30px; height: 30px; }
.keys button:active { transform: translateY(5px); box-shadow: 0 1px 0 #e6dcfb, 0 0 0 3px #efe7ff inset; }
.keys .ok { background: var(--green); color: #fff; box-shadow: 0 6px 0 var(--green-d); font-size: 26px; }

/* ---------- Вкладки настроек и раскраски ---------- */
.bigtabs { display: flex; gap: 10px; background: rgba(255,255,255,.7); padding: 6px; border-radius: 999px; margin: 10px 0 14px; max-width: 520px; }
.bigtabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border-radius: 999px; font-size: 20px; color: var(--muted); transition: all .3s var(--spring); }
.bigtabs button svg { width: 24px; height: 24px; }
.bigtabs button.on { background: var(--purple); color: #fff; box-shadow: 0 5px 0 var(--purple-d); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tpl { background: #fff; border-radius: 22px; padding: 12px; box-shadow: 0 6px 0 #e6dcfb; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.tpl .sheetpic { aspect-ratio: 210 / 297; border: 2px solid #eee6fb; border-radius: 10px; display: grid; place-items: center; padding: 12px; background: #fff; }
.tpl .sheetpic svg { width: 100%; height: auto; max-height: 100%; }
.tpl .nm { font-size: 19px; }
.tpl .btn { min-height: 50px; font-size: 18px; }
.tpl .btn svg { width: 22px; height: 22px; }

@media (max-width: 480px) {
  .tpl-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tpl .btn { padding: 0 12px; font-size: 16px; }
  .topbar .btn { padding: 0 12px !important; }
  .task { font-size: 36px; }
  .btn.big { min-height: 70px; font-size: 22px; }
  .fab { width: 84px; height: 84px; }
  .arrow-hint { right: 112px; font-size: 18px; }
  .preview { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Новые миры, замки, админ ---------- */
.btn.purple { --c: var(--purple); --cd: var(--purple-d); }
.world.dino { --w: #4caf50; --wd: #2e7d32; }
.world.jungle { --w: #16a34a; --wd: #166534; }
.world.space { --w: #6d28d9; --wd: #4c1d95; }
.world.cars { --w: #f59e0b; --wd: #b45309; }
.world:nth-child(4) { animation-delay: .3s; }
.world:nth-child(5) { animation-delay: .35s; }
.world:nth-child(6) { animation-delay: .4s; }
.world:nth-child(7) { animation-delay: .45s; }
.world .art { position: relative; }
.world.locked .art svg, .world.locked .art img { filter: grayscale(.75) brightness(1.05); opacity: .75; }
.world.locked .label { background: #9b8fb5; }
.world.locked .label .count { font-size: 15px; }
.lockbadge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--purple); box-shadow: 0 6px 0 #d9cdf2, 0 10px 24px rgba(43, 27, 74, .25);
  animation: lockwig 3s ease-in-out infinite;
}
.lockbadge svg { width: 40px; height: 40px; }
.lockbadge.big { width: 96px; height: 96px; }
.lockbadge.big svg { width: 52px; height: 52px; }
@keyframes lockwig { 0%, 86%, 100% { transform: translate(-50%, -50%) rotate(0); } 90% { transform: translate(-50%, -50%) rotate(-12deg); } 95% { transform: translate(-50%, -50%) rotate(10deg); } }
.badge-admin { display: inline-grid; vertical-align: middle; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 var(--yellow-d); }
.badge-admin svg { width: 22px; height: 22px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 18px; height: 18px; }
.lock-note { display: flex; gap: 14px; align-items: flex-start; }
.lock-note > svg { width: 36px; height: 36px; flex: none; color: var(--purple); }
.locked-sheet { text-align: center; }
.lock-art { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 200 / 140; margin: 6px auto 14px; max-width: 360px; }
.lock-art svg, .lock-art img { width: 100%; height: 100%; filter: grayscale(.6); }
.lock-art .lockbadge svg { filter: none; }
.user-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #fff; border-radius: 22px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 6px 0 #e6dcfb; }
.user-row .who { flex: 1 1 180px; font-size: 19px; }
.user-row .who small { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.user-row .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 14px; background: #efe9fb; color: var(--muted); }
.pill.green { background: #dcfce7; color: #15803d; }
.pill.gold { background: #fef3c7; color: #b45309; }
.btn.small-btn { min-height: 42px; font-size: 15px; padding: 0 14px; box-shadow: 0 4px 0 var(--cd); }
.preview.dino { background: linear-gradient(#ffd8a8 0 55%, #8bc34a 55%); }
.preview.jungle { background: linear-gradient(#b7f0a8 0 60%, #4d8f3a 60%); }
.preview.space { background: radial-gradient(circle at 30% 30%, #4c1d95, #0b0b2e); }
.preview.cars { background: linear-gradient(#9be7ff 0 62%, #555 62% 64%, #6b6b6b 64%); }

/* ---------- Узкие экраны: всё в пределах экрана, без «прокрутки вбок» ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
.page, .menu { overflow-x: hidden; }
.page * { min-width: 0; }
.bigtabs { max-width: 100%; }
.bigtabs button { min-width: 0; padding: 0 8px; white-space: nowrap; }
.seg { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 6px; margin-right: -16px; padding-right: 16px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; }
.user-row .plan { flex: none; }
.topbar .hello { min-width: 0; }
@media (max-width: 480px) {
  .bigtabs { gap: 4px; padding: 5px; }
  .bigtabs button { font-size: 16px; gap: 5px; min-height: 50px; }
  .bigtabs button svg { width: 18px; height: 18px; }
  .page .topbar .btn { padding: 0 14px !important; font-size: 16px !important; }
}
@media (max-width: 360px) {
  .bigtabs button { font-size: 14px; }
  .bigtabs button svg { display: none; }
}
@media (max-width: 380px) {
  .page .topbar .hello { font-size: 20px; line-height: 1.1; }
  .page .topbar .btn { padding: 0 12px !important; }
}

/* ---------- Плашка «Вышло обновление» ---------- */
.update-bar {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  width: min(520px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px; padding: 8px 8px 8px 18px;
  box-shadow: 0 6px 0 #d9cdf2, 0 14px 30px rgba(43, 27, 74, .25);
  font-size: 18px; color: var(--ink);
}
.update-bar > svg { width: 26px; height: 26px; color: var(--purple); flex: none; }
.update-bar span { flex: 1; min-width: 0; }
.update-bar .btn { min-height: 48px; font-size: 17px; padding: 0 18px; box-shadow: 0 4px 0 var(--cd); }

/* ======== Адаптация: телефон / планшет / ноутбук / телевизор, любая ориентация ======== */
/* Карточки миров: подпись и счётчик не ломаются на строки */
.world .label { min-width: 0; }
.world .label b { font-size: clamp(20px, 2.2vw + 12px, 30px); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world .label .count { flex: none; white-space: nowrap; font-size: clamp(13px, 1vw + 9px, 18px); padding: 4px 12px; }
.worlds { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* Телефон боком (низкий экран): карточки ниже и в 3–4 колонки, окна не вылезают за экран */
@media (orientation: landscape) and (max-height: 540px) {
  .menu { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .menu h2 { margin: 0 0 12px; font-size: 26px; }
  .worlds { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .world .art { aspect-ratio: 200 / 110; }
  .world .label { padding: 8px 14px 10px; }
  .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

  .sheet-bg { place-items: center; }
  .sheet { border-radius: 26px; max-height: calc(100dvh - 16px); width: min(760px, calc(100% - 24px)); padding: 12px 18px 14px; }
  .sheet h3 { font-size: 24px; margin-top: 2px; }
  .sheet .hint { font-size: 15px; margin-bottom: 10px; }
  .steps { display: none; }
  .btn.big { min-height: 56px; font-size: 20px; }
  .preview { height: 42dvh; min-height: 150px; }

  /* Замок для родителей: пример слева, кнопки справа — всё видно без прокрутки */
  .sheet.gate { display: grid; grid-template-columns: 1fr 1.1fr; grid-template-rows: auto auto 1fr; column-gap: 20px; align-items: start; }
  .sheet.gate h3, .sheet.gate .hint, .sheet.gate .task { grid-column: 1; }
  .sheet.gate .task { font-size: 34px; margin: 6px 0; justify-content: flex-start; }
  .sheet.gate .keys { grid-column: 2; grid-row: 1 / span 3; gap: 8px; max-width: none; margin-top: 34px; }
  .sheet.gate .keys button { min-height: 50px; font-size: 24px; border-radius: 16px; }
  .fab { width: 76px; height: 76px; }
  .hud .round { width: 54px; height: 54px; }
}

/* Планшет и ноутбук */
@media (min-width: 900px) and (min-height: 600px) {
  .worlds { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
/* Большой экран и телевизор: всё крупнее, чтобы было видно с дивана */
@media (min-width: 1500px) and (min-height: 800px) {
  .menu, .page, .sheet-bg > .sheet, .update-bar { zoom: 1.3; }
  .menu, .page { max-width: 1400px; }
  .worlds { grid-template-columns: repeat(4, 1fr); gap: 26px; }
  .round { width: 84px; height: 84px; }
  .round svg { width: 40px; height: 40px; }
  .fab { width: 120px; height: 120px; }
  .counter { font-size: 24px; padding: 10px 22px; }
  .toast { font-size: 34px; }
}

/* ---------- Подписка ---------- */
.plan-badge { display: flex; align-items: center; gap: 10px; margin: 0 auto 6px; padding: 10px 18px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 17px; box-shadow: 0 5px 0 #e6dcfb; max-width: 100%; }
.plan-badge svg { width: 24px; height: 24px; color: var(--purple); flex: none; }
.plan-badge b { color: var(--pink); }
.plan-badge.locked { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); }
.plan-badge.locked svg { color: var(--ink); }
.paywall { width: min(620px, 100%); }
.pw-worlds { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 12px; }
.pw-w { text-align: center; font-size: 11px; color: var(--muted); min-width: 0; }
.pw-w .art { aspect-ratio: 1; border-radius: 12px; overflow: hidden; margin-bottom: 3px; }
.pw-w .art svg { width: 100%; height: 100%; }
.pw-w span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-list { margin: 0 0 14px; padding-left: 22px; color: var(--ink); font-size: 16px; line-height: 1.5; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px 14px;
  border-radius: 22px; background: #fff; box-shadow: 0 6px 0 #e6dcfb, 0 0 0 3px #efe7ff inset; transition: transform .15s var(--spring); }
.plan:active { transform: translateY(4px); }
.plan b { font-size: 20px; }
.plan .price { font-size: 32px; font-weight: 900; color: var(--purple); }
.plan small { font-size: 13px; color: var(--muted); }
.plan.best { background: var(--purple); box-shadow: 0 6px 0 var(--purple-d); color: #fff; }
.plan.best .price, .plan.best small { color: #fff; }
.plan i { position: absolute; top: -12px; right: 12px; font-style: normal; font-size: 13px; background: var(--yellow); color: var(--ink); padding: 3px 10px; border-radius: 999px; }
.pw-note { text-align: center; margin-top: 12px; }
.paywall .err { text-align: center; }
@media (max-width: 420px) { .pw-worlds { grid-template-columns: repeat(4, 1fr); } }
@media (orientation: landscape) and (max-height: 540px) { .pw-worlds, .pw-list { display: none; } }

@media (min-width: 2400px) and (min-height: 1200px) {
  .menu, .page, .sheet-bg > .sheet, .update-bar { zoom: 1.8; }
}
/* Название мира подстраивается под ширину карточки, а не обрезается */
.world { container-type: inline-size; }
.world .label b { font-size: clamp(15px, 9.3cqw, 30px); text-overflow: clip; }
.world .label .count { font-size: clamp(11px, 5.2cqw, 18px); padding: 3px 10px; }
/* кнопок движения бывает 2–4 — растягиваем на всю ширину */
.motions { display: flex; }
.motions button { flex: 1 1 0; min-width: 0; }

/* ---------- Кнопка «Корм» в море ---------- */
.feed {
  position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 84px; height: 84px; border-radius: 50%; background: #fff; color: var(--ink);
  font-size: 14px; box-shadow: 0 7px 0 #d9cdf2, 0 12px 26px rgba(0,0,0,.28);
  transition: opacity .6s, transform .15s var(--spring);
}
.feed svg { width: 40px; height: 40px; }
.feed:active { transform: translateY(5px) scale(.94); }
.idle .feed { opacity: .25; }
@media (orientation: landscape) and (max-height: 540px) { .feed { width: 68px; height: 68px; font-size: 12px; } .feed svg { width: 32px; height: 32px; } }
@media (min-width: 1500px) and (min-height: 800px) { .feed { width: 110px; height: 110px; font-size: 18px; } .feed svg { width: 54px; height: 54px; } }

/* ---------- Вход: пример и телевизор ---------- */
.auth-extra { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.auth-extra .btn { min-height: 50px; font-size: 17px; padding: 0 18px; }
.auth-extra .btn svg { width: 24px; height: 24px; }
.empty .btn { pointer-events: auto; margin-top: 14px; min-height: 54px; font-size: 18px; }

/* ---------- Телевизор: QR ---------- */
.tv-box { display: flex; gap: 32px; align-items: center; justify-content: center; flex-wrap: wrap; background: #fff; border-radius: 30px; padding: 28px; box-shadow: 0 10px 0 #e6dcfb; max-width: 980px; margin: 20px auto; }
.tv-qr { width: min(340px, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.tv-qr svg { width: 100%; height: 100%; }
.tv-text { flex: 1 1 300px; min-width: 0; }
.tv-text h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 36px); }
.tv-text p { color: var(--muted); font-size: 18px; }
.tv-code { font-size: clamp(44px, 7vw, 80px); letter-spacing: 6px; color: var(--purple); margin: 10px 0; }
.pair-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pair-row .field { flex: 1 1 140px; margin: 0; min-height: 46px; font-size: 20px; letter-spacing: 3px; }
.pair-card { text-align: center; max-width: 520px; margin: 20px auto; padding: 24px; }
.pair-card > svg { width: 64px; height: 64px; margin: 0 auto 8px; color: var(--purple); }
.pair-card h3 { font-size: 24px; color: var(--ink); margin: 6px 0; }

/* ---------- Живой пример ---------- */
.demo-cta {
  position: absolute; left: 0; right: 0; margin: 0 auto; bottom: max(18px, env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 140px)); background: rgba(255,255,255,.93); border-radius: 24px; padding: 12px 16px;
  font-size: 15px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,.1);
}
.demo-cta b { color: var(--ink); }
.demo-cta .btn { min-height: 48px; font-size: 18px; }
.demo-next { min-height: 52px; font-size: 16px; padding: 0 16px; }
.demo .feed { bottom: max(22px, env(safe-area-inset-bottom)); }
@media (max-width: 560px) { .demo-cta { width: calc(100% - 32px); bottom: 120px; } }

/* ---------- Ссылки на оферту и реквизиты ---------- */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 18px; font-size: 13px; }
.legal-links a, .pw-note a { color: var(--muted); text-decoration: underline; font-weight: 700; }

/* ---------- Кнопка «Родителям» ---------- */
.grown-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; padding: 0; color: var(--purple); }
.grown-btn small { font-size: 12px; font-weight: 900; color: var(--muted); line-height: 1; }
.grown-btn .round { pointer-events: none; }
.grown-btn:active .round { transform: translateY(5px) scale(.95); }
/* ---------- Узкие экраны: кнопки не вылезают за край ---------- */
.pick > * { min-width: 0; }
.btn { max-width: 100%; }
@media (max-width: 380px) {
  .btn.big { font-size: 20px; padding: 0 16px; min-height: 64px; }
  .sheet .btn.wide { white-space: normal; line-height: 1.1; text-align: center; }
  .sheet h3 { font-size: 26px; }
}

.task.words { font-size: 28px; color: var(--ink); text-align: center; margin-bottom: 8px; }
.task.words span { padding: 10px 16px; border-radius: 18px; background: #fff6d6; }
@media (max-width: 380px) { .task.words { font-size: 23px; } }

/* ---------- Знакомство (3 карточки) ---------- */
.welcome { display: flex; flex-direction: column; min-height: 100dvh; }
.welcome .w-card { margin: auto; }
.w-card { position: relative; width: min(520px, 100%); background: #fff; border-radius: 34px; padding: 22px 20px 24px; text-align: center; box-shadow: 0 10px 0 rgba(43,27,74,.08), 0 20px 40px rgba(43,27,74,.12); }
.w-step { font-size: 14px; color: var(--muted); }
.w-art { height: 190px; display: grid; place-items: center; margin: 8px 0 6px; }
.w-art .w-img { max-height: 190px; max-width: 70%; object-fit: contain; }
.w-art .tips-svg { height: 170px; width: auto; }
.w-cover { width: 230px; height: 180px; border-radius: 24px; overflow: hidden; }
.w-cover img, .w-cover svg { width: 100%; height: 100%; object-fit: cover; }
.w-card h2 { font-size: 28px; margin: 6px 0 8px; color: var(--ink); }
.w-card p { color: var(--muted); font-size: 18px; line-height: 1.35; margin: 0 4px 14px; }
.w-card > .btn.white { min-height: 52px; font-size: 18px; margin-bottom: 8px; }
.w-dots { display: flex; justify-content: center; gap: 8px; margin: 10px 0 16px; }
.w-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e4dbf5; }
.w-dots i.on { background: var(--purple); width: 26px; border-radius: 6px; }
@media (max-width: 380px) { .w-art { height: 140px; } .w-art .w-img { max-height: 140px; } .w-art .tips-svg { height: 130px; } .w-cover { width: 190px; height: 140px; } .w-card h2 { font-size: 24px; } .w-card p { font-size: 16px; } }
/* ---------- Подсказки в окне «Новый друг» ---------- */
.photo-tips { text-align: center; color: var(--muted); font-size: 15px; margin: 14px 0 4px; }
.link-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; color: var(--purple); font-weight: 900; font-size: 16px; text-decoration: underline; }
.link-btn svg { width: 20px; height: 20px; }

.w-card .link-btn { margin-top: 6px; text-decoration: none; color: var(--muted); }
.counter { white-space: nowrap; }

[hidden] { display: none !important; }
/* ---------- Первый экран для гостя ---------- */
.landing { display: flex; flex-direction: column; min-height: 100dvh; }
.land { margin: auto; width: min(560px, 100%); text-align: center; }
.land .logo { margin-top: 4px; }
.land h1 { font-size: clamp(22px, 6vw, 32px); line-height: 1.15; margin: 6px 0 14px; color: var(--ink); }
.land-tank { position: relative; height: clamp(190px, 34vh, 300px); border-radius: 28px; overflow: hidden; box-shadow: 0 8px 0 #1680b3, 0 16px 30px rgba(43,27,74,.18); border: 5px solid #fff; }
.land-tank canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.land-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.land-steps div { background: #fff; border-radius: 18px; padding: 10px 6px; font-size: 14px; color: var(--muted); line-height: 1.2; }
.land-steps b { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 12px; color: #fff; font-size: 18px; background: var(--pink); }
.land-steps div:nth-child(2) b { background: var(--orange); }
.land-steps div:nth-child(3) b { background: var(--green); }
.land .small-note { margin: 12px 4px; }
/* ---------- Забыли пароль ---------- */
.f-title { font-size: 26px; margin: 0 0 6px; color: var(--ink); }
.auth .panel .hint { color: var(--muted); font-size: 16px; margin: 0 0 12px; }
.link-btn.forgot { margin-top: 4px; text-decoration: none; color: var(--muted); font-size: 15px; }
/* ---------- Оплата ---------- */
.pw-mail { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; color: var(--purple); }
.pw-mail svg { width: 26px; height: 26px; flex: none; }
.pw-mail .field { margin: 0; }
.field.bad { border-color: #ef4444 !important; }
.plan.busy { opacity: .6; }
.paid-card { text-align: center; }
.paid-card .loader { color: var(--purple); }
.paid-card > svg { width: 64px; height: 64px; color: var(--yellow-d); }
/* ---------- Подсказки родителям ---------- */
.for-parents { display: inline-flex; align-items: center; gap: 6px; margin: 4px 4px 0; font-size: 14px; color: var(--muted); }
.for-parents svg { width: 18px; height: 18px; }
.offer-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(120px, calc(env(safe-area-inset-bottom) + 110px)); z-index: 5;
  width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 22px; padding: 10px 10px 10px 16px;
  box-shadow: 0 8px 0 rgba(0,0,0,.08), 0 14px 30px rgba(43,27,74,.2); font-size: 15px; color: var(--muted); }
.offer-bar.pop { animation: none; }
.offer-bar span { flex: 1; }
.offer-bar b { color: var(--ink); }
.offer-bar .btn { min-height: 46px; font-size: 16px; padding: 0 14px; }
.offer-bar .round { width: 40px; height: 40px; box-shadow: none; flex: none; }
/* ---------- Поделиться ---------- */
.rec-badge { position: absolute; left: 50%; top: max(90px, calc(env(safe-area-inset-top) + 80px)); transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 18px; }
.rec-badge i { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.share-prev { border-radius: 20px; overflow: hidden; margin: 6px 0 16px; background: #000; }
.share-prev video, .share-prev img { display: block; width: 100%; max-height: 50dvh; object-fit: contain; }
a.btn { text-decoration: none; }
/* ---------- Настройки ---------- */
.note b > svg { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; }
/* ---------- Статистика ---------- */
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.funnel div { background: #f6f1ff; border-radius: 16px; padding: 10px; }
.funnel b { display: block; font-size: 26px; color: var(--purple); }
.funnel span { font-size: 13px; color: var(--muted); }
.stats-wrap { overflow-x: auto; margin-bottom: 14px; background: #fff; border-radius: 20px; }
.stats { border-collapse: collapse; width: 100%; font-size: 14px; }
.stats th, .stats td { padding: 8px 10px; text-align: center; border-bottom: 1px solid #f0eafa; white-space: nowrap; }
.stats th { color: var(--muted); font-size: 12px; }
@media (max-width: 380px) { .land-steps div { font-size: 12px; } .offer-bar { font-size: 13px; } }
/* ---------- Окно оплаты: ровные плитки миров ---------- */
.pw-worlds { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pw-w { width: calc((100% - 6 * 8px) / 7); }
.pw-w .art { aspect-ratio: 10 / 7; }
.pw-w .art svg { display: block; }
@media (max-width: 420px) { .pw-w { width: calc((100% - 3 * 8px) / 4); } .pw-w span { font-size: 11px; } }
/* ---------- Чеки ---------- */
.badge-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #ef4444; color: #fff; font-style: normal; font-size: 13px; }
.rc-how { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.rc-filter { display: flex; gap: 8px; margin: 0 0 12px; }
.rc-filter button { padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--muted); font-weight: 900; box-shadow: 0 4px 0 #e4dbf5; }
.rc-filter button.on { background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-d); }
.rc-card { background: #fff; border-radius: 22px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 6px 0 #ece4fb; }
.rc-card.done { opacity: .85; }
.rc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rc-top b { font-size: 22px; color: var(--ink); }
.rc-top span { color: var(--muted); font-size: 14px; }
.rc-top .pill { margin-left: auto; }
.rc-who { margin: 6px 0 10px; color: var(--ink); font-size: 16px; }
.rc-who small { color: var(--muted); font-size: 14px; }
.rc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.rc-acts .btn { min-height: 44px; font-size: 15px; padding: 0 14px; }
.rc-card .field { margin: 6px 0; font-size: 16px; }
.rc-done { font-size: 15px; color: var(--muted); }
.link-btn.inline { display: inline; width: auto; padding: 0; font-size: 15px; }
.pill.gold { background: #fff3c4; color: #8a6100; }

.diag { margin-top: 6px; font-size: 12px; color: #a99fc0; font-weight: 700; }

.note.warn.ok { background: #dcfce7; color: #15803d; box-shadow: 0 6px 0 #bbf7d0; }
.bigtabs:has(button:nth-child(4)) svg { display: none; }

.plan-badge.premium { background: #fff8db; }
.plan-badge.premium svg { color: #d97706; }
.plan-badge.premium b { color: var(--ink); }
.pill.red { background: #fee2e2; color: #b91c1c; }
.rc-warn { margin: 4px 0 8px; padding: 8px 12px; border-radius: 14px; background: #fee2e2; color: #991b1b; font-size: 14px; }

/* ---------- Альбом ---------- */
.album-head h3 { font-size: 24px; margin: 4px 4px 8px; color: var(--ink); }
.album-head h3 small { font-size: 16px; color: var(--muted); }
.album-head .hint { color: var(--muted); font-size: 15px; margin: 8px 4px 14px; }
.kid-row { margin-top: 0; }
.tile .dt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile .pic { cursor: pointer; }
.set-title { display: flex; align-items: center; gap: 8px; font-size: 22px; margin: 26px 4px 12px; color: var(--ink); }
.set-title svg { width: 24px; height: 24px; color: var(--purple); }
.view-pic { display: grid; place-items: center; min-height: 240px; border-radius: 22px; margin: 4px 0 16px;
  background: repeating-conic-gradient(#f4effd 0 25%, #fff 0 50%) 0 0 / 22px 22px; }
.view-pic img { max-width: 92%; max-height: 52dvh; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 800; color: var(--ink); }
.switch input { width: 24px; height: 24px; accent-color: var(--purple); }
.switch span { display: none; }
.hud [data-a=night].on { --c: #312e81; --cd: #1e1b4b; color: #fde68a; }
@media (max-width: 420px) {
  .hud { gap: 8px; }
  .hud .round.small { width: 44px; height: 44px; }
  .hud .round.small svg { width: 21px; height: 21px; }
  .hud .counter { font-size: 15px; padding: 6px 10px; }
}

/* ---------- Большой экран: подсказка ---------- */
.big-page .bigtabs button { font-size: 15px; }
.big-card { text-align: left; }
.big-lead { color: var(--muted); font-size: 16px; margin: 0 0 10px; }
.big-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: st; }
.big-steps li { position: relative; padding: 10px 0 10px 50px; font-size: 16px; color: #3d3159; line-height: 1.4; border-bottom: 1px dashed #ece4fb; }
.big-steps li:last-child { border-bottom: 0; }
.big-steps li::before { counter-increment: st; content: counter(st); position: absolute; left: 0; top: 8px; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; background: var(--purple); color: #fff; font-weight: 900; }
.big-steps b { color: var(--ink); }
.big-steps .addr { display: inline-block; padding: 1px 10px; border-radius: 10px; background: #f1eaff; color: var(--purple); font-weight: 900; }
.big-steps .ico svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--purple); }
.big-steps kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid #d9cdf2; background: #fff; font-family: inherit; }
.big-tip { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #fff8db; color: #6b4e00; font-size: 15px; }
.tv-steps { text-align: left; margin: 6px 0 10px; padding-left: 20px; color: var(--muted); line-height: 1.4; }
.note b > svg[viewBox="0 0 24 24"] { width: 20px; height: 20px; }
.big-page .bigtabs button { padding: 0 8px; white-space: nowrap; min-width: 0; flex: 1; }
@media (max-width: 400px) { .big-page .bigtabs button { font-size: 14px; } }
.tv-text a { color: var(--purple); }

/* ---------- Кнопки-игрушки (корм, угощение, мячик, светофор, звездопад) ---------- */
.acts { position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column-reverse; gap: 14px; z-index: 3; }
.acts .feed { position: static; }
.acts .emo { font-style: normal; font-size: 34px; line-height: 1; }
.acts .feed.red { background: #fee2e2; }
.idle .acts .feed { opacity: .25; }
@media (orientation: landscape) and (max-height: 540px) { .acts { flex-direction: row; } .acts .emo { font-size: 26px; } }
@media (max-width: 380px) { .acts .feed { width: 72px; height: 72px; font-size: 12px; } .acts .emo { font-size: 28px; } }
.demo .acts { bottom: max(22px, env(safe-area-inset-bottom)); }

.toast { white-space: normal; max-width: calc(100% - 32px); text-align: center; border-radius: 26px; }
@media (max-width: 420px) { .toast { font-size: 20px; padding: 12px 18px; } }
@media (max-width: 560px) { .demo-cta { bottom: auto; top: max(84px, calc(env(safe-area-inset-top) + 76px)); } }
