/* Мини-приложение «Мир Фантазии» в стиле «тёмное аниме»: приложение всегда тёмное, в любой теме Telegram
   (свои цвета ниже, а не --tg-theme-*), акцент - алый, у кнопок и переключателей срезанные углы.
   Разделы окрашены своей местностью (html[data-place], блок «ОФОРМЛЕНИЕ ОКОН» в конце файла). */

:root {
  --fb-bg: #efeff4;
  --fb-card: #ffffff;
  --fb-text: #000000;
  --fb-hint: #8e8e93;
  --fb-accent: #6d4aff;
  --fb-on-accent: #ffffff;
  --fb-danger: #e53935;
  --fb-toast: rgba(28, 28, 30, .94);

  --bg: #0d0b14;
  --card: #18141f;
  --text: #f2eef8;
  --hint: #9b93ae;
  --accent: #e0323c;
  --on-accent: #ffffff;
  --danger: #ff5a64;
  --sep: rgba(255, 255, 255, .08);
  --track: rgba(255, 255, 255, .1);
  --soft: rgba(255, 255, 255, .07);

  --hp: #ef4350;
  --mana: #4c8dff;
  --energy: #f4a417;
  --shield: #8fa3c0;
  --xp: #a855f7;
  --good: #22b14c;
  --bad: #e5484d;
  --gold: #e8a90c;

  --stage-1: #1d1736;
  --stage-2: #2e2158;
  --stage-text: #f3f0ff;
  --stage-muted: rgba(243, 240, 255, .62);
  --tile: linear-gradient(160deg, #4a4f7a, #33375a);
  --tile-edge: #23263f;

  --radius: 16px;
  --bar-h: 66px;
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --fb-bg: #0f0f12;
    --fb-card: #1c1c21;
    --fb-text: #ffffff;
    --fb-hint: #8d8d93;
    --fb-accent: #8b6dff;
    --fb-toast: rgba(58, 58, 64, .96);
  }
}

:root[data-scheme="dark"] {
  --fb-bg: #0f0f12;
  --fb-card: #1c1c21;
  --fb-text: #ffffff;
  --fb-hint: #8d8d93;
  --fb-accent: #8b6dff;
  --fb-toast: rgba(58, 58, 64, .96);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  min-height: 100vh;
}

[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

input { font: inherit; }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.muted { color: var(--hint); }
.center { text-align: center; justify-content: center; }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* ---------- экраны загрузки и ошибок ---------- */

.screen {
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 24px;
  text-align: center;
}

.screen-icon { font-size: 56px; line-height: 1; }
.screen h1 { margin: 6px 0 0; font-size: 20px; }
.screen p { margin: 0; max-width: 320px; color: var(--hint); white-space: pre-line; }
.screen .btn { margin-top: 14px; min-width: 200px; padding: 12px 20px; }

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- каркас ---------- */

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 12px calc(var(--safe-bottom) + 24px);
}

/* шапка окна раздела: «‹» на карту, название, зелья и кошелёк */
.win-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -12px 4px;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--sep);
}
.win-back {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); font-size: 28px; line-height: 1; padding-bottom: 3px;
}
.win-back:active { transform: scale(.92); }
.win-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 650; font-size: 14px; }
.wallet .donut { font-size: 12px; color: var(--hint); font-weight: 600; }

.offline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(229, 72, 77, .12);
  color: var(--danger);
  font-weight: 600;
}

/* ---------- общие блоки ---------- */

.section { margin: 18px 0 0; }
.section > h2 {
  margin: 0 4px 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--hint);
}

.card {
  margin: 10px 0 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2px 0 8px;
  font-weight: 650;
}

.card-title small { color: var(--hint); font-weight: 500; font-size: 12px; }
.card-title + .card-title, .segmented + .card-title { margin-top: 14px; }

.hint { margin: 8px 4px 0; font-size: 12.5px; color: var(--hint); }

.empty { padding: 18px 10px; text-align: center; color: var(--hint); font-size: 14px; }
/* Админка → «🔔 Сообщения»: под списком группы - сколько включено и кнопка на всю группу */
.notify-bulk { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
/* раздел упал при отрисовке (app.js, crashCard) */
.crash { margin: 16px; padding: 22px 16px; text-align: center; }
.crash-icon { font-size: 40px; line-height: 1.2; }
.crash p { margin: 8px 0 14px; color: var(--hint); font-size: 14px; }

.list { border-radius: var(--radius); background: var(--card); overflow: hidden; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--sep);
}

.row:first-child { border-top: 0; }
.row .ico { flex: none; width: 30px; text-align: center; font-size: 20px; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .sub { margin-top: 1px; font-size: 12.5px; color: var(--hint); }
.row .side { flex: none; font-weight: 600; font-size: 14px; text-align: right; }
.row.me { background: rgba(109, 74, 255, .1); }
.row .place { width: 26px; text-align: center; font-weight: 700; color: var(--hint); }
.row .place.medal { font-size: 20px; }

.my-place { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--soft);
  color: var(--text);
  white-space: nowrap;
}

