/* BESTIE ERA. Шрифты свои: Prata — заголовки, Cormorant Garamond — розовые акценты, Manrope — интерфейс */

@font-face {
  font-family: 'Prata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/prata-cyrillic.woff2?v=ozTd1OFZD6) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Prata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/prata-latin.woff2?v=hYXtCxCCgb) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/cormorant-italic-cyrillic.woff2?v=yxPARTPumM) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/cormorant-italic-latin.woff2?v=by9cOxq8PQ) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../assets/fonts/manrope-cyrillic.woff2?v=laSTBh_gqN) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../assets/fonts/manrope-latin.woff2?v=4xC1Wn_ZZ3) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* зарегистрированный цвет плавно перетекает при смене образа */
@property --character-color {
  syntax: '<color>';
  inherits: true;
  initial-value: #ff2c91;
}
/* отступ между блоками задаётся у самого блока и не наследуется вложенными */
@property --flow {
  syntax: '<length>';
  inherits: false;
  initial-value: 16px;
}

:root {
  --paper: #fbf8f6;
  --paper-warm: #fffaf6;
  --surface: #fff;
  --ink: #1d1a1c;
  --ink-soft: #37313a;
  --muted: #625c60;
  --faint: #8a8086;
  --line: #e7dfe2;
  --line-strong: #d9ccd2;
  --pink: #ff2c91;
  --pink-ink: #c4085f;
  --pink-strong: #dc0e74;
  --pink-soft: #ffe3ef;
  --pink-mist: #fff4f8;
  --pink-line: #f5cfe0;
  --lime: #d5f46c;
  --lime-soft: #eef9c8;
  --lime-ink: #425025;
  --sky: #bdeef5;
  --gem: #1597bd;
  --ticket: #e9f7b8;
  --ticket-dash: #879b58;
  --disabled-bg: #efe7ea;
  --disabled-ink: #8a8086;

  --font-display: 'Prata', 'Georgia', 'Times New Roman', serif;
  --font-accent: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(29, 26, 28, 0.06);
  --shadow-sm: 0 1px 2px rgba(29, 26, 28, 0.05), 0 4px 14px rgba(29, 26, 28, 0.05);
  --shadow-md: 0 2px 6px rgba(29, 26, 28, 0.05), 0 14px 36px rgba(29, 26, 28, 0.09);
  --shadow-lg: 0 10px 28px rgba(29, 26, 28, 0.1), 0 36px 90px rgba(29, 26, 28, 0.16);
  --shadow-pink: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 10px 22px -8px rgba(220, 14, 116, 0.55);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;
  --t-slower: 520ms;

  --gutter: 16px;
  --topbar-h: 64px;
  /* от низа окна до верха нижней панели: под неё оставляем место у контента, уведомления и тоста */
  --dock-space: 80px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --vh: 1vh;
}
@supports (height: 1svh) {
  :root {
    --vh: 1svh;
  }
}
@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }
}
@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
    --topbar-h: 68px;
  }
}

/* ---------- основа ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-synthesis: none;
  background: var(--paper);
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  /* --notice-space — высота уведомления CITY SCOOP, пока оно открыто (app.js) */
  scroll-padding-bottom: calc(var(--dock-space) + 16px + var(--notice-space, 0px));
}
html.dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}
/* место под полосу держим, только если она была: иначе на телефонах и маках появится пустая щель */
html.dialog-open.has-bar {
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: calc(var(--vh) * 100);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Android подсвечивает голубым всё с cursor: pointer */
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}
/* фон у body не задаём: иначе он перекроет это свечение */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52rem 38rem at -8% -6%, rgba(255, 44, 145, 0.075), transparent 70%),
    radial-gradient(44rem 34rem at 108% 104%, rgba(213, 244, 108, 0.2), transparent 70%);
}
h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}
ul,
ol {
  padding: 0;
}
h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}
h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
}
p,
li {
  text-wrap: pretty;
}
strong,
b {
  font-weight: 800;
}
em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 600;
  font-size: 1.12em;
  line-height: 1;
  letter-spacing: 0;
  color: var(--pink-ink);
}
h1 em,
h2 em {
  font-size: 1.16em;
  color: var(--pink);
}
img {
  max-width: 100%;
  height: auto;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}
button:not(:disabled) {
  cursor: pointer;
}
a {
  color: var(--pink-ink);
  text-underline-offset: 3px;
}
::selection {
  background: var(--pink-soft);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
/* сюда фокус переносит скрипт ради читалки — рамка не нужна */
[tabindex='-1']:focus,
#app:focus {
  outline: none;
}

.sr-only,
.hud-label,
.reset-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
.icon {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  overflow: visible;
}
.glyph {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.glyph-gem {
  color: var(--gem);
}
.glyph-heart {
  color: var(--pink);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}
.noscript {
  max-width: 480px;
  margin: 64px auto;
  padding: 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-md);
}

/* ---------- верхняя панель ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: rgba(251, 248, 246, 0.86);
  border-bottom: 1px solid rgba(217, 204, 210, 0.55);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
  user-select: none;
}
.brand-star,
.bestie-tip::before,
.scenario-ready::before {
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.brand-star {
  display: block;
  width: 14px;
  height: 14px;
  background: var(--pink);
}
.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}
.hud-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.hud-label {
  font-size: 12px;
}
.hud-avatar {
  position: relative;
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--pink-soft);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3px var(--line-strong);
}
.hud-avatar .hero-sprite {
  position: absolute;
  top: 1px;
  left: 50%;
  width: 250%;
  transform: translateX(calc(var(--face) * -100%));
}
.hud-phone {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.hud-phone .icon {
  width: 22px;
  height: 22px;
}
.hud-phone:disabled {
  color: #a79da2;
  background: transparent;
  box-shadow: none;
  cursor: not-allowed;
}
.hud-phone .notification-dot {
  top: 5px;
  right: 5px;
}
.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.reset-button .icon {
  width: 18px;
  height: 18px;
}
body[data-chapter='creation'] .hud,
body[data-chapter='creation'] .reset-button {
  display: none;
}
@media (max-width: 479px) {
  body:not([data-chapter='creation']) .wordmark > span:not(.brand-star) {
    display: none;
  }
  body:not([data-chapter='creation']) .brand-star {
    width: 24px;
    height: 24px;
  }
}
@media (max-width: 559px) {
  .hud-avatar {
    display: none;
  }
}
@media (max-width: 399px) {
  .topbar,
  .hud {
    gap: 6px;
  }
  .hud-stats {
    gap: 4px;
  }
  .hud-stat {
    gap: 5px;
    height: 36px;
    padding: 0 10px 0 7px;
    font-size: 14px;
  }
  .hud-stat .glyph {
    width: 16px;
    height: 16px;
  }
}
@media (min-width: 768px) {
  .reset-button {
    padding: 0 16px 0 14px;
  }
  .reset-button span {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
  }
}
@media (min-width: 1024px) {
  .wordmark {
    font-size: 1.25rem;
  }
  .hud-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 0 2px;
    overflow: visible;
    clip: auto;
    clip-path: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
  }
}

.sync-banner,
.save-error {
  position: sticky;
  top: var(--topbar-h);
  z-index: 19;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid #efdca0;
  background: #fff6d6;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}
.sync-banner:empty,
.save-error[hidden] {
  display: none;
}
.save-error {
  border-bottom-color: #f2c4cf;
  background: #ffedf1;
}

/* ---------- кнопки ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  min-height: 52px;
  /* в узкой колонке кнопка во всю ширину и текст по центру — широкие поля только отнимают место у подписи */
  padding: 14px clamp(18px, 6cqi, 26px);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  text-wrap: balance;
  transition:
    background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out);
}
.button .icon {
  width: 18px;
  height: 18px;
}
.button.primary,
.button.phone-quest {
  background: var(--pink);
  box-shadow: var(--shadow-pink);
}
.button.secondary {
  border-color: var(--ink);
  background: var(--surface);
}
.button.ghost {
  border-color: var(--line-strong);
  background: transparent;
}
.button.small {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13px;
}
@media (hover: hover) {
  .button.primary:hover,
  .button.phone-quest:hover {
    background: #ff4aa0;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.45) inset,
      0 16px 30px -10px rgba(220, 14, 116, 0.6);
  }
  .button.secondary:hover {
    background: var(--ink);
    color: #fff;
  }
  .button.ghost:hover {
    border-color: var(--ink);
    background: var(--surface);
  }
}
.button:disabled,
.button[aria-disabled='true'] {
  border-color: transparent;
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  box-shadow: none;
  cursor: not-allowed;
}

