/* ============================================================
   КЛУБОК — современная тёмная тема «forest glass»
   Глубокий лес, полупрозрачные панели, системная типографика.
   ============================================================ */

:root {
  --ink: #e9f5ee;
  --ink-soft: #c5d6cc;
  --paper: #0d1712;
  --paper-2: #09110d;
  --paper-3: #14221b;
  --green: #34d399;
  --green-deep: #050b08;
  --green-dark: #0a1611;
  --red: #fb7185;
  --gold: #fbbf24;
  --gold-soft: #fde68a;
  --blue: #38bdf8;
  --muted: #8ea69a;
  --line: rgba(233, 245, 238, 0.10);
  --shadow: rgba(0, 0, 0, 0.55);
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--green-deep);
  color: var(--ink);
  font-family: var(--font-ui);
  overscroll-behavior: none;
  touch-action: none;
}

button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4, p { margin: 0; }
.is-hidden { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  background: radial-gradient(circle at 50% 40%, #22452e 0%, #13281b 65%, #0b1a11 100%);
}

#map3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #08110d;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
#map3d.is-ready { background: #08110d; }
#map3d .maplibregl-canvas { outline: none; }
#map3d .maplibregl-canvas-container { cursor: grab; }
#map3d .maplibregl-canvas-container:active { cursor: grabbing; }

#character3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: transparent;
  transition: opacity 0.25s ease;
}
#character3d.is-hidden { opacity: 0; }

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  pointer-events: none;
  touch-action: none;
}

#map-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(64, 52, 32, 0.22) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(64, 52, 32, 0.14) 0 1px, transparent 1.5px);
  background-size: 74px 74px, 118px 118px;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(5, 14, 8, 0.45) 100%),
    linear-gradient(to bottom, rgba(8, 18, 11, 0.25), transparent 18%, transparent 80%, rgba(8, 18, 11, 0.3));
  z-index: 2;
}

/* ---------- бумага ---------- */
.paper {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, var(--paper-3) 0%, var(--paper) 55%, var(--paper-2) 100%);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(10, 22, 14, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
}

/* ---------- общие кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--paper-3);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
  user-select: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--ink); }
.btn-primary { background: linear-gradient(180deg, #396f45, var(--green)); color: var(--paper-3); border-color: #0f2216; box-shadow: 0 3px 0 #0f2216; }
.btn-primary:active { box-shadow: 0 0 0 #0f2216; }
.btn-danger { background: linear-gradient(180deg, #cc5a4c, var(--red)); color: #fff6e8; border-color: #571d18; box-shadow: 0 3px 0 #571d18; }
.btn-danger:active { box-shadow: 0 0 0 #571d18; }
.btn-gold { background: linear-gradient(180deg, #ecc269, var(--gold)); border-color: #5d4517; box-shadow: 0 3px 0 #5d4517; color: #2a1f08; }
.btn-gold:active { box-shadow: 0 0 0 #5d4517; }
.btn-big { width: 100%; padding: 15px 20px; font-size: 17px; border-radius: 14px; }
.btn-small { padding: 6px 10px; font-size: 12px; border-radius: 9px; box-shadow: 0 2px 0 var(--ink); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }

.ghost-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(247, 239, 219, 0.55);
  background: rgba(12, 25, 17, 0.5);
  color: var(--paper);
  font-weight: 600;
  font-size: 13px;
  backdrop-filter: blur(6px);
}
.ghost-btn:active { background: rgba(12, 25, 17, 0.8); }

/* ---------- HUD ---------- */
.hud-top {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: 10px;
  right: 10px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 10px;
}
.hud-top > *, .hud-right > * { pointer-events: auto; }

.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 16px;
  min-width: 205px;
  max-width: 260px;
}
.level-ring {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) 0deg, var(--gold) 0deg, rgba(23, 35, 26, 0.16) 0deg 360deg);
  border: 2px solid var(--ink);
  position: relative;
}
.level-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1.5px solid var(--ink);
}
.level-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}
.player-meta { flex: 1; min-width: 0; }
.player-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
  white-space: nowrap;
}
.player-line > span:first-child { overflow: hidden; text-overflow: ellipsis; }
#player-name.is-gm,
.gm-name {
  color: #7cffb2;
  text-shadow: 0 0 10px rgba(124, 255, 178, 0.45);
}
.gm-name::after {
  content: " GM";
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #052e1b;
  background: #7cffb2;
  border-radius: 999px;
  padding: 1px 4px;
  vertical-align: 1px;
}
.team-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--team-color, var(--red));
  color: #fff8e9;
  border: 1.5px solid var(--ink);
  flex: 0 0 auto;
}
.xp-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(23, 35, 26, 0.18);
  border: 1px solid rgba(23, 35, 26, 0.4);
  overflow: hidden;
}
#xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), #e8c268);
  transition: width 0.4s ease;
}
.xp-text { font-size: 9px; color: var(--muted); margin-top: 2px; font-weight: 600; }

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}
.chips { display: flex; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(12, 25, 17, 0.72);
  color: var(--paper);
  border: 1.5px solid rgba(247, 239, 219, 0.35);
  border-radius: 999px;
  padding: 4px 10px 4px 7px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}
.ico { font-size: 12px; line-height: 1; }
.ico-dust { color: #cf9ce8; }
.ico-coin { color: var(--gold); }
.world-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border-width: 1.5px;
  box-shadow: 0 2px 0 rgba(10, 22, 14, 0.6);
}
.world-chip .dot { opacity: 0.4; }
.area-chip {
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  color: rgba(247, 239, 219, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  padding-right: 4px;
  max-width: 200px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  gap: 10px;
}
.hud-bottom > * { pointer-events: auto; }

.joystick-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.joystick {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, rgba(247, 239, 219, 0.16), rgba(12, 25, 17, 0.5));
  border: 2px solid rgba(247, 239, 219, 0.45);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.4);
  touch-action: none;
}
.joystick-base {
  position: absolute;
  inset: 33%;
  border-radius: 50%;
  border: 1.5px dashed rgba(247, 239, 219, 0.3);
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fdf8ec, #d8c9a6);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.05s linear;
}
.move-hint { font-size: 9px; color: rgba(247, 239, 219, 0.6); letter-spacing: 0.08em; text-transform: uppercase; }

.bottom-center { padding-bottom: 8px; }
.ball-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border-width: 1.5px;
  box-shadow: 0 2px 0 rgba(10, 22, 14, 0.6);
  font-size: 12px;
  font-weight: 700;
}
.ball-pill small { color: var(--muted); font-size: 10px; }
.ball-mini {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  background: linear-gradient(180deg, var(--red) 0 46%, var(--ink) 46% 54%, var(--paper-3) 54% 100%);
  border: 1.5px solid var(--ink);
  position: relative;
  flex: 0 0 auto;
}
.ball-mini::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1px solid var(--ink);
}

