/* Tokyo Loop — флэт-стиль. Плоские цвета, палитра под ночной Токио. */
:root {
  --bg-deep: #0e1020;
  --bg-panel: #171a2e;
  --ink: #edeefb;
  --ink-dim: #9aa0c3;
  --neon-pink: #ff5d8f;
  --neon-cyan: #43e0d8;
  --neon-amber: #ffb454;
  --line: #2a2f4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #05060c; /* тёмные поля-леттербокс вокруг игрового столбца */
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", system-ui, "Hiragino Kaku Gothic ProN", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Игра — вертикальный «телефонный» столбец по центру.
   На широком экране появляются тёмные поля по бокам, арт 3:4 не растягивается. */
#app {
  height: 100vh;        /* фолбэк для старых браузеров */
  height: 100dvh;       /* динамическая высота: учитывает панели браузера на телефоне */
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.7);
}

.screen { display: none; height: 100%; width: 100%; }
.screen.active { display: flex; }

/* ── Титул / финал ── */
#title, #end {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 70% 20%, rgba(255,93,143,0.18), transparent 60%),
    radial-gradient(900px 500px at 20% 80%, rgba(67,224,216,0.14), transparent 60%),
    var(--bg-deep);
}
/* Титул — яркий неоновый перекрёсток + анимация */
#title {
  background:
    linear-gradient(rgba(14,16,32,0.28), rgba(14,16,32,0.62)),
    url('./assets/bg/station.webp') center/cover no-repeat;
  image-rendering: auto;
  overflow: hidden;
}
.title-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.title-card { text-align: center; padding: 32px; max-width: 480px; position: relative; z-index: 1; }

/* Логотип: парит и «дышит» неоном */
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes neonPink {
  0%,100% { text-shadow: 0 0 14px rgba(255,93,143,.7), 0 0 34px rgba(255,93,143,.4); }
  50% { text-shadow: 0 0 24px rgba(255,93,143,1), 0 0 60px rgba(255,93,143,.7); }
}
@keyframes titleFlicker {
  0%,100% { opacity: 1; } 46% { opacity: .78; } 48% { opacity: 1; } 52% { opacity: .88; } 54% { opacity: 1; }
}
#title .kanji { animation: logoFloat 4.5s ease-in-out infinite, neonPink 2.6s ease-in-out infinite; }
#title h1 {
  color: #fff;
  text-shadow: 0 0 12px var(--neon-cyan), 0 0 30px rgba(67,224,216,.7);
  animation: titleFlicker 5s infinite;
}
#title .tagline { color: #cfe9ff; text-shadow: 0 0 8px rgba(0,0,0,.7); }
@keyframes btnGlow {
  0%,100% { box-shadow: 0 0 0 rgba(255,93,143,0); }
  50% { box-shadow: 0 0 22px rgba(255,93,143,.8); }
}
#title .btn.primary { animation: btnGlow 1.8s ease-in-out infinite; }

.title-card { text-align: center; padding: 32px; max-width: 480px; }
.kanji { font-size: 96px; color: var(--neon-pink); line-height: 1; text-shadow: 0 0 24px rgba(255,93,143,0.5); }
.kanji.small { font-size: 64px; color: var(--neon-cyan); text-shadow: 0 0 24px rgba(67,224,216,0.5); }
h1 { font-size: 40px; letter-spacing: 8px; margin: 12px 0 4px; }
h2 { font-size: 28px; margin: 12px 0 8px; }
.tagline { color: var(--ink-dim); margin-bottom: 28px; }
.version { margin-top: 24px; color: var(--ink-dim); font-size: 12px; opacity: 0.6; }

