/* Хвостатое братство — демо-экран лагеря */

:root {
  --forest: #2f5d3a;
  --bark: #432b19;
  --bark-dark: #2a1b0f;
  --wood: #6b4423;
  --gold: #e8b13a;
  --amber: #f28c28;
  --cream: #f5e9d3;
  --red: #a8323a;
  --nav-h: 86px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html, body {
  height: 100%;
  background: var(--bark-dark);
  color: var(--cream);
  font-family: "Rubik", -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

img { -webkit-user-drag: none; user-select: none; }

/* ---------- Сцена ---------- */
.scene {
  position: fixed;
  inset: 0;
  height: 100dvh;
  background-color: var(--bark-dark);
  background-size: cover;
  background-position: center bottom;
  transition: filter .6s ease;
}

.scene.dim { filter: brightness(.55) saturate(.8); }

/* свет костра */
.fire-glow {
  position: absolute;
  left: 50%; top: 59%;
  width: 70vmin; height: 70vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,170,70,.35) 0%, rgba(255,140,40,.12) 35%, transparent 65%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: flicker 2.2s infinite;
  z-index: 0;
}
.scene[data-camp="2"] .fire-glow { left: 33%; top: 61%; }
.scene[data-camp="3"] .fire-glow { left: 50%; top: 61%; }
@keyframes flicker {
  0%, 100% { opacity: .85; transform: translate(-50%, -50%) scale(1); }
  20%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.04); }
  45%      { opacity: .7;  transform: translate(-50%, -50%) scale(.98); }
  70%      { opacity: .95; transform: translate(-50%, -50%) scale(1.02); }
}

/* светлячки */
.firefly {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #ffe9a0;
  box-shadow: 0 0 8px 3px rgba(255, 220, 120, .7);
  pointer-events: none;
  animation: drift var(--d, 7s) ease-in-out infinite, blink var(--b, 2.5s) ease-in-out infinite;
  z-index: 0;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(var(--x1, 14px), var(--y1, -18px)); }
  66%      { transform: translate(var(--x2, -10px), var(--y2, 10px)); }
}
@keyframes blink { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

/* ---------- Герои ---------- */
.hero {
  position: absolute;
  left: var(--x);
  width: var(--w);
  bottom: calc(var(--b) + var(--nav-h) + var(--safe-b));
  margin-bottom: calc(var(--w) * -0.031);  /* в PNG под ногами 3% пустоты */
  z-index: var(--z, 2);
  cursor: pointer;
  transition: transform 1.6s ease-in, opacity .4s;
}

.hero .body { position: relative; transform-origin: 50% 97%; }

.hero.idle .body { animation: breathe var(--br, 2.8s) ease-in-out infinite; animation-delay: var(--bd, 0s); }
@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50%      { transform: scale(1.012, 1.025); }
}

.hero.bounce .body { animation: bounce .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes bounce {
  0%   { transform: scale(1, 1); }
  25%  { transform: scale(1.08, .9); }
  55%  { transform: translateY(-9%) scale(.96, 1.06); }
  100% { transform: scale(1, 1); }
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(1px 0 0 #1c1209) drop-shadow(-1px 0 0 #1c1209)
    drop-shadow(0 1px 0 #1c1209) drop-shadow(0 -1px 0 #1c1209);
}

/* тень под ногами */
.hero::before {
  content: "";
  position: absolute;
  left: 20%; right: 20%;
  bottom: 1.5%;
  height: 5%;
  background: radial-gradient(ellipse at center, rgba(8, 6, 4, .7), transparent 70%);
  z-index: -1;
}

/* ходьба: подпрыгивание в такт шагам */
.hero.walking .body { animation: walk .42s ease-in-out infinite; }
@keyframes walk {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-5%) rotate(3deg); }
}
.hero.away { opacity: 0; }

/* реплика героя */
.bubble {
  position: absolute;
  left: 50%; bottom: 96%;
  transform: translateX(-50%) scale(.6);
  transform-origin: 50% 100%;
  background: var(--cream);
  color: var(--bark-dark);
  font: 600 13px/1.25 "Rubik", sans-serif;
  padding: 7px 11px;
  border-radius: 12px;
  border: 2px solid var(--bark-dark);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1);
  z-index: 20;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--bark-dark);
}
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }

/* ---------- Верхняя панель ---------- */
.topbar {
  position: fixed;
  top: calc(10px + var(--safe-t));
  left: 12px; right: 12px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  z-index: 30;
}

