/* Обби знаний — игровой интерфейс в эстетике Roblox-обби.
   Стиль: «игрушечные блоки» (claymorphism + блочная глубина Roblox): толстые грани,
   жёсткая нижняя тень-грань, текстура шипов-«студов» на верхних гранях, яркая палитра на тёмном небе.
   Палитра своя, от темы Telegram берём только отступы безопасной зоны. */

:root {
  /* небо */
  --sky: #1b1446;
  --sky-deep: #110c31;
  --sky-low: #2e1f78;
  /* поверхности */
  --card: #2a2070;
  --card-edge: #0f0a2e;
  --card-line: rgba(255, 255, 255, .10);
  /* текст */
  --ink: #ffffff;
  --ink-dim: #cfc8ff;
  --ink-dark: #24140a;
  /* блоки-кнопки: верх / грань */
  --green: #46d85a;   --green-edge: #1f8a33;
  --yellow: #ffd23f;  --yellow-edge: #c48a12;
  --blue: #3ec1ff;    --blue-edge: #1677b5;
  --pink: #ff4fa3;    --pink-edge: #b3226b;
  --violet: #b46bff;  --violet-edge: #6d2fc0;
  --grey: #6d6a8e;    --grey-edge: #3d3a5c;
  --rust: #9a5a2c;    --rust-edge: #5b3215;
  --red: #ff5a4f;     --red-edge: #a8241c;
  /* медали */
  --bronze: #d08a4b;  --bronze-edge: #8c5428;
  --silver: #c9d3e0;  --silver-edge: #7f8ba0;
  --gold: #ffcc33;    --gold-edge: #b88a0b;
  --diamond: #7ef3ff; --diamond-edge: #2aa6c2;
  /* форма */
  --r-block: 14px;
  --r-card: 18px;
  --edge: 6px;
  --stroke: 3px solid rgba(0, 0, 0, .28);
  --font-head: "Russo One", "Arial Black", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  /* безопасная зона: Telegram (fullscreen) или системная */
  --safe-top: max(env(safe-area-inset-top, 0px),
    calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --studs: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .32) 0 3.5px, rgba(0, 0, 0, .10) 4.5px, transparent 5.5px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--sky); color: var(--ink); }