/* ── Кнопки ── */
.btn {
  display: inline-block; border: none; cursor: pointer;
  font-size: 16px; padding: 14px 28px; border-radius: 12px;
  margin: 6px; transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.primary { background: var(--neon-pink); color: #1a0e16; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.hidden { display: none !important; }

/* ── Игровая сцена ── */
#game { position: relative; }
.scene { position: relative; height: 100%; width: 100%; }
.bg {
  position: absolute; inset: 0;
  transition: background-image .45s ease;
  background-color: var(--bg-panel);
  background-position: center;
  background-size: cover;      /* без искажений, аспект сохраняется */
  background-repeat: no-repeat;
  image-rendering: auto;
  animation: kenburns 22s ease-in-out infinite alternate; /* медленный кино-зум */
}
@keyframes kenburns {
  0%   { transform: scale(1.05) translate(0, 0); }
  100% { transform: scale(1.11) translate(-1.5%, -1%); }
}
/* Покачивание кадра по тапу */
@keyframes sceneBump {
  0% { transform: scale(1); } 35% { transform: scale(0.988); } 100% { transform: scale(1); }
}
.scene.bump { animation: sceneBump .17s ease-out; }

/* Слой анимации (дождь) — canvas поверх фона.
   width/height:100% обязательны: canvas — заменяемый элемент, inset:0 его не тянет. */
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* Мерцание неона — лёгкая пульсация яркости фона */
@keyframes neonFlicker {
  0%, 100% { filter: brightness(1) saturate(1); }
  43% { filter: brightness(1.05) saturate(1.05); }
  47% { filter: brightness(0.93) saturate(1); }
  50% { filter: brightness(1.08) saturate(1.1); }
  54% { filter: brightness(0.97) saturate(1); }
  78% { filter: brightness(1.03) saturate(1.04); }
}
.bg.flicker { animation: neonFlicker 5s infinite ease-in-out; }

/* Интерактивные точки (find & tap) */
.hotspots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.hotspot .ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 14px rgba(67,224,216,0.7), inset 0 0 10px rgba(67,224,216,0.4);
  display: grid; place-items: center; font-size: 22px;
  background: rgba(14,16,32,0.35); backdrop-filter: blur(2px);
  animation: hsPulse 1.5s infinite;
}
.hotspot .tag {
  font-size: 12px; color: var(--ink); background: rgba(14,16,32,0.8);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.hotspot:hover .ring { border-color: var(--neon-pink); box-shadow: 0 0 18px rgba(255,93,143,0.8); }
@keyframes hsPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 12px rgba(67,224,216,0.5); }
  50% { transform: scale(1.12); box-shadow: 0 0 22px rgba(67,224,216,0.9); }
}

/* ── Гашапон ── */
#gacha { align-items: flex-start; overflow-y: auto;
  background: radial-gradient(900px 500px at 50% 10%, rgba(255,93,143,0.18), transparent 60%), var(--bg-deep); }
.gacha-wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 22px 18px calc(40px + env(safe-area-inset-bottom)); }
.gacha-machine { text-align: center; margin: 18px 0; }
.gacha-dome {
  width: 190px; height: 190px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.25), rgba(67,224,216,0.12) 60%, rgba(14,16,32,0.5));
  border: 3px solid var(--neon-cyan); box-shadow: 0 0 30px rgba(67,224,216,0.4), inset 0 0 30px rgba(67,224,216,0.2);
  display: grid; place-items: center; overflow: hidden;
}
.capsule { font-size: 84px; transition: transform .2s; }
.capsule.spin { animation: capsuleSpin 1s ease-in-out; }
@keyframes capsuleSpin { 0%{transform:rotate(0) scale(1)} 25%{transform:rotate(-18deg) scale(1.08)} 50%{transform:rotate(18deg) scale(0.94)} 75%{transform:rotate(-10deg) scale(1.06)} 100%{transform:rotate(0) scale(1)} }
.capsule.reveal { animation: capsulePop .5s ease-out; }
@keyframes capsulePop { 0%{transform:scale(0.2);opacity:0} 60%{transform:scale(1.25)} 100%{transform:scale(1);opacity:1} }
.gacha-result { margin-top: 14px; font-size: 15px; color: var(--ink); min-height: 22px; }
.gacha-result .r-name { font-weight: 700; }
.gacha-result .r-new { color: var(--neon-amber); }
.gacha-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 20px; }
.g-item {
  aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg-panel); display: grid; place-items: center; position: relative; font-size: 30px;
}
.g-item.owned { border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(67,224,216,0.3); }
.g-item.rare.owned { border-color: var(--neon-pink); box-shadow: 0 0 12px rgba(255,93,143,0.4); }
.g-item.legend.owned { border-color: var(--neon-amber); box-shadow: 0 0 16px rgba(255,180,84,0.5); }
.g-item .locked { filter: grayscale(1) brightness(0.4); opacity: 0.5; }
.g-item .cnt { position: absolute; right: 4px; bottom: 2px; font-size: 11px; color: var(--ink-dim); }

