/* «Ёлочка Авангарда» — сборка C, страница-небо (SPEC-C F3, F4): надпись на небе и вещь неба (sky.js), вкладка «Небо» и шесть
   вкладок «Украсить» в ряд, макушка вместо звезды, шар-копилка на поляне. Подключается после style.css, bag.css, road.css.
   Жёлтого и золотого нет. Анимации для «уменьшить движение» не урезаются (правило заказчика). CSS-размытия на небе нет:
   свечение — полупрозрачными кругами и градиентами */

/* ---------- шесть вкладок «Украсить» и «Готово» в один ряд ---------- */
.yd-tabs { grid-template-columns: repeat(6, auto); }
.yd-tabs button { padding: 0 .45em; font-size: .78rem; }
@media (max-width: 430px) {
  .yd-tabs { gap: 1px; padding: 3px; }
  .yd-tabs button { padding: 0 .28em; font-size: .74rem; min-height: 40px; }
}
.yd-done__ok { display: none; }
/* не поместились — «Готово» круглой галочкой 40 px, подпись остаётся для чтения с экрана */
.yd-tray.is-tight .yd-done { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.yd-tray.is-tight .yd-done__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.yd-tray.is-tight .yd-done__ok { display: block; width: 20px; height: 20px; background: #fff;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4.5 12.5 5 5 10-11' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* «Ёлка»: рядом с запасом игрушек — гирлянда и макушка (на широком экране — две половины) */
@media (min-aspect-ratio: 1/1) and (min-width: 720px) {
  .yd-tray[data-tab="tree"] .yd-body--two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* «Небо» на широком экране: лоток шире, набор слева (подсказка в две строки, 8 столбцов «123» целиком), ряды вида и неба справа */
  .yd-tray[data-tab="sky"] { padding-left: max(0px, (100% - 56rem) / 2); padding-right: max(0px, (100% - 56rem) / 2); }
  .yd-tray[data-tab="sky"] .yd-body--two { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
}
.ys-rows > .yd-group + .yd-group { margin-top: 4px; }
/* «Ёлка» на узком экране: «Гирлянда на ёлку» и «Макушка» — двумя половинами в одну строку (лоток не выше прежнего: ёлка
   над ним видна целиком); каждая половина листается сама */
@media (max-aspect-ratio: 9999/10000), (max-width: 719.98px) {
  .ys-rows--tree { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 4px; }
  .ys-rows--tree > .yd-group + .yd-group { margin-top: 0; }
  .ys-rows--tree .yd-row { padding-left: 8px; padding-right: 8px; }
  .ys-rows--tree .yd-label { margin-left: 12px; white-space: nowrap; }
  /* в половине ряда стрелки закрыли бы две ячейки из трёх: листается пальцем, колесом и мышью, угасающий край показывает,
     что дальше есть ещё */
  .ys-rows--tree .yd-arrow { display: none !important; }
}
/* «Небо» и ряды «Ёлки»: ячейки компактнее — лоток «Небо» самый высокий, над ним должны остаться надпись и ёлка */
.yd-tray[data-tab="sky"] .ys-rows .yd-cell { width: auto; min-width: 4.1rem; padding: 5px 7px 6px; gap: 1px; border-radius: 15px; }
.yd-tray[data-tab="sky"] .ys-rows .yd-cell__pic { width: 2.2rem; height: 2.2rem; }
.yd-tray[data-tab="sky"] .ys-rows .yd-gico svg { width: 2.4rem; }
.yd-tray[data-tab="sky"] .ys-rows .yd-cell__name { font-size: .64rem; white-space: nowrap; }
.yd-tray[data-tab="sky"] .ys-rows .yd-cell__lock { font-size: .6rem; line-height: 1; }
.yd-tray[data-tab="sky"] .ys-rows .yd-cell__lockico { width: 14px; height: 14px; right: -8px; }
.yd-tray[data-tab="sky"] .ys-rows .yd-label { margin-bottom: 1px; }
.yd-tray[data-tab="sky"] .ys-rows .yd-row { padding-bottom: 4px; }
.yd-tray[data-tab="tree"] .ys-rows .yd-cell { width: auto; min-width: 4.4rem; padding: 6px 6px 7px; gap: 2px; }
.yd-tray[data-tab="tree"] .ys-rows .yd-cell__pic { width: 2.6rem; height: 2.6rem; }
.yd-tray[data-tab="tree"] .ys-rows .yd-gico svg { width: 2.7rem; }
.yd-tray[data-tab="tree"] .ys-rows .yd-cell__name { white-space: nowrap; }
.yd-tray[data-tab="tree"] .ys-rows .yd-label { margin-bottom: 2px; }
.yd-tray[data-tab="sky"] .yd-head { margin-bottom: 6px; }
.yd-tray[data-tab="sky"] .ys-head { min-height: 0; margin-bottom: 2px; }

/* ---------- макушка вместо звезды (на тех же ступенях, где звезда) ---------- */
.yt__star.is-top { width: auto; height: 21%; max-width: 40%; transform: translate(-50%, -80%); filter: drop-shadow(0 0 calc(var(--tree-h) * .025) rgba(255, 255, 255, .7)); }

/* ---------- шар-копилка на поляне ---------- */
.yd-globe { position: absolute; padding: 0; border: 0; background: none; transform: translate(-50%, -100%); touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.yd-globe img { display: block; width: 100%; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 calc(var(--tree-h) * .012) calc(var(--tree-h) * .016) rgba(29, 18, 56, .3)); }
.yd-globe .yd-pic { transform-origin: 50% 96%; }
.yd-globe::before { content: ""; position: absolute; inset: -8px -10px -4px; }   /* зона нажатия шире картинки */
/* плашка «❄ 5» над шаром — тёмная, как на листе 9 */
.yd-globe__n { position: absolute; left: 50%; bottom: 96%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: .18em .55em .2em .4em; border-radius: 99px;
  background: #2a1a52; color: #fff; font-size: .78rem; font-weight: 800; line-height: 1.1; white-space: nowrap; box-shadow: 0 2px 0 rgba(29, 18, 56, .35), 0 0 0 2px rgba(255, 255, 255, .85); pointer-events: none; }
.yd-globe__n .ys-flake { width: 13px; height: 13px; }
.yd-globe.is-drag .yd-pic { transform: translateY(-7%) scale(1.08); transition: transform .12s; }
body.y-decorating .yd-globe::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -5%; height: calc(var(--tree-h) * .04); border: 2px dashed rgba(109, 63, 224, .75); border-radius: 50%; z-index: -1; }
body.y-decorating .yd-globe__n { display: none; }
/* снежинка значком (не знаком ❄: на iPhone он становится цветной эмодзи) */
.ys-flake { display: inline-block; flex: none; width: 1em; height: 1em; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17 20.7 7M9.5 3.5 12 6l2.5-2.5M9.5 20.5 12 18l2.5 2.5M3 10.2l3.4.9-.9 3.4M21 13.8l-3.4-.9.9-3.4M5.5 6.7l.9 3.4M18.5 17.3l-.9-3.4'/%3E%3C/svg%3E"); }
/* снежинки летят из шара к кнопке «Игрушки» */
.ys-fly { position: fixed; z-index: 60; width: 22px; height: 22px; display: grid; place-items: center; pointer-events: none; color: #7c4dff; }
.ys-fly .ys-flake { width: 22px; height: 22px; }
.ys-fly::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 40%, rgba(255, 255, 255, 0) 72%); }   /* видно и на снегу, и на небе */
/* облачко над шаром */
.ys-bubble { position: fixed; z-index: 58; max-width: min(80vw, 18rem); padding: .5em .85em .55em; border-radius: 14px; background: #fff; color: var(--ink); font-size: .82rem; font-weight: 700; line-height: 1.2;
  box-shadow: 0 3px 0 rgba(29, 18, 56, .2), 0 8px 18px rgba(29, 18, 56, .22); pointer-events: none; animation: ys-pop .26s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes ys-pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- небо: полоса надписи между шапкой и макушкой ёлки ---------- */
.ys { position: absolute; z-index: 2800; pointer-events: none; }
.ys-text, .ys-row { position: absolute; left: 0; right: 0; }
.ys-text { inset: 0; z-index: 2; }
.ys-line { position: absolute; top: 0; overflow: visible; }
/* значок вида надписи (scriptIcon) — в потоке, а не абсолютом: иначе ширина 100 % считается от листа (лента «Что нового» на ноутбуке —
   флажки «АБ» на весь лист; слияние 21.11, проверка снимков) */
.ys-line.ys-ico { position: relative; top: auto; }
.ys-t { font-family: var(--font); font-weight: 800; letter-spacing: 0; }
/* флажки покачиваются на нити */
.ys-flag { transform-box: fill-box; transform-origin: 50% 0; animation: ys-sway 2.4s ease-in-out infinite alternate; }
@keyframes ys-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
/* буквы из лампочек мигают тремя группами, как гирлянда */
.ys-bulbs { animation: ys-blink 2.6s ease-in-out infinite; }
@keyframes ys-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
/* правка в «Небо»: места строки рамкой, курсор */
.ys.is-edit { pointer-events: auto; }
.ys.is-edit .ys-row { cursor: pointer; }
.ys-frame { position: absolute; top: 0; bottom: 0; border: 2px dashed rgba(255, 255, 255, .32); border-radius: 10px; pointer-events: none; }
.ys-row.is-cur .ys-frame { border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); }
.ys-caret { position: absolute; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(109, 63, 224, .5); animation: ys-caret 1s steps(2, jump-none) infinite; pointer-events: none; }
@keyframes ys-caret { 50% { opacity: 0; } }

/* вещь на небе: у края полосы или за надписью (прозрачность 0,6) */
.ys-item { position: absolute; top: 0; z-index: 1; display: grid; place-items: center; }
.ys-item.is-behind { opacity: .6; z-index: 0; }
.ys-item > img, .ys-item > svg { display: block; width: 100%; height: 100%; object-fit: contain; }
.ys-item--moon > img { filter: drop-shadow(0 0 5px rgba(240, 236, 255, .7)); }
.ys-item--comet { animation: ys-float 6s ease-in-out infinite alternate; }
@keyframes ys-float { from { transform: translate(-3%, 2%); } to { transform: translate(3%, -3%); } }
.ys-star { animation: ys-tw 3s ease-in-out infinite; }
@keyframes ys-tw { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
/* сияние: сиреневые и зелёно-бирюзовые полосы света фоном за надписью, медленно переливаются */
.ys-aurora { position: absolute; left: -6%; right: -6%; top: -34%; bottom: -30%; z-index: 0; pointer-events: none; overflow: visible; }
.ys-aurora i { position: absolute; left: 0; right: 0; border-radius: 50%; animation: ys-aur 9s ease-in-out infinite alternate; }
.ys-aurora__a { top: 8%; height: 46%; background: radial-gradient(60% 50% at 30% 55%, rgba(110, 236, 200, .75), rgba(110, 236, 200, 0) 70%), radial-gradient(45% 50% at 72% 45%, rgba(90, 210, 220, .65), rgba(90, 210, 220, 0) 70%); }
.ys-aurora__b { top: 30%; height: 50%; background: radial-gradient(55% 50% at 60% 50%, rgba(200, 160, 255, .75), rgba(200, 160, 255, 0) 70%), radial-gradient(40% 45% at 18% 50%, rgba(180, 130, 255, .6), rgba(170, 120, 255, 0) 70%); animation-duration: 11s; animation-delay: -4s; }
.ys-aurora__c { top: 50%; height: 40%; background: radial-gradient(50% 50% at 45% 50%, rgba(120, 240, 210, .55), rgba(120, 240, 210, 0) 70%); animation-duration: 13s; animation-delay: -7s; }
@keyframes ys-aur { 0% { transform: translateX(-6%) scaleY(.85); opacity: .7; } 50% { opacity: 1; } 100% { transform: translateX(6%) scaleY(1.15); opacity: .8; } }
/* салют фоном: вспышки по очереди */
.ys-back { position: absolute; top: -30%; bottom: -20%; z-index: 0; pointer-events: none; }
.ys-back > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ys-burst { opacity: 0; animation: ys-burst 4.5s ease-out infinite; }
@keyframes ys-burst { 0% { transform: scale(.15); opacity: 0; } 5% { opacity: 1; } 30% { transform: scale(1); opacity: 1; } 58% { transform: scale(1.08); opacity: 0; } 100% { transform: scale(1.08); opacity: 0; } }
/* сани пролетают через небо раз в полминуты — над надписью */
.ys-sleigh { position: absolute; left: 0; top: -18%; width: 100%; z-index: 3; pointer-events: none; transform: translateX(-100%); animation: ys-sleigh 30s linear 2s infinite; }
.ys-sleigh img { display: block; height: 100%; width: auto; animation: ys-bob 1.2s ease-in-out infinite alternate; }
@keyframes ys-sleigh { 0% { transform: translateX(-100%); } 18% { transform: translateX(100%); } 100% { transform: translateX(100%); } }
@keyframes ys-bob { from { transform: translateY(-4%) rotate(-2deg); } to { transform: translateY(5%) rotate(2deg); } }

/* значки вещей, которые рисует код (лоток, листы вещей, лента) */
.ys-gico { display: grid; place-items: center; }
.ys-gico svg { display: block; width: 3.5rem; height: auto; max-height: 100%; overflow: visible; }
.ys-gico--aurora { position: relative; width: 3.3rem; height: 2.4rem; border-radius: 10px; background: #2a1a52; overflow: hidden; }
.ys-gico--aurora .ys-aurora { inset: -10% -8%; }
.ys-gico--aurora .ys-aurora i { animation: none; }
.yd-cell__pic .ys-gico--aurora, .y-news__pic .ys-gico--aurora { width: 100%; height: 72%; }
.y-news__pic .ys-gico { width: 100%; height: 100%; }
.y-news__pic .ys-gico svg { width: 100%; max-height: 100%; }

/* ---------- вкладка «Небо»: набор надписи ---------- */
.ys-head { flex-wrap: nowrap; }
.ys-head .yd-hint { flex: 1 1 auto; }
.ys-sets { flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--soft); }
.ys-set { min-height: 34px; padding: 0 .6em; border: 0; border-radius: 99px; background: none; font: inherit; font-size: .76rem; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.ys-set.is-on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.ys-keyswrap { padding: 2px 12px 0; }
/* лоток букв: две строки кнопок, листается вбок; высота от набора не меняется */
.ys-keys { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 40px); grid-auto-columns: 40px; gap: 6px; height: 88px; padding: 1px 2px 3px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; overscroll-behavior-x: contain; }
.ys-keys::-webkit-scrollbar { display: none; }
@media (pointer: fine) { .ys-keys { scrollbar-width: thin; scrollbar-color: #c9bdee transparent; } }
.ys-keys--empty { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-size: .78rem; font-weight: 700; color: var(--ink-2); line-height: 1.25; }
.ys-keys--empty > span { flex: 1 1 auto; min-width: 0; }
.ys-key { position: relative; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: var(--soft); box-shadow: inset 0 -3px 0 var(--line); font: inherit; color: var(--ink); cursor: pointer; touch-action: pan-x; }
.ys-key b { font-size: 1.12rem; font-weight: 800; line-height: 1; }
.ys-key i { position: absolute; right: 3px; top: 2px; font-style: normal; font-size: .58rem; font-weight: 800; color: var(--ink-2); }
.ys-key.is-rare b { color: var(--red); }
.ys-key:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--line); }
.ys-key:disabled { opacity: .38; cursor: default; transform: none; }
.ys-key--buy { background: #fff; box-shadow: inset 0 0 0 2px #c9bdee; color: var(--accent); }
.ys-key--buy b { font-size: 1.3rem; }
.ys-key--buy i { position: static; font-size: .54rem; color: var(--accent); margin-top: -6px; }
.ys-acts { display: flex; flex-wrap: nowrap; gap: 6px; padding: 8px 12px 2px; }
.ys-act:disabled { opacity: .4; cursor: default; }
.ys-act { min-height: 36px; }
.ys-ico-back { display: block; width: 22px; height: 16px; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20' fill='none' stroke='%23000' stroke-width='2.4' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M9 2h15a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H9l-7-8Z'/%3E%3Cpath d='m13 7 6 6m0-6-6 6'/%3E%3C/svg%3E"); }
#ysBack { padding: 0 .9em; }
@media (max-width: 430px) {
  .ys-head .yd-hint { font-size: .7rem; }
  .ys-set { padding: 0 .48em; font-size: .72rem; }
  .ys-acts { gap: 5px; }
  .ys-acts .yd-chip { padding-left: .62em; padding-right: .62em; font-size: .74rem; }
}
