/* ——— праздник улучшения (js/anim/celebrate.js, 07.11.2026; аудит графики geroi-05, geroi-06, zamok-08) и докрутка
   чисел (js/anim/count.js). Окно — как «Получено» (css/itemcell.css .lo-wrap): без рамки и шапки, во весь экран,
   тёмный фон. Сверху крупная картинка, за ней (.cb-back — точка в её середине) столб света, лучи (второй слой —
   у силы 4–5), ореол и кольцо вспышки; по бокам — стрелки вверх (уровень, ранг), у основания — пыль (постройка); лента
   с заголовком (своя ui.ribbon_* — класс .art), имя, число «было → стало» или ряд звёзд, строки, подсказка внизу.
   Классы коробки: .cb-intro — появление ведёт js (ещё не показанное прозрачно, показанное — .cb-in), .cb-done — итог
   (лучи медленно повернутся раз, ореол подышит, картинка покачается, подсказка помигает — всё конечное, docs/ANIM.md
   §2.1а), .cb-still — «уменьшить движение»: сразу итог, без движения. «Эконом» (html.kod-lo) — без размытия и вращения.
   Размеры — в пикселях сцены: лёжа 1280×720, стоя (body.vertical) 720×H — всё крупнее. Малый праздник на месте —
   .cb-pop (внизу) ——— */
/* фон: тёмная виньетка; размытие экрана позади — только на «Богатой» ступени (.cb-blur, js): под праздником всё время
   что-то движется, и размытие во весь экран пересчитывается каждый кадр (замер /trace без видеокарты: 25 кадров за 3 с
   против 77 без него) */
#app > .modal-wrap.cb-wrap { background: radial-gradient(circle at 50% 38%, rgba(16, 20, 32, 0.8), rgba(4, 6, 10, 0.93) 70%); cursor: pointer; }
@supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
  #app > .modal-wrap.cb-wrap.cb-blur { background: rgba(6, 8, 14, 0.72); -webkit-backdrop-filter: blur(8px) saturate(0.7); backdrop-filter: blur(8px) saturate(0.7); }
  html:is(.kod-still, .kod-lo) #app > .modal-wrap.cb-wrap { background: rgba(6, 8, 14, 0.86); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
#app .modal.cb-modal {
  position: relative; width: 100%; height: 100%; max-width: none; max-height: none;
  padding: var(--sat, 0px) var(--sar, 0px) var(--sab, 0px) var(--sal, 0px);
  border: 0; border-image: none; border-radius: 0; background: none; box-shadow: none; animation: none; color: #fff;
}
#app .modal.cb-modal > .modal-title { display: none; }
#app .modal.cb-modal > .modal-body { display: flex; padding: 0; overflow: auto; overflow-x: hidden; }
html:not(.kod-still) #app > .modal-out.cb-wrap > .modal.cb-modal { animation: cb-out 0.15s ease-in forwards; }