/* Мини-игра (раннер и т.п.) — оверлей поверх сцены */
.minigame { position: absolute; inset: 0; z-index: 6; display: none; background: #0a0b16; touch-action: none; }
.minigame canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.mg-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  color: var(--ink); background: rgba(14,16,32,0.8); border: 1px solid var(--neon-cyan);
  padding: 8px 18px; border-radius: 999px; font-size: 14px; z-index: 2;
  animation: pulse 1.6s infinite; pointer-events: none;
}
.mg-hud {
  position: absolute; top: 46px; left: 14px; right: 14px; z-index: 2;
  color: #fff; font-size: 18px; letter-spacing: 2px; pointer-events: none;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
}
.mg-bar { margin-top: 8px; height: 8px; background: rgba(12,14,28,0.85); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.mg-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-amber)); }
.mg-over {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: rgba(10,11,22,0.9); padding: 24px;
}
.mg-over-t { font-size: 30px; font-weight: 800; color: var(--neon-pink); text-shadow: 0 0 18px rgba(255,93,143,0.6); }
.mg-over-s { color: var(--ink-dim); max-width: 320px; margin-bottom: 8px; }

/* Тапалка-реакция (перепрыгнуть препятствие и т.п.) */
.challenge {
  position: absolute; inset: 0; z-index: 3; display: none;
  align-items: center; justify-content: center;
}
.ch-target {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: pointer; user-select: none; transform: translateY(-6%);
}
.ch-ring {
  width: 118px; height: 118px; border-radius: 50%;
  display: grid; place-items: center; font-size: 54px;
  background: rgba(255,93,143,0.15);
  border: 3px solid var(--neon-pink);
  box-shadow: 0 0 30px rgba(255,93,143,0.7), inset 0 0 20px rgba(255,93,143,0.4);
  animation: chPulse 0.5s infinite alternate;
}
.ch-target:active .ch-ring { transform: scale(0.94); }
@keyframes chPulse { from { transform: scale(1); } to { transform: scale(1.09); } }
.ch-label {
  font-size: 18px; font-weight: 700; color: var(--ink);
  background: rgba(14,16,32,0.85); padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--neon-pink); white-space: nowrap;
}
.ch-bar {
  width: 200px; height: 10px; background: #0c0e1c;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.ch-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-amber));
}

/* Герой со спины стоит в сцене (над фоном, под диалогом) */
.hero {
  position: absolute; left: 50%; bottom: 34%;
  transform: translateX(-50%);
  width: 104px; height: 159px;
  background: url('./assets/sprite/hero_back.png') center/contain no-repeat;
  image-rendering: pixelated; z-index: 1; pointer-events: none;
  filter: drop-shadow(0 6px 5px rgba(0,0,0,0.55));
}
@media (min-width: 900px) { .hero { width: 132px; height: 202px; bottom: 30%; } }

.hud {
  position: absolute; top: 44px; left: 0; right: 0;
  display: flex; gap: 8px; padding: 8px 14px; z-index: 3;
}
.chip {
  background: rgba(23,26,46,0.8); backdrop-filter: blur(6px);
  border: 1px solid var(--line); color: var(--ink-dim);
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
}

.dialogue {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(14,16,32,0.98) 70%, rgba(14,16,32,0));
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  z-index: 2; min-height: 40%;
  max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; /* на маленьких экранах кнопки не уедут — скроллится */
  display: flex; flex-direction: column; justify-content: flex-end;
}
.speaker {
  font-weight: 700; color: var(--neon-cyan);
  margin-bottom: 8px; min-height: 22px; letter-spacing: 1px;
}
.text {
  font-size: 19px; line-height: 1.55; max-width: 720px;
  margin: 0 auto 8px; width: 100%;
}
.choices { display: flex; flex-direction: column; gap: 10px; max-width: 720px; margin: 12px auto 0; width: 100%; }
.choice {
  text-align: left; background: var(--bg-panel);
  border: 1px solid var(--line); color: var(--ink);
  padding: 14px 16px; border-radius: 12px; cursor: pointer; font-size: 16px;
  transition: border-color .15s ease, transform .08s ease;
}
.choice:hover { border-color: var(--neon-pink); }
.choice:active { transform: translateY(1px); }