.action-rail { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.action-btn {
  position: relative;
  width: 62px;
  height: 56px;
  border-radius: 15px;
  background: linear-gradient(180deg, var(--paper-3), var(--paper-2));
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(10, 22, 14, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.action-btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(10, 22, 14, 0.7); }
.action-ico { font-size: 20px; line-height: 1; }
.action-btn small { font-size: 9px; font-weight: 800; letter-spacing: 0.03em; }
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--paper-3);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.gps-chip {
  position: absolute;
  top: calc(112px + var(--safe-top));
  right: 12px;
  z-index: 25;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #8ce0a4;
  background: rgba(12, 25, 17, 0.7);
  border: 1px solid rgba(140, 224, 164, 0.4);
  padding: 3px 8px;
  border-radius: 999px;
}
.gps-chip::before { content: "●"; margin-right: 4px; font-size: 7px; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.nearby-chip {
  position: absolute;
  top: calc(112px + var(--safe-top));
  left: 12px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(247, 239, 219, 0.82);
  background: rgba(12, 25, 17, 0.74);
  border: 1px solid rgba(247, 239, 219, 0.18);
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.nearby-chip.has-players {
  color: #d1fae5;
  border-color: rgba(52, 211, 153, 0.48);
}
.nearby-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8ce0a4;
  box-shadow: 0 0 0 3px rgba(140, 224, 164, 0.12);
  animation: blink 2s infinite;
}

.recenter {
  position: absolute;
  right: 14px;
  bottom: calc(340px + var(--safe-bottom));
  z-index: 25;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 20, 16, 0.86);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  font-size: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.recenter:active { transform: scale(0.95); }

/* ---------- стартовый экран ---------- */
.start-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  background:
    linear-gradient(180deg, rgba(8, 18, 12, 0.88) 0%, rgba(8, 18, 12, 0.58) 42%, rgba(5, 12, 8, 0.93) 100%),
    radial-gradient(circle at 50% 15%, rgba(217, 164, 65, 0.14), transparent 50%),
    url("../assets/3d/forest-portrait.jpg") center / cover no-repeat,
    linear-gradient(180deg, #1a3a25 0%, #13281b 55%, #0b1a11 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
}
.start-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(115deg, transparent 0 46px, rgba(247, 239, 219, 0.025) 46px 47px),
    repeating-linear-gradient(25deg, transparent 0 62px, rgba(247, 239, 219, 0.02) 62px 63px);
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}
.start-inner { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; margin: auto 0; }
.logo-block { text-align: center; }
.logo-ball { width: 92px; margin: 0 auto 8px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)); animation: logoFloat 5s ease-in-out infinite; }
.logo-ball svg { width: 100%; display: block; }
@keyframes logoFloat { 50% { transform: translateY(-6px) rotate(-3deg); } }
.logo-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 9vw, 62px);
  line-height: 0.95;
  color: var(--paper-3);
  letter-spacing: 0.04em;
  text-shadow: 0 3px 0 #0d1d12, 0 10px 30px rgba(0, 0, 0, 0.5);
}
.logo-sub {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-soft);
  font-size: 17px;
  margin-top: 6px;
  letter-spacing: 0.06em;
}
.start-lead {
  color: rgba(247, 239, 219, 0.78);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  max-width: 430px;
}
.feature-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.feature-row span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-soft);
  border: 1px solid rgba(217, 164, 65, 0.45);
  background: rgba(217, 164, 65, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
}
.start-form { width: 100%; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  background: var(--paper-3);
  font-size: 16px;
  font-weight: 700;
  outline: none;
}
.field input:focus { box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.45); }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid var(--line);
  border-radius: 13px;
  transition: all 0.15s ease;
}
.team-card .team-crest {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--team);
  color: #fff8e9;
  font-family: var(--font-display);
  font-weight: 700;
  border: 2px solid var(--ink);
  margin-bottom: 4px;
}
.team-card b { font-size: 12px; }
.team-card small { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.2; }
.team-card.is-selected { border-color: var(--ink); background: var(--paper-3); transform: translateY(-2px); box-shadow: 0 3px 0 var(--ink); }
.team-card.is-selected .team-crest { box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.5); }
.fineprint { font-size: 9.5px; line-height: 1.45; color: var(--muted); text-align: center; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--green-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.5s ease;
}
.boot.is-done { opacity: 0; pointer-events: none; }
.boot-logo { font-family: var(--font-display); color: var(--paper); letter-spacing: 0.16em; font-size: 22px; }
.boot-line { width: 130px; height: 3px; background: rgba(247, 239, 219, 0.15); border-radius: 99px; overflow: hidden; }
.boot-line span { display: block; width: 40%; height: 100%; background: var(--gold); border-radius: 99px; animation: bootSlide 1.1s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------- экраны ---------- */
.screen { position: absolute; inset: 0; }

/* ---------- встреча ---------- */
.encounter {
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #0d2016;
  padding: calc(14px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
}
#ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}
.encounter.ar-on #ar-video { opacity: 1; }
.enc-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, transparent 0%, rgba(8, 20, 12, 0.08) 42%, rgba(4, 10, 7, 0.7) 88%),
    linear-gradient(180deg, rgba(5, 12, 8, 0.18), rgba(4, 10, 7, 0.55)),
    url("../assets/3d/forest-encounter.jpg") center / cover no-repeat;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.75);
  transition: opacity 0.4s ease;
}
.encounter.ar-on .enc-bg { background: radial-gradient(circle at 50% 42%, rgba(10, 26, 17, 0.1) 0%, rgba(10, 26, 17, 0.72) 70%); box-shadow: none; }
.enc-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(247, 239, 219, 0.07) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(247, 239, 219, 0.05) 0 1px, transparent 1.5px);
  background-size: 90px 90px, 130px 130px;
}
.enc-top, .enc-bottom { position: relative; z-index: 6; display: flex; justify-content: space-between; align-items: flex-start; }
.enc-title h2 {
  color: var(--paper-3);
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 34px);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  line-height: 1.05;
}
.type-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.type-row.small { margin-top: 4px; }
.type-chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff9ec;
  background: var(--type-color, #6d7a68);
  border: 1.5px solid rgba(12, 25, 17, 0.65);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.type-row.small .type-chip { font-size: 9px; padding: 1px 6px; }

.enc-stage {
  position: relative;
  z-index: 4;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.enc-stage.is-aiming { cursor: grabbing; }
.target-ring {
  position: absolute;
  width: clamp(200px, 54vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px dashed rgba(247, 239, 219, 0.55);
  box-shadow: 0 0 30px rgba(247, 239, 219, 0.08), inset 0 0 40px rgba(247, 239, 219, 0.05);
  transition: border-color 0.12s ease;
  pointer-events: none;
}
.target-ring.hot { border-color: var(--gold); box-shadow: 0 0 30px rgba(217, 164, 65, 0.35); }
.enc-sprite {
  width: clamp(210px, 58vw, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45));
  user-select: none;
}
.enc-sprite svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes creatureFloat { 50% { transform: translateY(-12px); } }
.enc-sprite.is-hit { animation: hitFlash 0.5s ease; }
@keyframes hitFlash { 0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 0 transparent); } 20% { transform: translateX(8px) scale(0.96); filter: brightness(2); } 40% { transform: translateX(-8px) scale(0.96); } 60% { transform: translateX(5px); } }