/* варианты ответа в сюжете */
.career-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--t-base) var(--ease-out),
    background-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
.choice-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.choice-text strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}
.choice-text span {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}
.career-choice > .icon {
  width: 20px;
  height: 20px;
  color: var(--pink-ink);
}
.career-choice.is-long strong {
  font-weight: 600;
  line-height: 1.5;
}
.career-choice.is-cta {
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 26px;
  border-color: transparent;
  border-radius: var(--r-pill);
  background: var(--pink);
  text-align: center;
  box-shadow: var(--shadow-pink);
}
.career-choice.is-cta strong {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-wrap: balance;
}
.career-choice.is-cta > .icon {
  width: 18px;
  height: 18px;
  color: currentColor;
}
.career-choice.chosen {
  border-color: var(--pink);
  background: var(--pink-mist);
}
@media (hover: hover) {
  .career-choice:hover {
    border-color: var(--pink);
    box-shadow: 0 10px 24px -14px rgba(196, 8, 95, 0.45);
  }
  .career-choice.is-cta:hover {
    background: #ff4aa0;
    border-color: transparent;
  }
}
.career-choice:disabled {
  border-color: var(--line);
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  box-shadow: none;
  cursor: not-allowed;
}
.choice-list,
.stack-actions {
  display: grid;
  gap: 10px;
}
.dialog-actions,
.button-row,
.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* ширина по подписи: две кнопки встают в ряд, только если обе подписи помещаются в строку, иначе каждая — на свою строку */
.dialog-actions .button,
.button-row .button {
  flex: 1 1 auto;
}

/* ---------- общий ритм текста в сюжете ---------- */

.step > * + *,
.location-panel > * + *,
.career-dialog > * + *,
.cafe-dialogue > * + *,
.scenario-ready > * + *,
.welcome-dialog > * + *,
.simple-dialog > * + *,
.task-dialog > * + *,
.box-final > * + *,
.brief-sheet > * + *,
.scoop-card > * + *,
.revision-stage > * + *,
.submission-card > * + *,
.certificate-preview > * + *,
.mentor-speech > * + *,
.brand-message > * + *,
.brand-reply > * + *,
.scoop-insight > * + *,
.bestie-tip > * + * {
  margin-top: var(--flow, 16px);
}
.news-edition + h2,
.dialog-kicker + .exam-progress,
.exam-progress + .news-edition,
.studio-progress + h2,
.ticket-top + h2,
.scoop-masthead + .scoop-card {
  --flow: 8px;
}
h2 + p,
h2 + .lead,
h2 + .exam-score,
h3 + p,
p + p,
.question-heading + .career-choice,
.career-choice + .career-choice,
.phone-app + .phone-app,
.bubble + .bubble,
.choice-list + .fine-print {
  --flow: 10px;
}
.brief-sheet > * + *,
.mentor-speech > * + *,
.brand-message > * + *,
.brand-reply > * + *,
.scoop-insight > * + *,
.bestie-tip > * + * {
  --flow: 8px;
}
.step > .button,
.step > .is-cta,
.location-panel > .return,
.welcome-dialog > .button,
.simple-dialog > .dialog-actions,
.task-dialog > .button,
.career-dialog > .button,
.career-dialog > .dialog-actions,
.career-dialog > .is-cta,
.cafe-dialogue > .career-choice,
.scenario-ready > .is-cta,
.step > .question-heading {
  --flow: 24px;
}

.news-edition,
.dialog-kicker,
.studio-progress,
.question-heading,
.location-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.question-heading {
  color: var(--muted);
}
.step > h2,
.career-dialog > h2,
.cafe-dialogue > h2,
.scenario-ready > h2,
.simple-dialog > h2,
.task-dialog > h2,
.welcome-dialog > h2,
.box-final > h2,
.submission-card > h2,
.certificate-preview > h2 {
  font-size: 1.75rem;
  line-height: 1.12;
}
.fine-print,
.field-help,
.action-hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.form-error {
  font-size: 14px;
  font-weight: 700;
  color: #b0123f;
}
.empty-note {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

/* ---------- экран создания героини ---------- */

.screen {
  width: 100%;
  margin: 0 auto;
}
.creation-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'intro' 'stage' 'picker' 'form' 'footer';
  gap: 24px;
  max-width: 1480px;
  padding: 20px var(--gutter) 28px;
}
.creation-intro {
  grid-area: intro;
}
.character-stage {
  grid-area: stage;
}
.archetype-picker {
  grid-area: picker;
  min-width: 0;
}
.identity-fields {
  grid-area: form;
  min-width: 0;
}
.mini-ticket {
  grid-area: ticket;
}
.stage-footer {
  grid-area: footer;
}
.creation-intro h1 {
  font-size: 2.5rem;
  font-size: clamp(2.5rem, 10.5vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.intro {
  max-width: 34ch;
  margin-top: 12px;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--muted);
}

.character-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 400px;
  height: calc(var(--vh) * 60);
  max-height: 540px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(64% 58% at 50% 60%, rgba(255, 186, 216, 0.75), transparent 72%),
    linear-gradient(180deg, #fff 0%, var(--pink-mist) 100%);
  background:
    radial-gradient(
      64% 58% at 50% 60%,
      color-mix(in srgb, var(--character-color) 52%, transparent),
      transparent 72%
    ),
    linear-gradient(180deg, #fff 0%, var(--pink-mist) 100%);
  box-shadow: var(--shadow-md);
  transition: --character-color var(--t-slower) var(--ease-out);
}
.stage-type {
  position: absolute;
  inset: 18px 18px 18px 22px;
  z-index: -1;
  font-family: var(--font-display);
  font-size: clamp(5rem, 22vw, 8.5rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: rgba(29, 26, 28, 0.055);
  user-select: none;
}
/* подпись идёт вертикально по правому краю: горизонтальную героиня закрывала посередине */
.stage-type span {
  position: absolute;
  top: 30%;
  right: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.32em;
  white-space: nowrap;
  color: var(--muted);
  writing-mode: vertical-rl;
}
.stage-orbit {
  position: absolute;
  top: 56%;
  left: 50%;
  z-index: -1;
  width: min(84%, 420px);
  aspect-ratio: 1;
  margin: calc(min(84%, 420px) / -2) 0 0 calc(min(84%, 420px) / -2);
  border: 1.5px dashed rgba(29, 26, 28, 0.13);
  border-radius: 50%;
}
.stage-orbit::before {
  content: '';
  position: absolute;
  top: 13%;
  left: 13%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 6px rgba(255, 44, 145, 0.16);
}
.decor {
  display: block;
  aspect-ratio: 1;
  background: no-repeat 0 0 / 300% 100%;
}
/* картинка декора грузится после главной героини — класс ставит app.js */
.decor-ready .decor {
  background-image: url(../assets/decor.webp?v=YRVClzAOK4);
}
.decor-green {
  background-position: 0 0;
}
.decor-pink {
  background-position: 50% 0;
}
.decor-chrome {
  background-position: 100% 0;
}
.hero-chrome {
  position: absolute;
  top: 8%;
  right: 6%;
  width: clamp(64px, 18%, 112px);
}
.hero-gem {
  position: absolute;
  bottom: 20%;
  left: 7%;
  width: clamp(48px, 13%, 84px);
}
.hero-sprite {
  display: block;
  aspect-ratio: 418 / 941;
  background: url(../assets/characters.webp?v=FLEAcL4sj5) no-repeat var(--sprite-position, 0%) 0 / 400% 100%;
}
.mentor-sprite {
  --face: 0.68;
  --body: 0.69;
  display: block;
  aspect-ratio: 418 / 941;
  background: url(../assets/mentor.webp?v=MKUweLJnKn) no-repeat 0 0 / 100% 100%;
}
.main-hero-wrap {
  position: absolute;
  inset: 5% 0 0;
}
.main-hero {
  position: absolute;
  bottom: -2%;
  left: 50%;
  height: 100%;
  transform: translateX(calc(var(--body) * -100%));
  filter: drop-shadow(0 22px 26px rgba(29, 26, 28, 0.16));
}
.character-sticker {
  position: absolute;
  bottom: 6%;
  left: 50%;
  z-index: 2;
  padding: 4px 20px 8px;
  border-radius: var(--r-pill);
  background: var(--lime);
  box-shadow: 0 12px 26px -10px rgba(66, 80, 37, 0.55);
  font-family: var(--font-accent);
  font-size: clamp(1.625rem, 6.4vw, 2rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-4deg);
}

.archetype-picker h2 {
  font-size: 1.875rem;
  line-height: 1.1;
}
.archetype-picker > p {
  margin-top: 6px;
  color: var(--muted);
}
.archetype-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.archetype {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
.portrait {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 0.78;
  border-radius: 14px;
  background: var(--swatch);
  background: color-mix(in srgb, var(--swatch) 34%, #fff);
}
.portrait .hero-sprite {
  position: absolute;
  top: 5%;
  left: 50%;
  width: 76%;
  transform: translateX(calc(var(--face) * -100%));
  transform-origin: 50% 0;
}
/* типограф сюда не ходит (data-typo=off): в узкой карточке «Pinterest Girl» переносится по пробелу, а не посреди слова */
.archetype-title {
  display: block;
  padding: 10px 6px 0;
  font-size: 15px;
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 800;
  line-height: 1.25;
}
.selection-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid rgba(29, 26, 28, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}
.selection-dot .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}
.archetype.selected {
  border-color: var(--ink);
  box-shadow:
    0 0 0 1px var(--ink),
    var(--shadow-md);
}
.archetype.selected .selection-dot {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
@media (hover: hover) {
  .archetype:not(.selected):hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
  }
}
.selected-copy {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--pink-line);
  border-radius: var(--r-md);
  background: var(--pink-mist);
}
.selected-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}
.selected-copy p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.identity-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.identity-fields > label,
.niche-field legend {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
}
.identity-fields input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 1.125rem;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
.identity-fields input::placeholder {
  color: var(--faint);
}
.identity-fields input:focus-visible {
  border-color: var(--ink);
  outline-offset: 2px;
}
.niche-field {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}
.niche-field legend {
  margin-bottom: 12px;
  padding: 0;
}
.niche-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.niche {
  min-height: 44px;
  padding: 10px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition:
    background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
}
/* ниши — латиницей строчными, как хештеги; решётку читалке не озвучиваем */
.niche::before {
  content: '#';
  content: '#' / '';
  margin-right: 1px;
  color: var(--pink-ink);
}
.niche.selected {
  border-color: var(--ink);
  background: var(--lime);
}
.niche.selected::before {
  color: var(--lime-ink);
}
@media (hover: hover) {
  .niche:not(.selected):hover {
    border-color: var(--ink);
  }
}
.creation-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.creation-cta .button {
  width: 100%;
  min-height: 58px;
  font-size: 15px;
}
.save-caption {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

.mini-ticket {
  position: relative;
  display: none;
  gap: 2px;
  width: min(100%, 300px);
  padding: 16px 22px 14px;
  border-radius: 14px;
  background: var(--ticket);
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
}
.mini-ticket::before,
.mini-ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--paper);
}
.mini-ticket::before {
  left: -9px;
}
.mini-ticket::after {
  right: -9px;
}
.mini-ticket > span:first-child,
.mini-ticket small {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime-ink);
}
.mini-ticket strong {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.06em;
}
.mini-ticket small {
  letter-spacing: 0.08em;
}
.barcode {
  display: block;
  height: 26px;
  margin: 4px 0 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px,
    transparent 2px 4px,
    var(--ink) 4px 5px,
    transparent 5px 8px,
    var(--ink) 8px 11px,
    transparent 11px 13px
  );
  opacity: 0.85;
}