.continue-hint {
  align-self: center; margin: 14px auto 2px; cursor: pointer;
  color: var(--ink); font-size: 14px; text-align: center;
  background: rgba(23,26,46,0.85); border: 1px solid var(--neon-cyan);
  padding: 10px 22px; border-radius: 999px;
  animation: hintPulse 1.9s ease-in-out infinite;
}
.continue-hint:hover { filter: brightness(1.15); animation: none; }
@keyframes hintPulse {
  0%, 100% { opacity: .68; box-shadow: 0 0 0 rgba(67,224,216,0); transform: translateY(0); }
  50% { opacity: 1; box-shadow: 0 0 16px rgba(67,224,216,0.55); transform: translateY(-1px); }
}
@keyframes pulse { 0%,100% { opacity: .7; } 50% { opacity: 1; } }
/* Вся сцена кликабельна для продвижения */
#game { cursor: pointer; }

@media (min-width: 900px) {
  .dialogue { min-height: 32%; }
  .text { font-size: 21px; }
}

/* ── Вход/регистрация ── */
#auth, #account {
  align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 500px at 30% 15%, rgba(67,224,216,0.14), transparent 60%),
    var(--bg-deep);
  overflow-y: auto;
}
.auth-card { display: flex; flex-direction: column; }
.field {
  width: 100%; margin: 8px 0; padding: 14px 16px;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); font-size: 16px;
}
.field:focus { outline: none; border-color: var(--neon-cyan); }
.auth-error { color: var(--neon-pink); min-height: 20px; font-size: 14px; margin: 4px 0; }

/* ── Личный кабинет ── */
#account { align-items: flex-start; }
/* Прокрутка для длинных экранов персонажей и магазина */
#characters, #store { align-items: flex-start; justify-content: center; overflow-y: auto; }
.lk {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 24px 18px calc(40px + env(safe-area-inset-bottom));
}
.lk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.lk-hello { font-weight: 700; font-size: 18px; }
.lk-sub { color: var(--ink-dim); font-size: 13px; }
.small-btn { padding: 8px 16px; font-size: 14px; }

.char-card {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; margin-bottom: 24px;
}
.char-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar {
  width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 34px;
  background: linear-gradient(160deg, var(--neon-pink), var(--neon-amber));
  color: #1a0e16;
}
.char-name { font-size: 22px; font-weight: 700; }
.char-level { color: var(--neon-cyan); font-size: 14px; }

/* ── Новый профиль-дашборд ── */
.prof-card { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.prof-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.prof-avatar {
  width: 60px; height: 60px; border-radius: 16px; flex-shrink: 0; display: grid; place-items: center; font-size: 32px;
  background: linear-gradient(160deg, var(--neon-pink), var(--neon-amber)); color: #1a0e16;
}
.prof-meta { flex: 1; min-width: 0; }
.prof-name { font-size: 20px; font-weight: 700; }
.prof-level { color: var(--neon-cyan); font-size: 14px; }
.prof-level b { font-weight: 800; }
.prof-wallet { font-size: 20px; font-weight: 800; color: var(--neon-amber); white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--neon-cyan); }
.stat-lbl { font-size: 12px; color: var(--ink-dim); margin-top: 4px; }
.gacha-progress-bar { margin: 2px 0 12px; }

/* ── Титул: фоновое интро-слайдшоу + брендинг ── */
.title-slideshow { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #0a0b16; }
.ss-layer { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.6s ease; filter: brightness(0.45) saturate(1.05); animation: kenburns 9s ease-in-out infinite alternate; }
.ss-layer.on { opacity: 1; }
/* Постоянная тёмная вуаль поверх слайдшоу — чтобы ни один яркий кадр (напр. розовый закат)
   не вспыхивал при переходе на титул, даже если filter кадра ещё не применился. */
.title-slideshow::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(rgba(10,11,22,0.45), rgba(10,11,22,0.72)); }
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1.2); } }
.title-fx { z-index: 1; }
.title-card { position: relative; z-index: 3; }
.studio-credit { margin-top: 14px; font-size: 12px; color: var(--ink-dim); letter-spacing: .5px; }

