/* Bonix Match — стиль: тёмный графит, синий Bonix, золото; заголовки и цифры — Russo One. */

@font-face {
  font-family: 'Russo One';
  src: url('./assets/fonts/RussoOne.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg0: #12161F;
  --bg1: #1B2333;
  --blue: #3969B5;
  --blue-l: #5B8FDB;
  --blue-d: #334970;
  --gold: #F5C542;
  --gold-l: #FFE9A3;
  --gold-d: #B9800F;
  --text: #EEF3FB;
  --muted: #8E9AB2;
  --panel: linear-gradient(180deg, rgba(50, 69, 110, 0.94), rgba(24, 33, 56, 0.96));
  --panel-edge: rgba(130, 160, 220, 0.2);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --gap: 8px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--text);
  font-family: 'Russo One', system-ui, sans-serif;
  font-weight: 400;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(130% 55% at 50% -14%, rgba(57, 105, 181, 0.45), rgba(57, 105, 181, 0) 62%),
    radial-gradient(90% 40% at 50% 112%, rgba(51, 73, 112, 0.6), rgba(51, 73, 112, 0) 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.016) 0 2px, transparent 2px 16px),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
  background-color: var(--bg0);
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; }

#app {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
}

/* ---------- загрузка ---------- */

.loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: inherit;
  z-index: 100;
  transition: opacity 0.35s ease, visibility 0.35s;
}
.loader-logo { width: 150px; filter: drop-shadow(0 0 18px rgba(80, 140, 255, 0.6)); }
.loader-bar { width: 120px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.loader-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--gold); animation: loader 1s ease-in-out infinite; }
@keyframes loader { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
body.ready .loader { opacity: 0; visibility: hidden; }
.boot-error { margin: auto; padding: 24px; text-align: center; color: var(--muted); }

/* ---------- игровой экран ---------- */

.game-screen {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(var(--safe-t) + var(--gap)) calc(var(--safe-r) + var(--gap)) calc(var(--safe-b) + 6px) calc(var(--safe-l) + var(--gap));
}

.hud-host { flex: none; position: relative; z-index: 2; }
/* HUD и нижняя панель — по ширине поля (на ПК не растягиваются шире него) */
.hud-host, .bottom-bar { width: 100%; max-width: max(344px, calc(var(--board-w, 720px) + 24px)); margin-left: auto; margin-right: auto; }

.board-host {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  /* поле на всю ширину экрана: рамка поля сама держит отступ */
  margin: 0 calc(-1 * (var(--safe-r) + var(--gap))) 0 calc(-1 * (var(--safe-l) + var(--gap)));
}
.board-canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  touch-action: none;
}