.stage-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}
.steps {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
}
.steps .icon {
  width: 14px;
  height: 14px;
  color: var(--pink-ink);
}
.footer-star {
  display: none;
}
.footer-star .icon {
  width: 20px;
  height: 20px;
  color: var(--pink);
}

@media (max-width: 599px) {
  /* три шага в строку не влезают — столбиком со стрелками вниз, без одинокого хвоста */
  .steps {
    flex-direction: column;
    gap: 6px;
  }
  .steps .icon {
    transform: rotate(90deg);
  }
  /* кнопка старта всегда под рукой, пока форма на экране */
  .creation-cta {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 6px calc(var(--gutter) * -1) 0;
    padding: 18px var(--gutter) calc(12px + var(--safe-b));
    background: linear-gradient(rgba(251, 248, 246, 0), var(--paper) 26%);
  }
}
@media (min-width: 600px) {
  .creation-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'intro intro' 'stage picker' 'stage form' 'footer footer';
    gap: 28px 32px;
    padding-top: 28px;
  }
  .creation-intro h1 {
    font-size: clamp(2.75rem, 6vw, 3.5rem);
  }
  .character-stage {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    align-self: start;
    height: min(640px, calc(var(--vh) * 100 - var(--topbar-h) - 32px));
    min-height: 460px;
    max-height: none;
  }
}
@media (min-width: 1100px) {
  .creation-stage {
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.15fr) minmax(280px, 0.95fr);
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      'intro stage form'
      'picker stage form'
      'picker stage ticket'
      'footer footer footer';
    gap: 24px 40px;
    padding: 32px 40px 28px;
  }
  .creation-intro h1 {
    font-size: clamp(2.75rem, 3.7vw, 3.75rem);
  }
  .character-stage {
    position: relative;
    top: auto;
    align-self: stretch;
    height: auto;
    min-height: 620px;
  }
  .identity-fields {
    align-self: start;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .mini-ticket {
    display: grid;
    align-self: end;
    justify-self: center;
    margin-bottom: 12px;
  }
  .stage-footer {
    justify-content: space-between;
  }
  .footer-star {
    display: block;
  }
}

/* ---------- комната и город ---------- */

.game-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1560px;
  padding: 20px var(--gutter) calc(var(--dock-space) + 32px + var(--safe-b) + var(--notice-space, 0px));
}
.location-screen {
  padding-bottom: calc(40px + var(--safe-b));
}
.scene-world {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1672 / 941;
  border-radius: var(--r-lg);
  background: #efe5e9;
  box-shadow: var(--shadow-md);
  /* табличка с именем считает кегль от ширины сцены */
  container-type: inline-size;
}
.scene-world > .environment,
.city-canvas > .environment {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.scene-location {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 6px 16px 6px 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.location-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pink);
}
.location-icon .icon {
  width: 18px;
  height: 18px;
}
.scene-location strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}
.scene-location small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
}
/* на карте метка в одну строку: двухстрочная наезжала на Creator Academy */
.city-world .scene-location {
  padding-right: 14px;
}
.city-world .scene-location small {
  display: none;
}
.city-world .location-icon {
  width: 28px;
  height: 28px;
}
.city-world .location-icon .icon {
  width: 16px;
  height: 16px;
}
.room-hero {
  position: absolute;
  bottom: 2%;
  left: 36%;
  z-index: 1;
  height: 76%;
  transform: translateX(calc(var(--body) * -100%));
  filter: drop-shadow(0 18px 22px rgba(29, 26, 28, 0.2));
}
.phone-object {
  position: absolute;
  right: 12%;
  bottom: 22%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 16px 7px 7px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--pink);
  box-shadow: var(--shadow-pink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}