/* ── Мини-меню на титуле ── */
.menu-overlay { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(6,8,18,0.7); backdrop-filter: blur(4px); }
.menu-overlay.hidden { display: none; }
.menu-panel { width: min(90%, 340px); background: var(--bg-panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.menu-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 4px; }

/* ── Магазин ── */
.store-card { display: flex; align-items: center; gap: 14px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.store-emoji { font-size: 34px; flex-shrink: 0; }
.store-info { flex: 1; min-width: 0; }
.store-name { font-weight: 700; }
.store-desc { font-size: 12px; color: var(--ink-dim); }
.store-price { flex-shrink: 0; padding: 8px 14px; }

/* ── Галерея персонажей ── */
.chars-wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 40px; }
.chars-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0 20px; }
.cc {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4;
  border: 1px solid var(--line); background: var(--bg-panel); cursor: default;
}
.cc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc.met { cursor: pointer; border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(67,224,216,0.25); }
.cc.met:active { transform: scale(0.98); }
.cc-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(transparent, rgba(10,12,24,0.9)); text-shadow: 0 0 6px #000;
}
.cc.locked .cc-silhouette { filter: brightness(0.12) grayscale(1); }
.cc-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; opacity: 0.85; }
/* модалка персонажа */
.char-modal { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(6,8,16,0.82); padding: 20px; }
.char-modal.hidden { display: none; }
.char-modal-inner { max-width: 420px; width: 100%; text-align: center; background: var(--bg-panel); border: 1px solid var(--neon-cyan); border-radius: 18px; padding: 16px; box-shadow: 0 0 30px rgba(67,224,216,0.25); }
.char-modal-img { width: 100%; border-radius: 12px; display: block; margin-bottom: 12px; }
.char-modal-name { font-size: 22px; font-weight: 800; }
.char-modal-desc { color: var(--ink-dim); font-size: 14px; margin: 6px 0 14px; }