.monster-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(210px, 58vw, 360px);
  aspect-ratio: 1;
  transform: translate3d(50%, 45%, 0) translate(-50%, -50%);
  pointer-events: none;
  will-change: transform;
  z-index: 5;
}
.monster-stage.is-fleeing {
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.8, 0.6), opacity 0.55s ease;
}
.monster-stage .enc-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: none;
}
.monster-stage .target-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.held-clew {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 68px;
  height: 68px;
  transform: translateX(-50%);
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55));
  transition: opacity 0.2s ease;
  will-change: transform, left, top;
}
.held-clew svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: heldBob 2.8s ease-in-out infinite;
}
.held-clew::before {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  border: 1.5px dashed rgba(240, 207, 135, 0.45);
  animation: heldRing 7s linear infinite;
}
.held-clew.is-aiming svg,
.held-clew.is-aiming::before { animation-play-state: paused; }
.held-clew.is-aiming::before { border-color: rgba(240, 207, 135, 0.8); }
.held-clew.is-curved {
  filter: drop-shadow(0 0 18px rgba(240, 207, 135, 0.85)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}
.held-clew.is-empty { opacity: 0.35; }
.held-clew.is-hidden { opacity: 0; }
@keyframes heldBob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-8px) rotate(6deg); }
}
@keyframes heldRing { to { transform: rotate(360deg); } }
.aim-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.aim-path.show { opacity: 1; }
.aim-path path {
  fill: none;
  stroke: rgba(240, 207, 135, 0.85);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1 12;
}
.aim-reticle {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid rgba(240, 207, 135, 0.8);
  border-radius: 50%;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.aim-reticle::before,
.aim-reticle::after {
  content: "";
  position: absolute;
  background: rgba(240, 207, 135, 0.8);
}
.aim-reticle::before { left: 50%; top: -8px; width: 1px; height: 48px; margin-left: -0.5px; }
.aim-reticle::after { top: 50%; left: -8px; height: 1px; width: 48px; margin-top: -0.5px; }
.aim-reticle.show { opacity: 1; }
.throw-trail {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--trail-color, #d9a441);
  pointer-events: none;
  z-index: 7;
  opacity: 0.65;
}
.throw-clews.in-flight {
  will-change: transform, left, top;
}
.enc-sparkles { position: absolute; inset: 0; pointer-events: none; }
.enc-sparkles span {
  position: absolute;
  font-size: 18px;
  color: var(--gold-soft);
  animation: sparkle 1.6s ease-in-out infinite;
  opacity: 0;
}
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
.throw-layer { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.throw-ball {
  position: absolute;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--ball-color, #b8463a) 0 46%, var(--ink) 46% 54%, var(--paper-3) 54% 100%);
  border: 2.5px solid var(--ink);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  z-index: 9;
}
.throw-ball::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 2px solid var(--ink);
}
.throw-ball::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--gold);
  border: 1px solid var(--ink);
  z-index: 1;
}
.throw-ball.shaking { animation: ballShake 0.55s ease-in-out; }
@keyframes ballShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-18deg); }
  50% { transform: rotate(14deg); }
  75% { transform: rotate(-8deg); }
}
.float-text {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: clamp(24px, 7vw, 42px);
  color: var(--gold-soft);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  white-space: nowrap;
}
.float-text.show { animation: floatText 1.1s ease forwards; }
@keyframes floatText {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  75% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(0.98); }
}
.enc-bottom { flex-direction: column; align-items: center; gap: 10px; }
.enc-hint {
  color: rgba(247, 239, 219, 0.82);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  min-height: 16px;
}
.tray { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tray-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(12, 25, 17, 0.62);
  border: 1.5px solid rgba(247, 239, 219, 0.42);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.tray-btn b { color: var(--gold-soft); }
.tray-btn.is-used { border-color: var(--gold); background: rgba(217, 164, 65, 0.22); }
.berry-ico {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c96a7a, #7c2735);
  border: 1px solid rgba(0, 0, 0, 0.5);
  display: inline-block;
}
.ball-select { display: flex; gap: 6px; }
.ball-opt {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(247, 239, 219, 0.35);
  background: rgba(12, 25, 17, 0.6);
  display: grid;
  place-items: center;
  transition: all 0.12s ease;
}
.ball-opt .ball-mini { width: 22px; height: 22px; }
.ball-opt .ball-mini::after { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; }
.ball-opt b {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 8px;
  display: grid;
  place-items: center;
}
.ball-opt.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 164, 65, 0.35); transform: translateY(-2px); }
.ball-opt.is-empty { opacity: 0.35; }
.ball-opt[data-ball="great"] { --ball-color: #3b6ea5; }
.ball-opt[data-ball="ultra"] { --ball-color: #c9a227; }
.ball-opt .ball-mini { background: linear-gradient(180deg, var(--ball-color, #b8463a) 0 46%, var(--ink) 46% 54%, var(--paper-3) 54% 100%); }

/* ---------- бой ---------- */
.battle {
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: calc(14px + var(--safe-top)) 16px calc(14px + var(--safe-bottom));
  background: #0b1a11;
  overflow: hidden;
}
.battle-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 22%, rgba(184, 70, 58, 0.24), transparent 45%),
    linear-gradient(180deg, rgba(8, 20, 13, 0.68), rgba(5, 12, 8, 0.9)),
    url("../assets/3d/forest-encounter.jpg") center / cover no-repeat;
}
.battle-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, transparent 0 60px, rgba(247, 239, 219, 0.02) 60px 61px);
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
}
.battle-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.battle-gym-name {
  font-family: var(--font-display);
  color: var(--gold-soft);
  font-size: 15px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.battle-team { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(12, 25, 17, 0.6); border: 1.5px solid var(--team-color, #c9a227); color: var(--paper); }

.fighter { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.fighter.enemy { align-items: flex-end; padding-top: 6px; }
.fighter.ally { align-items: flex-start; margin-top: auto; }
.fighter-info { width: min(240px, 62vw); }
.fighter-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.fighter-name b { color: var(--paper-3); font-size: 13px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.fighter-name span { color: rgba(247, 239, 219, 0.7); font-size: 10px; font-weight: 700; }
.hp-bar {
  height: 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid rgba(247, 239, 219, 0.4);
  overflow: hidden;
}
.hp-fill { height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, #6fbf73, #a8d98a); transition: width 0.25s ease; }
.hp-fill.low { background: linear-gradient(90deg, #c4483a, #e8792f); }
.energy-bar { height: 5px; margin-top: 4px; border-radius: 99px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(247, 239, 219, 0.3); overflow: hidden; }
.energy-bar > div { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #6fa8c4, #b9e3f0); transition: width 0.15s linear; }
.fighter-art { width: clamp(130px, 34vw, 210px); aspect-ratio: 1; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5)); }
.fighter-art svg { width: 100%; height: 100%; display: block; }
.fighter.ally .fighter-art { transform: scaleX(-1); }
.fighter-art.lunge { animation: lunge 0.28s ease; }
@keyframes lunge { 40% { transform: translateX(-16px) scale(1.04); } 100% { transform: translateX(0); } }
.fighter.ally .fighter-art.lunge { animation: lungeAlly 0.28s ease; }
@keyframes lungeAlly { 40% { transform: scaleX(-1) translateX(-16px) scale(1.04); } 100% { transform: scaleX(-1); } }
.fighter-art.hurt { animation: hurt 0.35s ease; }
@keyframes hurt { 20% { filter: brightness(2.5) drop-shadow(0 0 20px rgba(255, 240, 160, 0.8)); transform: translateX(10px); } 50% { transform: translateX(-6px); } 100% { transform: translateX(0); } }
.enemy-telegraph {
  position: absolute;
  right: 18%;
  top: 30%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid var(--red);
  opacity: 0;
  pointer-events: none;
}
.enemy-telegraph.charge { animation: telegraph 0.55s ease forwards; }
@keyframes telegraph {
  0% { opacity: 0.9; transform: scale(1.8); }
  100% { opacity: 0.1; transform: scale(0.7); }
}

.battle-log {
  position: relative;
  z-index: 3;
  align-self: center;
  margin: 4px 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(8, 18, 11, 0.68);
  color: rgba(247, 239, 219, 0.88);
  border: 1px solid rgba(247, 239, 219, 0.2);
  font-size: 11px;
  font-weight: 600;
  min-height: 24px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(6px);
  max-width: 90%;
  text-align: center;
}

.battle-controls { position: relative; z-index: 3; display: flex; gap: 7px; align-items: stretch; margin-top: 10px; }
.battle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 8px;
  border-radius: 13px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--paper-3), var(--paper-2));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.6);
  font-weight: 800;
  font-size: 11px;
  min-height: 58px;
  transition: transform 0.06s ease, box-shadow 0.06s ease, opacity 0.15s;
  user-select: none;
}
.battle-btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, 0.6); }
.battle-btn:disabled { opacity: 0.35; }
.battle-btn span { font-size: 13px; }
.battle-btn small { font-size: 8px; color: var(--muted); font-weight: 700; }
.battle-btn.dodge { flex: 0 0 58px; background: linear-gradient(180deg, #cfe3ea, #a9cbd8); }
.battle-btn.potion { flex: 0 0 50px; background: linear-gradient(180deg, #dfeccf, #bfd6a8); }
.battle-btn.strike {
  flex: 1.4;
  background: linear-gradient(180deg, #d9654f, #a83327);
  color: #fff5e2;
  font-family: var(--font-display);
  font-size: 18px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  border-color: #4d1712;
}
.battle-btn.strike small { color: rgba(255, 245, 226, 0.7); font-size: 8px; }
.charged-group { flex: 1.2; display: flex; flex-direction: column; gap: 5px; }
.battle-btn.charged { min-height: 27px; padding: 3px 6px; font-size: 10px; background: linear-gradient(180deg, #e8d6a8, #d9b96e); }
.battle-btn.charged small { color: rgba(23, 35, 26, 0.6); }
.battle-btn.charged.is-ready { animation: readyPulse 1.2s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.6), 0 0 18px rgba(217, 164, 65, 0.65); } }

.battle-result {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(6, 14, 9, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(4px);
}
.result-card { width: min(400px, 100%); padding: 22px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.result-card h2 { font-family: var(--font-display); font-size: 30px; color: var(--green); }
.result-card h2.lose { color: var(--red); }
.result-card p { font-size: 13px; color: var(--muted); line-height: 1.45; }
.reward-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.reward {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.16);
  border: 1.5px solid rgba(23, 35, 26, 0.2);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- sheet ---------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(6, 14, 9, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  width: min(560px, 100%);
  max-height: min(86dvh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.5; } }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px 11px;
  border-bottom: 1.5px solid var(--line);
  flex: 0 0 auto;
}
.sheet-head h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.01em; }
.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper-3);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 var(--ink);
  flex: 0 0 auto;
}
.sheet-close:active { transform: translateY(2px); box-shadow: none; }
.sheet-body { padding: 14px 18px 22px; overflow-y: auto; touch-action: pan-y; }

.tab-row { display: flex; gap: 6px; margin-bottom: 14px; position: sticky; top: -14px; background: var(--paper); padding: 8px 0; z-index: 2; }
.tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.25);
}
.tab.is-active { background: var(--green); color: var(--paper-3); border-color: var(--green-deep); box-shadow: 0 2px 0 var(--green-deep); }

.section-title { font-family: var(--font-display); font-size: 16px; margin: 4px 0 8px; }
.muted { color: var(--muted); }
.small-text { font-size: 11px; line-height: 1.45; color: var(--muted); }
.empty-state { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* коллекция */
.collection-list { display: flex; flex-direction: column; gap: 8px; }
.creature-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.3);
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.creature-card:active { background: rgba(255, 255, 255, 0.55); }
.creature-thumb { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; }
.creature-thumb svg { width: 100%; height: 100%; }
.creature-main { flex: 1; min-width: 0; }
.creature-main b { display: block; font-size: 13px; }
.creature-sub { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 3px; font-size: 10px; color: var(--muted); font-weight: 700; }
.cp-tag { color: var(--ink); background: var(--gold-soft); border-radius: 999px; padding: 1px 7px; border: 1px solid rgba(23, 35, 26, 0.35); font-size: 9px; }
.shiny-tag { color: #8a5fb0; font-weight: 900; }
.rarity-common { color: #5f7a5f; }
.rarity-uncommon { color: #3d7f7a; }
.rarity-rare { color: #3b6ea5; }
.rarity-epic { color: #8a5fb0; }
.rarity-legendary { color: #a67b12; }

.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 7px; }
.dex-card {
  position: relative;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.3);
  padding: 5px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
.dex-card.is-seen { border-color: rgba(23, 35, 26, 0.35); }
.dex-art { width: 62px; height: 62px; display: grid; place-items: center; }
.dex-art svg { width: 100%; height: 100%; }
.dex-card.unknown .dex-art svg { filter: brightness(0) opacity(0.25); }
.dex-card.unknown .dex-name { color: var(--muted); }
.dex-name { font-size: 9.5px; font-weight: 800; text-align: center; line-height: 1.15; }
.dex-num { position: absolute; top: 4px; left: 5px; font-size: 8px; color: var(--muted); font-weight: 700; }
.dex-count { position: absolute; top: 3px; right: 4px; font-size: 8px; font-weight: 800; background: var(--green); color: var(--paper-3); padding: 1px 4px; border-radius: 999px; }
.dex-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--type-color); }
.dex-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
.mini-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(23, 35, 26, 0.14); overflow: hidden; border: 1px solid rgba(23, 35, 26, 0.2); }
.mini-bar > div { height: 100%; background: var(--gold); }

/* детали духа */
.detail-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.detail-art { width: 118px; height: 118px; flex: 0 0 118px; }
.detail-art svg { width: 100%; height: 100%; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.05; }
.detail-info .scientific { font-family: var(--font-display); font-style: italic; font-size: 11px; color: var(--muted); margin-top: 2px; }
.detail-stats { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; }
.stat-row { display: grid; grid-template-columns: 72px 1fr 34px; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; color: var(--muted); }
.stat-row .bar { height: 7px; border-radius: 99px; background: rgba(23, 35, 26, 0.12); overflow: hidden; }
.stat-row .bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), #6fae5a); }
.stat-row .val { text-align: right; color: var(--ink); }
.detail-desc { font-size: 12px; line-height: 1.55; color: var(--ink-soft); background: rgba(255, 255, 255, 0.35); border-left: 3px solid var(--gold); padding: 8px 10px; border-radius: 0 8px 8px 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cost-line { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); font-weight: 700; }
.evo-line { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 12px; padding: 10px; border-radius: 12px; background: rgba(47, 93, 58, 0.08); border: 1.5px dashed rgba(47, 93, 58, 0.35); }
.evo-line .creature-thumb { width: 42px; height: 42px; flex-basis: 42px; }
.evo-arrow { color: var(--muted); font-size: 15px; }

/* лавка */
.shop-balance { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
}
.shop-ico {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--paper-3);
  border: 1.5px solid var(--ink);
  font-size: 20px;
}
.shop-meta { flex: 1; min-width: 0; }
.shop-meta b { font-size: 13px; display: block; }
.shop-meta small { font-size: 10px; color: var(--muted); }
.shop-price { font-size: 12px; font-weight: 900; color: #8a6a14; white-space: nowrap; }
.gift-card {
  padding: 12px;
  border-radius: 13px;
  border: 1.5px dashed var(--green);
  background: rgba(47, 93, 58, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.gift-card .gift-icon { font-size: 22px; }

/* задания */
.quest-card {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.32);
  margin-bottom: 9px;
}
.quest-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.quest-head b { font-size: 13px; }
.quest-progress { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; font-size: 10px; font-weight: 700; color: var(--muted); }
.quest-progress .mini-bar { height: 7px; }
.quest-reward { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.quest-reward span { font-size: 10px; font-weight: 700; background: rgba(217, 164, 65, 0.14); border-radius: 999px; padding: 2px 7px; }
.quest-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.quest-card.is-done { border-color: rgba(47, 93, 58, 0.5); background: rgba(47, 93, 58, 0.1); }
.quest-card.is-claimed { opacity: 0.55; }
.quest-reset { font-size: 10px; color: var(--muted); text-align: center; padding: 8px 0 2px; }

/* настройки */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-text b { display: block; font-size: 13px; }
.settings-text small { font-size: 10px; color: var(--muted); line-height: 1.35; display: block; max-width: 300px; }
.switch {
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: rgba(23, 35, 26, 0.2);
  border: 1.5px solid rgba(23, 35, 26, 0.35);
  position: relative;
  flex: 0 0 48px;
  transition: background 0.2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1.5px solid var(--ink);
  transition: transform 0.2s ease;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(21px); }
.settings-info { font-size: 11px; line-height: 1.55; color: var(--muted); }
.about-block { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--line); font-size: 10px; line-height: 1.6; color: var(--muted); text-align: center; }

/* ---------- confirm ---------- */
.confirm-backdrop {
  position: absolute;
  inset: 0;
  z-index: 130;
  background: rgba(6, 14, 9, 0.7);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.confirm-card { width: min(360px, 100%); padding: 20px; text-align: center; }
.confirm-card h3 { font-family: var(--font-display); font-size: 21px; margin-bottom: 6px; }
.confirm-card p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.confirm-actions { display: flex; gap: 8px; margin-top: 16px; }
.confirm-actions .btn { flex: 1; }

/* ---------- toasts ---------- */
.toasts {
  position: absolute;
  top: calc(112px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  width: min(360px, calc(100vw - 30px));
}
.toast {
  background: rgba(12, 25, 17, 0.9);
  color: var(--paper);
  border: 1.5px solid rgba(247, 239, 219, 0.35);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.8s forwards;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  max-width: 100%;
}
.toast.good { border-color: rgba(140, 224, 164, 0.5); color: #c8f0d2; }
.toast.bad { border-color: rgba(232, 121, 47, 0.55); color: #ffd9c2; }
.toast.gold { border-color: rgba(217, 164, 65, 0.6); color: var(--gold-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- level up ---------- */
.levelup {
  position: absolute;
  inset: 0;
  z-index: 135;
  background: rgba(6, 14, 9, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.levelup-card { width: min(340px, 100%); padding: 24px; text-align: center; animation: popIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } }
.levelup-star { font-size: 38px; color: var(--gold); line-height: 1; }
.levelup-card h2 { font-family: var(--font-display); font-size: 24px; margin: 4px 0; }
.levelup-num { font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--green); margin: 2px 0 6px; }
.levelup-card p { font-size: 12px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }

/* поимка */
.catch-card { text-align: center; }
.catch-art { width: 160px; height: 160px; margin: 0 auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28)); animation: creatureFloat 3.4s ease-in-out infinite; }
.catch-art svg { width: 100%; height: 100%; }
.catch-title { font-family: var(--font-display); font-size: 26px; margin-top: 4px; }
.catch-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.catch-badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.catch-badge { font-size: 9px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--gold-soft); }
.catch-badge.new { background: #cfe3a8; }
.catch-badge.shiny { background: #e2cff2; color: #5c2d7e; }
.catch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.catch-stat { background: rgba(255, 255, 255, 0.4); border: 1px solid var(--line); border-radius: 10px; padding: 7px 4px; }
.catch-stat b { display: block; font-size: 14px; }
.catch-stat small { font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- адаптив ---------- */
@media (max-width: 640px) {
  .player-card { min-width: 0; max-width: 200px; padding: 6px 10px 6px 6px; gap: 8px; }
  .level-ring { width: 40px; height: 40px; flex-basis: 40px; }
  .level-ring span { font-size: 17px; }
  .player-line { font-size: 11px; }
  .xp-text { display: none; }
  .world-chip { font-size: 10px; padding: 3px 8px; }
  .area-chip { font-size: 10px; max-width: 140px; }
  .action-btn { width: 54px; height: 50px; }
  .action-ico { font-size: 18px; }
  .joystick { width: 92px; height: 92px; }
  .joystick-knob { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .bottom-center { display: none; }
  .recenter { bottom: calc(300px + var(--safe-bottom)); }
  .battle-controls { gap: 5px; }
  .battle-btn { padding: 6px; }
  .battle-btn.dodge { flex-basis: 50px; }
  .battle-btn.potion { flex-basis: 44px; }
  .sheet-backdrop { padding: 0; }
  .sheet { max-height: 90dvh; width: 100%; border-radius: 22px 22px 0 0; border-bottom: 0; }
}

@media (max-height: 680px) {
  .fighter-art { width: clamp(100px, 26vw, 150px); }
  .monster-stage { width: clamp(180px, 46vw, 280px); }
  .enc-sprite { width: clamp(180px, 46vw, 280px); }
  .target-ring { width: clamp(170px, 44vw, 280px); }
  .battle-log { margin: 2px 0; }
  .battle-controls { margin-top: 6px; }
  .action-rail { gap: 5px; }
  .action-btn { width: 50px; height: 46px; }
  .action-ico { font-size: 16px; }
}

@media (min-width: 900px) {
  .hud-top { left: 18px; right: 18px; top: calc(16px + var(--safe-top)); }
  .hud-bottom { left: 18px; right: 18px; bottom: calc(16px + var(--safe-bottom)); }
  .player-card { min-width: 250px; }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
/* ---------- дополнения: зум, сервер, силуэты ---------- */
.zoom-controls {
  position: absolute;
  left: 26px;
  bottom: calc(156px + var(--safe-bottom));
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zoom-controls button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(12, 25, 17, 0.72);
  border: 1.5px solid rgba(247, 239, 219, 0.4);
  color: var(--paper);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.zoom-controls button:active { background: rgba(12, 25, 17, 0.95); }

.settings-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.settings-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--paper-3);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}
.settings-input:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(47, 93, 58, 0.2); }

.silhouette { width: 100%; height: 100%; filter: brightness(0); opacity: 0.28; }
.silhouette svg { width: 100%; height: 100%; }
.art-inline { width: 100%; height: 100%; }
.art-inline svg { width: 100%; height: 100%; }

.dex-card .dex-art .species-svg { width: 100%; height: 100%; }
.dex-card { font-family: var(--font-ui); color: var(--ink); }

@media (max-width: 640px) {
  .zoom-controls { left: 18px; bottom: calc(140px + var(--safe-bottom)); }
  .zoom-controls button { width: 34px; height: 34px; font-size: 17px; }
}

.tutorial-hint {
  position: absolute;
  left: 50%;
  bottom: calc(132px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 29;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: min(420px, calc(100vw - 120px));
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(12, 25, 17, 0.82);
  border: 1.5px solid rgba(240, 207, 135, 0.55);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.tutorial-dot { color: var(--gold); font-size: 12px; animation: tutorialPulse 1.6s ease-in-out infinite; }
@keyframes tutorialPulse { 50% { opacity: 0.35; transform: scale(0.8); } }
@media (max-width: 640px) {
  .tutorial-hint { bottom: calc(122px + var(--safe-bottom)); max-width: calc(100vw - 150px); font-size: 10px; padding: 6px 11px; }
}

/* ============================================================
   КЛУБОК: клубки, GPS, новый логотип
   ============================================================ */

.logo-clew {
  width: 132px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
  animation: logoFloat 5s ease-in-out infinite;
}
.logo-clew svg, .logo-clew img { width: 100%; display: block; filter: drop-shadow(0 10px 22px rgba(0,0,0,.55)); }

.gps-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 44vw;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(12, 25, 17, 0.8);
  border: 1.5px solid rgba(247, 239, 219, 0.35);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gps-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ce0a4;
  box-shadow: 0 0 8px rgba(140, 224, 164, 0.7);
  flex: 0 0 auto;
  animation: blink 2s infinite;
}
.gps-status.is-lost { border-color: rgba(232, 121, 47, 0.6); color: #ffd9c2; }
.gps-status.is-lost .gps-status-dot { background: #e8792f; box-shadow: 0 0 8px rgba(232, 121, 47, 0.7); }

.clew-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border-width: 1.5px;
  box-shadow: 0 2px 0 rgba(10, 22, 14, 0.6);
  font-size: 12px;
  font-weight: 700;
}
.clew-pill small { color: var(--muted); font-size: 10px; }
.clew-pill-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; }
.clew-pill-icon svg { width: 100%; height: 100%; display: block; }

.clew-select { display: flex; gap: 6px; }
.clew-opt {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(247, 239, 219, 0.35);
  background: rgba(12, 25, 17, 0.6);
  display: grid;
  place-items: center;
  transition: all 0.12s ease;
}
.clew-opt svg { width: 30px; height: 30px; }
.clew-opt b {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 8px;
  display: grid;
  place-items: center;
}
.clew-opt.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 164, 65, 0.35); transform: translateY(-2px); }
.clew-opt.is-empty { opacity: 0.35; }

.throw-clews {
  position: absolute;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  z-index: 9;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.55));
}
.throw-clews svg { width: 100%; height: 100%; display: block; }
.throw-clews.shaking { animation: clewShake 0.55s ease-in-out; }
@keyframes clewShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-14deg) scale(1.03); }
  50% { transform: rotate(12deg) scale(0.98); }
  75% { transform: rotate(-7deg) scale(1.02); }
}

.gps-gate {
  position: absolute;
  inset: 0;
  z-index: 106;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 38%, rgba(47, 93, 58, 0.55), transparent 55%),
    rgba(6, 14, 9, 0.86);
  backdrop-filter: blur(5px);
}
.gps-gate-card {
  width: min(380px, 100%);
  padding: 24px 22px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: popIn 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.gps-gate-clew { width: 86px; height: 86px; margin: 0 auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3)); }
.gps-gate-clew svg, .gps-gate-clew img { width: 100%; height: 100%; display: block; object-fit: contain; }
.gps-gate-card h2 { font-family: var(--font-display); font-size: 26px; }
.gps-gate-card p { font-size: 12px; line-height: 1.55; color: var(--muted); }
.gps-gate-status { font-size: 10px; color: var(--green); font-weight: 700; min-height: 14px; }

@media (max-width: 640px) {
  .bottom-center { display: block; }
  .gps-status { max-width: 38vw; font-size: 9px; padding: 6px 9px; }
  .clew-pill { padding: 4px 9px; font-size: 11px; }
  .clew-pill small { display: none; }
  .clew-opt { width: 42px; height: 42px; }
  .clew-opt svg { width: 27px; height: 27px; }
  .zoom-controls { left: 18px; bottom: calc(88px + var(--safe-bottom)); }
  .tutorial-hint { bottom: calc(96px + var(--safe-bottom)); max-width: calc(100vw - 140px); }
}


.species-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}
.species-img.is-shiny {
  filter: drop-shadow(0 0 10px rgba(255, 215, 110, 0.75)) saturate(1.12) hue-rotate(-6deg);
}
.silhouette-img {
  filter: brightness(0) opacity(0.28);
}


.enc-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--enc-color, #4e7a3a) 0%, transparent 58%);
  opacity: 0.22;
  pointer-events: none;
  mix-blend-mode: screen;
}
.encounter.ar-on .enc-bg::after { opacity: 0.12; }

/* ============================================================
   СОВРЕМЕННАЯ ТЕМА «FOREST GLASS»
   Плоские поверхности, мягкие тени, системный sans-serif.
   ============================================================ */

html, body {
  background: #050b08;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(52, 211, 153, 0.35); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: rgba(52, 211, 153, 0.32) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(52, 211, 153, 0.28); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid rgba(52, 211, 153, 0.7); outline-offset: 2px; }

#app { background: radial-gradient(circle at 50% -10%, #123b2c 0%, #07140f 48%, #040806 100%); }
#map-grain { display: none; }
#vignette { background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.38) 100%); }

/* ---------- поверхности ---------- */
.paper {
  background: linear-gradient(160deg, rgba(21, 35, 28, 0.92), rgba(11, 20, 16, 0.96));
  border: 1px solid rgba(233, 245, 238, 0.10);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(1.12);
}

/* ---------- кнопки ---------- */
.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(233, 245, 238, 0.14);
  border-radius: 14px;
  box-shadow: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(233, 245, 238, 0.22); }
.btn:active { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn:disabled { opacity: 0.4; box-shadow: none; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #04140d;
  border: 1px solid rgba(52, 211, 153, 0.55);
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.24);
}
.btn-primary:hover { background: linear-gradient(135deg, #4ade80, #10b981); }
.btn-danger {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  color: #fff;
  border: 1px solid rgba(251, 113, 133, 0.55);
  box-shadow: 0 8px 26px rgba(225, 29, 72, 0.22);
}
.btn-gold {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #241505;
  border: 1px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.20);
}
.btn-primary:active, .btn-danger:active, .btn-gold:active { transform: translateY(1px) scale(0.99); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22); }
.btn-big { border-radius: 16px; }
.btn-small { border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }

.ghost-btn {
  background: rgba(8, 18, 14, 0.68);
  border: 1px solid rgba(233, 245, 238, 0.16);
  color: var(--ink);
  font-weight: 600;
  backdrop-filter: blur(10px);
}
.ghost-btn:active { background: rgba(8, 18, 14, 0.9); }

/* ---------- HUD ---------- */
.player-card { border-radius: 18px; }
.level-ring {
  background: conic-gradient(var(--green) 0deg, var(--green) 0deg, rgba(255, 255, 255, 0.10) 0deg 360deg);
  border: 1px solid rgba(233, 245, 238, 0.18);
}
.level-ring::after { background: #0c1712; border: 1px solid rgba(233, 245, 238, 0.12); }
.level-ring span { font-family: var(--font-ui); font-weight: 800; }
.team-badge {
  background: var(--team-color, var(--red));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 800;
}
.xp-bar { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.07); }
#xp-fill { background: linear-gradient(90deg, #34d399, #22d3ee); }
.chip, .world-chip, .gps-status, .clew-pill {
  background: rgba(10, 20, 16, 0.82);
  border: 1px solid rgba(233, 245, 238, 0.12);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.clew-pill small { color: var(--muted); }
.area-chip {
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233, 245, 238, 0.55);
}
.action-btn {
  background: rgba(12, 22, 17, 0.86);
  border: 1px solid rgba(233, 245, 238, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  color: var(--ink);
}
.action-btn:hover { background: rgba(52, 211, 153, 0.10); border-color: rgba(52, 211, 153, 0.35); }
.action-btn:active { transform: scale(0.96); box-shadow: none; }
.action-ico { color: var(--green); }
.action-btn small { color: rgba(233, 245, 238, 0.70); }
.badge { border-color: #0d1712; box-shadow: 0 0 0 1px rgba(233, 245, 238, 0.18); }
.gps-chip { background: rgba(6, 20, 14, 0.82); border: 1px solid rgba(52, 211, 153, 0.35); color: #86efac; }
.recenter, .zoom-controls button {
  background: rgba(10, 20, 16, 0.82);
  border: 1px solid rgba(233, 245, 238, 0.14);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}
.recenter:active, .zoom-controls button:active { background: rgba(52, 211, 153, 0.14); }
.tutorial-hint {
  background: rgba(8, 18, 14, 0.86);
  border: 1px solid rgba(52, 211, 153, 0.30);
  color: #a7f3d0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.30);
}
.tutorial-dot { color: var(--green); }

/* ---------- стартовый экран ---------- */
.start-screen {
  background:
    linear-gradient(180deg, rgba(3, 8, 6, 0.74) 0%, rgba(3, 8, 6, 0.52) 40%, rgba(3, 8, 6, 0.94) 100%),
    radial-gradient(circle at 50% 16%, rgba(52, 211, 153, 0.16), transparent 52%),
    url("../assets/3d/forest-portrait.jpg") center / cover no-repeat,
    #050b08;
}
.start-screen::before { display: none; }
.logo-clew {
  width: 148px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.50)) drop-shadow(0 0 44px rgba(52, 211, 153, 0.16));
}
.logo-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 10vw, 68px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: #f0fdf4;
  background: linear-gradient(135deg, #ffffff 4%, #d1fae5 42%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.logo-sub {
  font-family: var(--font-ui);
  font-style: normal;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(167, 243, 208, 0.72);
  margin-top: 10px;
}
.start-lead { color: rgba(233, 245, 238, 0.70); font-size: 14px; line-height: 1.65; }
.feature-row span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.24);
  background: rgba(52, 211, 153, 0.08);
}
.start-form { padding: 22px; gap: 18px; }
.field > span { font-size: 12px; font-weight: 700; color: rgba(233, 245, 238, 0.82); }
.field input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(233, 245, 238, 0.14);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
}
.field input:focus { border-color: rgba(52, 211, 153, 0.60); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14); }
.team-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(233, 245, 238, 0.10);
  border-radius: 16px;
}
.team-card:hover { background: rgba(255, 255, 255, 0.06); }
.team-card.is-selected {
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
  transform: none;
}
.team-card .team-crest { font-family: var(--font-ui); font-weight: 800; border: 1px solid rgba(255, 255, 255, 0.22); }
.team-card small { color: var(--muted); }
.fineprint { color: rgba(233, 245, 238, 0.38); }
.boot-logo { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.20em; color: var(--ink); }
.boot-line span { background: linear-gradient(90deg, #34d399, #22d3ee); }

/* ---------- встреча ---------- */
.encounter { background: #040a07; }
.enc-bg {
  background:
    radial-gradient(circle at 50% 38%, rgba(52, 211, 153, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(3, 8, 6, 0.52), rgba(3, 8, 6, 0.88)),
    url("../assets/3d/forest-encounter.jpg") center / cover no-repeat;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.78);
}
.enc-grain { display: none; }
.enc-title h2 { font-weight: 800; letter-spacing: -0.02em; color: #f0fdf4; text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); }
.type-chip { border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: none; font-weight: 700; letter-spacing: 0.04em; }
.target-ring {
  border: 2px dashed rgba(233, 245, 238, 0.42);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.10), inset 0 0 40px rgba(52, 211, 153, 0.04);
}
.target-ring.hot { border-color: var(--green); box-shadow: 0 0 40px rgba(52, 211, 153, 0.32), inset 0 0 30px rgba(52, 211, 153, 0.07); }
.held-clew::before { border-color: rgba(52, 211, 153, 0.45); }
.held-clew.is-aiming::before { border-color: rgba(52, 211, 153, 0.80); }
.held-clew.is-curved { filter: drop-shadow(0 0 20px rgba(52, 211, 153, 0.80)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.aim-path path { stroke: rgba(52, 211, 153, 0.90); }
.aim-reticle { border-color: rgba(52, 211, 153, 0.85); }
.aim-reticle::before, .aim-reticle::after { background: rgba(52, 211, 153, 0.85); }
.float-text { font-family: var(--font-display); font-weight: 800; color: #a7f3d0; text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); }
.enc-hint { color: rgba(233, 245, 238, 0.65); font-weight: 500; }
.tray-btn { background: rgba(8, 18, 14, 0.72); border: 1px solid rgba(233, 245, 238, 0.14); color: var(--ink); }
.tray-btn b { color: var(--green); }
.tray-btn.is-used { border-color: rgba(251, 191, 36, 0.50); background: rgba(251, 191, 36, 0.12); }
.clew-opt { border: 1px solid rgba(233, 245, 238, 0.14); background: rgba(8, 18, 14, 0.72); }
.clew-opt.is-selected { border-color: var(--green); box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.20); }
.clew-opt b { background: #0d1712; color: var(--ink); border: 1px solid rgba(233, 245, 238, 0.20); }
.enc-bg::after { opacity: 0.16; }

/* ---------- бой ---------- */
.battle { background: #050b08; }
.battle-bg {
  background:
    radial-gradient(circle at 72% 18%, rgba(251, 113, 133, 0.18), transparent 45%),
    radial-gradient(circle at 25% 72%, rgba(52, 211, 153, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(4, 10, 8, 0.68), rgba(3, 8, 6, 0.94)),
    url("../assets/3d/forest-encounter.jpg") center / cover no-repeat;
}
.battle-bg::after { display: none; }
.battle-gym-name { font-family: var(--font-display); font-weight: 700; color: #fde68a; letter-spacing: 0.01em; }
.battle-team { background: rgba(8, 18, 14, 0.72); border: 1px solid var(--team-color, #fbbf24); color: var(--ink); }
.fighter-name b { color: #f0fdf4; font-weight: 700; }
.fighter-name span { color: rgba(233, 245, 238, 0.55); }
.hp-bar { background: rgba(0, 0, 0, 0.50); border: 1px solid rgba(233, 245, 238, 0.12); }
.hp-fill { background: linear-gradient(90deg, #34d399, #a3e635); box-shadow: 0 0 12px rgba(52, 211, 153, 0.28); }
.hp-fill.low { background: linear-gradient(90deg, #fb7185, #f97316); }
.energy-bar { background: rgba(0, 0, 0, 0.50); border: 1px solid rgba(233, 245, 238, 0.10); }
.energy-bar > div { background: linear-gradient(90deg, #38bdf8, #a5f3fc); }
.battle-log { background: rgba(8, 18, 14, 0.78); border: 1px solid rgba(233, 245, 238, 0.10); color: rgba(233, 245, 238, 0.78); font-weight: 500; }
.battle-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(233, 245, 238, 0.12); box-shadow: none; border-radius: 14px; color: var(--ink); }
.battle-btn:active { transform: scale(0.97); box-shadow: none; }
.battle-btn.dodge { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.30); color: #bae6fd; }
.battle-btn.potion { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.30); color: #a7f3d0; }
.battle-btn.strike {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  border-color: rgba(251, 113, 133, 0.55);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(225, 29, 72, 0.24);
}
.battle-btn.strike small { color: rgba(255, 255, 255, 0.70); }
.battle-btn.charged { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.30); color: #fde68a; }
.battle-btn.charged small { color: rgba(253, 230, 138, 0.65); }
.battle-btn.charged.is-ready { animation: readyPulse 1.2s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 0 24px rgba(251, 191, 36, 0.35); } }
.battle-result { background: rgba(3, 8, 6, 0.72); backdrop-filter: blur(8px); }
.result-card h2 { font-weight: 800; letter-spacing: -0.02em; color: var(--green); }
.result-card h2.lose { color: var(--red); }
.result-card p { color: var(--muted); }
.reward { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.18); }

/* ---------- шторки и карточки ---------- */
.sheet-backdrop { background: rgba(3, 8, 6, 0.66); backdrop-filter: blur(8px); }
.sheet { border-radius: 24px; }
.sheet-head { border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-weight: 800; letter-spacing: -0.015em; }
.sheet-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(233, 245, 238, 0.14);
  box-shadow: none;
  color: var(--ink);
}
.sheet-close:active { transform: scale(0.94); }
.tab-row { background: rgba(13, 23, 18, 0.94); backdrop-filter: blur(12px); }
.tab { background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(233, 245, 238, 0.10); color: var(--muted); }
.tab.is-active { background: rgba(52, 211, 153, 0.14); color: #a7f3d0; border-color: rgba(52, 211, 153, 0.45); box-shadow: none; }
.section-title { font-weight: 700; letter-spacing: -0.01em; }
.creature-card, .dex-card, .shop-item, .quest-card, .catch-stat {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(233, 245, 238, 0.09);
}
.creature-card:hover, .dex-card:hover, .shop-item:hover, .quest-card:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(233, 245, 238, 0.16); }
.creature-card:active { background: rgba(52, 211, 153, 0.10); }
.dex-card.is-seen { border-color: rgba(52, 211, 153, 0.24); }
.dex-count { color: #04140d; background: var(--green); }
.dex-card.unknown .dex-art svg { filter: grayscale(1) brightness(2) opacity(0.18); }
.silhouette-img { filter: grayscale(1) brightness(2) opacity(0.18); }
.cp-tag { color: #241505; background: var(--gold-soft); border: 1px solid rgba(251, 191, 36, 0.40); }
.rarity-common { color: #86efac; }
.rarity-uncommon { color: #5eead4; }
.rarity-rare { color: #7dd3fc; }
.rarity-epic { color: #c4b5fd; }
.rarity-legendary { color: #fcd34d; }
.shiny-tag { color: #f0abfc; }
.detail-desc { background: rgba(255, 255, 255, 0.035); border-left: 2px solid var(--green); color: var(--ink-soft); }
.detail-info .scientific { font-family: var(--font-ui); font-style: normal; text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.evo-line { background: rgba(52, 211, 153, 0.05); border: 1px dashed rgba(52, 211, 153, 0.25); }
.shop-ico { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(233, 245, 238, 0.12); }
.shop-price { color: var(--gold); }
.gift-card { background: rgba(52, 211, 153, 0.05); border: 1px dashed rgba(52, 211, 153, 0.25); }
.quest-card.is-done { background: rgba(52, 211, 153, 0.07); border-color: rgba(52, 211, 153, 0.30); }
.quest-reward span { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.16); }
.switch { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(233, 245, 238, 0.12); }
.switch::after { background: #e9f5ee; border: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.30); }
.switch.on { background: var(--green); border-color: rgba(52, 211, 153, 0.50); }
.settings-input { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(233, 245, 238, 0.12); color: var(--ink); }
.settings-input:focus { border-color: rgba(52, 211, 153, 0.60); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.about-block { border-top: 1px solid var(--line); }
.mini-bar, .stat-row .bar { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.06); }
.stat-row .bar > div { background: linear-gradient(90deg, #34d399, #22d3ee); }

/* ---------- подтверждения, тосты, уровни ---------- */
.confirm-backdrop, .levelup { background: rgba(3, 8, 6, 0.72); backdrop-filter: blur(8px); }
.confirm-card h3 { font-weight: 800; letter-spacing: -0.01em; }
.toast { background: rgba(8, 18, 14, 0.92); border: 1px solid rgba(233, 245, 238, 0.14); color: var(--ink); }
.toast.good { border-color: rgba(52, 211, 153, 0.40); color: #a7f3d0; }
.toast.bad { border-color: rgba(251, 113, 133, 0.40); color: #fecdd3; }
.toast.gold { border-color: rgba(251, 191, 36, 0.40); color: #fde68a; }
.levelup-card h2 { font-weight: 800; }
.levelup-num { font-weight: 900; letter-spacing: -0.04em; color: var(--green); }
.catch-title { font-weight: 800; letter-spacing: -0.02em; }
.catch-badge { background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.30); color: #fde68a; }
.catch-badge.new { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.30); color: #a7f3d0; }
.catch-badge.shiny { background: rgba(192, 132, 252, 0.12); border-color: rgba(192, 132, 252, 0.30); color: #e9d5ff; }

/* ---------- GPS-гейт ---------- */
.gps-gate {
  background:
    radial-gradient(circle at 50% 38%, rgba(52, 211, 153, 0.12), transparent 55%),
    rgba(3, 8, 6, 0.86);
  backdrop-filter: blur(8px);
}
.gps-gate-card h2 { font-weight: 800; letter-spacing: -0.02em; }
.gps-gate-status { color: #86efac; }

@media (max-width: 640px) {
  .start-form { padding: 18px; }
  .logo-title { font-size: clamp(38px, 12vw, 56px); }
  .logo-sub { font-size: 10px; letter-spacing: 0.26em; }
  .sheet { border-radius: 24px 24px 0 0; }
  .action-btn { border-radius: 14px; }
  .clew-pill { border-radius: 999px; }
}

/* ---------- вход ---------- */
.start-auth { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-top: 2px; }
.start-auth-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.start-auth-buttons { display: flex; gap: 10px; justify-content: center; }
.start-auth-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(233, 245, 238, 0.12);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.start-auth-btn svg { width: 28px; height: 28px; border-radius: 9px; display: block; }
.start-auth-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(52, 211, 153, 0.35); transform: translateY(-2px); }
.start-auth-btn:active { transform: scale(0.96); }
.start-auth-note { font-size: 10px; line-height: 1.45; color: var(--muted); text-align: center; max-width: 320px; }

.auth-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--muted); font-size: 13px; }
.auth-spinner { width: 16px; height: 16px; border: 2px solid rgba(52, 211, 153, 0.25); border-top-color: var(--green); border-radius: 50%; animation: authSpin 0.8s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-hero { text-align: center; padding: 6px 0 14px; }
.auth-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.30);
  color: var(--green);
  font-size: 24px;
}
.auth-hero h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.auth-hero p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-provider-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.auth-provider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(233, 245, 238, 0.09);
  text-align: left;
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.auth-provider:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(233, 245, 238, 0.16); }
.auth-provider:active { transform: scale(0.99); }
.auth-provider.is-linked { border-color: rgba(52, 211, 153, 0.30); background: rgba(52, 211, 153, 0.06); }
.auth-provider.is-disabled { opacity: 0.55; }
.auth-provider-logo { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; overflow: hidden; display: grid; place-items: center; background: #fff; }
.auth-provider-logo svg { width: 100%; height: 100%; display: block; }
.auth-provider-main { flex: 1; min-width: 0; }
.auth-provider-main b { display: block; font-size: 14px; }
.auth-provider-main small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.auth-provider-state {
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.30);
  background: rgba(52, 211, 153, 0.08);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.auth-provider-state.is-linked { color: #a7f3d0; background: rgba(52, 211, 153, 0.14); }
.auth-provider-state.is-off { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.auth-note { font-size: 10.5px; line-height: 1.5; color: var(--muted); text-align: center; margin: 10px 0 12px; }
#auth-done { width: 100%; }

@media (max-width: 640px) {
  .start-auth-btn { width: 44px; height: 44px; }
  .auth-provider-logo { width: 38px; height: 38px; flex-basis: 38px; }
}

/* ---------- создание странника ---------- */
.field-hint { font-size: 9px; line-height: 1.4; color: var(--muted); }
.field-error { font-size: 10px; line-height: 1.4; color: #fecdd3; font-weight: 600; }
.gender-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gender-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 12px;
  min-height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(233, 245, 238, 0.10);
  color: var(--ink);
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.gender-card .gender-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.30);
  color: #a7f3d0;
  font-weight: 900;
  font-size: 17px;
}
.gender-card[data-gender="f"] .gender-mark {
  background: rgba(251, 113, 133, 0.10);
  border-color: rgba(251, 113, 133, 0.32);
  color: #fecdd3;
}
.gender-card.is-selected {
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.50);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.10);
}
.gps-status { cursor: pointer; text-align: left; }

/* ---------- экран безопасности ---------- */
.safety-screen {
  z-index: 110;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(26px + var(--safe-top)) 18px calc(26px + var(--safe-bottom));
  overflow-y: auto;
  touch-action: pan-y;
  background:
    linear-gradient(180deg, rgba(3, 8, 6, 0.90), rgba(3, 8, 6, 0.72) 42%, rgba(3, 8, 6, 0.96)),
    radial-gradient(circle at 50% 10%, rgba(52, 211, 153, 0.18), transparent 54%),
    url("../assets/3d/forest-portrait.jpg") center / cover no-repeat,
    #050b08;
}
.safety-inner {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  margin: auto 0;
}
.safety-badge {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #04140d;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.safety-title {
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
  color: #f0fdf4;
}
.safety-lead {
  color: rgba(233, 245, 238, 0.72);
  font-size: 14px;
  line-height: 1.65;
  max-width: 380px;
}
.safety-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 2px;
  text-align: left;
}
.safety-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(21, 35, 28, 0.96), rgba(11, 20, 16, 0.98));
  border: 1px solid rgba(233, 245, 238, 0.10);
}
.safety-list b { display: block; font-size: 13px; color: #f0fdf4; margin-bottom: 2px; }
.safety-list small { display: block; font-size: 11px; line-height: 1.5; color: rgba(233, 245, 238, 0.62); }
.safety-ico {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.26);
  color: #a7f3d0;
  font-size: 15px;
}
.safety-screen .btn-primary { width: 100%; margin-top: 4px; }
.safety-screen .fineprint { color: rgba(233, 245, 238, 0.42); }

/* ---------- экран возвращения ---------- */
.welcome-card {
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.welcome-head { display: flex; align-items: center; gap: 14px; }
.welcome-portrait {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(52, 211, 153, 0.18), rgba(9, 17, 13, 0.9));
  border: 1px solid rgba(52, 211, 153, 0.28);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.45);
}
.welcome-portrait img { width: 100%; height: 100%; object-fit: contain; padding: 5px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); }
.welcome-meta { min-width: 0; }
.welcome-meta small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(167, 243, 208, 0.62); margin-bottom: 4px; }
.welcome-meta h2 { font-size: 26px; line-height: 1.05; letter-spacing: -0.03em; font-weight: 900; color: #f0fdf4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.welcome-meta p { margin-top: 4px; font-size: 12px; color: rgba(233, 245, 238, 0.62); }
.welcome-spirit {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.18);
  font-size: 12px;
  font-weight: 600;
  color: #a7f3d0;
}
.welcome-new { min-height: 38px; font-size: 12px; color: rgba(233, 245, 238, 0.62); }
.welcome-auth {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(233, 245, 238, 0.08);
  width: 100%;
  text-align: center;
}
.welcome-auth .start-auth-label { justify-content: center; }
.welcome-auth .start-auth-note { text-align: center; }

/* ---------- выбор любимого духа ---------- */
.spirit-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.spirit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(233, 245, 238, 0.10);
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.spirit-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.42));
  transition: transform 0.15s ease;
}
.spirit-card b { font-size: 11px; font-weight: 800; line-height: 1.15; }
.spirit-card small { font-size: 9px; color: var(--muted); line-height: 1.2; text-align: center; }
.spirit-card.is-selected {
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.50);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.10);
  transform: translateY(-2px);
}
.spirit-card.is-selected img { transform: scale(1.06); }

/* ---------- туториал ---------- */
.tutorial {
  position: fixed;
  inset: 0;
  z-index: 115;
  pointer-events: none;
}
.tutorial-glow {
  position: absolute;
  border-radius: 20px;
  border: 2px solid rgba(110, 231, 183, 0.9);
  box-shadow: 0 0 0 9999px rgba(3, 8, 6, 0.58), 0 0 32px rgba(52, 211, 153, 0.35);
  transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}
.tutorial-card {
  position: absolute;
  left: 16px;
  right: 16px;
  width: min(440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px;
  pointer-events: auto;
  transition: top 0.25s ease, bottom 0.25s ease;
}
.tutorial-card.is-centered { top: 50%; transform: translateY(-50%); }
.tutorial-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6ee7b7;
  margin-bottom: 6px;
}
.tutorial-card h2 { font-size: 22px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 900; color: #f0fdf4; }
.tutorial-card p { margin-top: 7px; font-size: 13px; line-height: 1.6; color: rgba(233, 245, 238, 0.72); }
.tutorial-dots { display: flex; gap: 5px; margin-top: 12px; }
.tutorial-dots span { width: 18px; height: 4px; border-radius: 999px; background: rgba(233, 245, 238, 0.16); transition: background 0.2s ease, width 0.2s ease; }
.tutorial-dots span.on { width: 28px; background: #34d399; }
.tutorial-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tutorial-actions .btn-ghost { font-size: 12px; color: rgba(233, 245, 238, 0.55); padding: 8px 10px; }
.tutorial-actions .btn-primary { min-width: 130px; }

/* ---------- фото с духом ---------- */
#btn-photo { color: var(--ink); }
.photo-flash {
  position: fixed;
  inset: 0;
  z-index: 125;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.photo-flash.on { animation: photoFlash 0.42s ease; }
@keyframes photoFlash {
  0% { opacity: 0; }
  12% { opacity: 0.85; }
  100% { opacity: 0; }
}

@media (max-width: 380px) {
  .spirit-card img { width: 48px; height: 48px; }
  .spirit-card b { font-size: 10px; }
  .spirit-card small { display: none; }
  .welcome-portrait { flex-basis: 68px; width: 68px; height: 68px; }
  .welcome-meta h2 { font-size: 22px; }
}

/* ---------- любимый дух в настройках ---------- */
.favorite-mini {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(52, 211, 153, 0.14), rgba(9, 17, 13, 0.9));
  border: 1px solid rgba(52, 211, 153, 0.22);
  overflow: hidden;
}
.favorite-mini img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.favorite-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.favorite-grid .spirit-card { gap: 4px; padding: 14px 8px 12px; }
.favorite-grid .spirit-card img { width: 82px; height: 82px; }
.favorite-grid .spirit-card .type-chip { margin-top: 4px; font-size: 9px; padding: 2px 8px; }

/* ---------- что нового ---------- */
.news-hero {
  width: 54px;
  height: 54px;
  margin: 2px auto 10px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 24px;
  color: #04140d;
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.news-lead { text-align: center; color: rgba(233, 245, 238, 0.62); margin-bottom: 14px; }
.news-list { display: flex; flex-direction: column; gap: 9px; }
.news-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(233, 245, 238, 0.08);
}
.news-item b { display: block; font-size: 13px; color: #f0fdf4; margin-bottom: 4px; }
.news-item p { font-size: 12px; line-height: 1.55; color: rgba(233, 245, 238, 0.66); margin: 0; }
