/* База: токены, фон, меню, карта, магазин, настройки, результат. */
:root {
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.72);
  --ink-faint: rgba(255, 255, 255, 0.45);
  --panel: rgba(30, 13, 48, 0.72);
  --panel-solid: #1b0d2b;
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-soft: rgba(255, 255, 255, 0.08);
  --accent: #ff3fb0;
  --accent-2: #8b5cf6;
  --accent-3: #22e0d6;
  --gold: #ffd166;
  --good: #3ef0a4;
  --bad: #ff3b62;
  --font-display: 'Comfortaa', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-ui: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-lg: 28px;
  --r-md: 18px;
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.5);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #12061c;
  color: var(--ink);
  font-family: var(--font-ui);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button { font-family: inherit; color: inherit; }

/* ------------------------------------------------------------------ фон */
.bg-photo {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center 42%;
  transform: scale(1.04);
  transition: opacity 0.45s ease, filter 0.6s ease;
  z-index: 0;
}
body[data-screen="game"] .bg-photo { opacity: 0; }
body[data-screen="map"] .bg-photo,
body[data-screen="shop"] .bg-photo,
body[data-screen="settings"] .bg-photo,
body[data-screen="result"] .bg-photo { filter: blur(3px) brightness(0.5) saturate(1.1); }

body[data-hall="night"] .bg-photo { filter: brightness(0.55) saturate(1.2) hue-rotate(-12deg); }
body[data-hall="sunset"] .bg-photo { filter: brightness(1.02) saturate(1.15) sepia(0.18); }
body[data-hall="fog"] .bg-photo { filter: brightness(0.92) saturate(0.65); }

.bg-grade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 78% 30%, rgba(255, 63, 176, 0.18), transparent 60%),
    radial-gradient(90% 80% at 15% 85%, rgba(90, 40, 200, 0.28), transparent 65%),
    linear-gradient(180deg, rgba(14, 5, 24, 0.86) 0%, rgba(14, 5, 24, 0.32) 32%, rgba(12, 4, 20, 0.72) 78%, rgba(10, 3, 18, 0.95) 100%);
}
body[data-screen="menu"] .bg-grade {
  background:
    radial-gradient(80% 70% at 78% 32%, rgba(255, 63, 176, 0.22), transparent 62%),
    linear-gradient(100deg, rgba(12, 4, 22, 0.94) 0%, rgba(12, 4, 22, 0.72) 42%, rgba(12, 4, 22, 0.28) 70%, rgba(12, 4, 22, 0.55) 100%),
    linear-gradient(180deg, rgba(12, 4, 22, 0.5) 0%, transparent 30%, rgba(10, 3, 18, 0.85) 100%);
}
.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 220px 40px rgba(4, 0, 10, 0.85);
}

.bg-notes { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.bg-notes i {
  position: absolute;
  color: rgba(255, 255, 255, 0.10);
  font-size: 34px;
  animation: floatNote 22s linear infinite;
}
.bg-notes i:nth-child(1) { left: 8%;  animation-duration: 26s; animation-delay: -2s; font-size: 26px; }
.bg-notes i:nth-child(2) { left: 26%; animation-duration: 32s; animation-delay: -12s; font-size: 44px; }
.bg-notes i:nth-child(3) { left: 54%; animation-duration: 24s; animation-delay: -6s; font-size: 30px; }
.bg-notes i:nth-child(4) { left: 72%; animation-duration: 36s; animation-delay: -18s; font-size: 38px; }
.bg-notes i:nth-child(5) { left: 90%; animation-duration: 28s; animation-delay: -9s; font-size: 24px; }
@keyframes floatNote {
  0% { transform: translateY(110vh) rotate(-12deg); opacity: 0; }
  15% { opacity: 0.9; }
  85% { opacity: 0.5; }
  100% { transform: translateY(-15vh) rotate(18deg); opacity: 0; }
}

/* --------------------------------------------------------------- экраны */
.screen {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.995);
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.screen.active { opacity: 1; pointer-events: auto; transform: none; }
.screen-game { z-index: 5; }
.screen-result { z-index: 6; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(18px + var(--safe-top)) clamp(18px, 3.4vw, 48px) 12px;
  flex: 0 0 auto;
}
#screen-menu .topbar { padding-bottom: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.screen-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: 0.01em;
}
.topbar .stars-chip { margin-left: auto; }
.screen-title + .stars-chip { margin-left: auto; }