.cb-box {
  --aw: 250px; --ah: 250px; /* место картинки */
  --rc: rgba(255, 232, 170, 0.62); /* цвет лучей */
  --rb1: #6a9ee0; --rb2: #2c5596; --rbe: #23467e; /* лента кодом: верх, низ, концы */
  --rbf: 30px; /* надпись ленты */
  position: relative; box-sizing: border-box; width: 100%; min-height: 100%; margin: auto; padding: 16px 24px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; text-align: center;
  overflow: hidden; isolation: isolate;
}
/* свободное место делят поле над картинкой (1) и подсказка (1.5) — лента примерно на трети высоты */
.cb-box::before { content: ''; flex: 1 1 0; }
/* пятно цвета свечения за всем (не мешает касаниям) */
.cb-box::after {
  content: ''; position: absolute; left: 50%; top: 38%; z-index: -1; width: 1300px; height: 1300px; margin: -650px 0 0 -650px;
  border-radius: 50%; pointer-events: none; opacity: 0.16; background: radial-gradient(closest-side, var(--cc, #ffd77a), rgba(0, 0, 0, 0));
}
.cb-k-skill { --aw: 210px; --ah: 210px; --rc: rgba(170, 220, 255, 0.55); }
.cb-box.cb-tall { --aw: 210px; --ah: 288px; }
.cb-k-hatch { --aw: 290px; --ah: 290px; }
/* лента по виду: синяя — уровень и навык, красная — звезда, дракон, ранг, оранжевая — постройка */
.cb-k-star, .cb-k-hatch, .cb-k-rank { --rb1: #e0584a; --rb2: #9a2222; --rbe: #6e1616; }
.cb-k-build { --rb1: #f2a040; --rb2: #b8641a; --rbe: #8a4a12; }
.cb-k-hatch { --rc: rgba(255, 196, 120, 0.62); }

/* ——— картинка и всё, что за ней ——— */
/* место картинки — без своего z-index (не отдельный контекст наложения): звёздочки и стрелки (z 6) рисуются поверх
   ленты и чисел — лента, имя и строки не выносятся в слои «из-за перекрытия» с ними (/layers) и не перестраиваются,
   когда звёздочки гаснут */
.cb-stage {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  width: 100%; height: var(--ah); margin-bottom: -16px; pointer-events: none;
}
.cb-back { position: absolute; left: 50%; top: 50%; z-index: 0; width: 0; height: 0; }
.cb-art { position: relative; z-index: 1; display: block; width: var(--aw); height: var(--ah); }
.cb-k-build .cb-art { transform-origin: 50% 100%; } /* падает и сплющивается от основания */
/* покачивание итога — своим слоем с самого начала: слой не появляется в конце появления (иначе картинка
   перерисовывается заново ровно тогда, когда игрок на неё смотрит) */
.cb-float { position: relative; display: block; width: 100%; height: 100%; will-change: transform; }
.cb-pic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cb-img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.6)); }
img.cb-img { opacity: 0; transition: opacity 0.2s; }
img.cb-img.on { opacity: 1; }
/* нет картинки — значок линией в медальоне */
.cb-code.cb-img {
  display: flex; align-items: center; justify-content: center; width: min(100%, var(--ah)); height: auto; aspect-ratio: 1 / 1;
  border-radius: 50%; filter: none; background: radial-gradient(circle at 50% 36%, #4c6c98, #1b2a44 72%);
  box-shadow: inset 0 0 0 6px #e2b866, inset 0 0 0 10px #5a3c12, 0 0 30px var(--cc, #ffd77a), 0 12px 26px rgba(0, 0, 0, 0.6);
}
.cb-code svg { width: 62%; height: 62%; }
/* старый портрет jpg (адрес pic, не слот) — карточкой в золотой рамке */
.cb-card .cb-pic img.cb-img { object-fit: cover; border-radius: 14px; filter: none; box-shadow: 0 0 0 4px #e2b866, 0 0 0 8px #4a3010, 0 16px 30px rgba(0, 0, 0, 0.65); }

.cb-rays, .cb-glow, .cb-pillar, .cb-ring { position: absolute; left: 0; top: 0; pointer-events: none; }
.cb-rays { width: 720px; height: 720px; margin: -360px 0 0 -360px; }
.cb-rays::before, .cb-glow::before { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.cb-rays::before {
  background: repeating-conic-gradient(from 0deg, var(--rc) 0deg 7deg, rgba(255, 232, 170, 0) 7deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 10%, rgba(0, 0, 0, 0.55) 36%, transparent 68%);
  mask: radial-gradient(circle, #000 10%, rgba(0, 0, 0, 0.55) 36%, transparent 68%);
}
.cb-rays2 { width: 560px; height: 560px; margin: -280px 0 0 -280px; opacity: 0.8; }
.cb-rays2::before { background: repeating-conic-gradient(from 11deg, rgba(255, 255, 255, 0.55) 0deg 3deg, rgba(255, 255, 255, 0) 3deg 15deg); }
.cb-glow { width: 380px; height: 380px; margin: -190px 0 0 -190px; }
.cb-glow::before { opacity: 0.78; background: radial-gradient(circle, rgba(255, 250, 230, 0.95) 0%, var(--cc, #ffd77a) 30%, rgba(0, 0, 0, 0) 68%); }
/* столб света: снизу от картинки вверх, края и верх тают */
.cb-pillar {
  width: 240px; height: 1100px; margin-left: -120px; top: calc(var(--ah) * 0.5 + 30px - 1100px); transform-origin: 50% 100%; opacity: 0.5;
  will-change: transform, opacity;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 6%, var(--cc, #ffd77a) 34%, #fffbe8 50%, var(--cc, #ffd77a) 66%, rgba(255, 255, 255, 0) 94%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.85) 40%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.85) 40%, transparent 100%);
}
.cb-ring {
  width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%; box-sizing: border-box;
  border: 6px solid var(--cc, #ffd77a); box-shadow: 0 0 26px var(--cc, #ffd77a), inset 0 0 18px var(--cc, #ffd77a);
}

/* мерцающие звёздочки вокруг картинки (места — js, по золотому углу) */
.cb-tw {
  position: absolute; left: 50%; top: 50%; z-index: 6; width: calc(var(--aw) * 1.9); height: calc(var(--ah) * 1.5);
  margin: calc(var(--ah) * -0.75) 0 0 calc(var(--aw) * -0.95); pointer-events: none;
}
.cb-tw > i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  opacity: 0; background: radial-gradient(circle, #fff 0 16%, var(--cc, #ffd77a) 34%, rgba(255, 255, 255, 0) 64%);
  clip-path: polygon(50% 0, 59% 41%, 100% 50%, 59% 59%, 50% 100%, 41% 59%, 0 50%, 41% 41%);
}
/* стрелки вверх по бокам (уровень, ранг) */
.cb-up { position: absolute; top: 50%; z-index: 6; width: 0; height: 0; pointer-events: none; }
.cb-up.l { left: calc(50% - var(--aw) * 0.5 - 44px); }
.cb-up.r { left: calc(50% + var(--aw) * 0.5 + 44px); }
.cb-up > i {
  position: absolute; left: -26px; top: 30px; width: 52px; height: 52px; box-sizing: border-box; opacity: 0;
  border: solid #8ff09c; border-width: 12px 0 0 12px; border-radius: 6px 0 0 0; transform: rotate(45deg);
  filter: drop-shadow(0 0 6px rgba(80, 220, 110, 0.9));
}
.cb-up > i:nth-child(2) { --dl: 0.24s; }
.cb-up > i:nth-child(3) { --dl: 0.48s; }
.cb-up.r > i { --dl: 0.12s; }
.cb-up.r > i:nth-child(2) { --dl: 0.36s; }
.cb-up.r > i:nth-child(3) { --dl: 0.6s; }
/* пыль у основания (постройка упала) */
.cb-dust { position: absolute; left: 50%; bottom: 6%; z-index: 2; width: 0; height: 0; pointer-events: none; }
.cb-dust > i {
  position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(222, 204, 168, 0.92), rgba(170, 150, 118, 0));
}
.cb-dust > i:nth-child(1) { --dx: -250px; --dy: -24px; }
.cb-dust > i:nth-child(2) { --dx: 250px; --dy: -24px; }
.cb-dust > i:nth-child(3) { --dx: -150px; --dy: -70px; }
.cb-dust > i:nth-child(4) { --dx: 150px; --dy: -70px; }
.cb-dust > i:nth-child(5) { --dx: -60px; --dy: -110px; }
.cb-dust > i:nth-child(6) { --dx: 60px; --dy: -110px; }
.cb-dust > i:nth-child(7) { --dx: 0px; --dy: 10px; }

/* навык — значок в круглом гнезде */
.cb-k-skill .cb-float {
  border-radius: 50%; background: radial-gradient(circle at 50% 40%, #33548a, #13213a 72%);
  box-shadow: 0 0 0 8px #e2b866, 0 0 0 13px #5a3c12, 0 0 40px var(--cc, #7cc8ff), 0 14px 30px rgba(0, 0, 0, 0.6);
}
.cb-k-skill .cb-pic { inset: 17%; }
.cb-k-skill .cb-pic .cb-img { border-radius: 22%; filter: none; }
.cb-k-skill .cb-code.cb-img { box-shadow: none; background: none; }

/* вылупление: яйцо в гнезде, свет из трещин, трещины разгораются; потом — дракончик, осколки, вспышка */
.cb-egg { position: absolute; inset: 0; transform-origin: 52% 80%; }
.cb-egg-pic { position: absolute; inset: 0; }
.cb-egg .cb-egg-code {
  display: block; width: 56%; height: 74%; margin: 4% auto 0; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 38% 30%, #ffd9a0 0%, #e0703a 30%, #a8321c 65%, #5a1608 100%);
  box-shadow: inset -10px -14px 24px rgba(60, 10, 0, 0.6), 0 12px 24px rgba(0, 0, 0, 0.6);
}
.cb-leak {
  position: absolute; left: 14%; top: -6%; width: 76%; height: 90%; border-radius: 50%; pointer-events: none;
  opacity: var(--leak, 0); transition: opacity 0.25s ease-out; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 250, 220, 0.95), rgba(255, 190, 80, 0.7) 45%, rgba(255, 120, 30, 0));
}
.cb-cracks {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 0 3px #ffd36a) drop-shadow(0 0 8px #ff8a2a);
}
.cb-cracks path {
  fill: none; stroke: #fffbe6; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 0.28s ease-out, opacity 0.08s;
}
.cb-cracks path.on { stroke-dashoffset: 0; opacity: 1; }
.cb-k-hatch .cb-pic { opacity: 0; }
.cb-k-hatch.cb-hatched .cb-pic { opacity: 1; }
.cb-hatched .cb-egg { opacity: 0; }
.cb-shard { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cb-shard > img, .cb-shard > span { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 1; }
.cb-flash {
  position: absolute; inset: 0; z-index: 9; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 36%, #fff 0%, rgba(255, 250, 230, 0.95) 30%, rgba(255, 224, 160, 0.55) 70%, rgba(255, 210, 140, 0.3));
}

/* ——— лента, имя, числа, звёзды, строки, подсказка ——— */
.cb-ribbon { position: relative; z-index: 3; display: flex; justify-content: center; max-width: 92%; }
.cb-ribbon > b {
  position: relative; z-index: 1; display: block; box-sizing: border-box; min-width: 420px; max-width: 100%; padding: 12px 64px;
  border-radius: 6px; background: linear-gradient(var(--rb1) 0%, var(--rb2) 100%); border: 3px solid #e2b866;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 10px 22px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  font: 700 var(--rbf, 30px)/1.15 var(--sans); color: #fff; letter-spacing: 0; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 3px rgba(0, 0, 0, 0.7);
  overflow-wrap: anywhere;
}
.cb-ribbon::before, .cb-ribbon::after {
  content: ''; position: absolute; top: 14px; bottom: -12px; width: 50px; z-index: 0; box-sizing: border-box;
  background: linear-gradient(var(--rb2), var(--rbe)); border: 3px solid #c99a4a;
}
.cb-ribbon::before { left: -30px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%); }
.cb-ribbon::after { right: -30px; clip-path: polygon(0 0, 100% 0, 66% 50%, 100% 100%, 0 100%); }
.cb-ribbon.art::before, .cb-ribbon.art::after { display: none; }
.cb-ribbon.art > b { border-color: transparent; box-shadow: none; border-radius: 0; padding-inline: 84px; background: none; }
/* длинная надпись (перевод) — мельче, чтобы осталась в одну строку (js/anim/celebrate.js fitLine) */
.cb-ribbon > b.cb-fit1 { font-size: calc(var(--rbf) * 0.88); }
.cb-ribbon > b.cb-fit2 { font-size: calc(var(--rbf) * 0.76); }
.cb-pp-rib > b.cb-fit1 { font-size: 34px; }

.cb-sub {
  position: relative; z-index: 3; max-width: 92%; font: 700 30px/1.15 var(--title); color: #ffe9b8; letter-spacing: 0.5px;
  text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, 0.9); overflow-wrap: anywhere;
}
.cb-num {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 14px;
  font: 700 58px/1 var(--sans); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.6);
}
.cb-from { color: #c9d3de; font-size: 0.74em; }
.cb-to { display: inline-block; color: #ffe39a; text-shadow: 0 3px 0 #6a3e00, 0 0 18px var(--cc, #ffd77a), 0 0 4px #000; }
.cb-num.one { font-size: 46px; }

/* блик: светлая полоса пробегает по картинке и ленте один раз (класс .cb-shine — js); «наложение» светлит только
   то, что под ней, по тёмному фону её почти не видно */
.cb-glint {
  position: absolute; top: -20%; bottom: -20%; left: -45%; width: 38%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  transform: skewX(-16deg); mix-blend-mode: overlay;
}
.cb-ribbon > b { overflow: hidden; }
html:not(.kod-still) .cb-shine > b > .cb-glint { animation: cb-glint 0.85s ease-out; }
@keyframes cb-glint { 0% { opacity: 0; transform: translateX(0) skewX(-16deg); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateX(420%) skewX(-16deg); } }
/* по картинке — только по нарисованному: маска — та же картинка (--gm ставит js), полоса бежит фоном */
.cb-pic > .cb-glint {
  inset: 0; left: 0; width: auto; transform: none; mix-blend-mode: normal; opacity: 1; visibility: hidden;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 58%) no-repeat;
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-mask: var(--gm) center / contain no-repeat; mask: var(--gm) center / contain no-repeat;
}
.cb-card .cb-pic > .cb-glint { -webkit-mask-size: cover; mask-size: cover; border-radius: 14px; }
html:not(.kod-still) .cb-pic.cb-shine > .cb-glint { visibility: visible; animation: cb-glint-pic 0.9s ease-out forwards; }
@keyframes cb-glint-pic { from { background-position: 100% 0; } to { background-position: 0% 0; } }
.cb-arw { display: block; }
.cb-arw svg { display: block; width: 0.9em; height: 0.9em; filter: drop-shadow(0 0 6px rgba(80, 220, 110, 0.7)); }
[dir=rtl] :is(.cb-arw, .cb-ra) svg { transform: scaleX(-1); } /* справа налево «было → стало» идёт справа: стрелка — по ходу */

.cb-stars { position: relative; z-index: 3; display: flex; gap: 10px; }
.cb-st { position: relative; display: block; width: 64px; height: 64px; }
.cb-si {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; font: 700 56px/1 var(--sans); font-style: normal;
}
b.cb-si-off { color: #5a6474; }
b.cb-si-gold { color: #ffd34a; }
b.cb-si-red { color: #ff5a4a; }
.cb-st.s-off .cb-si-off, :is(.cb-st, .cb-st-fly).s-gold .cb-si-gold, :is(.cb-st, .cb-st-fly).s-red .cb-si-red { opacity: 1; }
.cb-st:is(.s-gold, .s-red) { filter: drop-shadow(0 0 8px rgba(255, 200, 80, 0.75)); }
.cb-st-ring {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; margin: -50% 0 0 -50%; box-sizing: border-box;
  border-radius: 50%; border: 4px solid #fff3c0; box-shadow: 0 0 14px #ffd36a; pointer-events: none; opacity: 0;
}
.cb-st-fly { position: absolute; z-index: 8; display: block; pointer-events: none; filter: drop-shadow(0 0 12px rgba(255, 220, 120, 0.95)); }

.cb-rows { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 8px; width: min(520px, 100%); }
.cb-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 10px;
  background: rgba(16, 24, 38, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  font: 700 20px/1.2 var(--sans); text-shadow: 0 1px 2px #000;
}
.cb-rl { flex: 1; min-width: 0; text-align: start; color: #d6e2f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-rf { color: #c9d3de; }
.cb-ra { display: block; flex: none; }
.cb-ra svg { display: block; }
.cb-rt { display: inline-block; color: #8ff09c; font-size: 1.2em; text-align: end; }
.cb-rd { font-style: normal; color: #173510; background: #8ff09c; border-radius: 999px; padding: 1px 9px; font-size: 0.85em; text-shadow: none; }
.cb-rd.neg { background: #ff9a8a; color: #3a1210; }

.cb-hint {
  position: relative; z-index: 3; flex: 1.5 1 auto; display: flex; align-items: flex-end; justify-content: center; margin: 0;
  padding-top: 8px; font: 700 20px/1.3 var(--sans); color: #eef3f8; text-shadow: 0 1px 2px #000, 0 0 6px #000;
  will-change: opacity; /* мигание итога — своим слоем с начала: в конце появления слои не перестраиваются */
}

/* лента, имя, число, звёзды и строки лежат над большими слоями лучей (их всё равно выносит «перекрытие») — у каждого
   свой слой с начала: короткие «подскоки» внутри (плашка разницы, звезда, число) не пересобирают общий слой */
.cb-ribbon, .cb-sub, .cb-num, .cb-stars, .cb-rows { will-change: transform; }

/* ——— появление (.cb-intro): ещё не показанное прозрачно ——— */
.cb-intro :is(.cb-art, .cb-pillar, .cb-rays, .cb-glow, .cb-tw, .cb-up, .cb-ribbon, .cb-sub, .cb-num, .cb-from, .cb-arw, .cb-stars, .cb-row, .cb-rd, .cb-hint):not(.cb-in) { opacity: 0; }
.cb-still .cb-up, .cb-still .cb-dust { display: none; }
/* разовые движения по ходу появления и конечные «вдохи» итога */
html:not(.kod-still) .cb-tw.cb-in > i { animation: cb-twinkle 1.6s ease-in-out var(--d, 0s) 3 both; }
html:not(.kod-still) .cb-up.cb-in > i { animation: cb-rise 1.1s ease-out var(--dl, 0s) 2 both; }
html:not(.kod-still) .cb-dust.cb-in > i { animation: cb-dust 0.9s ease-out both; }
html:not(.kod-still) .cb-st.cb-hit { animation: cb-starhit 0.5s cubic-bezier(0.3, 0.7, 0.4, 1.3); }
html:not(.kod-still) .cb-st-ring { animation: cb-ring 0.7s ease-out forwards; }
html:not(.kod-still):not(.kod-lo) .cb-rays.cb-in::before { animation: cb-spin 36s linear; }
html:not(.kod-still):not(.kod-lo) .cb-rays2.cb-in::before { animation: cb-spin-back 30s linear; }
html:not(.kod-still):not(.kod-lo) .cb-glow.cb-in::before { animation: cb-breathe 2.6s ease-in-out 0.8s 4; }
html:not(.kod-still) .cb-art.cb-in .cb-float { animation: cb-float 3.2s ease-in-out 1s 4; }
html:not(.kod-still) .cb-pillar.cb-in { animation: cb-pillar 2.4s ease-in-out 1.2s 4; }
html:not(.kod-still) .cb-done .cb-hint { animation: cb-pulse 1.8s ease-in-out 0.5s 6; }
@keyframes cb-twinkle { 0%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes cb-rise { 0% { opacity: 0; transform: translateY(60px) rotate(45deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-230px) rotate(45deg); } }
@keyframes cb-dust { 0% { opacity: 0.95; transform: translate(0, 0) scale(0.4); } 100% { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.9); } }
@keyframes cb-starhit { 0% { transform: scale(1.5); } 40% { transform: scale(0.88); } 70% { transform: scale(1.1); } 100% { transform: none; } }
@keyframes cb-ring { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes cb-spin { to { transform: rotate(360deg); } }
@keyframes cb-spin-back { to { transform: rotate(-360deg); } }
@keyframes cb-breathe { 50% { transform: scale(1.08); opacity: 0.6; } }
@keyframes cb-float { 50% { transform: translateY(-10px); } }
@keyframes cb-pillar { 50% { opacity: 0.3; } }
@keyframes cb-pulse { 50% { opacity: 0.45; } }
@keyframes cb-out { to { transform: scale(0.96); opacity: 0; } }

/* ——— стоя: всё крупнее (телефон 412 px — картинка ~205 px экрана, лента 24, число 55) ——— */
body.vertical .cb-box { --aw: 440px; --ah: 440px; --rbf: 44px; gap: 20px; padding: 56px 24px 44px; }
body.vertical .cb-box.cb-tall { --aw: 380px; --ah: 522px; }
body.vertical .cb-k-skill { --aw: 320px; --ah: 320px; }
body.vertical .cb-k-hatch { --aw: 540px; --ah: 540px; }
body.vertical .cb-stage { margin-bottom: -26px; }
body.vertical .cb-rays { width: 1160px; height: 1160px; margin: -580px 0 0 -580px; }
body.vertical .cb-rays2 { width: 900px; height: 900px; margin: -450px 0 0 -450px; }
body.vertical .cb-glow { width: 660px; height: 660px; margin: -330px 0 0 -330px; }
body.vertical .cb-pillar { width: 330px; height: 1600px; margin-left: -165px; top: calc(var(--ah) * 0.5 + 40px - 1600px); }
body.vertical .cb-ring { width: 500px; height: 500px; margin: -250px 0 0 -250px; }
body.vertical .cb-up > i { left: -36px; width: 72px; height: 72px; border-width: 16px 0 0 16px; }
body.vertical .cb-up.l { left: calc(50% - var(--aw) * 0.5 - 50px); }
body.vertical .cb-up.r { left: calc(50% + var(--aw) * 0.5 + 50px); }
body.vertical .cb-dust > i { left: -90px; top: -90px; width: 180px; height: 180px; }
body.vertical .cb-ribbon { max-width: 96%; }
body.vertical .cb-ribbon > b { min-width: 540px; padding: 18px 70px; }
body.vertical .cb-ribbon.art > b { padding-inline: 110px; }
body.vertical .cb-ribbon::before, body.vertical .cb-ribbon::after { top: 18px; bottom: -14px; width: 56px; }
body.vertical .cb-ribbon::before { left: -34px; }
body.vertical .cb-ribbon::after { right: -34px; }
body.vertical .cb-sub { font-size: 48px; }
body.vertical .cb-num { gap: 22px; font-size: 104px; }
body.vertical .cb-num.one { font-size: 72px; }
body.vertical .cb-stars { gap: 14px; }
body.vertical .cb-st { width: 112px; height: 112px; }
body.vertical .cb-si { font-size: 98px; }
body.vertical .cb-rows { width: min(660px, 100%); gap: 14px; }
body.vertical .cb-row { gap: 14px; padding: 16px 24px; font-size: 30px; border-radius: 14px; }
body.vertical .cb-ra svg { width: 34px; height: 34px; }
body.vertical .cb-hint { font-size: 28px; }
/* лёжа на телефоне (сцена мельче 3/4, js/ui.js fitStage → body.phone-land): надписи крупнее, промежутки теснее —
   всё по-прежнему в 720 по высоте */
body.phone-land .cb-box { --rbf: 34px; gap: 8px; padding: 10px 24px 12px; }
body.phone-land .cb-sub { font-size: 34px; }
body.phone-land .cb-num { font-size: 64px; }
body.phone-land .cb-num.one { font-size: 50px; }
body.phone-land .cb-row, body.phone-land .cb-hint { font-size: var(--fs-body); }

/* ——— малый праздник на месте (o.at: постройка на сцене): столб света, лента «Ур. N», прибавки; без затемнения и
   касаний, сам гаснет (~2,3 с). Точка (0, 0) — верх середины элемента, сдвиг — transform из js ——— */
.cb-pop { position: absolute; left: 0; top: 0; z-index: 45; width: 0; height: 0; pointer-events: none; }
.cb-pop > * { position: absolute; }
.cb-pp-pillar {
  left: -84px; top: -520px; width: 168px; height: 620px; transform-origin: 50% 100%; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 6%, var(--cc, #ffd77a) 34%, #fffbe8 50%, var(--cc, #ffd77a) 66%, rgba(255, 255, 255, 0) 94%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.85) 45%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.85) 45%, transparent 100%);
}
.cb-pp-glow {
  left: -150px; top: -150px; width: 300px; height: 300px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 250, 230, 0.95), var(--cc, #ffd77a) 32%, rgba(0, 0, 0, 0) 68%);
}
.cb-pp-up { left: 0; top: -30px; width: 0; height: 0; }
.cb-pp-up > i {
  position: absolute; left: -22px; top: 0; width: 44px; height: 44px; box-sizing: border-box; opacity: 0;
  border: solid #8ff09c; border-width: 10px 0 0 10px; border-radius: 5px 0 0 0; transform: rotate(45deg);
  filter: drop-shadow(0 0 5px rgba(80, 220, 110, 0.9));
}
.cb-pp-up > i:nth-child(1) { left: -112px; }
.cb-pp-up > i:nth-child(2) { left: 68px; --dl: 0.2s; }
.cb-pp-up > i:nth-child(3) { --dl: 0.1s; top: -40px; }
.cb-pp-rib { left: -320px; top: -236px; width: 640px; display: flex; justify-content: center; }
.cb-pp-rib > b {
  display: block; box-sizing: border-box; white-space: nowrap; padding: 10px 40px; border-radius: 6px;
  background: linear-gradient(var(--rb1, #6a9ee0), var(--rb2, #2c5596)); border: 3px solid #e2b866;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 18px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  font: 700 40px/1.1 var(--sans); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 3px rgba(0, 0, 0, 0.7);
}
.cb-pop.cb-k-star, .cb-pop.cb-k-hatch, .cb-pop.cb-k-rank { --rb1: #e0584a; --rb2: #9a2222; }
.cb-pop.cb-k-build { --rb1: #f2a040; --rb2: #b8641a; }
.cb-pp-rib.art > b { border-color: transparent; box-shadow: none; border-radius: 0; background: none; padding-inline: 78px; }
.cb-pp-gains { left: -320px; top: -140px; width: 640px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cb-g { white-space: nowrap; font: 700 36px/1.15 var(--sans); color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px #000, 0 0 12px rgba(0, 0, 0, 0.7); }
.cb-g > b { display: inline-block; color: #8ff09c; }
html:not(.kod-still) .cb-pop.cb-pp-in .cb-pp-pillar { animation: cb-pp-pillar 2.2s ease-out both; }
html:not(.kod-still) .cb-pop.cb-pp-in .cb-pp-glow { animation: cb-pp-glow 1.4s ease-out both; }
html:not(.kod-still) .cb-pop.cb-pp-in .cb-pp-rib { animation: cb-pp-rib 2.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.1s both; }
html:not(.kod-still) .cb-pop.cb-pp-in .cb-pp-gains { animation: cb-pp-gain 2s ease-out 0.4s both; }
html:not(.kod-still) .cb-pop.cb-pp-in .cb-pp-up > i { animation: cb-pp-up 1s ease-out var(--dl, 0s) 2 both; }
.cb-pop.cb-still .cb-pp-pillar { opacity: 0.45; }
.cb-pop.cb-still .cb-pp-glow { opacity: 0.55; }
html.kod-still .cb-pop .cb-pp-pillar { opacity: 0.45; }
html.kod-still .cb-pop .cb-pp-glow { opacity: 0.55; }
@keyframes cb-pp-pillar { 0% { transform: scaleY(0); opacity: 0; } 14% { transform: scaleY(1.05); opacity: 1; } 30% { transform: scaleY(1); } 70% { opacity: 0.8; } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes cb-pp-glow { 0% { transform: scale(0.2); opacity: 0; } 25% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes cb-pp-rib { 0% { transform: translateY(40px) scale(0.3); opacity: 0; } 16% { transform: translateY(-6px) scale(1.12); opacity: 1; } 26% { transform: none; } 82% { transform: none; opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
@keyframes cb-pp-gain { 0% { transform: translateY(26px) scale(0.6); opacity: 0; } 18% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@keyframes cb-pp-up { 0% { transform: translateY(40px) rotate(45deg); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-190px) rotate(45deg); opacity: 0; } }

/* ——— докрутка числа (js/anim/count.js): в конце — вспышка ——— */
/* только цвет и свечение текста (перерисовка надписи), не filter: тот выносил бы число в свой слой и обратно */
html:not(.kod-still) .cu-hit { animation: cu-hit 0.6s ease-out; }
@keyframes cu-hit { 25% { color: #fffbe8; text-shadow: 0 0 10px rgba(255, 226, 130, 0.95), 0 0 3px #fff, 0 2px 0 rgba(0, 0, 0, 0.6); } }
