/* Hikari — глянцевый объёмный стиль: ночь, золото, стекло и керамика */
:root {
  --gold-1: #fff3b8;
  --gold-2: #f6cf6a;
  --gold-3: #d9a03a;
  --gold-4: #9a6418;
  --night-1: #0d0a1c;
  --night-2: #1b1233;
  --accent: #f6cf6a;            /* может уточняться из themeParams Telegram */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
  --app-h: var(--tg-viewport-stable-height, 100dvh);
  --tw: 52px;
  --th: 55px;
  /* цвета костей — переопределяются темой главы */
  --face-hi: #ffffff;
  --face-1: #fbf3e2;
  --face-2: #e9d6b0;
  --edge-1: #c9a66a;
  --edge-2: #7d5520;
  --glow: 255, 205, 90;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--night-1); overflow: hidden; }
body {
  font-family: 'Comfortaa', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #fff6e0;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* Ночной фон с боке, как в макете */
#bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(40px 40px at 12% 8%, rgba(255, 200, 110, .55), transparent 70%),
    radial-gradient(26px 26px at 86% 12%, rgba(255, 220, 150, .45), transparent 70%),
    radial-gradient(60px 60px at 92% 40%, rgba(255, 170, 80, .22), transparent 70%),
    radial-gradient(50px 50px at 6% 55%, rgba(255, 150, 90, .2), transparent 70%),
    radial-gradient(34px 34px at 20% 88%, rgba(255, 200, 120, .3), transparent 70%),
    radial-gradient(70px 70px at 80% 92%, rgba(255, 190, 110, .18), transparent 70%),
    radial-gradient(120% 70% at 50% 0%, #3a2350 0%, transparent 60%),
    radial-gradient(120% 60% at 50% 110%, #3b2110 0%, transparent 60%),
    linear-gradient(180deg, var(--night-2), var(--night-1));
}
#bg::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #ffe 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 70%, #ffd 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 80%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 45%, #ffe 50%, transparent 51%);
  opacity: .7; animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35 } to { opacity: .8 } }