.icon-btn {
  width: 46px; height: 46px;
  display: inline-grid; place-items: center;
  border-radius: 15px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, border-color 0.18s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.13); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.back { margin-right: 2px; }
.icon-btn.off { opacity: 0.55; }
.icon-btn.glass { background: rgba(18, 8, 30, 0.55); backdrop-filter: blur(12px); }

.stars-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px 0 12px;
  border-radius: 15px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.16), rgba(255, 150, 60, 0.08));
  font-weight: 900;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.stars-chip svg { width: 21px; height: 21px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.6)); }

/* --------------------------------------------------------------- кнопки */
.btn {
  --btn-top: rgba(255, 255, 255, 0.1);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: var(--ink);
  background: var(--btn-top);
  transition: transform 0.1s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn:active { transform: translateY(3px); }

.btn-primary {
  background: linear-gradient(180deg, #ff86cc 0%, #ff3fa8 52%, #f0258f 100%);
  color: #320a26;
  box-shadow: 0 7px 0 #b01268, 0 18px 40px rgba(255, 47, 158, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { box-shadow: 0 3px 0 #b01268, 0 8px 20px rgba(255, 47, 158, 0.3); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); }

.btn-mini {
  padding: 11px 16px;
  font-size: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-soft);
  color: var(--ink-dim);
}
.btn-mini svg { width: 17px; height: 17px; }
.btn-mini b {
  margin-left: 2px;
  font-size: 12px;
  color: var(--gold);
}
.btn-mini.done b { color: var(--good); }
.btn-mini:hover { color: var(--ink); background: rgba(255, 255, 255, 0.11); }

.btn-danger { background: rgba(255, 59, 98, 0.16); border: 1px solid rgba(255, 59, 98, 0.4); color: #ffb9c6; }
.btn-danger:hover { background: rgba(255, 59, 98, 0.26); }
.btn.small { padding: 11px 18px; font-size: 14px; border-radius: 13px; }
.btn.flat { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.btn:disabled { opacity: 0.75; cursor: default; transform: none; }

.btn-xl {
  padding: 18px 30px 20px;
  font-size: 21px;
  border-radius: 22px;
  width: min(380px, 100%);
  justify-content: flex-start;
  text-align: left;
}
.play-ico {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(50, 10, 38, 0.22);
  flex: 0 0 auto;
}
.play-ico svg { width: 24px; height: 24px; margin-left: 3px; }
.play-labels { display: flex; flex-direction: column; gap: 2px; line-height: 1.05; }
.play-labels b { font-size: 21px; letter-spacing: 0.01em; }
.play-labels small { font-size: 12.5px; font-weight: 800; opacity: 0.72; letter-spacing: 0.02em; }

/* ---------------------------------------------------------------- меню */
#screen-menu {
  padding: 0 clamp(18px, 4vw, 64px);
}
.menu-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(340px, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: clamp(12px, 3vw, 48px);
  padding: clamp(8px, 2vh, 28px) 0;
  min-height: 0;
}
.menu-copy { max-width: 640px; animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 14px;
}
.kicker span {
  width: 26px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.logo {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 5.6vw, 86px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  background: linear-gradient(100deg, #ff8ad1 0%, #ff3fa8 45%, #ff2dbb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 63, 176, 0.65)) drop-shadow(0 0 44px rgba(255, 63, 176, 0.4));
}
.logo em {
  font-style: normal;
  background: linear-gradient(100deg, #ff8ad1 0%, #ff3fa8 45%, #ff2dbb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 63, 176, 0.65)) drop-shadow(0 0 44px rgba(255, 63, 176, 0.4));
}
.lede {
  margin: 0 0 clamp(18px, 3vh, 30px);
  max-width: 44ch;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.5;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.74);
}
.menu-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.menu-actions .row { display: flex; gap: 10px; width: min(380px, 100%); }
.menu-actions .row .btn { flex: 1; }
.menu-actions .row .btn-mini { flex: 1 1 auto; }

.menu-progress {
  margin-top: clamp(12px, 2vh, 22px);
  width: min(380px, 100%);
}
.mp-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.mp-top b { color: var(--gold); letter-spacing: 0.02em; }
.mp-bar { height: 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.mp-bar i {
  display: block; height: 100%; width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff8ad1, var(--gold));
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.55);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-stage {
  position: relative;
  height: min(64vh, 600px);
  min-height: 300px;
  align-self: end;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.menu-stage canvas#menu-hero {
  position: relative;
  height: 100%;
  width: min(78%, 380px);
  z-index: 3;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45));
  animation: stageIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes stageIn { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: none; } }
.spot {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 78%;
  height: 96%;
  transform: translateX(-50%);
  background: conic-gradient(from 180deg at 50% 100%, transparent 0deg, rgba(255, 120, 200, 0.16) 30deg, transparent 60deg);
  filter: blur(16px);
  z-index: 1;
  pointer-events: none;
}
.stage-floor {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 76%;
  height: 12%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 120, 200, 0.35), rgba(120, 40, 180, 0.05) 70%, transparent);
  filter: blur(6px);
  z-index: 2;
}
.coach {
  position: absolute;
  left: clamp(18px, 4vw, 64px);
  bottom: calc(46px + var(--safe-bottom));
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: min(420px, 46vw);
  pointer-events: none;
}
.coach canvas { width: 106px; height: 146px; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.45)); }
.coach-say {
  margin-bottom: 26px;
  position: relative;
  padding: 12px 15px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, 0.94);
  color: #2a0f30;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  max-width: 232px;
}