.res {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 40px;
  padding: 0 10px 0 4px;
  background: linear-gradient(#4d3220, #33210f);
  border: 2px solid #1c1209;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 3px 0 rgba(0,0,0,.35);
  border-radius: 20px;
}
.res { cursor: pointer; }
.res img { width: 34px; height: 34px; flex: none; }
.res .num {
  font: 700 16px/1 "Rubik", sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}
.res .max { font-size: 11px; opacity: .65; font-weight: 500; }
.res.pulse { animation: pulse .35s ease; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.res.shake { animation: shake .4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.camp-title {
  position: fixed;
  top: calc(60px + var(--safe-t));
  left: 0; right: 0;
  text-align: center;
  font-family: "Neucha", "Rubik", cursive;
  font-size: 26px;
  color: var(--cream);
  text-shadow: 0 2px 0 #1c1209, 0 0 14px rgba(0,0,0,.6);
  z-index: 25;
  pointer-events: none;
}
.camp-title button {
  pointer-events: auto;
  padding: 0 12px;
  border: 0; background: none;
  font: inherit; color: inherit; text-shadow: inherit;
  cursor: pointer;
}
.camp-title small {
  display: block;
  font-family: "Rubik", sans-serif;
  font-size: 12px;
  opacity: .8;
  letter-spacing: .04em;
}

/* ---------- Нижнее меню ---------- */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 10px 8px calc(8px + var(--safe-b));
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr 1fr 1fr;
  align-items: end;
  gap: 4px;
  background: linear-gradient(#4a301d, #2a1b0f);
  border-top: 3px solid #1c1209;
  box-shadow: 0 -2px 0 rgba(232,177,58,.35) inset;
  z-index: 40;
}

.nav button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--cream);
  font: 600 11px/1.1 "Rubik", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  cursor: pointer;
}
.nav .plate {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(#f5e9d3, #d9c3a0);
  border: 2px solid #1c1209;
  box-shadow: 0 3px 0 #1c1209;
  transition: transform .1s;
}
.nav .plate img { width: 38px; height: 38px; }
.nav button:active .plate { transform: translateY(2px); box-shadow: 0 1px 0 #1c1209; }

.nav .raid-btn { position: relative; margin-top: -46px; }
.nav .raid-btn .plate {
  width: 74px; height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ffd27a, var(--amber) 60%, #b55d12);
  border: 3px solid #1c1209;
  box-shadow: 0 4px 0 #1c1209, 0 0 0 4px rgba(232,177,58,.35);
  animation: glow 2s ease-in-out infinite;
}
.nav .raid-btn .plate img { width: 52px; height: 52px; }
.nav .raid-btn span { font-size: 13px; font-weight: 700; color: var(--gold); text-shadow: 0 1px 0 #000; }
.nav .raid-btn .cost { font-size: 10px; color: var(--cream); opacity: .85; font-weight: 500; }
@keyframes glow {
  50% { box-shadow: 0 4px 0 #1c1209, 0 0 0 8px rgba(232,177,58,.15), 0 0 24px rgba(242,140,40,.6); }
}
.nav .raid-btn[disabled] { opacity: .5; }
.nav .raid-btn[disabled] .plate { animation: none; }

/* ---------- Окно набега ---------- */
.raid-card {
  position: fixed;
  left: 50%; top: 46%;
  width: min(88vw, 360px);
  transform: translate(-50%, -50%) scale(.85);
  opacity: 0;
  pointer-events: none;
  background: var(--cream);
  color: var(--bark-dark);
  border: 3px solid #1c1209;
  border-radius: 20px;
  box-shadow: 0 6px 0 #1c1209, 0 20px 40px rgba(0,0,0,.5);
  overflow: hidden;
  transition: opacity .3s, transform .35s cubic-bezier(.3,1.5,.5,1);
  z-index: 50;
}
.raid-card.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

.raid-card .road {
  height: 150px;
  background-size: cover;
  background-position: center 60%;
  position: relative;
  border-bottom: 3px solid #1c1209;
}
.raid-card .road::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,.45));
}
.raid-card .road h3 {
  position: absolute;
  left: 14px; bottom: 10px;
  font-family: "Neucha", "Rubik", cursive;
  font-size: 24px;
  color: var(--cream);
  text-shadow: 0 2px 0 #000;
  z-index: 1;
}
.raid-card .inner { padding: 14px 16px 18px; }
.raid-card p { font-size: 14px; line-height: 1.4; margin-bottom: 12px; }

.squad { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.squad img {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid #1c1209;
  background: #c9b48e;
}

.track {
  position: relative;
  height: 18px;
  border-radius: 9px;
  background: #d9c3a0;
  border: 2px solid #1c1209;
  overflow: visible;
}
.track .fill {
  height: 100%;
  width: 0%;
  border-radius: 7px;
  background: linear-gradient(90deg, #5f8f3e, #8dbb4f);
}
.track .runner {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 40px; height: 40px;
  transform: translate(-50%, -62%);
  animation: hop .4s ease-in-out infinite;
}
@keyframes hop { 50% { margin-top: -5px; } }
.track .goal {
  position: absolute;
  right: -10px; top: 50%;
  width: 34px; height: 34px;
  transform: translateY(-58%);
}
.timer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}
.timer b { font-variant-numeric: tabular-nums; font-size: 16px; }

.btn {
  appearance: none;
  width: 100%;
  margin-top: 14px;
  padding: 13px 0;
  border: 3px solid #1c1209;
  border-radius: 14px;
  font: 700 17px/1 "Rubik", sans-serif;
  color: #1c1209;
  background: linear-gradient(#ffd27a, var(--gold));
  box-shadow: 0 4px 0 #1c1209;
  cursor: pointer;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1c1209; }
.btn.ghost { background: #e9dcc3; font-size: 14px; padding: 10px 0; }

/* ---------- Добыча ---------- */
.loot {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 20%);
  width: 34vmin;
  max-width: 170px;
  transform: translate(-50%, -140vh);
  z-index: 45;
  pointer-events: none;
}
.loot.drop { animation: drop .8s cubic-bezier(.3,1.4,.5,1) forwards; pointer-events: auto; cursor: pointer; }
@keyframes drop {
  0%   { transform: translate(-50%, -140vh) rotate(-12deg); }
  70%  { transform: translate(-50%, 0) rotate(4deg) scale(1.05, .92); }
  100% { transform: translate(-50%, 0) rotate(0) scale(1); }
}
.loot img { width: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.loot.wiggle { animation: wiggle 1.2s ease-in-out infinite; pointer-events: auto; cursor: pointer; }
@keyframes wiggle {
  0%, 100% { transform: translate(-50%, 0) rotate(0); }
  10% { transform: translate(-50%, 0) rotate(-6deg); }
  20% { transform: translate(-50%, 0) rotate(6deg); }
  30% { transform: translate(-50%, 0) rotate(0); }
}
.loot .tag {
  position: absolute;
  left: 50%; top: -14px;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1c1209;
  font: 700 13px/1 "Rubik", sans-serif;
  padding: 6px 10px;
  border: 2px solid #1c1209;
  border-radius: 10px;
  white-space: nowrap;
}

.fly-coin {
  position: fixed;
  width: 34px; height: 34px;
  z-index: 60;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5));
}

.plus {
  position: fixed;
  z-index: 61;
  font: 800 22px/1 "Rubik", sans-serif;
  color: var(--gold);
  text-shadow: 0 2px 0 #1c1209, 0 0 8px rgba(0,0,0,.6);
  pointer-events: none;
  animation: rise 1.2s ease-out forwards;
}
@keyframes rise { to { transform: translateY(-40px); opacity: 0; } }

/* ---------- Уведомление ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 28px);
  transform: translate(-50%, 20px);
  background: rgba(28, 18, 9, .92);
  color: var(--cream);
  border: 2px solid var(--gold);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 70;
  max-width: 86vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.demo-badge {
  position: fixed;
  right: 12px;
  top: calc(60px + var(--safe-t));
  font: 700 10px/1 "Rubik", sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--red);
  color: var(--cream);
  border: 2px solid #1c1209;
  z-index: 30;
}

/* ---------- Сова на посту ---------- */
.hero.watching .body { animation: watch 7s ease-in-out infinite; }
@keyframes watch {
  0%, 8%    { transform: scaleX(1) rotate(0); }
  12%       { transform: scaleX(1) rotate(-4deg) translateY(-1%); }   /* привстаёт, смотрит на дорогу */
  30%       { transform: scaleX(1) rotate(-4deg) translateY(-1%); }
  36%, 44%  { transform: scaleX(1) rotate(0); }
  48%       { transform: scaleX(-1) rotate(0); }                      /* оглядывается назад */
  62%       { transform: scaleX(-1) rotate(3deg); }
  70%, 76%  { transform: scaleX(-1) rotate(0); }
  80%, 100% { transform: scaleX(1) rotate(0); }
}

/* ---------- Мини-панель набега ---------- */
.raid-mini {
  position: fixed;
  left: 50%;
  top: calc(104px + var(--safe-t));
  transform: translateX(-50%);
  width: min(88vw, 340px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  text-align: left;
  color: var(--cream);
  font-family: "Rubik", sans-serif;
  background: linear-gradient(rgba(77, 50, 32, .95), rgba(42, 27, 15, .95));
  border: 2px solid #1c1209;
  border-radius: 16px;
  box-shadow: 0 3px 0 #1c1209, 0 8px 20px rgba(0,0,0,.4);
  cursor: pointer;
  z-index: 35;
  animation: mini-in .35s cubic-bezier(.3,1.5,.5,1);
}
.raid-mini[hidden] { display: none; }
@keyframes mini-in { from { transform: translateX(-50%) translateY(-12px); opacity: 0; } }
.raid-mini img {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #c9b48e;
}
.mini-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mini-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.mini-head b { font-weight: 700; color: var(--gold); }
.mini-head span { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.mini-bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.mini-bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #5f8f3e, #8dbb4f);
  transition: width .2s linear;
}
.mini-text { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.squad-note {
  align-self: center;
  font-size: 11px;
  line-height: 1.2;
  opacity: .7;
  margin-left: 2px;
}

.sound-btn {
  position: fixed;
  left: 12px;
  top: calc(58px + var(--safe-t));
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid #1c1209;
  background: linear-gradient(#4d3220, #33210f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 0 rgba(0,0,0,.35);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 30;
}
.sound-btn.off { opacity: .55; }
.sound-btn:focus-visible, .nav button:focus-visible, .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}

/* ---------- Барон ---------- */
.baron {
  position: fixed;
  right: -6vw;
  top: calc(24% + var(--safe-t));
  width: min(62vw, 300px);
  transform: translateX(130%);
  transition: transform .5s cubic-bezier(.3,1.3,.5,1);
  z-index: 38;
  pointer-events: none;
}
.baron.in { transform: translateX(0); }
.baron img {
  width: 100%;
  display: block;
  transform-origin: 50% 100%;
  filter:
    drop-shadow(1px 0 0 #1c1209) drop-shadow(-1px 0 0 #1c1209)
    drop-shadow(0 1px 0 #1c1209) drop-shadow(0 -1px 0 #1c1209)
    drop-shadow(0 8px 12px rgba(0,0,0,.5));
}
.baron.angry.in img { animation: tantrum .3s ease-in-out 6; }
@keyframes tantrum {
  0%, 100% { transform: rotate(0) translateY(0); }
  25%      { transform: rotate(-5deg) translateY(-4%); }
  75%      { transform: rotate(5deg) translateY(-2%); }
}
.baron.broke img { filter: drop-shadow(0 8px 12px rgba(0,0,0,.5)) saturate(.75); animation: slump 2.4s ease-in-out infinite; }
@keyframes slump { 50% { transform: translateY(2%) scaleY(.98); } }

.baron-bubble {
  position: absolute;
  right: 70%;
  top: 6%;
  width: max-content;
  max-width: 54vw;
  background: #fff4e2;
  color: var(--red);
  font: 700 14px/1.25 "Rubik", sans-serif;
  padding: 8px 12px;
  border: 2px solid #1c1209;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 3px 0 #1c1209;
  opacity: 0;
  transform: scale(.6);
  transform-origin: 100% 100%;
  transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1);
}
.baron-bubble.show { opacity: 1; transform: scale(1); }
.baron.broke .baron-bubble { color: var(--bark-dark); font-weight: 600; }

/* пар из ушей, когда злится */
.steam { position: absolute; left: 30%; top: 2%; width: 40%; height: 20%; opacity: 0; }
.baron.angry.in .steam { opacity: 1; }
.steam i {
  position: absolute;
  bottom: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  animation: puff 1s ease-out infinite;
}
.steam i:nth-child(1) { left: 0; }
.steam i:nth-child(2) { left: 45%; animation-delay: .33s; }
.steam i:nth-child(3) { right: 0; animation-delay: .66s; }
@keyframes puff {
  0%   { transform: translateY(0) scale(.4); opacity: .9; }
  100% { transform: translateY(-46px) scale(1.4); opacity: 0; }
}

/* ---------- Карта Зеленолесья ---------- */
.map {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  background: #2a1b0f;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .3s ease, transform .3s ease;
}
.map.open { opacity: 1; transform: scale(1); }
.map[hidden] { display: none; }

/* сцена держит пропорцию 9:16 и заполняет экран, как фон — точки стоят на своих местах */
.map-stage {
  position: absolute;
  left: 50%; top: 50%;
  width: max(100vw, calc(100dvh * 9 / 16));
  aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%);
}
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-path { display: none; }

/* временная карта, пока нет нарисованного фона */
.map-stage.placeholder {
  background:
    radial-gradient(ellipse 30% 18% at 25% 30%, rgba(47, 93, 58, .55), transparent 70%),
    radial-gradient(ellipse 28% 20% at 70% 60%, rgba(47, 93, 58, .5), transparent 70%),
    radial-gradient(ellipse 35% 15% at 40% 90%, rgba(47, 93, 58, .45), transparent 70%),
    radial-gradient(ellipse 25% 18% at 85% 20%, rgba(47, 93, 58, .45), transparent 70%),
    radial-gradient(ellipse at center, #ead7ae 0%, #d8bd88 65%, #9c7b4a 100%);
}
.map-stage.placeholder .map-bg { display: none; }
.map-stage.placeholder .map-path { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.map-path path {
  fill: none;
  stroke: #6b4423;
  stroke-width: .9;
  stroke-dasharray: 2 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-width: 4px;
}

.map-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 12px 18px;
  background: linear-gradient(rgba(28, 18, 9, .85), rgba(28, 18, 9, 0));
  z-index: 3;
}
.map-close {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  border: 2px solid #1c1209;
  background: linear-gradient(#f5e9d3, #d9c3a0);
  color: #1c1209;
  font: 700 26px/1 "Rubik", sans-serif;
  box-shadow: 0 3px 0 #1c1209;
  cursor: pointer;
}
.map-title { flex: 1; min-width: 0; color: var(--cream); text-shadow: 0 2px 0 #1c1209; }
.map-title b { display: block; font: 400 24px/1.1 "Neucha", "Rubik", cursive; }
.map-title small { font-size: 12px; opacity: .85; }
.glory-pill {
  display: flex; align-items: center; gap: 4px;
  height: 36px; padding: 0 10px 0 2px;
  border-radius: 18px;
  background: linear-gradient(#4d3220, #33210f);
  border: 2px solid #1c1209;
  color: var(--cream);
  font: 700 15px/1 "Rubik", sans-serif;
  font-variant-numeric: tabular-nums;
}
.glory-pill img { width: 32px; height: 32px; }
.glory-pill.pulse { animation: pulse .35s ease; }

/* точки локаций */
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.pin .medal {
  position: relative;
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 35%, #fff4dc, #d9c3a0);
  border: 3px solid #1c1209;
  box-shadow: 0 4px 0 #1c1209, 0 0 0 4px rgba(232, 177, 58, .55);
  transition: transform .15s;
  animation: bob 3s ease-in-out infinite;
}
.pin:nth-child(2) .medal { animation-delay: -.6s; }
.pin:nth-child(3) .medal { animation-delay: -1.2s; }
.pin:nth-child(4) .medal { animation-delay: -1.8s; }
.pin:nth-child(5) .medal { animation-delay: -2.4s; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.pin .medal img { width: 46px; height: 46px; object-fit: contain; }
.pin.camp .medal img, .pin[data-id="castle"] .medal img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pin:active .medal { transform: scale(.94); }
.pin-label {
  font: 700 12px/1.1 "Rubik", sans-serif;
  color: var(--cream);
  background: rgba(28, 18, 9, .82);
  border: 1.5px solid #1c1209;
  padding: 3px 7px;
  border-radius: 8px;
  white-space: nowrap;
}
.pin.camp .medal { width: 50px; height: 50px; box-shadow: 0 3px 0 #1c1209; animation: none; }

.pin.locked .medal { filter: grayscale(.85) brightness(.75); box-shadow: 0 4px 0 #1c1209; animation: none; }
.pin.locked .pin-label { opacity: .8; }
.pin .lock {
  position: absolute;
  top: -8px; right: -14px;
  display: flex; align-items: center; gap: 1px;
  padding: 2px 6px 2px 1px;
  border-radius: 10px;
  background: #1c1209;
  color: var(--gold);
  font: 700 11px/1 "Rubik", sans-serif;
}
.pin .lock .i { width: 18px; height: 18px; }

.pin.here .medal { box-shadow: 0 4px 0 #1c1209, 0 0 0 4px var(--amber); }
.pin.here .medal::after {
  content: "";
  position: absolute;
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 3px solid var(--amber);
  animation: ring 1.4s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }

/* карточка локации */
.sheet {
  position: absolute;
  left: 50%; bottom: 0;
  width: min(100%, 480px);
  transform: translate(-50%, 105%);
  transition: transform .3s cubic-bezier(.3,1.2,.5,1);
  background: var(--cream);
  color: var(--bark-dark);
  border: 3px solid #1c1209;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.45);
  padding: 0 0 calc(16px + var(--safe-b));
  max-height: 78dvh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 4;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet[hidden] { display: none; }
.sheet-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid #1c1209;
  background: rgba(245, 233, 211, .92);
  color: #1c1209;
  font: 700 16px/1 "Rubik", sans-serif;
  cursor: pointer;
  z-index: 2;
}
.sheet-art {
  height: 150px;
  background-size: cover;
  background-position: center 60%;
  background-color: #6b4423;
  border-bottom: 3px solid #1c1209;
  border-radius: 19px 19px 0 0;
  position: relative;
}
.sheet-art::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(transparent 45%, rgba(0,0,0,.55));
}
.sheet-art h3 {
  position: absolute; left: 16px; bottom: 10px; z-index: 1;
  font: 400 26px/1.1 "Neucha", "Rubik", cursive;
  color: var(--cream);
  text-shadow: 0 2px 0 #000;
}
#sheet-body > *:not(.sheet-art) { margin-left: 16px; margin-right: 16px; }
#sheet-body > .btn { width: calc(100% - 32px); display: block; }
.sheet-desc { margin-top: 14px; font-size: 14px; line-height: 1.45; }
.sheet .i { width: 22px; height: 22px; vertical-align: -6px; margin-right: 1px; }

.stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stats div {
  background: #ead8b8;
  border: 2px solid #1c1209;
  border-radius: 12px;
  padding: 7px 10px;
  min-width: 0;
}
.stats div:nth-child(1), .stats div:nth-child(4) { grid-column: 1 / -1; }
.stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.stats dd { font: 700 15px/1.4 "Rubik", sans-serif; font-variant-numeric: tabular-nums; }
.btn[disabled] { opacity: .55; cursor: default; }

.unlock { margin-top: 14px; }
.unlock-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.unlock-row b { font-variant-numeric: tabular-nums; }
.unlock-bar { margin-top: 6px; height: 12px; border-radius: 6px; background: #d9c3a0; border: 2px solid #1c1209; overflow: hidden; }
.unlock-bar span { display: block; height: 100%; background: linear-gradient(90deg, #c98a1a, var(--gold)); }
.hint { margin-top: 10px; font-size: 13px; opacity: .8; }
.hint b { font-variant-numeric: tabular-nums; }

.donate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.donate .btn { margin-top: 6px; padding: 10px 0 8px; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.donate .btn small { font-size: 11px; font-weight: 500; opacity: .8; }

/* «новое на карте» — значок на кнопке набега */
.raid-btn.has-news .plate::after {
  content: "!";
  position: absolute;
  top: -2px; right: -2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #1c1209;
  color: var(--cream);
  font: 800 13px/18px "Rubik", sans-serif;
  text-align: center;
}
.nav .raid-btn .plate { position: relative; }

/* на нарисованной карте точки поменьше, чтобы не закрывать здания */
.map-stage:not(.placeholder) .pin .medal { width: 50px; height: 50px; }
.map-stage:not(.placeholder) .pin .medal img { width: 36px; height: 36px; }
.map-stage:not(.placeholder) .pin.camp .medal { width: 42px; height: 42px; }
.map-stage:not(.placeholder) .pin.here .medal::after { width: 50px; height: 50px; }
.map-stage:not(.placeholder) .pin-label { font-size: 11px; }

/* ---------- Бой с мини-боссом ---------- */
.fight-call {
  margin: 0 0 12px;
  background: linear-gradient(#ff8a5c, var(--red));
  color: var(--cream);
  text-shadow: 0 1px 0 #1c1209;
  animation: call 1s ease-in-out infinite;
}
@keyframes call { 50% { transform: scale(1.03); box-shadow: 0 4px 0 #1c1209, 0 0 18px rgba(168, 50, 58, .7); } }
.fight-call[hidden], .fight-line[hidden] { display: none; }
.fight-line {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #e3efd2;
  border: 2px solid #4b7a2e;
  font-size: 13px;
  font-weight: 600;
}
.raid-mini.alarm { border-color: var(--red); animation: mini-alarm .8s ease-in-out infinite; }
.raid-mini.alarm .mini-head b { color: #ff9a8a; }
@keyframes mini-alarm { 50% { box-shadow: 0 3px 0 #1c1209, 0 0 0 4px rgba(168, 50, 58, .55), 0 8px 20px rgba(0,0,0,.4); } }

.fight {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-t)) 16px calc(18px + var(--safe-b));
  background: #1c1209;
  opacity: 0;
  transition: opacity .25s;
  overflow: hidden;
  touch-action: manipulation;
}
.fight.open { opacity: 1; }
.fight[hidden] { display: none; }
.fight-bg {
  position: absolute; inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(.45) saturate(.8);
}
.fight > *:not(.fight-bg):not(.fight-result) { position: relative; }

.fight-top { width: min(100%, 420px); text-align: center; }
.boss-name {
  font: 400 30px/1.1 "Neucha", "Rubik", cursive;
  color: var(--cream);
  text-shadow: 0 2px 0 #000;
  margin-bottom: 8px;
}
.hp {
  position: relative;
  height: 22px;
  border-radius: 11px;
  background: #2a1b0f;
  border: 3px solid #1c1209;
  box-shadow: 0 3px 0 #000;
  overflow: hidden;
}
.hp span {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 100%;
  background: linear-gradient(#e2554d, var(--red));
  transition: width .12s ease-out;
}
.hp b {
  position: relative;
  font: 700 12px/16px "Rubik", sans-serif;
  color: var(--cream);
  text-shadow: 0 1px 0 #000;
  font-variant-numeric: tabular-nums;
}

.boss {
  flex: 1;
  width: min(92vw, 440px);
  min-height: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.boss img {
  max-width: 100%;
  max-height: 52dvh;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.6));
  animation: boss-idle 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes boss-idle { 50% { transform: translateY(-2%) scale(1.01); } }
.boss.hurt img { animation: boss-hurt .22s ease-out; }
@keyframes boss-hurt {
  0%   { transform: translateX(0) scale(1); filter: brightness(2.2) sepia(1) hue-rotate(-30deg) saturate(4) drop-shadow(0 10px 14px rgba(0,0,0,.6)); }
  40%  { transform: translateX(-4%) scale(.96, 1.03); }
  100% { transform: translateX(0) scale(1); }
}
.boss.down img { animation: boss-down .8s ease-in forwards; }
@keyframes boss-down { to { transform: rotate(-80deg) translate(-10%, 30%); opacity: 0; } }

.fight-hint {
  font: 600 15px/1.3 "Rubik", sans-serif;
  color: var(--cream);
  background: rgba(28, 18, 9, .8);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 8px 14px;
  animation: pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
.fight-hint[hidden] { display: none; }

.fight-bottom { width: min(100%, 420px); display: flex; flex-direction: column; gap: 10px; }
.fight-timer { height: 10px; border-radius: 5px; background: rgba(0,0,0,.5); border: 2px solid #1c1209; overflow: hidden; }
.fight-timer span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--amber)); }
.fight-squad { display: flex; justify-content: center; gap: 8px; }
.fight-squad img {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #c9b48e;
}
.fight-squad img.jab { animation: jab .25s ease-out; }
@keyframes jab { 40% { transform: translateY(-14px) scale(1.12); } }

.dmg {
  position: fixed;
  z-index: 95;
  font: 800 22px/1 "Rubik", sans-serif;
  color: var(--cream);
  text-shadow: 0 2px 0 #1c1209, 0 0 6px rgba(0,0,0,.7);
  pointer-events: none;
  animation: dmg-up .7s ease-out forwards;
}
.dmg.crit { color: #ffd27a; font-size: 26px; }
@keyframes dmg-up { to { transform: translateY(-60px) scale(1.2); opacity: 0; } }

.fight-result {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(86vw, 340px);
  background: var(--cream);
  color: var(--bark-dark);
  border: 3px solid #1c1209;
  border-radius: 20px;
  box-shadow: 0 6px 0 #1c1209, 0 20px 40px rgba(0,0,0,.6);
  padding: 18px 18px 16px;
  text-align: center;
  animation: pop .35s cubic-bezier(.3,1.5,.5,1);
}
.fight-result[hidden] { display: none; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }
.fight-result h3 { font: 400 32px/1.1 "Neucha", "Rubik", cursive; color: var(--red); }
.fight-result p { margin-top: 8px; font-size: 15px; line-height: 1.4; }

/* опасная локация и неудачный бой */
.risk {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f6dcd6;
  border: 2px solid var(--red);
  color: #5a1a1f;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}
.fight-line.bad { background: #f6dcd6; border-color: var(--red); }

/* ---------- Кузница Барсука ---------- */
.forge {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(10, 6, 3, .55);
  opacity: 0;
  transition: opacity .25s;
}
.forge.open { opacity: 1; }
.forge[hidden] { display: none; }
.forge-panel {
  position: absolute;
  left: 50%; bottom: 0;
  width: min(100%, 480px);
  max-height: 86dvh;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translate(-50%, 105%);
  transition: transform .3s cubic-bezier(.3,1.2,.5,1);
  background: var(--cream);
  color: var(--bark-dark);
  border: 3px solid #1c1209;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(18px + var(--safe-b));
}
.forge.open .forge-panel { transform: translate(-50%, 0); }
.forge-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.forge-head img { width: 58px; height: 58px; border-radius: 50%; border: 3px solid #1c1209; background: #c9b48e; flex: none; }
.forge-head b { display: block; font: 400 26px/1.1 "Neucha", "Rubik", cursive; }
.forge-head small { font-size: 13px; opacity: .75; }
.forge-wallet { margin: 12px 0 4px; font-size: 14px; }
.forge-wallet b { font-variant-numeric: tabular-nums; margin-right: 8px; }
.forge-wallet .i, .forge-list .i { width: 22px; height: 22px; vertical-align: -6px; }
.forge-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ride-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid #1c1209;
  border-radius: 16px;
  background: #ead8b8;
}
.ride-card.active { background: #e3efd2; border-color: #4b7a2e; box-shadow: 0 0 0 3px rgba(75, 122, 46, .25); }
.ride-card.old { opacity: .6; }
.ride-pic {
  width: 72px; height: 72px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #fff4dc, #d9c3a0);
  border: 2px solid #1c1209;
}
.ride-ico { width: 64px; height: 64px; object-fit: contain; }
.ride-emoji { font-size: 38px; line-height: 1; }
.ride-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ride-info b { font-size: 16px; }
.ride-info span { font-size: 13px; opacity: .8; }
.ride-info .btn { margin-top: 6px; padding: 9px 0; font-size: 14px; }
.ride-info .btn .i { width: 18px; height: 18px; vertical-align: -4px; }

/* транспорт стоит в лагере */
.camp-ride {
  position: absolute;
  right: 4%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 34%);
  width: 26vw;
  max-width: 130px;
  filter: drop-shadow(1px 0 0 #1c1209) drop-shadow(-1px 0 0 #1c1209) drop-shadow(0 6px 6px rgba(0,0,0,.5));
  z-index: 1;
  pointer-events: none;
}
.camp-ride[hidden] { display: none; }

/* время в карточке локации с учётом транспорта */
.faster { font-size: 13px; font-weight: 700; color: #3f6f22; margin-left: 6px; white-space: nowrap; }
.was { font-weight: 400; opacity: .55; text-decoration-thickness: 2px; }
.ride-line { margin: -4px 0 10px; font-size: 13px; font-weight: 600; color: #3f6f22; }
.ride-line[hidden] { display: none; }

/* ускорение за самоцветы */
.btn.rush { margin-top: 12px; background: linear-gradient(#b9e6ff, #6cb7e6); font-size: 15px; }
.btn.rush.confirm { background: linear-gradient(#ffe08a, var(--amber)); font-size: 13px; line-height: 1.25; padding: 10px 8px; }
.btn.rush[hidden] { display: none; }
.raid-card .btn.ghost { margin-top: 8px; }

/* ---------- Значок на кнопке меню ---------- */
.nav .plate { position: relative; }
.nav-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--red);
  border: 2px solid #1c1209;
  color: var(--cream);
  font: 800 11px/16px "Rubik", sans-serif;
  font-style: normal;
  text-align: center;
}
.nav-badge[hidden] { display: none; }

/* ---------- Награда за вход ---------- */
.daily {
  position: fixed; inset: 0; z-index: 88;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(10, 6, 3, .6);
  opacity: 0; transition: opacity .25s;
}
.daily.open { opacity: 1; }
.daily[hidden] { display: none; }
.daily-card {
  position: relative;
  width: min(100%, 380px);
  background: var(--cream);
  color: var(--bark-dark);
  border: 3px solid #1c1209;
  border-radius: 22px;
  box-shadow: 0 6px 0 #1c1209, 0 20px 40px rgba(0,0,0,.5);
  padding: 44px 16px 16px;
  text-align: center;
  transform: scale(.85);
  transition: transform .3s cubic-bezier(.3,1.5,.5,1);
}
.daily.open .daily-card { transform: scale(1); }
.daily-owl {
  position: absolute; left: 50%; top: -38px;
  width: 76px; height: 76px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 3px solid #1c1209;
  background: #c9b48e;
}
.daily-card h3 { font: 400 28px/1.1 "Neucha", "Rubik", cursive; }
.daily-card p { margin: 6px 0 12px; font-size: 14px; line-height: 1.4; }
.daily-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dcell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px;
  padding: 5px 2px;
  border: 2px solid #1c1209;
  border-radius: 12px;
  background: #ead8b8;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dcell small { font-size: 10px; font-weight: 500; opacity: .7; }
.dcell .i { width: 18px; height: 18px; vertical-align: -4px; }
.dcell.got { background: #e3efd2; opacity: .65; }
.dcell.today { background: linear-gradient(#ffe29a, var(--gold)); box-shadow: 0 0 0 3px rgba(232, 177, 58, .5); transform: scale(1.05); }
.dcell.chest { grid-column: span 1; }
.dcell.chest img { width: 34px; height: 34px; }

/* ---------- Задания ---------- */
.daily-row {
  width: 100%;
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 2px solid #1c1209;
  border-radius: 14px;
  background: #ead8b8;
  color: var(--bark-dark);
  text-align: left;
  cursor: pointer;
}
.daily-row.ready { background: linear-gradient(#ffe29a, var(--gold)); animation: call 1.2s ease-in-out infinite; }
.daily-row img { width: 40px; height: 40px; }
.daily-row span { flex: 1; display: flex; flex-direction: column; font-size: 15px; }
.daily-row small { font-size: 12px; opacity: .8; }
.daily-row i { font: 700 24px/1 "Rubik", sans-serif; font-style: normal; }
#quests-body h4 { margin: 16px 0 6px; font: 400 22px/1.1 "Neucha", "Rubik", cursive; }
#quests-body h4 small { font: 500 11px/1 "Rubik", sans-serif; opacity: .6; margin-left: 6px; }
.quest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 9px 10px;
  margin-bottom: 7px;
  border: 2px solid #1c1209;
  border-radius: 14px;
  background: #f1e3c8;
}
.quest.ready { background: #fff1c7; border-color: #b8860b; }
.quest.claimed { opacity: .55; }
.q-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-main b { font-size: 14px; line-height: 1.25; }
.q-reward { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.q-reward .i { width: 18px; height: 18px; vertical-align: -4px; }
.q-bar { grid-column: 1 / -1; grid-row: 2; height: 6px; border-radius: 3px; background: #d9c3a0; overflow: hidden; }
.q-bar span { display: block; height: 100%; background: linear-gradient(90deg, #5f8f3e, #8dbb4f); }
.q-action { grid-column: 2; grid-row: 1; text-align: right; }
.q-prog { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .75; white-space: nowrap; }
.q-done { font-size: 12px; font-weight: 600; color: #3f6f22; white-space: nowrap; }
.btn.q-claim { width: auto; margin: 0; padding: 8px 14px; font-size: 14px; }
.q-channel { display: flex; flex-direction: column; gap: 4px; }
.q-channel .btn { width: auto; margin: 0; padding: 6px 10px; font-size: 12px; }

/* ---------- Друзья ---------- */
.fr-how {
  margin: 14px 0 10px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px;
  border: 2px solid #1c1209;
  border-radius: 14px;
  background: #ead8b8;
  font-size: 14px; line-height: 1.35;
}
.fr-how > div { display: flex; gap: 10px; align-items: flex-start; }
.fr-how .i { width: 18px; height: 18px; vertical-align: -4px; }
.fr-step {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold); border: 2px solid #1c1209;
  font: 700 13px/1 "Rubik", sans-serif;
}
#friends-body > .btn { width: 100%; margin: 6px 0 0; }
.fr-income {
  margin-top: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 8px;
  border: 2px solid #1c1209;
  border-radius: 14px;
  background: #f1e3c8;
}
.fr-income.ready { background: linear-gradient(#ffe29a, var(--gold)); }
.fr-income img { width: 38px; height: 38px; }
.fr-income span { flex: 1; display: flex; flex-direction: column; font-size: 15px; min-width: 0; }
.fr-income small { font-size: 12px; opacity: .8; }
.fr-title { margin: 16px 0 6px; font: 400 22px/1.1 "Neucha", "Rubik", cursive; }
.fr-title small { font: 700 12px/1 "Rubik", sans-serif; opacity: .6; margin-left: 4px; }
.fr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  margin-bottom: 7px;
  border: 2px solid #1c1209;
  border-radius: 14px;
  background: #f1e3c8;
}
.fr-row.pending { opacity: .7; border-style: dashed; }
.fr-ava {
  position: relative; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #1c1209;
  background: #c98b4a; color: #fff6e2;
  display: grid; place-items: center; overflow: hidden;
  font: 700 18px/1 "Rubik", sans-serif;
}
.fr-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-main b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-main small { font-size: 12px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 700 14px/1.2 "Rubik", sans-serif; font-variant-numeric: tabular-nums; }
.fr-side small { font-size: 12px; color: #3f6f22; }
.fr-side .i { width: 18px; height: 18px; vertical-align: -4px; }
.fr-empty { margin: 10px 2px; font-size: 14px; opacity: .75; }
.fr-by { margin: 12px 2px 0; font-size: 13px; opacity: .8; }

/* ---------- Зал славы ---------- */
.lb-sticky {
  position: sticky; top: -16px; z-index: 2;
  margin: 6px -16px 2px;
  padding: 8px 16px;
  background: var(--cream);
}
.lb-tabs {
  margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 2px solid #1c1209; border-radius: 14px; overflow: hidden;
  background: #ead8b8;
}
.lb-tabs button {
  padding: 9px 4px;
  border: 0; border-left: 2px solid #1c1209;
  background: transparent; color: var(--bark-dark);
  font: 600 14px/1 "Rubik", sans-serif;
  cursor: pointer;
}
.lb-tabs button:first-child { border-left: 0; }
.lb-tabs button.on { background: linear-gradient(#ffe29a, var(--gold)); font-weight: 700; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  margin-bottom: 6px;
  border: 2px solid #1c1209;
  border-radius: 14px;
  background: #f1e3c8;
}
.lb-row.top { background: #fbeccb; }
.lb-row.me { background: linear-gradient(#ffe9ad, #f6cf6e); border-color: #8a5a10; box-shadow: 0 0 0 2px rgba(232, 177, 58, .45); }
.lb-place { flex: none; width: 30px; text-align: center; font: 700 16px/1 "Rubik", sans-serif; font-variant-numeric: tabular-nums; }
.lb-row.top .lb-place { font-size: 22px; }
.lb-score { flex: none; font: 700 15px/1 "Rubik", sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-score .i { width: 20px; height: 20px; vertical-align: -5px; margin-right: 2px; }
.lb-gap { text-align: center; font-weight: 700; opacity: .5; margin: -2px 0 4px; letter-spacing: .2em; }
.lb-note { margin: 0 2px 10px; font-size: 13px; line-height: 1.35; opacity: .8; }
.lb-mine {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 2px 10px;
  font-size: 14px;
}
.lb-mine b { font: 400 30px/1 "Neucha", "Rubik", cursive; color: #8a5a10; }
.lb-mine small { font-size: 13px; opacity: .75; }
#leaders-body > .btn { width: 100%; margin: 8px 0 0; }

/* ---------- Обучение (Сова) ---------- */
.coach {
  position: fixed; left: 10px; right: 10px; z-index: 92;
  bottom: calc(118px + var(--safe-b));
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 460px; margin: 0 auto;
  pointer-events: none;
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s;
}
.coach.top { bottom: auto; top: calc(64px + var(--safe-t, 0px)); }
.coach.show { opacity: 1; transform: none; }
.coach.away { opacity: 0 !important; }
.coach.away .coach-bubble { pointer-events: none; }
.coach[hidden] { display: none; }
.coach > img {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid #1c1209; background: #c9b48e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.coach-bubble {
  position: relative; flex: 1;
  padding: 10px 12px 8px;
  background: var(--cream); color: var(--bark-dark);
  border: 3px solid #1c1209; border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
  pointer-events: auto;
}
.coach-bubble::before {
  content: ""; position: absolute; left: -11px; bottom: 16px;
  border: 8px solid transparent; border-right: 10px solid #1c1209;
}
.coach-bubble p { margin: 0; font-size: 15px; line-height: 1.35; }
.coach-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.coach-skip { padding: 4px 0; border: 0; background: none; color: inherit; font: 500 12px/1 "Rubik", sans-serif; opacity: .55; text-decoration: underline; cursor: pointer; }
.btn#coach-next { width: auto; margin: 0; padding: 7px 16px; font-size: 14px; }
.coach-ring {
  position: fixed; z-index: 92;
  border: 3px solid var(--gold); border-radius: 18px;
  box-shadow: 0 0 0 4px rgba(232, 177, 58, .35), 0 0 22px rgba(255, 210, 122, .9);
  pointer-events: none;
  animation: coachRing 1.1s ease-in-out infinite;
}
.coach-ring[hidden] { display: none; }
@keyframes coachRing { 50% { box-shadow: 0 0 0 9px rgba(232, 177, 58, .15), 0 0 30px rgba(255, 210, 122, 1); } }

/* ---------- Лагерь: уровни ---------- */
.forge-sec { margin: 16px 0 6px; font: 400 22px/1.1 "Neucha", "Rubik", cursive; }
.forge-sec small { font: 500 12px/1 "Rubik", sans-serif; opacity: .6; margin-left: 4px; }
.camp-card {
  padding: 10px;
  border: 2px solid #1c1209;
  border-radius: 16px;
  background: #ead8b8;
  display: flex; flex-direction: column; gap: 8px;
}
.camp-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.camp-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 2px solid #1c1209; border-radius: 10px;
  background-size: cover; background-position: center 38%;
}
.camp-thumb i {
  position: absolute; left: 4px; top: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cream); border: 2px solid #1c1209;
  font: 700 11px/1 "Rubik", sans-serif; font-style: normal;
}
.camp-thumb.on { box-shadow: 0 0 0 3px var(--gold); }
.camp-thumb.on i { background: var(--gold); }
.camp-thumb.lock { filter: grayscale(.85) brightness(.7); }
.camp-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.camp-now b { font-size: 17px; }
.camp-now small { font-size: 12px; opacity: .65; }
.camp-now span, .camp-next span { flex-basis: 100%; font-size: 13px; }
.camp-card .i { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; }
.camp-next { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px dashed rgba(28, 18, 9, .35); }
.camp-next b { font-size: 15px; }
.camp-next .btn { margin: 6px 0 0; width: 100%; padding: 9px 0; font-size: 14px; }
.camp-max { margin: 0; font-size: 14px; font-weight: 600; color: #3f6f22; }
.scene.rebuild { animation: rebuild .9s ease; }
@keyframes rebuild {
  0% { filter: none; }
  35% { filter: brightness(2.2) saturate(.4) blur(2px); transform: scale(1.02); }
  100% { filter: none; transform: none; }
}

/* ---------- Банда ---------- */
#band-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.daily-row.ready { background: linear-gradient(#ffe29a, var(--gold)); }
.hero-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px;
  border: 2px solid #1c1209; border-radius: 16px;
  background: #ead8b8;
  scroll-margin: 16px;
}
.hero-card.focus { box-shadow: 0 0 0 3px var(--gold); }
.hero-card.locked .hero-port { filter: grayscale(.6) brightness(.85); }
.hero-card.levelup { animation: levelup .9s ease; }
@keyframes levelup { 30% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(232, 177, 58, .7); } }
.hero-port { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #1c1209; background: #c9b48e; object-fit: cover; }
.hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero-top b { font-size: 17px; }
.hero-info small { font-size: 12px; opacity: .65; }
.hero-talent { font-size: 13px; line-height: 1.35; }
.hero-talent b { color: #3f6f22; }
.hero-info .btn { margin: 6px 0 0; width: 100%; padding: 9px 0; font-size: 14px; }
.hero-info .btn .i { width: 18px; height: 18px; vertical-align: -4px; }
.pips { display: flex; gap: 3px; }
.pips i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #1c1209; background: #d9c3a0; }
.pips i.on { background: var(--gold); }
.hero[hidden] { display: none; }

/* ---------- Подсказки по ресурсам ---------- */
.res-tip {
  position: fixed; z-index: 75;
  top: calc(60px + var(--safe-t)); left: 12px; right: 12px;
  max-width: 460px; margin: 0 auto;
  padding: 12px 14px 14px;
  background: var(--cream); color: var(--bark-dark);
  border: 3px solid #1c1209; border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(-6px);
  transition: opacity .18s, transform .18s;
}
.res-tip.open { opacity: 1; transform: none; }
.res-tip[hidden] { display: none; }
.res-tip-arrow {
  position: absolute; top: -13px; width: 0; height: 0;
  border: 10px solid transparent; border-top: 0; border-bottom: 12px solid #1c1209;
  margin-left: -12px;
}
.res-tip-arrow::after {
  content: ""; position: absolute; left: -7px; top: 4px;
  border: 7px solid transparent; border-top: 0; border-bottom: 9px solid var(--cream);
}
.tip-head { display: flex; align-items: center; gap: 8px; }
.tip-head img { width: 36px; height: 36px; }
.tip-head b { font: 400 24px/1 "Neucha", "Rubik", cursive; }
.tip-head span { margin-left: auto; font-size: 13px; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.tip-live { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: #e3efd2; color: #2f5a17; font-size: 13px; font-weight: 600; }
.res-tip h5 { margin: 10px 0 3px; font: 700 11px/1 "Rubik", sans-serif; text-transform: uppercase; letter-spacing: .08em; opacity: .55; }
.res-tip ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.4; }
.res-tip li { margin: 2px 0; }
.res-tip .btn { width: 100%; margin: 12px 0 0; padding: 10px 0; font-size: 15px; }

/* ---------- Крепость Барона ---------- */
.pin-hp {
  display: block; width: 74px; height: 9px; margin: 3px auto 0;
  border: 2px solid #1c1209; border-radius: 6px; background: #3b1a12; overflow: hidden;
}
.pin-hp i { display: block; height: 100%; background: linear-gradient(90deg, #c0392b, #e8603a); }
.pin-hp.down i { background: #6b6b6b; }
.castle-hp { margin-top: 12px; }
.castle-bar {
  position: relative; height: 28px;
  border: 3px solid #1c1209; border-radius: 14px; background: #3b1a12; overflow: hidden;
}
.castle-bar span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ef6b4a, #b22a1d); transition: width .6s; }
.castle-bar b { position: relative; display: block; text-align: center; font: 700 14px/22px "Rubik", sans-serif; color: #fff4e0; text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.castle-hp small { display: block; margin-top: 4px; text-align: center; font-size: 12px; opacity: .7; }
.castle-hp.down .castle-bar span { background: #777; }
.castle-down { margin: 10px 0 0; padding: 8px 10px; border-radius: 12px; background: #e3efd2; color: #2f5a17; font-size: 14px; line-height: 1.35; }
.castle-me { margin: 10px 0 0; padding: 8px 10px; border: 2px dashed rgba(28, 18, 9, .4); border-radius: 12px; font-size: 14px; text-align: center; }
.btn.castle-go:not(:disabled) { background: linear-gradient(#ef7a55, #c0392b); color: #fff4e0; text-shadow: 0 1px 0 #5a120a; }
.btn.castle-go .i { width: 20px; height: 20px; vertical-align: -5px; }
.castle-card { padding-top: 110px; }
.cw-img { position: absolute; left: 50%; top: -70px; width: 170px; transform: translateX(-50%); filter: drop-shadow(0 8px 12px rgba(0,0,0,.6)); }
.cw-reward { display: flex; justify-content: center; gap: 14px; margin: 4px 0 12px; font: 700 22px/1 "Rubik", sans-serif; }
.cw-reward .i { width: 30px; height: 30px; vertical-align: -8px; margin-right: 3px; }

/* ---------- Нападение на лагерь ---------- */
.defend-call { background: linear-gradient(#7aa8d8, #2f5f9a); }
.camp-wolf {
  position: absolute; left: 2%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 18%);
  width: 34vw; max-width: 170px;
  padding: 0; border: 0; background: none;
  z-index: 6; cursor: pointer;
}
.camp-wolf[hidden] { display: none; }
.camp-wolf img { width: 100%; filter: drop-shadow(1px 0 0 #1c1209) drop-shadow(-1px 0 0 #1c1209) drop-shadow(0 6px 8px rgba(0,0,0,.6)); }
.camp-wolf.sneak { animation: wolfIn 1.4s ease-out both, wolfSneak 1.1s ease-in-out 1.4s infinite; }
@keyframes wolfIn { from { transform: translateX(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wolfSneak { 50% { transform: translateY(-3%) rotate(-2deg); } }
.camp-wolf::after {
  content: "!"; position: absolute; right: 10%; top: -6%;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red); color: #fff; border: 2px solid #1c1209;
  font: 700 18px/1 "Rubik", sans-serif;
  animation: call 1s ease-in-out infinite;
}

/* ---------- Банда на карте ---------- */
.band-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.band-trail.off { display: none; }
.band-trail polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#band-route { stroke: rgba(28, 18, 9, .55); stroke-width: 3; stroke-dasharray: 2 7; }
#band-done { stroke: var(--gold); stroke-width: 4; stroke-dasharray: 8 6; filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); }
.band-marker {
  position: absolute; z-index: 5;
  transform: translate(-50%, -78%);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
  transition: left .25s linear, top .25s linear;
}
.band-marker[hidden] { display: none; }
.band-medal {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid #1c1209; background: var(--gold);
  box-shadow: 0 4px 0 #1c1209, 0 0 0 4px rgba(232, 177, 58, .35);
  overflow: hidden;
}
.band-medal img { width: 100%; height: 100%; object-fit: cover; }
.band-marker.flip .band-medal img { transform: scaleX(-1); }
.band-marker.go .band-medal, .band-marker.back .band-medal { animation: bandWalk .5s ease-in-out infinite alternate; }
.band-marker.work .band-medal { animation: call 1s ease-in-out infinite; }
@keyframes bandWalk { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-4px) rotate(4deg); } }
.band-icon {
  position: absolute; right: -10px; top: -8px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cream); border: 2px solid #1c1209;
  font-size: 14px; font-style: normal;
}
.band-label {
  margin-top: 6px; padding: 3px 8px; border-radius: 10px;
  background: rgba(28, 18, 9, .85); color: var(--cream);
  font: 600 11px/1.2 "Rubik", sans-serif; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.raid-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.raid-actions .btn { margin: 0; width: 100%; font-size: 14px; }

/* ---------- Лавка Ворона ---------- */
.res { position: relative; }
.res-plus {
  margin-left: auto; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #1c1209;
  background: linear-gradient(#9be36b, #4f9a2b);
  color: #fff; font: 700 18px/1 "Rubik", sans-serif; text-shadow: 0 1px 0 #1c1209;
  display: grid; place-items: center; padding: 0 0 2px;
  cursor: pointer;
}
.shop-wallet { margin: 12px 0 8px; font-size: 14px; }
.shop-wallet .i { width: 22px; height: 22px; vertical-align: -6px; }
.shop-card {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 9px;
  border: 2px solid #1c1209; border-radius: 16px;
  background: #ead8b8;
}
.shop-card.starter { background: linear-gradient(135deg, #fff1c7, #f3cf72); border-color: #8a5a10; }
.shop-ico { width: 54px; height: 54px; flex: none; object-fit: contain; }
.shop-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shop-info b { font-size: 15px; }
.shop-info span { font: 700 14px/1.3 "Rubik", sans-serif; }
.shop-info .i { width: 18px; height: 18px; vertical-align: -4px; margin-right: 1px; }
.btn.shop-buy { width: auto; min-width: 92px; margin: 0; padding: 10px 12px; font-size: 16px; background: linear-gradient(#ffd96a, #f0a91c); }
.shop-bonus, .shop-ribbon {
  position: absolute; top: -9px; right: 12px;
  padding: 2px 8px; border-radius: 8px; border: 2px solid #1c1209;
  background: #4f9a2b; color: #fff; font: 700 11px/1.2 "Rubik", sans-serif;
}
.shop-ribbon { left: 12px; right: auto; background: var(--red); }
.shop-terms { margin: 10px 2px 0; font-size: 11px; line-height: 1.4; opacity: .6; text-align: center; }

/* ---------- Карточка персонажа ---------- */
.char {
  position: fixed; inset: 0; z-index: 89;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(10, 6, 3, .65);
  opacity: 0; transition: opacity .25s;
}
.char.open { opacity: 1; }
.char[hidden] { display: none; }
.char-card {
  position: relative;
  width: min(100%, 400px); max-height: 92dvh; overflow-y: auto;
  background: var(--cream); color: var(--bark-dark);
  border: 3px solid #1c1209; border-radius: 22px;
  box-shadow: 0 6px 0 #1c1209, 0 20px 40px rgba(0,0,0,.5);
  transform: scale(.9); transition: transform .3s cubic-bezier(.3,1.5,.5,1);
}
.char.open .char-card { transform: scale(1); }
.char-card .sheet-close { z-index: 2; }
.char-art {
  height: 230px; display: grid; place-items: end center;
  background: radial-gradient(circle at 50% 70%, #6f8f4a 0%, #3c5a2a 55%, #22331a 100%);
  border-bottom: 3px solid #1c1209; border-radius: 19px 19px 0 0; overflow: hidden;
}
.char-card.enemy .char-art { background: radial-gradient(circle at 50% 70%, #8a3a2e 0%, #4e1d17 55%, #24100c 100%); }
.char-art img { height: 225px; width: auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,.6)); }
.char-body { padding: 12px 16px 16px; }
.char-tag {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  border: 2px solid #1c1209; background: #9bc46a;
  font: 700 11px/1.2 "Rubik", sans-serif; text-transform: uppercase; letter-spacing: .05em;
}
.char-card.enemy .char-tag { background: #e27a5f; color: #fff; }
.char-body h3 { margin: 8px 0 0; font: 400 30px/1.05 "Neucha", "Rubik", cursive; }
.char-title { display: block; font-size: 13px; opacity: .7; }
.char-lore { margin: 10px 0 0; font-size: 14px; line-height: 1.45; font-style: italic; }
.char-stats { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.char-stats div { padding: 7px 10px; border: 2px solid #1c1209; border-radius: 12px; background: #ead8b8; }
.char-stats dt { font: 700 10px/1 "Rubik", sans-serif; text-transform: uppercase; letter-spacing: .07em; opacity: .55; }
.char-stats dd { margin: 3px 0 0; font-size: 14px; line-height: 1.35; }
.char-stats .pips { display: inline-flex; vertical-align: -1px; margin-right: 4px; }
.char-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.char-actions .btn { width: 100%; margin: 0; font-size: 15px; }
.char-actions .btn .i { width: 18px; height: 18px; vertical-align: -4px; }
.info-i {
  display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 2px;
  border-radius: 50%; border: 1.5px solid #1c1209; font: 700 10px/1 "Rubik", sans-serif; font-style: normal;
  vertical-align: 2px; opacity: .6;
}
.hero-port, .hero-top { cursor: pointer; }
.enemy-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; margin-bottom: 7px;
  border: 2px solid #1c1209; border-radius: 14px;
  background: #e9cfc2; color: var(--bark-dark); text-align: left; cursor: pointer;
}
.enemy-row img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #1c1209; background: #7a3b2e; object-fit: cover; }
.enemy-row span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.enemy-row b { font-size: 15px; }
.enemy-row small { font-size: 12px; opacity: .7; }
.enemy-row i { font: 700 22px/1 "Rubik", sans-serif; font-style: normal; opacity: .6; }
.enemy-row.guard { margin: 10px 0 0; }

/* ---------- TAIL в верхней панели (4 показателя) ---------- */
.topbar { gap: 6px; }
.topbar .res { padding: 0 8px 0 3px; gap: 4px; }
.topbar .res img { width: 30px; height: 30px; }
.topbar .res .num { font-size: 15px; }
.topbar .res .max { font-size: 11px; }
.res-plus { width: 22px; height: 22px; font-size: 16px; }
.res-tail { flex: .85; }

/* ---------- Пасека ---------- */
.apiary-art {
  display: block; width: 100%; height: 130px; object-fit: cover; object-position: center 62%;
  margin-top: 12px; border: 2px solid #1c1209; border-radius: 14px;
}
.ap-hive { margin-top: 12px; padding: 12px; border: 2px solid #1c1209; border-radius: 16px; background: #fff1c7; display: flex; flex-direction: column; gap: 6px; }
.ap-top { display: flex; justify-content: space-between; align-items: baseline; }
.ap-top b { font: 700 22px/1 "Rubik", sans-serif; }
.ap-bar { height: 14px; border: 2px solid #1c1209; border-radius: 8px; background: #ead8b8; overflow: hidden; }
.ap-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f0a91c, #ffd25a); transition: width .5s; }
.ap-hive small { font-size: 12px; opacity: .75; }
.ap-hive .btn { width: 100%; margin: 4px 0 0; }
.ap-stock { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; }
.ap-stock .i, .ap-feed .i, .apiary-art + * .i { width: 22px; height: 22px; vertical-align: -6px; }
.ap-feed { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 2px solid #1c1209; border-radius: 14px; background: #ead8b8; }
.ap-feed span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ap-feed small { font-size: 12px; opacity: .75; }
.ap-feed .btn { width: auto; margin: 0; padding: 8px 10px; font-size: 14px; white-space: nowrap; }
.ap-feed .btn .i { width: 18px; height: 18px; vertical-align: -4px; }
#apiary .camp-card { margin-top: 12px; }
#apiary .camp-now .pips { display: inline-flex; margin-left: auto; }
.honey-badge {
  position: absolute; left: 50%; top: -4%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
  padding: 2px 8px 2px 2px; border-radius: 14px; border: 2px solid #1c1209;
  background: var(--cream); color: #1c1209; font: 700 13px/1 "Rubik", sans-serif;
  cursor: pointer; z-index: 3; animation: call 1.4s ease-in-out infinite;
}
.honey-badge img { width: 24px; height: 24px; }
.honey-badge.full { background: linear-gradient(#ffe29a, var(--gold)); }
.honey-badge[hidden] { display: none; }

/* ---------- Стрельбище Белки ---------- */
.range {
  position: fixed; inset: 0; z-index: 91;
  background: url(../assets/backgrounds/bg_range.webp) center / cover, linear-gradient(#5d8b3a, #2c4a1c);
  opacity: 0; transition: opacity .25s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.range.open { opacity: 1; }
/* во время стрельбы фон приглушаем — нарисованные мишени не путаются с настоящими */
.range::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(14, 22, 8, .5); opacity: 0; transition: opacity .4s; pointer-events: none; }
.range.playing::before { opacity: 1; }
.range[hidden] { display: none; }
.range-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 8px;
  background: linear-gradient(rgba(20, 12, 6, .75), transparent);
  color: var(--cream);
}
.range-top .sheet-close { position: static; flex: none; }
.range-top b { flex: 1; font: 400 24px/1 "Neucha", "Rubik", cursive; text-shadow: 0 2px 0 #1c1209; }
.range-score { display: flex; flex-direction: column; align-items: flex-end; }
.range-score small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.range-score span { font: 700 26px/1 "Rubik", sans-serif; text-shadow: 0 2px 0 #1c1209; }
.range-timer {
  position: absolute; left: 14px; right: 14px; top: calc(64px + var(--safe-t)); z-index: 3;
  height: 10px; border: 2px solid #1c1209; border-radius: 6px; background: rgba(0,0,0,.35); overflow: hidden;
}
.range-timer span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f0a91c, #ffd25a); }
.range-field { position: absolute; inset: 0; z-index: 2; }
.range-count {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  font: 400 120px/1 "Neucha", "Rubik", cursive; color: var(--cream); text-shadow: 0 6px 0 #1c1209;
  animation: call .6s ease-in-out infinite;
}
.target {
  position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; padding: 0;
  border: 0; background: none; cursor: crosshair;
  animation: tIn .18s ease-out both;
}
.target img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 4px rgba(255, 244, 214, .9)) drop-shadow(0 8px 8px rgba(0,0,0,.6)); pointer-events: none; }
.target.t-acorn { width: 74px; height: 74px; margin: -37px 0 0 -37px; }
.target.t-acorn img { filter: drop-shadow(0 0 12px #ffd25a) drop-shadow(0 0 4px #fff3b0); }
.target.t-wolf { width: 120px; height: 140px; margin: -70px 0 0 -60px; animation: tPop .2s ease-out both; }
@keyframes tPop { from { transform: translateY(40px) scaleY(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.target.t-bag img { animation: bagSpin .6s ease-in-out infinite alternate; }
.target.hit { animation: tHit .2s ease-in forwards; }
.target.gone { animation: tOut .2s ease-in forwards; }
@keyframes tIn { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tHit { to { transform: scale(1.4) rotate(15deg); opacity: 0; } }
@keyframes tOut { to { transform: scale(.4); opacity: 0; } }
@keyframes bagSpin { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.range-panel {
  position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -46%);
  width: min(92vw, 380px); max-height: 82dvh; overflow-y: auto;
  padding: 16px; text-align: center;
  background: var(--cream); color: var(--bark-dark);
  border: 3px solid #1c1209; border-radius: 22px; box-shadow: 0 6px 0 #1c1209, 0 20px 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 8px;
}
.range-panel[hidden] { display: none; }
.range-squirrel { align-self: center; flex: none; width: 76px; height: 76px; margin-bottom: -4px; border-radius: 50%; border: 3px solid #1c1209; background: #c9b48e; }
.range-panel h3 { margin: 0; font: 400 28px/1.1 "Neucha", "Rubik", cursive; }
.range-panel p { margin: 0; font-size: 14px; line-height: 1.4; }
.rt-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.rt { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 2px solid #1c1209; border-radius: 12px; background: #ead8b8; font-size: 12px; text-align: left; }
.rt img { width: 30px; height: 30px; object-fit: contain; }
.rt span { flex: 1; line-height: 1.2; }
.rt b { font: 700 15px/1 "Rubik", sans-serif; }
.range-stats { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.range-stats .i { width: 18px; height: 18px; vertical-align: -4px; }
.range-panel .btn { width: 100%; margin: 4px 0 0; }
.range-panel .hint { font-size: 12px; opacity: .7; }
.range-result b { display: block; font: 700 52px/1 "Rubik", sans-serif; }
.range-result span { font-size: 13px; opacity: .75; }
.rt:last-child { grid-column: 1 / -1; justify-content: center; }
.rt:last-child span { flex: none; }