.bottom-bar {
  flex: none;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #3A5283, #1F2B48) padding-box,
              linear-gradient(180deg, rgba(160, 190, 245, 0.55), rgba(60, 80, 120, 0.3)) border-box;
  border: 1.5px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 5px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, filter 0.2s;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35)); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.off { color: #9AA6BF; }
@media (hover: hover) { .icon-btn:hover { filter: brightness(1.15); } }

.level-tag { display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; }
.level-num { font-size: 15px; letter-spacing: 0.02em; }
.level-chapter { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- HUD ---------- */

.hud { display: flex; flex-direction: column; gap: 7px; }

.hud-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 8px 22px rgba(0, 0, 0, 0.38);
}

.hud-cap {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(225, 233, 248, 0.72);
}

.hud-moves {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  background: radial-gradient(120% 90% at 50% 0%, #6B9BE2 0%, #3969B5 48%, #253E70 100%) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 45%, var(--gold-d)) border-box;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}
.hud-moves-num { font-size: 26px; line-height: 1; text-shadow: 0 2px 0 rgba(10, 20, 45, 0.55); }
.hud-moves .hud-cap { margin-top: 2px; color: rgba(255, 255, 255, 0.85); }
.hud-moves.low .hud-moves-num { color: #FFB4A6; animation: lowPulse 0.9s ease-in-out infinite; }
@keyframes lowPulse { 50% { color: #FF6B57; transform: scale(1.08); } }

.hud-goals { display: flex; justify-content: center; gap: 8px; min-width: 0; }
.goal { position: relative; display: flex; flex-direction: column; align-items: center; }
.goal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 20, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.goal-icon img { width: 100%; height: 100%; display: block; }
.goal-trophy svg { width: 26px; height: 26px; fill: var(--gold); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.4)); }
.goal-left {
  margin-top: -7px;
  min-width: 28px;
  padding: 1px 7px 2px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  background: linear-gradient(180deg, #1B2540, #0C121F);
  border: 1px solid rgba(150, 175, 225, 0.28);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}
.goal-done {
  position: absolute;
  bottom: -5px;
  width: 22px;
  height: 22px;
  display: none;
  z-index: 2;
}
.goal-done svg { width: 100%; height: 100%; fill: #2FBF62; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.goal.done .goal-left { visibility: hidden; }
.goal.done .goal-done { display: block; animation: pop 0.4s cubic-bezier(.3, 1.6, .5, 1); }
.goal.done .goal-icon { box-shadow: inset 0 0 0 2px rgba(47, 191, 98, 0.7); }
.goal-icon.hit { animation: goalHit 0.28s ease-out; }
@keyframes goalHit {
  0% { transform: scale(1); filter: brightness(1); }
  40% { transform: scale(1.2); filter: brightness(1.6) drop-shadow(0 0 8px rgba(255, 220, 120, 0.9)); }
  100% { transform: scale(1); filter: brightness(1); }
}

.hud-score { display: flex; flex-direction: column; align-items: flex-end; min-width: 72px; }
.hud-score-num {
  font-size: 21px;
  line-height: 1.1;
  background: linear-gradient(180deg, #FFF4C8, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
  white-space: nowrap;
}

.bump { animation: bump 0.26s ease-out; }
@keyframes bump { 40% { transform: scale(1.14); } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

.hud-bars { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; align-items: center; padding: 0 2px; }

.track {
  position: relative;
  height: 12px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(4, 7, 14, 0.72);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.07);
}
.track .fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: inherit;
  transition: transform 0.35s cubic-bezier(.3, .7, .3, 1);
}
.score-bar { position: relative; height: 24px; display: flex; align-items: center; }
.score-bar .track { flex: 1; }
.score-bar .fill { background: linear-gradient(180deg, #FFE99A, var(--gold) 50%, #D3920F); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.bar-star {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}
.bar-star svg { width: 100%; height: 100%; fill: #3B4763; stroke: rgba(10, 15, 28, 0.85); stroke-width: 1.4; stroke-linejoin: round; }
.bar-star.on svg { fill: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 200, 70, 0.85)); }
.bar-star.pop { animation: starPop 0.5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes starPop { 0% { transform: translate(-50%, -50%) scale(0.4); } 100% { transform: translate(-50%, -50%) scale(1); } }

.turbo { display: flex; align-items: center; }
.turbo-badge {
  position: relative;
  z-index: 1;
  flex: none;
  width: 30px;
  height: 30px;
  margin-right: -8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  background: radial-gradient(circle at 50% 30%, #5E92DE, #3969B5 55%, #233B6B) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 50%, var(--gold-d)) border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.turbo-badge img { width: 82%; display: block; }
.turbo .track { flex: 1; height: 14px; }
.turbo .fill { background: linear-gradient(90deg, #2E5AA8, #5E92DE 70%, #FFD45A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.turbo-cap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}
.turbo.hot .turbo-badge { animation: hot 0.9s ease-in-out infinite; }
.turbo.hot .fill { animation: hotFill 0.9s ease-in-out infinite; }
@keyframes hot { 50% { box-shadow: 0 0 12px 3px rgba(255, 205, 80, 0.75); transform: scale(1.06); } }
@keyframes hotFill { 50% { filter: brightness(1.35); } }
.turbo.burst .turbo-badge { animation: burst 0.6s ease-out; }
@keyframes burst {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 220, 120, 0.9); }
  40% { transform: scale(1.35); box-shadow: 0 0 22px 8px rgba(255, 220, 120, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 220, 120, 0); }
}

/* полёт собранных фишек к цели */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.flyer { position: absolute; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }

/* узкие и низкие экраны */
@media (max-width: 370px) {
  .hud-moves { width: 52px; height: 52px; }
  .hud-moves-num { font-size: 23px; }
  .goal-icon { width: 36px; height: 36px; }
  .hud-goals { gap: 5px; }
  .hud-score { min-width: 62px; }
  .hud-score-num { font-size: 18px; }
}
@media (max-height: 600px) {
  .bottom-bar { height: 42px; }
  .icon-btn { width: 40px; height: 40px; }
}

/* ПК и планшеты: HUD крупнее, под размер поля */
@media (min-width: 720px) and (min-height: 700px) {
  .hud { gap: 10px; }
  .hud-main { padding: 8px 14px 8px 8px; border-radius: 22px; }
  .hud-moves { width: 70px; height: 70px; border-radius: 18px; }
  .hud-moves-num { font-size: 32px; }
  .hud-cap { font-size: 11px; }
  .goal-icon { width: 52px; height: 52px; border-radius: 14px; }
  .goal-left { font-size: 15px; min-width: 34px; }
  .hud-goals { gap: 14px; }
  .hud-score { min-width: 100px; }
  .hud-score-num { font-size: 28px; }
  .track { height: 14px; }
  .turbo .track { height: 16px; }
  .turbo-badge { width: 36px; height: 36px; }
  .bar-star { width: 28px; height: 28px; }
  .turbo-cap { font-size: 10px; }
  .bottom-bar { height: 60px; }
  .icon-btn { width: 52px; height: 52px; }
  .level-num { font-size: 18px; }
}

/* =====================================================================
   Экраны приложения (таск 05): заставка, карта, карточка уровня, окна, обучение
   ===================================================================== */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.screen.enter { opacity: 0; transform: translateY(14px); }
.screen.leave { opacity: 0; pointer-events: none; }
.screen-game { justify-content: flex-start; }

.slot:empty { display: none; }

/* ---------- кнопки ---------- */

.btn {
  height: 50px;
  width: 100%;
  border-radius: 16px;
  font-size: 18px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.2s;
}
.btn:active { transform: translateY(3px) scale(0.98); }
@media (hover: hover) { .btn:hover { filter: brightness(1.08); } }
.btn-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.btn-ico svg { width: 100%; height: 100%; fill: currentColor; }
.btn-primary {
  color: #2B1A00;
  background: linear-gradient(180deg, #FFE9A0, var(--gold) 50%, #D9980F);
  box-shadow: 0 5px 0 #8C5F08, 0 10px 18px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:active { box-shadow: 0 2px 0 #8C5F08, 0 5px 10px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.btn-ghost {
  color: #fff;
  background: linear-gradient(180deg, #4A78C4, #2D4F8E);
  box-shadow: 0 5px 0 #1C3363, 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.btn-ghost:active { box-shadow: 0 2px 0 #1C3363, 0 5px 10px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #E65A4D, #B3261E);
  box-shadow: 0 5px 0 #6E120D, 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.btn-xl { height: 62px; font-size: 24px; border-radius: 20px; }
.btn-xl .btn-ico { width: 26px; height: 26px; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-pair .btn { font-size: 16px; padding: 0 8px; gap: 6px; }
.btn-pair .btn-ico { width: 18px; height: 18px; }
.icon-btn.sm { width: 42px; height: 42px; }
.icon-btn.sm svg { width: 20px; height: 20px; }

/* ---------- плашки логотипов брендов ---------- */

.logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;           /* логотип никогда не вылезает из плашки (WebKit: img в auto-треке grid брал родной размер SVG) */
  flex: none;
  width: 104px;
  height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--plate, #fff);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.logo-plate img { display: block; width: 100%; height: 100%; min-width: 0; object-fit: contain; }
.logo-plate.big { width: 156px; height: 66px; padding: 9px 14px; border-radius: 16px; }

/* ---------- окна ---------- */

.dlg {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);
  background: rgba(5, 8, 15, 0.64);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.22s ease;
  overflow-y: auto;
}
.dlg.show { opacity: 1; }
.dlg.hide { opacity: 0; pointer-events: none; }
.dlg-card {
  position: relative;
  width: min(100%, 360px);
  padding: 22px 20px 20px;
  border-radius: 26px;
  text-align: center;
  border: 2px solid transparent;
  background: radial-gradient(120% 60% at 50% 0%, rgba(91, 143, 219, 0.35), rgba(91, 143, 219, 0) 70%) padding-box,
              linear-gradient(180deg, #2E4372, #18223A) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 30%, rgba(185, 128, 15, 0.55)) border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: scale(0.86) translateY(12px);
  transition: transform 0.36s cubic-bezier(.3, 1.45, .5, 1);
}
.dlg.show .dlg-card { transform: none; }
.dlg.hide .dlg-card { transform: scale(0.94); transition-duration: 0.2s; }
.dlg-title {
  font-size: 30px;
  line-height: 1.1;
  background: linear-gradient(180deg, #FFF6D0, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.dlg-title.small { font-size: 24px; }
.dlg-sub { margin-top: 6px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.dlg-text { margin: 12px 0 4px; font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #D3DCEC; }
.dlg-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.dlg-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #C9D4EA;
  background: rgba(6, 10, 20, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.dlg-close svg { width: 18px; height: 18px; }
.dlg-close:active { transform: scale(0.9); }

/* переключатель (звук) */
.toggle-row {
  width: 100%;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(6, 10, 20, 0.38);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  text-align: left;
}
.toggle-ico { width: 24px; height: 24px; color: #9AA6BF; }
.toggle-ico svg { width: 100%; height: 100%; fill: currentColor; }
.toggle-label { flex: 1; font-size: 17px; }
.switch {
  position: relative;
  width: 50px;
  height: 28px;
  border-radius: 14px;
  background: #2A3247;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: background 0.2s;
}
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #C9D2E3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s cubic-bezier(.3, 1.4, .5, 1);
}
.toggle-row.on .switch { background: linear-gradient(180deg, #FFD966, #D9980F); }
.toggle-row.on .switch i { transform: translateX(22px); }
.toggle-row.on .toggle-ico { color: var(--gold); }

/* ---------- заставка ---------- */

.splash {
  justify-content: center;
  gap: 26px;
  padding: calc(var(--safe-t) + 64px) calc(var(--safe-r) + 20px) calc(var(--safe-b) + 28px) calc(var(--safe-l) + 20px);
  overflow: hidden;
}
.splash-top { position: absolute; top: calc(var(--safe-t) + 12px); right: calc(var(--safe-r) + 12px); display: flex; gap: 10px; z-index: 2; }
.splash-hero { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.splash-logo-wrap { position: relative; animation: heroIn 0.8s cubic-bezier(.3, 1.4, .5, 1) both; }
.splash-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(closest-side, rgba(80, 140, 255, 0.45), rgba(80, 140, 255, 0));
  z-index: -1;
  animation: glowPulse 3.2s ease-in-out infinite;
}
.splash-logo { display: block; width: min(64vw, 300px); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 16px rgba(90, 150, 255, 0.45)); }
.splash-title {
  margin: 2px 0 0;
  font-size: clamp(46px, 15vw, 72px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  background: linear-gradient(180deg, #FFF6D0, var(--gold) 52%, #C98612);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.55));
  animation: heroIn 0.8s 0.12s cubic-bezier(.3, 1.4, .5, 1) both;
}
.splash-tag { margin: 10px 0 0; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: #AFC0DE; animation: fadeUp 0.6s 0.3s both; }
.splash-brands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 360px;
  z-index: 1;
}
.splash-brands .logo-plate { animation: fadeUp 0.5s both; }
.splash-brands .logo-plate:nth-child(1) { animation-delay: 0.35s; }
.splash-brands .logo-plate:nth-child(2) { animation-delay: 0.42s; }
.splash-brands .logo-plate:nth-child(3) { animation-delay: 0.49s; }
.splash-brands .logo-plate:nth-child(4) { animation-delay: 0.56s; }
.splash-brands .logo-plate:nth-child(5) { animation-delay: 0.63s; }
.splash-actions { width: min(100%, 320px); display: flex; flex-direction: column; gap: 14px; z-index: 1; animation: fadeUp 0.6s 0.5s both; }
.splash-play { animation: playPulse 2.4s 1.4s ease-in-out infinite; }
.splash-floaters { position: absolute; inset: 0; pointer-events: none; }
.floater { position: absolute; width: 70px; height: 70px; opacity: 0.3; filter: blur(0.4px); animation: drift 9s ease-in-out infinite; }
.floater.f0 { left: 4%; top: 14%; --r: -14deg; }
.floater.f1 { right: 5%; top: 30%; --r: 12deg; animation-delay: -2s; width: 58px; height: 58px; }
.floater.f2 { left: 8%; top: 56%; --r: 8deg; animation-delay: -4s; width: 54px; height: 54px; }
.floater.f3 { right: 9%; top: 70%; --r: -10deg; animation-delay: -6s; }
.floater.f4 { left: 38%; top: 88%; --r: 16deg; animation-delay: -3s; width: 50px; height: 50px; opacity: 0.2; }
.floater.f5 { right: 24%; top: 6%; --r: -6deg; animation-delay: -5s; width: 62px; height: 62px; opacity: 0.4; }
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-16px) rotate(calc(var(--r) * -1)); } }
@keyframes heroIn { 0% { opacity: 0; transform: scale(0.7); } 100% { opacity: 1; transform: none; } }
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
@keyframes glowPulse { 50% { opacity: 0.6; transform: scale(1.06); } }
@keyframes playPulse { 0%, 100% { transform: none; } 50% { transform: scale(1.04); } }

/* ---------- карта уровней ---------- */

.map { padding: 0; }
.map-top {
  position: relative;
  z-index: 3;
  flex: none;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) 10px calc(var(--safe-l) + 12px);
}
.map-home { height: 42px; display: flex; align-items: center; padding: 0 4px; min-width: 0; flex: 0 1 auto; }
.map-home img { height: 28px; max-width: 100%; object-fit: contain; object-position: left center; display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
.map-total {
  flex: none;                 /* «28 / 90» всегда в одну строку: сжимается логотип, а не счётчик */
  margin-left: auto;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 6px;
  border-radius: 18px;
  background: rgba(6, 10, 20, 0.55);
  border: 1px solid rgba(245, 197, 66, 0.35);
  font-size: 16px;
  white-space: nowrap;
}
.map-total-star { width: 26px; height: 26px; flex: none; }
.map-total-num { white-space: nowrap; }
.map-total-star svg { width: 100%; height: 100%; fill: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 200, 70, 0.7)); }
.map-top-btns { display: flex; gap: 8px; flex: none; }

.map-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}
.map-scroll::-webkit-scrollbar { display: none; }
.map-track { position: relative; width: min(100%, 520px); margin: 0 auto; }
.map-bands { position: absolute; inset: 0; }
.map-band { position: absolute; left: 50%; width: 100vw; transform: translateX(-50%); }
.map-band.ch1 { background: radial-gradient(70% 45% at 30% 60%, rgba(91, 143, 219, 0.16), transparent 70%); }
.map-band.ch2 { background: radial-gradient(70% 45% at 70% 50%, rgba(46, 170, 190, 0.13), transparent 70%), linear-gradient(180deg, rgba(14, 40, 60, 0.25), rgba(14, 40, 60, 0)); }
.map-band.ch3 { background: radial-gradient(70% 45% at 40% 50%, rgba(245, 197, 66, 0.1), transparent 70%), linear-gradient(180deg, rgba(40, 20, 10, 0.25), rgba(40, 20, 10, 0)); }

.map-road { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-road path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.road-edge { stroke: rgba(3, 6, 12, 0.55); stroke-width: 38px; }
.road-base { stroke: #2A3550; stroke-width: 30px; }
.road-done { stroke: #3D6CB8; stroke-width: 30px; }
.road-dash { stroke: rgba(255, 255, 255, 0.4); stroke-width: 3px; stroke-dasharray: 10 14; }

.map-items { position: absolute; inset: 0; }

.node {
  position: absolute;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 2;
}
.node-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid transparent;
  background: radial-gradient(120% 90% at 50% 10%, #78A6EA 0%, #3969B5 50%, #223E73 100%) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 45%, var(--gold-d)) border-box;
  box-shadow: 0 6px 0 rgba(10, 20, 45, 0.85), 0 10px 18px rgba(0, 0, 0, 0.5), inset 0 3px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease;
}
.node:active .node-face { transform: translateY(3px); }
.node-num { font-size: 25px; line-height: 1; color: #fff; text-shadow: 0 2px 0 rgba(10, 20, 45, 0.7); }
.node-stars { position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; }
.node-stars i { width: 19px; height: 19px; display: block; }
.node-stars i:nth-child(2) { width: 22px; height: 22px; margin: 0 -2px 3px; }
.node-stars svg { width: 100%; height: 100%; fill: #3B4763; stroke: rgba(8, 12, 22, 0.9); stroke-width: 1.6; stroke-linejoin: round; }
.node-stars i.on svg { fill: var(--gold); filter: drop-shadow(0 0 3px rgba(255, 200, 70, 0.8)); }

.node.current { width: 74px; height: 74px; margin: -37px 0 0 -37px; z-index: 3; }
.node.current .node-face {
  background: radial-gradient(120% 90% at 50% 10%, #FFF3C4 0%, var(--gold) 48%, #C98612 100%) padding-box,
              linear-gradient(180deg, #fff, var(--gold-l) 40%, var(--gold-d)) border-box;
  box-shadow: 0 6px 0 #7A5207, 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 210, 90, 0.6), inset 0 3px 0 rgba(255, 255, 255, 0.6);
  animation: nodeGlow 1.8s ease-in-out infinite;
}
.node.current .node-num { font-size: 30px; color: #3A2400; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
@keyframes nodeGlow { 50% { box-shadow: 0 6px 0 #7A5207, 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 0 12px rgba(255, 210, 90, 0), inset 0 3px 0 rgba(255, 255, 255, 0.6); } 0% { box-shadow: 0 6px 0 #7A5207, 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 210, 90, 0.65), inset 0 3px 0 rgba(255, 255, 255, 0.6); } }

.node.locked .node-face {
  background: radial-gradient(120% 90% at 50% 10%, #46506A 0%, #2B3348 60%, #1D2333 100%) padding-box,
              linear-gradient(180deg, #6A7590, #2B3348) border-box;
  box-shadow: 0 5px 0 rgba(5, 8, 15, 0.85), 0 8px 14px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.1);
}
.node-lock { width: 24px; height: 24px; color: #8E9AB2; }
.node-lock svg { width: 100%; height: 100%; fill: currentColor; }
.node.shake { animation: nodeShake 0.4s ease; }
@keyframes nodeShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.node.fresh .node-face { animation: nodeFresh 0.7s 0.35s cubic-bezier(.3, 1.8, .5, 1) both, nodeGlow 1.8s 1.1s ease-in-out infinite; }
@keyframes nodeFresh { 0% { transform: scale(0.3); filter: brightness(2); } 100% { transform: scale(1); filter: none; } }

.node-pin {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 42px;
  height: 42px;
  margin-left: -21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2.5px solid transparent;
  background: radial-gradient(circle at 50% 30%, #6FA2EC, #3969B5 55%, #1E3F80) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 50%, var(--gold-d)) border-box;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  animation: pinBob 1.4s ease-in-out infinite;
  pointer-events: none;
}
.node-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top: 9px solid var(--gold-d);
  border-bottom: 0;
}
.node-pin img { width: 80%; display: block; }
@keyframes pinBob { 50% { transform: translateY(-6px); } }

.map-sign {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  transition: opacity 0.3s;
}
.map-sign .sign-plate { width: 100px; height: 38px; padding: 5px 9px; border-radius: 10px; }
.map-sign.locked { opacity: 0.72; }
.map-sign.current .sign-plate { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--gold), 0 0 14px rgba(255, 200, 70, 0.45); }
.sign-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 3px 12px 3px 3px;
  border-radius: 12px;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid rgba(150, 175, 225, 0.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}
.sign-icon img { width: 32px; height: 32px; display: block; }
.sign-icon.trophy svg { width: 26px; height: 26px; margin: 0 2px 0 4px; fill: var(--gold); }
.sign-icon b { font-weight: 400; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #C9D4EA; }
.sign-more { font-size: 12px; padding: 2px 8px; border-radius: 8px; background: rgba(8, 12, 22, 0.75); color: #C9D4EA; }

.map-gate {
  position: absolute;
  left: 50%;
  z-index: 2;
  width: min(80%, 320px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 12px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: linear-gradient(180deg, #304A7E, #19243F) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 40%, rgba(185, 128, 15, 0.6)) border-box;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.map-gate.ch2 { background: linear-gradient(180deg, #23596E, #142B3B) padding-box, linear-gradient(180deg, var(--gold-l), var(--gold) 40%, rgba(185, 128, 15, 0.6)) border-box; }
.map-gate.ch3 { background: linear-gradient(180deg, #5A3A1C, #2A1A0F) padding-box, linear-gradient(180deg, var(--gold-l), var(--gold) 40%, rgba(185, 128, 15, 0.6)) border-box; }
.gate-num { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(225, 233, 248, 0.75); }
.gate-title {
  font-size: 28px;
  line-height: 1.15;
  background: linear-gradient(180deg, #FFF6D0, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.gate-sub { display: flex; align-items: center; gap: 5px; font-size: 14px; color: #E2E9F6; }
.gate-sub i { width: 18px; height: 18px; display: block; }
.gate-sub svg { width: 100%; height: 100%; fill: var(--gold); }
.map-gate.locked { filter: saturate(0.4) brightness(0.8); }
.map-gate.locked .gate-sub svg { fill: #9AA6BF; }
.map-gate.locked .gate-sub { color: #9AA6BF; font-size: 12px; }

.map-finish { position: absolute; left: 50%; z-index: 2; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.finish-cup { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(245, 197, 66, 0.25), rgba(245, 197, 66, 0) 70%); }
.finish-cup svg { width: 56px; height: 56px; fill: #5A6580; }
.map-finish.done .finish-cup svg { fill: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 200, 70, 0.8)); }
.finish-title { font-size: 16px; letter-spacing: 0.2em; text-transform: uppercase; color: #C9D4EA; }

.map-bottom {
  position: relative;
  z-index: 3;
  flex: none;
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 14px) calc(var(--safe-l) + 16px);
}
.map-play { max-width: 320px; height: 56px; font-size: 21px; border-radius: 18px; }

/* ---------- карточка уровня ---------- */

.card-dlg .dlg-card { width: min(100%, 380px); padding: 20px 18px 20px; }
.card-head { display: flex; flex-direction: column; align-items: center; }
.card-chapter { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.card-title {
  font-size: 34px;
  line-height: 1.15;
  background: linear-gradient(180deg, #FFF6D0, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.card-stars { display: flex; align-items: flex-end; margin-top: 2px; }
.card-stars i { width: 26px; height: 26px; display: block; }
.card-stars i:nth-child(2) { width: 32px; height: 32px; margin: 0 2px 4px; }
.card-stars svg { width: 100%; height: 100%; fill: #3B4763; stroke: rgba(8, 12, 22, 0.9); stroke-width: 1.4; stroke-linejoin: round; }
.card-stars i.on svg { fill: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 200, 70, 0.8)); }
.card-goals { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.goal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: 18px;
  background: rgba(6, 10, 20, 0.4);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  text-align: left;
}
.goal-card-visual { position: relative; flex: none; }
.goal-card-row { display: flex; align-items: center; gap: 6px; }
.goal-chip { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.goal-art { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.goal-art img { width: 58px; height: 58px; }
.goal-art.trophy svg { width: 46px; height: 46px; fill: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 200, 70, 0.5)); }
.goal-card-text { display: flex; flex-direction: column; min-width: 0; margin-left: 6px; }
.goal-card-name { font-size: 13px; color: #C9D4EA; line-height: 1.2; }
.goal-card-count { font-weight: 400; font-size: 32px; line-height: 1.1; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
/* одна цель — во всю ширину, логотип ещё крупнее */
.card-goals.n1 .goal-card { flex-direction: column; gap: 12px; padding: 18px 14px 12px; text-align: center; }
.card-goals.n1 .logo-plate.big { width: 230px; height: 92px; padding: 12px 20px; border-radius: 20px; }
.card-goals.n1 .goal-chip { width: 44px; height: 44px; }
.card-goals.n1 .goal-art.trophy svg { width: 64px; height: 64px; }
.card-goals.n1 .goal-art { width: 96px; height: 96px; }
.card-goals.n1 .goal-art img { width: 84px; height: 84px; }
.card-goals.n1 .goal-card-text { align-items: center; margin-left: 0; }
.card-goals.n3 .logo-plate.big { width: 132px; height: 54px; }
.card-goals.n3 .goal-card { padding-top: 7px; padding-bottom: 7px; }
.card-goals.n3 .goal-card-count { font-size: 26px; }
.card-new { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: 16px; color: #fff; }
.card-new-tag { padding: 3px 9px; border-radius: 8px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #2B1A00; background: linear-gradient(180deg, #FFE9A0, var(--gold)); }
.card-info { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; border-radius: 17px; font-size: 15px; background: rgba(6, 10, 20, 0.45); border: 1px solid rgba(150, 175, 225, 0.25); }
.card-pill b { font-weight: 400; font-size: 18px; }
.card-pill .pill-ico { width: 20px; height: 20px; color: #9DBBEB; }
.card-pill .pill-ico svg { width: 100%; height: 100%; fill: currentColor; }
.card-pill.gold { border-color: rgba(245, 197, 66, 0.4); }
.card-pill.gold .pill-ico svg { fill: var(--gold); }
.card-start { margin-top: 18px; }

/* ---------- результат ---------- */

.result-dlg .dlg-card { overflow: visible; padding-top: 40px; }
.result { position: relative; }
.result-ribbon {
  position: absolute;
  left: 50%;
  top: -64px;
  transform: translateX(-50%);
  min-width: 78%;
  height: 52px;
  padding: 0 26px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #3A2400;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFF0B8, var(--gold) 50%, #D9980F);
  box-shadow: 0 6px 0 #8C5F08, 0 12px 22px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.65);
  animation: ribbonIn 0.5s 0.1s cubic-bezier(.3, 1.6, .5, 1) both;
}
.result-ribbon::before, .result-ribbon::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 30px;
  height: 44px;
  background: #B57E0E;
  z-index: -1;
}
.result-ribbon::before { left: -18px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.result-ribbon::after { right: -18px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
@keyframes ribbonIn { 0% { transform: translateX(-50%) scale(0.4); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
.result-level { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.result-rays {
  position: absolute;
  left: 50%;
  top: -10px;
  width: 300px;
  height: 300px;
  margin-left: -150px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 220, 120, 0.16) 0deg 10deg, rgba(255, 220, 120, 0) 10deg 24deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  animation: spin 18s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result-stars { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 10px 0 4px; }
.rstar { width: 62px; height: 62px; display: block; }
.rstar.s1 { width: 80px; height: 80px; margin-bottom: 12px; }
.rstar svg { width: 100%; height: 100%; fill: #2C3650; stroke: rgba(8, 12, 22, 0.9); stroke-width: 1.2; stroke-linejoin: round; transition: fill 0.2s; }
.rstar.on svg { fill: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 200, 70, 0.85)); animation: rstarIn 0.55s cubic-bezier(.3, 1.9, .5, 1) both; }
.rstar.off svg { animation: rstarOff 0.3s ease both; }
@keyframes rstarIn { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes rstarOff { 0% { transform: scale(0.7); } 100% { transform: none; } }
.result-score { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 2px; }
.result-cap { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.result-num {
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  background: linear-gradient(180deg, #FFF4C8, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.result-best { margin-top: 4px; font-size: 14px; color: #AFC0DE; min-height: 26px; }
.result-best b { font-weight: 400; color: #fff; }
.best-tag { display: inline-block; padding: 4px 12px; border-radius: 10px; font-size: 14px; color: #2B1A00; background: linear-gradient(180deg, #FFE9A0, var(--gold)); opacity: 0; }
.result-best.pop .best-tag { animation: bestPop 0.5s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes bestPop { 0% { opacity: 0; transform: scale(0.3); } 100% { opacity: 1; transform: none; } }
.slot-row:not(:empty) { display: flex; gap: 10px; margin-top: 16px; }
.result .dlg-buttons { margin-top: 16px; }
.btn-ico.end { order: 2; }

.lose .dlg-title { font-size: 28px; }
.left-cap { margin-top: 16px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.left-goals { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.left-goal { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: rgba(6, 10, 20, 0.4); }
.left-goal img { width: 50px; height: 50px; }
.left-goal .trophy svg { width: 34px; height: 34px; fill: var(--gold); }
.left-goal b {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 400;
  font-size: 13px;
  padding: 1px 7px;
  border-radius: 9px;
  background: #B3261E;
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

/* ---------- настройки ---------- */

.settings { display: flex; flex-direction: column; gap: 12px; }
.settings .toggle-row { margin-top: 8px; }
.settings .b-reset { margin-top: 8px; }

/* ---------- обучение ---------- */

.intro-dlg .dlg-card { width: min(100%, 330px); padding-top: 30px; cursor: pointer; }
.intro-ribbon {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 18px;
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2B1A00;
  background: linear-gradient(180deg, #FFE9A0, var(--gold) 50%, #D9980F);
  box-shadow: 0 4px 0 #8C5F08, 0 8px 14px rgba(0, 0, 0, 0.4);
}
.intro-title {
  font-size: 28px;
  background: linear-gradient(180deg, #FFF6D0, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.intro-text { margin-top: 12px; font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #E2E9F6; }
.intro-tap { margin-top: 14px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

.demo {
  position: relative;
  width: 260px;
  max-width: 100%;
  height: 128px;
  margin: 12px auto 0;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(80% 90% at 50% 50%, rgba(57, 105, 181, 0.35), rgba(6, 10, 20, 0.55));
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
}
.demo-stage { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.demo .d {
  position: absolute;
  width: 46px;
  height: 46px;
  left: -23px;
  top: -23px;
  transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px));
}
.demo .conv { animation: dConv 2.8s ease-in-out infinite; }
.demo .res { opacity: 0; animation: dRes 2.8s ease-in-out infinite; }
@keyframes dConv {
  0%, 22% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); opacity: 1; }
  42% { transform: translate(calc(var(--cx) * 48px), calc(var(--cy) * 48px)) scale(0.5); opacity: 0; }
  100% { transform: translate(calc(var(--cx) * 48px), calc(var(--cy) * 48px)) scale(0.5); opacity: 0; }
}
@keyframes dRes {
  0%, 38% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(0); opacity: 0; }
  48% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1.25); opacity: 1; }
  56%, 86% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); opacity: 0; }
}
.demo .beam {
  position: absolute;
  left: -10px;
  top: -90px;
  width: 20px;
  height: 180px;
  border-radius: 10px;
  background: linear-gradient(180deg, transparent, #fff 25%, #FFE08A 50%, #fff 75%, transparent);
  box-shadow: 0 0 18px rgba(255, 230, 150, 0.9);
  opacity: 0;
  animation: dBeamV 2.8s ease-out infinite;
}
.demo .beam.h { left: -150px; top: -10px; width: 300px; height: 20px; background: linear-gradient(90deg, transparent, #fff 25%, #FFE08A 50%, #fff 75%, transparent); animation-name: dBeamH; }
@keyframes dBeamV { 0%, 60% { opacity: 0; transform: scaleY(0); } 68% { opacity: 1; transform: scaleY(1); } 84%, 100% { opacity: 0; transform: scaleY(1.05); } }
@keyframes dBeamH { 0%, 60% { opacity: 0; transform: scaleX(0); } 68% { opacity: 1; transform: scaleX(1); } 84%, 100% { opacity: 0; transform: scaleX(1.05); } }
.demo .blast, .demo .glow {
  position: absolute;
  width: 150px;
  height: 150px;
  left: -75px;
  top: -75px;
  border-radius: 22px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), rgba(255, 200, 80, 0.7) 50%, rgba(255, 140, 40, 0));
  opacity: 0;
  transform: translate(calc(var(--x, 0) * 48px), calc(var(--y, 0) * 48px)) scale(0);
  animation: dBlast 2.8s ease-out infinite;
}
.demo .glow { width: 260px; height: 260px; left: -130px; top: -130px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9), rgba(90, 150, 255, 0.7) 45%, rgba(57, 105, 181, 0)); }
@keyframes dBlast {
  0%, 60% { opacity: 0; transform: translate(calc(var(--x, 0) * 48px), calc(var(--y, 0) * 48px)) scale(0.2); }
  68% { opacity: 1; transform: translate(calc(var(--x, 0) * 48px), calc(var(--y, 0) * 48px)) scale(1); }
  86%, 100% { opacity: 0; transform: translate(calc(var(--x, 0) * 48px), calc(var(--y, 0) * 48px)) scale(1.15); }
}
.demo-turbo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.mini-turbo { display: flex; align-items: center; width: 190px; }
.mini-badge {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  margin-right: -8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  background: radial-gradient(circle at 50% 30%, #5E92DE, #3969B5 55%, #233B6B) padding-box,
              linear-gradient(180deg, var(--gold-l), var(--gold) 50%, var(--gold-d)) border-box;
}
.mini-badge img { width: 80%; }
.mini-track { position: relative; flex: 1; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(4, 7, 14, 0.72); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7); }
.mini-track i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #2E5AA8, #5E92DE 70%, #FFD45A); animation: dFill 2.8s ease-in infinite; }
@keyframes dFill { 0% { transform: scaleX(0); } 55%, 62% { transform: scaleX(1); filter: brightness(1.5); } 66%, 100% { transform: scaleX(0); } }
.turbo-drop { width: 52px; height: 52px; opacity: 0; animation: dDrop 2.8s ease-out infinite; }
@keyframes dDrop { 0%, 58% { opacity: 0; transform: translateY(-30px) scale(0.3); } 68% { opacity: 1; transform: translateY(0) scale(1.15); } 74%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.demo-stain .under { animation: dStain 2.8s ease-in-out infinite; }
.demo-stain .over { animation: dOver 2.8s ease-in-out infinite; }
.demo-stain .u2, .demo-stain .o2 { animation-delay: 0.35s; }
@keyframes dOver {
  0%, 25% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); opacity: 1; }
  36%, 68% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(0.2); opacity: 0; }
  72% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px - 40px)) scale(1); opacity: 0; }
  82%, 100% { transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); opacity: 1; }
}
@keyframes dStain { 0%, 36% { opacity: 1; transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); } 50% { opacity: 0; transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1.3); } 62% { opacity: 0; transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); } 72%, 100% { opacity: 1; transform: translate(calc(var(--x) * 48px), calc(var(--y) * 48px)) scale(1); } }
.demo-crate .side { animation: dOver 2.8s ease-in-out infinite; }
.demo-crate .box { animation: dBox 2.8s ease-in-out infinite; }
@keyframes dBox {
  0%, 30% { transform: translate(0, 0) scale(1); opacity: 1; }
  34% { transform: translate(-4px, 0) rotate(-6deg); }
  38% { transform: translate(4px, 0) rotate(6deg); }
  42% { transform: translate(0, 0) scale(1); opacity: 1; }
  52%, 66% { transform: scale(1.35); opacity: 0; }
  76%, 100% { transform: scale(1); opacity: 1; }
}
.demo-combo .sw.a { animation: dSwapA 2.8s ease-in-out infinite; }
.demo-combo .sw.b { animation: dSwapB 2.8s ease-in-out infinite; }
@keyframes dSwapA {
  0%, 15% { transform: translate(calc(-0.55 * 48px), 0); opacity: 1; }
  35% { transform: translate(calc(0.55 * 48px), 0); opacity: 1; }
  50%, 100% { transform: translate(0, 0) scale(0.2); opacity: 0; }
}
@keyframes dSwapB {
  0%, 15% { transform: translate(calc(0.55 * 48px), 0); opacity: 1; }
  35% { transform: translate(calc(-0.55 * 48px), 0); opacity: 1; }
  50%, 100% { transform: translate(0, 0) scale(0.2); opacity: 0; }
}
.demo-combo .beam { animation-delay: -0.4s; }
.demo-combo .beam.v { width: 60px; left: -30px; }
.demo-combo .beam.h { height: 60px; top: -30px; }

/* рука-подсказка */
.hand-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; transition: opacity 0.25s ease; }
.hand-layer.out { opacity: 0; }
.hand-ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 24%;
  box-shadow: 0 0 0 3px rgba(255, 226, 130, 0.95), 0 0 16px 4px rgba(255, 200, 70, 0.6);
  animation: ringPulse 1.8s ease-in-out infinite;
}
.hand-ring.r2 { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 0 12px 2px rgba(255, 255, 255, 0.35); animation-delay: 0.6s; }
@keyframes ringPulse { 50% { transform: translate(-50%, -50%) scale(1.07); } }
.hand {
  position: absolute;
  width: var(--s);
  height: var(--s);
  margin-left: calc(var(--s) * -0.36);
  margin-top: calc(var(--s) * -0.12);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5));
  animation: handMove 1.8s ease-in-out infinite;
}
.hand svg { width: 100%; height: 100%; }
@keyframes handMove {
  0% { transform: translate(0, 0) scale(1.15); opacity: 0; }
  12% { transform: translate(0, 0) scale(1.05); opacity: 1; }
  24% { transform: translate(0, 0) scale(0.92); }
  62% { transform: translate(var(--dx), var(--dy)) scale(0.92); opacity: 1; }
  74% { transform: translate(var(--dx), var(--dy)) scale(1.05); opacity: 1; }
  90%, 100% { transform: translate(var(--dx), var(--dy)) scale(1.05); opacity: 0; }
}
.hand-bubble {
  position: absolute;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 9px 16px;
  border-radius: 16px;
  font-size: 15px;
  color: #fff;
  text-align: center;
  background: rgba(20, 30, 54, 0.92);
  border: 1.5px solid rgba(245, 197, 66, 0.8);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  width: max-content;
  transform: translateX(-50%);
  animation: bubbleIn 0.4s both;
}
@keyframes bubbleIn { 0% { opacity: 0; } 100% { opacity: 1; } }
.hand-bubble.at-bottom { transform: translate(-50%, -100%); }

/* подсказка iOS «На экран Домой» — шторка снизу */
.dlg.sheet { place-items: end center; }
.sheet .dlg-card { width: min(100%, 380px); padding: 18px 18px 16px; }
.ios-hint-title { font-size: 19px; color: #fff; }
.ios-hint-steps { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.ios-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; font-size: 13px; background: rgba(6, 10, 20, 0.4); }
.ios-ico { width: 30px; height: 30px; color: #6FA8FF; }
.ios-ico svg { width: 100%; height: 100%; }
.ios-hint-sub { margin-top: 12px; font: 13px/1.4 system-ui, -apple-system, sans-serif; color: #AFC0DE; }

/* ---------- вирусность: вызов дня, рейтинг, шаринг, ссылки, призы (таск 06) ---------- */

/* кнопки по бокам «Играть» на карте */
.map-bottom { align-items: stretch; }
.map-side-btn {
  position: relative;
  flex: none;
  width: 62px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  background: linear-gradient(180deg, #4A78C4, #2D4F8E);
  box-shadow: 0 5px 0 #1C3363, 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, filter 0.2s;
}
.map-side-btn:active { transform: translateY(3px) scale(0.97); }
@media (hover: hover) { .map-side-btn:hover { filter: brightness(1.1); } }
.msb-ico { width: 26px; height: 26px; }
.msb-ico svg { width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35)); }
.msb-label { font-size: 11px; letter-spacing: 0.02em; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.board-btn .msb-ico { color: var(--gold); }
.daily-btn.fresh .msb-ico { color: var(--gold-l); }
.msb-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF8A7A, #E0301F);
  border: 2px solid #12161F;
  animation: dotPulse 1.6s ease-in-out infinite;
}
@keyframes dotPulse { 50% { transform: scale(1.2); } }

/* «Поделиться» / «Брось вызов» */
.btn-share {
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  font-size: 15px;
  padding: 0 6px;
  gap: 5px;
  color: #fff;
  background: linear-gradient(180deg, #38B37A, #1D7A50);
  box-shadow: 0 4px 0 #0F4A30, 0 8px 16px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.btn-share:active { box-shadow: 0 2px 0 #0F4A30, 0 4px 8px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.btn-share .btn-ico { width: 17px; height: 17px; }
.b-challenge { background: linear-gradient(180deg, #E8643F, #B23A1C); box-shadow: 0 4px 0 #6A1F0C, 0 8px 16px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.b-challenge:active { box-shadow: 0 2px 0 #6A1F0C, 0 4px 8px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.btn-sm { width: auto; height: 38px; font-size: 15px; padding: 0 14px; border-radius: 12px; gap: 6px; }
.btn-sm .btn-ico { width: 17px; height: 17px; }

/* ссылки на Боникс */
.bonix-links { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 14px; }
.bonix-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  text-align: left;
  background: rgba(6, 10, 20, 0.42);
  border: 1px solid rgba(150, 175, 225, 0.22);
  transition: transform 0.12s ease, background 0.2s;
}
.bonix-link:active { transform: scale(0.97); }
@media (hover: hover) { .bonix-link:hover { background: rgba(40, 60, 100, 0.5); } }
.bl-ico { flex: none; width: 26px; height: 26px; }
.bl-ico svg { width: 100%; height: 100%; fill: currentColor; }
.bonix-link.catalog .bl-ico { color: var(--gold); }
.bonix-link.tg .bl-ico { color: #4FB3F0; }
.bl-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.bl-text b { font-weight: 400; font-size: 14px; }
.bl-text small { font: 12px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #AFC0DE; }

/* призы */
.reward {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  text-align: left;
  color: #fff;
  border: 1.5px dashed rgba(245, 197, 66, 0.55);
  background: rgba(245, 197, 66, 0.07);
}
.reward.on { border-style: solid; background: linear-gradient(180deg, rgba(245, 197, 66, 0.2), rgba(245, 197, 66, 0.06)); }
.rw-ico { flex: none; width: 28px; height: 28px; color: var(--gold); }
.rw-ico svg { width: 100%; height: 100%; fill: currentColor; }
.rw-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; min-width: 0; }
.rw-text b { font-weight: 400; font-size: 14px; color: var(--gold-l); }
.rw-text small { font: 12.5px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #C9D4EA; }
.rw-rules { font: 12px system-ui, sans-serif; color: #8FC3FF; }

/* вызов друга и рейтинг на победе */
.challenge-line { margin-top: 10px; font: 14px/1.35 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #C9D4EA; }
.challenge-line b { font-family: 'Russo One', sans-serif; font-weight: 400; color: #fff; }
.challenge-line.won b { color: var(--gold); }
.rank-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 12px;
  font: 13.5px/1.35 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #AFC0DE;
}
.rank-line:empty { display: none; }
.rank-line > svg { width: 20px; height: 20px; fill: var(--gold); flex: none; }
.rank-line b { font-family: 'Russo One', sans-serif; font-weight: 400; font-size: 17px; color: var(--gold); }
.rank-line.rank { color: #fff; }
.rank-line.sending { animation: blink 1.2s ease-in-out infinite; }

/* +5 ходов за репост */
.extra-wrap { margin-top: 18px; }
.btn-extra {
  height: 54px;
  font-size: 19px;
  color: #fff;
  background: linear-gradient(180deg, #45C987, #1F8A57);
  box-shadow: 0 5px 0 #0F4A30, 0 10px 18px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 0 0 2px rgba(255, 233, 160, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  animation: playPulse 1.8s ease-in-out infinite;
}
.extra-hint { margin-top: 8px; font: 12.5px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #AFC0DE; }

/* ник в настройках */
.name-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 16px;
  text-align: left;
  color: #fff;
  background: rgba(6, 10, 20, 0.38);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
.nr-ico, .nr-edit { flex: none; width: 24px; height: 24px; color: #9AA6BF; }
.nr-edit { width: 20px; height: 20px; color: var(--gold); }
.nr-ico svg, .nr-edit svg { width: 100%; height: 100%; fill: currentColor; }
.nr-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.nr-text small { font: 12px system-ui, -apple-system, sans-serif; color: var(--muted); }
.nr-text b { font-weight: 400; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings .bonix-links { margin-top: 0; }

/* ввод ника */
.nick-input {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid rgba(150, 175, 225, 0.35);
  background: rgba(6, 10, 20, 0.55);
  color: #fff;
  font: 20px 'Russo One', sans-serif;
  text-align: center;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.nick-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.2); }
.nick-input::placeholder { color: #66748F; }
.nick-err { min-height: 20px; margin-top: 6px; font: 13px system-ui, sans-serif; color: #FF8A7A; }
.nickname .dlg-buttons { margin-top: 8px; }

/* окно ежедневного вызова */
.daily-dlg .dlg-card, .challenge-dlg .dlg-card { margin-top: 30px; }
.daily-dlg .dlg-card { padding-top: 32px; overflow: visible; }
.daily-goals .goal-card { padding-top: 8px; padding-bottom: 8px; }
.daily-goals .goal-art { width: 54px; height: 54px; }
.daily-goals .goal-art img { width: 48px; height: 48px; }
.daily-goals .goal-art.trophy svg { width: 38px; height: 38px; }
.daily-goals .logo-plate.big { width: 120px; height: 50px; }
.daily-goals .goal-card-count { font-size: 26px; }
.daily .card-info { margin-top: 10px; flex-wrap: nowrap; }
.daily .card-pill { height: 32px; font-size: 14px; padding: 0 12px 0 8px; white-space: nowrap; }
.daily .card-pill b { font-size: 16px; }
.daily .b-board { height: 44px; font-size: 16px; }
.daily-badge, .ch-badge {
  position: absolute;
  top: -30px;
  left: 50%;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #2B1A00;
  background: linear-gradient(180deg, #FFE9A0, var(--gold) 50%, #D9980F);
  box-shadow: 0 5px 0 #8C5F08, 0 10px 18px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.daily-badge svg, .ch-badge svg { width: 32px; height: 32px; fill: currentColor; }
.daily .dlg-title { margin-top: 2px; }
.daily-text { margin-top: 6px; font-size: 14px; }
.daily .card-goals { margin-top: 12px; }
.daily-timer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font: 13.5px system-ui, -apple-system, sans-serif; color: #AFC0DE; }
.daily-timer b { font: 16px 'Russo One', sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.dt-ico { width: 18px; height: 18px; color: #9DBBEB; }
.dt-ico svg { width: 100%; height: 100%; fill: currentColor; }
.daily .dlg-buttons { margin-top: 14px; }

/* окно вызова от друга */
.challenge-dlg .dlg-card { padding-top: 40px; overflow: visible; }
.ch-badge { color: #fff; background: linear-gradient(180deg, #F08A5D, #C2401E); box-shadow: 0 5px 0 #6A1F0C, 0 10px 18px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.ch-title {
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.2;
  background: linear-gradient(180deg, #FFF6D0, var(--gold) 55%, #D99A14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.ch-score { display: flex; flex-direction: column; align-items: center; margin-top: 12px; }
.ch-score b { font-weight: 400; font-size: 38px; color: #fff; }

/* рейтинг */
.board-dlg .dlg-card { width: min(100%, 400px); padding: 18px 16px 18px; }
.board { display: flex; flex-direction: column; }
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 14px 0 0; padding: 4px; border-radius: 14px; background: rgba(6, 10, 20, 0.5); }
.lb-tab { height: 38px; border-radius: 11px; font-size: 16px; color: #AFC0DE; transition: background 0.2s, color 0.2s; }
.lb-tab.on { color: #2B1A00; background: linear-gradient(180deg, #FFE9A0, var(--gold) 50%, #D9980F); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.lb-sub { margin-top: 10px; font: 12.5px system-ui, -apple-system, sans-serif; color: var(--muted); }
.lb-body {
  position: relative;
  margin-top: 10px;
  height: min(46vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 14px;
  background: rgba(6, 10, 20, 0.35);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
  -webkit-user-select: none;
}
.lb-list { list-style: none; margin: 0; padding: 6px; }
.lb-list.mine { padding-top: 0; }
.lb-row { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px; text-align: left; }
.lb-row:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
.lb-row.me { background: linear-gradient(90deg, rgba(245, 197, 66, 0.32), rgba(245, 197, 66, 0.1)); box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, 0.7); }
.lb-rank { flex: none; width: 30px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; color: #C9D4EA; }
.lb-rank.medal { color: #2B1A00; }
.lb-rank.m1 { background: linear-gradient(180deg, #FFE9A0, #F5C542); }
.lb-rank.m2 { background: linear-gradient(180deg, #F1F4F9, #A9B3C4); }
.lb-rank.m3 { background: linear-gradient(180deg, #F3C19A, #C07A45); }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.lb-name i { font: italic 11px system-ui, sans-serif; color: var(--gold-l); }
.lb-score { flex: none; font-weight: 400; font-size: 15px; color: var(--gold-l); font-variant-numeric: tabular-nums; }
.lb-gap { text-align: center; color: var(--muted); line-height: 1; }
.lb-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; }
.lb-state-ico { width: 54px; height: 54px; color: #5E6B88; }
.lb-state.soon .lb-state-ico, .lb-state.empty .lb-state-ico { color: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 200, 70, 0.5)); }
.lb-state-ico svg { width: 100%; height: 100%; fill: currentColor; }
.lb-state b { font-weight: 400; font-size: 22px; }
.lb-state p { margin: 0; max-width: 280px; font: 14px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #AFC0DE; }
.lb-loading { height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.lb-loading i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: blink 0.9s ease-in-out infinite; }
.lb-loading i:nth-child(2) { animation-delay: 0.15s; }
.lb-loading i:nth-child(3) { animation-delay: 0.3s; }
.lb-note { margin-top: 8px; font: 12px system-ui, -apple-system, sans-serif; color: var(--muted); }
.lb-foot:empty { display: none; }
.board .b-daily { margin-top: 14px; }

/* всплывающая подсказка */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 24px);
  z-index: 200;
  max-width: min(92vw, 380px);
  padding: 11px 18px;
  border-radius: 14px;
  font: 14px/1.35 system-ui, -apple-system, 'Segoe UI', sans-serif;
  text-align: center;
  color: #fff;
  background: rgba(20, 28, 46, 0.96);
  border: 1px solid rgba(245, 197, 66, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 680px) {
  .bonix-links { margin-top: 10px; }
  .bonix-link { min-height: 42px; }
  .reward { margin-top: 8px; padding: 7px 10px; }
  .slot-row:not(:empty) { margin-top: 12px; }
  .daily .card-goals { margin-top: 8px; }
  .lb-body { height: min(42vh, 340px); }
}
@media (prefers-reduced-motion: reduce) {
  .msb-dot, .btn-extra { animation: none; }
}

/* ---------- адаптация ---------- */

@media (max-height: 680px) {
  .splash { gap: 18px; padding-top: calc(var(--safe-t) + 54px); }
  .splash-logo { width: min(56vw, 240px); }
  .splash-brands .logo-plate { width: 92px; height: 38px; }
  .card-goals.n1 .logo-plate.big { width: 200px; height: 80px; }
  .card-title { font-size: 30px; }
  .dlg-card { padding-top: 18px; padding-bottom: 16px; }
  .rstar { width: 54px; height: 54px; }
  .rstar.s1 { width: 70px; height: 70px; }
  .result-num { font-size: 34px; }
  .dlg-buttons { gap: 10px; margin-top: 16px; }
}
@media (max-width: 360px) {
  .logo-plate.big { width: 140px; height: 60px; }
  .map-sign .sign-plate { width: 90px; height: 34px; }
}
@media (max-width: 340px) {
  .logo-plate.big, .card-goals.n3 .logo-plate.big { width: 112px; height: 50px; padding: 7px 10px; }
  .goal-card { gap: 10px; }
  .map-top { gap: 6px; }
  .map-total { padding-right: 10px; }
}
@media (min-width: 720px) and (min-height: 700px) {
  .splash-brands { max-width: 700px; }
  .splash-brands .logo-plate { width: 120px; height: 50px; }
  .map-sign .sign-plate { width: 116px; height: 44px; }
  .node { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
  .node.current { width: 80px; height: 80px; margin: -40px 0 0 -40px; }
}
@media (prefers-reduced-motion: reduce) {
  .floater, .splash-play, .result-rays, .node-pin, .node.current .node-face { animation: none; }
}