.phone-object > .icon {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: #fff;
}
.phone-object .notification-dot {
  top: -3px;
  right: -3px;
}
.scene-name {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  --plate-max: min(58cqi, 320px);
  max-width: var(--plate-max);
  padding: 10px 16px 11px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.name-plate {
  max-width: 100%;
  font-family: var(--font-display);
  /* 0,68 — ширина буквы Prata с запасом (по замеру 0,59–0,67): обычное длинное имя встаёт в одну строку */
  font-size: clamp(14px, calc((var(--plate-max) - 32px) / (var(--len, 8) * 0.68)), 24px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.scene-name small {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--pink);
}

.story-panel,
.location-panel {
  position: relative;
  min-width: 0;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  container-type: inline-size;
}
.chapter-number {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.chapter-number span:first-child::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  background: currentColor;
}
.chapter-number span + span {
  color: var(--muted);
}
.story-panel h1 {
  margin-top: 14px;
  font-size: 2.25rem;
  font-size: clamp(2rem, 11cqi, 3rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
/* длинное имя ужимается по ширине панели, а не рвётся посреди слова; 0,5 — ширина буквы Cormorant с запасом */
.name-fit {
  font-size: min(1.16em, calc(100cqi / (var(--len) * 0.5)));
  overflow-wrap: anywhere;
}
.story-panel .lead {
  margin-top: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.quest-ticket {
  position: relative;
  margin-top: 22px;
  padding: 16px 20px 20px;
  border-radius: var(--r-md);
  background: var(--ticket);
}
/* вырезы билета точно на пунктире: 16 отступ + 28 строка + 12 до черты − 10 радиус */
.quest-ticket::before,
.quest-ticket::after {
  content: '';
  position: absolute;
  top: 46px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
}
.quest-ticket::before {
  left: -10px;
}
.quest-ticket::after {
  right: -10px;
}
.ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--ticket-dash);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime-ink);
}
.ticket-top .icon {
  width: 20px;
  height: 20px;
}
.quest-ticket h2 {
  margin-top: 14px;
  font-size: 1.5rem;
  line-height: 1.15;
}
.quest-ticket > p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.objectives {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  list-style: none;
}
.objective {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px 8px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}
button.objective {
  transition: background-color var(--t-base) var(--ease-out);
}
@media (hover: hover) {
  button.objective:hover {
    background: #fff;
  }
}
.objective-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ticket-dash);
  border-radius: 50%;
  background: #fff;
}
.objective-mark .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}
.objective.done .objective-mark {
  border-color: var(--lime-ink);
  background: var(--lime-ink);
  color: #fff;
}
.objective-text {
  flex: 1;
  min-width: 0;
}
.objective.done .objective-text {
  color: var(--muted);
}
.objective small {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime-ink);
}
.objective > .icon {
  width: 18px;
  height: 18px;
}
.mission-reward {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--lime-ink);
}
.story-panel > .button {
  width: 100%;
  margin-top: 20px;
}
/* по центру две строки равной длины смотрятся лучше, чем строка и хвост */
.story-panel .action-hint {
  margin-top: 10px;
  text-align: center;
  text-wrap: balance;
}
.scene-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.scene-progress span:last-child {
  color: var(--ink);
}

/* ---------- карта ---------- */