.menu-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0 calc(18px + var(--safe-bottom));
  border-top: 1px solid var(--stroke-soft);
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 800;
  letter-spacing: 0.03em;
}
.foot-item { display: flex; align-items: baseline; gap: 7px; }
.foot-item b { font-size: 16px; color: var(--ink); font-family: var(--font-display); }
.foot-sep { width: 1px; height: 18px; background: var(--stroke-soft); }
.foot-note { margin-left: auto; text-transform: uppercase; letter-spacing: 0.14em; font-size: 10.5px; }

/* ---------------------------------------------------------------- карта */
.map-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 6px clamp(18px, 3.4vw, 48px) 40px;
  -webkit-overflow-scrolling: touch;
}
.style-tabs { display: flex; gap: 9px; margin-bottom: 18px; flex-wrap: wrap; }
.style-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.style-tab:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.style-tab.active { background: rgba(255, 255, 255, 0.14); color: var(--ink); border-color: rgba(255, 255, 255, 0.28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.style-tab.locked { opacity: 0.62; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.st-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--gold); }
.st-lock svg { width: 13px; height: 13px; }

.style-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke-soft);
  background-color: rgba(20, 8, 32, 0.55);
  background-size: cover;
  background-position: center 42%;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  min-height: 132px;
}
.style-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(12, 4, 22, 0.94) 0%, rgba(12, 4, 22, 0.78) 46%, rgba(12, 4, 22, 0.35) 100%);
}
.style-head > * { position: relative; z-index: 1; }
.sh-kicker { font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); font-weight: 900; }
.style-head h2 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.01em;
}
.style-head h2::after {
  content: '';
  display: inline-block;
  width: 34px; height: 4px; border-radius: 3px;
  margin-left: 12px;
  vertical-align: middle;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}
.style-head p { margin: 0; color: var(--ink-dim); font-size: 14px; font-weight: 600; max-width: 52ch; }
.sh-right { text-align: right; flex: 0 0 auto; }
.sh-stars { display: inline-flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 900; font-family: var(--font-display);
  background: rgba(10, 3, 20, 0.55); padding: 6px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.12); }