.bar-block { margin-bottom: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.bar { height: 12px; background: #0c0e1c; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; width: 0; transition: width .4s ease; border-radius: 999px; }
.bar-fill.xp { background: linear-gradient(90deg, var(--neon-cyan), var(--neon-amber)); }

.energy-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.wallet-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.chip.wallet { color: var(--neon-amber); border-color: rgba(255,180,84,0.5); }
.chip.rent { color: var(--neon-pink); border-color: rgba(255,93,143,0.5); }
.chip.tickets { color: var(--neon-cyan); border-color: rgba(67,224,216,0.5); }
.gacha-chips { display: flex; gap: 8px; align-items: center; }
#global-mute {
  position: absolute; top: 8px; right: 8px; z-index: 60;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: rgba(14,16,32,0.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); color: #fff; font-size: 16px;
  line-height: 1; cursor: pointer;
}
/* Переключатели языка и стиля музыки — верх-лево, рядом друг с другом */
.tl-toggle {
  position: absolute; top: 8px; z-index: 60; height: 34px; padding: 0 10px;
  border-radius: 17px; background: rgba(14,16,32,0.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); color: #fff; font-size: 13px; font-weight: 600;
  line-height: 1; cursor: pointer; white-space: nowrap;
}
#lang-toggle { left: 8px; min-width: 40px; }
#music-toggle { left: 8px; }  /* языковая кнопка скрыта — музыка сдвинута в угол */

/* ── Карта Токио (fog-of-war) ── */
#map { padding: 0; }
.map-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; background: #0a0b16; }
.map-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-fog { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-pins { position: absolute; inset: 0; }
.map-pin { position: absolute; transform: translate(-50%, -50%); text-align: center; }
.map-pin .pin-dot {
  width: 44px; height: 44px; line-height: 42px; border-radius: 50%; font-size: 22px;
  background: rgba(14,16,32,0.62); border: 1px solid var(--line); margin: 0 auto;
}
.map-pin.on { cursor: pointer; }
.map-pin.on .pin-dot { border-color: var(--neon-cyan); box-shadow: 0 0 14px rgba(67,224,216,0.5); background: rgba(14,16,32,0.75); }
.map-pin.on.secret .pin-dot { border-color: var(--neon-pink); box-shadow: 0 0 16px rgba(255,93,143,0.6); }
.map-pin.off .pin-dot { opacity: 0.55; filter: grayscale(1); }
.map-pin.on:active .pin-dot { transform: scale(1.1); }
.map-pin .pin-name {
  margin-top: 5px; font-size: 12px; color: #fff; text-shadow: 0 0 6px #000; white-space: nowrap;
  background: rgba(14,16,32,0.6); padding: 2px 7px; border-radius: 8px; display: inline-block;
}
.map-top { position: absolute; top: 12px; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 5; }
.map-title { font-size: 20px; font-weight: 700; color: #fff; text-shadow: 0 0 10px #000; }
.map-sub { font-size: 12px; color: var(--ink-dim); text-shadow: 0 0 8px #000; }
#btn-map-back { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 5; }
.energy-hint { color: var(--ink-dim); font-size: 13px; }

.attrs-title { margin: 8px 0 2px; font-size: 16px; }
.attrs-note { color: var(--ink-dim); font-size: 13px; margin-bottom: 14px; }

.attr {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.attr-info { display: flex; align-items: center; gap: 14px; }
.attr-jp {
  font-size: 30px; width: 44px; text-align: center; flex-shrink: 0;
  color: var(--neon-cyan);
}
.attr-name { font-weight: 600; }
.attr-val { color: var(--neon-amber); margin-left: 4px; }
.attr-desc { color: var(--ink-dim); font-size: 12px; }
.train-btn { padding: 10px 16px; font-size: 14px; white-space: nowrap; }
.train-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.lk-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--bg-panel); border: 1px solid var(--neon-cyan);
  color: var(--ink); padding: 12px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20;
}
.lk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.xp-gain {
  color: var(--neon-amber); font-weight: 600; margin: 4px 0 16px;
  font-size: 15px; max-width: 380px;
}

/* Раскрытие шансов гачи (odds disclosure) */
.odds-inner { max-width: 430px; width: 100%; }
.odds-note { color: var(--ink-dim); font-size: 13px; margin: 2px 0 12px; }
.odds-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.odds-row { display: flex; align-items: center; gap: 10px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.odds-e { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.odds-n { flex: 1; text-align: left; font-size: 14px; color: var(--ink); display: flex; flex-direction: column; line-height: 1.25; }
.odds-n i { font-style: normal; font-size: 11px; color: var(--ink-dim); }
.odds-p { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--neon-cyan); flex-shrink: 0; }
.odds-row.r-rare .odds-p { color: #b98bff; }
.odds-row.r-legend .odds-p { color: var(--neon-amber); }

/* ── Экран загрузки миссии (прелоад ассетов квеста) ── */
#quest-loader { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 30%, rgba(18,20,40,.92), rgba(8,9,18,.98)); backdrop-filter: blur(4px);
  transition: opacity .25s ease; }
#quest-loader.hidden { opacity: 0; pointer-events: none; }
#quest-loader .ql-box { width: min(78vw, 320px); text-align: center; }
#quest-loader .ql-kanji { font-size: 46px; font-weight: 800; letter-spacing: .1em; color: var(--neon-cyan, #43e0d8);
  text-shadow: 0 0 18px rgba(67,224,216,.55); animation: qlPulse 1.4s ease-in-out infinite; }
#quest-loader .ql-label { margin: 14px 0 12px; color: #aeb6d6; font-size: 14px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
#quest-loader .ql-bar { height: 6px; border-radius: 6px; background: rgba(120,140,190,.22); overflow: hidden; }
#quest-loader .ql-fill { height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--neon-cyan, #43e0d8), #7ff0e8); transition: width .18s ease; }
@keyframes qlPulse { 0%,100% { opacity: .78; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

/* ── Модалка «Запросить доступ» (гейт после 3 миссий) ── */
.access-inner { max-width: 380px; text-align: center; }
.access-kanji { font-size: 44px; font-weight: 800; color: var(--neon-cyan, #43e0d8);
  text-shadow: 0 0 18px rgba(67,224,216,.5); margin-bottom: 6px; }
.access-desc { color: var(--ink-dim, #aeb6d6); font-size: 14px; line-height: 1.55; margin: 4px 0 14px; }
#access-modal .field { width: 100%; margin: 0 0 10px; }
#access-modal textarea.field { resize: vertical; min-height: 64px; font-family: inherit; }
.access-status { min-height: 20px; font-size: 13px; margin: 2px 0 10px; }
.access-status.ok { color: var(--neon-cyan, #43e0d8); }
.access-status.err { color: #ff8a8a; }
#access-modal .btn { width: 100%; margin-top: 6px; }