#app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  height: var(--app-h);
  padding: calc(var(--safe-top) + var(--content-top) + 8px) 14px calc(var(--safe-bottom) + 10px);
}
.screen { display: none; height: 100%; flex-direction: column; }
.screen.active { display: flex; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------- Главный экран ---------- */
.home-head { text-align: center; margin-top: 4px; }
.logo {
  font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800;
  font-size: clamp(44px, 14vw, 62px); letter-spacing: .06em; margin: 0; line-height: 1;
  background: linear-gradient(180deg, #fff7cf 0%, #ffd56b 38%, #e09a2c 60%, #fff0b0 78%, #b9741d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #6b3d0a) drop-shadow(0 0 18px rgba(255, 190, 80, .55));
}
.subtitle { margin: 6px 0 10px; font-weight: 800; color: #ffe7b0; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

.chapter-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; }
.card {
  position: relative; border-radius: 22px; padding: 10px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--card-bg);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 2px #7a4d12, 0 0 0 4px var(--gold-2), 0 0 0 5px #5a3608,
    inset 0 2px 0 rgba(255,255,255,.55), inset 0 -10px 30px rgba(0,0,0,.25),
    0 10px 24px rgba(0,0,0,.55), 0 0 26px var(--card-glow);
  transition: transform .15s ease;
}
.card:active { transform: scale(.97); }
.card::before { /* стеклянный блик */
  content: ''; position: absolute; left: -20%; right: -20%; top: -40%; height: 70%;
  background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0));
  border-radius: 50%; pointer-events: none;
}
.card .badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-weight: 900; font-size: 14px; padding: 3px 9px; border-radius: 12px;
  background: linear-gradient(180deg, #3b2412, #1c1009); color: var(--gold-1);
  box-shadow: 0 0 0 1.5px var(--gold-3), inset 0 1px 0 rgba(255,255,255,.2);
}
.card .progress {
  position: absolute; top: 8px; left: 8px; z-index: 2; font-weight: 900; font-size: 12px;
  padding: 3px 8px; border-radius: 12px; background: rgba(0,0,0,.35); color: #fff6dc;
}
.card .art {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; place-items: center; min-height: 0;
  padding-top: 18px; position: relative; z-index: 1;
}
.card .art span {
  width: clamp(54px, 17vw, 76px); aspect-ratio: 1; display: block;
  filter: drop-shadow(0 5px 6px rgba(0,0,0,.45));
  animation: bob 3.2s ease-in-out infinite;
}
.card .art img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 15%; -webkit-user-drag: none; }
.card .art span:nth-child(2) { animation-delay: -.8s } .card .art span:nth-child(3) { animation-delay: -1.6s } .card .art span:nth-child(4) { animation-delay: -2.4s }
@keyframes bob { 50% { transform: translateY(-4px) scale(1.04) } }
.card .name {
  position: relative; z-index: 1; text-align: center;
  font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; font-size: clamp(16px, 4.8vw, 21px);
  color: #fffaf0; text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 10px rgba(0,0,0,.35);
  padding: 6px 2px 2px; border-top: 1px solid rgba(255,255,255,.25);
}
.card.light  { --card-bg: radial-gradient(120% 90% at 50% 20%, #ffd27a 0%, #e08f1f 55%, #8a4c08 100%); --card-glow: rgba(255,180,60,.35); }
.card.ocean  { --card-bg: radial-gradient(120% 90% at 50% 20%, #5fe0e0 0%, #138a96 55%, #064650 100%); --card-glow: rgba(60,220,230,.3); }
.card.sweets { --card-bg: radial-gradient(120% 90% at 50% 20%, #ff8fc4 0%, #d93a86 55%, #7a1446 100%); --card-glow: rgba(255,90,170,.3); }
.card.space  { --card-bg: radial-gradient(120% 90% at 50% 20%, #a77bff 0%, #5a2bc4 55%, #23105c 100%); --card-glow: rgba(150,100,255,.35); }

.home-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.pill {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(60,36,20,.9), rgba(24,14,10,.92));
  box-shadow: 0 0 0 1.5px var(--gold-3), inset 0 1px 0 rgba(255,255,255,.15), 0 6px 14px rgba(0,0,0,.5);
}
.pill.mini { padding: 5px 10px; }
.pill b { font-size: 20px; font-weight: 900; color: var(--gold-1); }
.lives-pill { flex-direction: column; align-items: flex-start; gap: 2px; }
.coin {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; color: #7a4a06; font-weight: 900;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #ffcc3d 45%, #c27c10 100%);
  box-shadow: inset 0 -2px 3px rgba(120,60,0,.5), 0 0 0 1.5px #a86a0a, 0 0 10px rgba(255,200,60,.5);
}
.pill.mini .coin { width: 22px; height: 22px; font-size: 12px; }
.pill.mini b { font-size: 16px; }
.hearts { display: flex; gap: 4px; }
.heart {
  width: 26px; height: 24px; position: relative;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
.heart svg { width: 100%; height: 100%; display: block; }
.heart.empty { opacity: .35; filter: grayscale(1); }
.hearts.small .heart { width: 20px; height: 18px; }
.regen { font-size: 11px; font-weight: 800; color: #ffd9a0; min-height: 13px; }
.rules-btn { margin: 10px auto 0; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 26px; font-weight: 900; font-size: 18px;
  color: #4a2a04;
  background: linear-gradient(180deg, #fff5c2 0%, #ffd45e 45%, #e3992a 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.8), inset 0 -3px 0 rgba(140,80,0,.45), 0 4px 0 #8a5510, 0 8px 18px rgba(0,0,0,.45);
  transition: transform .1s ease;
}
.btn:active { transform: translateY(2px); }
.btn[disabled] { filter: grayscale(.8) brightness(.7); }
.btn-ghost {
  min-height: 44px; font-size: 16px; color: var(--gold-1);
  background: linear-gradient(180deg, rgba(70,44,22,.9), rgba(30,18,10,.9));
  box-shadow: 0 0 0 1.5px var(--gold-3), inset 0 1px 0 rgba(255,255,255,.15), 0 6px 14px rgba(0,0,0,.4);
}
.btn-teal { color: #fff; background: linear-gradient(180deg, #8ff3e6, #1fb4a8 50%, #0b6c66); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 #064a45, 0 8px 18px rgba(0,0,0,.45); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; font-size: 30px; line-height: 1; font-weight: 900;
  display: grid; place-items: center; padding-bottom: 4px; color: var(--gold-1);
  background: linear-gradient(180deg, rgba(70,44,22,.95), rgba(30,18,10,.95));
  box-shadow: 0 0 0 1.5px var(--gold-3), inset 0 1px 0 rgba(255,255,255,.2), 0 4px 10px rgba(0,0,0,.45);
}

/* ---------- Верхняя панель ---------- */
.bar { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.bar-title { flex: 1; display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.chapter-title { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; font-size: 20px; color: var(--gold-1); text-shadow: 0 2px 0 rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title small { font-weight: 800; color: #ffdca8; opacity: .85; font-size: 13px; }

/* ---------- Список уровней ---------- */
.lv-lives { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; justify-content: center; }
.level-list { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 8px 4px 12px; align-content: start; }
.lvl {
  position: relative; min-height: 92px; border-radius: 20px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left;
  background: var(--card-bg);
  box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-2), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -8px 18px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.45);
  overflow: hidden;
}
.lvl::before { content: ''; position: absolute; left: -10%; right: -10%; top: -50%; height: 80%; border-radius: 50%; background: linear-gradient(180deg, rgba(255,255,255,.3), transparent); pointer-events: none; }
.lvl:active { transform: scale(.97); }
.lvl .num { font-family: 'Comfortaa', system-ui, sans-serif; font-size: 30px; font-weight: 800; line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.lvl .meta { font-size: 13px; font-weight: 800; opacity: .95; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.lvl .stars { position: absolute; right: 10px; top: 10px; font-size: 16px; letter-spacing: -2px; }
.lvl .stars .off { filter: grayscale(1) brightness(.6); opacity: .6; }
.lvl.locked { filter: saturate(.45) brightness(.6); }
.lvl.locked .lock { filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.lvl.locked .lock { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lvl.current { animation: pulseLvl 1.6s ease-in-out infinite; }
@keyframes pulseLvl { 50% { box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-1), 0 0 22px rgba(255,210,90,.75), 0 8px 16px rgba(0,0,0,.45); } }
.lv-note { text-align: center; font-size: 12px; opacity: .7; margin: 4px 0 0; }

/* ---------- Игра ---------- */
.timer {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 18px; min-width: 96px; justify-content: center;
  background: linear-gradient(180deg, rgba(60,36,20,.95), rgba(24,14,10,.95));
  box-shadow: 0 0 0 1.5px var(--gold-3), inset 0 1px 0 rgba(255,255,255,.15), 0 4px 10px rgba(0,0,0,.45);
}
.timer b { font-size: 22px; font-weight: 900; color: var(--gold-1); font-variant-numeric: tabular-nums; }
.timer.low b { color: #ff7a6a; animation: lowPulse .8s ease-in-out infinite; }
.timer.frozen { box-shadow: 0 0 0 2px #9fe8ff, 0 0 18px rgba(120,220,255,.8); background: linear-gradient(180deg, #1f4a66, #0d2333); }
.timer.frozen b { color: #d6f6ff; }
@keyframes lowPulse { 50% { transform: scale(1.1) } }
.game-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; }
.left-count { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; min-width: 56px; }
.left-count b { font-size: 20px; font-weight: 900; color: var(--gold-1); }
.left-count small { font-size: 11px; opacity: .8; }

.board-wrap { flex: 1; position: relative; z-index: 1; min-height: 0; display: grid; place-items: center; }
.board { position: relative; transform-origin: 50% 50%; }
.board.shuffling .tile { animation: shuf .5s ease; }
@keyframes shuf { 40% { transform: rotateY(90deg) scale(.9) } }

.tile { position: absolute; width: var(--tw); height: var(--th); transition: transform .15s ease, opacity .2s; }
/* touch-action не наследуется: без него WebView ждёт ~300 мс, не двойное ли это касание */
.board-wrap, .board, .tile, .tile .face, .tile .ico { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tile .face {
  /* кость — готовая картинка из атласа (с золотым ободком), здесь только объём и тень */
  position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--th) - var(--tw));
  border-radius: 15%;
  box-shadow: 0 2px 0 #c89a45, 0 4px 0 #8a5c1c, 0 5px 0 #4d3008, 0 7px 10px rgba(0,0,0,.55);
  transition: filter .2s, box-shadow .15s, transform .15s;
}
.tile .ico {
  display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 15%;
  pointer-events: none; -webkit-user-drag: none; image-rendering: auto;
}
.tile.blocked .face { filter: brightness(.72) saturate(.85); }
.tile.free { cursor: pointer; }
.tile.sel { transform: translateY(-5px); }
.tile.sel .face {
  box-shadow: 0 2px 0 #c89a45, 0 4px 0 #8a5c1c, 0 5px 0 #4d3008,
    0 0 0 3px rgba(var(--glow), .95), 0 0 22px 7px rgba(var(--glow), .85);
}
.tile.sel .ico { filter: brightness(1.08) saturate(1.1); }
.tile.hint .face { animation: hintPulse .7s ease-in-out infinite; }
@keyframes hintPulse { 50% { box-shadow: 0 4px 0 #8a5c1c, 0 0 0 3px #9fffe0, 0 0 22px 8px rgba(120,255,210,.9); transform: translateY(-3px); } }
.tile.shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px) } 40%, 80% { transform: translateX(4px) } }
.tile.vanish { pointer-events: none; animation: vanish .55s ease forwards; z-index: 99999 !important; }
.tile.vanish .face { box-shadow: 0 0 0 3px var(--gold-1), 0 0 30px 12px rgba(var(--glow), 1); filter: brightness(1.2); }
@keyframes vanish {
  0% { transform: translateY(-5px) scale(1); opacity: 1 }
  45% { transform: translateY(-14px) scale(1.18); opacity: 1 }
  100% { transform: translateY(-30px) scale(.4); opacity: 0 }
}
.tile.appear { animation: appear .35s ease; }
@keyframes appear { from { transform: scale(.4) translateY(-20px); opacity: 0 } }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; z-index: 100000;
  background: radial-gradient(circle, #fff, rgba(var(--glow), 1) 40%, transparent 70%); animation: spark .7s ease-out forwards; }
/* fixed-искры для табло */
.spark.fixed { position: fixed; z-index: 70; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0 } }

/* темы костей по главам (как на листах-атласах) */
body.th-light  { --face-hi: #ffffff; --face-1: #fbf4e6; --face-2: #e8d3a8; --edge-1: #c9a465; --edge-2: #7a531c; --glow: 255, 205, 90; }
body.th-ocean  { --face-hi: #4fb3c4; --face-1: #1d6f80; --face-2: #0b3a48; --edge-1: #0a5560; --edge-2: #04222a; --glow: 110, 235, 255; }
body.th-sweets { --face-hi: #ffe0ee; --face-1: #ff9cc7; --face-2: #d9568f; --edge-1: #b03c70; --edge-2: #5e1638; --glow: 255, 140, 200; }
body.th-space  { --face-hi: #4a4fa8; --face-1: #232a6e; --face-2: #0e1236; --edge-1: #1b1f55; --edge-2: #07091e; --glow: 170, 140, 255; }
body.th-ocean .tile.blocked .face, body.th-space .tile.blocked .face { filter: brightness(.68) saturate(.85); }

.boosts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 8px; }
.boost {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 66px; border-radius: 16px; padding: 6px 2px;
  background: linear-gradient(180deg, rgba(80,52,26,.95), rgba(32,20,10,.95));
  box-shadow: 0 0 0 1.5px var(--gold-3), inset 0 2px 0 rgba(255,255,255,.18), 0 5px 12px rgba(0,0,0,.5);
}
.boost:active { transform: scale(.94); }
.boost .bi { font-size: 24px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.boost .bn { font-size: 9.5px; font-weight: 900; color: #ffe2b0; white-space: nowrap; }
.boost .bc {
  position: absolute; top: -6px; right: -2px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
  display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #4a2a04;
  background: linear-gradient(180deg, #fff3b0, #f0b43a); box-shadow: 0 0 0 1.5px #8a5510;
}
.boost.empty { filter: grayscale(.9) brightness(.6); }

/* ---------- Оверлеи ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5,3,14,.68); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.overlay.hidden { display: none; }
.sheet {
  width: min(360px, 100%); max-height: calc(var(--app-h) - 40px); overflow-y: auto;
  border-radius: 26px; padding: 22px 20px 20px; text-align: center; position: relative;
  background: radial-gradient(120% 80% at 50% 0%, #4a2c5e 0%, #1d1230 60%, #120b20 100%);
  box-shadow: 0 0 0 2px #6b420e, 0 0 0 4px var(--gold-2), 0 0 0 5px #4a2c06, 0 20px 50px rgba(0,0,0,.7), 0 0 40px rgba(255,190,80,.25);
  animation: sheetIn .3s cubic-bezier(.2,1.4,.4,1);
}
@keyframes sheetIn { from { transform: scale(.8); opacity: 0 } }
.sheet h2 { font-family: 'Comfortaa', system-ui, sans-serif; margin: 0 0 6px; font-size: 30px; color: var(--gold-1); text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 16px rgba(255,190,80,.5); }
.sheet h2.ru { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 900; }
.sheet p { margin: 8px 0; line-height: 1.4; font-weight: 700; color: #ffeccc; }
.sheet .big-ico { font-size: 54px; margin: 4px 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.sheet .stars-big { font-size: 40px; letter-spacing: 4px; margin: 4px 0; }
.sheet .stars-big .off { filter: grayscale(1) brightness(.5); }
.sheet .stats { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.sheet .stat { flex: 1; padding: 10px 6px; border-radius: 16px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,210,120,.3); }
.sheet .stat b { display: block; font-size: 22px; color: var(--gold-1); }
.sheet .stat small { font-size: 12px; opacity: .8; }
.sheet .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sheet .rules { text-align: left; }
.sheet .rules li { margin: 8px 0; line-height: 1.4; font-weight: 700; color: #ffeccc; }
.demo { display: flex; justify-content: center; gap: 8px; margin: 10px 0; }
.demo .mt { width: 58px; height: 58px; border-radius: 15%; object-fit: contain; display: block;
  box-shadow: 0 3px 0 #c89a45, 0 5px 0 #6b4515, 0 0 16px rgba(255,205,90,.85); }
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 100px); transform: translateX(-50%); z-index: 60;
  padding: 10px 16px; border-radius: 16px; font-weight: 800; background: rgba(20,12,30,.92); box-shadow: 0 0 0 1.5px var(--gold-3); max-width: 90%; text-align: center; }
.toast.hidden { display: none !important; }
.toast { pointer-events: none; width: max-content; }

@media (max-height: 700px) {
  .boost { min-height: 56px; } .boost .bi { font-size: 22px; }
  .card .art span { width: 52px; }
}

/* ---------- Табло (сборщик костей) ---------- */
.tray-wrap {
  margin-top: 8px; padding: 7px; border-radius: 20px;
  background: linear-gradient(180deg, #fff1b5, #d9a03a 40%, #8a5510 100%);
  box-shadow: 0 0 0 1.5px #5a3608, inset 0 2px 0 rgba(255,255,255,.7), 0 8px 18px rgba(0,0,0,.55), 0 0 22px rgba(255,190,80,.25);
}
.tray {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 6px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(30,20,50,.92), rgba(8,6,18,.96));
  box-shadow: inset 0 3px 10px rgba(0,0,0,.7), inset 0 -1px 0 rgba(255,255,255,.12);
  position: relative; overflow: hidden;
}
.tray::after { /* стеклянный блик */
  content: ''; position: absolute; left: 4%; right: 4%; top: 0; height: 40%; border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.14), transparent); pointer-events: none;
}
.tray .cell {
  aspect-ratio: 1; border-radius: 12px; position: relative; display: grid; place-items: center; min-width: 0;
  background: radial-gradient(120% 100% at 50% 20%, rgba(255,255,255,.08), rgba(0,0,0,.25));
  box-shadow: inset 0 0 0 1.5px rgba(255,214,130,.28), inset 0 2px 6px rgba(0,0,0,.6);
}
.tray .cell.bonus {
  background: radial-gradient(120% 100% at 50% 25%, #ffe9a0, #e0a432 55%, #8a5510);
  box-shadow: inset 0 0 0 2px #fff0b0, 0 0 14px 3px rgba(255,200,70,.75);
  animation: bonusGlow 1.8s ease-in-out infinite; cursor: pointer;
}
.tray .cell.bonus .lock { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.tray .cell.bonus .blabel { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-size: 9px; font-weight: 900; color: #4a2a04; }
.tray .cell.bonus .blabel { left: 1px; right: 1px; font-size: clamp(7px, 2.1vw, 9px) !important; line-height: 1.05; letter-spacing: -0.02em; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.tray .cell.bonus.open {
  background: radial-gradient(120% 100% at 50% 20%, rgba(255,230,150,.25), rgba(60,36,8,.6));
  box-shadow: inset 0 0 0 2px #ffd56b, 0 0 16px 4px rgba(255,200,70,.7); cursor: default;
}
@keyframes bonusGlow { 50% { box-shadow: inset 0 0 0 2px #fff6cf, 0 0 22px 6px rgba(255,210,90,.95); } }
.tray-tile { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 15%;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.55)); }
.tray-tile.landed { animation: land .22s ease; }
@keyframes land { 0% { transform: scale(1.18) } 100% { transform: scale(1) } }
.flyer { position: fixed; z-index: 80; pointer-events: none; border-radius: 15%; transform-origin: 0 0;
  will-change: transform; filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)); }
.tray-ghost { position: fixed; z-index: 75; pointer-events: none; border-radius: 15%;
  animation: trayVanish .55s ease forwards; }
@keyframes trayVanish {
  0% { transform: scale(1); filter: brightness(1.1) drop-shadow(0 0 0 rgba(255,210,90,0)); opacity: 1 }
  40% { transform: scale(1.22) translateY(-6px); filter: brightness(1.5) drop-shadow(0 0 14px rgba(255,210,90,1)); opacity: 1 }
  100% { transform: scale(.3) translateY(-24px); opacity: 0 }
}

/* ---------- Сложность ---------- */
.diff-chip { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 900; color: #fff;
  vertical-align: middle; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.diff-chip.green { background: linear-gradient(180deg, #6fe38a, #1f9a45); }
.diff-chip.red { background: linear-gradient(180deg, #ff8077, #c8261d); }
.diff-chip.purple { background: linear-gradient(180deg, #c99bff, #7232d6); }
.t-green { color: #7ff09a } .t-red { color: #ff8a80 } .t-purple { color: #d2a8ff }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 12px; font-weight: 800; margin: 2px 0 6px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1.5px rgba(255,255,255,.5); }
.dot.green { background: #2fbf5a } .dot.red { background: #e03a2f } .dot.purple { background: #8c45f0 }
.level-pages { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.level-pages::-webkit-scrollbar { display: none; }
.page-tab { flex: 0 0 auto; padding: 7px 12px; border-radius: 14px; font-weight: 900; font-size: 13px; color: var(--gold-1);
  background: rgba(40,26,14,.9); box-shadow: 0 0 0 1.5px rgba(217,160,58,.6); }
.page-tab.active { color: #4a2a04; background: linear-gradient(180deg, #fff5c2, #ffd45e 45%, #e3992a); box-shadow: 0 0 0 1.5px #8a5510; }
.page-tab.locked { opacity: .55; }
.level-list.level-list { grid-template-columns: repeat(5, 1fr); gap: 12px 8px; padding: 10px 6px 16px; }
.lvl-dot {
  position: relative; justify-self: center; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; color: #fff;
  box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-2), inset 0 3px 0 rgba(255,255,255,.55), inset 0 -6px 10px rgba(0,0,0,.3), 0 6px 12px rgba(0,0,0,.5);
}
.lvl-dot::before { content: ''; position: absolute; left: 14%; right: 14%; top: 6%; height: 40%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.55), transparent); pointer-events: none; }
.lvl-dot.green { background: radial-gradient(circle at 40% 30%, #8ff5a5, #23a94c 55%, #0f5c27); }
.lvl-dot.red { background: radial-gradient(circle at 40% 30%, #ff9e94, #d8342a 55%, #7a110b); }
.lvl-dot.purple { background: radial-gradient(circle at 40% 30%, #d6b0ff, #7d3be3 55%, #3a1180); width: 66px; height: 66px; }
.lvl-dot .num { font-size: 21px; text-shadow: 0 2px 0 rgba(0,0,0,.45); position: relative; }
.lvl-dot .stars { position: absolute; bottom: -9px; font-size: 11px; letter-spacing: -2px; }
.lvl-dot .stars .off { filter: grayscale(1) brightness(.6); opacity: .55; }
.lvl-dot .lnum { position: absolute; bottom: -12px; font-size: 11px; color: #ffe2b0; opacity: .8; }
.lvl-dot.locked { filter: saturate(.55) brightness(.6); }
.lvl-dot.locked .num { font-size: 18px; }
.lvl-dot.current { animation: pulseDot 1.5s ease-in-out infinite; }
@keyframes pulseDot { 50% { box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-1), 0 0 24px 6px rgba(255,220,110,.85), 0 6px 12px rgba(0,0,0,.5); transform: scale(1.06); } }

/* ---------- Ежедневный бонус ---------- */
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0 4px; }
.day { border-radius: 14px; padding: 6px 3px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,210,120,.3); min-height: 88px; }
.day small { font-size: 10px; font-weight: 900; opacity: .85; }
.day .dico { font-size: 26px; line-height: 1.1; }
.day b { font-size: 9.5px; line-height: 1.15; text-align: center; color: #ffeccc; }
.day.done { opacity: .55; }
.day.today { background: linear-gradient(180deg, rgba(255,214,110,.35), rgba(120,70,10,.45)); box-shadow: inset 0 0 0 2px #ffd56b, 0 0 16px rgba(255,200,80,.7); animation: pulseLvl 1.6s ease-in-out infinite; }
.day.chest { grid-column: span 2; }
.day.chest .dico { font-size: 34px; }
@media (max-width: 370px) { .lvl-dot { width: 54px; height: 54px; } .lvl-dot.purple { width: 58px; height: 58px; } .tray { gap: 4px; padding: 5px; } }

/* ---------- Главный экран: сага ---------- */
.home-head { position: relative; }
.lang-btn { position: absolute; right: 0; top: 2px; padding: 6px 11px; border-radius: 14px; font-weight: 900; font-size: 13px;
  color: #4a2a04; background: linear-gradient(180deg, #fff5c2, #ffd45e 45%, #e3992a); box-shadow: 0 0 0 1.5px #8a5510, 0 3px 0 #6b420e; }
.theme-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 20px; position: relative; overflow: hidden;
  background: var(--card-bg); box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-2), inset 0 2px 0 rgba(255,255,255,.5), 0 8px 18px rgba(0,0,0,.5); }
.theme-banner::before { content: ''; position: absolute; left: -10%; right: -10%; top: -60%; height: 90%; border-radius: 50%; background: linear-gradient(180deg, rgba(255,255,255,.3), transparent); pointer-events: none; }
.theme-banner.light, .saga-card.light { --card-bg: radial-gradient(120% 90% at 50% 20%, #ffd27a 0%, #e08f1f 55%, #8a4c08 100%); }
.theme-banner.ocean, .saga-card.ocean { --card-bg: radial-gradient(120% 90% at 50% 20%, #5fe0e0 0%, #138a96 55%, #064650 100%); }
.theme-banner.sweets, .saga-card.sweets { --card-bg: radial-gradient(120% 90% at 50% 20%, #ff8fc4 0%, #d93a86 55%, #7a1446 100%); }
.theme-banner.space, .saga-card.space { --card-bg: radial-gradient(120% 90% at 50% 20%, #a77bff 0%, #5a2bc4 55%, #23105c 100%); }
.tb-covers { display: flex; gap: 4px; flex: 0 0 auto; }
.tb-covers img { width: 46px; height: 46px; object-fit: contain; border-radius: 15%; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); animation: bob 3.2s ease-in-out infinite; }
.tb-covers img:nth-child(2) { animation-delay: -1.2s; }
.tb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tb-text .chapter-title { font-size: 22px; color: #fff; }
.tb-text small { font-weight: 900; font-size: 12.5px; color: #fff6dc; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.tb-bar { height: 10px; border-radius: 6px; background: rgba(0,0,0,.38); box-shadow: inset 0 1px 3px rgba(0,0,0,.6); overflow: hidden; }
.tb-bar i { display: block; height: 100%; min-width: 4px; border-radius: 6px; background: linear-gradient(180deg, #fff6c8, #ffd25a 50%, #e39a22); box-shadow: 0 0 8px rgba(255,220,110,.8); }
.play-btn { margin: 14px auto 6px; width: min(100%, 330px); padding: 12px 10px 13px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #fff; position: relative; overflow: hidden; animation: playPulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 2.5px #6b420e, 0 0 0 4.5px var(--gold-2), inset 0 3px 0 rgba(255,255,255,.55), 0 7px 0 rgba(0,0,0,.35), 0 12px 24px rgba(0,0,0,.5); }
.play-btn::before { content: ''; position: absolute; left: 6%; right: 6%; top: 4%; height: 45%; border-radius: 30px; background: linear-gradient(180deg, rgba(255,255,255,.45), transparent); pointer-events: none; }
.play-btn:active { transform: translateY(3px) scale(.98); }
.play-btn.green { background: linear-gradient(180deg, #8ff5a5, #23a94c 55%, #0f5c27); }
.play-btn.red { background: linear-gradient(180deg, #ff9e94, #d8342a 55%, #7a110b); }
.play-btn.purple { background: linear-gradient(180deg, #d6b0ff, #7d3be3 55%, #3a1180); }
.play-btn.soon { background: linear-gradient(180deg, #5a4a7a, #2a1f44); animation: none; }
.pl-main { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; font-size: 34px; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.4); letter-spacing: .04em; }
.pl-sub { font-weight: 900; font-size: 15px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
@keyframes playPulse { 50% { transform: scale(1.03); } }
.saga-path { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: center; margin: 22px 0 auto; position: relative; }
.saga-title { text-align: center; font-weight: 900; font-size: 13px; color: #ffdca8; margin: auto 0 -12px; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.saga-path::before { content: ''; position: absolute; left: 8%; right: 8%; top: 38%; height: 4px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--gold-2) 0 8px, transparent 8px 14px); opacity: .7; }
.saga-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 7px; border-radius: 16px; min-width: 0;
  background: var(--card-bg, linear-gradient(180deg, #3a2d5a, #1a1230));
  box-shadow: 0 0 0 1.5px #6b420e, 0 0 0 3px var(--gold-3), inset 0 2px 0 rgba(255,255,255,.4), 0 5px 12px rgba(0,0,0,.5); }
.saga-card .sc-art { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 100%; padding: 0 3px; }
.saga-card .sc-art img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 15%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.saga-card .soon-art { display: grid; place-items: center; font-size: 30px; aspect-ratio: 1; }
.saga-card .sc-name { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; font-size: 10px; line-height: 1.05; text-align: center; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.saga-card .sc-range { font-size: 9.5px; font-weight: 900; opacity: .9; }
.saga-card .sc-state { font-size: 8.5px; font-weight: 900; text-align: center; line-height: 1.05; }
.saga-card.locked { filter: saturate(.25) brightness(.55); }
.saga-card.done::after { content: '✓'; position: absolute; top: -6px; right: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #fff; background: #23a94c; box-shadow: 0 0 0 1.5px #fff; }
.saga-card.current { transform: scale(1.1); z-index: 1; animation: pulseLvl 1.6s ease-in-out infinite; }
.home-actions { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.home-actions .btn { padding: 0 10px; min-height: 44px; font-size: 14px; flex: 1; }
.lives-mini { display: flex; align-items: center; gap: 6px; }
.hearts { align-items: center; position: relative; }
.hearts.inf .heart { filter: drop-shadow(0 0 4px rgba(255,120,140,.9)); }
.inf-badge { margin-left: 2px; font-weight: 900; font-size: 18px; color: #fff; line-height: 1; padding: 1px 6px; border-radius: 10px;
  background: linear-gradient(180deg, #ff9ab0, #e0284a); box-shadow: 0 0 0 1.5px #fff3, 0 0 10px rgba(255,80,120,.8); }
.hearts.small .inf-badge { font-size: 13px; }
.regen.inf { color: #ffb3c4; font-weight: 900; }

/* уровни */
.level-list.level-list { gap: 20px 8px; }
.lvl-dot .lk { position: absolute; bottom: -8px; font-size: 14px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.theme-tab.done { box-shadow: 0 0 0 1.5px #23a94c; }
.soon-card { grid-column: 1 / -1; text-align: center; padding: 26px 16px; border-radius: 22px; margin-top: 10px;
  background: linear-gradient(180deg, rgba(60,40,100,.9), rgba(20,12,40,.95)); box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-2), 0 0 26px rgba(255,210,90,.35); }
.soon-card .soon-ico { font-size: 40px; }
.soon-card h3 { font-family: 'Comfortaa', system-ui, sans-serif; color: var(--gold-1); margin: 8px 0; font-size: 22px; }
.soon-card p { font-weight: 800; color: #ffeccc; }

/* альбом */
.album-body { flex: 1; overflow-y: auto; padding: 4px 2px 14px; }
.album-note { text-align: center; font-size: 12.5px; font-weight: 800; opacity: .8; margin: 2px 0 10px; }
.album-set { margin-bottom: 12px; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(40,26,60,.92), rgba(14,9,26,.95));
  box-shadow: 0 0 0 1.5px rgba(217,160,58,.7), inset 0 1px 0 rgba(255,255,255,.15), 0 6px 14px rgba(0,0,0,.45); }
.album-set.complete { box-shadow: 0 0 0 2px #ffd56b, 0 0 18px rgba(255,200,80,.55); }
.as-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.as-head b { font-weight: 900; color: var(--gold-1); font-size: 15px; }
.as-head span { font-weight: 900; font-size: 13px; opacity: .85; }
.as-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.acard { position: relative; aspect-ratio: 3/4; border-radius: 10px; display: grid; place-items: center; padding: 3px;
  background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1.5px rgba(255,214,130,.25); }
.acard img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 15%; filter: grayscale(1) brightness(.25) contrast(1.2); opacity: .7; }
.acard.own { background: linear-gradient(180deg, #fff3c4, #e3a63a); box-shadow: 0 0 0 1.5px #8a5510, inset 0 2px 0 rgba(255,255,255,.7); }
.acard.own img { filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); opacity: 1; }
.acard i { position: absolute; right: -3px; top: -5px; font-style: normal; font-size: 10px; font-weight: 900; padding: 0 4px; border-radius: 8px; background: #e0284a; color: #fff; }
.as-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; min-height: 26px; }
.as-foot small { font-size: 11.5px; font-weight: 800; opacity: .85; }
.as-done { font-size: 12px; font-weight: 900; color: #8ff5a5; white-space: nowrap; }
.mini-btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.card-drop { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px auto 0; padding: 8px 12px; border-radius: 16px; width: fit-content;
  background: linear-gradient(180deg, rgba(255,214,110,.3), rgba(120,70,10,.4)); box-shadow: inset 0 0 0 1.5px #ffd56b; font-weight: 900; }
.card-drop img { width: 46px; height: 46px; object-fit: contain; border-radius: 15%; animation: bob 2.4s ease-in-out infinite; }
.demo-tray { display: flex; gap: 4px; justify-content: center; padding: 5px; border-radius: 12px; margin: 6px auto 4px; width: fit-content;
  background: linear-gradient(180deg, #2a1c44, #0a0716); box-shadow: 0 0 0 2px #d9a03a; }
.demo-tray i { width: 30px; height: 30px; border-radius: 7px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,214,130,.3); display: grid; place-items: center; font-style: normal; font-size: 14px; }
.demo-tray i img { width: 100%; height: 100%; object-fit: contain; }
.demo-tray i.b { background: radial-gradient(circle at 50% 30%, #ffe9a0, #c98a20); }
.timer.paused { opacity: .85; }

/* ---------- Обучение ---------- */
.tut { position: fixed; inset: 0; z-index: 65; pointer-events: none; }
.tut.hidden { display: none; }
.tut-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(5,3,14,.66), 0 0 0 3px var(--gold-1), 0 0 24px 6px rgba(255,214,110,.8);
  transition: all .3s ease; animation: holePulse 1.4s ease-in-out infinite; }
@keyframes holePulse { 50% { box-shadow: 0 0 0 9999px rgba(5,3,14,.66), 0 0 0 4px #fff, 0 0 32px 10px rgba(255,214,110,.95); } }
.tut-finger { position: fixed; font-size: 38px; transition: left .3s, top .3s; animation: fingerTap 1s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
@keyframes fingerTap { 50% { transform: translateY(-10px) scale(.92); } }
.tut-bubble { position: fixed; left: 14px; right: 14px; padding: 12px 14px; border-radius: 18px; pointer-events: auto; text-align: center;
  background: linear-gradient(180deg, #3a2660, #170f2c); box-shadow: 0 0 0 2px #6b420e, 0 0 0 3.5px var(--gold-2), 0 10px 24px rgba(0,0,0,.6); transition: top .3s; }
.tut-bubble p { margin: 0 0 8px; font-weight: 900; font-size: 16px; line-height: 1.35; color: #fff3d6; }
.tut-actions { display: flex; gap: 8px; justify-content: center; }
.tut-actions .btn { padding: 8px 16px; font-size: 15px; }
.tut-actions .btn:only-child { min-width: 140px; }
@media (max-height: 700px) { .saga-card .sc-state { display: none; } .play-btn { margin: 10px auto 4px; } .pl-main { font-size: 30px; } }

/* ---------- Табло всегда поверх поля ---------- */
.tray-wrap { position: relative; z-index: 20; }
.boosts { position: relative; z-index: 20; }
.bar, .game-info { position: relative; z-index: 21; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.home-actions .btn { min-height: 42px; }
.meta-btn { position: relative; background: linear-gradient(180deg, #ffe58a, #f0a92a 55%, #a5590b) !important; color: #4a2a04 !important; }
.meta-dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 0 2px #fff, 0 0 10px #ff3b5c; animation: pulseDot 1.2s infinite; }
.meta-dot.hidden { display: none; }
.gear-btn { position: absolute; left: 0; top: 2px; width: 38px; height: 34px; border-radius: 14px; font-size: 18px;
  background: linear-gradient(180deg, #fff5c2, #ffd45e 45%, #e3992a); box-shadow: 0 0 0 1.5px #8a5510, 0 3px 0 #6b420e; }
.pause-btn { font-size: 16px; }

/* ---------- Цикл уровней: значки ---------- */
.lvl-dot .clock { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: radial-gradient(circle at 40% 30%, #fff, #cfe8ff 50%, #5b8ccf); box-shadow: 0 0 0 1.5px #23406e, 0 2px 4px rgba(0,0,0,.5); }
.lvl-dot.bonus { background: radial-gradient(circle at 40% 30%, #fff6c8, #ffc93a 50%, #a96a08); width: 66px; height: 66px; overflow: visible; }
.lvl-dot.bonus .num { color: #5a3304; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.lvl-dot.bonus .gift { position: absolute; top: -9px; left: -6px; font-size: 20px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.lvl-dot.bonus::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.85) 48%, transparent 66%) no-repeat; background-size: 250% 100%; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0 } to { background-position: -100% 0 } }
.dot.bonus { background: #ffc93a } .t-gold { color: #ffd45e }
.diff-chip.bonus { background: linear-gradient(180deg, #fff0a0, #e5a41f); color: #4a2a04; text-shadow: none; }
.play-btn.bonus { background: linear-gradient(180deg, #fff6c8, #ffc93a 50%, #a96a08); color: #4a2a04; }
.play-btn.bonus .pl-main { text-shadow: 0 2px 0 rgba(255,255,255,.5); }
.play-btn.bonus::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%) no-repeat; background-size: 250% 100%; animation: shimmer 2.4s linear infinite; pointer-events: none; }
.timer.notimer { background: linear-gradient(180deg, #2e6b3c, #12321b); box-shadow: 0 0 0 2px #7ff09a, 0 0 14px rgba(120,240,150,.5); }
.timer.notimer b { color: #d8ffe0; font-size: 24px; }
.boost.na { filter: grayscale(1) brightness(.45); }
body.bonus-level .board-wrap::before { content: ''; position: absolute; inset: 2% 4%; border-radius: 30px; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 45%, rgba(255,210,90,.28), transparent 70%); animation: twinkle 2s ease-in-out infinite alternate; }
body.bonus-level .tile .face { box-shadow: 0 3px 0 #a36d10, 0 0 0 1.5px #ffd45e, 0 0 10px rgba(255,210,90,.5); }
.bonus-prize { font-weight: 900; color: #ffd45e !important; }
.sheet .stats .stat b { font-size: 20px; }

/* ---------- VFX ---------- */
.tile.free .face { box-shadow: 0 2px 0 #c89a45, 0 4px 0 #8a5c1c, 0 5px 0 #4d3008, 0 7px 10px rgba(0,0,0,.55), 0 0 0 1.5px rgba(255,236,170,.7), 0 0 12px rgba(var(--glow), .5); }
.tile .face { overflow: hidden; }
.tile.free .face::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 60%; pointer-events: none;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.42), transparent); transform: translateX(-120%); animation: sheen 4.5s ease-in-out infinite; }
@keyframes sheen { 0%, 62% { transform: translateX(-120%) } 100% { transform: translateX(260%) } }
.fx-trail { z-index: 79; filter: blur(1.5px) drop-shadow(0 0 10px rgba(255,220,120,.9)); }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }
.fx-flash { position: fixed; z-index: 76; pointer-events: none; border-radius: 16px;
  background: radial-gradient(closest-side, rgba(255,255,230,.95), rgba(255,210,90,.55) 45%, transparent 100%); animation: fxFlash .55s ease-out forwards; }
@keyframes fxFlash { from { opacity: 1; transform: scale(.7) } to { opacity: 0; transform: scale(1.35) } }
.fx-combo { position: fixed; z-index: 95; pointer-events: none; transform: translate(-50%, -100%); font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; font-size: 28px;
  color: #fff6c8; -webkit-text-stroke: 1.5px #8a4a04; text-shadow: 0 3px 0 #8a4a04, 0 0 18px rgba(255,200,80,.95); animation: comboUp 1.05s ease-out forwards; white-space: nowrap; }
@keyframes comboUp { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.5) } 20% { opacity: 1; transform: translate(-50%, -100%) scale(1.15) } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1) } }
.tray .cell.pop { animation: cellPop .45s ease; }
@keyframes cellPop { 0% { transform: scale(1) } 35% { transform: scale(1.22); box-shadow: inset 0 0 0 2px #fff6cf, 0 0 18px 6px rgba(255,220,110,.95) } 100% { transform: scale(1) } }
.fx-shake { animation: fxShake .5s ease; }
@keyframes fxShake { 15%, 55% { transform: translateX(-7px) } 35%, 75% { transform: translateX(7px) } }
.tray-wrap.fx-red { animation: redPulse .42s ease 3; }
@keyframes redPulse { 50% { box-shadow: 0 0 0 2px #ff2b3c, 0 0 30px 10px rgba(255,40,60,.85); } }

/* ---------- Экран загрузки ---------- */
.splash { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px;
  background: radial-gradient(80% 60% at 50% 38%, #4a2a8a 0%, #1c1040 55%, #07040f 100%); transition: opacity .5s ease, transform .5s ease; }
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.sp-glow { position: absolute; width: 340px; height: 340px; border-radius: 50%; top: 18%; background: radial-gradient(closest-side, rgba(255,200,90,.55), transparent); animation: twinkle 1.6s ease-in-out infinite alternate; }
.sp-tiles { position: relative; display: flex; gap: 10px; margin-bottom: 6px; }
.sp-tiles img { width: 62px; height: 62px; border-radius: 15%; object-fit: contain; box-shadow: 0 0 0 2px #d9a03a, 0 6px 0 #6b420e, 0 10px 18px rgba(0,0,0,.6), 0 0 18px rgba(255,200,90,.5);
  background: linear-gradient(180deg, #fff9e8, #e9d3a6); animation: bob 2.2s ease-in-out infinite; }
.sp-tiles img:nth-child(2) { animation-delay: -.5s } .sp-tiles img:nth-child(3) { animation-delay: -1s } .sp-tiles img:nth-child(4) { animation-delay: -1.5s }
.sp-logo { position: relative; font-size: 64px !important; }
.sp-bar-wrap { position: relative; display: flex; align-items: center; gap: 10px; width: min(86%, 320px); margin-top: 18px; }
.sp-bar { flex: 1; height: 18px; border-radius: 12px; padding: 3px; background: linear-gradient(180deg, #2a1a08, #0c0612); box-shadow: 0 0 0 2px #d9a03a, inset 0 2px 6px rgba(0,0,0,.8); }
.sp-bar i { display: block; height: 100%; width: 0; border-radius: 9px; transition: width .2s ease;
  background: linear-gradient(180deg, #fffbe0, #ffd25a 45%, #e8891c); box-shadow: 0 0 12px 3px rgba(255,200,80,.85), inset 0 2px 0 rgba(255,255,255,.8); }
.sp-bar-wrap b { min-width: 44px; font-weight: 900; color: var(--gold-1); text-shadow: 0 0 8px rgba(255,200,80,.8); }
.sp-label { position: relative; margin: 4px 0 0; font-weight: 900; color: #ffe2b0; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.sp-tip { position: relative; max-width: 320px; text-align: center; font-weight: 800; color: #fff3d6; margin-top: 14px; padding: 10px 14px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(80,50,140,.85), rgba(30,18,60,.9)); box-shadow: 0 0 0 1.5px rgba(217,160,58,.8); }

/* ---------- Настройки ---------- */
.settings { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 4px; text-align: left; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,210,120,.3); }
.set-row b { flex: 0 0 auto; min-width: 86px; font-weight: 900; color: #ffeccc; }
.set-row input[type=range] { flex: 1; accent-color: #ffd25a; min-width: 0; }
.lang-row b { flex: 1; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: #3a2a4a; box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 0 0 1.5px #8a5510; transition: background .2s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(180deg, #fff, #d8c9a8); box-shadow: 0 2px 3px rgba(0,0,0,.5); transition: transform .2s; }
.switch input:checked + i { background: linear-gradient(180deg, #8ff5a5, #23a94c); }
.switch input:checked + i::after { transform: translateX(20px); }
.set-note { font-size: 12px !important; opacity: .7; text-align: center; }

/* ---------- Дом (мета) ---------- */
.sparks-pill .spark-ico { font-size: 18px; }
.meta-body { flex: 1; overflow-y: auto; padding: 4px 2px 16px; }
.meta-scene { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 58vh; margin: 0 auto; border-radius: 22px; overflow: hidden;
  box-shadow: 0 0 0 2.5px #6b420e, 0 0 0 4.5px var(--gold-2), 0 10px 24px rgba(0,0,0,.6), 0 0 28px rgba(255,190,80,.25); }
.meta-scene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ms-piece { opacity: 0; transition: opacity .5s; }
.ms-piece.on { opacity: 1; }
.ms-piece.reveal { animation: revealPiece 1.1s ease-out both; }
@keyframes revealPiece { 0% { opacity: 0; filter: brightness(3) saturate(1.5) blur(6px) } 45% { opacity: 1; filter: brightness(1.8) blur(0) } 100% { opacity: 1; filter: none } }
.ms-after { opacity: 0; transition: opacity 1.2s ease; }
.ms-after.on { opacity: 1; }
.meta-scene.show-before .ms-after, .meta-scene.show-before .ms-piece { opacity: 0; }
.ms-marker { position: absolute; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255,240,180,.95), rgba(255,190,60,.6) 60%, transparent 72%); animation: markerPulse 1.3s ease-in-out infinite; }
.ms-marker img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
@keyframes markerPulse { 50% { transform: translate(-50%, -50%) scale(1.18); } }
.mira-bubble { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(58,38,96,.92), rgba(20,12,40,.92)); box-shadow: 0 0 0 1.5px var(--gold-2); font-weight: 900; font-size: 14px; color: #fff3d6; }
.mira-face { font-size: 26px; }
.ms-tag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 10px; font-weight: 900; font-size: 12px; color: #4a2a04; background: linear-gradient(180deg, #fff5c2, #ffd45e); }
.ms-tag:empty { display: none; }
.meta-progress { display: flex; align-items: center; gap: 10px; margin: 10px 2px 6px; }
.mp-bar { flex: 1; height: 14px; border-radius: 8px; padding: 2px; background: #140b20; box-shadow: 0 0 0 1.5px #d9a03a, inset 0 2px 4px rgba(0,0,0,.7); }
.mp-bar i { display: block; height: 100%; border-radius: 6px; min-width: 4px; background: linear-gradient(180deg, #fffbe0, #ffd25a 45%, #e8891c); box-shadow: 0 0 10px rgba(255,200,80,.8); transition: width .5s; }
.meta-progress small { font-weight: 900; color: #ffe2b0; white-space: nowrap; }
.meta-task { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 18px; margin: 6px 0;
  background: linear-gradient(180deg, rgba(60,40,100,.95), rgba(20,12,40,.95)); box-shadow: 0 0 0 1.5px var(--gold-2), 0 6px 14px rgba(0,0,0,.45); }
.meta-task img { width: 50px; height: 50px; object-fit: contain; border-radius: 15%; background: linear-gradient(180deg, #fff9e8, #e9d3a6); box-shadow: 0 0 0 1.5px #d9a03a, 0 3px 0 #6b420e; }
.mt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mt-text b { font-weight: 900; color: var(--gold-1); font-size: 15px; }
.mt-text small { font-size: 11.5px; font-weight: 800; opacity: .85; }
.meta-task .btn[disabled] { opacity: .65; }
.meta-items { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 8px 0; }
.mi { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 1px; border-radius: 9px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(255,214,130,.25); }
.mi img { width: 100%; aspect-ratio: 1; object-fit: contain; filter: grayscale(1) brightness(.5); }
.mi small { font-size: 9px; font-weight: 900; }
.mi.ok { background: linear-gradient(180deg, #fff3c4, #e3a63a); color: #4a2a04; }
.mi.ok img { filter: none; }
.mi.next { box-shadow: 0 0 0 2px #ffd56b, 0 0 10px rgba(255,200,80,.8); }
.mi.next img { filter: none; }
.meta-story { font-size: 13px; font-weight: 800; color: #ffe2b0; opacity: .9; text-align: center; margin: 8px 4px; }
.meta-h { font-family: 'Comfortaa', system-ui, sans-serif; color: var(--gold-1); margin: 12px 0 6px; font-size: 17px; text-align: center; }
.meta-lock { display: flex; align-items: center; gap: 10px; margin: 7px 0; padding: 7px; border-radius: 16px; background: rgba(20,12,36,.9); box-shadow: 0 0 0 1.5px rgba(217,160,58,.55); }
.ml-art { width: 78px; height: 58px; flex: 0 0 auto; border-radius: 12px; background-size: cover; background-position: center; filter: saturate(.65) brightness(.55); box-shadow: 0 0 0 1.5px #8a5510; position: relative; }
.ml-art::after { content: '🔒'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; filter: drop-shadow(0 2px 3px #000); }
.ml-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ml-text b { font-weight: 900; color: #ffeccc; font-size: 14px; }
.ml-text small { font-size: 11.5px; font-weight: 800; opacity: .75; }
.ba-toggle { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.meta-fly { z-index: 96; filter: drop-shadow(0 0 12px rgba(255,220,120,1)); border-radius: 15%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.game-bar .chapter-title { font-size: 17px; }

/* =====================================================================
   Премиальный слой (пакет 8): шрифты, глянцевые иконки, кнопки, рамки, фоны, магазин, альбом, просмотр.
   ===================================================================== */
body { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 600; }
:root { --gold-grad: linear-gradient(180deg, #fff8d6 0%, #ffd86a 30%, #e7a133 55%, #fff0b0 75%, #b8761e 100%); --rim: 0 0 0 1.5px #5c3606, 0 0 0 3px #ffd56b, 0 0 0 4.5px #7a4a0c; }

/* иконки вместо эмодзи */
img.ei { height: 1.3em; width: auto; vertical-align: -0.3em; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.55)); pointer-events: none; user-select: none; }
.big-ico img.ei, .big-ico > img { height: 84px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.55)); }
.sheet .big-ico { font-size: 0; }
.dico img.ei { height: 34px; vertical-align: middle; }
.day.chest .dico img.ei { height: 44px; }
.lvl-dot .stars img.ei { height: 14px; vertical-align: 0; margin: 0 -1px; }
.lvl-dot .lk img.ei { height: 20px; }
.lvl-dot .clock img.ei { height: 17px; vertical-align: -3px; }
.lvl-dot .gift img.ei { height: 22px; }
.timer-ico img.ei { height: 20px; vertical-align: -4px; }
.sheet .stars-big img.ei { height: 52px; vertical-align: middle; }
.sheet .stars-big .off img.ei, .stars .off img.ei { filter: grayscale(1) brightness(.5); }
.mira-face img.ei { height: 30px; }
.tut-finger { font-size: 0; } .tut-finger img { width: 52px; height: 52px; }
.heart { width: 24px; height: 24px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.heart img { width: 100%; height: 100%; display: block; }
.hearts.small .heart { width: 19px; height: 19px; }
img.coin { width: 28px; height: 28px; background: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.pill.mini img.coin { width: 24px; height: 24px; }
.boost .bi { font-size: 0; } .boost .bi img.bico, .boost img.bico { height: 30px; width: 30px; vertical-align: 0; }
.sheet .big-ico img.bico { height: 84px; width: 84px; }
.pause-btn img, .gear-btn img { width: 30px; height: 30px; display: block; }
.pause-btn { padding: 0; }

/* заголовки: объёмный золотой градиент */
.logo { font-family: 'Comfortaa', system-ui, sans-serif; font-size: clamp(40px, 12.5vw, 56px); letter-spacing: .04em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #6b3d0a) drop-shadow(0 0 22px rgba(255, 190, 80, .6)); }
.chapter-title, .sheet h2, .sheet h2.ru, .meta-h, .soon-card h3, .shop-h, .pl-main {
  font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; letter-spacing: .01em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(70,35,0,.9)) drop-shadow(0 0 10px rgba(255,190,80,.35)); text-shadow: none; }
.sheet h2 { font-size: 24px; line-height: 1.15; }
.chapter-title { font-size: 17px; }
.pl-main { font-size: 30px; background: linear-gradient(180deg, #fff, #fff3c0 45%, #ffd56b); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.lvl .num, .lvl-dot .num { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; }
.lvl-dot .num { font-size: 18px; }

/* верхняя панель ресурсов */
.res-bar { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.res { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 6px 0 2px; border-radius: 20px; position: relative;
  background: linear-gradient(180deg, rgba(88,52,128,.95), rgba(34,18,58,.95));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.22), inset 0 -3px 6px rgba(0,0,0,.35), 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 5px 12px rgba(0,0,0,.5); }
.res-ico { width: 38px; height: 38px; margin: -6px 0 -6px -6px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); flex: none; }
.res-v { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.res-v b { font-family: 'Comfortaa', system-ui, sans-serif; font-size: 15px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.res-v small { font-size: 9px; font-weight: 900; color: #ffd9a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.res-lives { flex: 1.25; }
.res-plus { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; font-weight: 900; font-size: 17px; line-height: 1; color: #fff; padding: 0 0 2px;
  background: radial-gradient(circle at 35% 30%, #a8ff9a, #2fb83a 60%, #11671b); box-shadow: 0 0 0 1.5px #ffe7a0, 0 2px 4px rgba(0,0,0,.5); }
.gear-btn { position: static; flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: radial-gradient(circle at 35% 30%, #8d5fd0, #3a1f66 70%); box-shadow: 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 5px 12px rgba(0,0,0,.5); }
.gear-btn img { width: 32px; height: 32px; }
.home-head { margin-top: 0; }
.home-foot, .lang-btn { display: none !important; }

/* глянцевые 3D-кнопки */
.btn { font-family: 'Comfortaa', system-ui, sans-serif; letter-spacing: .01em; border: 0; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe07a 28%, #f5b23c 58%, #d98612 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.95), inset 0 -4px 0 rgba(150,80,0,.45), 0 0 0 1.5px #8a5510, 0 0 0 3px rgba(255,230,150,.6), 0 5px 0 #7a4608, 0 10px 20px rgba(0,0,0,.45);
  text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.btn::after { content: ''; position: absolute; left: 8%; right: 8%; top: 3px; height: 42%; border-radius: 30px; background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0)); pointer-events: none; }
.btn-ghost { color: #fff3c8; text-shadow: 0 1px 2px rgba(0,0,0,.6);
  background: linear-gradient(180deg, #9a6ad8 0%, #6a3cae 45%, #3e1f74 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(20,0,50,.4), 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 5px 0 #24103f, 0 10px 18px rgba(0,0,0,.45); }
.btn-ghost::after { background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0)); }
.btn-teal::after { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); }
.icon-btn { background: radial-gradient(circle at 35% 30%, #8d5fd0, #3a1f66 70%); box-shadow: 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, inset 0 2px 0 rgba(255,255,255,.3), 0 4px 10px rgba(0,0,0,.45); color: #ffe7a0; }
.play-btn { box-shadow: inset 0 3px 0 rgba(255,255,255,.6), inset 0 -6px 0 rgba(0,0,0,.25), 0 0 0 2px #fff0b0, 0 0 0 4px #b8761e, 0 0 0 5.5px #5c3606, 0 8px 0 rgba(0,0,0,.35), 0 16px 30px rgba(0,0,0,.5), 0 0 34px rgba(255,200,90,.35) !important; position: relative; overflow: hidden; }
.play-btn::after { content: ''; position: absolute; left: 6%; right: 6%; top: 4px; height: 40%; border-radius: 40px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); pointer-events: none; }

/* кнопки разделов на главном */
.home-actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.hbtn { grid-column: span 2; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 70px; padding: 6px 4px 7px; border-radius: 20px; overflow: hidden;
  font-weight: 900; font-size: 12.5px; color: #fff3c8; text-shadow: 0 1px 2px rgba(0,0,0,.7);
  background: linear-gradient(180deg, #9a6ad8 0%, #6a3cae 45%, #3e1f74 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(20,0,50,.45), 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 5px 0 #24103f, 0 10px 18px rgba(0,0,0,.45); }
.hbtn::after { content: ''; position: absolute; left: 8%; right: 8%; top: 3px; height: 38%; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0)); pointer-events: none; }
.hbtn img { width: 40px; height: 40px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.55)); }
.hbtn:active { transform: translateY(2px); }
.hbtn.shop-btn, #btn-rules { grid-column: span 3; flex-direction: row; min-height: 52px; gap: 8px; font-size: 14px; }
.hbtn.shop-btn { background: linear-gradient(180deg, #ff9ab0 0%, #e2335f 45%, #8e0f33 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(60,0,20,.4), 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 5px 0 #4a0619, 0 10px 18px rgba(0,0,0,.45); }
.hbtn.shop-btn img, #btn-rules img { width: 34px; height: 34px; }
.hbtn .meta-dot { position: absolute; top: 6px; right: 10px; }

/* богатые фоны по темам */
body.th-light #bg { background: radial-gradient(90% 50% at 50% 0%, rgba(255,170,70,.45), transparent 70%), radial-gradient(60% 40% at 10% 80%, rgba(255,90,120,.28), transparent 70%), radial-gradient(60% 40% at 90% 60%, rgba(255,200,90,.22), transparent 70%), linear-gradient(180deg, #3a1a4e, #170a26 60%, #0e0618); }
body.th-ocean #bg { background: radial-gradient(90% 50% at 50% 0%, rgba(80,230,255,.45), transparent 70%), radial-gradient(70% 40% at 15% 85%, rgba(30,160,200,.35), transparent 70%), radial-gradient(50% 30% at 85% 50%, rgba(120,255,220,.2), transparent 70%), linear-gradient(180deg, #0b4b6e, #062a44 55%, #03152a); }
body.th-sweets #bg { background: radial-gradient(90% 50% at 50% 0%, rgba(255,150,210,.5), transparent 70%), radial-gradient(60% 40% at 10% 75%, rgba(255,210,120,.3), transparent 70%), radial-gradient(60% 40% at 90% 85%, rgba(200,120,255,.3), transparent 70%), linear-gradient(180deg, #6a1f52, #3a0f33 55%, #1c0619); }
body.th-space #bg { background: radial-gradient(80% 45% at 50% 0%, rgba(150,110,255,.5), transparent 70%), radial-gradient(60% 40% at 85% 70%, rgba(255,80,200,.25), transparent 70%), radial-gradient(50% 35% at 10% 50%, rgba(60,200,255,.22), transparent 70%), linear-gradient(180deg, #24145e, #120a36 55%, #07041a); }

/* узорные рамки окон */
.sheet { background: radial-gradient(120% 70% at 50% 0%, #6a3c8e 0%, #2a1748 55%, #150b28 100%);
  box-shadow: 0 0 0 2px #5c3606, 0 0 0 4px #ffd56b, 0 0 0 5px #fff3c0, 0 0 0 7px #b8761e, 0 0 0 8.5px #4a2c06, 0 20px 50px rgba(0,0,0,.7), 0 0 50px rgba(255,190,80,.3), inset 0 0 0 1.5px rgba(255,220,140,.35), inset 0 0 40px rgba(255,180,255,.12); overflow: visible; }
.sheet::before, .sheet::after { content: ''; position: absolute; width: 22px; height: 22px; top: -12px; left: 50%; margin-left: -11px; transform: rotate(45deg); border-radius: 4px; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fff, #ff7ab0 40%, #b0105a); box-shadow: 0 0 0 2px #ffd56b, 0 0 0 3.5px #5c3606, 0 0 14px rgba(255,120,180,.8); }
.sheet::after { display: none !important; } /* был ромб снизу — выглядел как стрелка */
#sheet { overflow-y: auto; }

/* альбом: настоящие коллекционные карточки */
.as-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acard { padding: 0; border: 0; border-radius: 10px; background: none; box-shadow: 0 4px 10px rgba(0,0,0,.5); overflow: hidden; display: block; aspect-ratio: 3/4; position: relative; }
.acard img, .acard.own img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border-radius: 0; filter: none; opacity: 1; display: block; }
.acard.locked img { filter: brightness(.75) saturate(.8); }
.acard .ac-name { position: absolute; left: 7%; right: 7%; bottom: 6%; height: 18%; display: grid; place-items: center; text-align: center; line-height: 1.05;
  font-weight: 900; font-size: 10.5px; color: #fff3c8; text-shadow: 0 1px 2px #000; padding: 0 2px; overflow: hidden; }
.acard .ac-q { font-family: 'Comfortaa', system-ui, sans-serif; font-size: 18px; color: #ffd56b; }
.acard .ac-count { position: absolute; right: 4px; top: 4px; left: auto; font-style: normal; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 9px; background: linear-gradient(180deg, #ff6b8a, #c01040); color: #fff; box-shadow: 0 0 0 1.5px #ffd56b; }
.acard.own.r3 { box-shadow: 0 0 0 1.5px #d9a6ff, 0 0 14px rgba(190,120,255,.8), 0 4px 10px rgba(0,0,0,.5); }
.acard.own.r3::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); background-size: 250% 100%; animation: cardShine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes cardShine { 0% { background-position: 130% 0 } 60%, 100% { background-position: -130% 0 } }
.locked-preview { opacity: .9; margin-top: 10px; }
.card-drop { border: 0; color: inherit; font: inherit; cursor: pointer; }
.card-drop img { width: 54px; height: 72px; object-fit: cover; border-radius: 6px; }
.card-drop span { display: flex; flex-direction: column; text-align: left; } .card-drop span b { color: #fff3c8; }

/* просмотр на весь экран */
.zoom { position: fixed; inset: 0; z-index: 120; background: radial-gradient(90% 60% at 50% 40%, rgba(70,30,110,.92), rgba(5,2,14,.96)); display: flex; flex-direction: column; align-items: center; justify-content: center; touch-action: none; animation: zoomIn .25s ease; }
.zoom.hidden { display: none; }
@keyframes zoomIn { from { opacity: 0 } }
.zoom-stage { width: 100%; flex: 1; display: grid; place-items: center; overflow: hidden; padding: 56px 18px 0; }
.zoom-wrap { width: min(92vw, 440px); display: grid; place-items: center; perspective: 1200px; }
.zoom-target { transform-origin: 50% 50%; will-change: transform; }
.zoom-img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 18px; box-shadow: 0 0 0 2px #ffd56b, 0 0 0 4px #5c3606, 0 20px 50px rgba(0,0,0,.7); user-select: none; -webkit-user-drag: none; }
.zoom-cap { min-height: 60px; padding: 10px 22px calc(18px + env(safe-area-inset-bottom)); text-align: center; color: #ffeccc; font-weight: 800; max-width: 460px; }
.zoom-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px; padding: 0; background: none; border: 0; z-index: 2; }
.zoom-close img { width: 100%; height: 100%; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.card-view { width: min(80vw, 62vh * .75, 380px); }
.cv-flip { position: relative; width: 100%; aspect-ratio: 3/4; transform-style: preserve-3d; }
.cv-flip.flip-in > .cv-face { animation: none; }
.cv-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6%; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.7), 0 0 40px rgba(255,200,100,.35); }
.cv-face img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.cv-back { transform: rotateY(180deg); }
.cv-flip.flip-in { animation: cardFlip .8s cubic-bezier(.3,1.3,.5,1) both; }
@keyframes cardFlip { from { transform: rotateY(-180deg) scale(.85); } to { transform: rotateY(0) scale(1); } }
.card-view.r3 .cv-face { box-shadow: 0 20px 50px rgba(0,0,0,.7), 0 0 60px rgba(200,120,255,.75); }
.cv-plate { position: absolute; left: 7%; right: 7%; bottom: 5.5%; height: 19%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.cv-name { font-family: 'Comfortaa', system-ui, sans-serif; font-size: clamp(15px, 5vw, 21px); line-height: 1.1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0,0,0,.8)); }
.cv-rar { font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: #e8e8f4; }
.cv-rar.r2 { color: #8fd6ff; } .cv-rar.r3 { color: #e2b8ff; text-shadow: 0 0 8px rgba(200,120,255,.9); }
.cv-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%); background-size: 250% 100%; animation: cardShine 2.6s ease-in-out .8s infinite; pointer-events: none; }
.cv-desc { margin: 0; line-height: 1.4; font-size: 15px; }
.meta-scene.zoomed { width: min(92vw, 440px); }
.prod-zoom .pa { width: 260px; height: 260px; }
.prod-zoom .pa-main { width: 200px; height: 200px; } .prod-zoom .pa-sub { width: 110px; height: 110px; }
[data-zoom], .acard, .meta-scene, .prod-art { cursor: zoom-in; }

/* магазин */
.shop-body { flex: 1; overflow-y: auto; padding: 4px 2px 18px; }
.shop-h { margin: 14px 4px 8px; font-size: 16px; }
.shop-note { margin: 6px 4px; padding: 10px 12px; border-radius: 14px; background: rgba(255,120,150,.16); box-shadow: 0 0 0 1px rgba(255,160,180,.5); font-weight: 800; font-size: 13px; color: #ffe0e6; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.shop-grid.packs { grid-template-columns: 1fr; }
.prod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 7px 9px; border-radius: 20px; text-align: center;
  background: radial-gradient(120% 80% at 50% 0%, #7a48b8 0%, #3a1d66 60%, #22113e 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 8px 18px rgba(0,0,0,.5); }
.prod.wide { flex-direction: row; text-align: left; padding: 12px; gap: 12px; }
.prod.wide .prod-text { flex: 1; }
.prod.starter { background: radial-gradient(120% 90% at 20% 0%, #ff8fb0 0%, #b5245a 55%, #5a0b2c 100%); }
.prod.pass { background: radial-gradient(120% 90% at 20% 0%, #ffe08a 0%, #b77a12 50%, #4f2a04 100%); }
.prod-art { position: relative; width: 78px; height: 78px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(255,230,160,.55), rgba(255,200,90,0) 70%); }
.pa { position: relative; width: 78px; height: 78px; display: grid; place-items: center; }
.pa-main { width: 64px; height: 64px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
.pa-sub { position: absolute; right: -2px; bottom: 0; width: 36px; height: 36px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.pa-coins1500 .pa-sub { left: -2px; right: auto; }
.pa-x { position: absolute; right: -4px; bottom: 4px; font-family: 'Comfortaa', system-ui, sans-serif; font-size: 18px; color: #fff; text-shadow: 0 2px 0 #7a0016, 0 0 6px rgba(0,0,0,.7); }
.prod-badge { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); font-style: normal; white-space: nowrap; font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 10px;
  background: linear-gradient(180deg, #7ff09a, #1d9c3a); color: #fff; box-shadow: 0 0 0 1.5px #ffe7a0; }
.prod-badge.hot { background: linear-gradient(180deg, #ff9a6a, #e0284a); }
.prod-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prod-text b { font-weight: 900; font-size: 13.5px; color: #fff; line-height: 1.15; }
.prod-text small { font-size: 11px; font-weight: 700; color: #ffe2c0; line-height: 1.25; }
.prod:not(.wide) .prod-text small { display: none; }
.pass-on { color: #9dffb0 !important; font-weight: 900 !important; }
.prod-buy { min-height: 38px; padding: 0 12px; font-size: 16px; font-weight: 900; width: 100%; gap: 4px; }
.prod.wide .prod-buy { width: auto; min-width: 88px; }
.prod-buy img.xtr { height: 22px; vertical-align: -5px; }
.prod-buy.wait { filter: brightness(.8); pointer-events: none; }
.prod.owned { opacity: .7; }
.shop-foot { margin: 16px 6px 0; font-size: 11.5px; font-weight: 700; color: #d9c6ef; line-height: 1.4; text-align: center; }
.lang-pick { display: flex; gap: 6px; margin-left: auto; }
.lang-row b { white-space: nowrap; }
img.ei.pa-main { width: 64px; height: 64px; vertical-align: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
img.ei.pa-sub { position: absolute; right: -2px; bottom: 0; width: 36px; height: 36px; vertical-align: 0; }
.pa-coins1500 img.ei.pa-sub { left: -2px; right: auto; }
.prod.wide .prod-art { width: 84px; height: 84px; }
.prod-zoom img.ei.pa-main { width: 200px; height: 200px; } .prod-zoom img.ei.pa-sub { width: 110px; height: 110px; }
.zoom { background: radial-gradient(90% 60% at 50% 40%, rgba(60,26,100,.985), rgba(5,2,14,.99)); }
.prod:not(.wide) .prod-buy { margin-top: auto; }

/* =====================================================================
   Мягкие скругления везде (пакет 14): ничего острого и «рубленого».
   ===================================================================== */
:root { --r-xl: 30px; --r-l: 24px; --r-m: 18px; --r-s: 14px; }
.sheet { border-radius: 34px; }
.tray-wrap { border-radius: 28px; padding: 8px; }
.tray { border-radius: 22px; }
.tray .cell { border-radius: 16px; }
.tray::after { border-radius: 22px 22px 50% 50%; }
.boost { border-radius: 22px;
  background: linear-gradient(180deg, #8e5fd0 0%, #5a2f9c 50%, #34176a 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(20,0,50,.4), 0 0 0 1.5px #ffd56b, 0 0 0 3px #5c3606, 0 5px 12px rgba(0,0,0,.5); }
.boost .bc { border-radius: 999px; }
.btn, .btn-ghost, .btn-teal, .prod-buy, .mini-btn { border-radius: 999px; }
.btn::after, .play-btn::after { border-radius: 999px; }
.play-btn { border-radius: 34px !important; }
.hbtn { border-radius: 26px; } .hbtn::after { border-radius: 22px; }
.res { border-radius: 999px; }
.pill, .timer, .diff-chip, .page-tab, .toast, .legend span, .sp-bar, .sp-bar i, .mp-bar, .mp-bar i, .tb-bar, .tb-bar i, .ms-tag, .prod-badge { border-radius: 999px; }
.theme-banner, .album-set, .meta-task, .meta-progress, .soon-card, .set-row, .shop-note, .day, .game-info, .meta-lock { border-radius: var(--r-l); }
.saga-card, .prod, .mi, .card-drop { border-radius: var(--r-m); }
.meta-scene, .ml-art, .mira-bubble { border-radius: var(--r-l); overflow: hidden; }
.mira-bubble { border-radius: 22px; }
.acard { border-radius: 14px; }
.zoom-img { border-radius: 26px; }
.cv-face { border-radius: 7%; }
.board-wrap, .board { border-radius: 26px; }
.tile .face, .tray-tile, .flyer, .tray-ghost { border-radius: 18%; }
.lvl-dot { border-radius: 50%; }
.overlay .sheet .actions .btn { border-radius: 999px; }
.zoom-close, .gear-btn, .icon-btn, .res-plus { border-radius: 50%; }
.demo-tray, .demo-tray i { border-radius: 14px; }
.acard { border-radius: 9.5% / 7.2%; } .cv-face { border-radius: 9.6% / 7.2%; } .card-drop img { border-radius: 10% / 7.5%; }
.cimg { display: block; width: 100%; height: 100%; background-repeat: no-repeat; }
.acard .cimg { position: absolute; inset: 0; }
.acard.locked .cimg { filter: brightness(.8) saturate(.85); }
.card-drop .cimg { width: 54px; height: 72px; flex: none; border-radius: 10% / 7.5%; animation: bob 2.4s ease-in-out infinite; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.cv-face .cimg { position: absolute; inset: 0; }

/* =====================================================================
   ИГРОВЫЕ ЭКРАНЫ — ПРЕМИУМ v2: сцена темы, глянцевые кости с золотым ободком,
   HUD-пилюли, табло-«шкатулка», круглые бусты, ленты в окнах, дорожка на карте
   ===================================================================== */
body.th-light #bg  { background: url(../assets/bg/light.webp) center / cover no-repeat, #1b0c33; }
body.th-ocean #bg  { background: url(../assets/bg/ocean.webp) center / cover no-repeat, #04213a; }
body.th-sweets #bg { background: url(../assets/bg/sweets.webp) center / cover no-repeat, #4a1030; }
body.th-space #bg  { background: url(../assets/bg/space.webp) center / cover no-repeat, #120a35; }
body[class*="th-"] #bg::before { /* мягкая виньетка + затемнение центра под костями */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 55% at 50% 48%, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 55%),
    radial-gradient(130% 95% at 50% 45%, transparent 55%, rgba(5,0,15,.72) 100%),
    linear-gradient(180deg, rgba(0,0,0,.35), transparent 18%, transparent 78%, rgba(0,0,0,.45));
}
body[class*="th-"] #bg::after { opacity: .35; }

/* --- HUD: глянцевые пилюли --- */
.hud { gap: 8px; }
.hud-level { padding: 5px 14px 6px; border-radius: 999px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(120,76,196,.95), rgba(46,22,96,.95));
  box-shadow: 0 0 0 1.5px #ffd56b, 0 0 0 3px rgba(92,54,6,.9), inset 0 2px 0 rgba(255,255,255,.35), inset 0 -6px 10px rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.45); }
.hud-level::before, .hud-pill::before { content: ''; position: absolute; left: 8%; right: 8%; top: 2px; height: 45%; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0)); pointer-events: none; }
.hud-level .chapter-title { font-size: 15px; }
.hud-level small { font-size: 11.5px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.hud-level .diff-chip { font-size: 10px; padding: 1px 7px; }
.hud-pill { position: relative; display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px 4px 6px; min-height: 34px;
  background: linear-gradient(180deg, rgba(78,44,118,.94), rgba(28,14,52,.94));
  box-shadow: 0 0 0 1.5px rgba(255,213,107,.95), inset 0 2px 0 rgba(255,255,255,.22), inset 0 -4px 8px rgba(0,0,0,.3), 0 5px 12px rgba(0,0,0,.45); }
.timer.hud-pill { min-width: 92px; padding: 5px 14px 5px 8px; justify-content: center; }
.timer.hud-pill b { font-size: 21px; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.timer.hud-pill .timer-ico img, .timer.hud-pill img.ei { height: 26px; }
.game-bar .pause-btn, .hud-back { width: 44px; height: 44px; flex: none; }
.hud-row { gap: 6px; margin: 8px 0 2px; justify-content: space-between; }
.hud-lives { padding: 4px 10px; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1; border-radius: 20px; }
.hud-lives .regen { font-size: 10px; margin-top: 1px; }
.hud-coins { padding-left: 4px; }
.hud-coins .hud-ico { width: 26px; height: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.hud-coins b { font-size: 16px; color: var(--gold-1); text-shadow: 0 2px 0 rgba(0,0,0,.45); font-variant-numeric: tabular-nums; }
.hud-left { flex-direction: column; align-items: center; gap: 0; padding: 4px 12px; border-radius: 20px; min-width: 64px; }
.hud-left b { font-size: 17px; }
.hud-left small { font-size: 9.5px; }

/* --- Кости: глянцевый скос, золотой ободок, мягкая тень --- */
.tile .face { border-radius: 20%; }
.tile .face::before { /* золотой ободок поверх картинки */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 0 1.6px rgba(255,226,140,.95), inset 0 0 0 3px rgba(150,96,20,.55), inset 0 3px 3px rgba(255,255,255,.55), inset 0 -4px 6px rgba(0,0,0,.28);
}
.tile .face::after { /* глянцевый блик сверху */
  content: ''; position: absolute; left: 6%; right: 6%; top: 3%; height: 38%; border-radius: 18% 18% 50% 50% / 30% 30% 60% 60%;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0)); pointer-events: none; z-index: 3;
}
.tile .face, .tile.free .face {
  box-shadow: 0 1.5px 0 #ffe7a6, 0 3px 0 #d39a3c, 0 5px 0 #8a5a18, 0 6px 0 #4a2c06, 0 9px 12px rgba(0,0,0,.5), 0 0 0 1px rgba(60,30,0,.6);
}
.tile.blocked .face { filter: brightness(.62) saturate(.75); box-shadow: 0 3px 0 #8f6a35, 0 5px 0 #4a2c06, 0 7px 8px rgba(0,0,0,.45); }
.tile.blocked .face::after { opacity: .35; }
.tile.free .face::after { animation: none; }
.tile.sel .face { box-shadow: 0 3px 0 #d39a3c, 0 5px 0 #8a5a18, 0 0 0 3px rgba(var(--glow), .95), 0 0 24px 8px rgba(var(--glow), .8); }
body.bonus-level .tile .face { box-shadow: 0 1.5px 0 #fff2b8, 0 3px 0 #f0b43a, 0 5px 0 #a36d10, 0 6px 0 #5a3a04, 0 0 14px rgba(255,210,90,.55); }

/* --- Табло: глянцевая «шкатулка» --- */
.tray-wrap { border-radius: 30px; padding: 7px; position: relative;
  background: linear-gradient(180deg, #fff4c4 0%, #f2c45a 22%, #c98a26 60%, #7b4a0c 100%);
  box-shadow: 0 0 0 1.5px #4a2a04, inset 0 2px 0 rgba(255,255,255,.85), inset 0 -3px 0 rgba(0,0,0,.25), 0 10px 22px rgba(0,0,0,.55), 0 0 28px rgba(255,200,90,.3); }
.tray-wrap::before, .tray-wrap::after { /* камни по краям */
  content: ''; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #fff, #b48cff 40%, #5a22b8 80%); box-shadow: 0 0 0 1.5px #5c3606, 0 0 8px rgba(190,140,255,.9); }
.tray-wrap::before { left: -4px; } .tray-wrap::after { right: -4px; }
.tray { border-radius: 24px; padding: 6px; gap: 5px;
  background: linear-gradient(180deg, rgba(40,20,70,.96), rgba(12,6,26,.98));
  box-shadow: inset 0 4px 12px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,220,140,.25); }
.tray .cell { border-radius: 16px;
  background: radial-gradient(120% 100% at 50% 15%, rgba(170,130,255,.16), rgba(0,0,0,.35));
  box-shadow: inset 0 0 0 1.5px rgba(255,214,130,.35), inset 0 3px 7px rgba(0,0,0,.65), 0 1px 0 rgba(255,255,255,.08); }
.tray-tile { border-radius: 20%; box-shadow: 0 0 0 1.5px rgba(255,226,140,.9); }

/* --- Бусты: круглые глянцевые кнопки со счётчиком --- */
.boosts { gap: 4px; margin-top: 10px; }
.boost { background: none !important; box-shadow: none !important; min-height: 0; padding: 0 0 2px; gap: 3px; border-radius: 0; }
.boost .bi { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 38% 28%, #b98cff 0%, #6a32c8 45%, #2c0f66 100%);
  box-shadow: 0 0 0 2px #ffd56b, 0 0 0 3.5px #5c3606, inset 0 3px 0 rgba(255,255,255,.4), inset 0 -6px 10px rgba(0,0,0,.35), 0 6px 12px rgba(0,0,0,.5); }
.boost .bi::before { content: ''; position: absolute; left: 16%; right: 16%; top: 5%; height: 40%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); pointer-events: none; }
.boost .bi img.bico, .boost img.bico { width: 32px; height: 32px; position: relative; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.boost .bn { font-size: 9px; color: #fff1cf; text-shadow: 0 1px 2px rgba(0,0,0,.9); }
.boost .bc { top: -4px; right: calc(50% - 32px); min-width: 22px; height: 22px; border-radius: 999px; font-size: 12px;
  color: #fff; background: radial-gradient(circle at 40% 30%, #8dff9e, #1fae45 60%, #0d6a27); box-shadow: 0 0 0 1.5px #fff, 0 2px 4px rgba(0,0,0,.5); }
.boost.empty .bc { background: radial-gradient(circle at 40% 30%, #fff3b0, #f0b43a 60%, #a86a10); color: #4a2a04; }
.boost:active .bi { transform: scale(.92); }
@media (max-height: 700px) { .boost .bi { width: 46px; height: 46px; } .boost .bi img.bico { width: 28px; height: 28px; } }
@media (max-width: 370px) { .boost .bi { width: 46px; height: 46px; } .boost .bc { right: calc(50% - 29px); } }

/* --- Окна: лента-заголовок, лучи за звёздами --- */
.sheet h2.ribbon { position: relative; display: inline-block; margin: -4px auto 10px; padding: 8px 30px 10px; border-radius: 16px;
  font-size: 23px; color: #fff8dc; text-shadow: 0 2px 0 rgba(90,40,0,.7);
  background: linear-gradient(180deg, #ffe58a, #f2a92e 55%, #b8650d);
  box-shadow: 0 0 0 1.5px #5c3606, inset 0 2px 0 rgba(255,255,255,.7), inset 0 -4px 6px rgba(0,0,0,.2), 0 6px 14px rgba(0,0,0,.45); }
.sheet h2.ribbon::before, .sheet h2.ribbon::after { content: ''; position: absolute; top: 10px; bottom: -6px; width: 22px; z-index: -1;
  background: linear-gradient(180deg, #e08a1c, #8a4a06); box-shadow: 0 0 0 1.5px #5c3606; }
.sheet h2.ribbon::before { left: -14px; border-radius: 6px 0 0 6px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.sheet h2.ribbon::after { right: -14px; border-radius: 0 6px 6px 0; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.sheet h2.ribbon.red { background: linear-gradient(180deg, #ff9b8e, #e0402f 55%, #8e1a10); color: #fff; }
.sheet h2.ribbon.red::before, .sheet h2.ribbon.red::after { background: linear-gradient(180deg, #c22a1c, #6a0f08); }
.sheet-win, .sheet-lose, .sheet-pause, .sheet-newtile { overflow: visible; text-align: center; }
.win-rays { position: absolute; left: 50%; top: 8%; width: 420px; height: 420px; margin-left: -210px; pointer-events: none; z-index: 0; opacity: .7; background: radial-gradient(closest-side, rgba(255,230,150,.55) 0%, rgba(255,200,90,.22) 35%, transparent 70%); border-radius: 50%; filter: blur(1px); }
@keyframes spinRays { to { transform: rotate(360deg) } }
.sheet-win > *:not(.win-rays) { position: relative; z-index: 1; }
.sheet-win .stars-big { margin: 2px 0 4px; }
.sheet-win .stars-big img.ei { height: 60px; filter: drop-shadow(0 0 10px rgba(255,210,90,.8)) drop-shadow(0 4px 4px rgba(0,0,0,.45)); }
.sheet-win .stars-big span:nth-child(2) img.ei { height: 74px; transform: translateY(-10px); }
.sheet .stat { border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.3)); box-shadow: inset 0 0 0 1.5px rgba(255,210,120,.45), inset 0 2px 0 rgba(255,255,255,.12); }
.lose-ico { position: relative; display: inline-block; }
.lose-ico > img.ei:first-child { height: 96px; animation: heartBeat 1.4s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(255,80,90,.7)) drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.lose-ico .lose-sub { position: absolute; right: -14px; bottom: -4px; }
.lose-ico .lose-sub img.ei { height: 44px; }
@keyframes heartBeat { 50% { transform: scale(1.07) } }
.sheet-pause .settings-row, .sheet-pause .set-row { border-radius: 20px; }

/* --- Окно «Открыт новый рисунок!» --- */
.nt-stage { position: relative; width: 210px; height: 210px; margin: -6px auto 4px; display: grid; place-items: center; }
.nt-rays { position: absolute; inset: -40px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,226,140,.5) 0 8deg, rgba(255,226,140,0) 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: spinRays 14s linear infinite; }
.nt-glow { position: absolute; inset: 20px; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,180,.95), rgba(255,190,80,.45) 45%, transparent 70%); animation: ntGlow 1.8s ease-in-out infinite; }
@keyframes ntGlow { 50% { transform: scale(1.12); opacity: .8 } }
.nt-tile { position: relative; width: 150px; height: 150px; border-radius: 22%; overflow: hidden; animation: ntPop .7s cubic-bezier(.2,1.6,.4,1) both;
  box-shadow: 0 0 0 3px #ffe08a, 0 0 0 6px #8a5510, 0 4px 0 6px #5c3606, 0 0 40px 10px rgba(255,210,90,.7), 0 18px 24px rgba(0,0,0,.5); }
.nt-tile img { width: 100%; height: 100%; display: block; }
.nt-tile::after { content: ''; position: absolute; left: 6%; right: 6%; top: 3%; height: 40%; border-radius: 30% 30% 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.5), transparent); }
@keyframes ntPop { 0% { transform: scale(.2) rotate(-18deg); opacity: 0 } 100% { transform: none; opacity: 1 } }
.nt-sp { position: absolute; width: 18px; height: 18px; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, rgba(255,230,150,.9) 30%, transparent 60%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: ntTw 1.6s ease-in-out infinite; }
.nt-sp.s1 { left: 8px; top: 30px; } .nt-sp.s2 { right: 4px; top: 16px; animation-delay: .3s; width: 24px; height: 24px; }
.nt-sp.s3 { right: 14px; bottom: 20px; animation-delay: .6s; } .nt-sp.s4 { left: 18px; bottom: 8px; animation-delay: .9s; width: 22px; height: 22px; }
.nt-sp.s5 { left: 50%; top: -6px; animation-delay: 1.2s; }
@keyframes ntTw { 0%, 100% { transform: scale(.4) rotate(0); opacity: .3 } 50% { transform: scale(1.2) rotate(45deg); opacity: 1 } }
.sheet h2.nt-title { font-family: 'Comfortaa', system-ui, sans-serif; font-size: 22px; margin: 4px 0 2px;
  background: linear-gradient(180deg, #fff6c8, #ffd45e 50%, #f09a1e); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(70,30,0,.8)) drop-shadow(0 0 12px rgba(255,190,80,.5)); }
.nt-name { display: inline-block; margin: 6px 0 2px !important; padding: 4px 16px; border-radius: 999px; font-size: 17px; font-weight: 900 !important; color: #fff !important;
  background: linear-gradient(180deg, rgba(150,100,230,.9), rgba(70,30,140,.9)); box-shadow: 0 0 0 1.5px #ffd56b; }
.nt-text { font-size: 14px; opacity: .9; }
.nt-more { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.nt-more span { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,210,120,.4); font-weight: 800; font-size: 13px; }
.nt-more img { width: 30px; height: 30px; border-radius: 22%; }

/* --- Карта уровней: дорожка между глянцевыми узлами --- */
.level-list.level-list { container-type: inline-size; gap: 16px 8px; }
.lvl-dot { z-index: 1; }
.lvl-link { position: relative; justify-self: center; align-self: center; width: 0; height: 0; z-index: 0; pointer-events: none; }
.lvl-link::after { content: ''; position: absolute; border-radius: 999px; box-shadow: 0 0 6px rgba(255,210,90,.55);
  background: repeating-linear-gradient(90deg, #ffe08a 0 8px, #c98a26 8px 11px, rgba(0,0,0,0) 11px 15px); }
.lvl-link.to-r::after, .lvl-link.to-l::after { top: -3px; height: 6px; width: calc((100cqw - 12px - 32px) / 5 + 8px); }
.lvl-link.to-r::after { left: 0; } .lvl-link.to-l::after { right: 0; }
.lvl-link.to-d::after { left: -3px; width: 6px; top: 0; height: 82px;
  background: repeating-linear-gradient(180deg, #ffe08a 0 8px, #c98a26 8px 11px, rgba(0,0,0,0) 11px 15px); }
.lvl-link.locked::after { filter: grayscale(1) brightness(.55); opacity: .6; box-shadow: none; }
.lvl-dot { box-shadow: 0 0 0 2.5px #ffe08a, 0 0 0 4.5px #6b420e, inset 0 4px 0 rgba(255,255,255,.5), inset 0 -8px 12px rgba(0,0,0,.35), 0 8px 14px rgba(0,0,0,.55); }
.lvl-dot .num { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 800; font-size: 18px; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.lvl-dot.current { box-shadow: 0 0 0 3px #fff4c0, 0 0 0 5.5px #e0a432, 0 0 26px 8px rgba(255,220,110,.85), 0 8px 14px rgba(0,0,0,.55); }
.level-list.level-list { padding: 12px 12px 18px; gap: 20px 6px; }
.lvl-dot { width: 54px; height: 54px; } .lvl-dot.purple { width: 58px; height: 58px; }
.lvl-dot .num { font-size: 16px; }
.lvl-link.to-r::after, .lvl-link.to-l::after { top: -4px; height: 8px; width: calc((100cqw - 24px - 24px) / 5 + 6px); }
.lvl-link.to-d::after { left: -4px; width: 8px; height: 80px; }
.hud-level .diff-chip { font-size: 0; padding: 2px 4px; gap: 0; line-height: 0; }
.hud-level .diff-chip img.ei { height: 14px; margin: 0; }
.hud-level .chapter-title { font-size: 14px; }
/* HUD: заголовок уровня не обрезается на узких экранах (шрифт подгоняется в fitHudTitle) */
.hud-level { flex: 1 1 auto; min-width: 0; padding: 5px 10px 6px; }
.hud-level .chapter-title { text-overflow: clip; overflow: hidden; white-space: nowrap; }
@media (max-width: 380px) { .hud { gap: 5px; } .timer.hud-pill { min-width: 78px; padding: 5px 10px 5px 6px; } .timer.hud-pill b { font-size: 19px; } .game-bar .pause-btn, .hud-back { width: 40px; height: 40px; } }
/* Карта уровней на 360 px: 5 колонок всегда влезают по ширине */
.level-list.level-list { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow-x: hidden; }
@media (max-width: 380px) { .level-list.level-list { padding: 12px 8px 18px; gap: 20px 4px; } .lvl-dot { width: 50px; height: 50px; } .lvl-dot.purple, .lvl-dot.bonus { width: 54px; height: 54px; } .lvl-dot .num { font-size: 15px; } }




@font-face { font-family: 'Comfortaa'; font-weight: 600; font-display: swap; src: url(../assets/fonts/comfortaa-600.woff2) format('woff2'); }
@font-face { font-family: 'Comfortaa'; font-weight: 700; font-display: swap; src: url(../assets/fonts/comfortaa-700.woff2) format('woff2'); }
@font-face { font-family: 'Comfortaa'; font-weight: 800; font-display: swap; src: url(../assets/fonts/comfortaa-700.woff2) format('woff2'); }
@font-face { font-family: 'Comfortaa'; font-weight: 900; font-display: swap; src: url(../assets/fonts/comfortaa-700.woff2) format('woff2'); }

/* ================= ПРЕМИУМ v3: растровые 3D-рамки, глянцевые кнопки, округлый шрифт ================= */
:root {
  --font-display: 'Comfortaa', system-ui, sans-serif;
  --f-panel: url(../assets/ui/frames/panel.webp);
  --f-card: url(../assets/ui/frames/card.webp);
  --b-gold: url(../assets/ui/frames/gold.webp);
  --b-purple: url(../assets/ui/frames/purple.webp);
  --b-green: url(../assets/ui/frames/green.webp);
  --b-red: url(../assets/ui/frames/red.webp);
  --b-dark: url(../assets/ui/frames/dark.webp);
  --b-round: url(../assets/ui/frames/round.webp);
  --title-grad: linear-gradient(180deg, #ffffff 0%, #fff4c4 22%, #ffd45a 48%, #f0a32c 70%, #ffe7a0 86%, #c07a1c 100%);
}

/* Шрифт везде — Comfortaa Bold (OFL), кириллица + латиница */
.logo, .chapter-title, .sheet h2, .sheet h2.ru, .meta-h, .soon-card h3, .shop-h, .pl-main, .nt-title,
.btn, .hbtn, .page-tab, .lvl-dot .num, .lvl .num, .res-v b, .timer b, .hud-pill b, .hud-level, .set-row b,
.prod b, .prod-name, .prod .pn, .stat b, .album-set h3, .album-set h4, .as-head, .sc-name, .bar-title, .pill b,
.boost small, .boosts small, .cv-name, .ac-name, .ms-tag, .tut-bubble p, .toast, .legend, .saga-label, .day b {
  font-family: 'Comfortaa', system-ui, sans-serif !important; letter-spacing: 0; }
.logo { font-weight: 900; letter-spacing: .06em; }

/* Заголовки: глянцевая градиентная заливка, мягкий контур и тень */
.logo, .chapter-title, .sheet h2, .sheet h2.ru, .meta-h, .soon-card h3, .shop-h, .nt-title {
  font-weight: 900; background: var(--title-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .6px rgba(90, 44, 0, .55);
  filter: drop-shadow(0 1.5px 0 #7a4208) drop-shadow(0 3px 2px rgba(0,0,0,.55)) drop-shadow(0 0 10px rgba(255,196,90,.35)); }
.logo { -webkit-text-stroke: 1px rgba(90, 44, 0, .6); filter: drop-shadow(0 3px 0 #7a4208) drop-shadow(0 6px 6px rgba(0,0,0,.55)) drop-shadow(0 0 22px rgba(255,190,80,.55)); }
.sheet h2.ribbon { -webkit-text-stroke: 0; }
.pl-main { font-weight: 900; -webkit-text-stroke: .8px rgba(10, 70, 10, .55); }

/* Окна и большие панели: узорная золотая 3D-рамка (9-slice, края прозрачные) */
.sheet, .album-set, .meta-scene {
  border: 0 solid transparent; border-image: var(--f-panel) 100 / 44px / 11px stretch;
  border-radius: 22px; }
.sheet { box-shadow: 0 22px 50px rgba(0,0,0,.7), 0 0 60px rgba(255,190,80,.22), inset 0 0 40px rgba(255,180,255,.1); }
.album-set { box-shadow: 0 10px 24px rgba(0,0,0,.45); margin: 12px 8px 22px; }
.album-set.complete { box-shadow: 0 0 22px rgba(255,200,80,.6), 0 10px 24px rgba(0,0,0,.45); }
.meta-scene { box-shadow: 0 10px 24px rgba(0,0,0,.5); margin-left: 8px; margin-right: 8px; width: auto; }
.sheet::before, .sheet::after { top: -17px; } .sheet::after { top: auto; bottom: -17px; }

/* Карточки, строки, пузыри: гладкая глянцевая золотая рамка */
.prod, .saga-card, .stat, .sheet .stat, .set-row, .card-drop, .shop-note, .mira-bubble, .tut-bubble, .meta-task, .theme-banner, .soon-card, .meta-progress, .day {
  border: 0 solid transparent !important; border-image: var(--f-card) 64 / 22px / 6px stretch !important;
  border-radius: 15px !important; }
.prod, .saga-card, .card-drop, .theme-banner, .meta-task, .tut-bubble, .mira-bubble, .shop-note {
  box-shadow: inset 0 2px 0 rgba(255,255,255,.14), inset 0 -10px 18px rgba(0,0,0,.25), 0 10px 18px rgba(0,0,0,.45) !important; }
.stat, .sheet .stat, .set-row, .day, .meta-progress { box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -8px 14px rgba(0,0,0,.25) !important; }
.prod-grid, .shop-grid { gap: 14px 12px; padding: 6px; }
.saga-path { gap: 10px; padding: 0 6px; }

/* Глянцевые растровые 3D-кнопки (капсулы) */
.btn, .btn-ghost, .btn-teal, .prod-buy, .mini-btn, .play-btn, .hbtn, .page-tab, .pill, .hud-pill, .hud-level, .res, .timer {
  border: 0 solid transparent !important; background: none !important;
  border-image-slice: 58 62 58 62 fill !important; border-image-width: 50% var(--cap, 24px) !important; border-image-outset: 0 !important; border-image-repeat: stretch !important; }
.btn, .prod-buy, .mini-btn { border-image-source: var(--b-gold) !important; --cap: 26px; color: #4a2604;
  box-shadow: 0 6px 10px rgba(0,0,0,.4) !important; text-shadow: 0 1px 0 rgba(255,250,220,.75); }
.btn-ghost { border-image-source: var(--b-purple) !important; color: #fff6d8; text-shadow: 0 1px 0 rgba(40,0,80,.8), 0 0 6px rgba(0,0,0,.35); }
.btn-teal { border-image-source: var(--b-green) !important; color: #fff; text-shadow: 0 1px 2px rgba(0,60,0,.8); }
.play-btn { border-image-source: var(--b-green) !important; --cap: 40px; box-shadow: 0 10px 20px rgba(0,0,0,.45), 0 0 34px rgba(140,255,120,.25) !important; }
.hbtn { border-image-source: var(--b-purple) !important; --cap: 30px; box-shadow: 0 8px 14px rgba(0,0,0,.45) !important; }
.hbtn.shop-btn { border-image-source: var(--b-red) !important; }
.hbtn#btn-rules { border-image-source: var(--b-gold) !important; color: #4a2604; text-shadow: 0 1px 0 rgba(255,250,220,.75); }
.page-tab { border-image-source: var(--b-dark) !important; --cap: 16px; box-shadow: 0 4px 8px rgba(0,0,0,.4) !important; }
.page-tab.active { border-image-source: var(--b-gold) !important; color: #4a2604 !important; }
.pill, .hud-pill, .hud-level, .res, .timer { border-image-source: var(--b-dark) !important; --cap: 20px; box-shadow: 0 5px 10px rgba(0,0,0,.45) !important; }
.timer.frozen { border-image-source: var(--b-purple) !important; filter: hue-rotate(-70deg) saturate(1.2); }
.timer.notimer { border-image-source: var(--b-green) !important; }
.btn::after, .btn-ghost::after, .btn-teal::after, .play-btn::after, .hbtn::after, .page-tab::after { display: none !important; }
.btn:active, .hbtn:active, .play-btn:active, .page-tab:active { filter: brightness(.92); }

/* Круглые кнопки: растровые 3D-кнопки с золотым кольцом */
.icon-btn, .gear-btn { background: var(--b-round) center / 100% 100% no-repeat !important; box-shadow: 0 5px 10px rgba(0,0,0,.45) !important; border: 0 !important; }
.icon-btn { color: #fff2c2; text-shadow: 0 2px 2px rgba(40,0,80,.9); }

/* Прокручиваемые области: мягкое затухание вместо резкого прямоугольного среза */
.level-list, .album-body, .meta-body, .shop-body {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 20px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 20px), transparent 100%); }
.album-body, .meta-body, .shop-body { padding-left: 12px; padding-right: 12px; }
.hbtn.meta-btn { border-image-source: var(--b-gold) !important; color: #4a2604 !important; text-shadow: 0 1px 0 rgba(255,250,220,.75) !important; }
.overlay .sheet { width: min(336px, calc(100% - 36px)); }
.album-set .btn { font-size: 13px; padding: 0 14px; white-space: nowrap; min-height: 42px; --cap: 21px; }
@media (max-width: 380px) { .lang-row .page-tab { padding: 6px 9px; font-size: 12px; } .lang-row { gap: 6px; } }

/* ================= v3.1: ресурсы-кнопки, комната целиком, предметы по порядку, реклама, альбом-витрина, сочные кнопки ================= */
/* (A/B) Пилюли ресурсов: значение никогда не перекрывается «+», вся пилюля — кнопка с откликом */
.res-bar { gap: 5px; }
.res.res-btn { cursor: pointer; font: inherit; color: inherit; text-align: left; min-width: 0; padding: 0 6px 0 2px !important; height: 40px; display: flex; align-items: center; gap: 3px;
  transition: transform .1s ease, filter .1s ease; -webkit-tap-highlight-color: transparent; }
.res.res-btn:active { transform: translateY(2px) scale(.97); filter: brightness(1.15); }
.res-btn .res-v { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.res-btn .res-v b { font-family: 'Comfortaa', system-ui, sans-serif !important; font-weight: 900; font-size: 16px; white-space: nowrap; }
.res-btn .res-plus { position: static; flex: none; margin: 0 0 0 2px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font: 900 18px/1 'Comfortaa', system-ui, sans-serif; color: #fff; padding-bottom: 2px;
  background: radial-gradient(circle at 35% 28%, #e9ffd8 0 12%, #6fe35c 30%, #22a02e 65%, #0f5a17); box-shadow: 0 0 0 1.5px #ffe7a0, 0 0 0 3px #6b420e, inset 0 -2px 2px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.5); }
.res-lives { flex: 1.35 1 0; } .res-coins { flex: 1.05 1 0; } .res-sparks { flex: .8 1 0; }
.res-btn .res-ico { width: 36px; height: 36px; margin: -6px -2px -6px -6px; }
.res-v small.regen { max-width: none; font-size: 9px; }
@media (max-width: 380px) { .res-btn .res-v b { font-size: 14.5px; } .res-btn .res-ico { width: 32px; height: 32px; } .res-btn .res-plus { width: 20px; height: 20px; font-size: 16px; } .res-v small.regen { font-size: 8.5px; } }
.shop-h.flash { animation: shopFlash 1.1s ease 1; }
@keyframes shopFlash { 0%, 100% { transform: none; } 30% { transform: scale(1.12); filter: drop-shadow(0 0 12px rgba(255,220,120,.9)); } }

/* (C) Комната видна целиком: размер по высоте экрана без обрезки; реплика и задание — под картинкой */
.meta-scene { width: min(calc(100% - 16px), calc(54vh * 0.75)) !important; max-height: none !important; aspect-ratio: 3 / 4; margin: 10px auto 6px !important; }
.meta-scene.zoomed { width: min(92vw, calc(80vh * .75), 440px) !important; }
.meta-scene .mira-bubble { display: none; }
#meta-body > .mira-bubble { position: static; margin: 10px 8px 4px; padding: 6px 12px; min-height: 0; font-size: 14px; }
#meta-body > .mira-bubble.pop { animation: miraPop .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes miraPop { from { transform: translateY(-8px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.meta-task .mt-art { flex: none; width: 64px; height: 64px; border-radius: 14px; background-color: #2a1748; background-repeat: no-repeat;
  box-shadow: 0 0 0 2px #ffe08a, 0 0 0 4px #6b420e, inset 0 2px 0 rgba(255,255,255,.3), 0 6px 10px rgba(0,0,0,.5); }

/* (D) Ряд предметов: только следующий доступен, остальные под замком; открытие с эффектом */
.meta-items { grid-template-columns: repeat(5, 1fr) !important; gap: 10px 8px !important; margin: 12px 8px !important; }
.mi { position: relative; padding: 4px 4px 3px !important; }
.mi .mi-art { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; background-repeat: no-repeat; box-shadow: inset 0 0 0 1px rgba(255,230,160,.4); }
.mi small { font-size: 11px !important; margin-top: 2px; }
.mi.locked .mi-art { filter: grayscale(1) brightness(.45) blur(.6px); }
.mi.locked { opacity: .9; }
.mi .mi-lock { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: 26px; height: 26px; display: grid; place-items: center; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.mi .mi-lock img.ei { height: 24px; }
.mi.next { box-shadow: 0 0 0 2px #fff1b8, 0 0 16px 3px rgba(255,210,90,.85) !important; animation: miNext 1.6s ease-in-out infinite; }
@keyframes miNext { 50% { transform: translateY(-2px) scale(1.04); } }
.mi.unlocking { animation: miUnlock .9s cubic-bezier(.2,1.5,.4,1) both, miNext 1.6s ease-in-out .9s infinite; }
.mi.unlocking::after { content: ''; position: absolute; inset: -10px; border-radius: 16px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,240,170,.95), rgba(255,200,80,.4) 40%, transparent 70%); animation: miGlow .9s ease-out both; }
@keyframes miUnlock { 0% { transform: scale(.6) rotate(-8deg); filter: brightness(2); } 60% { transform: scale(1.15) rotate(3deg); } 100% { transform: none; filter: none; } }
@keyframes miGlow { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.4); } }

/* (E) Кнопки «Смотреть рекламу» — показываются только в сборке Google Play */
.ad-btn { --cap: 24px; min-height: 46px; font-size: 15px; }
.home .ad-btn, #btn-ad-boost { display: flex; margin: 10px auto 0; width: 88%; }
#btn-ad-boost.hidden { display: none; }

/* (F) Альбом — витрина коллекционера: глянцевый бархат, золото, слоты-гнёзда */
.album-set { background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,214,120,.28), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.25)),
    url(../assets/ui/frames/velvet.webp) center / cover !important;
  padding: 14px 12px !important; }
body.th-ocean .album-set { background: radial-gradient(120% 60% at 50% 0%, rgba(120,240,255,.28), transparent 60%), linear-gradient(180deg, rgba(0,140,180,.28), rgba(0,20,60,.35)), url(../assets/ui/frames/velvet.webp) center / cover !important; }
body.th-sweets .album-set { background: radial-gradient(120% 60% at 50% 0%, rgba(255,170,220,.32), transparent 60%), linear-gradient(180deg, rgba(255,80,160,.22), rgba(60,0,40,.3)), url(../assets/ui/frames/velvet.webp) center / cover !important; }
body.th-space .album-set { background: radial-gradient(120% 60% at 50% 0%, rgba(170,140,255,.3), transparent 60%), linear-gradient(180deg, rgba(60,40,200,.22), rgba(0,0,40,.35)), url(../assets/ui/frames/velvet.webp) center / cover !important; }
.album-set h3, .album-set .as-head b { text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.as-cards { gap: 12px 10px !important; padding: 6px 2px; }
.acard { box-shadow: 0 0 0 2px #ffe08a, 0 0 0 3.5px #7a4a0c, 0 8px 14px rgba(0,0,0,.6), 0 0 18px rgba(255,200,90,.25) !important; transform: translateZ(0); }
.acard::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,.06) 28%, transparent 45%), linear-gradient(0deg, rgba(0,0,0,.25), transparent 30%); }
.acard.locked { box-shadow: inset 0 6px 12px rgba(0,0,0,.75), inset 0 -2px 0 rgba(255,230,160,.35), 0 0 0 2px rgba(255,214,120,.55), 0 0 0 3.5px #3a2208, 0 2px 0 rgba(255,255,255,.12) !important; }
.acard.locked .cimg { filter: brightness(.62) saturate(.7) !important; }
.acard.locked::before { background: radial-gradient(80% 50% at 50% 0%, rgba(255,255,255,.18), transparent 70%), linear-gradient(0deg, rgba(0,0,0,.35), transparent 40%); }

/* (G) Главное меню: конфетные 3D-кнопки, крупные иконки «выпрыгивают» из кнопки */
.home-actions { margin-top: 22px !important; row-gap: 14px !important; }
.hbtn { overflow: visible !important; min-height: 66px !important; padding-top: 26px !important; filter: saturate(1.25) contrast(1.05); }
.hbtn img { position: absolute; top: -24px; left: 50%; width: 58px !important; height: 58px !important; transform: translateX(-50%);
  filter: drop-shadow(0 4px 0 rgba(60,20,0,.35)) drop-shadow(0 8px 8px rgba(0,0,0,.55)) saturate(1.2) !important; transition: transform .15s ease; }
.hbtn:active img { transform: translateX(-50%) translateY(2px) scale(.94); }
.hbtn::before { content: ''; position: absolute; left: 12%; right: 12%; top: 10%; height: 30%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0)); mix-blend-mode: screen; }
.hbtn span, .hbtn { font-size: 14px !important; text-shadow: 0 2px 0 rgba(40,0,80,.75), 0 0 8px rgba(0,0,0,.35); }
.hbtn.meta-btn, .hbtn#btn-rules { text-shadow: 0 1px 0 rgba(255,250,220,.85) !important; }
.hbtn.shop-btn, #btn-rules { padding-top: 0 !important; padding-left: 52px !important; min-height: 54px !important; }
.hbtn.shop-btn img, #btn-rules img { top: 50%; left: 8px; width: 52px !important; height: 52px !important; transform: translateY(-58%) rotate(-8deg); }
.hbtn.shop-btn:active img, #btn-rules:active img { transform: translateY(-54%) rotate(-8deg) scale(.94); }
.hbtn .meta-dot { top: -6px !important; right: 6px !important; z-index: 3; }
.res-lives { flex: 1.1 1 0; } .res-coins { flex: 1.2 1 0; } .res-sparks { flex: .9 1 0; }
@media (max-width: 400px) { .res-bar { gap: 4px; } .gear-btn { width: 38px !important; height: 38px !important; } .gear-btn img { width: 28px; height: 28px; }
  .res.res-btn { padding: 0 4px 0 2px !important; } .res-btn .res-ico { width: 32px; height: 32px; margin-right: -3px; } }
.meta-task { flex-wrap: wrap; row-gap: 10px; }
.meta-task .mt-text { flex: 1 1 0; min-width: 0; }
.meta-task .btn { flex: 1 0 100%; }
.album-set .btn { font-size: 12px !important; padding: 0 18px !important; }

/* v3.2: экран «Дом» на 360/393/412 — комната, реплика, прогресс, задание и ряд предметов на первом экране */
.meta-scene { width: min(calc(100% - 16px), calc((var(--app-h) - 380px) * 0.75)) !important; min-width: 200px; }
#meta-body { padding-bottom: 20px; }
#meta-body > .mira-bubble { margin: 8px 8px 4px; padding: 5px 12px; font-size: 13px; line-height: 1.25; }
#meta-body > .mira-bubble .mira-face img.ei { height: 24px; }
.meta-progress { margin: 6px 8px !important; }
.meta-task { display: grid !important; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 8px; align-items: center; padding: 10px 12px !important; margin: 6px 8px !important; }
.meta-task .mt-art { width: 52px; height: 52px; grid-row: 1; }
.meta-task .mt-text { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meta-task .mt-text b { font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.meta-task .mt-text small { font-size: 12px; line-height: 1.25; opacity: .9; }
.meta-task .btn { grid-column: 1 / -1; width: 100%; min-height: 42px; font-size: 15px; --cap: 21px; }
.meta-task.done { grid-template-columns: 52px 1fr !important; }
.meta-task.done .mt-trophy { grid-column: 1; grid-row: 1; }
.meta-task.done .mt-text { grid-column: 2 !important; grid-row: 1; }
.meta-task.done .btn,
.meta-task.done .as-done { grid-column: 1 / -1 !important; grid-row: 2 !important; width: 100%; }
/* ряд предметов — одна прокручиваемая полоса */
.meta-items { display: flex !important; gap: 8px !important; overflow-x: auto; overflow-y: visible; padding: 8px 10px 10px !important; margin: 4px 0 6px !important; scroll-snap-type: x proximity; scrollbar-width: none; }
.meta-items::-webkit-scrollbar { display: none; }
.meta-items .mi { flex: 0 0 58px; scroll-snap-align: center; }

/* ================= v3.3: главный экран — 3D-логотип, праздничная сцена, саги, баннер темы ================= */
/* Логотип: растровое объёмное золото + блик-«пробег» по маске букв */
.logo.logo-img { position: relative; display: block; width: min(78vw, 300px); margin: 2px auto 0; aspect-ratio: 720 / 309; line-height: 0; font-size: 0;
  background: none !important; -webkit-text-stroke: 0; filter: drop-shadow(0 6px 8px rgba(0,0,0,.55)) drop-shadow(0 0 18px rgba(255,190,80,.45)) !important; }
.logo.logo-img img { width: 100%; height: 100%; display: block; }
.logo-shine { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url(../assets/ui/frames/logo.webp) center / 100% 100% no-repeat; mask: url(../assets/ui/frames/logo.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.95) 48%, rgba(255,250,220,.6) 52%, transparent 62%) no-repeat; background-size: 250% 100%;
  mix-blend-mode: screen; animation: logoShine 3.6s ease-in-out infinite; }
@keyframes logoShine { 0% { background-position: 140% 0; } 55%, 100% { background-position: -40% 0; } }
.sp-logo.logo-img { width: min(80vw, 330px); }
@media (prefers-reduced-motion: reduce) { .logo-shine { animation: none; opacity: 0; } }

/* Фон главного: праздничная 3D-сцена с мягкой виньеткой */
body:not([class*="th-"]) #bg { background: url(../assets/bg/home.webp) center top / cover no-repeat, #1a0b36; }
body:not([class*="th-"]) #bg::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 48%, rgba(10,4,26,.42) 0%, rgba(10,4,26,.15) 45%, rgba(8,3,20,.55) 100%),
              linear-gradient(180deg, rgba(8,3,20,.35) 0%, transparent 18%, transparent 62%, rgba(8,3,20,.7) 100%); }
body:not([class*="th-"]) #bg::after { opacity: .5; }
.splash { background: linear-gradient(180deg, rgba(10,4,26,.25), rgba(10,4,26,.75)), url(../assets/bg/home.webp) center / cover no-repeat, #1a0b36 !important; }

/* Путь саги: зазоры между карточками и двойная глянцевая золотая рамка */
.saga-path { gap: 13px !important; padding: 0 9px !important; }
.saga-path::before { display: none; }
.saga-card { border-image: none !important; border-radius: 14px !important; overflow: visible; margin: 7px 0;
  box-shadow:
    0 0 0 1px #5c3606,                   /* тёмный кант */
    0 0 0 2.5px #ffe9a8,                 /* внутренний глянцевый обод */
    0 0 0 3.5px #7a4a0c,                 /* зазор между ободами */
    0 0 0 5.5px #f3c24f,                 /* внешний обод */
    0 0 0 6.5px #4a2a06,
    inset 0 2px 0 rgba(255,255,255,.55), inset 0 -8px 12px rgba(0,0,0,.28), 0 9px 14px rgba(0,0,0,.55) !important; }
.saga-card::before { content: ''; position: absolute; inset: -5.5px; border-radius: 19px; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0) 18%, rgba(255,255,255,0) 82%, rgba(255,240,190,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; }
.saga-card.current { box-shadow: 0 0 0 1px #5c3606, 0 0 0 2.5px #fff6cc, 0 0 0 3.5px #b8761e, 0 0 0 5.5px #ffd56b, 0 0 0 6.5px #4a2a06, 0 0 20px 6px rgba(255,214,110,.6), inset 0 2px 0 rgba(255,255,255,.55), 0 9px 14px rgba(0,0,0,.55) !important; }
.saga-card.locked { filter: saturate(.55) brightness(.82); }
.saga-card.done::after { z-index: 3; top: -10px; right: -8px; }
.saga-card .sc-name { font-size: 11px; line-height: 1.1; }

/* Баннер текущей темы: объёмная сцена темы, глянец, бегущий блик, глянцевый заголовок и прогресс */
.theme-banner { border-image: none !important; border-radius: 22px !important; overflow: hidden; isolation: isolate; min-height: 88px;
  box-shadow: 0 0 0 1.5px #5c3606, 0 0 0 3.5px #ffe08a, 0 0 0 5px #8a5510, 0 0 0 7px #f3c24f, 0 0 0 8.5px #5c3606, 0 12px 22px rgba(0,0,0,.55), 0 0 26px rgba(255,200,90,.3) !important;
  margin: 10px 8px 6px; }
.theme-banner.light  { background: linear-gradient(90deg, rgba(120,50,0,.55), rgba(255,170,60,.15) 60%, rgba(120,40,0,.3)), url(../assets/bg/light.webp) center 30% / cover !important; }
.theme-banner.ocean  { background: linear-gradient(90deg, rgba(0,50,80,.6), rgba(40,200,230,.12) 60%, rgba(0,40,70,.35)), url(../assets/bg/ocean.webp) center 40% / cover !important; }
.theme-banner.sweets { background: linear-gradient(90deg, rgba(110,0,60,.55), rgba(255,120,200,.15) 60%, rgba(100,0,50,.3)), url(../assets/bg/sweets.webp) center 40% / cover !important; }
.theme-banner.space  { background: linear-gradient(90deg, rgba(30,0,90,.6), rgba(150,110,255,.15) 60%, rgba(20,0,70,.35)), url(../assets/bg/space.webp) center 40% / cover !important; }
.theme-banner::before { content: ''; position: absolute; inset: 0; left: 0; right: 0; top: 0; height: 48%; border-radius: 22px 22px 60% 60% / 22px 22px 30px 30px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,.08)) !important; }
.theme-banner::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg); animation: bannerSweep 4.5s ease-in-out infinite; }
@keyframes bannerSweep { 0% { left: -60%; } 45%, 100% { left: 130%; } }
.theme-banner > * { position: relative; z-index: 2; }
.tb-covers img { width: 50px !important; height: 50px !important; border-radius: 12px; box-shadow: 0 0 0 2px #ffe08a, 0 0 0 3.5px #6b420e, 0 6px 10px rgba(0,0,0,.5); }
.tb-text .chapter-title { font-size: 26px !important; background: linear-gradient(180deg, #ffffff 0%, #fffbe6 35%, #ffe07a 60%, #ffb02e 85%, #fff1b8 100%) !important;
  -webkit-background-clip: text !important; background-clip: text !important; color: transparent !important; -webkit-text-stroke: .8px rgba(80,30,0,.6);
  filter: drop-shadow(0 2px 0 #7a4208) drop-shadow(0 4px 4px rgba(0,0,0,.6)) !important; }
.tb-text small { font-size: 13px !important; text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 0 6px rgba(0,0,0,.5) !important; }
.tb-bar { height: 14px !important; border-radius: 999px; padding: 2px; background: linear-gradient(180deg, #3a1d05, #6b3c0c) !important;
  box-shadow: 0 0 0 1.5px #ffe08a, inset 0 2px 3px rgba(0,0,0,.7), 0 2px 4px rgba(0,0,0,.45) !important; overflow: hidden; }
.tb-bar i { position: relative; height: 100%; min-width: 10px !important; border-radius: 999px !important; overflow: hidden;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe27a 35%, #f5a623 70%, #ffcf5a 100%) !important; box-shadow: 0 0 10px rgba(255,220,110,.9) !important; }
.tb-bar i::after { content: ''; position: absolute; left: 4px; right: 4px; top: 1px; height: 40%; border-radius: 999px; background: rgba(255,255,255,.75); }
.logo.logo-img:not(.sp-logo) { width: min(70vw, 280px, 25vh); margin: 0 auto -2px; }
.play-btn { flex-shrink: 0; }
.theme-banner { flex-shrink: 0; }
.res-lives { flex: 1.3 1 0 !important; } .res-coins { flex: 1.1 1 0 !important; } .res-sparks { flex: .8 1 0 !important; }
.res-v small.regen { overflow: visible; text-overflow: clip; letter-spacing: -.02em; }
/* невысокие экраны (Android + шапка Telegram): главное помещается целиком, иначе — прокрутка */
#screen-home { overflow-y: auto; overflow-x: hidden; }
@media (max-height: 700px) {
  .logo.logo-img:not(.sp-logo) { width: min(60vw, 220px, 24vh); }
  .home-sub, #screen-home .subtitle { margin: 0 0 2px; font-size: 13px; }
  .theme-banner { min-height: 72px; padding: 7px 10px !important; margin: 8px 8px 4px; }
  .tb-covers img { width: 42px !important; height: 42px !important; }
  .tb-text .chapter-title { font-size: 22px !important; }
  .play-btn { min-height: 64px !important; }
  .saga-path { margin-top: 14px !important; }
  .saga-card { padding: 4px 2px 5px !important; }
  .saga-card .sc-art img, .saga-card img { max-height: 26px; }
  .home-actions { margin-top: 18px !important; row-gap: 12px !important; }
  .hbtn { min-height: 56px !important; padding-top: 22px !important; }
  .hbtn img { width: 50px !important; height: 50px !important; top: -20px; }
  .hbtn.shop-btn, #btn-rules { min-height: 46px !important; }
}

/* Эффекты бустов на целях */
.tile.bfx-hint { animation: bfxHint 1.2s ease-out; }
@keyframes bfxHint { 0% { filter: brightness(2.2) drop-shadow(0 0 16px #ffe27a); transform: scale(1.12); } 100% { filter: none; transform: none; } }
.tile.bfx-undo { animation: bfxUndo .8s cubic-bezier(.2,1.4,.4,1); }
@keyframes bfxUndo { 0% { transform: rotate(-200deg) scale(.3); filter: brightness(2) hue-rotate(-40deg); } 100% { transform: none; filter: none; } }
.board-wrap.bfx-shuffle { animation: bfxShuffle .9s ease-in-out; }
@keyframes bfxShuffle { 20% { transform: rotate(-3deg) scale(.97); filter: saturate(1.6) brightness(1.15); } 50% { transform: rotate(3deg) scale(1.02); } 80% { transform: rotate(-1deg); } 100% { transform: none; filter: none; } }
.cell.bfx-slot, #tray.bfx-slot { animation: bfxSlot 1s ease-out; }
@keyframes bfxSlot { 0% { transform: scale(1.35); filter: brightness(2.4) drop-shadow(0 0 14px #ffd25a); } 100% { transform: none; filter: none; } }
#timer.bfx-time { animation: bfxTime 1s ease-out; }
@keyframes bfxTime { 0% { transform: scale(1.3); filter: brightness(1.8) drop-shadow(0 0 14px #7ff09a); } 100% { transform: none; filter: none; } }
#timer.bfx-freeze { animation: bfxFreeze 1.2s ease-out; }
@keyframes bfxFreeze { 0% { transform: scale(1.25); filter: brightness(2) drop-shadow(0 0 16px #bff4ff); } 100% { transform: none; filter: none; } }
.board-wrap.bfx-frost::after { content: ''; position: absolute; inset: -6px; border-radius: 24px; pointer-events: none; z-index: 30;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(190,240,255,.55) 85%, rgba(255,255,255,.85) 100%);
  box-shadow: inset 0 0 30px rgba(170,235,255,.8); animation: frost 2.6s ease-out both; }
@keyframes frost { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: .85; } 100% { opacity: 0; } }
.board-wrap { position: relative; }

/* Аудит «ноль плоского»: глянец и объём у мелких элементов */
.legend i, .legend .dot, .legend span > b:first-child { box-shadow: inset 0 -2px 3px rgba(0,0,0,.35), inset 0 2px 1px rgba(255,255,255,.7), 0 0 0 1.5px #ffe08a, 0 2px 3px rgba(0,0,0,.5) !important; }
.diff-chip { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.6), inset 0 -2px 3px rgba(0,0,0,.25), 0 0 0 1px rgba(255,230,160,.8), 0 2px 4px rgba(0,0,0,.4); position: relative; overflow: hidden; }
.diff-chip::after { content: ''; position: absolute; left: 6%; right: 6%; top: 1px; height: 45%; border-radius: 999px; background: rgba(255,255,255,.35); pointer-events: none; }
.toast { background: linear-gradient(180deg, #7a4ab8, #3e1f74 60%, #2a1450) !important; box-shadow: 0 0 0 1.5px #5c3606, 0 0 0 3.5px #ffd56b, 0 0 0 5px #5c3606, inset 0 2px 0 rgba(255,255,255,.3), 0 10px 20px rgba(0,0,0,.5) !important; border-radius: 999px !important; }
.mp-bar, .sp-bar { padding: 2px !important; background: linear-gradient(180deg, #3a1d05, #6b3c0c) !important; box-shadow: 0 0 0 1.5px #ffe08a, inset 0 2px 3px rgba(0,0,0,.7), 0 2px 4px rgba(0,0,0,.45) !important; border-radius: 999px !important; }
.mp-bar i, .sp-bar i { position: relative; border-radius: 999px !important; background: linear-gradient(180deg, #fffbe0 0%, #ffe27a 35%, #f5a623 70%, #ffcf5a 100%) !important; box-shadow: 0 0 10px rgba(255,220,110,.9) !important; overflow: hidden; }
.mp-bar i::after, .sp-bar i::after { content: ''; position: absolute; left: 4px; right: 4px; top: 1px; height: 40%; border-radius: 999px; background: rgba(255,255,255,.7); }
.switch i { background: linear-gradient(180deg, #2a1a3a, #4a3460) !important; box-shadow: inset 0 3px 5px rgba(0,0,0,.7), 0 0 0 1.5px #ffe08a, 0 0 0 3px #5c3606 !important; }
.switch input:checked + i { background: linear-gradient(180deg, #c8ffd0 0%, #5fe07a 35%, #1f9a45 100%) !important; }
.switch i::after { background: radial-gradient(circle at 35% 30%, #ffffff 0 18%, #fff3c4 35%, #e3a63a 100%) !important; box-shadow: 0 2px 4px rgba(0,0,0,.5), inset 0 -2px 2px rgba(120,60,0,.4) !important; }
.set-row input[type=range] { -webkit-appearance: none; appearance: none; height: 12px; border-radius: 999px; background: linear-gradient(180deg, #3a1d05, #6b3c0c); box-shadow: 0 0 0 1.5px #ffe08a, inset 0 2px 3px rgba(0,0,0,.7); }
.set-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #ffe27a 40%, #d98612 100%); box-shadow: 0 0 0 2px #6b420e, 0 3px 5px rgba(0,0,0,.5); }
.prod-badge { box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -2px 3px rgba(0,0,0,.25), 0 0 0 1.5px #fff3c0, 0 3px 6px rgba(0,0,0,.45) !important; }
.ms-tag { box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 0 0 1.5px #ffe08a, 0 3px 6px rgba(0,0,0,.45) !important; }
.mi { background: linear-gradient(180deg, #4a2a78, #1e0f38) !important; box-shadow: 0 0 0 1.5px #5c3606, 0 0 0 3px #ffd56b, inset 0 2px 0 rgba(255,255,255,.25), 0 6px 10px rgba(0,0,0,.45) !important; border-radius: 14px !important; }
.mi.ok { background: linear-gradient(180deg, #fff6d0, #f0b545 60%, #b8761e) !important; }

/* ================= v3.4: мягкие скругления модалок + объёмный глянцевый фон =================
   border-image игнорирует border-radius → почти квадратные углы. Убираем растровую рамку
   у окон, ставим многослойный глянцевый золотой обод (как у saga-card / theme-banner).
   Орнаменты углов сняты: они ломали скругление. */
.sheet, .overlay .sheet {
  border-image: none !important;
  border: 0 !important;
  border-radius: 28px !important;
  overflow: hidden;
  background:
    radial-gradient(140% 90% at 50% -8%, rgba(255, 236, 180, .34) 0%, rgba(255, 200, 120, .08) 32%, transparent 58%),
    radial-gradient(90% 70% at 50% 110%, rgba(160, 70, 220, .38) 0%, transparent 55%),
    radial-gradient(70% 50% at 18% 70%, rgba(255, 120, 200, .12), transparent 60%),
    linear-gradient(165deg, #7a4aa8 0%, #4a2878 28%, #2a1648 62%, #160a2c 100%) !important;
  box-shadow:
    0 0 0 1.5px #4a2a06,
    0 0 0 3.5px #ffe9a8,
    0 0 0 5px #8a5510,
    0 0 0 7.5px #f3c24f,
    0 0 0 9px #5c3606,
    inset 0 2px 0 rgba(255,255,255,.28),
    inset 0 -18px 28px rgba(0,0,0,.28),
    inset 0 0 40px rgba(255,190,255,.08),
    0 22px 50px rgba(0,0,0,.7),
    0 0 48px rgba(255,190,80,.28) !important;
}
/* Блик-шелк по верхней дуге модалки */
.sheet::before {
  content: '' !important;
  position: absolute !important;
  left: 8% !important; right: 8% !important; top: 0 !important;
  height: 42% !important;
  margin: 0 !important; width: auto !important;
  transform: none !important; border-radius: 28px 28px 55% 55% / 28px 28px 40px 40px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.06) 55%, transparent) !important;
  box-shadow: none !important; pointer-events: none !important; z-index: 0 !important;
}
/* Нижний ромбик-указатель оставляем, но мягче */
.sheet::after {
  content: '' !important;
  position: absolute !important;
  width: 18px !important; height: 18px !important;
  left: 50% !important; margin-left: -9px !important;
  top: auto !important; bottom: -9px !important;
  transform: rotate(45deg) !important;
  border-radius: 4px !important;
  background: linear-gradient(135deg, #ffe9a8, #d9a03a 55%, #8a5510) !important;
  box-shadow: 0 0 0 1.5px #5c3606, 0 4px 8px rgba(0,0,0,.45) !important;
  pointer-events: none !important; z-index: 2 !important;
}
.sheet > * { position: relative; z-index: 1; }
.sheet-win, .sheet-lose, .sheet-pause, .sheet-newtile { overflow: visible !important; }
.sheet-win { overflow: hidden; overflow-y: auto !important; } /* scroll on short viewports */

/* Внутренние плитки статистики и строк настроек — объём, не плоская заливка */
.sheet .stat, .stat, .set-row {
  border-image: none !important;
  border: 0 !important;
  border-radius: 20px !important;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(180deg, rgba(90,50,130,.72) 0%, rgba(28,14,52,.88) 55%, rgba(14,6,28,.95) 100%) !important;
  box-shadow:
    0 0 0 1.5px #5c3606,
    0 0 0 3px #ffe08a,
    0 0 0 4.5px #8a5510,
    inset 0 2px 0 rgba(255,255,255,.28),
    inset 0 -10px 16px rgba(0,0,0,.35),
    0 8px 14px rgba(0,0,0,.35) !important;
}
.set-row { border-radius: 22px !important; }

/* Большие панели альбома/меты тоже скруглённые глянцевые (без квадратных орнаментов) */
.album-set, .meta-scene {
  border-image: none !important;
  border: 0 !important;
  border-radius: 26px !important;
  box-shadow:
    0 0 0 1.5px #4a2a06,
    0 0 0 3.5px #ffe9a8,
    0 0 0 5px #8a5510,
    0 0 0 7px #f3c24f,
    0 0 0 8.5px #5c3606,
    inset 0 2px 0 rgba(255,255,255,.2),
    0 12px 24px rgba(0,0,0,.5) !important;
}
.album-set {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255,220,160,.2), transparent 50%),
    linear-gradient(180deg, rgba(70,40,110,.92), rgba(18,10,36,.96)) !important;
}
.sheet-win > .win-rays { position: absolute !important; z-index: 0 !important; }
.sheet-win > *:not(.win-rays) { position: relative; z-index: 1; }
.nt-stage, .nt-rays, .nt-glow { z-index: 0; }

/* v3.4.1: сильнее объём внутри модалок (после проверки live) */
.sheet, .overlay .sheet {
  background:
    radial-gradient(130% 85% at 50% -12%, rgba(255, 245, 210, .55) 0%, rgba(255, 210, 140, .18) 28%, transparent 55%),
    radial-gradient(100% 70% at 50% 100%, rgba(180, 80, 255, .45) 0%, transparent 50%),
    radial-gradient(80% 55% at 12% 78%, rgba(255, 120, 210, .22), transparent 55%),
    radial-gradient(70% 50% at 88% 30%, rgba(120, 200, 255, .12), transparent 50%),
    linear-gradient(168deg, #8a58b8 0%, #5a3290 22%, #3a1f68 48%, #241040 72%, #12081f 100%) !important;
}
.sheet::before {
  height: 48% !important;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.12) 50%, transparent) !important;
}
.sheet .stat, .stat, .set-row {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255,255,255,.32), transparent 50%),
    radial-gradient(90% 80% at 50% 120%, rgba(140,60,220,.35), transparent 55%),
    linear-gradient(180deg, rgba(110,70,160,.85) 0%, rgba(40,20,75,.92) 45%, rgba(16,8,34,.98) 100%) !important;
}

/* ================= v3.5: Comfortaa Bold readability + Win variant 1 ================= */
body { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em; }
button, input, .btn, .hbtn, .page-tab, .play-btn, .pill { font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.01em; }
.logo, .chapter-title, .sheet h2, .sheet h2.ru, .meta-h, .soon-card h3, .shop-h, .pl-main, .nt-title,
.btn, .hbtn, .page-tab, .lvl-dot .num, .lvl .num, .res-v b, .timer b, .hud-pill b, .hud-level, .set-row b,
.prod b, .prod-name, .prod .pn, .stat b, .album-set h3, .album-set h4, .as-head, .sc-name, .bar-title, .pill b,
.boost small, .boosts small, .cv-name, .ac-name, .ms-tag, .tut-bubble p, .toast, .legend, .saga-label, .day b {
  font-family: 'Comfortaa', system-ui, sans-serif !important; letter-spacing: -0.015em; }

/* Баннер темы и play: не обрезать длинные названия (Праздник света / Light Festival) */
.theme-banner { gap: 8px; padding: 10px 10px; }
.tb-text { min-width: 0; flex: 1 1 auto; }
.tb-text .chapter-title {
  font-size: clamp(14px, 4.3vw, 21px) !important; font-weight: 700 !important;
  letter-spacing: -0.045em !important; line-height: 1.1 !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.tb-text small { font-size: clamp(10.5px, 3.1vw, 12.5px) !important; font-weight: 700 !important; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-btn { padding: 11px 12px 12px; width: min(100%, 340px); }
.pl-main { font-size: clamp(26px, 8vw, 34px) !important; font-weight: 900 !important; letter-spacing: -0.02em !important; white-space: nowrap; }
.pl-sub {
  font-size: clamp(10px, 3.0vw, 13px) !important; font-weight: 700 !important; letter-spacing: -0.035em !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  padding: 0 4px; line-height: 1.2;
}
.chapter-title { font-size: clamp(15px, 4.4vw, 20px); font-weight: 800; letter-spacing: 0.01em; }
.btn, .btn-ghost, .btn-teal { font-weight: 800; letter-spacing: -0.01em; font-size: 16px; }
.saga-card .sc-name { font-size: 10px !important; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }

@media (max-width: 370px) {
  .tb-text .chapter-title { font-size: 13.5px !important; letter-spacing: 0.01em !important; }
  .pl-main { font-size: 22px !important; }
  .pl-sub { font-size: 9.5px !important; letter-spacing: -0.045em !important; }
  .tb-covers img { width: 42px !important; height: 42px !important; }
  .overlay .sheet { width: min(336px, calc(100% - 28px)); padding: 18px 14px 16px; }
  .sheet-win .win-stats .stat { padding: 10px 4px 8px; }
  .sheet-win .stat b { font-size: 18px; }
  .sheet-win .stat-ico { width: 34px; height: 34px; }
}

/* ---- Win variant 1: expressive ---- */
.sheet-win {
  overflow: hidden !important;
  padding-top: 16px !important;
  background:
    radial-gradient(120% 90% at 50% 18%, rgba(255, 230, 140, .42) 0%, rgba(255, 180, 80, .12) 28%, transparent 55%),
    radial-gradient(90% 70% at 50% 100%, rgba(160, 60, 255, .4) 0%, transparent 50%),
    linear-gradient(168deg, #7a48b0 0%, #4a2880 35%, #241048 70%, #12081f 100%) !important;
}
.win-glow {
  position: absolute; left: 50%; top: 22%; width: 320px; height: 320px; margin: -160px 0 0 -160px;
  pointer-events: none; z-index: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,230,150,.75) 0%, rgba(255,190,80,.35) 38%, rgba(255,160,60,.08) 62%, transparent 78%);
  filter: blur(8px); animation: winGlowPulse 2.4s ease-in-out infinite alternate;
}
@keyframes winGlowPulse { from { opacity: .65; transform: scale(.9); } to { opacity: 1; transform: scale(1.12); } }
.sheet-win .win-rays {
  width: 560px; height: 420px; margin-left: -280px; top: -60px; opacity: 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(255,236,170,.7) 0%, rgba(255,200,90,.28) 32%, rgba(255,170,60,.08) 55%, transparent 72%);
  -webkit-mask-image: none; mask-image: none;
  animation: winGlowPulse 2.8s ease-in-out infinite alternate;
  filter: blur(10px);
  pointer-events: none;
}
.sheet-win .win-rays::after { display: none !important; content: none !important; }
.win-title-art {
  display: block; width: min(100%, 310px); height: auto; margin: -2px auto 0;
  background: none !important; mix-blend-mode: normal;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.35)) drop-shadow(0 0 12px rgba(255,200,80,.3));
  position: relative; z-index: 2; animation: winTitleIn .55s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes winTitleIn { from { transform: scale(.6) translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-win .win-title-glow {
  font-size: clamp(26px, 8vw, 34px) !important; margin: 4px auto 8px !important;
  filter: drop-shadow(0 0 18px rgba(255,210,90,.85)) drop-shadow(0 4px 0 rgba(90,40,0,.55));
}
.sheet-win .win-stars {
  display: flex; justify-content: center; align-items: flex-end; gap: 6px;
  min-height: 78px; margin: 2px 0 6px; position: relative; z-index: 2;
}
.sheet-win .win-stars > span {
  display: inline-grid; place-items: center; opacity: 0; transform: scale(.2);
  filter: drop-shadow(0 0 12px rgba(255,210,90,.95));
}
.sheet-win .win-stars > span.win-star-pop {
  animation: winStarPop .55s cubic-bezier(.2,1.5,.4,1) forwards;
  animation-delay: var(--d, 0ms);
}
.sheet-win .win-stars > span:nth-child(2) { transform-origin: 50% 60%; }
.sheet-win .win-stars img.ei { height: 64px !important; width: auto; }
.sheet-win .win-stars > span:nth-child(2) img.ei { height: 82px !important; }
@keyframes winStarPop {
  0% { opacity: 0; transform: scale(.15) translateY(18px); filter: brightness(3) drop-shadow(0 0 0 transparent); }
  55% { opacity: 1; transform: scale(1.22) translateY(-6px); filter: brightness(1.4) drop-shadow(0 0 22px rgba(255,230,120,1)); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: brightness(1) drop-shadow(0 0 14px rgba(255,210,90,.9)); }
}
.sheet-win .win-sub { font-weight: 700; font-size: 13.5px; letter-spacing: -0.01em; margin: 2px 0 4px; color: #ffe9c8; }
.sheet-win .win-note { font-size: 13px; font-weight: 700; opacity: .88; margin: 2px 0; }
.sheet-win .win-note.dim { font-size: 12px; opacity: .72; }
.sheet-win .win-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 12px 4px 8px;
}
.sheet-win .win-stats .stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px 10px !important; border-radius: 22px !important;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.28), transparent 55%),
    linear-gradient(180deg, rgba(120,70,180,.9), rgba(30,12,60,.95)) !important;
  box-shadow:
    0 0 0 1.5px #5c3606, 0 0 0 3.5px #ffe08a, 0 0 0 5px #8a5510,
    inset 0 2px 0 rgba(255,255,255,.35), inset 0 -10px 16px rgba(0,0,0,.35),
    0 10px 16px rgba(0,0,0,.4) !important;
  min-height: 96px; justify-content: center;
}
.sheet-win .stat-ico {
  width: 40px; height: 40px; object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)) drop-shadow(0 0 8px rgba(255,210,90,.55));
  margin-bottom: 2px;
}
.sheet-win .win-stats .stat b {
  font-size: 22px; font-weight: 900; letter-spacing: -0.02em;
  color: #fff6d0; text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 10px rgba(255,200,80,.45);
}
.sheet-win .win-stats .stat small {
  font-size: 11px; font-weight: 700; letter-spacing: -0.02em; opacity: .92;
  white-space: nowrap; max-width: 100%; line-height: 1.15;
}
.sheet-win .win-actions { gap: 9px; margin-top: 10px; }
.sheet-win .win-actions .btn { font-size: 16px; font-weight: 800; }
.sheet-win .win-actions .btn img.ei { height: 20px; width: 20px; vertical-align: -4px; margin-right: 2px; }


/* v3.5.1: win — без прямоугольников; шрифт жирнее */
.sheet-win::before {
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.28), transparent 70%) !important;
  height: 55% !important; border-radius: 50% !important; left: -5% !important; right: -5% !important; width: auto !important;
  filter: blur(6px); opacity: .85;
}
.sheet-win { isolation: isolate; }
.win-title-art { -webkit-mask-image: none; }

/* Comfortaa: реально жирнее (Bold + stroke + тень). Body тоже 700 — иначе выглядит тонко. */
body { font-weight: 700 !important; -webkit-font-smoothing: antialiased; }
.btn, .btn-ghost, .btn-teal, .hbtn, .page-tab, .play-btn, .pill, .pl-main, .pl-sub,
.chapter-title, .sheet h2, .sheet h2.ru, .set-row b, .stat b, .meta-h, .soon-card h3,
.shop-h, .nt-title, .saga-card .sc-name, .prod b, .prod-name, .bar-title, .cv-name {
  font-weight: 700 !important;
  -webkit-text-stroke: 0.4px rgba(255,255,255,.12);
}
.btn, .btn-ghost, .btn-teal, .play-btn .pl-main, .hbtn span {
  -webkit-text-stroke: 0.55px rgba(0,0,0,.18);
  text-shadow: 0 1px 0 rgba(0,0,0,.35), 0 2px 3px rgba(0,0,0,.35) !important;
}
.btn { text-shadow: 0 1px 0 rgba(255,250,220,.55), 0 2px 0 rgba(90,40,0,.35), 0 3px 4px rgba(0,0,0,.35) !important; }
.btn-ghost { text-shadow: 0 1px 0 rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.45), 0 0 1px rgba(255,255,255,.25) !important; }
.pl-main { -webkit-text-stroke: 0.7px rgba(10,60,10,.45) !important; text-shadow: 0 2px 0 rgba(0,0,0,.4), 0 3px 6px rgba(0,0,0,.35) !important; }
.pl-sub { font-weight: 700 !important; text-shadow: 0 1px 2px rgba(0,0,0,.55) !important; }
.tb-text .chapter-title, .chapter-title {
  font-weight: 700 !important;
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 8px rgba(0,0,0,.35) !important;
}
.sheet-win .win-actions .btn {
  font-weight: 700 !important; font-size: 17px !important;
  -webkit-text-stroke: 0.5px rgba(0,0,0,.2);
}
.sheet-win .win-sub, .sheet-win .win-note, .sheet-win .win-stats .stat small {
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.sheet-win .win-stats .stat b {
  -webkit-text-stroke: 0.4px rgba(80,40,0,.35);
}
@media (max-width: 370px) {
  .btn, .btn-ghost { font-size: 15px !important; }
  .sheet-win .win-actions .btn { font-size: 15px !important; }
}


/* v3.5.2: жирнее глифы Comfortaa — stroke в цвет текста + плотная тень */
.btn, .btn-ghost, .btn-teal, .hbtn, .hbtn span, .page-tab, .play-btn, .pl-main, .pl-sub,
.chapter-title, .tb-text .chapter-title, .sheet h2, .set-row b, .stat b, .prod b, .saga-card .sc-name {
  paint-order: stroke fill;
  -webkit-text-stroke: 0.85px currentColor;
  font-synthesis: weight;
}
.btn { -webkit-text-stroke: 0.9px rgba(74,38,4,.55); letter-spacing: -0.02em; }
.btn-ghost { -webkit-text-stroke: 0.75px rgba(255,246,216,.35); letter-spacing: -0.02em; }
.pl-main { -webkit-text-stroke: 1px rgba(255,255,255,.35) !important; }
.sheet-win .win-actions .btn { -webkit-text-stroke: 0.95px rgba(74,38,4,.5) !important; letter-spacing: -0.025em !important; }
.sheet-win .win-actions .btn-ghost { -webkit-text-stroke: 0.8px rgba(255,246,216,.4) !important; }
body { font-weight: 700 !important; }


/* v3.5.3: только мягкое свечение; жирнее кнопки */
.sheet-win .win-glow {
  width: 380px !important; height: 300px !important; margin: -150px 0 0 -190px !important;
  top: 18% !important; left: 50% !important;
  background: radial-gradient(ellipse 70% 60% at 50% 50%,
    rgba(255,240,180,.85) 0%,
    rgba(255,210,110,.4) 28%,
    rgba(255,180,70,.12) 52%,
    transparent 74%) !important;
  filter: blur(14px) !important;
  border-radius: 50% !important;
  opacity: 1 !important;
}
.sheet-win .win-rays { display: none !important; }
.sheet-win::before {
  background: radial-gradient(ellipse 80% 70% at 50% -10%, rgba(255,255,255,.22), transparent 65%) !important;
  filter: blur(10px) !important; height: 50% !important;
  border-radius: 50% 50% 40% 40% !important;
}
.win-title-art {
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)) drop-shadow(0 0 10px rgba(255,200,80,.35)) !important;
}
.sheet-win .win-actions .btn,
.sheet-win .win-actions .btn-ghost {
  font-size: 18px !important; font-weight: 700 !important;
  -webkit-text-stroke: 1.15px currentColor !important;
  paint-order: stroke fill !important;
  letter-spacing: -0.03em !important;
}
.sheet-win .win-actions .btn {
  -webkit-text-stroke: 1.2px rgba(60,30,0,.45) !important;
  text-shadow: 0 1px 0 rgba(255,250,220,.7), 0 2px 0 rgba(90,40,0,.4), 0 3px 5px rgba(0,0,0,.4) !important;
}
.sheet-win .win-actions .btn-ghost {
  -webkit-text-stroke: 1.05px rgba(255,246,220,.45) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 2px 4px rgba(0,0,0,.5) !important;
}
.btn, .btn-ghost, .hbtn span, .pl-main, .pl-sub, .chapter-title, .tb-text .chapter-title {
  -webkit-text-stroke-width: 1px !important;
  paint-order: stroke fill !important;
}


/* v3.6: победа — компактнее по вертикали, меньше пустоты сверху */
.sheet-win {
  padding: 10px 16px 14px !important;
  justify-content: flex-start;
}
.overlay:has(.sheet-win) { align-items: center; padding-top: 12px; padding-bottom: 12px; }
.sheet-win .win-glow {
  top: 8% !important; width: 300px !important; height: 220px !important;
  margin: -110px 0 0 -150px !important; opacity: .85 !important;
}
.win-title-art {
  width: min(100%, 260px) !important; margin: -14px auto -4px !important;
}
.sheet-win .win-stars { min-height: 64px !important; margin: -2px 0 2px !important; gap: 2px !important; }
.sheet-win .win-stars img.ei { height: 52px !important; }
.sheet-win .win-stars > span:nth-child(2) img.ei { height: 66px !important; }
.sheet-win .win-sub { margin: 0 0 2px !important; font-size: 12.5px !important; }
.sheet-win .win-note { margin: 1px 0 !important; font-size: 12px !important; }
.sheet-win .win-stats { margin: 6px 2px 4px !important; gap: 8px !important; }
.sheet-win .win-stats .stat { min-height: 78px !important; padding: 8px 4px 6px !important; border-radius: 18px !important; }
.sheet-win .stat-ico { width: 32px !important; height: 32px !important; }
.sheet-win .win-stats .stat b { font-size: 18px !important; }
.sheet-win .win-actions { gap: 7px !important; margin-top: 6px !important; }
.sheet-win .win-actions .btn { min-height: 46px !important; font-size: 16px !important; }
.sheet-win .card-drop { margin: 4px auto 2px !important; padding: 6px 10px !important; }
@media (max-height: 720px) {
  .win-title-art { width: min(100%, 220px) !important; margin-top: -18px !important; }
  .sheet-win .win-stars { min-height: 52px !important; }
  .sheet-win .win-stats .stat { min-height: 68px !important; }
}
@media (max-width: 370px) {
  .win-title-art { width: min(100%, 230px) !important; }
  .sheet-win { padding: 8px 12px 12px !important; }
}


/* v3.8: кнопка магазина — изумруд (сумка не сливается) + толстый золотой ободок сумки */
.hbtn.shop-btn {
  background: linear-gradient(180deg, #6ef0c8 0%, #1aa87a 42%, #0a5c44 100%) !important;
  border-image-source: none !important;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.5),
    inset 0 -4px 0 rgba(0,40,28,.45),
    0 0 0 2px #ffe08a,
    0 0 0 4px #5c3606,
    0 5px 0 #063d2e,
    0 10px 18px rgba(0,0,0,.45) !important;
  overflow: visible !important;
  color: #fff8e8 !important;
  text-shadow: 0 2px 0 rgba(0,40,28,.75) !important;
}
.hbtn.shop-btn .shop-bag-ring {
  position: absolute; left: 4px; top: 50%; transform: translateY(-58%);
  width: 56px; height: 56px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff8dc 0%, #ffd24a 28%, #c48912 58%, #5c3606 82%, #2a1800 100%);
  box-shadow:
    0 0 10px rgba(255,210,80,.65),
    0 3px 6px rgba(0,0,0,.45),
    inset 0 2px 3px rgba(255,255,255,.65),
    inset 0 -3px 4px rgba(60,30,0,.55);
  display: grid; place-items: center; pointer-events: none; z-index: 2;
}
.hbtn.shop-btn .shop-bag-ring::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a2040, #1a0c28 70%);
  box-shadow: inset 0 0 0 1.5px rgba(255,210,120,.35);
}
.hbtn.shop-btn img {
  position: absolute !important; left: 4px !important; top: 50% !important;
  width: 40px !important; height: 40px !important;
  transform: translateY(-58%) rotate(-8deg) !important;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)) !important;
  z-index: 3;
}
.hbtn.shop-btn:active .shop-bag-ring { transform: translateY(-54%) scale(.94); }
.hbtn.shop-btn:active img { transform: translateY(-54%) rotate(-8deg) scale(.94) !important; }
@media (max-width: 370px) {
  .hbtn.shop-btn .shop-bag-ring { width: 50px; height: 50px; }
  .hbtn.shop-btn img { width: 36px !important; height: 36px !important; }
}


/* v3: лёд и замки на костях */
.tile.iced .face::before {
  content: ''; position: absolute; inset: -2px; border-radius: 18%; pointer-events: none; z-index: 3;
  background: linear-gradient(160deg, rgba(180,230,255,.55), rgba(120,190,255,.25) 40%, rgba(200,240,255,.35));
  box-shadow: inset 0 0 12px rgba(255,255,255,.55), 0 0 8px rgba(140,210,255,.6);
  border: 1.5px solid rgba(200,240,255,.7);
}
.tile.iced .ico { filter: brightness(1.05) saturate(.85) hue-rotate(10deg); }
.tile.locked-tile .face::after {
  content: '🔒'; position: absolute; right: 2px; top: 2px; z-index: 4; font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.7));
}
.tile.locked-tile .face { filter: brightness(.78) saturate(.9); }

/* копилка */
.res-piggy { min-width: 68px; }
.res-piggy .res-v { font-size: 11px; }
.piggy-wrap { position: relative; text-align: center; padding: 6px 4px 4px; }
.piggy-glow {
  position: absolute; left: 50%; top: 18%; width: 200px; height: 140px; margin: -70px 0 0 -100px;
  background: radial-gradient(ellipse, rgba(255,200,80,.55), transparent 70%); pointer-events: none;
}
.piggy-art {
  font-size: 64px; line-height: 1; margin: 4px auto 8px;
  filter: drop-shadow(0 4px 0 #8a5c1c) drop-shadow(0 8px 12px rgba(0,0,0,.45));
  display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px;
  background: linear-gradient(180deg, #ffe9a8, #e7a83a 55%, #9a5a12);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(80,40,0,.35), 0 0 0 2px #ffe08a, 0 0 0 4px #5c3606, 0 8px 16px rgba(0,0,0,.4);
}
.piggy-art.tier-copper {
  background: linear-gradient(180deg, #f6d0b0, #d4894a 55%, #8a4a18);
}
.piggy-art.tier-gold {
  background: linear-gradient(180deg, #fff3b0, #ffd24a 45%, #c48912 100%);
}
.piggy-bar {
  height: 16px; border-radius: 10px; margin: 8px 8px 6px; overflow: hidden;
  background: rgba(20,10,30,.85);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 0 0 1.5px rgba(255,210,100,.55);
}
.piggy-bar i {
  display: block; height: 100%; min-width: 4px; border-radius: 10px;
  background: linear-gradient(180deg, #fff6c8, #ffd25a 50%, #e39a22);
  box-shadow: 0 0 10px rgba(255,200,80,.7);
}


/* ===== v3.8 CRITICAL: win modal fits any viewport (Telegram short screens) ===== */
.overlay {
  align-items: center;
  justify-content: center;
  padding: max(8px, var(--safe-top, 0px)) 12px max(10px, var(--safe-bottom, 0px));
  /* Telegram / mobile: use stable height */
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  box-sizing: border-box;
  overflow: hidden;
  display: flex !important;
}
.overlay.hidden { display: none !important; }

.overlay .sheet.sheet-win {
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100% - 16px));
  max-height: calc(var(--app-h, 100dvh) - 16px - var(--safe-top, 0px) - var(--safe-bottom, 0px));
  max-height: calc(100dvh - 16px);
  max-height: calc(var(--app-h, 100dvh) - 16px);
  overflow: hidden !important;          /* clip chrome */
  overflow-y: hidden !important;
  padding: 8px 14px 10px !important;
  margin: 0 auto;
  justify-content: flex-start;
  box-sizing: border-box;
}

.sheet-win .win-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 4px;
}

.sheet-win .win-actions {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 5;
  gap: 6px !important;
  margin-top: 4px !important;
  padding-top: 6px;
  background: linear-gradient(180deg, transparent, rgba(20,8,40,.92) 28%);
}

.sheet-win .win-actions .btn {
  min-height: 44px !important;
  font-size: 15px !important;
  padding: 10px 14px !important;
}

.sheet-win .win-glow {
  top: 6% !important;
  width: 220px !important;
  height: 160px !important;
  margin: -80px 0 0 -110px !important;
  opacity: .75 !important;
}

.win-title-art {
  width: min(100%, 240px) !important;
  margin: -8px auto -2px !important;
}

.sheet-win .win-stars {
  min-height: 48px !important;
  margin: 0 0 2px !important;
  gap: 2px !important;
}
.sheet-win .win-stars img.ei { height: 42px !important; }
.sheet-win .win-stars > span:nth-child(2) img.ei { height: 54px !important; }

.sheet-win .win-sub { margin: 0 0 2px !important; font-size: 12px !important; }
.sheet-win .win-note { margin: 1px 0 !important; font-size: 11.5px !important; }
.sheet-win .win-stats {
  margin: 4px 0 2px !important;
  gap: 6px !important;
}
.sheet-win .win-stats .stat {
  min-height: 64px !important;
  padding: 6px 4px 5px !important;
  border-radius: 16px !important;
}
.sheet-win .stat-ico { width: 28px !important; height: 28px !important; }
.sheet-win .win-stats .stat b { font-size: 16px !important; }
.sheet-win .card-drop { margin: 4px auto 2px !important; padding: 6px 8px !important; }

/* Short phones / Telegram with header (≤640) */
@media (max-height: 700px) {
  .overlay .sheet.sheet-win { padding: 6px 12px 8px !important; }
  .win-title-art { width: min(100%, 200px) !important; margin-top: -10px !important; }
  .sheet-win .win-stars { min-height: 40px !important; }
  .sheet-win .win-stars img.ei { height: 36px !important; }
  .sheet-win .win-stars > span:nth-child(2) img.ei { height: 46px !important; }
  .sheet-win .win-stats .stat { min-height: 56px !important; }
  .sheet-win .win-note.dim, .sheet-win .bonus-prize { display: none; } /* hide secondary notes to save space */
  .sheet-win .win-actions .btn { min-height: 42px !important; font-size: 14.5px !important; }
}
@media (max-height: 600px) {
  .win-title-art { width: min(100%, 170px) !important; }
  .sheet-win .win-stats { gap: 4px !important; }
  .sheet-win .win-stats .stat { min-height: 48px !important; padding: 4px 2px !important; }
  .sheet-win .stat-ico { width: 22px !important; height: 22px !important; }
  .sheet-win .win-stats .stat small { font-size: 10px !important; }
  .sheet-win .win-actions .btn { min-height: 40px !important; }
}
@media (max-height: 520px) {
  .sheet-win .win-stars { min-height: 32px !important; }
  .sheet-win .win-stars img.ei { height: 28px !important; }
  .sheet-win .win-stars > span:nth-child(2) img.ei { height: 34px !important; }
  .win-title-art { width: min(100%, 140px) !important; }
}

/* Splash captions — Comfortaa Bold glossy */
.splash .sp-label {
  font-family: 'Comfortaa', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #fff6d0 !important;
  text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 12px rgba(255,200,80,.55);
  min-height: 1.4em;
  transition: opacity .25s ease;
}
.splash .sp-bar-wrap {
  width: min(280px, 78vw);
  margin: 10px auto 6px;
}
.splash .sp-bar {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: rgba(20,10,40,.75);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 0 0 1.5px rgba(255,210,100,.55), 0 0 0 3px #5c3606;
}
.splash .sp-bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(180deg, #fffbe0, #ffd25a 45%, #e8891c);
  box-shadow: 0 0 12px rgba(255,200,80,.85);
  transition: width .18s ease-out;
}


/* —— Рико (маскот) —— */
.rico-home-wrap{display:flex;flex-direction:column;align-items:center;gap:6px;margin:6px auto 2px;max-width:220px}
.rico-home,.rico-face{width:96px;height:96px;display:block;border-radius:24px;background-color:#1a1230;background-repeat:no-repeat;box-shadow:0 8px 24px rgba(0,0,0,.35),inset 0 0 0 2px rgba(232,184,74,.55);flex-shrink:0}
.rico-bubble{margin:0;padding:8px 12px;border-radius:16px;background:rgba(20,14,40,.88);border:1.5px solid rgba(232,184,74,.45);color:#f7f0d8;font:600 12px/1.35 Comfortaa,system-ui,sans-serif;text-align:center;max-width:240px;box-shadow:0 4px 14px rgba(0,0,0,.25)}
.rico-face{width:72px;height:72px;margin:0 auto 6px;border-radius:20px}
.rico-face.lg,.rico-face.profile-ava{width:96px;height:96px;border-radius:50%}
.overlay .rico-line{font:600 12px/1.35 Comfortaa,system-ui,sans-serif;color:#e8d9a8;text-align:center;margin:4px 0 8px}

/* Профиль */
.profile-card{display:flex;flex-direction:column;align-items:center;gap:10px;padding:8px 4px}
.profile-ava{width:88px;height:88px;border-radius:50%;object-fit:cover;padding:3px;background:linear-gradient(135deg,#f0d060,#a67c00 45%,#f5e6a0);box-shadow:0 6px 18px rgba(0,0,0,.35)}
.profile-fields{width:100%;display:flex;flex-direction:column;gap:8px}
.profile-fields label{display:flex;flex-direction:column;gap:4px;font:600 11px Comfortaa,system-ui;color:#cbb98a}
.profile-fields input{border-radius:14px;border:1.5px solid rgba(232,184,74,.4);background:rgba(12,8,28,.7);color:#fff;padding:10px 12px;font:600 14px Comfortaa,system-ui}
.card-view.gold-frame .cv-front{box-shadow:0 0 0 3px #e8b84a,0 0 0 6px rgba(80,50,0,.5),0 12px 28px rgba(0,0,0,.45);border-radius:18px;overflow:hidden}
.prod.boosts_bag .prod-art,.prod.boosts_chest .prod-art,.prod.theme_light .prod-art{background:radial-gradient(circle at 30% 20%,#fff6,#0000 55%),linear-gradient(160deg,#3a2a6a,#1a1038)}


/* shop title: Comfortaa «а» визуально ≈ «о» («Могозин») — системный гротеск */
#screen-shop .chapter-title,
#screen-shop .bar-title .chapter-title {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.04em !important;
  font-weight: 800 !important;
  font-size: 20px !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: 0 2px 0 rgba(0,0,0,.55) !important;
  filter: drop-shadow(0 1.5px 0 #7a4208) drop-shadow(0 2px 2px rgba(0,0,0,.4)) !important;
}


/* Профиль: глянцевая 3D золотая рамка аватара */
.ava-gold-ring {
  width: 104px; height: 104px; border-radius: 50%; padding: 6px; margin: 0 auto 8px;
  background: radial-gradient(circle at 30% 22%, #fff8dc 0%, #ffe08a 18%, #e8b84a 40%, #a67c00 68%, #5c3606 100%);
  box-shadow:
    0 0 0 1px #3a2200,
    0 0 14px rgba(255,200,80,.55),
    0 8px 18px rgba(0,0,0,.45),
    inset 0 2px 4px rgba(255,255,255,.7),
    inset 0 -4px 6px rgba(80,40,0,.45);
  position: relative;
}
.ava-gold-ring::before {
  content: ''; position: absolute; left: 18%; right: 38%; top: 10%; height: 18%;
  border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0));
  pointer-events: none;
}
.ava-gold-ring .rico-face, .ava-gold-ring .profile-ava, .ava-gold-ring .player-ava {
  width: 100% !important; height: 100% !important; border-radius: 50% !important;
  margin: 0 !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}
.profile-ava-row, .profile-ava-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  justify-content: center; margin: 6px 0 10px; width: 100%; max-width: 280px;
}
.profile-ava-row button, .profile-ava-grid button {
  width: 56px; height: 56px; border-radius: 50%; padding: 3px; border: 0; margin: 0 auto;
  background: radial-gradient(circle at 30% 25%, #ffe08a, #a67c00 70%, #5c3606);
  box-shadow: 0 2px 6px rgba(0,0,0,.4); cursor: pointer; overflow: hidden;
}
.profile-ava-row button.active, .profile-ava-grid button.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e8b84a, 0 2px 8px rgba(0,0,0,.5);
}
.profile-ava-row button .rico-face,
.profile-ava-row button .player-ava,
.profile-ava-grid button .rico-face,
.profile-ava-grid button .player-ava {
  width: 100% !important; height: 100% !important; border-radius: 50% !important; margin: 0 !important;
  object-fit: cover; display: block;
}
.player-ava {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block;
  background: #1a1230;
}
.player-ava.profile-ava { width: 100%; height: 100%; padding: 0; }
.ava-gold-ring .player-ava {
  width: 100% !important; height: 100% !important; border-radius: 50% !important;
  margin: 0 !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}
/* Аватарка в кнопке «Профиль» на главном меню */
#btn-profile img.menu-ava, .hbtn-profile img.menu-ava {
  border-radius: 50% !important;
  object-fit: cover !important;
  background: radial-gradient(circle at 30% 25%, #ffe08a, #a67c00 70%, #5c3606);
  box-shadow: 0 0 0 2px #e8b84a, 0 0 0 4px #5c3606, 0 4px 10px rgba(0,0,0,.45) !important;
  filter: none !important;
}
.sheet.sheet-profile { position: relative; padding-top: 18px; }
.sheet.sheet-profile .profile-x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: radial-gradient(circle at 35% 30%, #5a3a7a, #1a0c30);
  box-shadow: 0 0 0 2px rgba(232,184,74,.55), 0 4px 10px rgba(0,0,0,.4);
  color: #ffe9b0; font: 800 22px/1 Comfortaa,sans-serif; cursor: pointer; z-index: 3;
}
.sheet h2.ribbon.profile-ribbon {
  background: linear-gradient(180deg, #fff3c0 0%, #ffd24a 28%, #e0a020 55%, #a66a00 78%, #6b4200 100%) !important;
  color: #3a2200 !important;
  text-shadow: 0 1px 0 rgba(255,250,220,.85) !important;
  box-shadow: 0 4px 0 #5c3606, 0 8px 16px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.55) !important;
  -webkit-text-stroke: 0 !important;
}
.sheet h2.ribbon.profile-ribbon::before,
.sheet h2.ribbon.profile-ribbon::after {
  background: linear-gradient(180deg, #c48912, #5c3606) !important;
}


/* FINAL: hide sheet bottom diamond artifact */
.sheet::after { display: none !important; content: none !important; }


/* ruined meta layers */
.meta-scene .ms-base{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1}
.meta-scene .ms-piece{z-index:2}
.meta-scene .ms-after{z-index:3}
.meta-scene .ms-marker{z-index:5}
.meta-scene .ms-light{position:absolute;width:28px;height:28px;margin:-14px 0 0 -14px;border-radius:50%;background:radial-gradient(circle,rgba(255,230,120,.95),rgba(255,160,40,.35) 45%,transparent 70%);box-shadow:0 0 18px rgba(255,200,80,.85);pointer-events:none;z-index:4;animation:metaGlow 1.6s ease-in-out infinite alternate}
@keyframes metaGlow{from{opacity:.55;transform:scale(.9)}to{opacity:1;transform:scale(1.08)}}
.meta-items{grid-template-columns:repeat(6,1fr)!important}


/* meta action icons atlas 5×5 */
.mi-ico, .mt-ico, .ms-marker .mi-ico {
  display:block; width:100%; aspect-ratio:1; border-radius:50%;
  background-image:url(../assets/meta/action-icons.webp);
  background-size:500% 500%;
  background-repeat:no-repeat;
  background-color:transparent;
  box-shadow:0 0 0 2px #e8b84a, 0 3px 8px rgba(0,0,0,.45), inset 0 2px 3px rgba(255,255,255,.35);
}
.mt-ico { width:56px; height:56px; flex:none; }
.ms-marker .mi-ico { width:40px; height:40px; border-radius:50%; }
.mi .mi-ico { width:100%; }
.mi.locked .mi-ico { filter:grayscale(1) brightness(.5); opacity:.75; }
.mi.ok .mi-ico { box-shadow:0 0 0 2px #7dffb0, 0 3px 8px rgba(0,0,0,.4); }

/* stage reward modal — rich gold ribbon + glow */
.sheet.sheet-stage { position:relative; overflow:visible; }
.sheet.sheet-stage h2.ribbon,
.sheet.sheet-stage h2.ribbon.profile-ribbon,
.sheet h2.ribbon.stage-ribbon {
  background: linear-gradient(180deg, #fff3c0 0%, #ffd24a 28%, #e0a020 55%, #a66a00 78%, #6b4200 100%) !important;
  color:#3a2200 !important;
  text-shadow:0 1px 0 rgba(255,250,220,.85) !important;
  box-shadow:0 4px 0 #5c3606, 0 8px 16px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.55), 0 0 24px rgba(255,200,80,.45) !important;
  -webkit-text-stroke:0 !important;
}
.sheet.sheet-stage::before {
  content:''; position:absolute; inset:-20% -10% auto -10%; height:55%; pointer-events:none; z-index:0;
  background:radial-gradient(ellipse at 50% 30%, rgba(255,210,80,.35), transparent 65%);
}
.stage-confetti { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:1; }
.stage-confetti i { position:absolute; width:10px; height:14px; border-radius:2px;
  background:linear-gradient(180deg,#ffe08a,#e8b84a); box-shadow:0 0 6px rgba(255,200,80,.8);
  animation:stageFall 1.8s linear infinite; opacity:.9; }
.stage-confetti i:nth-child(2){ left:20%; background:linear-gradient(180deg,#ff9ad0,#e2335f); animation-delay:.2s; }
.stage-confetti i:nth-child(3){ left:40%; background:linear-gradient(180deg,#9dffc8,#1aa87a); animation-delay:.4s; }
.stage-confetti i:nth-child(4){ left:60%; background:linear-gradient(180deg,#9ab8ff,#3a5ad9); animation-delay:.1s; }
.stage-confetti i:nth-child(5){ left:80%; background:linear-gradient(180deg,#fff3c0,#c48912); animation-delay:.35s; }
.stage-confetti i:nth-child(6){ left:10%; animation-delay:.5s; }
.stage-confetti i:nth-child(7){ left:70%; animation-delay:.6s; }
.stage-confetti i:nth-child(8){ left:50%; animation-delay:.15s; }
@keyframes stageFall { 0%{ transform:translateY(-20px) rotate(0); opacity:0 } 15%{opacity:1} 100%{ transform:translateY(220px) rotate(240deg); opacity:0 } }

/* before/after glossy buttons */
.ba-toggle { display:flex; justify-content:center; gap:12px; margin:10px 8px; }
.ba-toggle .page-tab, .ba-toggle .ba-btn {
  min-width:120px; min-height:44px; padding:10px 18px !important; border-radius:999px !important;
  font:800 15px Comfortaa,sans-serif !important; letter-spacing:.02em !important;
  background:linear-gradient(180deg,#5a3a7a,#1a0c30) !important; color:#ffe9b0 !important;
  box-shadow:0 0 0 2px rgba(232,184,74,.55), 0 4px 0 #2a1040, 0 8px 14px rgba(0,0,0,.4) !important;
  border:0 !important;
}
.ba-toggle .page-tab.active, .ba-toggle .ba-btn.active {
  background:linear-gradient(180deg,#fff3c0,#ffd24a 40%,#c48912) !important; color:#3a2200 !important;
  box-shadow:0 0 0 2px #ffe08a, 0 0 0 4px #5c3606, 0 5px 0 #5c3606, 0 8px 14px rgba(0,0,0,.35) !important;
}

/* room-complete panel: trophy inside, frame not cropped */
.meta-task {
  border-image: var(--f-card) 64 / 22px / 0 stretch !important; /* no outset — avoids left crop */
}
.meta-task.done {
  overflow: visible !important;
  padding: 12px 14px !important;
  margin: 8px 4px !important; /* body already has 12px pad; keep frame fully inside */
}
.meta-body {
  padding-left: 14px !important;
  padding-right: 14px !important;
  overflow-x: hidden; /* clip nothing of ours; frames stay inside via pad */
}
.meta-task.done .mt-text { overflow: visible; min-width: 0; }
.meta-task .mt-art, .meta-task .mt-ico, .meta-task .mt-trophy { overflow: visible; }
.mt-trophy {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border-radius: 14px; font-size: 28px; line-height: 1;
  background: linear-gradient(180deg, #fff8d0 0%, #ffd24a 40%, #c48912 70%, #7a4a08 100%);
  box-shadow: 0 0 0 2px #ffe08a, 0 0 0 4px #5c3606, inset 0 2px 0 rgba(255,255,255,.55), 0 4px 8px rgba(0,0,0,.45);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}

/* keep action-icon row above the fold on short phones */
@media (max-height: 760px) {
  /* scene height budget ≈ app-h - 470 so bubble+bar+task+icons fit */
  .meta-scene { width: min(calc(100% - 16px), calc((var(--app-h) - 470px) * 0.75)) !important; }
  #meta-body > .rico-bubble, #meta-body > .mira-bubble { margin: 4px 6px 2px; padding: 5px 8px; }
  .rico-bubble .rico-face { width: 44px; height: 44px; }
  .rico-bubble .rb-text { font-size: 12px; line-height: 1.25; }
  .meta-progress { margin: 3px 6px !important; }
  .meta-task { margin: 3px 8px !important; padding: 8px 10px !important; row-gap: 6px; }
  .meta-task .mt-ico, .meta-task .mt-trophy { width: 48px; height: 48px; }
  .meta-task .btn { min-height: 38px; font-size: 14px; --cap: 18px; }
  .meta-items { margin: 0 0 2px !important; padding: 4px 6px 6px !important; gap: 6px !important; }
  .meta-items .mi { flex: 0 0 48px; padding: 2px !important; }
  .meta-items .mi small { font-size: 9px !important; }
  .ba-toggle { margin: 4px 6px 2px; gap: 8px; }
  .ba-toggle .ba-btn { min-height: 38px; min-width: 96px; padding: 7px 12px !important; font-size: 13px !important; }
  .meta-story { margin: 4px; font-size: 12px; }
}
@media (max-height: 680px) {
  .meta-scene { width: min(calc(100% - 16px), calc((var(--app-h) - 455px) * 0.75)) !important; }
  .meta-story { display: none; }
  #meta-body > .rico-bubble .rb-text { font-size: 11.5px; }
}

/* Rico dialogue bubble */
.rico-bubble { display:flex; gap:10px; align-items:flex-start; margin:8px 8px 6px;
  padding:10px 12px; border-radius:18px;
  background:linear-gradient(160deg, rgba(60,30,90,.95), rgba(20,10,40,.95));
  box-shadow:0 0 0 2px rgba(232,184,74,.5), 0 6px 14px rgba(0,0,0,.4); }
.rico-bubble .rico-face { width:56px; height:56px; flex:none; border-radius:50%;
  box-shadow:0 0 0 2px #e8b84a, 0 4px 10px rgba(0,0,0,.4); background-size:300% 300%; display:inline-block; }
.rico-bubble .rb-text { flex:1; font:700 13.5px/1.35 Comfortaa,sans-serif; color:#ffe9c8; }
.rico-bubble .rb-text b { display:block; color:#ffd24a; font-size:12px; margin-bottom:2px; }

/* Мета: комната без картинки (заглушка) */
.meta-scene.placeholder .ms-before { filter: grayscale(.35) brightness(.85); }
.meta-scene.placeholder .ms-tag { background: rgba(0,0,0,.55); }

/* ========== Сложность уровней (полировка для директора) ========== */
.diff-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 4px 8px 8px; padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(60,30,90,.85), rgba(20,10,40,.9));
  box-shadow: inset 0 0 0 1.5px rgba(255,210,120,.55), inset 0 2px 0 rgba(255,255,255,.12), 0 4px 12px rgba(0,0,0,.35);
}
.diff-bar-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 7px; flex: 1; min-width: 0; }
.diff-mini {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 5px;
  border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.45);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), inset 0 -2px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,230,160,.65), 0 2px 4px rgba(0,0,0,.35);
  position: relative; overflow: hidden;
}
.diff-mini::after { content: ''; position: absolute; left: 8%; right: 8%; top: 1px; height: 42%; border-radius: 999px; background: rgba(255,255,255,.3); pointer-events: none; }
.diff-mini .dm-ico { font-style: normal; font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.diff-mini.green { background: linear-gradient(180deg, #8ff5a5, #1f9a45 60%, #0f5c27); }
.diff-mini.red { background: linear-gradient(180deg, #ff9e94, #d8342a 60%, #7a110b); }
.diff-mini.purple { background: linear-gradient(180deg, #d6b0ff, #7d3be3 60%, #3a1180); }
.diff-mini.bonus { background: linear-gradient(180deg, #fff0a0, #e5a41f 60%, #8a5510); color: #4a2a04; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.diff-info-btn {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  font-family: 'Comfortaa', system-ui, sans-serif; font-weight: 900; font-size: 15px; font-style: italic;
  color: #4a2a04; background: linear-gradient(180deg, #fff6c8, #ffc93a 55%, #a96a08);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.65), inset 0 -2px 3px rgba(0,0,0,.25), 0 0 0 1.5px #ffe08a, 0 0 0 3px #6b420e, 0 3px 8px rgba(0,0,0,.4);
}
.diff-info-btn:active { transform: scale(.94); }

/* Значок сложности на узле карты */
.lvl-dot .tier-ico {
  position: absolute; top: -7px; left: -6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #e0a432 70%);
  box-shadow: 0 0 0 1.5px #5c3606, 0 2px 4px rgba(0,0,0,.5); filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.lvl-dot.red { box-shadow: 0 0 0 2.5px #ffe08a, 0 0 0 4.5px #6b420e, inset 0 4px 0 rgba(255,255,255,.5), inset 0 -8px 12px rgba(0,0,0,.35), 0 8px 14px rgba(0,0,0,.55), 0 0 18px 2px rgba(255,80,60,.45); }
.lvl-dot.purple { box-shadow: 0 0 0 2.5px #ffe08a, 0 0 0 4.5px #6b420e, inset 0 4px 0 rgba(255,255,255,.5), inset 0 -8px 12px rgba(0,0,0,.35), 0 8px 14px rgba(0,0,0,.55), 0 0 22px 4px rgba(160,90,255,.55); }
.lvl-dot.bonus { box-shadow: 0 0 0 2.5px #fff4c0, 0 0 0 4.5px #6b420e, inset 0 4px 0 rgba(255,255,255,.55), inset 0 -8px 12px rgba(0,0,0,.3), 0 8px 14px rgba(0,0,0,.55), 0 0 24px 5px rgba(255,200,60,.6); }
.lvl-dot.green.current { box-shadow: 0 0 0 3px #fff4c0, 0 0 0 5.5px #e0a432, 0 0 26px 8px rgba(120,255,140,.55), 0 8px 14px rgba(0,0,0,.55); }

/* Чип в HUD / победе */
.diff-chip .dc-ico { font-style: normal; margin-right: 2px; }

/* Попап старта уровня */
.sheet-start { text-align: center; overflow: visible; }
.start-stage { position: relative; z-index: 1; }
.diff-badge {
  position: relative; width: 88px; height: 88px; margin: 2px auto 10px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px #ffe08a, 0 0 0 6px #6b420e, 0 10px 22px rgba(0,0,0,.5);
}
.diff-badge .db-glow {
  position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,220,120,.55), transparent 70%);
  animation: pulseDot 1.8s ease-in-out infinite;
}
.diff-badge .db-ico { position: relative; z-index: 1; font-size: 42px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.diff-badge.green { background: radial-gradient(circle at 40% 30%, #8ff5a5, #23a94c 55%, #0f5c27); }
.diff-badge.red { background: radial-gradient(circle at 40% 30%, #ff9e94, #d8342a 55%, #7a110b); }
.diff-badge.purple { background: radial-gradient(circle at 40% 30%, #d6b0ff, #7d3be3 55%, #3a1180); }
.diff-badge.bonus { background: radial-gradient(circle at 40% 30%, #fff6c8, #ffc93a 50%, #a96a08); }

.sheet h2.ribbon.diff-ribbon.green { background: linear-gradient(180deg, #8ff5a5, #23a94c 55%, #0f5c27); color: #fff; }
.sheet h2.ribbon.diff-ribbon.green::before, .sheet h2.ribbon.diff-ribbon.green::after { background: linear-gradient(180deg, #1a7a38, #0a3a18); }
.sheet h2.ribbon.diff-ribbon.red { background: linear-gradient(180deg, #ff9b8e, #e0402f 55%, #8e1a10); color: #fff; }
.sheet h2.ribbon.diff-ribbon.red::before, .sheet h2.ribbon.diff-ribbon.red::after { background: linear-gradient(180deg, #c22a1c, #6a0f08); }
.sheet h2.ribbon.diff-ribbon.purple { background: linear-gradient(180deg, #d6b0ff, #7d3be3 55%, #3a1180); color: #fff; }
.sheet h2.ribbon.diff-ribbon.purple::before, .sheet h2.ribbon.diff-ribbon.purple::after { background: linear-gradient(180deg, #5a22b0, #2a0a60); }
.sheet h2.ribbon.diff-ribbon.bonus { background: linear-gradient(180deg, #fff6c8, #ffc93a 55%, #a96a08); color: #4a2a04; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.sheet h2.ribbon.diff-ribbon.bonus::before, .sheet h2.ribbon.diff-ribbon.bonus::after { background: linear-gradient(180deg, #c48a18, #6a4508); }

.diff-hint { margin: 6px 12px 4px !important; font-size: 14px; line-height: 1.35; color: #ffeccc; font-weight: 700; }
.start-theme { margin: 0 !important; font-size: 13px; opacity: .85; font-weight: 800; color: #ffdca8; }
.start-meta { margin: 4px 0 0 !important; font-size: 13px; font-weight: 800; color: #ffe2b0; }
.start-reward { margin: 6px 0 0 !important; font-size: 12px; }

/* Лист «О сложности» */
.sheet-diffleg { text-align: center; }
.diff-lead { margin: 0 4px 10px !important; font-size: 13px; opacity: .9; }
.diff-legend-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; text-align: left; }
.dl-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.28));
  box-shadow: inset 0 0 0 1.5px rgba(255,210,120,.4), inset 0 2px 0 rgba(255,255,255,.1);
}
.dl-row b { display: block; font-size: 14px; color: #fff6cc; font-weight: 900; }
.dl-row small { display: block; font-size: 11.5px; line-height: 1.3; color: #ffeccc; opacity: .9; font-weight: 700; margin-top: 2px; }
.dl-badge {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 0 0 2px #ffe08a, 0 0 0 3.5px #6b420e, 0 4px 8px rgba(0,0,0,.4);
}
.dl-badge.green { background: radial-gradient(circle at 40% 30%, #8ff5a5, #23a94c 55%, #0f5c27); }
.dl-badge.red { background: radial-gradient(circle at 40% 30%, #ff9e94, #d8342a 55%, #7a110b); }
.dl-badge.purple { background: radial-gradient(circle at 40% 30%, #d6b0ff, #7d3be3 55%, #3a1180); }
.dl-badge.bonus { background: radial-gradient(circle at 40% 30%, #fff6c8, #ffc93a 50%, #a96a08); }
.dl-badge i { font-style: normal; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.dl-notes {
  display: flex; flex-direction: column; gap: 4px; margin: 0 4px 4px;
  font-size: 12px; font-weight: 800; color: #ffe2b0; opacity: .9; text-align: left;
}

@media (max-width: 370px) {
  .diff-mini b { font-size: 10px; }
  .diff-mini { padding: 2px 6px 2px 4px; }
  .diff-bar { gap: 5px; padding: 5px 6px; }
}

/* 10.11: закрытый буст — откроется на уровне N */
.boost.locked { opacity: .45; filter: grayscale(.7); }
.boost.locked .bc { font-size: 10px; }

/* задача 82: значок «Дом» светится, когда искр хватает */
.hbtn.meta-btn.home-glow {
  box-shadow: 0 0 0 2px #ffe08a, 0 0 18px 6px rgba(255, 200, 80, .75), 0 6px 14px rgba(0,0,0,.45);
  animation: homeGlowPulse 1.6s ease-in-out infinite;
}
.hbtn.meta-btn.home-glow img {
  filter: drop-shadow(0 0 6px rgba(255, 220, 120, .95));
}
@keyframes homeGlowPulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffe08a, 0 0 14px 4px rgba(255, 200, 80, .55), 0 6px 14px rgba(0,0,0,.45); }
  50% { box-shadow: 0 0 0 3px #fff4c0, 0 0 26px 8px rgba(255, 220, 110, .9), 0 6px 14px rgba(0,0,0,.45); }
}



/* Win-panel piggy flight badge (safe inside sheet) */
.sheet-win { position: relative; }
.win-piggy-slot {
  position: absolute !important;
  right: 12px !important;
  top: 36px !important;
  left: auto !important;
  width: 100px !important;
  height: 118px !important;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}
.win-piggy-slot .win-piggy-mount,
.win-piggy-slot .piggy-anim {
  width: 100% !important;
  max-width: 100px !important;
  margin: 0 !important;
  transform-origin: top center;
}
#piggy-fx-host.piggy-fx-host {
  position: absolute;
  pointer-events: none;
  z-index: 6;
  opacity: 1;
}
#piggy-fx-host.piggy-fx-fixed {
  position: fixed;
}
.toast.toast-top {
  bottom: auto !important;
  top: calc(var(--safe-top) + var(--content-top) + 12px) !important;
  z-index: 80 !important;
}

.piggy-art#piggy-anim-mount,
#piggy-anim-mount.piggy-art {
  width: min(280px, 72vw);
  height: auto;
  min-height: 220px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  filter: none;
  margin: 0 auto 4px;
  padding: 0;
}

/* ===== HOME LAYOUT (task 85): no overlaps at 667 / 740 / 852 =====
   Главный экран — обычный поток сверху вниз: шапка → Рико → тема → «Играть» → путь саги → кнопки.
   Ничего не липкое и не абсолютное поверх соседей; на низких экранах всё ужимается, остаток — прокрутка. */
#screen-home.active { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: 0 0 6px; }
#screen-home > * { flex-shrink: 0; }

/* — ресурсы — */
#screen-home .res-bar { gap: 4px; margin: 2px 0 4px; }
#screen-home .res.res-btn { flex: 1 1 auto !important; min-width: 0; height: 40px; padding: 0 4px 0 2px !important; gap: 2px; }
#screen-home .res-btn .res-ico { width: 32px !important; height: 32px !important; margin: -4px -1px -4px -5px !important; }
#screen-home .res-btn .res-v { flex: 1 0 auto; min-width: 0; overflow: visible; justify-content: center; }
#screen-home .res-btn .res-v b { font-size: 15px !important; line-height: 1.05; max-width: none !important; overflow: visible !important; letter-spacing: -.02em; white-space: nowrap; }
#screen-home .res-btn .res-plus { flex: none !important; width: 20px; height: 20px; font-size: 16px; margin: 0 0 0 2px !important; }
#screen-home .res-v small.regen { font-size: 9px; line-height: 1.15; max-width: none; white-space: nowrap; overflow: visible; letter-spacing: -.02em; }
#screen-home .res-piggy .res-v small.pg-max { display: block; font-size: 10px; line-height: 1.15; font-weight: 700; color: #ffd9a0; white-space: nowrap; max-width: none; overflow: visible; }
#screen-home .res-piggy .res-v small.pg-max i { font-style: normal; }
#screen-home .gear-btn { flex: none; width: 36px !important; height: 36px !important; }
#screen-home .gear-btn img { width: 27px; height: 27px; }

/* — шапка: логотип, подзаголовок, Рико с репликой сбоку — */
#screen-home .home-head { margin: 0; }
#screen-home .home-head .logo.logo-img:not(.sp-logo) { width: min(52vw, 190px); margin: 0 auto; }
#screen-home .subtitle { margin: 2px 0 4px; font-size: 14px; line-height: 1.2; }
#screen-home .rico-home-wrap { flex-direction: row; justify-content: center; align-items: center; gap: 10px; max-width: 350px; margin: 4px auto 0; }
#screen-home .rico-home, #screen-home .rico-home-wrap .rico-face { width: 68px !important; height: 68px !important; border-radius: 18px; }
#screen-home #rico-home-bubble { display: block; flex: 0 1 auto; max-width: 230px; max-height: none; overflow: visible; margin: 0; padding: 8px 12px;
  font: 700 12.5px/1.3 Comfortaa, system-ui, sans-serif; text-align: left; white-space: normal; }
#screen-home #rico-home-bubble:empty { display: none; }

/* — тема и «Играть» — */
#screen-home .theme-banner { margin: 8px 6px 0; }
#screen-home .play-btn { margin: 10px auto 0; }

/* — путь саги — */
#screen-home .saga-title { margin: 10px 0 0 !important; font-size: 13px; line-height: 1.2; }
#screen-home .saga-path { margin: 6px 0 0 !important; }

/* — кнопки: обычный поток, верх иконок не заходит на карточки — */
#screen-home .home-actions { position: static !important; background: none !important; margin: 34px 0 0 !important; padding: 0 2px !important; row-gap: 12px !important; column-gap: 8px; }
#screen-home .hbtn.shop-btn, #screen-home .hbtn-profile { margin-top: 20px; }
#screen-home .hbtn.shop-btn, #screen-home #btn-rules { align-self: end; }
/* иконки «Магазин» / «Как играть» внутри кнопки — не заходят на соседний ряд */
#screen-home .hbtn.shop-btn img, #screen-home #btn-rules img { top: 50% !important; left: 6px !important; width: 46px !important; height: 46px !important; transform: translateY(-50%) rotate(-8deg) !important; }
#screen-home .hbtn.shop-btn:active img, #screen-home #btn-rules:active img { transform: translateY(-50%) rotate(-8deg) scale(.94) !important; }

/* иконки верхних кнопок и аватар «Профиль» не наезжают на подпись */
#screen-home .hbtn:not(.shop-btn):not(#btn-rules) img { width: 54px !important; height: 54px !important; top: -24px; }
#screen-home .home-actions #btn-profile img.menu-ava { width: 48px !important; height: 48px !important; top: -22px; }
/* 740-класс (≤ 800) */
@media (max-height: 800px) {
  #screen-home .home-head .logo.logo-img:not(.sp-logo) { width: min(42vw, 150px); }
  #screen-home .subtitle { margin: 0 0 2px; font-size: 13px; }
  #screen-home .rico-home-wrap { margin-top: 2px; }
  #screen-home .rico-home, #screen-home .rico-home-wrap .rico-face { width: 56px !important; height: 56px !important; border-radius: 15px; }
  #screen-home #rico-home-bubble { font-size: 12px; padding: 6px 10px; }
  #screen-home .theme-banner { min-height: 62px; padding: 6px 10px !important; margin-top: 6px; }
  #screen-home .tb-covers img { width: 44px !important; height: 44px !important; }
  #screen-home .tb-text .chapter-title { font-size: 22px !important; }
  #screen-home .play-btn { min-height: 60px !important; margin-top: 7px; padding-top: 7px; padding-bottom: 8px; }
  #screen-home .saga-title { margin-top: 6px !important; }
  #screen-home .saga-path { margin-top: 2px !important; }
  #screen-home .saga-card { padding: 4px 2px 5px !important; }
  #screen-home .home-actions { margin-top: 28px !important; row-gap: 10px !important; }
  #screen-home .hbtn.shop-btn, #screen-home .hbtn-profile { margin-top: 18px; }
  #screen-home .hbtn { min-height: 56px !important; padding-top: 22px !important; }
  #screen-home .hbtn:not(.shop-btn):not(#btn-rules) img { width: 46px !important; height: 46px !important; top: -22px; }
  #screen-home .home-actions #btn-profile img.menu-ava { width: 42px !important; height: 42px !important; top: -20px; }
  #screen-home .hbtn.shop-btn, #screen-home #btn-rules { min-height: 48px !important; }
  #screen-home .hbtn.shop-btn img, #screen-home #btn-rules img { width: 42px !important; height: 42px !important; }
}
/* 667-класс (≤ 700) */
@media (max-height: 700px) {
  #screen-home .home-head .logo.logo-img:not(.sp-logo) { width: min(34vw, 124px); }
  #screen-home .subtitle { display: none; }
  #screen-home .rico-home, #screen-home .rico-home-wrap .rico-face { width: 48px !important; height: 48px !important; border-radius: 13px; }
  #screen-home #rico-home-bubble { font-size: 11.5px; padding: 5px 9px; }
  #screen-home .theme-banner { min-height: 54px; padding: 4px 10px !important; }
  #screen-home .tb-covers img { width: 38px !important; height: 38px !important; }
  #screen-home .tb-text .chapter-title { font-size: 20px !important; }
  #screen-home .play-btn { min-height: 54px !important; margin-top: 6px; padding-top: 5px; padding-bottom: 6px; }
  #screen-home .pl-main { font-size: 28px !important; }
  #screen-home .saga-card .sc-state { display: none; }
  #screen-home .home-actions { margin-top: 26px !important; row-gap: 8px !important; }
  #screen-home .hbtn.shop-btn, #screen-home .hbtn-profile { margin-top: 16px; }
  #screen-home .hbtn { min-height: 52px !important; padding-top: 20px !important; }
  #screen-home .hbtn:not(.shop-btn):not(#btn-rules) img { width: 42px !important; height: 42px !important; top: -20px; }
  #screen-home .home-actions #btn-profile img.menu-ava { width: 38px !important; height: 38px !important; top: -18px; }
  #screen-home .hbtn.shop-btn, #screen-home #btn-rules { min-height: 44px !important; }
  #screen-home .hbtn.shop-btn img, #screen-home #btn-rules img { width: 40px !important; height: 40px !important; }
}


/* Тост: не больше двух строк, не перекрывает кнопки окна (z ниже pack-оверлеев, очередь в JS) */
.toast {
  max-width: min(320px, 86vw) !important;
  line-height: 1.25 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  padding: 8px 14px !important;
}
.overlay:not(.hidden) ~ #toast:not(.hidden) {
  /* если тост всё же показан при окне (поля ввода) — только сверху */
  bottom: auto !important;
  top: calc(var(--safe-top, 0px) + 10px) !important;
}

/* Дом: попредметные слои (base = state0, слой = действие).
   Нельзя ставить inset:!important — он перебивает inline left/top/width/height. */
.meta-scene.layered img.ms-layer {
  position: absolute;
  inset: unset;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  object-fit: fill;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s;
}
.meta-scene.layered img.ms-layer.on { opacity: 1; }
.meta-scene.layered img.ms-layer.reveal { animation: revealPiece 1.1s ease-out both; }
.meta-scene.show-before img.ms-layer { opacity: 0 !important; animation: none !important; }

/* Тост: вертикальные поля — прозрачной рамкой, чтобы обрезка по 2 строкам не показывала
   кусок третьей строки в нижнем поле; ширина по тексту (раньше left:50% сужал до полэкрана). */
.toast {
  padding: 0 14px !important;
  border-top: 8px solid transparent !important;
  border-bottom: 8px solid transparent !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
}
/* 23.11: в окне победы рамки крайних плашек (бусты/монеты/искры) не обрезаются на 390 px */
.sheet-win .win-stats { margin: 4px 8px 2px !important; }

/* 30.11 аудит: на узких телефонах (320 px) шестой буст «Заморозка» уходил за край экрана */
.boosts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.boost { min-width: 0; }
@media (max-width: 345px) {
  .boosts { gap: 2px; }
  .boost .bi { width: 40px; height: 40px; }
  .boost .bi img.bico, .boost img.bico { width: 25px; height: 25px; }
  .boost .bc { right: calc(50% - 25px); }
  html body #boosts .bn, html body .boosts .bn { font-size: 11.5px !important; letter-spacing: -.3px !important; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
}