.sh-stars svg { width: 22px; height: 22px; color: var(--gold); }
.sh-stars span { font-size: 14px; color: var(--ink-faint); font-family: var(--font-ui); }
.sh-need { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px;
}
.level-card {
  position: relative;
  text-align: left;
  padding: 14px 15px 13px;
  border-radius: 20px;
  border: 1px solid var(--stroke-soft);
  background: linear-gradient(165deg, rgba(40, 18, 60, 0.55), rgba(18, 7, 30, 0.5));
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}
.level-card::after {
  content: '';
  position: absolute;
  inset: auto -30% -60% -30%;
  height: 90%;
  background: radial-gradient(closest-side, rgba(255, 63, 176, 0.18), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.level-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.26); background: linear-gradient(165deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)); }
.level-card:hover::after { opacity: 1; }
.level-card.done { border-color: rgba(255, 209, 102, 0.22); }
.level-card.locked { opacity: 0.55; cursor: default; }
.level-card.locked:hover { transform: none; }
.lc-top { display: flex; align-items: center; justify-content: space-between; }
.lc-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
}
.lc-go, .lc-lock { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--ink-dim); }
.lc-go svg, .lc-lock svg { width: 14px; height: 14px; }
.lc-go svg { margin-left: 2px; }
.lc-title { font-weight: 800; font-size: 14px; line-height: 1.25; letter-spacing: 0.005em; }
.lc-stars { display: flex; gap: 3px; margin-top: auto; }
.lc-stars i { color: rgba(255, 255, 255, 0.20); display: inline-flex; }
.lc-stars i svg { width: 14px; height: 14px; }
.lc-stars i.on { color: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 209, 102, 0.7)); }
.lc-meta { font-size: 11px; font-weight: 800; letter-spacing: 0.03em; color: var(--ink-faint); }

/* -------------------------------------------------------------- магазин */
.shop-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 6px clamp(18px, 3.4vw, 48px) 40px;
}
.shop-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.shop-tab {
  padding: 10px 18px;
  border-radius: 13px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  font-weight: 900;
  font-size: 13.5px;
  cursor: pointer;
}
.shop-tab.active { background: rgba(255, 255, 255, 0.15); color: var(--ink); border-color: rgba(255, 255, 255, 0.26); }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}
.shop-card {
  border-radius: 22px;
  border: 1px solid var(--stroke-soft);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.shop-card:hover { transform: translateY(-2px); }
.shop-card.equipped { border-color: rgba(62, 240, 164, 0.45); box-shadow: 0 0 0 1px rgba(62, 240, 164, 0.18) inset; }
.sc-preview {
  height: 158px;
  position: relative;
  background: radial-gradient(70% 80% at 50% 30%, rgba(255, 120, 200, 0.22), rgba(20, 8, 32, 0.6));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.sc-preview canvas { display: block; }
.hall-prev { background-size: cover; background-position: center; }
.hall-prev[data-grade="night"] { filter: brightness(0.55) saturate(1.2); }
.hall-prev[data-grade="sunset"] { filter: saturate(1.2) sepia(0.2) brightness(1.05); }
.hall-prev[data-grade="fog"] { filter: saturate(0.6) brightness(0.95); }
.hall-prev::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(20, 8, 32, 0.85));
}
.booster-prev {
  display: grid;
  place-items: center;
  height: 118px;
}
.booster-prev svg { width: 44px; height: 44px; color: var(--accent); filter: drop-shadow(0 0 16px rgba(255, 63, 176, 0.5)); }
.booster-prev b {
  position: absolute;
  top: 12px; right: 14px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 9px;
  border-radius: 9px;
}
.sc-body { padding: 12px 15px 6px; flex: 1; }
.sc-name { font-weight: 900; font-size: 15px; margin-bottom: 3px; }
.sc-desc { font-size: 12px; line-height: 1.35; color: var(--ink-faint); font-weight: 700; }
.sc-foot { padding: 10px 15px 14px; }
.sc-foot .btn { width: 100%; padding: 11px 14px; font-size: 13.5px; }
.btn-buy { background: rgba(255, 209, 102, 0.14); border: 1px solid rgba(255, 209, 102, 0.35); color: #ffe6a8; }
.btn-buy svg { width: 16px; height: 16px; color: var(--gold); }
.btn-buy:hover { background: rgba(255, 209, 102, 0.22); }
.btn-buy.equipped { background: rgba(62, 240, 164, 0.12); border-color: rgba(62, 240, 164, 0.35); color: var(--good); }
.shop-note {
  margin: 22px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------ настройки */
.settings-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 6px clamp(18px, 3.4vw, 48px) 40px;
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-content: start;
}
.settings-card, .about-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke-soft);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  padding: 22px;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--stroke-soft);
}
.set-row:last-of-type { border-bottom: 0; }
.set-row label { font-weight: 800; font-size: 14.5px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: min(220px, 46vw);
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff86cc, #ff3fa8);
  box-shadow: 0 2px 10px rgba(255, 63, 176, 0.6);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: #ff3fa8; cursor: pointer;
}
.set-stats { margin-top: 16px; font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.about-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 20px;
  background: linear-gradient(100deg, #ff8ad1 0%, #ff3fa8 45%, #ff2dbb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 63, 176, 0.5));
}
.about-card p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); font-weight: 600; }
.about-card ul { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-dim); font-weight: 600; }
.about-card li { margin-bottom: 6px; }
.about-card .tiny { font-size: 11.5px; color: var(--ink-faint); }