body {
  font: 800 16px/1.4 var(--font-body);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; -webkit-user-drag: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; margin: 0; letter-spacing: .3px; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#app { min-height: 100dvh; overflow-x: hidden; }

/* ---------- фоны-миры ---------- */
.bg {
  position: relative; isolation: isolate;
  min-height: 100dvh;
  padding: 0 16px calc(28px + var(--safe-bottom));
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 40%, var(--sky-low) 100%);
}
/* блочные облака и пиксельные звёзды */
.bg::before {
  content: ""; position: fixed; inset: 0 -60px 0 0; z-index: -1; pointer-events: none;
  background:
    /* облако 1 */
    linear-gradient(var(--cloud), var(--cloud)) 6% 14% / 96px 22px no-repeat,
    linear-gradient(var(--cloud), var(--cloud)) calc(6% + 22px) calc(14% - 18px) / 48px 22px no-repeat,
    /* облако 2 */
    linear-gradient(var(--cloud), var(--cloud)) 88% 32% / 120px 24px no-repeat,
    linear-gradient(var(--cloud), var(--cloud)) calc(88% - 30px) calc(32% - 20px) / 60px 24px no-repeat,
    /* облако 3 */
    linear-gradient(var(--cloud), var(--cloud)) 18% 62% / 84px 20px no-repeat,
    linear-gradient(var(--cloud), var(--cloud)) calc(18% + 18px) calc(62% - 16px) / 40px 20px no-repeat,
    /* облако 4 */
    linear-gradient(var(--cloud), var(--cloud)) 80% 86% / 104px 22px no-repeat,
    linear-gradient(var(--cloud), var(--cloud)) calc(80% + 24px) calc(86% - 18px) / 52px 22px no-repeat,
    /* звёзды-пиксели */
    linear-gradient(var(--star), var(--star)) 30% 8% / 4px 4px no-repeat,
    linear-gradient(var(--star), var(--star)) 62% 20% / 4px 4px no-repeat,
    linear-gradient(var(--star), var(--star)) 12% 40% / 3px 3px no-repeat,
    linear-gradient(var(--star), var(--star)) 70% 52% / 4px 4px no-repeat,
    linear-gradient(var(--star), var(--star)) 44% 74% / 3px 3px no-repeat,
    linear-gradient(var(--star), var(--star)) 94% 6% / 3px 3px no-repeat;
  animation: drift 26s ease-in-out infinite alternate;
}
.bg-default { --cloud: rgba(255, 255, 255, .09); --star: rgba(255, 255, 255, .7); }
.bg-candy {
  --cloud: rgba(255, 255, 255, .28); --star: rgba(255, 255, 255, .9);
  background: linear-gradient(180deg, #5b2a9e 0%, #b84bb8 45%, #ff8fc8 100%);
}
.bg-sunset {
  --cloud: rgba(255, 220, 180, .22); --star: rgba(255, 255, 255, .6);
  background: linear-gradient(180deg, #2a1556 0%, #7b2f7d 38%, #e8566a 72%, #ffae4d 100%);
}
.bg-space {
  --cloud: rgba(140, 120, 255, .10); --star: #fff;
  background:
    radial-gradient(circle at 80% 18%, rgba(180, 107, 255, .35), transparent 38%),
    radial-gradient(circle at 15% 70%, rgba(62, 193, 255, .22), transparent 40%),
    #07051c;
}
@keyframes drift { to { transform: translateX(-60px); } }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  margin: 0 -16px 8px; padding: calc(10px + var(--safe-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(17, 12, 49, .96) 70%, rgba(17, 12, 49, 0));
}
.topbar > div {
  display: flex; align-items: center; gap: 6px;
  min-height: 48px; padding: 6px 12px;
  background: var(--card); border: var(--stroke); border-radius: var(--r-block);
  box-shadow: 0 4px 0 var(--card-edge);
  font-family: var(--font-head); font-size: 17px; white-space: nowrap;
}
.topbar b { font-weight: 400; }
.lvl { flex: 1; min-width: 0; padding-left: 6px !important; }
.lvl img { width: 38px; height: 38px; border-radius: 10px; background: var(--violet); border: 2px solid rgba(0, 0, 0, .25); flex: none; }
.lvl > div { flex: 1; min-width: 0; }
.lvl b { display: block; font-size: 15px; line-height: 1.1; }
.xp {
  height: 12px; margin-top: 4px; border-radius: 4px; overflow: hidden;
  background: var(--card-edge); border: 2px solid rgba(0, 0, 0, .3);
}
.xp i {
  display: block; height: 100%; max-width: 100%;
  background: linear-gradient(180deg, #8dff7a 0 45%, var(--green) 45%);
  transition: width .6s var(--ease-pop);
}
.coins { background: var(--yellow) !important; color: var(--ink-dark); box-shadow: 0 4px 0 var(--yellow-edge) !important; }
.streak { background: #ff8a3d !important; color: var(--ink-dark); box-shadow: 0 4px 0 #b4501a !important; }

/* ---------- кнопки-блоки ---------- */
.btn {
  --top: var(--violet); --edge-c: var(--violet-edge);
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 10px 18px;
  font-family: var(--font-head); font-size: 20px; color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .28);
  background: var(--top);
  border: var(--stroke); border-radius: var(--r-block);
  box-shadow: 0 var(--edge) 0 var(--edge-c), inset 0 3px 0 rgba(255, 255, 255, .35), inset 0 -4px 0 rgba(0, 0, 0, .12);
  transition: transform .08s ease-out, box-shadow .08s ease-out, filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--edge-c), inset 0 3px 0 rgba(255, 255, 255, .25); }
.btn-play {
  --top: var(--green); --edge-c: var(--green-edge);
  min-height: 68px; font-size: 26px;
  background: var(--studs) 0 0 / 22px 22px, var(--green);
}
.btn-shop { --top: var(--yellow); --edge-c: var(--yellow-edge); color: var(--ink-dark); text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn-bag { --top: var(--blue); --edge-c: var(--blue-edge); }
.btn-ghost {
  --top: transparent; --edge-c: rgba(0, 0, 0, .35);
  min-height: 48px; font-size: 17px; color: var(--ink-dim);
  border: 3px dashed rgba(255, 255, 255, .25); box-shadow: none;
}
.btn-ghost:active { box-shadow: none; }

/* ---------- Вера ---------- */
.vera { position: relative; display: inline-flex; justify-content: center; align-items: flex-end; aspect-ratio: 767 / 1100; }
.vera img { height: 100%; width: auto; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .25)); position: relative; z-index: 1; }
.vera-pet {
  position: absolute; z-index: 2; right: -18%; bottom: 4%;
  font-size: 48px; line-height: 1;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .3));
  animation: bob 2.2s ease-in-out infinite .4s;
}
.vera-idle img { animation: idle 3s ease-in-out infinite; transform-origin: 50% 100%; }
.vera-jump img { animation: jump .7s var(--ease-pop) 2; transform-origin: 50% 100%; }
.vera-fly img { animation: fly 2.4s ease-in-out infinite; }
.vera-sad img, img.vera-sad { transform: rotate(-9deg) translateY(4px); transform-origin: 50% 100%; filter: saturate(.6) drop-shadow(0 10px 0 rgba(0, 0, 0, .25)); }
@keyframes idle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(1.5deg); } }
@keyframes jump {
  0% { transform: scale(1, 1); } 15% { transform: scale(1.08, .9); }
  45% { transform: translateY(-28%) scale(.96, 1.06); } 75% { transform: translateY(0) scale(1.05, .94); } 100% { transform: scale(1, 1); }
}
@keyframes fly { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-18px) rotate(2deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* рамки — светящийся блок-портал за Верой */
.frame-gold::before, .frame-rainbow::before {
  content: ""; position: absolute; z-index: 0; left: -14%; right: -14%; top: 6%; bottom: -2%;
  border-radius: 22px; border: 6px solid var(--gold);
  box-shadow: 0 6px 0 var(--gold-edge), 0 0 26px rgba(255, 204, 51, .55), inset 0 0 20px rgba(255, 204, 51, .35);
}
.frame-rainbow::before {
  border: 6px solid transparent;
  background: linear-gradient(var(--sky), var(--sky)) padding-box,
    conic-gradient(#ff4fa3, #ffd23f, #7cff6b, #3ec1ff, #b46bff, #ff4fa3) border-box;
  box-shadow: 0 0 28px rgba(180, 107, 255, .6);
  opacity: .95;
  animation: hue 4s linear infinite;
}
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ---------- загрузка ---------- */
.loading {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; text-align: center; font-family: var(--font-head); font-size: 20px;
}
.loading .btn { max-width: 260px; }
.loading-vera { height: 220px; width: auto; animation: idle 3s ease-in-out infinite; transform-origin: 50% 100%; }

/* ---------- главная ---------- */
.home-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.home-hero .vera { height: clamp(190px, 31dvh, 300px) !important; }
.bubble {
  position: relative; z-index: 3; max-width: 280px; margin-bottom: 10px; padding: 10px 16px;
  background: #fff; color: #2a1f6b; border: var(--stroke); border-radius: 16px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .3);
  font-family: var(--font-head); font-size: 18px; line-height: 1.25; text-align: center;
  animation: pop .45s var(--ease-pop) both;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -12px; width: 18px; height: 18px; margin-left: -9px;
  background: #fff; border-right: var(--stroke); border-bottom: var(--stroke); transform: rotate(45deg);
}
/* блок травы, на котором стоит Вера */
.hero-pad {
  width: min(240px, 70%); height: 34px; margin-top: -10px; border-radius: 8px;
  background: linear-gradient(180deg, var(--green) 0 45%, #8a5a34 45%);
  border: var(--stroke); box-shadow: 0 8px 0 #5b3a1e, 0 18px 24px rgba(0, 0, 0, .35);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.card {
  background: var(--card); border: var(--stroke); border-radius: var(--r-card);
  box-shadow: 0 var(--edge) 0 var(--card-edge);
  padding: 14px 16px;
}
.banner {
  display: block; width: 100%; min-height: 52px; margin: 20px 0 0; padding: 12px 16px; text-align: left;
  border: var(--stroke); border-radius: var(--r-block); font-size: 16px; line-height: 1.3;
}
.banner.rust {
  background: repeating-linear-gradient(135deg, var(--rust) 0 14px, #8a4f25 14px 28px);
  box-shadow: 0 var(--edge) 0 var(--rust-edge); color: #fff3e6;
  transition: transform .08s ease-out, box-shadow .08s;
}
.banner.rust:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--rust-edge); }

.quests { margin-top: 20px; padding-top: 12px; padding-bottom: 10px; }
.quests h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 19px; margin-bottom: 10px; }
.chest {
  padding: 4px 10px; border-radius: 10px; font-size: 15px;
  background: var(--yellow); color: var(--ink-dark); box-shadow: 0 3px 0 var(--yellow-edge);
}
.chest.open { background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-edge); animation: bob 1.6s ease-in-out infinite; }
.quest {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 5px 0;
  border-top: 2px solid var(--card-line); color: var(--ink);
}
.quest:first-of-type { border-top: 0; }
.quest .check {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; background: var(--card-edge); border: 3px solid rgba(255, 255, 255, .22);
  font-family: var(--font-head); font-size: 18px; color: #fff;
}
.quest.done { color: var(--ink-dim); }
.quest.done .check { background: var(--green); border-color: var(--green-edge); box-shadow: 0 3px 0 var(--green-edge); }

