/* 🌸 Sakura Prison — тёмный сад: anime/fantasy, розовое и фиолетовое, мягкое свечение.
   Мобильный экран первичен: всё рассчитано на ширину от 320px и на палец, а не на курсор.
   Вся графика — код (SVG/градиенты): резко на любом экране и весит килобайты. */

:root {
  --bg-0: #08060d;
  --bg-1: #120c1c;
  --bg-2: #1a1226;
  --panel: rgba(23, 16, 34, 0.78);
  --panel-line: rgba(255, 138, 205, 0.17);
  --ink: #f6ecff;
  --ink-dim: #b0a2c8;
  --ink-faint: #74668d;
  --pink: #ff8fd0;
  --pink-deep: #e2479e;
  --violet: #9a6bff;
  --violet-deep: #6b3fd4;
  --gold: #ffc65c;
  --danger: #ff6b6b;
  --ok: #67d98b;
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --serif: "Georgia", "Times New Roman", "Noto Serif", serif;
}

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

/* `hidden` должен побеждать классы: у .boot и .tabbar есть свой display:flex,
   и без !important скрытые блоки продолжали бы показываться поверх игры. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45;
  overscroll-behavior-y: none;
}

body { position: relative; overflow-x: hidden; }

.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 78% -4%, rgba(154, 107, 255, 0.30), transparent 70%),
    radial-gradient(52% 34% at 12% 8%, rgba(255, 138, 205, 0.18), transparent 70%),
    linear-gradient(175deg, var(--bg-1) 0%, var(--bg-0) 55%, #050309 100%);
}

.petals { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -24px; width: 10px; height: 10px;
  background: linear-gradient(135deg, var(--pink), rgba(255, 255, 255, 0.85));
  border-radius: 10px 0 10px 0;
  opacity: 0.5; filter: blur(0.2px);
  animation: fall linear infinite;
}
@keyframes fall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.55; }
  100% { transform: translate3d(var(--drift, 30px), 108vh, 0) rotate(420deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .petal { display: none; } }

.app { position: relative; z-index: 2; min-height: 100vh; }

/* ---------------------------------------------------------------- Загрузка */
.boot, .gate {
  min-height: 82vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 24px;
}
.boot-mark, .gate-mark {
  width: 56px; height: 56px; animation: pulse 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 138, 205, .5));
}
.boot-title {
  font-family: var(--serif); font-weight: 700; letter-spacing: 5px; font-size: 20px;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boot-hint, .gate-text { color: var(--ink-dim); font-size: 13px; text-align: center; max-width: 280px; }
.gate-title { font-size: 18px; font-weight: 700; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.08); opacity: 1 } }

/* ------------------------------------------------------- Экран «ещё рано» */
.soon {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 30px; text-align: center;
  /* Лепестки летят СЗАДИ этого слоя (они на z-index 1), поэтому фон прозрачный. */
  background: radial-gradient(70% 50% at 50% 30%, rgba(154, 107, 255, .18), transparent 70%);
}
.soon-title { margin-bottom: 2px; }
.soon-line1, .soon-line2 {
  font-family: var(--serif); font-weight: 700; line-height: .98;
  letter-spacing: 3px; font-size: 34px; text-shadow: 0 4px 26px rgba(0, 0, 0, .7);
}
.soon-line1 { color: #fff; }
.soon-line2 {
  margin-left: 22px;
  background: linear-gradient(180deg, #ffd7ec, var(--pink) 55%, var(--pink-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.soon-tag {
  font-size: 10px; letter-spacing: 3.4px; text-transform: uppercase;
  color: rgba(255, 220, 240, .7); margin-bottom: 26px;
}
.soon-word {
  font-family: var(--serif); font-size: 58px; font-weight: 700; letter-spacing: 10px;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 143, 208, .85), 0 0 80px rgba(226, 71, 158, .55);
  animation: soon-breathe 3.4s ease-in-out infinite;
}
@keyframes soon-breathe {
  0%, 100% { opacity: .78; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.035); }
}
.soon-note { margin-top: 22px; font-size: 12px; color: var(--ink-faint); max-width: 260px; }
@media (prefers-reduced-motion: reduce) { .soon-word { animation: none; } }

