/* Оформление «Космическое сияние». Подключается последним и переопределяет базовые стили страницы. */
:root {
  color-scheme: dark;
  --ink: #f5f2ff;
  --muted: #b9b3da;
  --paper: #141034;
  --card: rgba(255, 255, 255, .065);
  --card-hover: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .15);
  --night: #0a0822;
  --sun: #ffc65c;
  --sun-deep: #ff9f43;
  --coral: #ff5d7d;
  --mint: #2ed3a0;
  --accent: linear-gradient(120deg, #7b3ff2 0%, #c026a8 55%, #e0366f 100%);
  --accent-glow: rgba(192, 38, 168, .5);
  --gold: linear-gradient(120deg, #ffd76e, #ff9f43);
  --glass: rgba(24, 19, 66, .78);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html { scrollbar-color: rgba(255, 255, 255, .25) transparent; }
body { background: var(--night); }
::selection { background: #c026a8; color: #fff; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .22) padding-box; }

/* Панель */
#panel {
  position: relative;
  overflow: hidden;
  background: #120e30;
  box-shadow: 8px 0 44px rgba(3, 2, 20, .65);
  border-right: 1px solid rgba(255, 255, 255, .08);
}
#panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30%;
  background:
    radial-gradient(40% 32% at 20% 16%, rgba(123, 63, 242, .42), transparent 70%),
    radial-gradient(38% 30% at 86% 44%, rgba(224, 54, 111, .24), transparent 70%),
    radial-gradient(44% 34% at 26% 88%, rgba(38, 148, 214, .24), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate;
}
#panel { isolation: isolate; }
@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) rotate(0deg); }
  to { transform: translate3d(4%, 3%, 0) rotate(9deg); }
}