.map-scroller {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* overflow: hidden — иначе сдвинутый игрок раздувает прокрутку карты */
.city-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  container-type: inline-size;
}
.travel-route {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.travel-route polyline {
  fill: none;
  stroke: var(--pink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2 10;
  vector-effect: non-scaling-stroke;
}
.city-building {
  position: absolute;
  top: calc(var(--y) * 1%);
  left: calc(var(--x) * 1%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 16px 5px 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(29, 26, 28, 0.45);
  transform: translate(-50%, -50%);
  transition:
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    background-color var(--t-base) var(--ease-out);
}
.place-icon {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink-ink);
}
.building-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.building-text strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.building-text small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.done-icon {
  width: 15px;
  height: 15px;
  color: var(--lime-ink);
  stroke-width: 2.6;
}
.lock-icon {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  stroke-width: 2;
}
.city-building.locked-building {
  background: rgba(246, 241, 243, 0.94);
}
.city-building.locked-building .place-icon {
  background: #e9e2e5;
  color: var(--muted);
}
.city-building.locked-building strong {
  color: var(--ink-soft);
}
.city-building.next-building {
  border-color: var(--lime-ink);
  background: var(--lime);
}
.city-building.next-building .place-icon {
  background: var(--ink);
  color: var(--lime);
}
.city-building.next-building small {
  color: var(--lime-ink);
}
.city-building.next-building::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--lime-ink);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.city-building.travel-target {
  border-color: var(--pink-strong);
  background: var(--pink);
}
.city-building.travel-target .place-icon {
  background: #fff;
  color: var(--pink-ink);
}
.city-building.travel-target small {
  color: var(--ink);
}
.city-building[aria-disabled='true'] {
  cursor: progress;
}
@media (hover: hover) {
  .city-building:not([aria-disabled='true']):hover {
    box-shadow: 0 14px 26px -10px rgba(29, 26, 28, 0.5);
  }
}
/* на узкой карте подписи короче, чтобы соседние здания не наезжали друг на друга */
@container (max-width: 839px) {
  .city-building {
    gap: 6px;
    padding: 4px 12px 4px 4px;
  }
  .place-icon {
    width: 26px;
    height: 26px;
    padding: 5px;
  }
  .building-text strong {
    font-size: 12px;
  }
  .building-text small {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
.map-player {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  transform: translate(calc(var(--x) * 1%), calc(var(--y) * 1%));
  transition: transform var(--walk, 0ms) linear;
}
.map-figure {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 16%;
  transform: translateY(-100%);
}
.map-figure .hero-sprite {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  transform: translateX(calc(var(--body) * -100%));
  filter: drop-shadow(0 5px 4px rgba(29, 26, 28, 0.32));
}
.map-name {
  position: absolute;
  top: 100%;
  left: 0;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--pink);
  box-shadow: 0 6px 14px -6px rgba(29, 26, 28, 0.5);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  transform: translate(-50%, 4px);
}
.map-status {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 6;
  max-width: calc(100% - 28px);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.map-hint {
  display: none;
}

/* ---------- локации ---------- */

.location-world.has-guide .environment {
  filter: brightness(0.82) saturate(0.95);
}
.scene-figure {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.scene-figure .room-hero {
  left: 30%;
  height: 74%;
}
.location-mentor {
  position: absolute;
  bottom: 0;
  left: 32%;
  height: 90%;
  transform: translateX(calc(var(--body) * -100%));
  filter: drop-shadow(0 20px 26px rgba(29, 26, 28, 0.28));
}
.location-back {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 1.5px solid var(--lime-ink);
  border-radius: var(--r-pill);
  background: var(--lime);
  box-shadow: 0 10px 22px -10px rgba(66, 80, 37, 0.6);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}
.location-back .icon {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .location-back:hover {
    background: #def87f;
  }
}
.location-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.location-label::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
}
.location-panel > .location-label + * {
  --flow: 12px;
}
.location-panel .step > h2,
.location-panel .career-dialog > h2,
.location-panel .cafe-dialogue > h2,
.location-panel .box-final > h2,
.location-panel .submission-card > h2 {
  font-size: 1.875rem;
  font-size: clamp(1.625rem, 7cqi, 2.125rem);
}
/* карточка с отступами внутри панели: при 26px «UGC-СЦЕНАРИЙ» на 320 не встаёт в строку и рвётся посреди слова */
.location-panel .scenario-ready > h2 {
  font-size: 1.875rem;
  font-size: clamp(1.4375rem, 7cqi, 2.125rem);
}
.location-panel > .return {
  width: 100%;
  margin-top: 24px;
}
.location-panel .step > .button,
.location-panel .career-dialog > .button,
.location-panel .stack-actions .button {
  width: 100%;
}

@media (max-width: 599px) {
  .game-screen {
    gap: 0;
    padding-top: 0;
    padding-right: 0;
    padding-left: 0;
  }
  .scene-world {
    aspect-ratio: auto;
    height: min(calc(var(--vh) * 60), 520px);
    border-radius: 0;
    box-shadow: none;
  }
  .location-world {
    height: clamp(260px, calc(var(--vh) * 42), 380px);
  }
  /* панель наезжает на сцену, как лист: подписи сцены поднимаем над её краем */
  .story-panel,
  .location-panel {
    z-index: 2;
    margin-top: -24px;
    padding: 26px 20px 24px;
    border-width: 1px 0 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -10px 30px -18px rgba(29, 26, 28, 0.35);
  }
  .scene-name,
  .map-status,
  .location-back {
    bottom: 38px;
  }
  .scene-location {
    top: 12px;
    left: 12px;
  }
  /* карту на телефоне листают — под неподвижной меткой проезжали бы здания */
  .city-world .scene-location {
    display: none;
  }
  /* справа внизу только круглая кнопка «назад», длинному имени отдаём остальное */
  .scene-name {
    left: 12px;
    --plate-max: min(100cqi - 88px, 360px);
  }
  .location-back {
    right: 12px;
  }
  .room-hero {
    left: 32%;
    height: 72%;
    bottom: 20px;
  }
  .phone-object {
    right: 6%;
    bottom: 30%;
  }
  .scene-figure .room-hero {
    left: 28%;
  }
  .location-mentor {
    left: 30%;
    height: 92%;
  }
  .city-world {
    --map-h: min(calc(var(--vh) * 62), 560px);
    height: var(--map-h);
  }
  .map-scroller {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .map-scroller::-webkit-scrollbar {
    display: none;
  }
  .city-canvas {
    width: calc(var(--map-h) * 1.7768);
  }
  /* место метки района, которую на телефоне прячем: ниже плашка наезжала на Creator Academy */
  .map-hint {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 9px;
    border-radius: var(--r-pill);
    background: rgba(29, 26, 28, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    pointer-events: none;
    animation: hint-fade 6s linear forwards;
  }
  .map-hint .icon {
    width: 16px;
    height: 16px;
  }
  /* на низкой карте имя под ногами уходило под строку «Выбери здание» — поднимаем над головой */
  .map-name {
    top: auto;
    bottom: 100%;
    transform: translate(-50%, -4px);
  }
}
@media (max-width: 479px) {
  .location-back {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
  .location-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (min-width: 600px) {
  .story-panel,
  .location-panel {
    padding: 28px;
  }
}
@media (min-width: 1024px) {
  .game-screen {
    grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 440px);
    gap: 24px;
    padding-top: 24px;
  }
  .location-screen {
    grid-template-columns: minmax(0, 1fr) clamp(360px, 36vw, 540px);
  }
  .game-screen > .scene-world {
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
  }
  .scene-location {
    top: 18px;
    left: 18px;
  }
  .scene-name,
  .map-status {
    bottom: 18px;
    left: 18px;
  }
  .location-back {
    right: 18px;
    bottom: 18px;
  }
}
@supports not (container-type: inline-size) {
  .story-panel h1 {
    font-size: 2.25rem;
  }
  .name-fit {
    font-size: min(1.16em, calc(min(88vw, 380px) / (var(--len) * 0.5)));
  }
  .scene-name {
    --plate-max: min(58vw, 320px);
  }
  @media (max-width: 1023px) {
    .building-text small {
      display: none;
    }
  }
  @media (max-width: 599px) {
    .studio-timeline small {
      display: none;
    }
    .scene-name {
      --plate-max: min(100vw - 88px, 360px);
    }
  }
  @media (max-width: 359px) {
    .studio-timeline strong {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }
}

/* ---------- нижняя панель ---------- */

.game-dock {
  position: fixed;
  bottom: calc(14px + var(--safe-b));
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(217, 204, 210, 0.7);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}
.dock-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  transition:
    background-color var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out);
}
.dock-button .icon {
  width: 20px;
  height: 20px;
}
.dock-button.active {
  background: var(--ink);
  color: #fff;
}
@media (hover: hover) {
  .dock-button:not(.active):hover {
    background: var(--pink-mist);
  }
}
.dock-divider {
  width: 1px;
  height: 26px;
  margin: 0 6px;
  background: var(--line-strong);
}
.dock-count {
  position: absolute;
  top: 3px;
  right: 6px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: var(--r-pill);
  background: var(--pink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.dock-button .notification-dot {
  top: 8px;
  right: 10px;
}
@media (max-width: 767px) {
  .game-dock {
    right: 8px;
    bottom: calc(8px + var(--safe-b));
    left: 8px;
    gap: 0;
    padding: 5px;
    border-radius: 22px;
    transform: none;
  }
  .dock-button {
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    padding: 6px 2px 5px;
    border-radius: 17px;
    font-size: 12px;
    font-weight: 700;
  }
  .dock-divider {
    display: none;
  }
  .dock-count {
    top: 2px;
    right: calc(50% - 22px);
  }
  .dock-button .notification-dot {
    top: 5px;
    right: calc(50% - 16px);
  }
}

/* ---------- окна ---------- */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(29, 26, 28, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.dialog-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(var(--vh) * 100 - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
/* крестик плавает справа и прилипает к верху при прокрутке длинного окна */
.dialog-close {
  position: sticky;
  top: 0;
  z-index: 5;
  float: right;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -14px -14px 8px 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--t-base) var(--ease-out);
}
.dialog-close .icon {
  width: 20px;
  height: 20px;
}
@media (hover: hover) {
  .dialog-close:hover {
    background: var(--pink-mist);
  }
}
.dialog-symbol {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--pink-soft);
  color: var(--pink-ink);
}
.dialog-symbol .icon {
  width: 28px;
  height: 28px;
}
.simple-dialog > p,
.career-dialog > p,
.welcome-dialog > p {
  line-height: 1.6;
}
.task-dialog .ticket-top {
  color: var(--pink-ink);
  border-bottom-color: var(--line-strong);
}
.task-dialog .objective {
  background: var(--pink-mist);
}
.task-dialog .objective-mark {
  border-color: var(--line-strong);
}
.task-dialog > .button,
.welcome-dialog > .button,
.career-dialog > .button {
  width: 100%;
}
.mission-list {
  display: grid;
  gap: 8px;
  list-style: none;
}
.mission-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.mission-list li > .icon {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
}
.mission-list li.done > .icon {
  background: var(--lime);
}
.mission-list li.done {
  color: var(--muted);
}
.mission-list li.open {
  border-color: var(--pink);
  background: var(--pink-mist);
}
.mission-list li.open > .icon {
  background: var(--pink);
}
.mission-list li.locked {
  background: #f8f4f5;
  color: var(--muted);
}
.mission-list li.locked > .icon {
  background: #ebe4e7;
}
/* обрезаем clip-path, а не overflow: блок с overflow встал бы сбоку от плавающего крестика */
.welcome-portrait {
  position: relative;
  clip-path: inset(0 round var(--r-lg) var(--r-lg) 0 0);
  height: 250px;
  margin: -32px -32px 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background:
    radial-gradient(70% 90% at 50% 100%, #ffc6df, transparent 72%), linear-gradient(180deg, #fff2f8, #ffe0ee);
}
.welcome-portrait .mentor-sprite {
  position: absolute;
  top: 14px;
  left: 50%;
  height: 470px;
  transform: translateX(calc(var(--face) * -100%));
}
.welcome-dialog > .welcome-portrait + h2 {
  --flow: 24px;
}
.locked-dialog {
  text-align: left;
}

@media (max-width: 599px) {
  .dialog-backdrop {
    align-items: end;
    padding: 0;
  }
  .dialog-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(var(--vh) * 100 - 20px);
    padding: 24px 20px calc(24px + var(--safe-b));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .dialog-close {
    margin: -10px -8px 8px 12px;
  }
  .welcome-portrait {
    height: 220px;
    margin: -24px -20px 0;
  }
  .welcome-portrait .mentor-sprite {
    height: 420px;
  }
  .step > h2,
  .career-dialog > h2,
  .cafe-dialogue > h2,
  .simple-dialog > h2,
  .task-dialog > h2,
  .welcome-dialog > h2,
  .box-final > h2 {
    font-size: 1.625rem;
  }
}

/* ---------- телефон ---------- */

.dialog-panel.is-phone {
  width: min(388px, 100%);
  max-height: none;
  overflow: visible;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.is-phone .dialog-close {
  position: absolute;
  top: 6px;
  right: -58px;
  float: none;
  margin: 0;
  border-color: transparent;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.phone-shell {
  position: relative;
  padding: 12px;
  border-radius: 46px;
  background: linear-gradient(155deg, #f7b0cf 0%, #ef8fbc 42%, #e27aaa 100%);
  box-shadow:
    inset 0 0 0 2px #c86693,
    inset 3px 2px 6px rgba(255, 220, 234, 0.9),
    0 30px 70px -20px rgba(36, 17, 28, 0.55);
}
.phone-hardware {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.1em;
  color: #5b2340;
}
.speaker {
  width: 56px;
  height: 5px;
  border-radius: 5px;
  background: #b85d86;
  box-shadow: 0 1px 0 #ffbdd6;
}
.phone-display {
  position: relative;
  min-height: 380px;
  max-height: min(640px, calc(100vh - 190px));
  max-height: min(640px, calc(var(--vh) * 100 - 190px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 16px;
  /* рамка — border, а не внутренняя тень: туман липкой кнопки закрасил бы тень, а за обрезку прокрутки не заходит */
  border: 2px solid #d4a6bb;
  border-radius: 32px;
  background: #fff7fa;
  font-size: 15px;
  scrollbar-width: thin;
  scrollbar-color: #e3b6ca transparent;
}
.phone-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 12px 10px 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.14em;
  color: #6f2e4d;
}
.phone-bottom i {
  display: block;
  width: 56px;
  height: 28px;
  border-radius: 12px;
  background: #e178a6;
  box-shadow:
    inset 0 1px 2px #a94877,
    0 1px 0 #ffcadf;
}
.phone-screen > h2 {
  font-size: 1.75rem;
  line-height: 1.1;
}
.phone-screen > p {
  line-height: 1.55;
  color: var(--muted);
}
.phone-screen > .phone-back + * {
  --flow: 6px;
}
.phone-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -8px 0 0 -8px;
  padding: 0 14px 0 8px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--pink-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transition: background-color var(--t-base) var(--ease-out);
}
.phone-back .icon {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .phone-back:hover {
    background: var(--pink-soft);
  }
}
.career-dialog > .phone-back + * {
  --flow: 8px;
}
.phone-app {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
@media (hover: hover) {
  .phone-app:hover {
    border-color: var(--pink);
    box-shadow: 0 10px 22px -14px rgba(196, 8, 95, 0.5);
  }
}
.phone-app > .icon {
  width: 18px;
  height: 18px;
  color: var(--pink-ink);
}
.phone-app .notification-dot,
.phone-app .dock-count {
  position: static;
  flex: none;
}
.phone-app .dock-count {
  border: 0;
}
.app-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--pink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.app-icon .icon {
  width: 22px;
  height: 22px;
}
.app-icon.lime {
  background: var(--lime);
}
.app-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.app-text strong {
  font-size: 15px;
  line-height: 1.3;
}
.app-text small {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}
.mia-portrait {
  position: relative;
  display: block;
  flex: none;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffd3e6, #ff9fcb);
}
.mia-portrait .mentor-sprite {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 260%;
  transform: translateX(calc(var(--face) * -100%));
}
.phone-note {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  color: var(--ink);
}
.phone-screen > .phone-note {
  --flow: 28px;
  color: var(--ink);
}
.phone-note strong {
  font-family: var(--font-accent);
  font-size: 1.18em;
  font-style: italic;
  font-weight: 600;
  color: var(--pink-ink);
}
.thread-person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.thread-person .mia-portrait {
  width: 54px;
  height: 54px;
}
.thread-person h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}
.thread-person h2 + span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.avatar-profile {
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.message-date {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}
.message-date::before,
.message-date::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  align-self: flex-start;
  max-width: 92%;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 4px 18px 18px 18px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.55;
  box-shadow: var(--shadow-xs);
}
.bubble.own {
  align-self: flex-end;
  width: fit-content;
  max-width: 88%;
  margin-left: auto;
  border-color: var(--pink-line);
  border-radius: 18px 4px 18px 18px;
  background: var(--pink-soft);
}
.bubble.typing {
  display: inline-flex;
  gap: 5px;
  padding: 15px 16px;
}
.bubble.typing i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c3b2ba;
}
.reputation-bonus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--lime);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}
/* липкая кнопка не висит на обрезанных строках: над ней дымка цвета экрана, под ней сплошная полоса до края —
   sticky держит кнопку выше padding прокрутки, и в щель иначе видно текст; внешняя тень под саму кнопку не заходит */
.button.phone-quest {
  --phone-halo: 0 0 0 8px #fff7fa, 0 -10px 20px 10px #fff7fa, 0 calc(24px + var(--safe-b)) 0 24px #fff7fa;
  position: sticky;
  bottom: 12px;
  z-index: 2;
  width: 100%;
  box-shadow: var(--shadow-pink), var(--phone-halo);
}
.phone-screen > .button.phone-quest {
  --flow: 28px;
}
@media (hover: hover) {
  .button.phone-quest:hover {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.45) inset,
      0 16px 30px -10px rgba(220, 14, 116, 0.6),
      var(--phone-halo);
  }
}
.button.phone-quest:disabled {
  background: var(--disabled-bg);
  box-shadow: var(--phone-halo);
}
.thread-earlier {
  background: rgba(255, 255, 255, 0.7);
}
.bestie-cover {
  position: relative;
  overflow: hidden;
  height: 196px;
  border-radius: 22px;
  background:
    radial-gradient(60% 80% at 75% 100%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(140deg, #ffd6e8 0%, #ff9fcb 100%);
}
.bestie-cover .mentor-sprite {
  position: absolute;
  top: 10px;
  left: 70%;
  height: 470px;
  transform: translateX(calc(var(--face) * -100%));
}
.bestie-cover span {
  position: absolute;
  bottom: 18px;
  left: 18px;
  max-width: 52%;
  font-family: var(--font-accent);
  font-size: 1.625rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.02;
}
.phone-screen > .bestie-cover + h2 {
  --flow: 20px;
}
.phone-screen > h3 {
  font-size: 1.125rem;
}
.phone-screen > h2 + h3 {
  --flow: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.bestie-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bestie-facts > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.bestie-facts strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--pink-ink);
}
.bestie-facts p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* CITY SCOOP */
.scoop-display > h2 {
  letter-spacing: 0.02em;
}
.scoop-display .news-edition {
  color: var(--muted);
}
.scoop-list {
  display: grid;
  gap: 10px;
  list-style: none;
}
.scoop-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.scoop-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  transition:
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
@media (hover: hover) {
  .scoop-list-item:hover {
    border-color: var(--pink);
    box-shadow: 0 10px 22px -14px rgba(196, 8, 95, 0.5);
  }
}
.scoop-list-item .news-edition {
  color: var(--pink-ink);
}
.scoop-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.25;
  text-wrap: balance;
}
.scoop-list-item small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.scoop-list-item small .icon {
  width: 16px;
  height: 16px;
}
.scoop-list-item small.is-new {
  color: var(--pink-ink);
}
.scoop-list-item small.is-new::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
}
.scoop-masthead {
  padding-bottom: 10px;
  border-bottom: 3px double var(--ink);
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-align: center;
}
article.scoop-card {
  padding: 18px 16px 20px;
}
.scoop-heading {
  font-size: 1.5rem;
  line-height: 1.15;
}
article.scoop-card p {
  font-size: 15px;
  line-height: 1.65;
}
.scoop-insight {
  padding: 14px 16px;
  border-left: 4px solid var(--lime-ink);
  border-radius: 6px 14px 14px 6px;
  background: var(--lime-soft);
}
.scoop-insight strong {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--lime-ink);
}
.scoop-insight p + p {
  --flow: 6px;
}

@media (min-width: 600px) and (max-width: 719px) {
  .is-phone .dialog-close {
    right: -54px;
  }
}
@media (max-width: 599px) {
  .dialog-panel.is-phone {
    width: 100%;
    height: 100vh;
    height: calc(var(--vh) * 100);
    border-radius: 0;
    background: #fff7fa;
  }
  .phone-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  /* на телефоне корпус не рисуем: шапка приложения вместо рамки */
  .phone-hardware {
    flex: none;
    height: calc(60px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 64px 0 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 247, 250, 0.96);
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--ink);
  }
  .phone-hardware .speaker,
  .phone-hardware span:last-child {
    display: none;
  }
  .phone-display {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding: 16px 20px calc(24px + var(--safe-b));
    border: 0;
    border-radius: 0;
  }
  .phone-bottom {
    display: none;
  }
  /* главный экран: подпись внизу, как на обоях телефона, — иначе под списком приложений полэкрана пустоты */
  .phone-display:has(> .phone-home) {
    display: flex;
    flex-direction: column;
  }
  .phone-home {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
  }
  .phone-home > .phone-note {
    margin-top: auto;
    padding: 28px 0 8px;
  }
  .is-phone .dialog-close {
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 10px;
    box-shadow: none;
    border-color: var(--line);
  }
}

/* ---------- реплики, заметки, документы ---------- */

.brand-message,
.brand-reply,
.mentor-speech {
  padding: 15px 18px;
  font-size: 15px;
  line-height: 1.6;
}
.brand-message {
  border: 1px solid var(--pink-line);
  border-radius: 4px 20px 20px 20px;
  background: var(--pink-mist);
}
.brand-reply {
  border: 1px solid var(--line);
  border-radius: 4px 20px 20px 20px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.mentor-speech {
  border: 1px solid #edc0d5;
  border-radius: 4px 20px 20px 20px;
  background: #fff0f7;
}
.agreement-strip {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--lime-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--lime-ink);
}
.bestie-tip {
  position: relative;
  padding: 14px 16px 14px 46px;
  border: 1px dashed #efb2cd;
  border-radius: var(--r-md);
  background: var(--pink-mist);
  font-size: 14px;
  line-height: 1.55;
}
.bestie-tip::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 17px;
  width: 16px;
  height: 16px;
  background: var(--pink);
}
.bestie-tip strong:first-child {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.speech-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.brief-sheet {
  position: relative;
  padding: 18px 20px 20px 24px;
  border: 1px solid #efe1d6;
  border-radius: var(--r-md);
  background: var(--paper-warm);
  box-shadow: var(--shadow-xs);
}
.brief-sheet::before {
  content: '';
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--pink);
}
.brief-sheet > strong:first-child {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.brief-sheet p {
  font-size: 15px;
  line-height: 1.6;
}
.brief-sheet h3 {
  font-size: 1.25rem;
}
.feedback-list {
  display: grid;
  gap: 8px;
  list-style: none;
}
.feedback-list li {
  position: relative;
  padding-left: 22px;
  line-height: 1.55;
}
.feedback-list li::before {
  content: '';
  position: absolute;
  top: 0.62em;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
}
details {
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
details[open] {
  padding-bottom: 16px;
}
details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0 -16px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t-base) var(--ease-out);
}
details[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}
details > summary ~ * + * {
  margin-top: 10px;
}
.shot-decisions p {
  font-size: 14px;
  line-height: 1.55;
}
.shot-decisions strong {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.negotiation-history > .bubble,
.negotiation-history > .brand-reply {
  font-size: 14px;
}

/* ---------- студия ---------- */

.studio-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
}
.studio-timeline li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
}
.studio-timeline li::before {
  content: '';
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line-strong);
}
.studio-timeline li:first-child::before {
  display: none;
}
.studio-timeline li.filled::before,
.studio-timeline li.current::before {
  background: var(--pink);
}
.stage-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.stage-dot .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}
.studio-timeline li.filled .stage-dot {
  border-color: var(--pink);
  background: var(--pink);
}
.studio-timeline li.current .stage-dot {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 0 0 4px var(--pink-soft);
}
/* 700, а не 800: «Придумай» жирным не влезает в колонку шириной 61px и рвётся переносом */
.studio-timeline strong {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.studio-timeline small {
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}
.studio-timeline li:not(.filled):not(.current) strong {
  font-weight: 600;
  color: var(--muted);
}
@container (max-width: 439px) {
  .studio-timeline small {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* уже 305px подписи под точками не помещаются без разрыва слов — остаются точки,
   а название этапа и так стоит строкой ниже: «Этап 1 из 5 · Придумай начало» */
@container (max-width: 304px) {
  .studio-timeline strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
.submission-card {
  padding: 28px 20px;
  border: 1px solid var(--pink-line);
  border-radius: var(--r-lg);
  background: var(--pink-mist);
  text-align: center;
}
.submit-spinner {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 3px solid var(--pink-soft);
  border-top-color: var(--pink);
  border-radius: 50%;
}
.scenario-ready {
  position: relative;
  overflow: hidden;
  padding: 24px 22px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(80% 70% at 100% 0%, rgba(255, 255, 255, 0.7), transparent 70%),
    linear-gradient(150deg, var(--lime-soft), #f9fde8);
  border: 1px solid #dbeaa8;
}
.scenario-ready::before {
  content: '';
  position: absolute;
  top: 18px;
  right: 20px;
  width: 26px;
  height: 26px;
  background: var(--pink);
}
/* звезда стоит справа от первой строки — место под неё нужно издательской строке, а не заголовку */
.scenario-ready > .news-edition {
  padding-right: 36px;
  color: var(--lime-ink);
}
.revision-stage {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fdfafb;
}
.revision-stage > .revision-choice + .revision-choice {
  --flow: 8px;
}
.revision-choice > .icon {
  color: var(--faint);
}
.revision-choice.chosen > .icon {
  color: var(--pink-ink);
}

/* ---------- академия, проверка, подарки ---------- */

.exam-progress {
  display: flex;
  gap: 6px;
}
.exam-progress i {
  flex: 1;
  height: 5px;
  border-radius: 5px;
  background: var(--line);
}
.exam-progress i.on {
  background: var(--pink);
}
.exam-question {
  font-size: 1.5rem;
  line-height: 1.2;
}
/* вопрос в 120–165 знаков: заголовочный кегль на телефоне занимает весь экран и уводит варианты ответа под сгиб */
@media (max-width: 599px) {
  .exam-question {
    font-size: 1.25rem;
    line-height: 1.3;
  }
}
.exam-score {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--pink-ink);
}
.signature {
  font-family: var(--font-accent);
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.1;
  color: var(--pink-ink);
}
.certificate-card,
.guide-card {
  text-align: left;
}
.guide-card::before {
  background: var(--lime-ink);
}
.certificate-inline-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: min(100%, 260px);
  aspect-ratio: 1080 / 1920;
  margin-right: auto;
  margin-left: auto;
  border-radius: var(--r-md);
  background: linear-gradient(110deg, #f4ebef 30%, #fff 50%, #f4ebef 70%) 0 0 / 300% 100%;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.certificate-inline-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.certificate-inline-preview p {
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.certificate-preview {
  text-align: center;
}
.certificate-preview img {
  display: block;
  width: min(100%, 340px);
  margin: 0 auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.box-final > .signature {
  --flow: 8px;
}

/* ---------- уведомление и тост ---------- */

.scoop-notice {
  position: fixed;
  right: 24px;
  bottom: calc(var(--dock-space) + 14px + var(--safe-b));
  z-index: 40;
  width: min(380px, calc(100vw - 32px));
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.scoop-notice h2 {
  margin-top: 6px;
  padding-right: 34px;
  font-size: 1.3125rem;
  line-height: 1.2;
}
.scoop-notice p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.scoop-notice .news-edition {
  padding-right: 40px;
}
.notice-actions {
  margin-top: 14px;
}
.notice-actions .button {
  flex: 1 1 auto;
}
.notice-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background-color var(--t-base) var(--ease-out);
}
@media (hover: hover) {
  .notice-close:hover {
    background: var(--pink-mist);
    color: var(--ink);
  }
}
@media (max-width: 599px) {
  .scoop-notice {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: calc(var(--dock-space) + 8px + var(--safe-b));
    padding: 14px 14px 12px;
    border-radius: 18px;
  }
  .scoop-notice h2 {
    font-size: 1.0625rem;
    line-height: 1.25;
  }
  .notice-actions {
    margin-top: 12px;
  }
}
/* на невысоком телефоне уведомление — как пуш: издание, заголовок и кнопки; подводка есть в самой новости */
@media (max-width: 599px) and (max-height: 740px) {
  .scoop-notice p {
    display: none;
  }
}
/* на 320 «Читать новость» и «Позже» иначе не встают в один ряд: 194 + 89 + 10 при 274 доступных */
@media (max-width: 359px) {
  /* на 320 px «ПОСМОТРЕТЬ СЕРТИФИКАТ» и «ИСКАТЬ ПЕРВЫЙ БРЕНД» иначе ломаются в две строки */
  .button {
    gap: 8px;
    padding-inline: 14px;
    letter-spacing: 0.035em;
  }
  .brief-sheet {
    padding: 16px 14px 18px 18px;
  }
  .notice-actions {
    gap: 8px;
  }
  .notice-actions .button {
    padding-inline: 12px;
  }
}
.toast {
  position: fixed;
  bottom: calc(var(--dock-space) + 16px + var(--safe-b) + var(--notice-space, 0px));
  left: 50%;
  z-index: 60;
  width: max-content;
  max-width: min(480px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity var(--t-base) var(--ease-out);
}
.toast.visible {
  opacity: 1;
}

/* ---------- движение: только если человек его не отключил ---------- */

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
@keyframes panel-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}
@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}
@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}
@keyframes sticker-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) rotate(-14deg) scale(0.6);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) rotate(-2deg) scale(1.06);
  }
  100% {
    transform: translateX(-50%) rotate(-4deg) scale(1);
  }
}
@keyframes drift {
  from {
    transform: translateY(-6px) rotate(-3deg);
  }
  to {
    transform: translateY(6px) rotate(3deg);
  }
}
/* спрайт центрируется через transform, поэтому сдвиг центровки входит в каждый кадр */
@keyframes breathe {
  from {
    transform: translateX(calc(var(--body) * -100%)) translateY(0);
  }
  to {
    transform: translateX(calc(var(--body) * -100%)) translateY(-6px);
  }
}
@keyframes bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ring-out {
  from {
    opacity: 0.85;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.1, 1.45);
  }
}
@keyframes dot-ring {
  from {
    opacity: 0.6;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.4);
  }
}
@keyframes typing-dot {
  0%,
  60%,
  100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
@keyframes route-run {
  to {
    stroke-dashoffset: -12;
  }
}
@keyframes walk-bob {
  from {
    transform: translateX(calc(var(--body) * -100%)) translateY(0) rotate(-1.5deg);
  }
  to {
    transform: translateX(calc(var(--body) * -100%)) translateY(-4px) rotate(1.5deg);
  }
}
@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: none;
  }
}
@keyframes twinkle {
  0%,
  100% {
    transform: scale(1) rotate(0);
  }
  50% {
    transform: scale(0.8) rotate(45deg);
  }
}
/* подсказка «карту можно листать» гаснет сама: это только смена прозрачности, не движение */
@keyframes hint-fade {
  0%,
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .screen {
    animation: fade-in var(--t-slow) var(--ease-out) backwards;
  }
  .creation-stage > *,
  .game-screen > .scene-world,
  .game-screen > .story-panel,
  .game-screen > .location-panel {
    animation: rise-in var(--t-slower) var(--ease-out) backwards;
  }
  .creation-stage > .character-stage,
  .game-screen > .story-panel,
  .game-screen > .location-panel {
    animation-delay: 70ms;
  }
  .creation-stage > .archetype-picker {
    animation-delay: 120ms;
  }
  .creation-stage > .identity-fields {
    animation-delay: 170ms;
  }
  .creation-stage > .mini-ticket,
  .creation-stage > .stage-footer {
    animation-delay: 220ms;
  }
  .step {
    animation: step-in var(--t-slow) var(--ease-out) backwards;
  }
  .main-hero-wrap {
    animation: hero-in var(--t-slower) var(--ease-out) backwards;
  }
  .main-hero-wrap > .main-hero {
    animation: breathe 3.6s var(--ease-in-out) 0.6s infinite alternate;
  }
  .character-sticker {
    animation: sticker-pop var(--t-slower) var(--ease-out) 90ms backwards;
  }
  .hero-chrome {
    animation: drift 6s var(--ease-in-out) infinite alternate;
  }
  .hero-gem {
    animation: drift 7s var(--ease-in-out) -2.5s infinite alternate-reverse;
  }
  .stage-orbit {
    animation: spin 60s linear infinite;
  }
  .brand-star {
    animation: twinkle 5s var(--ease-in-out) infinite;
  }
  .phone-object {
    animation: bob 2.6s var(--ease-in-out) infinite alternate;
  }
  /* волна от точки — псевдоэлементом на transform: box-shadow перерисовывался бы каждый кадр */
  .notification-dot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--pink);
    animation: dot-ring 1.8s var(--ease-out) infinite;
  }
  .city-building.next-building::after {
    animation: ring-out 1.8s var(--ease-out) infinite;
  }
  .travel-route polyline {
    animation: route-run 0.6s linear infinite;
  }
  .map-player.walking .map-figure .hero-sprite {
    animation: walk-bob 0.32s var(--ease-in-out) infinite alternate;
  }
  .bubble.typing i {
    animation: typing-dot 1.2s var(--ease-in-out) infinite;
  }
  .bubble.typing i:nth-child(2) {
    animation-delay: 0.15s;
  }
  .bubble.typing i:nth-child(3) {
    animation-delay: 0.3s;
  }
  .thread > .bubble:not(.typing) {
    animation: step-in var(--t-slow) var(--ease-out) backwards;
  }
  .submit-spinner {
    animation: spin 0.9s linear infinite;
  }
  .certificate-inline-preview[aria-busy='true'] {
    animation: shimmer 1.4s linear infinite;
  }
  .reputation-bonus,
  .agreement-strip {
    animation: pop-in var(--t-slower) var(--ease-out) 120ms backwards;
  }
  .scoop-notice {
    animation: rise-in var(--t-slower) var(--ease-out) backwards;
  }
  .dialog-backdrop {
    animation: fade-in var(--t-base) var(--ease-out) backwards;
  }
  .dialog-panel {
    animation: panel-in var(--t-slow) var(--ease-out) backwards;
  }
  .dialog-backdrop.is-closing {
    animation: fade-out 180ms var(--ease-in-out) forwards;
  }
  .dialog-backdrop.is-closing .dialog-panel {
    animation: panel-out 180ms var(--ease-in-out) forwards;
  }
  .toast {
    transition:
      opacity var(--t-base) var(--ease-out),
      transform var(--t-slow) var(--ease-out);
    transform: translate(-50%, 10px);
  }
  .toast.visible {
    transform: translate(-50%, 0);
  }
  .portrait .hero-sprite {
    transition: transform var(--t-slow) var(--ease-out);
  }
  .button,
  .career-choice,
  .phone-app,
  .scoop-list-item,
  .archetype,
  .location-back,
  .phone-object {
    transition-property: background-color, border-color, box-shadow, color, transform;
    transition-duration: var(--t-base);
    transition-timing-function: var(--ease-out);
  }
  .career-choice > .icon,
  .phone-app > .icon {
    transition: transform var(--t-base) var(--ease-out);
  }
  .button:active,
  .career-choice:active,
  .archetype:active,
  .niche:active,
  .dock-button:active,
  .phone-app:active {
    transform: scale(0.98);
    transition-duration: 80ms;
  }
  @media (hover: hover) {
    .button.primary:not(:disabled):hover,
    .button.phone-quest:not(:disabled):hover,
    .career-choice.is-cta:not(:disabled):hover {
      transform: translateY(-2px);
    }
    .career-choice:not(:disabled):hover > .icon,
    .phone-app:hover > .icon {
      transform: translateX(3px);
    }
    .archetype:hover .portrait .hero-sprite {
      transform: translateX(calc(var(--face) * -100%)) scale(1.05);
    }
    .city-building:not([aria-disabled='true']):hover {
      transform: translate(-50%, calc(-50% - 3px));
    }
  }
  @media (max-width: 599px) {
    .dialog-panel {
      animation: sheet-in var(--t-slow) var(--ease-out) backwards;
    }
    .dialog-backdrop.is-closing .dialog-panel {
      animation: sheet-out 200ms var(--ease-in-out) forwards;
    }
    .dialog-panel.is-phone {
      animation: rise-in var(--t-slow) var(--ease-out) backwards;
    }
  }
}

/* ---------- контрастная тема Windows ---------- */

@media (forced-colors: active) {
  .archetype.selected,
  .niche.selected,
  .career-choice.chosen,
  .dock-button.active,
  .city-building.next-building {
    forced-color-adjust: none;
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }
  .archetype.selected *,
  .niche.selected *,
  .career-choice.chosen *,
  .dock-button.active *,
  .city-building.next-building * {
    color: HighlightText;
  }
  .button,
  .career-choice,
  .niche,
  .archetype,
  .dock-button,
  .city-building,
  .phone-app,
  .location-back,
  .phone-object,
  .scoop-list-item {
    border: 1px solid ButtonText;
  }
  .brand-star,
  .notification-dot,
  .bestie-tip::before,
  .scenario-ready::before,
  .exam-progress i.on {
    forced-color-adjust: none;
    background: CanvasText;
  }
  .exam-progress i,
  .studio-timeline li::before {
    border: 1px solid CanvasText;
  }
  .hero-sprite,
  .mentor-sprite,
  .decor {
    forced-color-adjust: none;
  }
}