/* ---------------------------------------------------------------- Каркас */
.content { padding: 0 14px calc(var(--tabbar-h) + var(--safe-b) + 18px); }
.screen { animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.screen-title {
  font-size: 17px; font-weight: 700; margin: 16px 0 14px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 9px;
}
/* Нарисованные значки интерфейса вместо эмодзи (см. app.js: UI_SHAPES). */
.ui-svg { width: 20px; height: 20px; display: block; }
.screen-title .ui-svg, .screen-title .tool-svg { width: 20px; height: 20px; color: var(--pink); }
/* Значок внутри строки текста — по высоте шрифта. */
.icon-inline { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.card { padding: 14px; margin-bottom: 12px; background: var(--panel);
  border: 1px solid var(--panel-line); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

.dim { color: var(--ink-dim); font-size: 12px; }
.label { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }

/* ------------------------------------------------------------ Шапка-афиша */
/* Высота афиши — по заголовку, а не «с запасом»: при 210px под надписью
   оставалась пустая тёмная полоса, и экран начинался слишком низко
   (22.09.2026). Арт рисуется с preserveAspectRatio=slice, поэтому меньшая
   высота просто подрезает сцену сверху и снизу, композиция не ломается. */
.hero-art {
  position: relative; margin: 0 -14px 8px; height: 104px;
  overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center;
}
.hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Слой сгенерированного арта: подменяет векторную сцену, когда картинка есть. */
.art-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-art::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  background: linear-gradient(to top, var(--bg-0), transparent);
  pointer-events: none;
}
.hero-title { position: relative; z-index: 2; text-align: center; padding-top: 2px; }
.hero-line1, .hero-line2 {
  font-family: var(--serif); font-weight: 700; line-height: .96;
  letter-spacing: 2.4px; text-shadow: 0 4px 26px rgba(0, 0, 0, .7);
}
.hero-line1 { font-size: 26px; color: #fff; }
.hero-line2 {
  font-size: 26px; margin-left: 18px;
  background: linear-gradient(180deg, #ffd7ec, var(--pink) 55%, var(--pink-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tag {
  margin-top: 5px; font-size: 8.5px; letter-spacing: 2.8px;
  color: rgba(255, 220, 240, .72); text-transform: uppercase;
}
/* Вертикальные надписи по краям — на узкой афише они только мешают. */
.hero-vert { display: none; }
.hero-vert-left { left: 14px; }
.hero-vert-right { right: 14px; color: rgba(255, 190, 225, .38); }

/* ---------------------------------------------------------------- Профиль */
/* Карточка профиля: сверху аватар с уровнем, снизу балансы. */
.profile-panel { padding: 13px; margin-bottom: 10px; }
.profile-top { display: flex; align-items: center; gap: 13px; }
.avatar-ring {
  width: 62px; height: 62px; flex: 0 0 auto; border-radius: 50%; padding: 2px;
  background: linear-gradient(145deg, var(--pink), var(--violet));
  box-shadow: 0 0 18px rgba(255, 138, 205, .45);
}
.avatar {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: linear-gradient(145deg, var(--violet-deep), var(--pink-deep));
  display: grid; place-items: center; font-size: 26px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-main { flex: 1; min-width: 0; }
.username {
  font-size: 17px; font-weight: 700; letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.level-line { color: var(--ink-dim); font-size: 13px; margin: 1px 0 7px; }
.level-line b { color: var(--ink); font-size: 15px; }
.bar { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), #ffb3de);
  box-shadow: 0 0 14px rgba(255, 138, 205, .6);
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
}
.level-xp { text-align: right; margin-top: 4px; color: var(--ink-faint); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------- Кошельки (внутри профиля) */
.wallets { display: flex; gap: 8px; margin-top: 12px; }
.wallet {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 11px; border-radius: 14px;
  /* Внутри панели — своя лёгкая подложка, а не вторая «карточка в карточке». */
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
}
.wallet-emoji { font-size: 19px; display: flex; align-items: center; }
/* Нарисованные значки валюты и находок — одинаковые на всех устройствах. */
.coin-svg, .gem-svg, .star-svg { width: 24px; height: 24px; display: block; }
.coin-svg { filter: drop-shadow(0 0 7px rgba(255, 200, 60, .55)); }
.star-svg { filter: drop-shadow(0 0 7px rgba(255, 210, 74, .5)); }
.gem-svg { filter: drop-shadow(0 0 7px rgba(110, 200, 245, .5)); }
.coin-svg-inline { width: 19px; height: 19px; }
/* Нарисованные предметы: в списках — 26px, внутри строк-листов — по шрифту. */
.item-svg { width: 26px; height: 26px; display: block; }
/* Заглушка аватара и значки экранов загрузки/отказа. */
.avatar-svg { width: 58%; height: 58%; display: block; }
.place-avatar .avatar-svg { width: 62%; height: 62%; }
.boot-mark svg, .gate-mark svg { width: 100%; height: 100%; display: block; }
.row-sub .item-svg { display: inline-block; vertical-align: -3px; }
.sheet-line .item-svg, .slash-loot-line .item-svg { width: 22px; height: 22px; flex: 0 0 auto; }
/* Петал внутри строки текста (цены, лимиты, история) — по высоте шрифта. */
.coin-inline {
  width: 1.15em; height: 1.15em; display: inline-block;
  vertical-align: -.24em; margin: 0 .05em;
}
.sell-coin { display: inline-flex; vertical-align: -3px; margin-left: 5px; }
.wallet-value {
  flex: 1 1 auto; min-width: 0; font-weight: 800; font-size: 17px;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wallet-plus {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; cursor: pointer;
  background: rgba(255, 138, 205, .16); border: 1px solid rgba(255, 138, 205, .34);
  color: var(--pink); font-size: 17px; font-weight: 700; line-height: 1; padding: 0;
}
.wallet-plus:active { transform: scale(.92); }

/* ---------------------------------------------- Локация · инструмент · ранг */
/* Локация · катана · ранг — список строк, а не колонки (22.09.2026).
   Во всю ширину название влезает всегда: ни переносов, ни разного кегля. */
.status-list { padding: 4px 6px; margin-bottom: 14px; }
.status-row {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 11px 8px; background: none; border: none; cursor: pointer;
  color: var(--ink); text-align: left;
}
.status-row + .status-row { border-top: 1px solid rgba(255, 255, 255, .06); }
.status-row:active { background: rgba(255, 255, 255, .04); border-radius: 12px; }
.status-icon {
  flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255, 138, 205, .1); color: var(--pink);
}
.status-icon .ui-svg, .status-icon .item-svg, .status-icon .tool-svg {
  width: 20px; height: 20px;
}
.status-label {
  flex: 0 0 auto; font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--ink-faint);
}
/* Значение прижато вправо и при нехватке места сжимается многоточием —
   но на 360px влезает даже «Императорская катана VII». */
.status-value {
  flex: 1 1 auto; min-width: 0; text-align: right;
  font-size: 13.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Стрелка нарисованная: символ «›» у системных шрифтов разной ширины и на
   части телефонов срезался краем строки (22.09.2026). */
.status-go { flex: 0 0 auto; color: var(--ink-faint); display: grid; place-items: center; }
.status-go .ui-svg { width: 13px; height: 13px; display: block; }
@media (max-width: 360px) {
  .status-label { font-size: 9px; letter-spacing: .8px; }
  .status-value { font-size: 12.5px; }
}

.boosters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.booster-chip {
  display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  background: rgba(103, 217, 139, .12); border: 1px solid rgba(103, 217, 139, .32);
  color: var(--ok); font-size: 12px; font-weight: 700;
}
.booster-chip .time { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-weight: 600; }

/* --------------------------------------------------------- Кнопка добычи */
.mine-bar {
  position: relative; width: 100%; height: 74px; border: none; cursor: pointer;
  border-radius: 20px; padding: 0; overflow: hidden;
  background: linear-gradient(135deg, #ff5fb4, var(--pink-deep) 45%, #a03aa0);
  box-shadow: 0 10px 34px rgba(226, 71, 158, .45), inset 0 -3px 12px rgba(0, 0, 0, .3),
              inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s ease, filter .2s ease;
}
.mine-bar:active { transform: scale(.985); }
.mine-bar[disabled] { filter: grayscale(.5) brightness(.6); box-shadow: none; cursor: default; }
.mine-bar-glow {
  position: absolute; inset: 0;
  background: radial-gradient(60% 120% at 50% 120%, rgba(255, 255, 255, .35), transparent 70%);
  opacity: .8;
}
.mine-bar-face {
  position: relative; z-index: 2; height: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.mine-bar-icon { font-size: 26px; display: flex; align-items: center; }
/* Нарисованный секатор вместо эмодзи: одинаково выглядит на всех устройствах. */
.tool-svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
.tool-svg-big { width: 76px; height: 76px; filter: drop-shadow(0 0 18px rgba(255, 138, 205, .6)); }
.tool-svg-small { width: 20px; height: 20px; }
.mine-bar-text {
  font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
}
.mine-hint { margin: 9px 0 16px; text-align: center; color: var(--ink-dim); font-size: 12px; min-height: 16px; }

/* ------------------------------------------------------- Разделы-карточки */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nav-card {
  position: relative; height: 118px; border: 1px solid var(--panel-line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; padding: 0;
  background: var(--bg-2); color: var(--ink); text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.nav-card:active { transform: scale(.98); }
/* Только фоновая картинка карточки (она — прямой ребёнок). Иконку в заголовке
   это правило раньше тоже растягивало на всю карточку поверх текста. */
.nav-card > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nav-card-title .ui-svg, .nav-card-title .tool-svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8, 6, 13, .94) 22%, rgba(8, 6, 13, .25) 60%, transparent);
}
.nav-card-body {
  position: absolute; left: 11px; right: 34px; bottom: 9px; z-index: 2;
}
.nav-card-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; }
.nav-card-sub { font-size: 10.5px; color: var(--ink-dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-card-arrow {
  position: absolute; right: 11px; bottom: 14px; z-index: 2;
  color: var(--pink); opacity: .85; line-height: 0;
}
.nav-card-arrow .ui-svg { width: 13px; height: 13px; display: block; }

/* ---------------------------------------------------------------- Списки */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.row-sub { color: var(--ink-dim); font-size: 12px; margin-top: 2px; }
/* Зачем предмет нужен — третьей строкой в инвентаре. Описания лежали в
   данных и не показывались нигде (23.09.2026, просьба владельца). */
.row-note {
  color: var(--ink-faint); font-size: 11.5px; line-height: 1.4; margin-top: 4px;
}
.row-emoji {
  font-size: 24px; width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 14px; background: rgba(255, 255, 255, .05);
}
.row.locked { opacity: .62; }
.row.current { border-color: rgba(255, 138, 205, .55); box-shadow: 0 0 22px rgba(255, 138, 205, .16); }

.primary-btn {
  background: linear-gradient(135deg, var(--pink-deep), var(--violet-deep));
  color: #fff; border: none; border-radius: 13px; padding: 10px 14px;
  font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(154, 107, 255, .35);
}
/* Кнопки со значком: flex, иначе inline-SVG тянет базовую линию и текст
   съезжает вниз относительно иконки (поймано 22.09.2026 на «Ещё раз»). */
.primary-btn, .ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.primary-btn .icon-inline, .ghost-btn .icon-inline,
.primary-btn .coin-inline, .ghost-btn .coin-inline {
  vertical-align: baseline; flex: 0 0 auto;
}
.primary-btn:active { transform: scale(.96); }
.primary-btn[disabled] { filter: grayscale(.6) brightness(.7); box-shadow: none; }

.ghost-btn {
  background: rgba(255, 138, 205, .12); border: 1px solid rgba(255, 138, 205, .3);
  color: var(--pink); border-radius: 12px; padding: 8px 12px;
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ghost-btn:active { transform: scale(.96); }

/* ❓ Помощь: один экран, где собрано всё — с чего начать и куда жать. */
.help-intro {
  font-size: 13px; color: var(--ink-dim); line-height: 1.5;
  padding: 2px 4px 10px;
}
.help-card { margin-bottom: 12px; }
.help-steps { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: help; }
.help-steps li {
  counter-increment: help; position: relative; padding: 0 0 12px 34px;
  font-size: 13px; line-height: 1.5; color: var(--ink);
}
.help-steps li:last-child { padding-bottom: 0; }
.help-steps li::before {
  content: counter(help); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff5fa8, #9a6bff);
}
/* Ниточка между шагами — видно, что это последовательность, а не список. */
.help-steps li:not(:last-child)::after {
  content: ''; position: absolute; left: 10.5px; top: 24px; bottom: 4px;
  width: 1px; background: linear-gradient(to bottom, rgba(255, 95, 168, .45), transparent);
}
.help-lines { display: grid; gap: 8px; margin-top: 4px; }
.help-line {
  display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}
.help-line b { font-size: 12.5px; }
.help-line span { font-size: 12px; color: var(--ink-dim); line-height: 1.45; }
.help-foot {
  font-size: 11.5px; color: var(--ink-faint); text-align: center; padding: 4px 0 8px;
}
.ghost-btn[disabled] { filter: grayscale(.65) brightness(.75); opacity: .55; cursor: default; }

.pill { font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: var(--ink-dim); font-weight: 700; }

/* Локация-заглушка в конце списка: видно, что дальше что-то будет. */
.soon-row { opacity: .5; border-style: dashed; }
.soon-row .row-emoji { color: var(--ink-faint); }
.soon-pill {
  letter-spacing: 2px; font-size: 10px; padding: 5px 10px;
  color: var(--pink); background: rgba(255, 138, 205, .12);
  border: 1px solid rgba(255, 138, 205, .3);
}

.sell-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px; margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(255, 138, 205, .14), rgba(154, 107, 255, .1)), var(--panel);
  border: 1px solid var(--panel-line); border-radius: var(--radius);
}
.sell-total { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.budget-note { color: var(--ink-faint); font-size: 11px; margin: -4px 0 10px; }

/* ----------------------------------------------------- Разделы магазина */
/* Карточки разделов — те же .nav-card, что на главной (22.09.2026, просьба
   владельца: «в идеале как тут»). Здесь только обложка: настоящая катана
   рисуется на canvas, остальное — крупный значок раздела. */
/* Клинок живёт в верхней части карточки: нижние 32px занимает подпись. */
/* width/height обязательно в процентах: canvas — заменяемый элемент, при
   width:auto он берёт свой атрибутный размер, а не отступы (22.09.2026). */
.shop-cat-canvas {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 32px);
}
.shop-cat-art {
  position: absolute; left: 0; right: 0; top: 6px; height: 72px;
  display: flex; align-items: center; justify-content: center;
}
.shop-cat-shape { width: 50px; height: 50px; opacity: .92; }
/* Название раздела — всегда в одну строку: перенос («Эффекты клинка»,
   «Особые предметы») ломал ритм сетки. */
.shop-cat .nav-card-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-cat .nav-card-title .item-svg { width: 17px; height: 17px; flex: 0 0 auto; }
/* Разделов нечётное число — последний занимает всю ширину, чтобы сетка не
   заканчивалась полупустой строкой. */
.shop-cat:last-child:nth-child(odd) { grid-column: span 2; height: 104px; }
.shop-cat .nav-card-sub { color: rgba(255, 220, 240, .72); }

.shop-back {
  background: none; border: none; color: var(--ink-dim); cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 2px 2px 10px;
}
.shop-back:active { color: var(--pink); }
.shop-cat-title {
  font-family: var(--serif); font-size: 19px; letter-spacing: 2.4px;
  text-transform: uppercase; color: var(--pink); margin: 0 2px 12px;
}

.section-head {
  display: flex; align-items: center; gap: 8px; margin: 14px 2px 4px;
  font-size: 13px; font-weight: 700; color: var(--ink-dim);
}
.section-head .item-svg, .section-head .ui-svg, .section-head .tool-svg,
.section-head .star-svg { width: 18px; height: 18px; flex: 0 0 auto; }
.section-head .count { margin-left: auto; font-size: 11px; color: var(--ink-faint); }
.empty { color: var(--ink-faint); font-size: 12px; padding: 10px 2px; }

/* --------------------------------------------------------------- Вкладки */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid transparent;
  color: var(--ink-dim); font-size: 12px; font-weight: 700;
}
.tab.active { background: rgba(255, 138, 205, .16); border-color: rgba(255, 138, 205, .38); color: var(--pink); }

.my-place {
  padding: 11px 14px; margin-bottom: 10px; border-radius: var(--radius);
  background: rgba(255, 198, 92, .1); border: 1px solid rgba(255, 198, 92, .3);
  font-size: 13px; font-weight: 700; color: var(--gold);
}
.place-num { width: 30px; flex: 0 0 auto; text-align: center; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.place-num.top1 { color: #ffd76a; } .place-num.top2 { color: #d8dbe6; } .place-num.top3 { color: #e0a06a; }

/* Аватар в топе: фото, а если его нет — первая буква имени. */
.place-avatar {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  background: linear-gradient(145deg, var(--violet-deep), var(--pink-deep));
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800; color: #fff;
  box-shadow: 0 0 0 1.5px rgba(255, 138, 205, .35);
}
.place-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ----------------------------------------------------------------- Меню */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.menu-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 16px 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-line);
  color: var(--ink); font-size: 14px; font-weight: 700; text-align: left;
}
.menu-tile span { font-size: 24px; }
.menu-tile i { display: block; color: var(--pink); }
.menu-tile .ui-svg, .menu-tile .tool-svg { width: 26px; height: 26px; }
.menu-tile:active { transform: scale(.975); }

/* ------------------------------------------------------------ Инструмент */
.tool-big { text-align: center; }
.tool-big .tool-icon { font-size: 58px; margin-bottom: 6px; filter: drop-shadow(0 0 18px rgba(255, 138, 205, .55)); }
/* Портрет катаны: рисуется на canvas тем же кодом, что клинок в бою. */
.tool-canvas {
  width: 100%; height: 124px; display: block; margin: 2px 0 10px;
  border-radius: var(--radius);
  background: radial-gradient(70% 90% at 50% 40%, rgba(90, 40, 120, .35), rgba(10, 6, 18, .6));
}
.tool-big h2 { margin: 2px 0; font-size: 19px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: rgba(0, 0, 0, .26); border-radius: 13px; padding: 10px;
  display: flex; flex-direction: column; gap: 3px; }
.stat b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- Профиль */
.profile-head { text-align: center; padding: 18px 14px; }
.profile-avatar {
  width: 78px; height: 78px; border-radius: 26px; margin: 0 auto 10px;
  background: linear-gradient(145deg, var(--violet-deep), var(--pink-deep));
  display: grid; place-items: center; font-size: 34px; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 138, 205, .3), 0 10px 28px rgba(0, 0, 0, .45);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 18px; font-weight: 800; }
.profile-sub { color: var(--ink-dim); font-size: 13px; margin-top: 2px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
/* Значок в строке профиля не должен уводить подпись на вторую строку. */
.kv > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.kv > span .coin-inline { flex: 0 0 auto; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--ink-dim); font-size: 13px; }
.kv b { font-variant-numeric: tabular-nums; }

.history-line { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); font-size: 12px; }
.history-line .when { color: var(--ink-faint); width: 74px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.history-line .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-line .amt.plus { color: var(--ok); } .history-line .amt.minus { color: var(--pink); }
/* Строка за звёзды: сумма стоит в тексте, справа только значок. */
.history-line .amt.stars { display: flex; align-items: center; }
.history-line .amt.stars .coin-inline { width: 15px; height: 15px; }
.settings-card .kv b { color: var(--ink-dim); font-weight: 600; font-size: 12px; }

/* --------------------------------------------------------- 🌳 Экран рубки */
.slash {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(70% 50% at 50% 0%, #241536, #0b0713 70%, #070410);
  touch-action: none; user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
.slash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.slash-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: flex-start; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: linear-gradient(to bottom, rgba(7, 4, 16, .85), transparent);
  pointer-events: none;
}
.slash-hud-left { flex: 1; min-width: 0; }
.slash-loc { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.slash-loc .item-svg, .slash-loc .ui-svg { display: inline-block; vertical-align: -3px; }
.slash-sub { font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.slash-sub b { color: var(--pink); }
.slash-timer {
  font-family: var(--serif); font-size: 30px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 0 20px rgba(255, 143, 208, .55);
}
.slash-timer.low { color: #ff8f8f; text-shadow: 0 0 20px rgba(255, 90, 90, .6); }
.slash-close {
  pointer-events: auto; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 12px; cursor: pointer; padding: 0;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  color: var(--ink); font-size: 15px;
}

.slash-start {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  animation: slash-hint 1.8s ease forwards;
}
.slash-start-title {
  font-family: var(--serif); font-size: 32px; font-weight: 700; letter-spacing: 3px;
  color: #fff; text-shadow: 0 0 30px rgba(255, 143, 208, .7);
}
.slash-start-text { font-size: 12.5px; color: var(--ink-dim); max-width: 240px; text-align: center; }
@keyframes slash-hint { 0% { opacity: 0 } 15% { opacity: 1 } 75% { opacity: 1 } 100% { opacity: 0 } }

.slash-result {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(7, 4, 16, .93); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 26px; text-align: center;
  animation: rise .25s ease both;
}
.slash-result h2 { font-family: var(--serif); font-size: 26px; margin: 0; letter-spacing: 2px; }
.slash-result .score { color: var(--ink-dim); font-size: 13px; }
.slash-loot { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 300px; margin: 8px 0 4px; }
.slash-loot-line {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 13px;
  animation: loot-in .3s cubic-bezier(.22, 1, .36, 1) both;
}
.slash-loot-line .qty { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.slash-loot-line.rare { border-color: rgba(255, 198, 92, .55); box-shadow: 0 0 22px rgba(255, 198, 92, .2); }
.slash-loot-line.gold { border-color: rgba(255, 198, 92, .4); }
@keyframes loot-in { from { opacity: 0; transform: translateY(10px) scale(.97) } to { opacity: 1; transform: none } }
.slash-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ------------------------------------------------------------ Навигация */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: rgba(12, 8, 19, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 138, 205, .14);
}
.tabbar-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer; padding: 6px 2px;
  color: var(--ink-faint); font-size: 10px; font-weight: 600;
}
.tabbar-btn span { font-size: 20px; line-height: 1; filter: grayscale(.7); transition: filter .2s, transform .2s; }
/* Иконки табов рисуются currentColor, поэтому активный таб подсвечивается сам. */
.tabbar-btn i { display: block; transition: transform .2s ease, opacity .2s ease; opacity: .75; }
.tabbar-btn .ui-svg { width: 22px; height: 22px; }
.tabbar-btn.active { color: var(--pink); }
.tabbar-btn.active span { filter: none; transform: translateY(-2px) scale(1.08); }
.tabbar-btn.active i { opacity: 1; transform: translateY(-2px) scale(1.08); }

/* ------------------------------------------------- Лист подтверждения (Sheet) */
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; }
.sheet-back { position: absolute; inset: 0; background: rgba(5, 3, 10, .72);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade-in .18s ease both; }
.sheet-card {
  position: relative; width: 100%; max-height: 86vh; overflow: auto;
  padding: 14px 14px calc(16px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, rgba(38, 22, 56, .98), rgba(15, 9, 24, .99));
  border-top: 1px solid rgba(255, 138, 205, .28);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .6);
  animation: sheet-up .26s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes sheet-up { from { transform: translateY(22px); opacity: .6 } to { transform: none; opacity: 1 } }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
/* Превью: катана крутится на этом холсте, сундук показывает награды списком. */
.sheet-canvas {
  width: 100%; height: 172px; display: block; margin-bottom: 10px;
  border-radius: var(--radius);
  background: radial-gradient(70% 90% at 50% 20%, rgba(90, 40, 120, .5), rgba(10, 6, 18, .9));
  border: 1px solid var(--panel-line);
}
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet-emoji { font-size: 26px; width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.sheet-headmain { flex: 1; min-width: 0; }
.sheet-title { font-size: 16px; font-weight: 800; }
.sheet-sub { color: var(--ink-dim); font-size: 12px; margin-top: 2px; }
.sheet-body { display: flex; flex-direction: column; gap: 7px; }
.sheet-line { display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 9px 11px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.sheet-line .qty { margin-left: auto; font-weight: 800; color: var(--ink-dim); }
.sheet-note { color: var(--ink-faint); font-size: 11.5px; line-height: 1.45; }
/* Описание ранга — цитатой над цифрами, чтобы не мешалось с объяснением. */
.rank-quote {
  border-left: 2px solid rgba(255, 138, 205, .4); padding: 2px 0 2px 10px;
  margin-bottom: 4px; color: var(--ink-dim); font-style: italic;
}
/* Название и пояснение в строке листа — в две строки, одно под другим.
   Раньше это было привязано к .rank-line, а лестница рангов давно рисуется
   через .row-main. Правило висело мёртвым, и выбор эффекта для катаны писал
   «Лепестки сакурыС клинка слетают лепестки» — без переноса и без пробела
   (23.09.2026). Теперь стиль на самом .rank-main, где бы он ни стоял. */
/* Выбор эффекта: строка не надевает, а показывает. Что показано сейчас —
   видно по рамке и галочке (23.09.2026). */
.fx-pick { cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.fx-pick .fx-mark { margin-left: auto; width: 18px; height: 18px; opacity: 0; flex: 0 0 auto; }
.fx-pick .fx-mark svg { width: 100%; height: 100%; display: block; color: var(--pink); }
.fx-pick.selected {
  border-color: rgba(255, 138, 205, .55);
  background: rgba(255, 138, 205, .1);
}
.fx-pick.selected .fx-mark { opacity: 1; }

.rank-main { display: flex; flex-direction: column; min-width: 0; }
.rank-main b { font-size: 13px; font-weight: 700; }
.rank-main i {
  font-style: normal; font-size: 11px; color: var(--ink-faint); margin-top: 1px;
  line-height: 1.35;
}
.rank-line .qty { white-space: nowrap; flex: 0 0 auto; }
.rank-line.locked { opacity: .45; }
.rank-line.current {
  border-color: rgba(255, 138, 205, .45);
  background: rgba(255, 138, 205, .1);
}
.rank-line.current .qty { color: var(--pink); }
.sheet-body .sheet-group-title { margin: 12px 2px 4px; }
/* Группы кнопок в листе: пополнение звёзд, обмен на золотые. */
.sheet-groups { margin-top: 12px; }
.sheet-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--ink-faint); margin: 12px 2px 7px;
}
.sheet-group { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-group button { flex: 1 1 calc(50% - 4px); padding: 11px 8px; font-size: 13px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 14px; }
.sheet-actions button { flex: 1; padding: 13px; font-size: 14px; border-radius: 14px; }

/* ----------------------------------------------------------------- Тост */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  transform: translateX(-50%); z-index: 70; max-width: 88vw;
  padding: 11px 16px; border-radius: 14px; font-size: 13px; font-weight: 600;
  background: rgba(20, 13, 31, .97); border: 1px solid var(--panel-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: toast-in .2s ease both;
}
.toast.err { border-color: rgba(255, 107, 107, .5); color: #ffc9c9; }
.toast.ok { border-color: rgba(103, 217, 139, .45); color: #c8f5d6; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* Узкие экраны — 320px всё ещё должен читаться */
@media (max-width: 360px) {
  .hero-line1, .hero-line2 { font-size: 23px; }
  .hero-art { height: 94px; }
  .mine-bar-text { font-size: 22px; }
  .nav-card { height: 108px; }
}