.tag.soft { color: var(--hint); }
.tag.good { background: rgba(34, 177, 76, .16); color: var(--good); }
.tag.bad { background: rgba(229, 72, 77, .16); color: var(--bad); }
.tag.gold { background: rgba(232, 169, 12, .18); color: var(--gold); }
.tag.diff.easy { color: var(--good); }
.tag.diff.fair { color: #c99a06; }
.tag.diff.hard { color: #ea7a12; }
.tag.diff.deadly { color: var(--bad); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  white-space: nowrap;
  transition: transform .08s ease, opacity .15s, filter .15s;
}

.btn:active:not(:disabled) { transform: scale(.97); }
.btn.wide { width: 100%; margin-top: 12px; min-height: 48px; font-size: 16px; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.soft { background: var(--soft); color: var(--accent); }
.btn.danger { background: linear-gradient(135deg, #f0525a, #c62f6b); color: #fff; }
.btn.off, .btn:disabled { background: var(--soft); color: var(--hint); cursor: default; }
.btn.busy { opacity: .6; }
.btn.wait { font-variant-numeric: tabular-nums; }
.btn.chip-btn { min-height: 32px; padding: 5px 10px; font-size: 13px; background: var(--soft); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, color .15s;
}

.chip.active { background: var(--accent); color: var(--on-accent); }

.segmented {
  display: flex;
  gap: 4px;
  margin: 12px 0 0;
  padding: 4px;
  border-radius: 14px;
  background: var(--card);
}

.card .segmented { background: var(--soft); margin-top: 0; }

.segmented button {
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  font-weight: 650;
  font-size: 14px;
  color: var(--hint);
  transition: background .15s, color .15s;
}

.segmented button.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }

/* ---------- полоски ---------- */

.bar {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 8px;
  background: var(--track);
  overflow: hidden;
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 8px;
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

.bar.hp i { background: linear-gradient(90deg, #ff6b6b, var(--hp)); }
.bar.mana i { background: linear-gradient(90deg, #6aa8ff, var(--mana)); }
.bar.energy i { background: linear-gradient(90deg, #ffc94a, var(--energy)); }
.bar.shield i { background: linear-gradient(90deg, #b9c6da, var(--shield)); }

.meter { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.meter-icon { width: 20px; text-align: center; }
.meter b { min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- арена: подготовка ---------- */

.hero-card .hero-stats, .rating-stats, .mines-head, .mines-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

.hero-stats div, .rating-stats div, .mstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--soft);
  text-align: center;
}

.hero-stats small, .rating-stats small, .mstat small { color: var(--hint); font-size: 11.5px; }
.hero-stats b, .rating-stats b, .mstat b { font-size: 15px; }

.warn-line {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(229, 72, 77, .12);
  color: var(--bad);
  font-size: 13px;
  font-weight: 600;
}

.prep-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------- арена: монстры и соперники ---------- */

.monsters { display: flex; flex-direction: column; gap: 8px; }

.monster { padding: 12px; border-radius: var(--radius); background: var(--card); border-left: 4px solid transparent; }
.monster-body { display: flex; align-items: center; gap: 12px; }
.monster > .tags { margin-top: 8px; }
.monster-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sep);
}

.rival {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card);
  border-left: 4px solid transparent;
}

.monster.easy { border-left-color: var(--good); }
.monster.fair { border-left-color: #e3b00d; }
.monster.hard { border-left-color: #ea7a12; }
.monster.deadly { border-left-color: var(--bad); }
.monster.locked { opacity: .55; }
.monster.locked .monster-art { filter: grayscale(1); }
.tower .monster { margin-top: 4px; padding: 10px 0 4px; background: none; border-left: 0; border-top: 1px solid var(--sep); border-radius: 0; }

.monster-art, .rival-art {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(150deg, var(--stage-2), var(--stage-1));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
}

.rival-art { border-radius: 50%; }
.monster-main { flex: 1; min-width: 0; }
.monster-title { display: flex; align-items: baseline; gap: 6px; }
.monster-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvl { flex: none; font-size: 12px; color: var(--hint); font-weight: 600; }
.monster-stats { display: flex; gap: 10px; margin-top: 3px; font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; }
.reward { font-size: 13px; font-weight: 600; }

/* ---------- арена: башня ---------- */

.tower-head { display: flex; align-items: center; gap: 12px; }
.tower-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: linear-gradient(160deg, #4b3a8c, #241a47);
}

.tower-floor { font-size: 22px; font-weight: 750; }

.ladder { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 6px; }

.floor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
  color: var(--hint);
}

.floor span { width: 18px; text-align: center; }
.floor b { flex: 1; font-weight: 600; }
.floor.done { opacity: .6; }
.floor.guard { color: var(--gold); }
.floor.current {
  background: linear-gradient(90deg, rgba(109, 74, 255, .9), rgba(168, 85, 247, .85));
  color: #fff;
  box-shadow: 0 4px 14px rgba(109, 74, 255, .35);
}

.tower-reward { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 13px; }

/* ---------- арена: рейтинг ---------- */

.rating-card .rating-main { display: flex; flex-direction: column; align-items: center; margin-bottom: 12px; }
.rating-card .league { font-weight: 650; }
.rating-card .rating {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #8b6dff, #e84393);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rating-stats { grid-template-columns: repeat(4, 1fr); margin: 0; }

/* ---------- арена: бой ---------- */

.stage {
  position: relative;
  margin-top: 10px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  background:
    radial-gradient(120% 70% at 50% 18%, rgba(168, 85, 247, .35), transparent 60%),
    linear-gradient(180deg, var(--stage-2), var(--stage-1));
  color: var(--stage-text);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(29, 23, 54, .35);
}

.stage.is-shadow { background: radial-gradient(120% 70% at 50% 18%, rgba(76, 141, 255, .35), transparent 60%), linear-gradient(180deg, #1f2a4f, #121931); }
.stage.guard { box-shadow: 0 0 0 2px rgba(232, 169, 12, .6), 0 10px 30px rgba(29, 23, 54, .35); }
.stage .muted, .stage .lvl { color: var(--stage-muted); }
.stage .tag.soft { color: var(--stage-muted); background: rgba(255, 255, 255, .08); }
.stage .bar { background: rgba(255, 255, 255, .14); }
.stage .meter { color: var(--stage-text); }

.stage-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--stage-muted); }

.enemy-art {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 8px auto 4px;
  display: grid;
  place-items: center;
  font-size: 66px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 68%);
  animation: idle 2.6s ease-in-out infinite;
}

.enemy-art.hit { animation: hit .45s ease; }

@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes hit {
  0% { transform: translateX(0) scale(1); filter: none; }
  20% { transform: translateX(-9px) scale(.96); filter: brightness(1.8) saturate(.4); }
  45% { transform: translateX(8px); }
  70% { transform: translateX(-4px); }
  100% { transform: translateX(0) scale(1); filter: none; }
}

.enemy-name { text-align: center; font-size: 18px; font-weight: 750; }
.enemy-name .lvl { margin-left: 6px; }
.stage .tags { justify-content: center; }

.floater {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: float 1.1s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

.floater.dmg { color: #ff6b6b; }
.floater.shield { color: #c9d4e6; font-size: 15px; top: 34px; }
.floater.heal { color: #4ade80; }

@keyframes float {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.8); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}

.intent {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .12);
}

.intent.heavy, .intent.breath { border-color: rgba(255, 107, 107, .6); background: rgba(255, 107, 107, .14); animation: pulse 1.2s ease-in-out infinite; }
.intent.heal, .intent.drain { border-color: rgba(74, 222, 128, .5); }
.intent-head { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.intent-dmg { margin-left: auto; font-weight: 800; color: #ffb4b4; }
.intent-hint { margin-top: 2px; font-size: 12px; color: var(--stage-muted); }

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .0); } 50% { box-shadow: 0 0 0 4px rgba(255, 107, 107, .18); } }

.battle-log {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--card);
  font-size: 13px;
  line-height: 1.45;
  color: var(--hint);
  min-height: 52px;
}

.battle-log .fresh { color: var(--text); font-weight: 600; animation: fresh .35s ease; }
@keyframes fresh { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.hero-panel { position: relative; margin-top: 8px; }
.hero-panel.hurt { animation: hurt .5s ease; }
@keyframes hurt { 0%, 100% { box-shadow: none; } 30% { box-shadow: inset 0 0 0 2px var(--bad), 0 0 18px rgba(229, 72, 77, .35); } }
.hero-title { position: relative; display: flex; align-items: center; gap: 8px; }
.hero-panel .floater { top: -6px; left: auto; right: 10px; transform: none; animation-name: float-side; }
@keyframes float-side {
  0% { opacity: 0; transform: translateY(8px); }
  15% { opacity: 1; transform: translateY(0) scale(1.15); }
  100% { opacity: 0; transform: translateY(-26px); }
}

.moves { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }

.move {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 2px 7px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 -3px 0 var(--sep);
  transition: transform .08s ease, background .15s;
}

.move i { font-style: normal; font-size: 24px; line-height: 1.15; }
.move b { font-size: 13px; }
.move small { font-size: 11px; color: var(--hint); }
.move:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.move:disabled { opacity: .45; }
.move.primary { background: linear-gradient(160deg, #f0525a, #b8265f); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.move.primary small { color: rgba(255, 255, 255, .75); }
.move.open { background: var(--accent); color: var(--on-accent); }
.move.open small { color: inherit; opacity: .8; }

/* боевые приёмы под ходами: готовый - светится, на перезарядке - тусклый с «⏳ N х.» */
.techs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.tech {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0;
  padding: 6px 4px 5px; border-radius: 14px; color: var(--text);
  background: linear-gradient(160deg, rgba(168, 85, 247, .28), rgba(91, 33, 182, .18));
  box-shadow: inset 0 0 0 1px rgba(196, 160, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .25);
  transition: transform .08s ease, opacity .15s;
}
.tech i { font-style: normal; font-size: 20px; line-height: 1.15; }
.tech b { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech small { font-size: 11px; color: #d9c8ff; }
.tech:active { transform: translateY(2px); }
.tech.off { opacity: .5; background: var(--card); box-shadow: inset 0 -3px 0 var(--sep); }
.tech.off small { color: var(--hint); }

/* набор приёмов в лобби арены */
.tech-card { padding: 0; overflow: hidden; }
.tech-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; text-align: left; color: var(--text); }
.tech-head b { flex: none; }
.tech-chips { flex: 1; display: flex; gap: 4px; justify-content: flex-end; }
.tech-chips i { font-style: normal; font-size: 18px; }
.tech-card.spare .tech-head small:last-child { color: var(--accent); }
.tech-card .list { padding: 0 4px; }
.tech-card .hint { margin: 6px 14px 12px; }
.tech-row .ico { font-size: 22px; }
.tech-row .title small { font-weight: 500; }
.tech-row.locked { opacity: .55; }

.panel { margin-top: 8px; border-radius: var(--radius); background: var(--card); overflow: hidden; animation: fresh .2s ease; }
.panel-title { padding: 10px 14px 0; font-weight: 650; }

.flee { display: block; margin: 8px auto 0; padding: 6px 14px; color: var(--hint); font-size: 14px; font-weight: 600; }

/* ---------- итог боя ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  background: rgba(8, 6, 20, .55);
  animation: fade .2s ease;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px 16px 16px;
  border-radius: 22px;
  background: var(--card);
  animation: rise .28s cubic-bezier(.2, .8, .2, 1);
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.result-card { text-align: center; }
.result-card h3 { margin: 6px 0 2px; font-size: 24px; }
.result-card > p { margin: 0 0 12px; }
.result-icon { font-size: 60px; line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.result-card.win h3 { color: var(--good); }
.result-card.loss h3 { color: var(--bad); }

@keyframes pop { from { transform: scale(.3); opacity: 0; } }

.result-lines { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.result-line { display: flex; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--soft); font-weight: 600; font-size: 14px; }
.result-line span:first-child { flex: none; width: 22px; text-align: center; }

.result-log { margin-top: 12px; text-align: left; font-size: 13px; color: var(--hint); }
.result-log summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.result-log div { padding: 2px 0; }

/* ---------- сапёр ---------- */

.bet-input {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  outline: none;
}

.bet-input:focus { box-shadow: 0 0 0 2px var(--accent); }

.mines-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.mines-step { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: var(--soft); }
.mines-step small { font-size: 11px; color: var(--hint); }
.mines-step b { font-size: 12.5px; color: var(--good); white-space: nowrap; }

.mines-game, .mines-result {
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(76, 141, 255, .25), transparent 60%),
    linear-gradient(180deg, #232846, #161a30);
  color: var(--stage-text);
}

.mines-game .mstat, .mines-result .mstat { background: rgba(255, 255, 255, .08); }
.mines-game .mstat small { color: var(--stage-muted); }
.mstat.accent b { color: #7dffb0; }
.mstat.good b { color: var(--good); }
.mstat.bad b { color: var(--bad); }
.mines-stats { grid-template-columns: repeat(4, 1fr); margin: 10px 0 0; padding: 10px; border-radius: var(--radius); background: var(--card); }

.board {
  display: grid;
  gap: 8px;
  margin: 12px auto 4px;
  max-width: 380px;
}

.board.s3 { grid-template-columns: repeat(3, 1fr); max-width: 300px; }
.board.s4 { grid-template-columns: repeat(4, 1fr); max-width: 340px; }
.board.s5 { grid-template-columns: repeat(5, 1fr); gap: 7px; }

.cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--tile);
  box-shadow: inset 0 -4px 0 var(--tile-edge), 0 2px 6px rgba(0, 0, 0, .25);
  font-size: 26px;
  transition: transform .08s ease;
}

.board.s5 .cell { font-size: 22px; border-radius: 12px; }
button.cell:active:not(:disabled) { transform: translateY(2px) scale(.97); box-shadow: inset 0 -1px 0 var(--tile-edge); }
.cell.pending { animation: pending .6s ease-in-out infinite alternate; }
@keyframes pending { to { filter: brightness(1.35); transform: scale(.95); } }

.cell.gem {
  background: linear-gradient(160deg, #2bd38f, #129a68);
  box-shadow: inset 0 -4px 0 #0c6b49, 0 0 14px rgba(43, 211, 143, .35);
  animation: reveal .3s cubic-bezier(.2, 1.6, .4, 1);
}

.cell.mine { background: linear-gradient(160deg, #5a2a3a, #3a1824); box-shadow: inset 0 -4px 0 #2a0f19; opacity: .9; }
.cell.boom { background: radial-gradient(circle, #ffb347, #e5484d 60%, #8e1d3a); box-shadow: 0 0 22px rgba(255, 120, 80, .7); animation: boom .55s ease; }
.cell.dim { opacity: .28; filter: grayscale(.5); }
.cell.last { box-shadow: inset 0 -4px 0 #0c6b49, 0 0 0 2px #7dffb0; }

@keyframes reveal { from { transform: scale(.5) rotate(-12deg); } }
@keyframes boom { 0% { transform: scale(.6); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.mines-next { margin-top: 8px; text-align: center; font-size: 13px; color: var(--stage-muted); }
.mines-next b { color: #7dffb0; }
.mines-hash { margin-top: 10px; text-align: center; font-size: 11px; color: var(--stage-muted); font-family: ui-monospace, Menlo, monospace; }
.btn.cash { background: linear-gradient(135deg, #2bd38f, #1a9e6c); color: #fff; box-shadow: 0 6px 18px rgba(43, 211, 143, .3); }
.btn.cash:disabled { background: rgba(255, 255, 255, .1); color: var(--stage-muted); box-shadow: none; }

.mines-banner { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; }
.mines-banner b { font-size: 26px; }
.mines-banner span { font-size: 13px; color: var(--stage-muted); }
.mines-result.won .mines-banner b { color: #7dffb0; }
.mines-result.lost .mines-banner b { color: #ff8a8a; }
.mines-result.lost { animation: shake .45s ease; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.fair { margin-top: 10px; font-size: 12.5px; }
.fair summary { cursor: pointer; color: var(--stage-muted); font-weight: 600; }
.fair p { margin: 6px 0 0; }
.fair .muted { color: var(--stage-muted); }

/* ---------- всплывающее сообщение ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 16px);
  z-index: 40;
  width: max-content;
  max-width: min(92vw, 480px);
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--fb-toast);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transform: translateX(-50%);
  animation: toast .25s cubic-bezier(.2, .8, .2, 1);
}

.toast.good { background: linear-gradient(135deg, #1f9d55, #15803d); }
.toast.bad { background: linear-gradient(135deg, #d93b47, #b4233c); }
.toast.warn { background: linear-gradient(135deg, #d98a06, #b86e00); }

@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- рисунки (art.js) ---------- */

.fa-art { display: block; flex: none; }
svg.fill { display: block; width: 100%; height: 100%; }

@keyframes ping { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, .55); } 50% { box-shadow: 0 0 0 6px rgba(255, 77, 109, 0); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* стеклянная метка поверх картинки */
.tag.glass {
  background: rgba(12, 8, 28, .58);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

.timer { font-variant-numeric: tabular-nums; }
.small { font-size: 12.5px; }

/* ---------- баннер раздела: картинка места и заголовок ---------- */

.banner {
  position: relative;
  height: 118px;
  margin-top: 10px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
  box-shadow: 0 8px 22px rgba(29, 23, 54, .22);
}

.banner > svg.fill { position: absolute; inset: 0; }
.banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 24, 0) 34%, rgba(10, 6, 24, .74));
}

.banner-text {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}

.banner-text b { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.banner-text span { font-size: 13px; opacity: .9; }
.banner .raid-chips { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1; }
.card > .banner:first-child { margin: 0 -14px 12px; border-radius: var(--radius) var(--radius) 0 0; box-shadow: none; }
.raid-head { padding-top: 0; overflow: hidden; }

.adv-title { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.adv-title .main { display: flex; flex-direction: column; min-width: 0; }
.adv-title b { font-size: 20px; font-weight: 800; }
.adv-hero {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(168, 85, 247, .5), transparent 70%), linear-gradient(160deg, var(--stage-2), var(--stage-1));
}
.adv-hero svg { width: 68px; height: 68px; margin: 0 0 0 -6px; }

/* ---------- главная ---------- */

.hero-home {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 14px;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(255, 122, 182, .14), transparent 60%),
    var(--card);
}

.hero-home-art, .heal-hero-art {
  position: relative;
  flex: none;
  width: 122px;
  height: 134px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(168, 85, 247, .5), transparent 68%),
    linear-gradient(165deg, #3a2a72, var(--stage-1));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
}

.hero-home-art svg { width: 138px; height: 138px; margin-bottom: -8px; }
.hero-home.wounded .hero-home-art svg, .heal-hero-art.wounded svg { filter: saturate(.55) brightness(.9); }

.hero-flag {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(229, 72, 77, .9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.hero-home-info, .heal-hero-info { flex: 1; min-width: 0; }
.hero-home-element { font-weight: 750; font-size: 15px; }
.hero-home-stats { display: flex; gap: 12px; margin: 2px 0 2px; font-size: 13px; color: var(--hint); font-weight: 600; }
.hero-home .meter, .heal-hero .meter { gap: 6px; }
.hero-home .meter b, .heal-hero .meter b { min-width: 0; font-size: 12px; }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.alert-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--sep);
}

.alert-card.danger {
  background: linear-gradient(135deg, rgba(229, 72, 77, .2), rgba(229, 72, 77, .06)), var(--card);
  border-color: rgba(229, 72, 77, .5);
  animation: alarm 1.6s ease-in-out infinite;
}

.alert-card.warn { background: linear-gradient(135deg, rgba(232, 169, 12, .16), rgba(232, 169, 12, .04)), var(--card); border-color: rgba(232, 169, 12, .4); }
.alert-card.good { background: linear-gradient(135deg, rgba(34, 177, 76, .16), rgba(34, 177, 76, .04)), var(--card); border-color: rgba(34, 177, 76, .4); }
.alert-card.battle { background: linear-gradient(135deg, rgba(139, 109, 255, .2), rgba(139, 109, 255, .05)), var(--card); border-color: rgba(139, 109, 255, .45); }

@keyframes alarm { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .0); } 50% { box-shadow: 0 0 0 4px rgba(229, 72, 77, .2); } }

.alert-art {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
}

.alert-art svg { width: 56px; height: 56px; margin: 0 0 0 -5px; }
.alert-main { flex: 1; min-width: 0; }
.alert-main b { display: block; font-size: 14px; line-height: 1.25; }
.alert-sub { margin-top: 1px; font-size: 12.5px; color: var(--hint); }
.alert-card .btn { flex: none; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.tile {
  position: relative;
  display: block;
  height: 118px;
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
  box-shadow: 0 6px 18px rgba(29, 23, 54, .2);
  transition: transform .1s ease;
}

.tile.wide { grid-column: 1 / -1; height: 144px; }
.tile:active { transform: scale(.97); }
.tile-art { position: absolute; inset: 0; }
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 24, 0) 38%, rgba(10, 6, 24, .78));
}

.tile-text {
  position: absolute;
  left: 12px;
  right: 10px;
  bottom: 9px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}

.tile-text b { font-size: 16px; font-weight: 750; }
.tile.wide .tile-text b { font-size: 20px; }
.tile-text span { font-size: 12px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tile-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff4d6d;
  border: 2px solid #fff;
  animation: ping 1.4s ease-in-out infinite;
}

.tile-pet { background: radial-gradient(120% 120% at 75% 30%, #ffe0f0, #ff9acb 40%, #8b5cf6 85%); }
.tile-pet .tile-art svg { position: absolute; right: -6px; top: -4px; width: 112px; height: 112px; }

/* ---------- походы ---------- */

.adv-meters .meter:first-child { margin-top: 0; }
.adv-head .warn-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.places { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.place-card { border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: 0 4px 16px rgba(0, 0, 0, .06); }
.place-art { position: relative; height: 134px; background: var(--stage-1); }
.place-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 24, .1), rgba(10, 6, 24, 0) 35%, rgba(10, 6, 24, .7));
}

.place-card.locked .place-art svg { filter: grayscale(.85) brightness(.75); }
.place-tags { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1; display: flex; justify-content: space-between; gap: 6px; }
.place-title { position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 1; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.place-title b { font-size: 20px; font-weight: 800; }
.place-body { padding: 12px 14px 14px; }
.place-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.pstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 2px;
  border-radius: 12px;
  background: var(--soft);
  text-align: center;
}

.pstat b { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pstat small { font-size: 11px; color: var(--hint); }
.place-finds { margin-top: 9px; font-size: 12.5px; line-height: 1.4; }

.btn.go {
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
  font-size: 15.5px;
  background: linear-gradient(135deg, #ff6fae, #8b6dff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(139, 109, 255, .28);
}

.btn.go.off, .btn.go:disabled { background: var(--soft); color: var(--hint); box-shadow: none; }

/* ---------- итог похода и другие итоги ---------- */

.result-banner { position: relative; height: 150px; margin: -20px -16px 6px; border-radius: 22px 22px 0 0; overflow: hidden; }
.result-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(10, 6, 24, .45)); }
.result-hero { position: absolute; left: 50%; bottom: -10px; z-index: 1; transform: translateX(-50%); }
.result-hero svg { width: 124px; height: 124px; }
.adv-result h3 { margin-top: 2px; }
.result-pet { display: flex; justify-content: center; }

.pet-found {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 122, 182, .2), rgba(139, 109, 255, .2));
  text-align: left;
  font-weight: 650;
  font-size: 14px;
}

.result-card .btn.wide + .btn.wide { margin-top: 8px; }

.versus { display: flex; align-items: center; justify-content: center; gap: 2px; }
.versus-art { width: 108px; height: 108px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 109, 255, .28), transparent 70%); }
.versus-art svg { width: 108px; height: 108px; }
.versus .result-icon { font-size: 40px; }

/* ---------- лечебница ---------- */

.heal-hero { display: flex; align-items: center; gap: 12px; }
.heal-hero-art { width: 104px; height: 122px; background: radial-gradient(circle at 50% 36%, rgba(255, 143, 168, .5), transparent 68%), linear-gradient(165deg, #4a2a62, var(--stage-1)); }
.heal-hero-art svg { width: 124px; height: 124px; margin-bottom: -8px; }
.heal-status { font-weight: 700; font-size: 14px; }
.heal-status.bad { color: var(--bad); }
.heal-meter .meter { margin-top: 6px; }
.regen { display: block; margin: 0 0 0 26px; font-size: 11px; color: var(--hint); }
.regen.full { color: var(--good); }
.healer-card .card-title { margin-bottom: 2px; }
.healer-card .hint { margin: 0 0 4px; }
.healer-card .btn.wide { margin-top: 8px; }

.heal-full {
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(34, 177, 76, .12);
  color: var(--good);
  font-weight: 650;
  text-align: center;
}

.btn.heal-btn { background: linear-gradient(135deg, #ff6f91, #e8274f); color: #fff; box-shadow: 0 6px 16px rgba(232, 39, 79, .25); }
.flask-box { flex: none; width: 40px; display: grid; place-items: center; }
.chips.qty { align-items: center; margin: 0 4px 8px; }
.list.potions .row { gap: 10px; }

.quick-potion {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(150deg, rgba(255, 111, 174, .22), rgba(139, 109, 255, .22));
  box-shadow: inset 0 0 0 1px rgba(139, 109, 255, .35);
}

.quick-potion:active { transform: scale(.94); }
.quick-potion b {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
}

.quick-potion b:empty { display: none; }
.quick-potions h3 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.quick-list { margin: 12px -4px 4px; }
.quick-list .list { background: var(--soft); }
.quick-potions .btn.wide + .btn.wide { margin-top: 8px; }

/* ---------- питомцы ---------- */

.pets-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pets-head-text { display: flex; flex-direction: column; min-width: 0; }
.pets-head-text b { font-size: 17px; }
.pets-head-text small { font-size: 12.5px; }
.pets { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.pet-card { padding: 12px; border-radius: 18px; background: var(--card); }
.pet-top { display: flex; gap: 12px; }

.pet-art {
  position: relative;
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, #fff6fb, #ffd0e6 55%, #f7a6cd);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}

.pet-art.rare { background: radial-gradient(circle at 50% 42%, #f2f8ff, #c7defd 55%, #8fb6f2); }
.pet-art.epic { background: radial-gradient(circle at 50% 42%, #faf2ff, #dcc6ff 55%, #b08cf5); }
.pet-art.legendary { background: radial-gradient(circle at 50% 42%, #fffbea, #ffe39a 55%, #f4b93f); box-shadow: 0 0 16px rgba(244, 185, 63, .45); }
.pet-art svg { width: 104px; height: 104px; }
.pet-card.asleep .pet-art { filter: saturate(.6); }

.pet-bubble {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
  animation: bob 1.6s ease-in-out infinite;
}

.pet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pet-name { display: flex; align-items: center; gap: 6px; }
.pet-name b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); font-size: 13px; }
.pet-species { font-size: 12.5px; color: var(--hint); }
.pet-state { font-size: 12.5px; font-weight: 650; }
.pet-state.active { color: var(--good); }
.pet-state.hungry { color: #e08a00; }
.pet-state.asleep { color: var(--bad); }
.pet-loot { font-size: 12.5px; font-weight: 600; }

.hearts { display: flex; align-items: center; gap: 1px; color: #ff5c8d; font-size: 13px; line-height: 1; }
.hearts i { font-style: normal; }
.hearts i:not(.on) { color: var(--hint); opacity: .55; }
.hearts small { margin-left: 6px; color: var(--hint); font-size: 11.5px; }

.pet-actions { display: flex; gap: 8px; margin-top: 10px; }
.pet-actions .btn:first-child { flex: 1; }
.btn.feed { background: linear-gradient(135deg, #ffb347, #ff6fae); color: #fff; }

.tag.rarity.common { color: var(--hint); }
.tag.rarity.rare { background: rgba(76, 141, 255, .16); color: #3f7ff0; }
.tag.rarity.epic { background: rgba(168, 85, 247, .16); color: #9a4cf0; }
.tag.rarity.legendary { background: rgba(232, 169, 12, .2); color: #c98a00; }

.shelter-body { display: flex; align-items: center; gap: 12px; }
.shelter .pet-art { width: 88px; height: 88px; border-radius: 20px; }
.shelter .pet-art svg { width: 88px; height: 88px; }
.shelter .btn.wide { margin-top: 12px; }
.card.gone { color: var(--bad); font-weight: 600; font-size: 14px; }

.rename-card { text-align: center; }
.rename-card h3 { margin: 4px 0 2px; font-size: 20px; }
.rename-card > p { margin: 0 0 10px; }
.rename-art { display: flex; justify-content: center; }
.rename-card .bet-input { text-align: center; }
.rename-card .btn.wide + .btn.wide { margin-top: 8px; }

/* ---------- нападения ---------- */

.raid-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.raid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.raid-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 2px;
  border-radius: 12px;
  background: var(--soft);
}

.raid-stats b { font-size: 15px; }
.raid-stats small { font-size: 11px; color: var(--hint); }
.raid-money { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }

.raid-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 18px;
  color: #fff;
}

.raid-alert.incoming {
  background: linear-gradient(135deg, #4a1023, #8a1d3d);
  box-shadow: 0 0 0 2px rgba(255, 90, 110, .65), 0 8px 24px rgba(160, 20, 50, .3);
  animation: alarm 1.4s ease-in-out infinite;
}

.raid-alert.outgoing { background: linear-gradient(135deg, var(--stage-2), var(--stage-1)); }
.raid-alert .muted { color: rgba(255, 255, 255, .7); }

.raid-face {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, .14);
}

.raid-face svg { width: 74px; height: 74px; margin: -1px 0 0 -6px; }
.raid-alert-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.raid-timer { font-weight: 700; font-variant-numeric: tabular-nums; }
.btn.wide-sm { width: 100%; margin-top: 2px; }

.target-art, .top-art {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
}

.target-art svg { width: 54px; height: 54px; margin: 0 0 0 -5px; }
.row.target { gap: 10px; }

/* ---------- рейтинг ---------- */

.chips.top-kinds { justify-content: center; }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin-top: 12px; }
.podium-place { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }

.podium-art {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
  box-shadow: 0 0 0 3px #c0c7d6;
}

.podium-art svg { width: 84px; height: 84px; margin: 0 0 0 -7px; }
.p1 .podium-art { width: 86px; height: 86px; box-shadow: 0 0 0 3px #f2b705, 0 0 20px rgba(242, 183, 5, .45); }
.p1 .podium-art svg { width: 102px; height: 102px; margin-left: -8px; }
.p3 .podium-art { box-shadow: 0 0 0 3px #d08a4f; }
.podium-place.me .podium-art { outline: 2px dashed var(--accent); outline-offset: 4px; }
.podium-medal { position: relative; z-index: 1; margin-top: -12px; font-size: 22px; line-height: 1; }
.podium-name { max-width: 100%; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13.5px; }
.podium-value { max-width: 100%; font-size: 12px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.podium-step {
  width: 100%;
  margin-top: 6px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, rgba(139, 109, 255, .38), rgba(139, 109, 255, .08));
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
}

.p1 .podium-step { height: 54px; background: linear-gradient(180deg, rgba(242, 183, 5, .45), rgba(242, 183, 5, .08)); color: #c98a00; }
.p2 .podium-step { height: 40px; }
.p3 .podium-step { height: 30px; }
.podium + .list { margin-top: 10px; }
.top-art { width: 36px; height: 36px; }
.top-art svg { width: 44px; height: 44px; margin: 0 0 0 -4px; }
.list + .my-place, .podium + .my-place, .card + .my-place { margin-top: 10px; }

/* ---------- арена: рисунки ---------- */

.monster-art, .rival-art { overflow: hidden; }
.monster-art { width: 60px; height: 60px; }
.monster-art svg { width: 66px; height: 66px; }
.monster.locked .monster-art svg { filter: grayscale(1); }
.monster.guard .monster-art { background: radial-gradient(circle, rgba(242, 183, 5, .45), transparent 70%), linear-gradient(150deg, var(--stage-2), var(--stage-1)); box-shadow: 0 0 0 2px rgba(242, 183, 5, .7); }
.rival-art { width: 56px; height: 56px; }
.rival-art svg { width: 66px; height: 66px; margin: 2px 0 0 -5px; }
.tower-icon { overflow: hidden; }

.next-guard {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(232, 169, 12, .14), rgba(232, 169, 12, .03)), var(--card);
  border: 1px solid rgba(232, 169, 12, .35);
}
.next-guard.legendary { background: linear-gradient(135deg, rgba(255, 122, 182, .18), rgba(139, 109, 255, .1)), var(--card); }
.next-guard .main { display: flex; flex-direction: column; min-width: 0; }
.next-guard b { font-size: 16px; }
.next-guard-art {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle, rgba(242, 183, 5, .4), transparent 70%), linear-gradient(150deg, var(--stage-2), var(--stage-1));
}
.next-guard-art svg { width: 72px; height: 72px; margin: -2px 0 0 -4px; }

.stage > * { position: relative; }
.stage > .stage-bg { position: absolute; inset: 0; opacity: .5; }
.stage-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(29, 23, 54, .35), var(--stage-1) 92%); }
.stage.is-shadow > .stage-bg::after { background: linear-gradient(180deg, rgba(18, 25, 49, .35), #121931 92%); }

.enemy-art { width: 150px; height: 150px; margin: 2px auto 0; }
.enemy-art svg { width: 150px; height: 150px; }
.hero-mini { flex: none; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, var(--stage-2), var(--stage-1)); }
.hero-mini svg { width: 42px; height: 42px; margin: 1px 0 0 -4px; }

/* ============ ГЕРОЙ: СНАРЯЖЕНИЕ, КУЗНИЦА, МАСТЕРСКАЯ, ЗАДАНИЯ (hero.js, gear.js, forge.js, workshop.js, quests.js) ============ */

/* цвета редкости */
.r-common { --rar: #9aa3ad; }
.r-uncommon { --rar: #36b864; }
.r-rare { --rar: #3d8bff; }
.r-epic { --rar: #a855f7; }
.r-legendary { --rar: #f59e0b; }
.r-mythic { --rar: #ef4444; }

/* вещь в рамке редкости */
.gi {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 3px;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rar, #9aa3ad) 28%, transparent), transparent 70%),
    linear-gradient(160deg, var(--stage-2), var(--stage-1));
  border: 2px solid var(--rar, #9aa3ad);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 2px 10px color-mix(in srgb, var(--rar, #9aa3ad) 35%, transparent);
}
.gi.r-legendary, .gi.r-mythic { animation: rarityPulse 2.6s ease-in-out infinite; }
.gi.dim { filter: grayscale(.8) brightness(.8); }
.gi svg { display: block; }
.gi-plus, .gi-count {
  position: absolute;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 8px;
  color: #fff;
}
.gi-plus { top: -6px; left: -6px; background: linear-gradient(135deg, #ffcf4a, #f08a00); color: #3a2400; }
.gi-count { bottom: -6px; right: -6px; background: rgba(20, 16, 40, .88); }
@keyframes rarityPulse { 0%, 100% { box-shadow: 0 0 6px color-mix(in srgb, var(--rar) 40%, transparent); } 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--rar) 75%, transparent); } }

.tag.rar { background: var(--soft); color: var(--rar, #9aa3ad); font-weight: 700; }
.tag.rar { background: color-mix(in srgb, var(--rar, #9aa3ad) 18%, transparent); color: var(--rar, #9aa3ad); font-weight: 700; }

/* прочность и заряд */
.dur { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dur-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--track); overflow: hidden; min-width: 40px; }
.dur-bar i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }
.dur.good .dur-bar i { background: linear-gradient(90deg, #2bd38f, #22b14c); }
.dur.warn .dur-bar i { background: linear-gradient(90deg, #ffcf4a, #e8a90c); }
.dur.bad .dur-bar i { background: linear-gradient(90deg, #ff7a7a, #e5484d); }
.dur.charge.good .dur-bar i { background: linear-gradient(90deg, #7aa7ff, #8b6dff); }
.dur small { flex: none; font-size: 12px; color: var(--hint); font-variant-numeric: tabular-nums; }

/* награды за разбор */
.reward-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.reward-chips.center { justify-content: center; }
.rchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 4px;
  border-radius: 12px;
  font-size: 13px;
  background: var(--soft);
  border: 1px solid var(--sep);
  border: 1px solid color-mix(in srgb, var(--rar, #9aa3ad) 55%, transparent);
  animation: chipIn .35s ease both;
}
.rchip i { font-style: normal; padding: 0 2px; }
.rchip.d1 { animation-delay: .06s; } .rchip.d2 { animation-delay: .12s; } .rchip.d3 { animation-delay: .18s; }
.rchip.d4 { animation-delay: .24s; } .rchip.d5 { animation-delay: .3s; } .rchip.d6 { animation-delay: .36s; } .rchip.d7 { animation-delay: .42s; }
@keyframes chipIn { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }

.gstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0 4px; }
.gstat { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.gstat b { color: var(--good); }
.gstat b.bad { color: var(--bad); }

/* кукла героя */
.doll { padding-bottom: 10px; color: var(--stage-text); background: radial-gradient(circle at 50% 30%, rgba(139, 109, 255, .35), transparent 60%), linear-gradient(170deg, var(--stage-2), var(--stage-1)); }
.doll.el-fire { background: radial-gradient(circle at 50% 30%, rgba(255, 110, 64, .35), transparent 60%), linear-gradient(170deg, #3a1d3a, #1d1736); }
.doll.el-water { background: radial-gradient(circle at 50% 30%, rgba(76, 141, 255, .35), transparent 60%), linear-gradient(170deg, #1d2c58, #141a36); }
.doll.el-earth { background: radial-gradient(circle at 50% 30%, rgba(90, 190, 110, .32), transparent 60%), linear-gradient(170deg, #1f3a2c, #15211d); }
.doll.el-air { background: radial-gradient(circle at 50% 30%, rgba(160, 220, 255, .32), transparent 60%), linear-gradient(170deg, #253b55, #182236); }
.doll.el-lightning { background: radial-gradient(circle at 50% 30%, rgba(255, 215, 64, .32), transparent 60%), linear-gradient(170deg, #3a3320, #1d1a14); }
.doll-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.doll-grid { display: grid; grid-template-columns: 1fr 150px 1fr; align-items: center; gap: 6px; }
.doll-hero { display: flex; justify-content: center; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.doll-amulets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  min-height: 104px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--stage-text);
  font: inherit;
  cursor: pointer;
}
.slot small { font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--stage-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot .dur { width: 100%; margin-top: 2px; }
.slot.empty { justify-content: center; border-style: dashed; }
.slot-ghost { font-size: 26px; opacity: .45; }
.slot.low { border-color: rgba(229, 72, 77, .6); }
.slot.fresh { animation: slotFresh .9s ease; }
@keyframes slotFresh { 0% { transform: scale(.8); box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); } 60% { transform: scale(1.06); } 100% { transform: none; box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
.doll-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 12px; }
.dstat { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: rgba(255, 255, 255, .07); }
.dstat b { font-size: 15px; }
.dstat small { font-size: 11px; }
.dstat small.good { color: #6ee7a0; }
.dstat small.bad { color: #ff8a8a; }
.doll-note { grid-column: 1 / -1; margin: 4px 0 0; text-align: center; font-size: 11px; color: var(--stage-muted); }
.doll .tag.glass { color: var(--stage-text); }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* рюкзак */
.bag-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); }
.bag-tab { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; }
.bag-tab i { font-style: normal; font-size: 18px; }
.bag-tab small { font-size: 11px; color: var(--hint); }
.bag-tab.active { background: var(--accent); color: var(--on-accent); }
.bag-tab.active small { color: var(--on-accent); }
.bag-tab.none { opacity: .45; }
.bag-list { margin-top: 8px; }
.gear-row { gap: 10px; cursor: pointer; }
.gear-row .dur { max-width: 180px; }
.row .sub.good { color: var(--good); }
.row .sub.trait { font-style: italic; }
.cmp { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; font-size: 12px; }
.cmp i { font-style: normal; font-weight: 700; }
.cmp i.up { color: var(--good); }
.cmp i.down { color: var(--bad); }
.cmp.same { color: var(--hint); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.res { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; background: var(--card); }
.res i { font-style: normal; font-size: 22px; }
.res span { font-size: 12px; color: var(--hint); }
.other-title { margin-top: 14px; }
.center-row { display: flex; justify-content: center; margin-top: 10px; }

/* карточка вещи (окно) */
.item-sheet { display: flex; flex-direction: column; gap: 6px; }
.sheet-art { display: flex; justify-content: center; padding: 14px 0 6px; border-radius: 16px; background: var(--soft); }
.sheet-art { background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--rar, #9aa3ad) 30%, transparent), transparent 70%); }
.sheet-title { margin: 4px 0 0; text-align: center; font-size: 19px; }
.sheet-line { padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.sheet-line.big { font-size: 16px; font-weight: 600; text-align: center; }
.sheet-block { padding: 8px 10px; border-radius: 12px; background: var(--soft); }
.sheet-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--hint); }
.sheet-label b { color: var(--text); }
.sheet-cmp { font-size: 13px; text-align: center; }
.sheet-buttons { display: flex; flex-direction: column; }
.sheet-buttons .btn.wide { margin-top: 8px; }
.warn-line { margin-top: 6px; padding: 7px 10px; border-radius: 10px; font-size: 13px; background: rgba(232, 169, 12, .14); color: #b77d00; }

/* кузница */
.forge-item { position: relative; margin-top: 10px; border: 1px solid var(--rar, var(--sep)); }
.forge-item { border: 1px solid color-mix(in srgb, var(--rar, #9aa3ad) 45%, transparent); }
.forge-item.low { border-color: rgba(229, 72, 77, .6); }
.forge-item.empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-style: dashed; }
.forge-item-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.forge-item-head .main { flex: 1; min-width: 0; }
.forge-item-head .sub { font-size: 13px; color: var(--hint); margin-top: 4px; }
.forge-block { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.forge-block.top { text-align: center; font-weight: 700; color: var(--gold); }
.forge-item .btn.wide { margin-top: 10px; }
.enhance-steps { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 8px 0; }
.enhance-steps i { height: 8px; border-radius: 4px; background: var(--track); }
.enhance-steps i.on { background: linear-gradient(90deg, #ffcf4a, #f08a00); }
.enhance-steps i.risky:not(.on) { background: rgba(229, 72, 77, .25); }
.enhance-steps i.next { animation: stepBlink 1.2s ease-in-out infinite; }
@keyframes stepBlink { 50% { background: rgba(255, 207, 74, .6); } }
.enhance-info { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--hint); }
.enhance-info b { color: var(--text); }
.enhance-info b.good, .enhance-info .good { color: var(--good); }
.enhance-info .bad { color: var(--bad); }
.enhance-btn { background: linear-gradient(135deg, #ffb340, #e0701a); color: #fff; box-shadow: 0 6px 16px rgba(224, 112, 26, .3); }

.forge-flash { position: relative; display: flex; justify-content: center; padding: 18px 0 8px; border-radius: 18px; }
.forge-flash.good { background: radial-gradient(circle, rgba(255, 215, 90, .45), transparent 65%); }
.forge-flash.warn { background: radial-gradient(circle, rgba(160, 160, 180, .35), transparent 65%); }
.forge-flash.bad { background: radial-gradient(circle, rgba(229, 72, 77, .4), transparent 65%); animation: shake .45s ease 2; }
.forge-flash .gi { animation: forgePop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.forge-spark { position: absolute; top: 6px; right: 28%; font-style: normal; font-size: 28px; animation: sparkUp 1.2s ease both; }
.forge-spark.big { position: static; font-size: 64px; animation: forgePop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes forgePop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sparkUp { from { transform: translateY(20px) scale(.4); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* мастерская */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px; background: var(--card); text-align: center; border: 1px solid var(--sep); border: 1px solid color-mix(in srgb, var(--rar) 35%, transparent); }
.mat b { font-size: 13.5px; }
.mat small { font-size: 11.5px; color: var(--hint); font-style: italic; }
.recipe { position: relative; margin-top: 10px; border: 1px solid var(--rar, var(--sep)); }
.recipe { border: 1px solid color-mix(in srgb, var(--rar, #9aa3ad) 40%, transparent); }
.recipe.dim .recipe-head { opacity: .7; }
.recipe-new { position: absolute; top: -8px; right: 12px; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff5fa2, #a855f7); animation: rarityPulse 2s ease-in-out infinite; --rar: #ff5fa2; }
.recipe-head { display: flex; align-items: center; gap: 12px; }
.recipe-head .main { flex: 1; min-width: 0; }
.recipe-head .sub { margin-top: 4px; font-size: 13px; color: var(--hint); }
.parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.part { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 9px 3px 5px; border-radius: 10px; font-size: 12.5px; white-space: nowrap; background: var(--soft); }
.part svg { flex: none; width: 20px; height: 20px; }
.part span { overflow: hidden; text-overflow: ellipsis; }
.part i { font-style: normal; }
.part b { font-variant-numeric: tabular-nums; color: var(--good); }
.part.lack b { color: var(--bad); }
.part.mat { border: 1px solid color-mix(in srgb, var(--rar) 45%, transparent); }
.recipe-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hidden-recipes { margin-top: 12px; text-align: center; background: linear-gradient(135deg, rgba(139, 109, 255, .14), rgba(139, 109, 255, .03)), var(--card); }

/* задания и достижения */
.qbar { height: 8px; margin-top: 8px; border-radius: 5px; background: var(--track); overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #c084fc); transition: width .5s ease; }
.qbar.good i { background: linear-gradient(90deg, #2bd38f, #22b14c); }
.qbar.gold i { background: linear-gradient(90deg, #ffcf4a, #e8a90c); }
.qbar.xp i { background: linear-gradient(90deg, #a855f7, #ec4899); }
.quests-body { margin-top: 10px; }
.quest-card { margin-top: 10px; }
.quest-card.offer { display: flex; align-items: center; gap: 10px; }
.quest-card.offer .quest-head { flex: 1; }
.quest-card.done { border: 1px solid rgba(34, 177, 76, .5); background: linear-gradient(135deg, rgba(34, 177, 76, .14), rgba(34, 177, 76, .02)), var(--card); }
.quest-head { display: flex; align-items: center; gap: 12px; }
.quest-head .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quest-head small { color: var(--hint); }
.quest-emoji { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; font-style: normal; font-size: 24px; background: linear-gradient(160deg, var(--stage-2), var(--stage-1)); }
.quest-count { margin-top: 4px; text-align: right; font-size: 12px; color: var(--hint); font-variant-numeric: tabular-nums; }
.steps { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.step { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--soft); }
.step i { font-style: normal; font-size: 18px; }
.step .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.step small { color: var(--hint); }
.step.done { opacity: .6; }
.step.current { background: linear-gradient(135deg, rgba(139, 109, 255, .2), rgba(139, 109, 255, .05)); border: 1px solid rgba(139, 109, 255, .45); }
.ach-summary { text-align: center; }
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ach { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px; border-radius: 14px; background: var(--card); text-align: center; }
.ach .qbar { width: 100%; }
.ach b { font-size: 13.5px; }
.ach small { font-size: 11.5px; color: var(--hint); }
.ach-icon { font-style: normal; font-size: 30px; filter: grayscale(1); opacity: .5; }
.ach.earned .ach-icon, .ach.ready .ach-icon { filter: none; opacity: 1; }
.ach.earned { background: linear-gradient(160deg, rgba(232, 169, 12, .16), rgba(232, 169, 12, .03)), var(--card); border: 1px solid rgba(232, 169, 12, .35); }
.ach.ready { border: 1px solid rgba(34, 177, 76, .6); animation: rarityPulse 2s ease-in-out infinite; --rar: #22b14c; }
.ach-reward { color: var(--gold) !important; font-weight: 600; }
.ach-got { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--soft); }
.ach-got i { font-style: normal; font-size: 22px; }
.ach-got b { flex: 1; }
.ach-got span { color: var(--gold); font-size: 13px; }
.quest-flash { min-height: 96px; align-items: center; }


/* ==================== НАВИГАЦИЯ: ГРУППЫ РАЗДЕЛОВ (app.js HUBS, home.js) ==================== */

/* переключатель разделов группы - под шапкой, всегда на виду */
.subnav {
  position: sticky;
  top: var(--top-h, 63px);
  z-index: 4;
  display: flex;
  gap: 4px;
  margin: -4px -12px 6px;
  padding: 6px 10px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--sep);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav button {
  position: relative;
  flex: 1 0 auto;
  min-width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--hint);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  transition: background .15s, color .15s, transform .1s;
}
.subnav button i { font-style: normal; font-size: 17px; line-height: 1; filter: grayscale(.5); }
.subnav button.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.subnav button.active i { filter: none; }
.subnav button:active { transform: scale(.96); }
.subnav button.alert::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--card);
}
.subnav button.active.alert::after { box-shadow: 0 0 0 2px var(--accent); }

/* «Сегодня» на главной */
.today { margin-top: 14px; }
.today > h2 { margin: 0 4px 8px; font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--hint); }
.today-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.today-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 8px 12px 8px 10px;
  border: 1px solid rgba(229, 72, 77, .35);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(229, 72, 77, .14), rgba(229, 72, 77, .03)), var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
}
.today-chip i { font-style: normal; font-size: 17px; }
.today-chip b { font-weight: 750; white-space: nowrap; }
.today-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--hint); }
.today-calm { padding: 12px 14px; border-radius: 14px; background: var(--card); color: var(--hint); font-size: 14px; }

/* группа разделов на главной */
.hub-card { margin-top: 16px; }
.hub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
}
.hub-head i { font-style: normal; font-size: 24px; }
.hub-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-head b { font-size: 18px; font-weight: 800; }
.hub-head small { font-size: 12.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-go { font-size: 26px; line-height: 1; color: var(--hint); }

.mtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mtile {
  position: relative;
  display: block;
  height: 104px;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  color: #fff;
  font: inherit;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
  box-shadow: 0 4px 14px rgba(29, 23, 54, .18);
  transition: transform .1s ease;
}
.mtile.wide { grid-column: span 2; }
.mtile:active { transform: scale(.96); }
.mtile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 6, 28, .82), rgba(10, 6, 28, 0) 62%); }
.mtile .tile-art { position: absolute; inset: 0; }
.mtile.char .tile-art svg { position: absolute; right: -10px; top: -8px; width: 96px; height: 96px; }
.mtile.char.wide .tile-art svg { width: 130px; height: 130px; right: -6px; top: -14px; }
.mtile.tile-pet .tile-art svg { position: absolute; right: -8px; top: -6px; width: 92px; height: 92px; }
.mtile-text { position: absolute; left: 10px; right: 8px; bottom: 8px; z-index: 1; display: flex; flex-direction: column; gap: 1px; }
.mtile-text b { font-size: 14px; font-weight: 750; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile.wide .mtile-text b { font-size: 17px; }
.mtile-text span { font-size: 11px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile .tile-dot { z-index: 2; }

.top-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(232, 169, 12, .18), rgba(232, 169, 12, .04)), var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.top-link i { font-style: normal; font-size: 28px; }
.top-link div { flex: 1; display: flex; flex-direction: column; }
.top-link b { font-size: 16px; }
.top-link small { font-size: 12.5px; color: var(--hint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==================== ⛩ ХРАМ (shrine.js) ==================== */

.shrine-top { display: flex; align-items: center; gap: 12px; }
.shrine-top-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shrine-top-text b { font-size: 18px; font-weight: 800; }
.shrine-top-text span { font-size: 13px; }
.shrine-top-text small { font-size: 12px; color: var(--hint); }

.mikuji-box {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 92px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(90deg, #8a4a24, #c77a3e 30%, #e09a5a 50%, #c77a3e 70%, #8a4a24);
  box-shadow: inset 0 0 0 3px #5a2a14, inset 0 8px 0 #d2303e, 0 6px 14px rgba(0, 0, 0, .3);
  color: #2a1208;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.05;
}
.mikuji-box span { position: relative; z-index: 1; }
.mikuji-box.mini { width: 48px; height: 70px; font-size: 11px; }
.mikuji-box.shake { animation: mikuji-shake .28s ease-in-out infinite; }
.mikuji-box.out { animation: none; }
.mikuji-stick {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 14px;
  height: 64px;
  margin-left: -7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e8d3a8, #fff4d8, #e8d3a8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  color: #8a1a24;
  font-size: 9px;
  font-style: normal;
  writing-mode: vertical-rl;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: transform .5s cubic-bezier(.2, 1.4, .4, 1), opacity .2s;
}
.mikuji-box.out .mikuji-stick { opacity: 1; transform: translateY(-46px); }
@keyframes mikuji-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) translateX(-4px); } 75% { transform: rotate(12deg) translateX(4px); } }

.draw-ladder { display: flex; gap: 4px; margin-top: 12px; }
.draw-ladder span {
  flex: 1;
  padding: 4px 0;
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--hint);
}
.draw-ladder span.done { opacity: .45; text-decoration: line-through; }
.draw-ladder span.next { background: rgba(210, 48, 62, .14); color: #d2303e; box-shadow: inset 0 0 0 1.5px rgba(210, 48, 62, .5); }
.btn.draw:not(.off) { background: linear-gradient(135deg, #e0353f, #b4233c); color: #fff; box-shadow: 0 6px 18px rgba(224, 53, 63, .3); }

.favor { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 143, 184, .1); }
.favor-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.favor small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--hint); }
.favor .bar { margin-top: 6px; }
.bar.favor i { background: linear-gradient(90deg, #ffb7d0, #ff6f91); }
.favor.full { background: linear-gradient(135deg, rgba(255, 143, 184, .22), rgba(255, 210, 63, .18)); }
.favor.full small { color: #e0559a; font-weight: 650; }

.shrine-curse { margin-top: 10px; background: linear-gradient(135deg, rgba(90, 60, 160, .22), rgba(90, 60, 160, .05)), var(--card); border-color: rgba(120, 90, 200, .45); }
.kanji-art { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(160deg, #4a3a7a, #241a48); }
.btn.tie { background: linear-gradient(135deg, #3f9a5e, #2a7448); color: #fff; }

.blessing .title { display: flex; align-items: center; gap: 6px; }
.blessing .side { font-size: 12.5px; color: var(--hint); font-variant-numeric: tabular-nums; }

/* листок омикудзи */
.slip {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffaf0, #f6ecd8);
  color: #2a1a10;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(150, 110, 60, .25);
  overflow: hidden;
}
.slip::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, #d2303e 0 10px, #b4233c 10px 20px); }
.slip.compact { cursor: pointer; }
.slip-head { display: flex; gap: 12px; align-items: flex-start; }
.slip-kanji { flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 6px; background: #d2303e; color: #fff; font-size: 30px; font-weight: 800; line-height: 1.05; }
.slip.bad .slip-kanji { background: #3a2a5a; }
.slip.great .slip-kanji { background: linear-gradient(160deg, #ffcf4a, #e0353f); text-shadow: 0 1px 4px rgba(120, 30, 0, .5); }
.slip-title { flex: 1; min-width: 0; }
.slip-title small { font-size: 11px; color: #8a6a4a; letter-spacing: .04em; }
.slip-title b { display: block; font-size: 18px; font-weight: 800; }
.slip-title p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.slip-seal { position: absolute; right: 10px; bottom: 8px; width: 30px; height: 30px; border-radius: 6px; border: 2px solid rgba(210, 48, 62, .55); color: rgba(210, 48, 62, .6); font-style: normal; font-weight: 800; display: flex; align-items: center; justify-content: center; transform: rotate(-8deg); }
.slip.compact .slip-seal { bottom: auto; top: 12px; }
.slip-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.slip-line { padding: 6px 8px; border-radius: 6px; background: rgba(150, 110, 60, .1); font-size: 12px; line-height: 1.3; }
.slip-line b { display: block; color: #a0303a; font-size: 11px; }
.slip-lucky { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-right: 36px; font-size: 12px; }
.slip.tied { opacity: .7; }
.slip.tied::after { content: '🎋 на ветке'; position: absolute; right: 10px; top: 12px; padding: 2px 8px; border-radius: 10px; background: #3f9a5e; color: #fff; font-size: 11px; font-weight: 700; }

.shrine-gifts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.gift { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(232, 169, 12, .14); }
.gift i { font-style: normal; font-size: 22px; }
.gift b { display: block; font-size: 14px; }
.gift small { font-size: 12px; color: var(--hint); }
.gift.curse { background: rgba(110, 80, 190, .16); }

/* окно с листком */
.mikuji-reveal { text-align: left; }
.mikuji-stage {
  position: relative;
  height: 150px;
  margin: -4px -4px 0;
  border-radius: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  overflow: hidden;
  background: radial-gradient(90% 90% at 50% 100%, #ff9a8b, #6b3a92 60%, #24175a);
  cursor: pointer;
}
.mikuji-stage.bad { background: radial-gradient(90% 90% at 50% 100%, #6a5a9a, #2a2050 60%, #120c28); }
.mikuji-stage.great.opened { background: radial-gradient(90% 90% at 50% 100%, #fff1a8, #ff8a4a 45%, #8a2a6a); }
.mikuji-stage::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .6s; background: repeating-conic-gradient(from 0deg at 50% 100%, rgba(255, 246, 200, .35) 0 6deg, transparent 6deg 18deg); }
.mikuji-stage.good.opened::after { opacity: 1; animation: spin 18s linear infinite; }
.mikuji-stage .mikuji-box { width: 70px; height: 100px; font-size: 15px; z-index: 1; }
.mikuji-reveal .slip { margin-top: -30px; z-index: 2; transform-origin: top center; transform: scaleY(0); opacity: 0; }
.mikuji-reveal .slip.open { transform: none; opacity: 1; transition: transform .6s cubic-bezier(.2, 1.2, .4, 1), opacity .2s; }
.mikuji-reveal .slip.fly { transform: translate(-30%, -120%) rotate(-30deg) scale(.15); opacity: 0; transition: transform .8s ease-in, opacity .8s ease-in; }
.mikuji-after { opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s; }
.mikuji-after.show { opacity: 1; transform: none; }
.petal-fx { position: absolute; top: -12px; width: 10px; height: 8px; border-radius: 10px 0 10px 0; background: #ffc2d6; opacity: 0; animation: petal-fall 4s linear infinite; }
@keyframes petal-fall { 0% { opacity: 0; transform: translateY(0) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(-30px, 170px) rotate(320deg); } }

.offerings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.offering { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: var(--radius); background: var(--card); text-align: center; }
.offering:active:not(:disabled) { transform: scale(.96); }
.offering i { font-style: normal; font-size: 30px; line-height: 1.1; }
.offering b { font-size: 12.5px; line-height: 1.2; min-height: 30px; display: flex; align-items: center; }
.offering .price { font-weight: 750; font-size: 14px; }
.offering small { font-size: 11.5px; color: #e0559a; font-weight: 650; }
.offering.off { opacity: .5; }
.offering-gift p { font-weight: 650; }

.shrine-info { margin-top: 12px; }
.shrine-info details { margin-bottom: 8px; }
.shrine-info summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.flat-list { margin-top: 6px; background: none; }
.odds { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.odd { display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 10px; background: var(--soft); }
.odd b { font-size: 20px; color: #d2303e; }
.odd.bad b { color: #6a5aa8; }
.odd span { font-size: 11px; text-align: center; }
.odd small { font-weight: 700; font-size: 12px; }
.shrine-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.shrine-history { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

/* ==================== 🎣 РЫБАЛКА (fishing.js) и цвета редкости (fishing.js, cases.js) ==================== */

.r-junk { --rar: #8a8f98; }
.r-common { --rar: #a3aab4; }
.r-uncommon { --rar: #3cc46a; }
.r-rare { --rar: #3a8dff; }
.r-epic { --rar: #a855f7; }
.r-legendary { --rar: #ff9a1f; }
.r-mythic { --rar: #ff3b5c; }
.tag.rar { background: color-mix(in srgb, var(--rar) 18%, transparent); color: var(--rar); }

.pond-card { padding-top: 0; overflow: hidden; }
.pond-stage { position: relative; height: 210px; margin: 0 -14px; overflow: hidden; background: #0b2440; }
.pond-stage > svg.fill { position: absolute; inset: 0; width: 100%; height: 100%; }
.pond-line { position: absolute; right: 0; top: -20px; width: 2px; height: 245px; background: rgba(255, 255, 255, .55); transform-origin: top; transform: rotate(51deg); opacity: 0; }
.pond-float { position: absolute; left: 46%; top: 118px; width: 18px; height: 26px; opacity: 0; transform: translateY(-80px) scale(.6); }
.pond-float i { display: block; width: 18px; height: 26px; border-radius: 50% 50% 45% 45%; background: linear-gradient(180deg, #ff4a4a 0 48%, #ffffff 52%); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 0 12px rgba(255, 120, 120, .5); }
.pond-ripple, .pond-shadow, .pond-bang { position: absolute; left: calc(46% + 9px); top: 140px; opacity: 0; pointer-events: none; }
.pond-ripple { width: 20px; height: 7px; margin: -3px 0 0 -10px; border-radius: 50%; border: 1.5px solid rgba(190, 230, 255, .8); }
.pond-shadow { width: 60px; height: 20px; margin: 4px 0 0 -30px; border-radius: 50%; background: rgba(0, 10, 20, .55); filter: blur(3px); }
.s-medium .pond-shadow { width: 80px; height: 26px; margin-left: -40px; }
.s-big .pond-shadow { width: 104px; height: 32px; margin-left: -52px; }
.s-huge .pond-shadow { width: 140px; height: 42px; margin-left: -70px; background: rgba(40, 0, 20, .6); }
.pond-bang { top: 70px; margin-left: -18px; width: 36px; height: 36px; border-radius: 50%; background: #ffd23f; color: #2a1630; font-size: 26px; font-weight: 900; text-align: center; line-height: 36px; box-shadow: 0 0 18px rgba(255, 210, 63, .8); }
.pond-label { position: absolute; left: 12px; bottom: 10px; padding: 4px 10px; border-radius: 12px; background: rgba(8, 20, 40, .65); color: #fff; font-size: 13px; font-weight: 700; }
.pond-blessing { position: absolute; right: 10px; top: 10px; }

.pond-stage.wait .pond-line, .pond-stage.bite .pond-line { opacity: 1; }
.pond-stage.wait .pond-float, .pond-stage.bite .pond-float { opacity: 1; transform: none; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; }
.pond-stage.wait .pond-float i { animation: float-bob 1.6s ease-in-out infinite; }
.pond-stage.wait .pond-ripple { animation: ripple 2.2s ease-out infinite; }
.pond-stage.wait .pond-ripple.r2 { animation-delay: 1.1s; }
.pond-stage.wait .pond-shadow { opacity: .5; animation: lurk 3s ease-in-out infinite; }
.pond-stage.bite .pond-float i { animation: float-bite .22s ease-in-out infinite; }
.pond-stage.bite .pond-ripple { animation: ripple .7s ease-out infinite; }
.pond-stage.bite .pond-shadow { opacity: .85; }
.pond-stage.bite .pond-bang { opacity: 1; animation: pop .3s cubic-bezier(.2, 1.6, .4, 1); }
.pond-stage.bite .pond-label { background: #e0353f; }
.pond-stage.gone .pond-label { background: rgba(80, 90, 120, .8); }
@keyframes float-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes float-bite { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(14px) rotate(8deg); } }
@keyframes ripple { from { transform: scale(.6); opacity: .9; } to { transform: scale(4); opacity: 0; } }
@keyframes lurk { 0%, 100% { transform: translateX(-30px); } 50% { transform: translateX(30px); } }

.btn.pond-btn { background: linear-gradient(135deg, #2b8ad3, #1a5e9e); color: #fff; }
.btn.pond-btn.wait { background: linear-gradient(135deg, #3a4a6a, #2a3450); }
.btn.pond-btn.bite { background: linear-gradient(135deg, #ffb03b, #e0353f); animation: bite-pulse .5s ease-in-out infinite; }
@keyframes bite-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.pond-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--hint); font-weight: 600; }

.bait-card { margin-top: 10px; }
.bait-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bait-packs .btn { flex-direction: column; gap: 0; }
.bait-packs .btn small { font-size: 11px; opacity: .8; font-weight: 600; }

.fish-row { border-left: 3px solid var(--rar); }
.fish-ico { flex: none; width: 44px; height: 44px; }
.fish-ico svg { width: 44px; height: 44px; }

.aquarium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.aqua { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 14px; background: var(--card); box-shadow: inset 0 -3px 0 var(--rar); text-align: center; }
.aqua-art svg { width: 76px; height: 76px; }
.aqua b { font-size: 12.5px; line-height: 1.2; }
.aqua small { font-size: 11px; color: var(--hint); }
.aqua.unknown .aqua-art svg { filter: brightness(0) opacity(.35); }
.aqua.unknown b { color: var(--hint); }

.catch-card .catch-art { display: flex; justify-content: center; margin: -8px auto 0; border-radius: 50%; width: 190px; height: 190px; background: radial-gradient(circle, color-mix(in srgb, var(--rar) 45%, transparent), transparent 68%); }
.catch-card h3 { margin-top: 0; }
.catch-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.catch-size { margin: 8px 0 2px; font-size: 16px; }
.catch-size b { font-size: 22px; }
.catch-card .btn.wide + .btn.wide { margin-top: 8px; }
.treat-card { margin-top: 10px; }

/* ==================== 🎁 КЕЙСЫ (cases.js) ==================== */

.donate { margin-top: 10px; background: linear-gradient(135deg, rgba(232, 169, 12, .16), rgba(139, 109, 255, .08)), var(--card); border-color: rgba(232, 169, 12, .35); }
.case-card { margin-top: 10px; position: relative; overflow: hidden; }
.case-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.case-sakura::before { background: radial-gradient(80% 60% at 0% 0%, rgba(255, 143, 184, .3), transparent 70%); }
.case-dragon::before { background: radial-gradient(80% 60% at 0% 0%, rgba(255, 90, 58, .3), transparent 70%); }
.case-kami::before { background: radial-gradient(80% 60% at 0% 0%, rgba(192, 139, 255, .35), transparent 70%); }
.case-card > * { position: relative; }
.case-head { display: flex; align-items: center; gap: 10px; }
.case-art { flex: none; width: 96px; height: 96px; }
.case-art svg { width: 104px; height: 104px; margin: -6px 0 0 -4px; }
.case-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.case-text b { font-size: 17px; font-weight: 800; }
.case-text span:not(.tag) { font-size: 13px; color: var(--hint); }
.case-buttons { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-top: 10px; }
.case-btn { min-height: 44px; }
.case-btn:not(.soft) { background: linear-gradient(135deg, #8b5cf6, #d946ef); color: #fff; box-shadow: 0 6px 16px rgba(168, 85, 247, .3); }
.case-btn.poor { opacity: .7; }
.pity { margin-top: 10px; }
.pity-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; }
.pity .bar { margin-top: 4px; }
.bar.pity i { background: linear-gradient(90deg, #ffd23f, #ff7a1f); }
.case-drops { margin-top: 10px; }
.case-drops summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.drops { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.drop { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: color-mix(in srgb, var(--rar) 10%, transparent); border-left: 3px solid var(--rar); font-size: 13px; }
.drop i { font-style: normal; width: 20px; text-align: center; }
.drop span { flex: 1; min-width: 0; }
.drop b { font-variant-numeric: tabular-nums; }
.drop.excl { background: linear-gradient(90deg, rgba(255, 210, 63, .22), transparent); }

/* открытие */
.case-open { position: relative; text-align: center; }
.case-open-title { font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.roll-window { position: relative; height: 104px; margin: 0 -6px; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, #1d1736, #2e2158); box-shadow: inset 0 0 18px rgba(0, 0, 0, .5); }
.roll-strip { display: flex; padding: 12px 0; transition: transform 4.6s cubic-bezier(.08, .72, .16, 1); will-change: transform; }
.roll-strip.instant { transition: none; }
.roll-cell { flex: none; width: 70px; height: 80px; margin: 0 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px; background: linear-gradient(180deg, rgba(255, 255, 255, .08), color-mix(in srgb, var(--rar) 35%, transparent)); border-bottom: 3px solid var(--rar); color: #fff; }
.roll-cell i { font-style: normal; font-size: 28px; }
.roll-cell small { font-size: 9.5px; line-height: 1.1; padding: 0 3px; overflow: hidden; max-height: 22px; opacity: .85; }
.roll-cell.excl { box-shadow: inset 0 0 0 2px #ffd23f; }
.roll-cell.win { animation: win-cell .6s ease 2; box-shadow: 0 0 0 2px var(--rar), 0 0 22px var(--rar); }
.roll-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #ffd23f; box-shadow: 0 0 10px #ffd23f; }
.roll-marker::before, .roll-marker::after { content: ''; position: absolute; left: -6px; border: 7px solid transparent; }
.roll-marker::before { top: 0; border-top-color: #ffd23f; }
.roll-marker::after { bottom: 0; border-bottom-color: #ffd23f; }
@keyframes win-cell { 50% { transform: scale(1.1); } }
.roll-after { opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s; pointer-events: none; }
.roll-after.show { opacity: 1; transform: none; pointer-events: auto; }
.roll-after .loot-card { margin-top: 12px; }

.loot-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: 14px; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rar) 40%, transparent), var(--soft) 75%); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rar) 70%, transparent); }
.loot-card i { font-style: normal; font-size: 34px; line-height: 1.1; }
.loot-card b { font-size: 14px; }
.loot-card small { font-size: 12px; color: var(--rar); font-weight: 700; }
.loot-card.excl { background: radial-gradient(circle at 50% 0%, rgba(255, 210, 63, .55), rgba(255, 90, 58, .12) 75%); box-shadow: inset 0 0 0 2px #ffd23f, 0 0 20px rgba(255, 210, 63, .45); }
.loot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.loot-grid .loot-card { opacity: 0; animation: card-flip .5s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.loot-grid .loot-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
@keyframes card-flip { from { opacity: 0; transform: perspective(500px) rotateY(90deg) scale(.8); } to { opacity: 1; transform: none; } }
.chest-art { display: flex; justify-content: center; height: 150px; }
.chest-art svg { width: 160px; height: 160px; margin-top: -8px; }
.chest-art.shaking { animation: mikuji-shake .25s ease-in-out infinite; }
.chest-art.opened { animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
.excl-flash { position: absolute; inset: -16px; display: flex; align-items: center; justify-content: center; border-radius: 18px; background: radial-gradient(circle, rgba(255, 246, 200, .95), rgba(255, 210, 63, .6) 45%, transparent 75%); pointer-events: none; animation: excl 1.8s ease forwards; }
.excl-flash b { font-size: 24px; color: #8a3a00; text-shadow: 0 0 12px #fff; }
@keyframes excl { 0% { opacity: 0; transform: scale(.6); } 20% { opacity: 1; transform: scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1); } }
/* ---------- мировой босс (boss.js) ---------- */

.boss-stage { padding-bottom: 14px; }
.boss-stage.legendary { box-shadow: 0 0 0 2px rgba(255, 196, 64, .75), 0 0 28px rgba(255, 122, 182, .45), 0 10px 30px rgba(29, 23, 54, .35); }
.boss-stage.legendary .enemy-name { background: linear-gradient(90deg, #ffe08a, #ff9ad5, #b9a4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boss-art { position: relative; width: 210px; height: 210px; margin: 4px auto 0; animation: idle 3s ease-in-out infinite; }
.boss-art.hit { animation: hit .45s ease; }
.boss-art svg { width: 210px; height: 210px; }
.floater.big { top: 38%; font-size: 34px; color: #fff; -webkit-text-stroke: 1px #c2143a; text-shadow: 0 0 10px rgba(255, 77, 109, .9), 0 3px 8px rgba(0, 0, 0, .7); }
.boss-hp { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.boss-hp b { text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.boss-hp-bar { position: relative; height: 14px; border-radius: 8px; background: rgba(255, 255, 255, .14); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.boss-hp-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; background: linear-gradient(90deg, #ff4d6d, #ff9a3c); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.boss-stage.legendary .boss-hp-bar i { background: linear-gradient(90deg, #ff6fae, #ffd166, #8b6dff); }
.boss-rules { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-top: 8px; font-size: 12.5px; color: var(--hint); }
.boss-hero .hero-title .muted { margin-left: auto; }
.btn.boss-strike { background: linear-gradient(135deg, #f0525a, #8b2fc9); color: #fff; box-shadow: 0 6px 16px rgba(240, 82, 90, .3); }
.btn.boss-strike.off, .btn.boss-strike:disabled { background: var(--soft); color: var(--hint); box-shadow: none; }
.boss-actions .btn.wide + .btn.wide { margin-top: 8px; }
.boss-last { border: 1px solid rgba(139, 109, 255, .35); animation: fresh .3s ease; }
.boss-last b { display: block; margin-bottom: 2px; }
.boss-mine { display: flex; align-items: center; gap: 12px; }
.boss-mine .main { min-width: 0; }
.boss-mine-place { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; font-weight: 800; background: var(--soft); }
.empty-share { display: block; }
.boss-fall-art { width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 64, .35), transparent 70%); }
.boss-fall-art svg { width: 150px; height: 150px; }
.boss-fall.legendary h3 { color: #e8a90c; }
.boss-fall-title { margin: 14px 0 6px; text-align: left; font-weight: 700; }
.boss-fall-list { text-align: left; background: var(--soft); }
.boss-fall-list .row { padding: 8px 12px; }
.tile-art > svg.fa-boss, .tile-art > svg.fa-monster { position: absolute; right: -8px; top: -10px; width: 140px; height: 140px; }

/* ---------- подземелье ёкаев (dungeon.js) ---------- */

.dg-lobby .meter:first-of-type { margin-top: 10px; }
.dg-keys { display: flex; align-items: center; gap: 4px; font-size: 22px; }
.dg-keys .muted { margin-left: auto; font-size: 12.5px; }
.dg-key.used { filter: grayscale(1); opacity: .35; }
.dg-legend { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.dg-head .dg-title { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dg-title .main { display: flex; flex-direction: column; min-width: 0; }
.dg-title b { font-size: 18px; font-weight: 800; }
.dg-bag { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dg-bag-box { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--soft); }
.dg-bag-box.safe { background: rgba(34, 177, 76, .12); }
.dg-bag-box small { font-size: 11.5px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; }
.dg-bag-box b { font-size: 14px; font-variant-numeric: tabular-nums; }
.dg-head .tags { margin-top: 8px; }
.dg-head .warn-line { margin-top: 8px; font-size: 13px; color: var(--bad); font-weight: 600; }

.dg-map { padding: 10px; background: linear-gradient(180deg, rgba(139, 109, 255, .08), transparent), var(--card); }
.dg-row { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.dg-row + .dg-row::before { content: ''; position: absolute; left: 14px; top: -6px; height: 12px; border-left: 2px dashed var(--sep); }
.dg-floor { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); font-weight: 800; font-size: 13px; color: var(--hint); }
.dg-row.current .dg-floor { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 4px rgba(139, 109, 255, .25); }
.dg-row.current { align-items: flex-start; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dg-chip { padding: 5px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dg-chip.done { background: rgba(34, 177, 76, .16); color: var(--good); }
.dg-chip.skipped { opacity: .35; }
.dg-chip.locked { color: var(--hint); }
.dg-chip.active { background: var(--accent); color: var(--on-accent); }
.dg-chip.boss { background: linear-gradient(135deg, rgba(229, 72, 77, .22), rgba(139, 109, 255, .22)); color: var(--text); }

.dg-choices { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dg-node {
  position: relative;
  display: block;
  width: 100%;
  min-height: 96px;
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: linear-gradient(160deg, var(--stage-2), var(--stage-1));
  box-shadow: 0 6px 16px rgba(29, 23, 54, .22);
  transition: transform .1s ease;
}
.dg-node:active { transform: scale(.98); }
.dg-node-scene { position: absolute; inset: 0; opacity: .75; }
.dg-node::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 6, 24, .82) 30%, rgba(10, 6, 24, .2)); }
.dg-node-foe { position: absolute; right: -4px; bottom: -8px; z-index: 1; width: 96px; height: 96px; }
.dg-node-foe svg { width: 96px; height: 96px; }
.dg-node-text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 12px 96px 12px 14px; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.dg-node-text b { font-size: 16px; font-weight: 750; }
.dg-node-text span { font-size: 12.5px; opacity: .9; }
.dg-node-stats { margin-top: 3px; font-size: 12px; font-weight: 600; color: #ffd9a8; }
.dg-node.elite { box-shadow: 0 0 0 2px rgba(229, 72, 77, .6), 0 6px 16px rgba(29, 23, 54, .22); }
.dg-node.boss { min-height: 112px; box-shadow: 0 0 0 2px rgba(232, 169, 12, .75), 0 0 22px rgba(232, 169, 12, .3); }
.dg-node.boss.legendary { box-shadow: 0 0 0 2px #ff9ad5, 0 0 24px rgba(255, 122, 182, .45); }
.dg-node.boss .dg-node-foe, .dg-node.boss .dg-node-foe svg { width: 112px; height: 112px; }

.dg-stage { overflow: hidden; }
.dg-stage-art { position: relative; height: 150px; margin: -14px -14px 12px; background: var(--stage-1); }
.dg-stage-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 6, 24, 0) 40%, rgba(10, 6, 24, .6)); }
.dg-stage-foe { position: absolute; left: 50%; bottom: -6px; z-index: 1; transform: translateX(-50%); }
.dg-stage-foe svg { width: 110px; height: 110px; }
.dg-stage-title { display: block; font-size: 19px; font-weight: 800; }
.dg-stage p { margin: 6px 0 10px; font-size: 14px; }
.dg-buttons { display: flex; gap: 8px; }
.dg-buttons > .btn { flex: 1; }
.dg-buttons.col { flex-direction: column; }
.dg-offers { display: flex; flex-direction: column; gap: 8px; }
.dg-offer { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; text-align: left; background: linear-gradient(135deg, rgba(232, 169, 12, .16), rgba(139, 109, 255, .1)); border: 1px solid rgba(232, 169, 12, .35); }
.dg-offer i { font-style: normal; font-size: 28px; }
.dg-offer div { display: flex; flex-direction: column; }
.dg-offer small { color: var(--hint); font-size: 12.5px; }
.dg-shop { background: var(--soft); }
.dg-clear .dg-stage-title { color: var(--gold); }
.stage.is-dungeon { background: radial-gradient(120% 70% at 50% 18%, rgba(255, 77, 109, .28), transparent 60%), linear-gradient(180deg, #2a1440, #120a22); }
.dg-end .result-icon { margin-top: 4px; font-size: 44px; }
.dg-end.dead h3, .dg-end.fled h3 { color: var(--bad); }
.dg-end.complete h3, .dg-end.left h3 { color: var(--good); }

/* ============ РЫНОК ============ */
.mk-price { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.mk-price small { font-size: 11px; font-weight: 400; color: var(--hint); }
.mk-count { min-width: 28px; text-align: center; font-size: 16px; }
.mk-total { padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 15px; color: var(--text); }
.market-body .gear-row .btn.small { margin-left: 6px; }
.item-sheet .bad { color: var(--bad); }

/* ============ ОБРАЗ (косметика) ============ */
.hud-ava.framed { box-shadow: 0 0 0 3px var(--frame), 0 0 14px var(--frame); }
.look-art { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.look-art svg { position: relative; z-index: 1; }
.look-art.aura::before {
  content: ''; position: absolute; inset: -18% -18% 0; z-index: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--aura), transparent 62%);
  opacity: .6; animation: aura-pulse 2.8s ease-in-out infinite;
}
.look-art.aura::after {
  content: attr(data-icon); position: absolute; z-index: 2; top: 4px; right: 6px; font-size: 18px;
  animation: aura-float 3.4s ease-in-out infinite;
}
@keyframes aura-pulse { 0%, 100% { opacity: .45; transform: scale(.94); } 50% { opacity: .75; transform: scale(1.04); } }
@keyframes aura-float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
.hero-home-art .look-art svg { width: 138px; height: 138px; margin-bottom: -8px; }
.look-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.look-ring {
  width: 168px; height: 168px; border-radius: 50%; overflow: hidden; display: flex; align-items: flex-end;
  justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(168, 85, 247, .45), transparent 70%),
  linear-gradient(165deg, #3a2a72, var(--stage-1));
}
.look-ring.framed { box-shadow: 0 0 0 4px var(--frame), 0 0 22px var(--frame); }
.look-ring .look-art svg { width: 160px; height: 160px; margin-bottom: -10px; }
.look-name { font-weight: 700; font-size: 17px; text-align: center; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; }
.look-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px;
  border: 2px solid var(--rar, transparent); background: var(--card); color: var(--text); font: inherit; cursor: pointer;
}
.look-tile b { font-size: 13px; text-align: center; line-height: 1.2; }
.look-tile small { font-size: 11px; text-align: center; color: var(--hint); line-height: 1.2; }
.look-tile.locked { opacity: .62; border-style: dashed; }
.look-tile.worn { box-shadow: 0 0 0 2px var(--accent); }
.look-icon {
  font-style: normal; font-size: 30px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tint, #a855f7) 45%, transparent), transparent 70%);
}

/* персонажи: портрет в круге цвета стихии */
.chips.hero-sex { justify-content: center; margin: 0 0 8px; }

/* навыки: карточка на навык - уровень, полоса до следующего, бонусы, покупка за изумруды */
.skills { display: flex; flex-direction: column; gap: 10px; }
.skill-card { display: flex; flex-direction: column; gap: 8px; }
.skill-head { display: flex; align-items: center; gap: 10px; }
.skill-icon { font-style: normal; font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(160deg, rgba(168, 85, 247, .3), rgba(91, 33, 182, .2)); box-shadow: inset 0 0 0 1px rgba(196, 160, 255, .3); }
.skill-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.skill-title b { font-size: 16px; }
.skill-level { font-weight: 800; font-size: 15px; color: #ffd66a; }
.skill-card.fresh .skill-level { color: var(--hint); }
.bar.xp i { background: linear-gradient(90deg, #a855f7, #ffd66a); }
.skill-bonus { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.skill-next { color: var(--hint); font-size: 13px; }
.skill-foot { display: flex; align-items: center; gap: 10px; }
.skill-foot small { flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; }
.skill-foot .btn { flex: none; }
.look-tile.hero-tile { padding: 8px 6px 10px; }
.look-tile.hero-tile svg { width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(168, 85, 247, .35), transparent 70%); }
.look-tile.hero-tile small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ============ ПУТЬ САМУРАЯ И СОБЫТИЯ ============ */
.season-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.season-chip {
  display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; border: 0; text-align: left;
  background: var(--card); color: var(--text); font: inherit; cursor: pointer; min-width: 0;
}
.season-chip i { font-style: normal; font-size: 24px; }
.season-chip div { display: flex; flex-direction: column; min-width: 0; }
.season-chip b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.season-chip small { font-size: 11.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.season-chip.alert { box-shadow: 0 0 0 2px var(--accent); }
.season-chip.fest { background: linear-gradient(135deg, rgba(255, 122, 58, .22), var(--card)); }
.pass-head { display: flex; gap: 12px; align-items: center; }
.pass-level {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; background: radial-gradient(circle at 40% 30%, #ffd23a, #e8273f); color: #fff;
}
.pass-level b { font-size: 24px; line-height: 1; }
.pass-level small { font-size: 10px; opacity: .85; }
.pass-progress { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pass-premium { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, .2), var(--card)); }
.pass-premium .btn { grid-column: 2; grid-row: 1 / span 2; padding: 9px 12px; white-space: nowrap; }
.pass-track { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.pass-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: stretch; }
.pass-row.head b { font-size: 12px; color: var(--hint); text-align: center; }
.pass-lvl {
  display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--soft); font-size: 14px;
}
.pass-row.reached .pass-lvl { background: var(--accent); color: var(--on-accent); }
.pass-row.next .pass-lvl { box-shadow: 0 0 0 2px var(--accent); }
.pass-cell {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--card);
  font-size: 12.5px; line-height: 1.25; min-width: 0;
}
.pass-cell i { font-style: normal; flex: none; }
.pass-cell span { overflow: hidden; text-overflow: ellipsis; }
.pass-cell.empty { justify-content: center; color: var(--hint); background: transparent; }
.pass-cell.locked { opacity: .55; }
.pass-cell.ready { box-shadow: 0 0 0 2px var(--accent); }
.pass-cell.cosmetic { background: linear-gradient(135deg, rgba(168, 85, 247, .18), var(--card)); }
.fest-head { display: flex; gap: 12px; align-items: center; }
.fest-tokens { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.fest-tokens i { font-style: normal; font-size: 30px; }
.fest-tokens b { font-size: 22px; }
.fest-tokens small { font-size: 11px; color: var(--hint); }
.fest-next { display: flex; flex-direction: column; gap: 6px; }
.fest-count { font-size: 22px; font-weight: 700; }
.fest-item.cosmetic .title { font-weight: 700; }
.pass-progress .bar { flex: none; height: 10px; }
.bar.pass i { background: linear-gradient(90deg, #ffd23a, #e8273f); }

/* ============ ПИТОМЦЫ: что приносят ============ */
.pet-finds { margin: 8px 0 2px; font-size: 13px; }
.pet-finds summary { cursor: pointer; color: var(--hint); }
.find-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.find-chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 8px; border-radius: 10px; background: var(--soft); font-size: 12px; }
.find-chip b { font-weight: 600; color: var(--hint); }
.find-chip.rare { background: color-mix(in srgb, #a855f7 20%, transparent); }

/* ============ ЗНАКОМСТВО ============ */
.tour-layer { position: fixed; inset: 0; z-index: 90; }
.tour-ring {
  position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(8, 4, 20, .66), 0 0 0 3px var(--accent);
  transition: all .25s ease; pointer-events: none;
}
.tour-ring[hidden] { display: block; width: 0; height: 0; left: 50%; top: 50%; box-shadow: 0 0 0 9999px rgba(8, 4, 20, .66); }
.tour-card {
  position: fixed; left: 16px; right: 16px; padding: 14px; border-radius: 16px; background: var(--card); color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); display: flex; flex-direction: column; gap: 6px; transition: top .25s ease;
}
.tour-card.center { top: 34%; }
.tour-card b { font-size: 17px; }
.tour-card p { margin: 0; font-size: 14.5px; line-height: 1.4; }
.tour-step { font-size: 12px; color: var(--hint); }
.tour-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.tour-again { margin-top: 6px; }

/* ============ КЛАНОВЫЙ РЕЙД ============ */
.raid-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.raid-boss { position: relative; display: flex; justify-content: center; }
.raid-boss.shake svg { animation: raid-shake .35s ease-in-out 2; }
@keyframes raid-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.raid-dmg {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%); font-size: 28px; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7); animation: raid-float 1.2s ease-out forwards;
}
.raid-dmg.crit { color: #ffd23a; font-size: 34px; }
@keyframes raid-float { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -60px; } }
.raid-name { font-size: 18px; font-weight: 700; }
.raid-card .meter { width: 100%; }
.raid-hit { margin-top: 8px; }
.row.me { box-shadow: inset 3px 0 0 var(--accent); }

/* ============ АДМИНКА ============ */
/* Цвета графиков: синий и оранжевый (проверены на различимость, в т.ч. при дальтонизме) */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; }
@media (prefers-color-scheme: dark) { :root:not([data-scheme="light"]) { --viz-1: #3987e5; --viz-2: #d95926; } }
:root[data-scheme="dark"] { --viz-1: #3987e5; --viz-2: #d95926; }

.admin-views { display: flex; gap: 6px; overflow-x: auto; margin: 10px -12px 0; padding: 0 12px 2px; scrollbar-width: none; }
.admin-views::-webkit-scrollbar { display: none; }
.admin-views .chip { flex: none; }
.admin-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.admin-flags .tag { white-space: normal; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat-grid.two { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
.stat-tile { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px; border-radius: 14px; background: var(--card); }
.card .stat-tile { background: var(--soft); }
.stat-tile b { font-size: 19px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-tile span { font-size: 12px; color: var(--hint); }
.stat-tile small { font-size: 11px; color: var(--hint); }

.viz { position: relative; margin-top: 4px; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--sep); stroke-width: 1; }
.viz-axis { stroke: var(--track); stroke-width: 1; }
.viz-tick { fill: var(--hint); font-size: 10px; font-family: inherit; }
.viz-s1 { fill: var(--viz-1); }
.viz-s2 { fill: var(--viz-2); }
.viz-line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { fill: var(--viz-1); stroke: var(--card); stroke-width: 2; opacity: 0; }
.viz-point:hover .viz-dot, .viz-point.viz-on .viz-dot { opacity: 1; }
.viz-hit { fill: transparent; cursor: pointer; }
rect.viz-hit.viz-on { fill: var(--soft); }
.viz-tip {
  position: absolute; top: -6px; z-index: 2; padding: 5px 9px; border-radius: 9px; background: var(--fb-toast); color: #fff;
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.viz-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--hint); }
.viz-legend span { display: inline-flex; align-items: center; gap: 5px; }
.viz-key { width: 10px; height: 10px; border-radius: 3px; background: var(--viz-1); }
.viz-key.viz-s2 { background: var(--viz-2); }
.viz-table { margin-top: 8px; font-size: 13px; }
.viz-table summary { cursor: pointer; color: var(--hint); }
.viz-table table, .cohorts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.viz-table th, .viz-table td, .cohorts th, .cohorts td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--sep); }
.viz-table th:first-child, .viz-table td:first-child, .cohorts th:first-child, .cohorts td:first-child { text-align: left; }
.viz-table th, .cohorts th { font-size: 11.5px; color: var(--hint); font-weight: 600; }
.money-now { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.money-now b { font-size: 22px; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.hbar-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-head b { flex: none; font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; margin-top: 4px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--viz-1); }
.hbar-fill.viz-s2 { background: var(--viz-2); }
.sub-title { margin: 14px 0 8px; font-size: 13px; color: var(--hint); text-transform: uppercase; letter-spacing: .03em; }

.cohort-wrap { overflow-x: auto; padding: 8px 10px; }
.cohorts td { font-size: 13px; }
.cohorts td.heat-0 { background: color-mix(in srgb, var(--viz-1) 6%, transparent); }
.cohorts td.heat-1 { background: color-mix(in srgb, var(--viz-1) 14%, transparent); }
.cohorts td.heat-2 { background: color-mix(in srgb, var(--viz-1) 22%, transparent); }
.cohorts td.heat-3 { background: color-mix(in srgb, var(--viz-1) 32%, transparent); }
.cohorts td.heat-4 { background: color-mix(in srgb, var(--viz-1) 42%, transparent); }
.cohorts td.heat-na { color: var(--hint); }

.admin-search { display: flex; gap: 8px; margin-top: 10px; }
.admin-search .bet-input { font-size: 16px; font-weight: 600; }
.admin-player { width: 100%; text-align: left; background: none; color: inherit; }
.admin-card { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.admin-card-head { display: flex; gap: 12px; align-items: center; }
.admin-card-head b { font-size: 18px; }
.mini-art { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); overflow: hidden; }
.mini-art svg { width: 44px; height: 44px; }
.mini-art.big { width: 64px; height: 64px; }
.mini-art.big svg { width: 64px; height: 64px; }
.admin-grant { display: flex; flex-direction: column; gap: 10px; }
.admin-grant-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-setting { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.admin-setting .chips { margin-top: 2px; }
.admin-setting .btn { align-self: flex-start; }
.admin-text {
  width: 100%; min-height: 110px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--soft); color: var(--text);
  font: inherit; font-size: 15px; resize: vertical; outline: none;
}
.admin-text:focus { box-shadow: 0 0 0 2px var(--accent); }
.admin-preview { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border-left: 3px solid var(--accent); background: var(--soft);
  font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.admin-preview b { display: block; margin-bottom: 4px; }

.switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--track); transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(18px); }

/* ============ НАСТРОЙКИ ИГРЫ (админка владельца): любое значение из config.py ============ */
.cfg-intro { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 14px; line-height: 1.35; }
.cfg-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cfg-section { text-align: left; }
.cfg-section.changed .side { color: #ffd66a; font-weight: 700; }
.cfg-head { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.cfg-head > b { font-size: 18px; }
.cfg-head .btn { align-self: flex-start; margin-top: 4px; }
.cfg-card { padding: 4px 12px; margin-top: 10px; }
.cfg-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--sep); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row.changed { box-shadow: inset 3px 0 0 #ffd66a; padding-left: 8px; }
.cfg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cfg-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cfg-name b { font-size: 14px; }
.cfg-row code, .cfg-group-head code { font-size: 11px; color: var(--hint); background: none; padding: 0; overflow-wrap: anywhere; }
.cfg-where { font-size: 11px; color: #c8a8ff; }
.cfg-hint { font-size: 12px; line-height: 1.3; color: var(--hint); }
.cfg-hint.group { padding: 0 10px 6px; }
.cfg-meta { font-size: 12px; color: #ffd66a; }
.cfg-edit { flex: none; display: flex; align-items: center; gap: 6px; }
.cfg-input { width: 92px; padding: 8px 10px; border-radius: 10px; border: 0; background: var(--soft); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 650; text-align: right; }
.cfg-input.text { width: 150px; text-align: left; font-weight: 500; font-size: 14px; }
.cfg-input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.cfg-fixed { max-width: 130px; font-size: 12px; color: var(--hint); text-align: right; overflow-wrap: anywhere; }
.cfg-reset { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 214, 106, .15); color: #ffd66a; font-size: 16px; font-weight: 800; }
.cfg-inline { flex-wrap: wrap; }
.cfg-cells { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 100%; }
.cfg-cell { display: flex; align-items: center; gap: 4px; }
.cfg-cell small { font-size: 11px; color: var(--hint); }
.cfg-cell .cfg-input { width: 74px; }
.cfg-cell.changed .cfg-input { box-shadow: 0 0 0 2px rgba(255, 214, 106, .6); }
.cfg-group { margin: 6px 0; border-radius: 12px; background: rgba(255, 255, 255, .03); }
.cfg-group.changed > .cfg-group-head b { color: #ffd66a; }
.cfg-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; text-align: left; color: var(--text); }
.cfg-group-title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cfg-group-head small { flex: none; font-size: 12px; color: var(--hint); }
.cfg-group-head i { flex: none; font-style: normal; color: var(--hint); }
.cfg-body { padding: 0 10px 4px; }
.cfg-group.depth-2, .cfg-group.depth-3 { background: rgba(255, 255, 255, .03); }
@media (max-width: 380px) {
  .cfg-input { width: 80px; }
  .cfg-input.text { width: 120px; }
}

/* ============ ЛАБОРАТОРИЯ ============ */
.lab-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lab-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border-radius: 14px; background: var(--card); }
.lab-slot.busy { box-shadow: inset 0 0 0 2px rgba(168, 85, 247, .45); }
.lab-slot.free { box-shadow: inset 0 0 0 2px rgba(34, 177, 76, .35); }
.lab-slot.locked { opacity: .6; }
.lab-slot .btn { width: 100%; padding: 6px 8px; font-size: 13px; }
.lab-head { display: flex; justify-content: space-between; align-items: center; }
.lab-what { font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.lab-bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.lab-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.lab-timer { font-size: 12px; font-weight: 600; color: var(--hint); font-variant-numeric: tabular-nums; }
.lab-amulet { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.lab-amulet.upgrading { box-shadow: inset 0 0 0 2px rgba(168, 85, 247, .35); }
.lab-amulet-head { display: flex; gap: 12px; align-items: center; }
.lab-amulet-head .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lab-amulet-head .sub { font-size: 13px; color: var(--hint); }
.lab-upgrading, .lab-next { display: flex; flex-direction: column; gap: 8px; }
.lab-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; }
.lab-line.gold, .lab-line .gold, b.gold { color: var(--gold); }
.lab-line .good { color: var(--good); }
.lab-next .btn, .lab-upgrading .btn, .lab-sell { align-self: flex-start; }

/* ============ ГЛАВНАЯ: ИГРОВОЙ ЭКРАН (home.js, village.js) ============ */
/* Главная - один экран без прокрутки: карта во весь экран, панели поверх неё */
html.game-mode, html.game-mode body { overflow: hidden; height: 100%; overscroll-behavior: none; }
#app.mode-home { max-width: none; padding: 0; }
#app.mode-home .offline { position: fixed; z-index: 25; left: 10px; right: 10px; top: calc(var(--safe-top) + 10px); margin: 0;
  background: #3a1220; color: #ffb3bd; }
html.game-mode .toast { bottom: calc(var(--bar-h) + var(--safe-bottom) + 18px); }

.game {
  position: fixed; left: 0; right: 0; top: 0; height: var(--app-h, 100vh); overflow: hidden; max-width: 600px; margin: 0 auto;
  background: #140f33; color: #fff; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.game-stage { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--bar-h) + var(--safe-bottom)); overflow: hidden; }
.village-world { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.village-world .village-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* значки зданий: круг со значком и имя под ним */
.v-spot {
  position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: translate(-50%, -50%) scale(var(--spot, 1)); transition: transform .12s ease; color: #fff;
}
.v-spot:active { transform: translate(-50%, -50%) scale(calc(var(--spot, 1) * .9)); }
.v-spot i {
  position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 18px; line-height: 1;
  background: rgba(16, 12, 40, .72); border: 1.5px solid rgba(255, 255, 255, .38);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}
.v-spot span {
  padding: 1px 6px; border-radius: 8px; background: rgba(16, 12, 40, .62);
  font-size: 10.5px; font-weight: 750; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.v-spot small { margin-top: -1px; font-size: 9.5px; font-weight: 800; color: #ffd27a; text-shadow: 0 1px 2px #000; }
.v-spot.locked i { background: rgba(16, 12, 40, .5); border-color: rgba(255, 255, 255, .2); font-size: 15px; }
.v-spot.locked span { opacity: .8; }
.v-spot.alert i { border-color: #ffd27a; box-shadow: 0 0 0 3px rgba(255, 210, 122, .25), 0 3px 10px rgba(0, 0, 0, .35); animation: spotGlow 1.8s ease-in-out infinite; }
@keyframes spotGlow { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 122, .08), 0 3px 10px rgba(0, 0, 0, .35); } }
.v-dot { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #ff4d5e;
  box-shadow: 0 0 0 2px rgba(16, 12, 40, .9); animation: vdot 1.6s ease-in-out infinite; }
@keyframes vdot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* верх: герой, кошелёк, полоски, кнопки, «Сейчас» */
.game-top {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0; display: flex; flex-direction: column; gap: 6px;
  padding: calc(var(--safe-top) + 8px) 8px 0; pointer-events: none;
}
.game-top > * { pointer-events: auto; }
.glass, .hud-hero, .hud-wallet span, .hud-bars, .notice {
  background: rgba(12, 9, 30, .66); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .1);
}
.hud { display: flex; align-items: center; gap: 8px; }
.hud-hero {
  position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px; color: #fff; text-align: left;
}
.hud-hero:active { transform: scale(.97); }
.hud-hero.alert::after { content: ''; position: absolute; top: 2px; left: 34px; width: 10px; height: 10px; border-radius: 50%;
  background: #ff4d5e; box-shadow: 0 0 0 2px rgba(12, 9, 30, .9); }
.hud-ava {
  flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(140deg, var(--stage-2), var(--stage-1)); box-shadow: 0 0 0 2px rgba(168, 85, 247, .55);
}
.hud-ava svg { width: 54px; height: 54px; margin-top: 8px; }
.hud-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hud-who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-who small { font-size: 11.5px; color: rgba(255, 255, 255, .7); font-weight: 600; }
.hud-xp { height: 3px; margin-top: 3px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; max-width: 140px; }
.hud-xp i { display: block; height: 100%; background: var(--xp); border-radius: 3px; }
.hud-potion { background: rgba(12, 9, 30, .66); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.hud-wallet { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hud-wallet span { padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }

.hud-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 10px; border-radius: 14px; color: #fff; }
.hud-bars:active { transform: scale(.98); }
.hud-bar { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hud-bar i { font-style: normal; font-size: 12px; }
.hud-bar .bar { flex: 1; height: 6px; background: rgba(255, 255, 255, .16); }
.hud-bar b { font-size: 11.5px; font-weight: 800; min-width: 22px; text-align: right; }
.hud-bars.wounded { border-color: rgba(239, 67, 80, .7); animation: hurt 1.6s ease-in-out infinite; }
@keyframes hurt { 50% { box-shadow: 0 0 0 3px rgba(239, 67, 80, .25); } }

.quick-row { display: flex; gap: 6px; align-self: flex-start; }
.q-btn { position: relative; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; }
.q-btn i {
  position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 21px;
  background: linear-gradient(150deg, rgba(139, 109, 255, .55), rgba(40, 28, 90, .8)); border: 1.5px solid rgba(255, 255, 255, .28);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.q-btn.fest i { background: linear-gradient(150deg, rgba(255, 138, 61, .7), rgba(120, 30, 60, .85)); }
.q-btn i b { position: absolute; right: -4px; bottom: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center; background: #ffd27a; color: #2a1a10; font-size: 10.5px; font-weight: 800; }
.q-btn span { font-size: 10px; font-weight: 750; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .6); }
.q-btn.alert i::after { content: ''; position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: #ff4d5e; box-shadow: 0 0 0 2px rgba(12, 9, 30, .9); }
.q-btn:active i { transform: scale(.92); }

.notice {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 6px 8px; border-radius: 16px; color: #fff;
}
.notice.calm { min-height: 0; padding: 8px 12px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .8); }
.notice.danger { border-color: rgba(239, 67, 80, .8); background: rgba(70, 12, 28, .78); }
.notice.warn { border-color: rgba(232, 169, 12, .7); }
.notice.good { border-color: rgba(34, 177, 76, .7); }
.notice.battle { border-color: rgba(139, 109, 255, .8); }
.notice-art { flex: none; width: 40px; height: 40px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); }
.notice-art svg { width: 48px; height: 48px; }
.notice-art .alert-place { display: block; width: 40px; height: 40px; }
.notice-art .alert-place svg { width: 40px; height: 40px; }
.notice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice-main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-main small { font-size: 11.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice .btn { flex: none; }
.notice .btn.soft { background: rgba(255, 255, 255, .14); color: #fff; }
.notice-arrow { flex: none; width: 20px; align-self: stretch; font-size: 22px; font-weight: 700; color: rgba(255, 255, 255, .75); }
.notice-count { position: absolute; top: -8px; right: 12px; padding: 1px 7px; border-radius: 8px; background: #ff4d5e;
  font-size: 10.5px; font-weight: 800; }

/* низ: панель с большой кнопкой похода */
.game-bar {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: calc(var(--bar-h) + var(--safe-bottom));
  display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr; align-items: start;
  padding: 0 6px var(--safe-bottom);
  background: linear-gradient(to top, rgba(10, 8, 26, .98), rgba(18, 14, 40, .94));
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.gb-btn { position: relative; height: var(--bar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: rgba(255, 255, 255, .86); font-size: 11px; font-weight: 700; }
.gb-btn i { font-style: normal; font-size: 23px; line-height: 1.1; }
.gb-btn:active i { transform: scale(.9); }
.gb-btn[disabled] { opacity: .35; }
.gb-btn.alert::after { content: ''; position: absolute; top: 9px; left: calc(50% + 9px); width: 10px; height: 10px; border-radius: 50%;
  background: #ff4d5e; box-shadow: 0 0 0 2px rgba(12, 9, 30, .9); }
.gb-go {
  position: relative; height: calc(var(--bar-h) + 6px); margin-top: -18px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0; border-radius: 22px; color: #fff; font-weight: 800;
  background: linear-gradient(160deg, #ff9a3d, #e8274f); box-shadow: 0 6px 18px rgba(232, 39, 79, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.gb-go i { font-style: normal; font-size: 26px; line-height: 1.1; }
.gb-go span { font-size: 13px; }
.gb-go small { font-size: 10.5px; opacity: .85; }
.gb-go:active { transform: scale(.95); }
.gb-go[disabled] { filter: grayscale(.8); opacity: .6; }
.gb-go.alert::after { content: ''; position: absolute; top: 6px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #ffd27a; }

/* невысокий экран: кнопки меньше и без подписей, ещё ниже - кнопки только в меню, «Сейчас» - строкой */
@media (max-height: 740px) {
  .q-btn { width: 40px; }
  .q-btn i { width: 38px; height: 38px; font-size: 18px; }
  .q-btn span { display: none; }
  .notice { min-height: 46px; padding: 4px 8px; }
  .notice-art { width: 34px; height: 34px; }
  .notice-art .alert-place, .notice-art .alert-place svg { width: 34px; height: 34px; }
  .hud-ava { width: 38px; height: 38px; }
}
@media (max-height: 600px) {
  .quick-row { display: none; }
  .notice-art { display: none; }
  .notice { min-height: 40px; }
  .notice-main small { display: none; }
  .hud-bars { padding: 4px 10px; }
}

/* окна: картинка-шапка раздела ниже (название уже в шапке окна) */
#app.mode-window .banner { height: 64px; margin-top: 6px; }
#app.mode-window .banner-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* окна плотнее: кукла снаряжения и карточки лаборатории */
#app.mode-window .slot { min-height: 72px; padding: 6px; }
#app.mode-window .doll-note { display: none; }
#app.mode-window .doll-hero svg { width: 124px; height: 124px; }
#app.mode-window .doll-grid { grid-template-columns: 1fr 124px 1fr; }
#app.mode-window .doll-stats { margin-top: 8px; }
#app.mode-window .dstat { padding: 4px 2px; }
#app.mode-window .section.bag > h2 { display: none; }   /* раздел рюкзака и так виден по выбранной вкладке */
#app.mode-window .lab-amulet { gap: 8px; padding: 10px 12px; }
#app.mode-window .lab-amulet-head .fa-art, #app.mode-window .lab-amulet-head svg { max-width: 48px; max-height: 48px; }

/* листание страницами (F.pager) вместо длинной прокрутки */
.pager { display: flex; flex-direction: column; gap: 8px; }
.pager-page { touch-action: pan-y; }
.pager-col { display: flex; flex-direction: column; gap: 8px; }
.pager > .pager-page.places, .pager > .pager-page.steps, .pager > .pager-page.ach-grid, .pager > .pager-page.look-grid { margin-top: 0; }
.pager-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pager-btn { width: 44px; height: 36px; border-radius: 12px; background: var(--card); font-size: 24px; font-weight: 700; line-height: 1;
  color: var(--text); box-shadow: inset 0 0 0 1px var(--sep); }
.pager-btn[disabled] { opacity: .3; }
.pager-btn:not([disabled]):active { transform: scale(.92); }
.pager-dots { display: flex; gap: 6px; }
.pager-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--track); }
.pager-dots i.on { width: 18px; border-radius: 4px; background: var(--accent); }
.pager-count, .pager-label { font-size: 13px; font-weight: 700; color: var(--hint); }

/* меню: все разделы на одном экране */
.menu-sheet { display: flex; flex-direction: column; gap: 10px; }
.menu-head { display: flex; justify-content: space-between; align-items: center; }
.menu-head b { font-size: 19px; }
.menu-close { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); font-size: 16px; }
.menu-group small { display: block; margin: 0 2px 6px; font-size: 12px; font-weight: 750; letter-spacing: .03em; color: var(--hint); }
.menu-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.menu-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px;
  border-radius: 14px; background: var(--soft); color: var(--text); font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; }
.menu-tile i { font-style: normal; font-size: 22px; line-height: 1.1; }
.menu-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-tile small { font-size: 9.5px; color: var(--gold); font-weight: 800; }
.menu-tile.locked { opacity: .6; }
.menu-tile.alert::after { content: ''; position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #ff4d5e; }
.menu-tile:active { transform: scale(.94); }
.menu-tour { align-self: center; padding: 6px 12px; color: var(--hint); font-size: 13px; font-weight: 650; }

/* ============ СОЗДАНИЕ ГЕРОЯ ============ */
.create-layer { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: #120f24; color: #fff; }
.create-inner { max-width: 480px; margin: 0 auto; padding: calc(22px + var(--safe-top)) 18px calc(22px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px; min-height: 100%; box-sizing: border-box; }
.create-head { text-align: center; }
.create-head small { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: #a9a3c9; }
.create-head h1 { margin: 2px 0 0; font-size: 26px; font-weight: 800; }
.create-stage { position: relative; display: flex; justify-content: center; align-items: center; height: 232px; touch-action: pan-y; }
.create-stage svg { position: relative; width: 230px; height: 230px; animation: fresh .3s ease; }
/* персонаж под рисунком: «‹ Аки · рыжий задира 1/16 ›» */
.create-hero { display: flex; align-items: center; gap: 10px; margin-top: -6px; }
.create-arrow { flex: none; width: 42px; height: 42px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff;
  font-size: 26px; font-weight: 700; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.create-arrow:active { transform: scale(.92); }
/* ♂ / ♀ в углу сцены: листать только парней или только девушек */
.create-sex { position: absolute; right: 0; top: 6px; display: flex; flex-direction: column; gap: 6px; }
.create-sex-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #d8d2f2; font-size: 18px;
  font-weight: 700; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: background .15s, color .15s; }
.create-sex-btn.active { background: #a855f7; color: #fff; box-shadow: 0 0 12px rgba(168, 85, 247, .6); }
.create-hero-name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.create-hero-name b { font-size: 19px; font-weight: 800; }
.create-hero-name small { font-size: 12.5px; color: #a9a3c9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.create-glow { position: absolute; left: 50%; top: 50%; width: 290px; height: 290px; margin: -145px 0 0 -145px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, rgba(18, 15, 36, 0) 68%); }
.create-picker { display: flex; justify-content: center; gap: 10px; }
.create-dot { width: 54px; height: 54px; border-radius: 50%; border: 2px solid #2c2650; background: #1b1735; font-size: 25px; }
.create-dot.active { background: #262049; transform: scale(1.06); }
.create-card { background: #1b1735; color: #fff; display: flex; flex-direction: column; gap: 6px; }
.create-card p { margin: 0; font-size: 15px; line-height: 1.4; color: #dcd7f2; }
.create-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.create-title b { font-size: 22px; }
.create-title .tag { background: rgba(255, 255, 255, .12); color: #fff; font-size: 12.5px; }
.create-strong small { display: block; font-size: 12.5px; color: #a9a3c9; }
.create-strong b { font-size: 14px; font-weight: 600; }
.create-go { margin-top: auto; min-height: 54px; font-size: 17px; font-weight: 800; color: #fff; }
.create-hint { margin: 0; text-align: center; font-size: 12.5px; line-height: 1.45; color: #a9a3c9; }
/* невысокий экран: всё на одном экране без прокрутки */
@media (max-height: 760px) {
  .create-inner { gap: 9px; padding-top: calc(12px + var(--safe-top)); padding-bottom: calc(12px + var(--safe-bottom)); }
  .create-head h1 { font-size: 21px; }
  .create-head small { font-size: 11.5px; }
  .create-stage { height: 168px; }
  .create-stage svg { width: 168px; height: 168px; }
  .create-hero { margin-top: -4px; }
  .create-arrow { width: 38px; height: 38px; }
  .create-hero-name b { font-size: 17px; }
  .create-dot { width: 46px; height: 46px; font-size: 22px; }
  .create-card { padding: 10px 12px; gap: 3px; }
  .create-card p { font-size: 13.5px; line-height: 1.3; }
  .create-strong small { font-size: 11px; }
  .create-strong b { font-size: 12.5px; }
  .create-go { min-height: 48px; font-size: 16px; margin-top: 0; }
  .create-hint { font-size: 11.5px; line-height: 1.35; }
}

/* ============ АКАДЕМИЯ ============ */
.school-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; margin-top: 8px; text-align: left; color: var(--text);
  border: 2px solid transparent; }
.school-card.selected { border-color: var(--accent); }
.school-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 25px; }
.school-card .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.school-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15.5px; }
.school-card .sub { font-size: 12.5px; color: var(--hint); }
.school-passive { font-size: 13.5px; }

/* ==================== ОФОРМЛЕНИЕ ОКОН И АНИМАЦИИ (app.js: PLACES, «Переходы») ==================== */
/* У каждого раздела своя местность (html[data-place]): фон с узором и свечением, цвет кнопок и частицы
   за окном. Карточки в окнах полупрозрачные - местность просвечивает. Цвета отдельно для светлой и
   тёмной темы Telegram. На главной (data-place="home") всё это не действует: там карта */

:root {
  --pl-top: #ebecf5; --pl-bottom: #f0f1f8;
  --pl-glow: rgba(130, 140, 255, .36); --pl-glow2: rgba(200, 140, 255, .24);
  --acc-1: #ff4655; --acc-2: #c8102e; --acc-text: var(--acc-2);
  --fx: #8f9cff; --fx-anim: fxRise; --fx-size: 4px; --fx-radius: 50%;
  --fx-bg: var(--fx); --fx-border: 0 solid transparent; --fx-glow: 0 0 8px var(--fx);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg fill='%233a2a6a' fill-opacity='.07'%3E%3Cpath d='M18 10l1.6 4.4 4.4 1.6-4.4 1.6-1.6 4.4-1.6-4.4-4.4-1.6 4.4-1.6z'/%3E%3Cpath d='M52 46l1 2.8 2.8 1-2.8 1-1 2.8-1-2.8-2.8-1 2.8-1z'/%3E%3Ccircle cx='58' cy='14' r='1.2'/%3E%3Ccircle cx='12' cy='56' r='1'/%3E%3C/g%3E%3C/svg%3E");
  --glass: rgba(255, 255, 255, .74);
  --glass-edge: rgba(255, 255, 255, .95);
  --glass-shadow: rgba(60, 30, 90, .2);
}
:root[data-scheme="dark"] {
  --pl-top: #161827; --pl-bottom: #0a0b13;
  --pl-glow: rgba(110, 120, 255, .26); --pl-glow2: rgba(170, 110, 255, .16);
  --acc-text: var(--acc-1); --fx: #b9c2ff;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg fill='%23ffffff' fill-opacity='.06'%3E%3Cpath d='M18 10l1.6 4.4 4.4 1.6-4.4 1.6-1.6 4.4-1.6-4.4-4.4-1.6 4.4-1.6z'/%3E%3Cpath d='M52 46l1 2.8 2.8 1-2.8 1-1 2.8-1-2.8-2.8-1 2.8-1z'/%3E%3Ccircle cx='58' cy='14' r='1.2'/%3E%3Ccircle cx='12' cy='56' r='1'/%3E%3C/g%3E%3C/svg%3E");
  --glass: rgba(26, 24, 40, .68);
  --glass-edge: rgba(255, 255, 255, .08);
  --glass-shadow: rgba(0, 0, 0, .5);
}
/* в окнах кнопки и выделение - цвета местности, а не синий Telegram */
html[data-place]:not([data-place="home"]) { --accent: var(--acc-text); --on-accent: #fff; }

/* местности: [свет] верх и низ фона, два свечения, кнопки, частицы; [тьма] то же */
[data-place="battle"] { --pl-top: #ffe4d9; --pl-bottom: #ffeee6; --pl-glow: rgba(255, 112, 67, .42); --pl-glow2: rgba(255, 64, 129, .22);
  --acc-1: #ff5a3c; --acc-2: #d81b4f; --fx: #ff7a2e; --fx-size: 5px; --fx-glow: 0 0 10px var(--fx); }
[data-place="wild"] { --pl-top: #e1f5d9; --pl-bottom: #edf8e7; --pl-glow: rgba(110, 205, 100, .42); --pl-glow2: rgba(255, 214, 102, .3);
  --acc-1: #2bab5f; --acc-2: #0b7a63; --fx: #5fbf3c; --fx-anim: fxFall; --fx-size: 9px; --fx-radius: 80% 0; --fx-glow: none; }
[data-place="hero"] { --pl-top: #ebe4ff; --pl-bottom: #f0ebff; --pl-glow: rgba(150, 120, 255, .42); --pl-glow2: rgba(255, 140, 215, .26);
  --acc-1: #8b6dff; --acc-2: #5a3fe0; --fx: #9b7bff; }
[data-place="heal"] { --pl-top: #ffe3ed; --pl-bottom: #ffedf3; --pl-glow: rgba(255, 120, 160, .42); --pl-glow2: rgba(90, 215, 195, .26);
  --acc-1: #ff5c8a; --acc-2: #e0264d; --fx: #ff7aa2; --fx-size: 11px; --fx-bg: rgba(255, 255, 255, .22);
  --fx-border: 1.5px solid var(--fx); --fx-glow: none; }
[data-place="gold"] { --pl-top: #ffefcc; --pl-bottom: #fff4dc; --pl-glow: rgba(255, 190, 60, .48); --pl-glow2: rgba(255, 130, 60, .26);
  --acc-1: #f39a1c; --acc-2: #d9550b; --fx: #f2a91c; }
[data-place="forge"] { --pl-top: #ffe3d1; --pl-bottom: #ffeee2; --pl-glow: rgba(255, 125, 45, .46); --pl-glow2: rgba(255, 195, 80, .28);
  --acc-1: #ff7a2b; --acc-2: #c8420c; --fx: #ff8a2e; --fx-size: 5px; --fx-glow: 0 0 10px var(--fx); }
[data-place="arcane"] { --pl-top: #e2e9ff; --pl-bottom: #ebefff; --pl-glow: rgba(95, 145, 255, .42); --pl-glow2: rgba(170, 110, 255, .32);
  --acc-1: #5b7cff; --acc-2: #7c4dff; --fx: #6f95ff; }
[data-place="sakura"] { --pl-top: #ffe4ef; --pl-bottom: #ffeef5; --pl-glow: rgba(255, 145, 192, .46); --pl-glow2: rgba(255, 205, 145, .28);
  --acc-1: #ff6fa8; --acc-2: #d93f7a; --fx: #ff8fbd; --fx-anim: fxFall; --fx-size: 10px; --fx-radius: 80% 0; --fx-glow: none; }
[data-place="water"] { --pl-top: #dcf0ff; --pl-bottom: #e8f5ff; --pl-glow: rgba(70, 175, 255, .42); --pl-glow2: rgba(70, 225, 215, .28);
  --acc-1: #1f9bff; --acc-2: #0f62d6; --fx: #45aef5; --fx-size: 11px; --fx-bg: rgba(255, 255, 255, .22);
  --fx-border: 1.5px solid var(--fx); --fx-glow: none;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cg fill='none' stroke='%2306467a' stroke-opacity='.08' stroke-width='1.2'%3E%3Cpath d='M0 24a24 24 0 0 1 48 0M8 24a16 16 0 0 1 32 0M16 24a8 8 0 0 1 16 0M-24 12a24 24 0 0 1 48 0M24 12a24 24 0 0 1 48 0'/%3E%3C/g%3E%3C/svg%3E"); }
[data-place="battle"], [data-place="forge"] {
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M0 0L32 32M32 0L0 32' stroke='%235a1a10' stroke-opacity='.06' stroke-width='1'/%3E%3C/svg%3E"); }

[data-scheme="dark"][data-place="battle"] { --pl-top: #2a0e16; --pl-bottom: #10060a; --pl-glow: rgba(255, 84, 60, .32); --pl-glow2: rgba(210, 30, 95, .26); --fx: #ffa04a; }
[data-scheme="dark"][data-place="wild"] { --pl-top: #0e2416; --pl-bottom: #06110a; --pl-glow: rgba(70, 190, 110, .28); --pl-glow2: rgba(200, 220, 90, .14); --fx: #8be06a; }
[data-scheme="dark"][data-place="hero"] { --pl-top: #1b1338; --pl-bottom: #0b0818; --pl-glow: rgba(139, 109, 255, .34); --pl-glow2: rgba(255, 120, 200, .16); --fx: #ffe7a3; }
[data-scheme="dark"][data-place="heal"] { --pl-top: #2a0f1d; --pl-bottom: #11060c; --pl-glow: rgba(255, 90, 140, .3); --pl-glow2: rgba(60, 200, 180, .14); --fx: #ff9ebb; }
[data-scheme="dark"][data-place="gold"] { --pl-top: #291b06; --pl-bottom: #110b03; --pl-glow: rgba(255, 180, 40, .3); --pl-glow2: rgba(255, 120, 40, .18); --fx: #ffd34d; }
[data-scheme="dark"][data-place="forge"] { --pl-top: #29120a; --pl-bottom: #100704; --pl-glow: rgba(255, 110, 30, .34); --pl-glow2: rgba(255, 170, 60, .18); --fx: #ffb347; }
[data-scheme="dark"][data-place="arcane"] { --pl-top: #0f1833; --pl-bottom: #060a18; --pl-glow: rgba(90, 140, 255, .32); --pl-glow2: rgba(160, 90, 255, .24); --fx: #9ad0ff; }
[data-scheme="dark"][data-place="sakura"] { --pl-top: #2a1020; --pl-bottom: #11060d; --pl-glow: rgba(255, 120, 180, .3); --pl-glow2: rgba(255, 180, 120, .14); --fx: #ffb3d1; }
[data-scheme="dark"][data-place="water"] { --pl-top: #0a1d2c; --pl-bottom: #040d16; --pl-glow: rgba(50, 160, 255, .32); --pl-glow2: rgba(40, 210, 200, .18); --fx: #8fd3ff;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M0 24a24 24 0 0 1 48 0M8 24a16 16 0 0 1 32 0M16 24a8 8 0 0 1 16 0M-24 12a24 24 0 0 1 48 0M24 12a24 24 0 0 1 48 0'/%3E%3C/g%3E%3C/svg%3E"); }
[data-scheme="dark"][data-place="battle"], [data-scheme="dark"][data-place="forge"] {
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M0 0L32 32M32 0L0 32' stroke='%23ffffff' stroke-opacity='.04' stroke-width='1'/%3E%3C/svg%3E"); }

/* фон окна: узор и переход цвета сверху вниз, над ним медленно плывут два свечения */
html[data-place]:not([data-place="home"]) body { background: var(--pl-bottom); }
#app.mode-window { position: relative; z-index: 1; --card: var(--glass); }
#app.mode-window::before, #app.mode-window::after { content: ''; position: fixed; pointer-events: none; }
#app.mode-window::before { z-index: -3; inset: 0; background: var(--pattern), linear-gradient(180deg, var(--pl-top) 0, var(--pl-bottom) 100%); }
#app.mode-window::after {
  z-index: -2; inset: -20%;
  background: radial-gradient(32% 24% at 78% 26%, var(--pl-glow), transparent 70%),
    radial-gradient(30% 22% at 22% 74%, var(--pl-glow2), transparent 70%);
  animation: glowDrift 16s ease-in-out infinite alternate;
}
@keyframes glowDrift { to { transform: translate3d(-5%, 4%, 0) scale(1.08); } }

/* частицы: искры, пузырьки, листья, лепестки - поднимаются или падают, у каждой свой путь */
.win-fx { display: none; }
#app.mode-window .win-fx { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.win-fx i {
  position: absolute; bottom: -24px; width: var(--fx-size); height: var(--fx-size); border-radius: var(--fx-radius);
  background: var(--fx-bg); border: var(--fx-border); box-shadow: var(--fx-glow); opacity: 0;
  animation: var(--fx-anim) 12s linear infinite;
}
.win-fx i:nth-child(1) { left: 6%; animation-duration: 13s; animation-delay: -2s; }
.win-fx i:nth-child(2) { left: 17%; animation-duration: 10s; animation-delay: -8s; --fx-drift: -30px; }
.win-fx i:nth-child(3) { left: 28%; animation-duration: 15s; animation-delay: -5s; }
.win-fx i:nth-child(4) { left: 39%; animation-duration: 11s; animation-delay: -10s; --fx-drift: 36px; }
.win-fx i:nth-child(5) { left: 50%; animation-duration: 14s; animation-delay: -1s; --fx-drift: -20px; }
.win-fx i:nth-child(6) { left: 61%; animation-duration: 12s; animation-delay: -6s; }
.win-fx i:nth-child(7) { left: 71%; animation-duration: 16s; animation-delay: -12s; --fx-drift: -40px; }
.win-fx i:nth-child(8) { left: 80%; animation-duration: 10.5s; animation-delay: -3s; }
.win-fx i:nth-child(9) { left: 89%; animation-duration: 13.5s; animation-delay: -9s; --fx-drift: -26px; }
.win-fx i:nth-child(10) { left: 95%; animation-duration: 11.5s; animation-delay: -7s; --fx-drift: -48px; }
.win-fx i:nth-child(3n) { width: calc(var(--fx-size) * .7); height: calc(var(--fx-size) * .7); }
.win-fx i:nth-child(4n) { width: calc(var(--fx-size) * 1.3); height: calc(var(--fx-size) * 1.3); }
@keyframes fxRise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: .75; }
  80% { opacity: .5; }
  100% { transform: translate3d(var(--fx-drift, 24px), -108vh, 0); opacity: 0; }
}
@keyframes fxFall {
  0% { transform: translate3d(0, -112vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: .8; }
  88% { opacity: .6; }
  100% { transform: translate3d(var(--fx-drift, 40px), 4vh, 0) rotate(420deg); opacity: 0; }
}

/* шапка окна - в цвет полоски Telegram над ней, вкладки окна - цветом местности */
#app.mode-window .win-head { background: var(--pl-top); }
#app.mode-window .subnav { background: var(--pl-top); }
#app.mode-window .win-back, #app.mode-window .subnav button:not(.active) {
  background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-edge), 0 4px 12px -8px var(--glass-shadow);
}
#app.mode-window .subnav button.active, :where(#app.mode-window, .modal) .segmented button.active,
:where(#app.mode-window, .modal) .chip.active {
  background: linear-gradient(135deg, var(--acc-1), var(--acc-2)); color: #fff; box-shadow: 0 4px 12px -6px var(--acc-2);
}
:where(#app.mode-window) .section > h2 { color: var(--acc-text); opacity: .9; }
.wallet, .hud-wallet { position: relative; }

/* стекло: карточки, списки и переключатели приподняты над фоном */
:where(#app.mode-window) .card, :where(#app.mode-window) .list, :where(#app.mode-window) .segmented,
:where(#app.mode-window) .pager-btn {
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 10px 26px -16px var(--glass-shadow);
}
:where(#app.mode-window) .card .segmented { box-shadow: none; }

/* кнопки как в игре: градиент местности, блик сверху, тень снизу; у главной кнопки пробегает отблеск */
:where(#app.mode-window, .modal) .btn {
  background: linear-gradient(135deg, var(--acc-1), var(--acc-2)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .14), 0 6px 16px -8px var(--acc-2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}
:where(#app.mode-window, .modal) .btn.soft { background: var(--soft); color: var(--accent); box-shadow: none; text-shadow: none; }
:where(#app.mode-window, .modal) .btn.off, :where(#app.mode-window, .modal) .btn:disabled {
  background: var(--soft); color: var(--hint); box-shadow: none; text-shadow: none;
}
:where(#app.mode-window) .btn.wide:not(.soft):not(.off):not(:disabled) { position: relative; overflow: hidden; }
:where(#app.mode-window) .btn.wide:not(.soft):not(.off):not(:disabled)::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 34%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: translateX(-120%) skewX(-20deg); animation: shine 5s ease-in-out 1s infinite;
}
@keyframes shine { 0%, 72% { transform: translateX(-120%) skewX(-20deg); } 100% { transform: translateX(380%) skewX(-20deg); } }
.bar i::after { content: ''; position: absolute; inset: 0 0 50% 0; border-radius: 8px 8px 0 0; background: rgba(255, 255, 255, .22); }

/* окно раскрывается кругом из места нажатия; карта под ним гаснет, но размер не меняет */
#app.win-reveal { animation: winReveal .52s cubic-bezier(.45, 0, .2, 1) both; }
@keyframes winReveal {
  from { clip-path: circle(22px at var(--ox, 50%) var(--oy, 60%)); }
  to { clip-path: circle(var(--or, 150%) at var(--ox, 50%) var(--oy, 60%)); }
}
#app.win-reveal .win-title { animation: titleIn .5s .14s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes titleIn { from { opacity: 0; transform: translateX(-14px); } }
.map-ghost { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.map-ghost .game { animation: mapAway .52s ease-in both; }
@keyframes mapAway { to { opacity: .4; } }

/* содержимое окна появляется по очереди, полоски наполняются */
#view.enter > *, #view.enter .pager-page > * { animation: riseIn .5s cubic-bezier(.2, .8, .2, 1) both; }
#view.enter > :nth-child(1) { animation-delay: .08s; }
#view.enter > :nth-child(2) { animation-delay: .13s; }
#view.enter > :nth-child(3) { animation-delay: .18s; }
#view.enter > :nth-child(4) { animation-delay: .23s; }
#view.enter > :nth-child(5) { animation-delay: .28s; }
#view.enter > :nth-child(n+6) { animation-delay: .33s; }
#view.enter .pager-page > :nth-child(1) { animation-delay: .2s; }
#view.enter .pager-page > :nth-child(2) { animation-delay: .25s; }
#view.enter .pager-page > :nth-child(3) { animation-delay: .3s; }
#view.enter .pager-page > :nth-child(4) { animation-delay: .35s; }
#view.enter .pager-page > :nth-child(n+5) { animation-delay: .4s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
#view.enter .bar i { transform-origin: left center; animation: barGrow .9s .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes barGrow { from { transform: scaleX(0); } }

/* другая вкладка или страница - въезжает со стороны листания */
#view.swap-next .segmented ~ *, .pager-page.turn-next > * { animation: slideL .34s cubic-bezier(.2, .8, .2, 1) both; }
#view.swap-prev .segmented ~ *, .pager-page.turn-prev > * { animation: slideR .34s cubic-bezier(.2, .8, .2, 1) both; }
.pager-page.turn-next > :nth-child(2), .pager-page.turn-prev > :nth-child(2) { animation-delay: .04s; }
.pager-page.turn-next > :nth-child(3), .pager-page.turn-prev > :nth-child(3) { animation-delay: .08s; }
.pager-page.turn-next > :nth-child(n+4), .pager-page.turn-prev > :nth-child(n+4) { animation-delay: .12s; }
@keyframes slideL { from { opacity: 0; transform: translateX(28px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-28px); } }
#view.swap-next .segmented button.active, #view.swap-prev .segmented button.active { animation: segPop .38s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes segPop { from { transform: scale(.88); } }

/* назад на карту: карта проявляется на своём месте и своего размера, панели въезжают сверху и снизу */
.game.map-back .game-stage { animation: mapIn .4s ease-out both; }
@keyframes mapIn { from { opacity: 0; } }
.game.map-back .game-top { animation: hudDown .5s .12s cubic-bezier(.2, .8, .2, 1) both; }
.game.map-back .game-bar { animation: barUp .5s .12s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hudDown { from { transform: translateY(-26px); opacity: 0; } }
@keyframes barUp { from { transform: translateY(34px); opacity: 0; } }

/* «+120 🪙» над кошельком */
.bump { animation: bump .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { 35% { transform: scale(1.14); } }
.coin-float {
  position: absolute; right: 2px; top: 100%; z-index: 6; padding: 2px 9px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: linear-gradient(135deg, #ffd34d, #f39a1c); color: #3a2200; font-size: 12px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(243, 154, 28, .45); animation: coinFloat 1.3s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes coinFloat {
  0% { transform: translateY(8px) scale(.6); opacity: 0; }
  18% { transform: translateY(0) scale(1.08); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(-24px); opacity: 0; }
}

/* загрузка: волшебный шар в кольце на ночном небе, в любой теме */
#loading { background: radial-gradient(120% 70% at 50% 0%, #3b2a80 0%, #1b1442 55%, #0d0a22 100%); color: #f3f0ff; }
#loading p { color: rgba(243, 240, 255, .75); font-weight: 650; letter-spacing: .03em; }
.load-magic { position: relative; width: 88px; height: 88px; display: grid; place-items: center; }
.load-magic .spinner {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 3px solid rgba(255, 255, 255, .1);
  border-top-color: #ffd36b; border-right-color: #b48cff; box-shadow: 0 0 34px rgba(180, 140, 255, .35); animation-duration: 1.1s;
}
.load-magic i { font-style: normal; font-size: 40px; line-height: 1; filter: drop-shadow(0 0 12px rgba(180, 140, 255, .8));
  animation: orbFloat 2.4s ease-in-out infinite; }
@keyframes orbFloat { 50% { transform: translateY(-6px) scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  #app.mode-window .win-fx { display: none; }
}

/* «тёмное аниме»: срезанные углы у кнопок, углы карточек строже, у заголовков разделов - светящаяся черта */
#app.mode-window { --radius: 10px; }
:where(#app.mode-window, .modal) .btn:not(.chip-btn) {
  border-radius: 4px; clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
:where(#app.mode-window) .segmented, :where(#app.mode-window) .segmented button, :where(#app.mode-window) .pager-btn,
#app.mode-window .subnav button, #app.mode-window .win-back { border-radius: 6px; }
:where(#app.mode-window) .segmented button.active, #app.mode-window .subnav button.active {
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
:where(#app.mode-window) .section > h2 { display: flex; align-items: center; gap: 8px; }
:where(#app.mode-window) .section > h2::before {
  content: ''; flex: none; width: 3px; height: 13px; background: var(--acc-1); box-shadow: 0 0 8px var(--acc-1);
}
#app.mode-window .win-title { text-shadow: 0 0 14px var(--pl-glow); }