.brand h1 {
  background: linear-gradient(100deg, #fff 10%, #ffd76e 55%, #ff8fc4 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand svg { filter: drop-shadow(0 0 10px rgba(255, 198, 92, .75)); transition: transform .5s var(--ease); }
.brand:hover svg { transform: rotate(-10deg) scale(1.08); }

.menu-btn {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(6px);
  transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.menu-btn:hover { background: var(--card-hover); transform: translateY(-1px); }
.menu-btn.main { border-color: transparent; background: var(--gold); color: #2b1a00; box-shadow: 0 4px 18px rgba(255, 159, 67, .35); }
.menu-btn.main:hover { background: var(--gold); box-shadow: 0 6px 24px rgba(255, 159, 67, .6); }

/* Шаги */
.stepper { position: relative; border-bottom: 1px solid var(--line); }
.stepper button { color: var(--muted); transition: color .25s; }
.stepper button:hover { color: var(--ink); }
.stepper b {
  background: rgba(255, 255, 255, .09);
  border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s, background .3s;
}
.stepper button:hover b { transform: scale(1.1); }
.stepper button.done b { background: linear-gradient(135deg, #2ed3a0, #1b9fbf); border-color: transparent; color: #04261d; box-shadow: 0 0 12px rgba(46, 211, 160, .45); }
.stepper button.current { color: #fff; }
.stepper button.current b {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(192, 38, 168, .28), 0 0 22px var(--accent-glow);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  50% { box-shadow: 0 0 0 5px rgba(192, 38, 168, .14), 0 0 30px var(--accent-glow); }
}

#flightSpeedRow { border-bottom: 1px solid var(--line); }
.nav { border-top: 1px solid var(--line); background: rgba(10, 8, 34, .35); backdrop-filter: blur(10px); }

/* Появление шага */
.step:not([hidden]) { animation: rise .45s var(--ease) both; }
.step:not([hidden]) > * { animation: rise .5s var(--ease) both; }
.step:not([hidden]) > *:nth-child(2) { animation-delay: .04s; }
.step:not([hidden]) > *:nth-child(3) { animation-delay: .08s; }
.step:not([hidden]) > *:nth-child(4) { animation-delay: .12s; }
.step:not([hidden]) > *:nth-child(5) { animation-delay: .16s; }
.step:not([hidden]) > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.step h2 { letter-spacing: -.012em; }

/* Кнопки */
.btn {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform .2s var(--ease), box-shadow .25s, background .2s, border-color .2s;
}
.btn:hover:not(:disabled) { background: var(--card-hover); border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn.primary {
  border-color: transparent;
  background: var(--accent);
  background-size: 180% 100%;
  color: #fff;
  box-shadow: 0 8px 26px rgba(123, 63, 242, .4);
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent);
  background-size: 180% 100%;
  background-position: 100% 0;
  border-color: transparent;
  box-shadow: 0 10px 34px var(--accent-glow);
}
.btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .34), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.btn.primary:hover:not(:disabled)::after { animation: shine .85s var(--ease); }
@keyframes shine { to { left: 130%; } }
.btn.primary.locked, .btn.primary.locked:hover:not(:disabled) {
  background: rgba(255, 255, 255, .07);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}
.btn.active, .btn.confirming { border-color: transparent; background: linear-gradient(120deg, #ff5d7d, #ff7a45); color: #fff; }
.btn.active:hover:not(:disabled), .btn.confirming:hover:not(:disabled) { background: linear-gradient(120deg, #ff4a6d, #ff6a35); }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  transform: scale(0);
  animation: ripple .6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.text-btn { color: #ff9dc6; }
a { color: #a9c4ff; }

/* Поля */
input[type=url], select, .account-input, .set-save input {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input[type=url]::placeholder, .set-save input::placeholder { color: #9d97bf; }
input[type=url]:focus, select:focus, .account-input:focus, .set-save input:focus {
  border-color: #b079ff;
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 3px rgba(123, 63, 242, .32);
  outline: none;
}
select option { background: #1b1647; color: #f5f2ff; }
.or::before, .or::after { border-top: 1px solid var(--line); }

/* Зона загрузки */
.drop {
  position: relative;
  border: 1px dashed rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .045);
  transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
}
.drop:hover, .drop.over {
  background: rgba(123, 63, 242, .16);
  border-color: #c79bff;
  box-shadow: 0 0 30px rgba(123, 63, 242, .32), inset 0 0 26px rgba(123, 63, 242, .14);
  transform: translateY(-2px);
}
.drop svg { color: #ffc65c; filter: drop-shadow(0 0 8px rgba(255, 198, 92, .6)); transition: transform .3s var(--ease); }
.drop:hover svg { transform: translateY(-3px) scale(1.08); }
.tips li::before { color: var(--mint); }

/* Персонажи и движения */
.character-list button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .1);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.character-list button:hover { transform: translateY(-2px) scale(1.04); border-color: rgba(255, 255, 255, .4); }
.character-list button[aria-pressed=true] { border-color: #ffc65c; box-shadow: 0 0 0 2px rgba(255, 198, 92, .35), 0 0 18px rgba(255, 198, 92, .4); }
.character-list button.add { border: 1px dashed rgba(255, 198, 92, .75); background: rgba(255, 198, 92, .08); color: #ffc65c; }
.character-list button.add:hover { background: rgba(255, 198, 92, .18); }
.character-list .thumb > .remove { border-color: #141034; background: #ff5d7d; color: #fff; }
.character-list .thumb > .remove:hover { background: #ff3f65; transform: scale(1.1); }
#partList button { background: repeating-conic-gradient(#d6def0 0 25%, #f2f5fb 0 50%) 0 0/14px 14px; }

#motions button {
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform .2s var(--ease), background .2s, box-shadow .25s, border-color .2s;
}
#motions button:hover:not(:disabled) { background: var(--card-hover); transform: translateY(-2px); }
#motions button:hover:not(:disabled) i { transform: scale(1.18) rotate(-5deg); }
#motions i { display: block; transition: transform .25s var(--ease); }
#motions button[aria-pressed=true] { border-color: transparent; background: var(--accent); color: #fff; box-shadow: 0 6px 22px var(--accent-glow); }

.check, .option, .set-row { border: 1px solid var(--line); background: var(--card); }
.check { transition: background .2s; }
.check:hover { background: var(--card-hover); }
.check input, input[type=range] { accent-color: #c026a8; }
.place, #panelStatus, #tvAddress, .phone-url { background: rgba(255, 198, 92, .13); color: #ffe6b3; }
.option { transition: transform .25s var(--ease), box-shadow .25s; }
.option:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(3, 2, 20, .4); }
#panelStatus { border: 1px solid rgba(255, 198, 92, .3); backdrop-filter: blur(8px); }
#panelStatus.error { background: linear-gradient(120deg, #e0365f, #e25a2c); border-color: transparent; color: #fff; }
#panelStatus.busy::before { border-color: rgba(255, 255, 255, .25); border-top-color: #ffc65c; }

/* Ползунок */
input[type=range] { height: 22px; appearance: none; -webkit-appearance: none; background: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #7b3ff2, #c026a8 55%, #ffc65c);
}
input[type=range]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #7b3ff2, #c026a8 55%, #ffc65c);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #c026a8;
  box-shadow: 0 0 14px var(--accent-glow);
  transition: transform .15s var(--ease);
}
input[type=range]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #c026a8;
  box-shadow: 0 0 14px var(--accent-glow);
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.18); }

/* Окна */
dialog {
  border: 1px solid rgba(255, 255, 255, .16) !important;
  background: linear-gradient(160deg, rgba(38, 29, 96, .97), rgba(20, 15, 56, .98)) !important;
  color: var(--ink) !important;
  box-shadow: 0 30px 90px rgba(2, 1, 16, .7), 0 0 60px rgba(123, 63, 242, .22);
}
dialog[open] { animation: pop .35s var(--ease) both; }
dialog::backdrop { background: rgba(5, 3, 24, .68) !important; backdrop-filter: blur(7px); animation: fade .3s both; }
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } }
.phone-qr { background: #fff; box-shadow: 0 0 40px rgba(123, 63, 242, .45); }
.phone-url, #tvAddress { color: #ffe6b3; }
#subscribeError, #guestsError { color: #ff9db3; }
.perks li::marker { color: #ffc65c; }
#templateFilters button, #planButtons button { border: 1px solid var(--line); background: var(--card); transition: background .2s, transform .2s var(--ease), box-shadow .2s; }
#templateFilters button:hover, #planButtons button:hover { background: var(--card-hover); transform: translateY(-1px); }
#templateFilters button[aria-pressed=true] { border-color: transparent; background: var(--accent); color: #fff; box-shadow: 0 4px 18px var(--accent-glow); }
#planButtons button[aria-pressed=true] { border-color: #ffc65c; background: rgba(255, 198, 92, .13); box-shadow: 0 0 18px rgba(255, 198, 92, .25); }
#templateGrid button { border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
#templateGrid img { transition: transform .5s var(--ease); }
#templateGrid button:hover { transform: translateY(-3px); border-color: #c79bff; box-shadow: 0 10px 30px rgba(123, 63, 242, .45); }
#templateGrid button:hover img { transform: scale(1.07); }
#guestReview { border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); animation: pop .35s var(--ease) both; }
#guestImage { background: #fff; }

/* Экран с картинкой */
#status {
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(18, 14, 48, .72);
  color: #fff;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(2, 1, 16, .5);
  animation: status-in .35s var(--ease) both;
}
/* Подсказка центрируется сдвигом, поэтому анимация его сохраняет. */
@keyframes status-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translateX(-50%); }
}
#changeScene {
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(18, 14, 48, .68);
  color: #fff;
  backdrop-filter: blur(14px);
  transition: transform .2s var(--ease), background .2s;
}
#changeScene:hover { background: rgba(50, 36, 122, .85); transform: translateY(-2px); }
canvas#stage { animation: fade .6s both; }

/* Стартовый экран */
#empty { overflow: hidden; align-items: flex-start; padding-top: clamp(22px, 7vh, 72px); background: #16324a; }
#empty > * { z-index: 1; }
.hero-world { position: absolute; inset: 0; z-index: 0; container-type: size; }
.hero-world::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 34, .78) 0%, rgba(10, 8, 34, .46) 34%, rgba(10, 8, 34, 0) 58%);
}
/* Рамка повторяет пропорции снимка и закрывает весь экран. Рыбка лежит внутри неё и всегда остаётся на воде */
.hero-frame {
  --w: max(100cqw, 168.3cqh);
  --h: max(100cqh, 59.42cqw);
  position: absolute;
  left: calc((100cqw - var(--w)) * .5);
  top: calc((100cqh - var(--h)) * .62);
  width: var(--w);
  height: var(--h);
  container-type: size;
  transform-origin: 60% 70%;
  animation: hero-drift 34s ease-in-out infinite alternate;
}
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes hero-drift { to { transform: scale(1.07); } }
.hero-char {
  position: absolute;
  z-index: 1;
  width: auto;
  transform-origin: 50% 100%;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 12px 12px rgba(5, 14, 26, .5));
  will-change: transform;
}
/* Кот, динозавр и зайчик идут друг за другом туда и обратно, поэтому не наезжают друг на друга */
@keyframes hero-walk {
  0% { left: var(--from); scale: 1 1; }
  48% { left: var(--to); scale: 1 1; }
  50% { left: var(--to); scale: -1 1; }
  98% { left: var(--from); scale: -1 1; }
  100% { left: var(--from); scale: 1 1; }
}
@keyframes hero-step {
  from { transform: translateY(0) rotate(-1.6deg); }
  to { transform: translateY(-2.5%) rotate(1.6deg); }
}
@keyframes hero-hop {
  0%, 100% { transform: translateY(0) scale(1.08, .88); }
  14% { transform: translateY(0) scale(.95, 1.06); }
  50% { transform: translateY(-34%) scale(1, 1); }
  86% { transform: translateY(0) scale(.97, 1.03); }
}
/* Птичка летит волнами и навстречу рыбке, в другом ритме, поэтому их пути не идут параллельно */
@keyframes hero-fly-across {
  0% { left: 72%; top: var(--y); scale: -1 1; }
  16% { left: 50%; top: calc(var(--y) + 10%); }
  32% { left: 28%; top: calc(var(--y) + 3%); }
  48% { left: 6%; top: calc(var(--y) + 12%); scale: -1 1; }
  50% { left: 6%; top: calc(var(--y) + 12%); scale: 1 1; }
  66% { left: 28%; top: calc(var(--y) + 16%); }
  82% { left: 52%; top: calc(var(--y) + 4%); }
  98% { left: 72%; top: var(--y); scale: 1 1; }
  100% { left: 72%; top: var(--y); scale: -1 1; }
}
@keyframes hero-swim {
  0% { left: 16%; top: 68%; scale: 1 1; }
  12% { left: 33%; top: 70%; }
  24% { left: 50%; top: 71.5%; }
  36% { left: 67%; top: 67.5%; }
  48% { left: 84%; top: 61%; scale: 1 1; }
  50% { left: 84%; top: 61%; scale: -1 1; }
  62% { left: 67%; top: 67.5%; }
  74% { left: 50%; top: 71.5%; }
  86% { left: 33%; top: 70%; }
  98% { left: 16%; top: 68%; scale: -1 1; }
  100% { left: 16%; top: 68%; scale: 1 1; }
}
@keyframes hero-wave {
  from { transform: translateY(-16%) rotate(-5deg); }
  to { transform: translateY(16%) rotate(5deg); }
}
@keyframes hero-ripple {
  from { transform: translateY(-5%) rotate(-2.5deg); }
  to { transform: translateY(5%) rotate(2.5deg); }
}
.hero-rabbit { --from: 80%; --to: 84%; left: 80%; bottom: 3%; height: 27%; max-width: 16%; animation: hero-walk 28s linear infinite, hero-hop .95s ease-in-out infinite; }
.hero-cat { --from: 10%; --to: 24%; left: 10%; bottom: 2%; height: 30%; max-width: 22%; animation: hero-walk 28s linear infinite, hero-step .45s ease-in-out infinite alternate; }
.hero-dino { --from: 36%; --to: 50%; left: 36%; bottom: 3%; height: 32%; max-width: 34%; animation: hero-walk 28s linear infinite, hero-step .6s ease-in-out infinite alternate; }
.hero-fish { left: 50%; top: 71.5%; height: 8.5%; translate: -50% -50%; transform-origin: 50% 50%; animation: hero-swim 24s linear infinite, hero-ripple 1.3s ease-in-out infinite alternate; }
.hero-bird { --y: 37%; left: 72%; top: var(--y); height: 14%; max-width: 20%; transform-origin: 50% 50%; animation: hero-fly-across 17s linear infinite, hero-wave 1.7s ease-in-out infinite alternate; }
.hero-credit {
  position: absolute;
  right: 8px;
  bottom: 5px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(10, 8, 34, .5);
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  pointer-events: auto;
}
.hero-credit:hover { color: #fff; text-decoration: underline; }
#empty div.text { animation: rise .8s var(--ease) both; }
#empty h2 {
  background: linear-gradient(100deg, #fff 20%, #ffd76e 60%, #ff9dc6 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, .65));
}
#empty p { text-shadow: 0 2px 10px rgba(0, 0, 0, .75); }

/* Заставка и телевизор без лишней нагрузки */
body.saver #panel::before, body.saver .hero-frame, body.saver .hero-char { animation: none; }
body.saver canvas#stage { animation: none; }

@media (max-width: 820px) {
  #panel { border-right: 0; border-top: 1px solid rgba(255, 255, 255, .1); }
  .hero-char { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 6px 6px rgba(5, 14, 26, .5)); }
  .hero-rabbit { height: 24%; }
  .hero-cat { height: 26%; }
  .hero-dino { height: 27%; }
  .hero-bird { --y: 52%; height: 11%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Живые мелочи */
.stepper::before, .stepper::after {
  content: "";
  position: absolute;
  top: 28px;
  left: 12.5%;
  height: 2px;
  border-radius: 2px;
  pointer-events: none;
}
.stepper::before { right: 12.5%; background: rgba(255, 255, 255, .12); }
.stepper::after {
  width: calc(var(--progress, 0%) * .75);
  background: linear-gradient(90deg, #2ed3a0, #b079ff, #ff8fc4);
  box-shadow: 0 0 10px rgba(176, 121, 255, .8);
  transition: width .6s var(--ease);
}
.stepper button { z-index: 1; }
.stepper b { background-color: #1d1847; }

.brand svg circle { transition: transform .12s ease-out; }
.brand svg.wink { animation: wink .7s var(--ease); }
@keyframes wink {
  30% { transform: rotate(-14deg) scale(1.14); }
  60% { transform: rotate(10deg) scale(1.08); }
}

.drop, .option, #templateGrid button { will-change: transform; transform-style: preserve-3d; }

.character-list button[aria-pressed=true] { animation: bounce .55s var(--ease); }
#motions button[aria-pressed=true] i { animation: bounce .55s var(--ease); }
@keyframes bounce {
  0% { transform: scale(.82); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}


.menu-btn:active, #motions button:active:not(:disabled) { transform: scale(.95); }
#panelStatus.busy { background: linear-gradient(90deg, rgba(255, 198, 92, .1), rgba(176, 121, 255, .22), rgba(255, 198, 92, .1)); background-size: 200% 100%; animation: flow 2.4s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.lock { animation: lock-glow 3s ease-in-out infinite; }
@keyframes lock-glow { 50% { box-shadow: 0 0 14px rgba(255, 198, 92, .75); } }

/* Шапка панели: если три кнопки не помещаются рядом с названием, они уходят на вторую строку */
.brand { flex-wrap: wrap; row-gap: 8px; }
.brand h1 { white-space: nowrap; }
.menu { flex: 1 1 100%; order: 2; margin-left: 0; }
.menu-btn { flex: 1 1 0; white-space: nowrap; }
.subscribe-box { display: flex; flex: 1 1 100%; flex-direction: column; gap: 4px; order: 3; }
.subscribe-box:has(#openSubscribe[hidden]) { display: none; }
.menu:not(:has(button:not([hidden]))), .nav:not(:has(button:not([hidden]))) { display: none; }
.subscribe-note { color: #d9d2f5; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; }
#openSubscribe[hidden] + .subscribe-note { display: none; }
.subscribe-btn {
  flex: none;
  width: 100%;
  border-color: transparent;
  background: linear-gradient(100deg, #7b3ff2, #e0366f);
  color: #fff;
  box-shadow: 0 4px 18px rgba(224, 54, 111, .45);
}
.subscribe-btn:hover { background: linear-gradient(100deg, #8d55ff, #f04a82); box-shadow: 0 6px 24px rgba(224, 54, 111, .7); }
@media (max-width: 360px) {
  .menu-btn { padding: 6px 7px; font-size: 13px; }
}
.space-hint {
  margin: 8px 0 0;
  background: linear-gradient(100deg, #ffd76e, #ff9dc6 60%, #b79bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.pick-hint { margin: 6px 0 0; text-align: center; }

/* 3D-герои на стартовом экране рисует видеокарта. Обычные картинки появляются, только если 3D не запустилось */
.hero-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.hero-world.ready .hero-canvas { opacity: 1; }
.hero-world:not(.fallback) .hero-char { visibility: hidden; animation: none; }
.solid-row b { color: #ffd76e; }
#solidBadge { margin-left: 2px; padding: 1px 7px; border-radius: 9px; background: linear-gradient(100deg, #7b3ff2, #e0366f); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }

/* Бесплатные картинки внизу первого шага */
.free-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.free-grid button { overflow: hidden; aspect-ratio: 16 / 10; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: none; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
.free-grid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.free-grid button:hover { transform: translateY(-2px); border-color: #c79bff; box-shadow: 0 8px 24px rgba(123, 63, 242, .45); }
.free-grid button:hover img { transform: scale(1.07); }
#templateGrid .lock.free { background: linear-gradient(100deg, #2ed3a0, #1fa37c); color: #04271d; animation: none; }

/* Подключение телевизора кодом */
#tvPair { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; padding: 6vw; background: radial-gradient(120% 90% at 70% 110%, #5c2a86 0%, #241a5e 42%, #0a0822 78%); color: #fff; text-align: center; }
#tvPair[hidden] { display: none; }
.tv-pair-title { margin: 0; font-size: clamp(28px, 5vw, 64px); font-weight: 900; }
.tv-pair-step { max-width: 70vw; margin: 0; color: #d9d2f5; font-size: clamp(16px, 2.2vw, 30px); }
#tvPairCode { padding: 2vh 4vw; border-radius: 3vw; background: rgba(255, 255, 255, .1); font-size: clamp(56px, 12vw, 180px); font-weight: 900; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.tv-code-row { display: flex; gap: 8px; margin: 8px 0; }
.tv-code-row input { flex: 1 1 auto; min-width: 0; font-size: 18px; letter-spacing: .12em; text-align: center; }