/* -------------------------------------------------------------- результат */
.result-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(240px, 0.85fr);
  align-items: center;
  gap: clamp(10px, 3vw, 48px);
  padding: 4vh clamp(18px, 5vw, 72px) 5vh;
}
.result-card {
  max-width: 560px;
  padding: clamp(22px, 3vw, 36px);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--accent);
  background: linear-gradient(165deg, rgba(56, 26, 82, 0.9), rgba(20, 8, 34, 0.96));
  box-shadow: var(--shadow-lg), 0 0 60px rgba(255, 63, 176, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  animation: rise 0.4s ease both;
}
.result-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 900;
}
.result-card h2 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.01em;
}
.result-stars { display: flex; gap: 8px; margin: 10px 0 14px; }
.big-star { display: inline-flex; color: rgba(255, 255, 255, 0.14); transform: scale(0.9); }
.big-star svg { width: clamp(40px, 5.4vw, 60px); height: clamp(40px, 5.4vw, 60px); }
.big-star.on {
  color: var(--gold);
  filter: drop-shadow(0 0 22px rgba(255, 209, 102, 0.7));
  animation: starPop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: var(--d);
}
@keyframes starPop { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.result-comment {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
  z-index: 12;
  pointer-events: none;
  margin: 0 0 20px;
  max-width: min(88vw, 860px);
  padding: 22px 36px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(26px, 5.2vw, 52px);
  line-height: 1.22;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.005em;
  background: linear-gradient(165deg, rgba(40, 16, 60, 0.92), rgba(18, 6, 32, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 60px rgba(255, 63, 176, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  animation: resultCommentIn 0.6s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
@keyframes resultCommentIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: none; }
}
.result-comment:empty { display: none; }
.result-stats { font-size: 12.5px; font-weight: 800; color: var(--ink-faint); letter-spacing: 0.02em; margin-bottom: 22px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-actions .btn-primary { flex: 1 1 100%; }
.result-actions .btn-ghost { flex: 1 1 0; }
.result-stage { position: relative; height: min(56vh, 460px); display: flex; align-items: flex-end; justify-content: center; }
.result-stage canvas { position: relative; height: 100%; width: min(88%, 320px); z-index: 2; filter: drop-shadow(0 20px 26px rgba(0, 0, 0, 0.45)); }
body[data-result="gold"] .result-stage .spot { background: conic-gradient(from 180deg at 50% 100%, transparent 0deg, rgba(255, 209, 102, 0.3) 30deg, transparent 60deg); }

/* ------------------------------------------------------------------ тосты */
#toast-wrap {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 14px;
  background: rgba(24, 10, 38, 0.94);
  border: 1px solid var(--stroke);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease both;
  max-width: 84vw;
  text-align: center;
}
.toast.out { animation: toastOut 0.4s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ------------------------------------------------------------------ модал */
.modal-root { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.modal-root[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(6, 2, 12, 0.68); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  width: min(420px, 90vw);
  padding: 26px;
  border-radius: 26px;
  background: linear-gradient(165deg, #35194c, #1c0d2b);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  animation: rise 0.25s ease both;
}
.modal-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 21px; }
.modal-card p { margin: 0 0 20px; font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); font-weight: 600; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* -------------------------------------------------------------- адаптив */
@media (max-width: 780px) {
  .menu-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(150px, 1fr);
    overflow: hidden;
    gap: 6px;
    padding-bottom: 6px;
  }
  .menu-copy { order: 1; align-self: start; }
  .menu-stage { order: 2; height: 100%; min-height: 150px; margin-top: 0; }
  .logo { font-size: clamp(32px, 6.4vw, 54px); margin-bottom: 10px; }
  .lede { font-size: 13.5px; margin-bottom: 16px; max-width: 60ch; }
  .kicker { margin-bottom: 10px; }
  .menu-actions { gap: 9px; }
  .menu-progress { margin-top: 14px; }
  .menu-stage canvas#menu-hero { width: 46%; }
  .coach { display: none; }
  .settings-wrap, .result-wrap { grid-template-columns: 1fr; }
  .result-stage { height: 30vh; order: -1; }
  .menu-foot { flex-wrap: wrap; gap: 10px; padding-top: 12px; }
  .foot-note { display: none; }
}
@media (max-width: 620px) {
  .topbar { padding-top: calc(12px + var(--safe-top)); gap: 8px; }
  .brand { font-size: 10.5px; letter-spacing: 0.1em; }
  .stars-chip { height: 40px; padding: 0 12px 0 10px; font-size: 15px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .icon-btn svg { width: 19px; height: 19px; }
  .logo { font-size: clamp(34px, 10.5vw, 52px); }
  .lede { font-size: 13.5px; }
  .btn-xl { padding: 14px 18px 16px; font-size: 18px; }
  .play-ico { width: 38px; height: 38px; }
  .play-labels b { font-size: 18px; }
  .menu-actions .row { flex-direction: column; }
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
  .sc-preview { height: 128px; }
  .style-head { flex-direction: column; align-items: flex-start; }
  .sh-right { text-align: left; }
  .menu-foot { padding-bottom: calc(10px + var(--safe-bottom)); }
}


/* меню: крупнее текст */
.menu-copy .kicker { font-size: 13.5px; letter-spacing: 0.2em; margin-bottom: 16px; }
.menu-copy .lede { font-size: clamp(17px, 1.35vw, 20.5px); line-height: 1.55; max-width: 42ch; font-weight: 600; color: rgba(255,255,255,0.82); }
.mp-top { font-size: 14px; }
.mp-top b { font-size: 15px; }
.menu-actions .btn { font-size: 17px; letter-spacing: 0.04em; }
.menu-actions .btn-mini { font-size: 13.5px; }
.coach-say { font-size: 16px !important; line-height: 1.35; }
.menu-foot { font-size: 13px; }
.menu-foot b { font-size: 14px; }
@media (max-width: 860px) {
  .menu-copy .lede { font-size: 16.5px; }
  .coach-say { font-size: 14.5px !important; }
}
@media (max-width: 620px) {
  .menu-copy .lede { font-size: 15.5px; }
  .menu-copy .kicker { font-size: 11.5px; }
  .coach-say { font-size: 13.5px !important; }
}


/* меню: фигура хореографа убрана, реплика — крупной плашкой под прогрессом */
[data-screen="menu"] .coach {
  position: static;
  display: block;
  max-width: none;
  margin: 16px 0 0;
  padding-left: clamp(18px, 4vw, 64px);
}
[data-screen="menu"] .coach canvas { display: none; }
[data-screen="menu"] .coach-say {
  display: inline-block;
  max-width: min(520px, 46vw);
  margin: 0;
  padding: 14px 18px;
  font-size: 16.5px;
  line-height: 1.4;
  border-radius: 18px 18px 18px 5px;
}
@media (max-width: 860px) and (min-height: 1px) {
  [data-screen="menu"] .coach-say { max-width: 78vw; font-size: 15px; }
}