.home-actions { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row .btn { font-size: 18px; padding: 10px 8px; }

/* ---------- карта-обби ---------- */
.map-title { text-align: center; font-size: 26px; margin: 6px 0 4px; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.map-soon {
  margin: 10px auto 6px; max-width: 320px; padding: 10px 14px; text-align: center;
  color: var(--ink-dim); font-size: 15px; border: 3px dashed rgba(255, 255, 255, .2); border-radius: var(--r-block);
}
.island { position: relative; margin: 26px 0 10px; padding: 14px 0 22px; }
/* «земля» острова — блочная полоса внизу */
.island::after {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 14px; border-radius: 6px;
  background: linear-gradient(180deg, rgba(70, 216, 90, .5) 0 40%, rgba(138, 90, 52, .5) 40%);
}
.island-title {
  display: table; margin: 0 auto 14px; padding: 8px 16px; max-width: 92%;
  font-size: 18px; text-align: center; line-height: 1.2;
  background: #8a5a34; color: #fff3e0; border: var(--stroke); border-radius: 10px;
  box-shadow: 0 5px 0 #5b3a1e; text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.obby { display: flex; flex-direction: column-reverse; }

.plat {
  --top: var(--green); --edge-c: var(--green-edge);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 46%; min-height: 92px; padding: 10px 8px 12px;
  background: var(--studs) 0 0 / 20px 20px, var(--top);
  border: var(--stroke); border-radius: 12px;
  box-shadow: 0 10px 0 var(--edge-c), 0 18px 18px rgba(0, 0, 0, .35), inset 0 3px 0 rgba(255, 255, 255, .35);
  color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .1s ease-out, box-shadow .1s ease-out;
}
.plat:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--edge-c), 0 8px 10px rgba(0, 0, 0, .3); }
.plat-top { font-size: 28px; line-height: 1.1; }
.plat-title { font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.plat-stars { font-family: var(--font-head); font-size: 16px; color: var(--gold); letter-spacing: 2px; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.tag {
  margin-top: 4px; padding: 2px 8px; border-radius: 8px; font-size: 12px; text-shadow: none;
  background: rgba(0, 0, 0, .35); color: #fff;
}
.tag-ahead { background: var(--blue); color: #06263a; box-shadow: 0 2px 0 var(--blue-edge); }

.plat.locked { --top: var(--grey); --edge-c: var(--grey-edge); color: #e4e2f5; }
.plat.locked .plat-top { opacity: .85; }
.plat.bonus.open:not(.bronze):not(.silver):not(.gold):not(.diamond) { --top: var(--pink); --edge-c: var(--pink-edge); }
.plat.bronze  { --top: var(--bronze);  --edge-c: var(--bronze-edge); }
.plat.silver  { --top: var(--silver);  --edge-c: var(--silver-edge);  color: #22283a; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.plat.gold    { --top: var(--gold);    --edge-c: var(--gold-edge);    color: #3a2600; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
.plat.diamond { --top: var(--diamond); --edge-c: var(--diamond-edge); color: #05303a; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.plat.final {
  width: 76%; min-height: 116px; margin-left: 12% !important;
  --top: var(--red); --edge-c: var(--red-edge);
  background: var(--studs) 0 0 / 20px 20px, linear-gradient(180deg, var(--red), #c2275f);
}
.plat.final.locked { --top: #5d4a7a; --edge-c: #33264a; background: var(--studs) 0 0 / 20px 20px, #5d4a7a; }
.plat.final .plat-top { font-size: 38px; }
.plat.final .plat-title { font-family: var(--font-head); font-size: 17px; }

.plat.locked.final::after, .plat.locked.bonus::after {
  content: "🔒"; position: absolute; top: -12px; left: -8px; font-size: 22px; text-shadow: none;
}

/* текущая: пульсирующее свечение и Вера сверху */
.plat.current { z-index: 2; }
.plat.current::before {
  content: ""; position: absolute; inset: -8px; border-radius: 16px; pointer-events: none;
  border: 4px solid #fff; opacity: .0;
  animation: ring 1.6s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.94); opacity: .9; } 100% { transform: scale(1.12); opacity: 0; } }
.plat-vera {
  position: absolute; left: 50%; bottom: calc(100% - 6px); height: 74px; width: auto; margin-left: -26px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .3));
  animation: bob 1.4s ease-in-out infinite; pointer-events: none;
}
.plat.current { margin-top: 64px; }

/* ржавые: коричневая текстура + крутящаяся шестерёнка */
.rusty { filter: sepia(.55) saturate(1.3) hue-rotate(-12deg); }
.plat.rusty {
  --edge-c: var(--rust-edge);
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .14) 0 6px, transparent 6px 14px), var(--studs) 0 0 / 20px 20px, var(--rust);
}
.plat.rusty::after {
  content: "⚙️"; position: absolute; top: -14px; right: -10px; font-size: 26px;
  animation: spin 4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* пунктир-прыжок */
.jump { position: relative; height: 58px; pointer-events: none; }
.jump i {
  position: absolute; width: 10px; height: 10px; margin-left: -5px; border-radius: 3px;
  background: rgba(255, 255, 255, .4); box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.jump.done i { background: var(--green); }
.trail-stars .jump i, .trail-hearts .jump i { background: none; box-shadow: none; width: 18px; height: 18px; margin-left: -9px; }
.trail-stars .jump i::before, .trail-hearts .jump i::before {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.trail-stars .jump i::before { content: "★"; color: var(--gold); }
.trail-hearts .jump i::before { content: "♥"; color: var(--pink); }
.trail-stars .jump i:nth-child(2n), .trail-hearts .jump i:nth-child(2n) { animation: twinkle 1.4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.3); } }

.map-start {
  margin: 18px auto 0; width: 60%; padding: 10px; text-align: center;
  font-family: var(--font-head); font-size: 18px; letter-spacing: 3px;
  background: repeating-linear-gradient(90deg, #fff 0 16px, #1b1446 16px 32px);
  color: transparent; border: var(--stroke); border-radius: 8px; position: relative;
}
.map-start::after {
  content: "СТАРТ"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; text-shadow: 0 0 6px #000, 0 2px 0 #000;
}

/* ---------- экран-заглушка ---------- */
.soon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding-top: calc(24px + var(--safe-top)); }
.soon h2 { font-size: 28px; }
.soon p { color: var(--ink-dim); margin: 0; }
.soon .btn { max-width: 260px; }

/* ---------- тост ---------- */
#toast {
  position: fixed; z-index: 50; left: 16px; right: 16px; bottom: calc(18px + var(--safe-bottom));
  margin: 0 auto; max-width: 420px; padding: 14px 16px; text-align: center;
  background: #fff; color: #2a1f6b; border: var(--stroke); border-radius: var(--r-block);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .35); font-size: 16px;
  transform: translateY(160%); opacity: 0; pointer-events: none;
  transition: transform .25s var(--ease-pop), opacity .18s;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* ---------- конфетти ---------- */
.confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall 1.8s cubic-bezier(.3, .2, .6, 1) forwards;
}
@keyframes fall { to { top: 105%; rotate: 540deg; } }

/* ---------- общее для игровых экранов ---------- */
[hidden] { display: none !important; }
.btn:disabled { filter: grayscale(.55) brightness(.8); cursor: default; }
.btn:disabled:active { transform: none; box-shadow: 0 var(--edge) 0 var(--edge-c), inset 0 3px 0 rgba(255, 255, 255, .35); }
.btn-small { min-height: 48px; font-size: 17px; padding: 8px 14px; --edge: 5px; }
.section-title { margin: 22px 2px 10px; font-size: 19px; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.stars-big { font-family: var(--font-head); font-size: 24px; letter-spacing: 3px; color: rgba(255, 255, 255, .35); }
.stars-big b { font-weight: 400; color: var(--gold); text-shadow: 0 2px 0 var(--gold-edge); }
.banner.ahead { background: var(--blue); color: #06263a; box-shadow: 0 var(--edge) 0 var(--blue-edge); }
.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
.pop { animation: popin .35s var(--ease-pop); }
.pop-soft { animation: popsoft .4s var(--ease-pop); }
@keyframes shake { 15%, 85% { transform: translateX(-3px); } 30%, 70% { transform: translateX(6px); } 45%, 55% { transform: translateX(-8px); } }
@keyframes popin { 0% { transform: scale(.9); } 60% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes popsoft { 50% { transform: scale(1.025); } }

/* ---------- тема ---------- */
.topic-head { display: flex; align-items: flex-end; gap: 12px; padding-top: calc(14px + var(--safe-top)); }
.topic-vera { flex: none; width: 70px; display: flex; justify-content: center; }
.topic-head h2 { font-size: 26px; line-height: 1.15; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.topic-badges { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.badge { font-size: 26px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
.concept { position: relative; overflow: hidden; }
.concept-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.concept-n { font-size: 14px; color: var(--ink-dim); }
.dots { display: flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.dots i.on { background: var(--yellow); box-shadow: 0 2px 0 var(--yellow-edge); }
.concept-body h3 { font-size: 21px; margin-bottom: 8px; }
.concept-body p { margin: 0; font-weight: 600; font-size: 18px; line-height: 1.5; }
.concept-img { width: 100%; max-height: 240px; object-fit: contain; margin: 4px 0 10px; border-radius: 12px; background: #fff; border: var(--stroke); }
.in-right { animation: inright .28s ease-out; }
.in-left { animation: inleft .28s ease-out; }
@keyframes inright { from { transform: translateX(40px); opacity: 0; } }
@keyframes inleft { from { transform: translateX(-40px); opacity: 0; } }
.concept-nav { margin-top: 14px; }
.btn-nav { --top: var(--blue); --edge-c: var(--blue-edge); font-size: 20px; }
.explain { margin-top: 14px; border-top: 2px solid var(--card-line); padding-top: 10px; }
.explain summary {
  list-style: none; display: flex; align-items: center; min-height: 48px; padding: 0 4px;
  font-family: var(--font-head); font-size: 18px; color: var(--yellow); cursor: pointer;
}
.explain summary::-webkit-details-marker { display: none; }
.explain summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.explain[open] summary::after { transform: rotate(180deg); }
.explain label { display: block; margin: 4px 2px 6px; font-size: 14px; color: var(--ink-dim); }
.ask-input {
  width: 100%; min-height: 50px; padding: 10px 14px; margin-bottom: 10px;
  font: 700 17px var(--font-body); color: #2a1f6b; background: #fff;
  border: var(--stroke); border-radius: 12px; -webkit-user-select: text; user-select: text;
}
.ask-input:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.btn-ask { --top: var(--yellow); --edge-c: var(--yellow-edge); color: var(--ink-dark); text-shadow: none; }
.guide-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; }
.guide-face { font-size: 34px; line-height: 1; flex: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
.bubble.guide { max-width: none; margin: 0; text-align: left; font: 700 17px/1.45 var(--font-body); -webkit-user-select: text; user-select: text; }
.bubble.guide::after { display: none; }
.bubble.thinking { margin-top: 14px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.modes { display: flex; flex-direction: column; gap: 14px; }
.mode { justify-content: flex-start; gap: 14px; min-height: 68px; text-align: left; }
.mode-icon { font-size: 30px; line-height: 1; width: 38px; text-align: center; text-shadow: none; }
.mode-text { display: flex; flex-direction: column; line-height: 1.15; }
.mode-text b { font-weight: 400; font-size: 21px; }
.mode-text small { font-family: var(--font-body); font-size: 14px; font-weight: 800; opacity: .9; }
.mode-warmup { --top: var(--green); --edge-c: var(--green-edge); }
.mode-boss { --top: var(--red); --edge-c: var(--red-edge); background: var(--studs) 0 0 / 22px 22px, var(--red); }
.mode-trial { --top: var(--blue); --edge-c: var(--blue-edge); }
.mode-hardcore { --top: #ff8a3d; --edge-c: #b4501a; }
.mode-recharge { --top: var(--violet); --edge-c: var(--violet-edge); }
.mode.locked { --top: var(--grey); --edge-c: var(--grey-edge); background: var(--grey); color: #e4e2f5; }
.mode.glow { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { filter: brightness(1.2) drop-shadow(0 0 12px rgba(180, 107, 255, .8)); } }

/* ---------- забег ---------- */
.run { position: relative; min-height: 100dvh; padding: 0 16px calc(120px + var(--safe-bottom)); }
.run.boss {
  isolation: isolate;
  background: radial-gradient(circle at 50% 12%, rgba(255, 90, 79, .35), transparent 45%),
    linear-gradient(180deg, #1a0710 0%, #2a0b1e 50%, #12061a 100%);
}
.run-head {
  position: sticky; top: 0; z-index: 20; margin: 0 -16px 10px; padding: calc(10px + var(--safe-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(17, 12, 49, .97) 75%, rgba(17, 12, 49, 0));
}
.run.boss .run-head { background: linear-gradient(180deg, rgba(26, 7, 16, .97) 75%, rgba(26, 7, 16, 0)); }
.run-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 8px; }
.run-title b { font-family: var(--font-head); font-weight: 400; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo { flex: none; font-family: var(--font-head); font-size: 16px; color: #ffb36b; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.runbar { display: flex; gap: 5px; }
.runbar i {
  flex: 1; height: 14px; border-radius: 4px; background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(0, 0, 0, .3); transition: background .25s, transform .25s var(--ease-pop);
}
.runbar i.now { background: rgba(255, 255, 255, .5); transform: scaleY(1.25); }
.runbar i.ok { background: var(--green); box-shadow: 0 3px 0 var(--green-edge); }
.runbar i.meh { background: var(--yellow); box-shadow: 0 3px 0 var(--yellow-edge); }
.runbar i.bad { background: var(--red); box-shadow: 0 3px 0 var(--red-edge); }

.boss-arena { position: relative; display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.boss-face { font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .45)); animation: bossbob 1.8s ease-in-out infinite; }
.boss-face.hit { animation: hit .5s ease-out; }
.boss-face.laugh { animation: laugh .6s ease-in-out; }
@keyframes bossbob { 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes hit { 0% { transform: scale(1); filter: brightness(3); } 30% { transform: scale(.8) rotate(12deg); } 60% { transform: scale(1.1) rotate(-8deg); } 100% { transform: none; } }
@keyframes laugh { 25% { transform: scale(1.18) rotate(-6deg); } 50% { transform: scale(1.12) rotate(6deg); } 75% { transform: scale(1.18) rotate(-4deg); } }
.boss-hp-wrap { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 10px; align-items: center; }
.boss-hp-wrap b { font-family: var(--font-head); font-weight: 400; font-size: 20px; color: #ff8a80; letter-spacing: 2px; }
.boss-hp-n { justify-self: end; font-family: var(--font-head); font-size: 15px; color: #ffd0cc; }
.boss-hp { grid-column: 1 / -1; height: 22px; border-radius: 7px; overflow: hidden; background: #3a0d16; border: 3px solid rgba(0, 0, 0, .5); }
.boss-hp i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(180deg, #ff8a80 0 40%, var(--red) 40%);
  transition: width .5s var(--ease-pop);
}
.dmg {
  position: absolute; left: 40px; top: 0; font-family: var(--font-head); font-size: 32px; color: #fff;
  text-shadow: 0 3px 0 var(--red-edge), 0 0 12px var(--red); pointer-events: none; animation: dmg .9s ease-out forwards;
}
@keyframes dmg { to { transform: translateY(-40px) scale(1.3); opacity: 0; } }

.task { padding: 14px 14px 18px; }
.run.boss .task { background: #3a1430; box-shadow: 0 var(--edge) 0 #1a0710; }
.slide-in { animation: inright .3s ease-out; }
.task-type { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-dim); margin-bottom: 8px; }
.hearts { display: flex; gap: 2px; font-size: 18px; }
.heart.lost { animation: heartlost .45s ease-out; }
@keyframes heartlost { 40% { transform: scale(1.5) rotate(-15deg); } }
.task-q { font-family: var(--font-body); font-weight: 900; font-size: 21px; line-height: 1.3; margin-bottom: 14px; }
.hint { margin: 0 0 10px; font-size: 14px; color: var(--ink-dim); }

/* варианты ответа */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; min-height: 56px; padding: 12px 16px; text-align: left;
  font-size: 18px; font-weight: 800; line-height: 1.25; color: #2a1f6b;
  background: #fff; border: var(--stroke); border-radius: var(--r-block);
  box-shadow: 0 5px 0 #b9b2e6; transition: transform .08s, box-shadow .08s, background .15s;
}
.opts.grid2 .opt { text-align: center; }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #b9b2e6; }
.opt:disabled { cursor: default; }
.opt.right { background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-edge); text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.opt.wrong { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-edge); opacity: .85; }
.opt.right::after, .opt.wrong::after {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .95); font-size: 17px; text-shadow: none;
}
.opts.grid2 .opt.right::after, .opts.grid2 .opt.wrong::after { top: -10px; right: -6px; transform: none; }
.opt.right::after { content: "✓"; color: var(--green-edge); }
.opt.wrong::after { content: "✗"; color: var(--red-edge); }
.opts:not(.grid2):not(.tf-row) .opt { padding-right: 46px; }
.reveal { animation: revealglow 1.2s ease-in-out 2; }
@keyframes revealglow { 50% { filter: brightness(1.25) drop-shadow(0 0 10px rgba(124, 255, 107, .9)); } }

.tf-row { flex-direction: row; }
.tf-row .opt { flex: 1; min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-family: var(--font-head); font-weight: 400; font-size: 19px; text-align: center; }
.tf-ico { font-size: 34px; line-height: 1; }
.tf-row .opt.right::after, .tf-row .opt.wrong::after { top: -10px; right: -6px; transform: none; }

.clues { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clues li {
  padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); border: 2px dashed rgba(255, 255, 255, .25);
  font-size: 17px; font-weight: 800; animation: inright .35s ease-out both;
}
.gap { margin: 0 0 16px; font-size: 21px; font-weight: 900; line-height: 1.8; }
.blank {
  display: inline-block; min-width: 72px; padding: 0 10px; margin: 0 2px; text-align: center; line-height: 1.5;
  color: var(--yellow); border-bottom: 4px dashed var(--yellow); border-radius: 4px;
}
.blank.filled { color: #fff; background: var(--green); border: 0; box-shadow: 0 3px 0 var(--green-edge); animation: popin .35s var(--ease-pop); }

/* пары */
.pair-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-col { display: flex; flex-direction: column; gap: 10px; }
.pair-l, .pair-r {
  position: relative; min-height: 64px; padding: 8px 10px; border-radius: 12px; text-align: center;
  font-size: 16px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere;
  transition: transform .1s, box-shadow .1s, background .15s;
}
.pair-l {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--card-edge); color: #fff; border: 3px solid var(--pc); box-shadow: 0 4px 0 rgba(0, 0, 0, .4);
}
.pair-l.active { background: var(--pc); color: #1b1446; transform: scale(1.04); box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 4px 0 rgba(0, 0, 0, .4); }
.pair-m { font-size: 13px; opacity: .85; }
.pair-l.set .pair-m { opacity: 1; font-weight: 900; }
.pair-r { background: #fff; color: #2a1f6b; border: 3px solid rgba(0, 0, 0, .25); box-shadow: 0 4px 0 #b9b2e6; }
.pair-r.used { background: var(--pc); color: #1b1446; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.pair-r:active:not(:disabled) { transform: translateY(3px); }
.pair-l.right { border-color: var(--green); }
.pair-l.right::after { content: "✓"; position: absolute; top: -9px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 15px; }

/* корзинки */
.pool {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 64px; padding: 10px; margin-bottom: 12px;
  border-radius: 14px; background: rgba(0, 0, 0, .2); border: 3px dashed rgba(255, 255, 255, .2);
}
.pool.target { border-color: var(--yellow); }
.pool-empty { align-self: center; color: var(--ink-dim); font-size: 15px; }
.chip {
  min-height: 48px; padding: 8px 14px; border-radius: 12px; font-size: 17px; font-weight: 800;
  background: #fff; color: #2a1f6b; border: 3px solid rgba(0, 0, 0, .25); box-shadow: 0 4px 0 #b9b2e6;
  transition: transform .1s, box-shadow .1s;
}
.chip.active { background: var(--yellow); box-shadow: 0 0 0 3px #fff, 0 4px 0 var(--yellow-edge); transform: translateY(-3px) scale(1.05); }
.gboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.gboxes:has(> :nth-child(3)) { grid-template-columns: 1fr; }
.gbox {
  min-height: 110px; padding: 10px; border-radius: 14px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 3px solid var(--pc); box-shadow: 0 5px 0 rgba(0, 0, 0, .35);
  transition: background .15s, transform .15s;
}
.gbox > b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 16px; margin-bottom: 8px; color: var(--pc); overflow-wrap: anywhere; }
.gbox.target { background: rgba(255, 255, 255, .14); animation: boxpulse 1s ease-in-out infinite; }
@keyframes boxpulse { 50% { transform: scale(1.02); } }
.gbox.right { border-color: var(--green); background: rgba(70, 216, 90, .16); }
.gitems { display: flex; flex-wrap: wrap; gap: 6px; }
.gitems .chip { min-height: 48px; font-size: 15px; padding: 6px 10px; }

/* порядок */
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.order-row {
  display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 6px 6px 10px;
  background: #fff; color: #2a1f6b; border: var(--stroke); border-radius: 12px; box-shadow: 0 4px 0 #b9b2e6;
}
.order-row.moved { animation: popin .3s var(--ease-pop); }
.order-row .n {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  background: var(--violet); color: #fff; font-family: var(--font-head); font-size: 16px;
}
.order-row .t { flex: 1; font-size: 17px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.mv {
  flex: none; width: 48px; height: 48px; border-radius: 10px; font-size: 18px; color: #fff;
  background: var(--blue); border: 3px solid rgba(0, 0, 0, .25); box-shadow: 0 4px 0 var(--blue-edge);
}
.mv:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-edge); }
.mv:disabled { background: #d8d4f0; box-shadow: none; color: #fff; }
.order-list.right .order-row { background: #dfffd9; box-shadow: 0 4px 0 var(--green-edge); }
.order-list.right .n { background: var(--green); }

.btn-check { margin-top: 14px; --top: var(--yellow); --edge-c: var(--yellow-edge); color: var(--ink-dark); text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }

/* «почему» и дальше */
.why { display: none; margin-top: 16px; padding: 12px 14px; border-radius: 14px; border: var(--stroke); animation: popin .35s var(--ease-pop); }
.why.show { display: block; }
.why b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 19px; }
.why p { margin: 6px 0 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
.why.good { background: #1f6b34; box-shadow: 0 5px 0 #0f3d1c; }
.why.learn { background: #6b4a12; box-shadow: 0 5px 0 #3d2a08; }
.btn-next { margin-top: 18px; }
.run-hero { position: fixed; z-index: 15; right: 6px; bottom: calc(4px + var(--safe-bottom)); pointer-events: none; }
.run-hero .vera-jump img { animation-iteration-count: 1; }

/* ---------- итоги ---------- */
.result { display: flex; flex-direction: column; align-items: stretch; text-align: center; padding-top: calc(14px + var(--safe-top)); }
.result-hero { display: flex; justify-content: center; }
.result-hero .vera { height: clamp(150px, 24dvh, 200px) !important; }
.result-title { font-size: 30px; margin-top: 6px; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); animation: popin .5s var(--ease-pop) both; }
.result-stars { font-size: 46px; letter-spacing: 6px; margin-top: 4px; }
.result-stars .star { display: inline-block; }
.result-stars .star.on { color: var(--gold); text-shadow: 0 3px 0 var(--gold-edge), 0 0 18px rgba(255, 204, 51, .7); animation: popin .45s var(--ease-pop); }
.gain {
  align-self: center; margin-top: 10px; padding: 8px 22px; border-radius: 16px;
  font-family: var(--font-head); font-size: 44px; line-height: 1.1;
  background: var(--yellow); color: var(--ink-dark); border: var(--stroke); box-shadow: 0 6px 0 var(--yellow-edge);
  font-variant-numeric: tabular-nums;
}
.gain b { font-weight: 400; }
.gain.done { animation: popin .4s var(--ease-pop); }
.gain.zero { background: var(--grey); color: #fff; box-shadow: 0 6px 0 var(--grey-edge); }
.result-sub { margin: 14px 0 0; color: var(--ink-dim); }
.bonuses { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.bonus {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; text-align: left;
  background: var(--card); border: var(--stroke); border-radius: var(--r-block); box-shadow: 0 4px 0 var(--card-edge);
  animation: inright .35s ease-out both;
}
.bonus b { flex: none; font-family: var(--font-head); font-weight: 400; color: var(--yellow); }
.new-medal {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; padding: 12px;
  border: var(--stroke); border-radius: var(--r-card); background: var(--card); box-shadow: 0 var(--edge) 0 var(--card-edge);
  animation: popin .5s var(--ease-pop) 1.2s both;
}
.new-medal .medal-ico { font-size: 48px; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
.new-medal div { display: flex; flex-direction: column; text-align: left; }
.new-medal small { color: var(--ink-dim); font-size: 14px; }
.new-medal b { font-family: var(--font-head); font-weight: 400; font-size: 22px; }
.result .quests { text-align: left; }
.result-wallet { margin: 14px 0 0; color: var(--ink-dim); }
.result-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

/* модалка уровня */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 28, .6); animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.modal-card { width: min(100%, 360px); text-align: center; animation: popin .45s var(--ease-pop); }
.modal-card h2 { font-size: 30px; margin: 10px 0 6px; }
.modal-card p { margin: 6px 0 12px; color: var(--ink-dim); }
.lvl-badge {
  width: 84px; height: 84px; margin: 0 auto; display: grid; place-items: center; border-radius: 22px;
  font-family: var(--font-head); font-size: 42px; color: var(--ink-dark);
  background: var(--studs) 0 0 / 20px 20px, var(--yellow); border: var(--stroke); box-shadow: 0 6px 0 var(--yellow-edge);
  animation: bob 1.4s ease-in-out infinite;
}
.unlocks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.unlock { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); text-align: left; }
.unlock span { font-size: 26px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 360px) {
  .topbar > div { padding: 6px 8px; font-size: 15px; }
  .btn-play { font-size: 23px; }
  .row .btn { font-size: 16px; }
  .plat-title { font-size: 13px; }
}

/* ---------- меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
}

/* ---------- магазин и шкаф ---------- */
.shop-title { margin: 6px 2px 12px; font-size: 26px; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.roblox { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.roblox-emoji { font-size: 44px; line-height: 1; animation: bob 2.2s ease-in-out infinite; }
.roblox h3 { font-size: 22px; }
.roblox p { margin: 0; color: var(--ink-dim); }
.roblox .pending { color: var(--yellow); }
.shop .btn, .wardrobe .btn { margin-top: 12px; }
.roblox .btn { margin-top: 4px; }
.items { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.item { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; text-align: center; min-height: 150px; font-size: 15px; line-height: 1.2; color: var(--ink); }
.item .btn { margin-top: 4px; }
.item-emoji { font-size: 44px; line-height: 1; }
.item.locked { opacity: .65; filter: saturate(.5); }
.item small { color: var(--ink-dim); font-size: 14px; }
button.item { font: inherit; width: 100%; }
button.item:active { transform: translateY(3px); }
.item.on { outline: 4px solid var(--green); outline-offset: -2px; }
.item.on small { color: var(--green); }
.wardrobe-stage { display: flex; justify-content: center; padding: 8px 40px 0; }
.wardrobe .empty { text-align: center; color: var(--ink-dim); }

/* ---------- мамин экран: спокойный, светлый, без анимаций ---------- */
.parent {
  --p-ink: #2b2b33; --p-dim: #6b6b78; --p-line: #e2e0da;
  min-height: 100dvh; padding: calc(16px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  background: #f5f3ee; color: var(--p-ink);
  font: 500 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: text; user-select: text;
}
.parent *, .parent *::before, .parent *::after { animation: none !important; transition: none !important; }
.parent h2 { font: 700 24px/1.2 system-ui, -apple-system, sans-serif; margin: 0 0 14px; }
.parent h3 { font: 700 17px/1.3 system-ui, -apple-system, sans-serif; margin: 0 0 8px; }
.pcard { background: #fff; border: 1px solid var(--p-line); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; }
.parent p { margin: 0; color: var(--p-dim); }
.parent ul { margin: 6px 0 0; padding-left: 18px; }
.parent li { margin: 3px 0; overflow-wrap: anywhere; }
.req { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--p-line); }
.req:first-of-type { border-top: 0; }
.req-btns { display: flex; gap: 8px; }
.pbtn {
  flex: 1; min-height: 48px; padding: 10px 16px; border-radius: 10px; border: 1px solid #c9c6bd;
  background: #fff; color: var(--p-ink); font: 600 16px/1.2 system-ui, -apple-system, sans-serif;
}
.pbtn.ok { background: #2f7d4f; border-color: #2f7d4f; color: #fff; }
.pbtn.no { background: #fff; }
.pbtn.ghost { width: 100%; background: transparent; margin-top: 4px; }
.pbtn:disabled { opacity: .5; cursor: default; }
.settings { display: flex; flex-direction: column; gap: 12px; }
.settings label { display: flex; flex-direction: column; gap: 4px; color: var(--p-dim); font-size: 14px; }
.settings input, .settings select {
  min-height: 48px; padding: 8px 12px; font: 500 17px system-ui, -apple-system, sans-serif;
  border: 1px solid #c9c6bd; border-radius: 10px; background: #fff; color: var(--p-ink);
}
.parent button:focus-visible, .parent input:focus-visible, .parent select:focus-visible { outline: 3px solid #2f6fb0; outline-offset: 2px; }
