:root {
  --cols: 8;
  --rows: 8;

  --bg-1: #061018;
  --bg-2: #0c1d2c;
  --panel: rgba(15, 29, 44, 0.78);
  --panel-strong: rgba(14, 26, 40, 0.94);
  --border: rgba(148, 210, 255, 0.16);
  --text: #f4f9ff;
  --muted: rgba(226, 240, 255, 0.7);

  --accent-1: #10b981;
  --accent-2: #0ea5e9;
  --amber: #f59e0b;
  --gold: #fbbf24;
  --danger: #fb7185;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(1100px 700px at 12% 12%, rgba(16, 185, 129, 0.2), transparent 58%),
    radial-gradient(1000px 700px at 88% 85%, rgba(14, 165, 233, 0.22), transparent 58%),
    linear-gradient(155deg, var(--bg-1), var(--bg-2));
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 36vmax;
  height: 36vmax;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.36;
  animation: drift 16s ease-in-out infinite alternate;
}

.blob-1 {
  top: -12vmax;
  left: -8vmax;
  background: radial-gradient(circle at 30% 30%, #10b981, transparent 68%);
}

.blob-2 {
  right: -10vmax;
  bottom: -14vmax;
  background: radial-gradient(circle at 30% 30%, #0284c7, transparent 68%);
  animation-delay: -4s;
}

.blob-3 {
  left: 35%;
  bottom: -16vmax;
  width: 24vmax;
  height: 24vmax;
  opacity: 0.22;
  background: radial-gradient(circle at 30% 30%, #f59e0b, transparent 68%);
  animation-delay: -8s;
}

@keyframes drift {
  to {
    transform: translate3d(3vmax, -2.5vmax, 0) scale(1.06);
  }
}

/* ==========================================================================
   АДАПТИВНЫЙ КАРКАС (Responsive Split: 3 колонки на ПК, стек на телефоне)
   ========================================================================== */
.app {
  width: min(100%, 1240px);
  display: grid;
  grid-template-columns: 300px minmax(340px, 1fr) 280px;
  align-items: center;
  gap: 16px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

/* ==========================================================================
   ЛЕВАЯ ПАНЕЛЬ: БРЕНД, GPS-РАДАР РЫЖИКА, БОСС, ЦЕЛИ МИССИИ
   ========================================================================== */
.brand-card,
.boss-card,
.objectives-card,
.toolkit-card {
  padding: 13px 14px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.28), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(90deg, #ffffff, #fde68a, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chapter-label {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
}

/* GPS Радар ошейника */
.radar-box {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(6, 20, 31, 0.68);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.radar-circle {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(16, 185, 129, 0.32) 0%, rgba(16, 185, 129, 0.05) 70%);
  border: 1.5px solid rgba(16, 185, 129, 0.65);
}

.radar-ping {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: radarPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
  0% {
    transform: scale(0.75);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.radar-cat {
  font-size: 24px;
  z-index: 1;
  animation: catBob 2.4s ease-in-out infinite;
}

@keyframes catBob {
  50% {
    transform: translateY(-2px) scale(1.06);
  }
}

.radar-info {
  min-width: 0;
  flex: 1;
}

.radar-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #34d399;
}

.radar-dist-row {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.radar-dist-val {
  color: var(--gold);
  font-size: 14px;
  font-weight: 900;
}

.story-ticker {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: #e2f1ff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Босс-карточка */
.boss-card {
  background: linear-gradient(145deg, rgba(88, 18, 36, 0.78), rgba(32, 14, 28, 0.88));
  border-color: rgba(251, 113, 133, 0.42);
}

.boss-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.boss-icon {
  font-size: 28px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.boss-meta {
  flex: 1;
  min-width: 0;
}

.boss-name {
  font-size: 14px;
  font-weight: 900;
  color: #ffe4e6;
}

.boss-timer {
  font-size: 11px;
  font-weight: 700;
  color: #fda4af;
}

.boss-hp-text {
  font-size: 13px;
  font-weight: 900;
  color: #fecdd3;
}

.boss-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.boss-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f43f5e, #fb923c);
  transition: width 0.25s ease;
}

/* Цели уровня и звёзды */
.objectives-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.stage-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

.stars-meter {
  display: flex;
  gap: 4px;
  font-size: 18px;
}

.stars-meter .star {
  color: rgba(255, 255, 255, 0.22);
  transition: transform 0.22s ease, color 0.22s ease;
}

.stars-meter .star.lit {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.65);
  transform: scale(1.12);
}

.star-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 10px;
}

.star-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #fbbf24);
  transition: width 0.25s ease;
}

.objectives-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.obj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(6, 16, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.obj-item.done {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

.obj-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.obj-icon {
  font-size: 17px;
}

.obj-progress {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   ЦЕНТРАЛЬНАЯ ДОСКА 8×8
   ========================================================================== */
.target-banner {
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  animation: pulseBanner 1.2s ease-in-out infinite alternate;
}

@keyframes pulseBanner {
  to {
    transform: scale(1.03);
  }
}

.board-wrap {
  position: relative;
  width: min(100%, calc(100dvh - 58px), 560px);
  aspect-ratio: 1;
  padding: 10px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.board-wrap.shake {
  animation: boardShake 0.32s ease;
}

@keyframes boardShake {
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 2px); }
}

.board {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: rgba(4, 11, 20, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 0 40px rgba(0, 0, 0, 0.42);
}

.board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size:
    calc(100% / var(--cols)) calc(100% / var(--rows));
}

.board.reshuffling {
  filter: blur(2px) saturate(0.75);
  transform: scale(0.99);
  transition: 0.25s ease;
}

/* Клетки-модификаторы (вырезы, лианы, валуны) */
.board-cell {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--cols));
  height: calc(100% / var(--rows));
  pointer-events: none;
}

.board-cell.cell-void {
  background: rgba(2, 6, 12, 0.85);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9);
  z-index: 2;
}

.board-cell.cell-vine-1,
.board-cell.cell-vine-2 {
  z-index: 6;
  border-radius: 18%;
  border: 3px solid rgba(34, 197, 94, 0.85);
  background:
    radial-gradient(circle at 20% 20%, rgba(74, 222, 128, 0.32), transparent 55%),
    rgba(20, 83, 45, 0.28);
  box-shadow: inset 0 0 10px rgba(34, 197, 94, 0.55);
}

.board-cell.cell-vine-2 {
  border-width: 5px;
  border-color: #15803d;
  background:
    repeating-linear-gradient(45deg, rgba(22, 163, 74, 0.28) 0 6px, rgba(20, 83, 45, 0.45) 6px 12px);
}

.board-cell.cell-vine-1::after,
.board-cell.cell-vine-2::after {
  content: "🌿";
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 13px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.board-cell.cell-rock-1,
.board-cell.cell-rock-2 {
  z-index: 7;
  padding: 7%;
}

.rock-body {
  width: 100%;
  height: 100%;
  border-radius: 24%;
  display: grid;
  place-items: center;
  font-size: clamp(18px, 2.8vw, 26px);
  background: radial-gradient(circle at 30% 25%, #94a3b8, #334155 75%);
  border: 2px solid rgba(203, 213, 225, 0.45);
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.25),
    inset 0 -6px 12px rgba(0, 0, 0, 0.5),
    0 6px 14px rgba(0, 0, 0, 0.4);
}

.board-cell.cell-rock-1 .rock-body {
  background: radial-gradient(circle at 30% 25%, #cbd5e1, #475569 75%);
  border-style: dashed;
  opacity: 0.92;
}

.fx {
  position: absolute;
  inset: 10px;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.combo-toast {
  position: absolute;
  left: 50%;
  top: 12%;
  z-index: 50;
  transform: translate(-50%, -8px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  font-size: clamp(20px, 3.5vw, 32px);
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow:
    0 0 18px rgba(251, 191, 36, 0.65),
    0 0 36px rgba(16, 185, 129, 0.5);
  transition: 0.22s ease;
  white-space: nowrap;
}

.combo-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ==========================================================================
   ФИШКИ ПРИПАСОВ, СПЕЦ-ФИШКИ И УЛИКИ КОТИКА
   ========================================================================== */
.gem {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--cols));
  height: calc(100% / var(--rows));
  transition: transform 0.22s cubic-bezier(0.2, 0.85, 0.25, 1.1);
  will-change: transform;
  z-index: 3;
}

.gem-body {
  position: absolute;
  inset: 8%;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 24%;
  transform: scale(1);
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.18s ease;
  box-shadow:
    inset 0 4px 9px rgba(255, 255, 255, 0.32),
    inset 0 -8px 14px rgba(0, 0, 0, 0.32),
    0 6px 14px rgba(0, 0, 0, 0.28);
}

.gem-body::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 10%;
  height: 24%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.gem-icon {
  position: relative;
  z-index: 2;
  font-size: clamp(18px, 3.2vw, 27px);
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

/* 6 цветов припасов спасателя */
.gem[data-type="0"] .gem-body {
  border-radius: 24%;
  background: radial-gradient(circle at 30% 25%, #fecdd3, #f43f5e 72%);
}

.gem[data-type="1"] .gem-body {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fde68a, #ea580c 74%);
}

.gem[data-type="2"] .gem-body {
  border-radius: 30% 70% 32% 68% / 35% 32% 68% 65%;
  background: radial-gradient(circle at 30% 25%, #bbf7d0, #16a34a 74%);
}

.gem[data-type="3"] .gem-body {
  border-radius: 20%;
  background: radial-gradient(circle at 30% 25%, #bae6fd, #2563eb 74%);
}

.gem[data-type="4"] .gem-body {
  border-radius: 46% 46% 24% 24%;
  background: radial-gradient(circle at 30% 25%, #e9d5ff, #7c3aed 74%);
}

.gem[data-type="5"] .gem-body {
  border-radius: 34%;
  background: radial-gradient(circle at 30% 25%, #fef08a, #0891b2 76%);
}

/* Спускаемая улика Рыжика (🐾) */
.gem[data-drop="1"] .gem-body {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fffbeb, #f59e0b 65%, #b45309 100%);
  border: 2.5px solid #fef08a;
  box-shadow:
    0 0 18px rgba(251, 191, 36, 0.75),
    inset 0 4px 10px rgba(255, 255, 255, 0.6);
  animation: dropPulse 1.3s ease-in-out infinite alternate;
}

@keyframes dropPulse {
  to {
    transform: scale(1.07);
  }
}

/* Запертый ящик (цепи) */
.gem.chained .gem-body::before {
  content: "⛓️";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  font-size: clamp(20px, 3.4vw, 28px);
  background: rgba(15, 23, 42, 0.48);
  border: 2px dashed rgba(226, 232, 240, 0.8);
  border-radius: inherit;
}

/* Спец-фишки: Сигнальная ракета (4 в ряд), Дрон-бомба (T/L), Супер-радар (5 в ряд) */
.gem[data-special="line-h"] .gem-body,
.gem[data-special="line-v"] .gem-body {
  box-shadow:
    0 0 0 2.5px #fef08a,
    0 0 18px rgba(250, 204, 21, 0.75),
    inset 0 4px 10px rgba(255, 255, 255, 0.5);
}

.special-badge {
  position: absolute;
  right: 3px;
  top: 3px;
  z-index: 5;
  font-size: 12px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fde047;
  font-weight: 900;
}

.gem[data-special="bomb"] .gem-body {
  box-shadow:
    0 0 0 2.5px #fb7185,
    0 0 22px rgba(244, 63, 94, 0.85),
    inset 0 4px 10px rgba(255, 255, 255, 0.5);
}

.gem[data-special="prism"] .gem-body {
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #f43f5e,
    #f59e0b,
    #10b981,
    #0ea5e9,
    #8b5cf6,
    #f43f5e
  );
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.8);
}

.gem.selected {
  z-index: 8;
}

.gem.selected .gem-body {
  transform: scale(1.1);
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 24px rgba(255, 255, 255, 0.6);
}

.gem.hint-glow .gem-body {
  animation: hintPulse 0.85s ease-in-out infinite alternate;
  box-shadow:
    0 0 0 3px #fde047,
    0 0 24px rgba(253, 224, 71, 0.75);
}

@keyframes hintPulse {
  to {
    transform: scale(1.09);
  }
}

.gem.invalid .gem-body {
  animation: shake 0.24s ease;
  box-shadow: 0 0 0 3px rgba(255, 80, 80, 0.85);
}

@keyframes shake {
  25% { transform: translateX(-6%); }
  75% { transform: translateX(6%); }
}

.gem.removing {
  z-index: 9;
}

.gem.removing .gem-body {
  animation: pop 0.24s ease forwards;
}

@keyframes pop {
  35% {
    transform: scale(1.22);
    opacity: 1;
  }
  100% {
    transform: scale(0.05) rotate(18deg);
    opacity: 0;
  }
}

/* Спецэффекты взрывов и лучей */
.particle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: particle 0.62s ease-out forwards;
}

@keyframes particle {
  from { opacity: 1; }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0);
  }
}

.laser-beam {
  position: absolute;
  z-index: 35;
  background: linear-gradient(90deg, rgba(253, 224, 71, 0.2), #ffffff, rgba(56, 189, 248, 0.9), rgba(253, 224, 71, 0.2));
  box-shadow: 0 0 24px #38bdf8, 0 0 40px #fde047;
  border-radius: 999px;
  animation: beamFlash 0.34s ease-out forwards;
}

@keyframes beamFlash {
  0% { opacity: 1; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}

.blast-wave {
  position: absolute;
  z-index: 35;
  border-radius: 50%;
  border: 4px solid #fde047;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.45), transparent 70%);
  transform: translate(-50%, -50%);
  animation: blastExpand 0.38s ease-out forwards;
}

@keyframes blastExpand {
  from {
    width: 10px;
    height: 10px;
    opacity: 1;
  }
  to {
    width: 220px;
    height: 220px;
    opacity: 0;
  }
}

.float-score {
  position: absolute;
  z-index: 40;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: clamp(16px, 2.6vw, 24px);
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 14px rgba(251, 191, 36, 0.65),
    0 2px 8px rgba(0, 0, 0, 0.6);
  animation: floatUp 0.8s ease forwards;
}

@keyframes floatUp {
  to {
    transform: translate(-50%, calc(-50% - 32px)) scale(1.08);
    opacity: 0;
  }
}

.hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ==========================================================================
   ПРАВАЯ ПАНЕЛЬ: СТАТИСТИКА, БУСТЕРЫ, КНОПКИ
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat {
  padding: 9px 10px;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.label {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.value {
  display: inline-block;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.token-val {
  color: var(--gold);
}

.value.bump {
  animation: bump 0.25s ease;
}

@keyframes bump {
  30% { transform: scale(1.18); }
}

#movesStat.danger .value {
  color: var(--danger);
  text-shadow: 0 0 16px rgba(251, 113, 133, 0.6);
}

.card-subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.boosters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.booster-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 6px;
  border-radius: 13px;
  background: rgba(8, 20, 33, 0.72);
  border: 1px solid rgba(148, 210, 255, 0.18);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.booster-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 34, 54, 0.88);
}

.booster-btn.active {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.24);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.4);
}

.booster-icon {
  font-size: 20px;
}

.booster-name {
  font-size: 11.5px;
  font-weight: 800;
}

.booster-badge {
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
}

.nav-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-color: rgba(110, 231, 183, 0.45);
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.32);
}

.btn-accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(234, 88, 12, 0.28));
  border-color: rgba(251, 191, 36, 0.45);
}

.pill-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.22);
  color: var(--gold);
}

.alert-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f43f5e;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
}

/* ==========================================================================
   МОДАЛЬНЫЕ ОКНА: РЕЗУЛЬТАТ, КАРТА КАМПАНИИ, ЛАГЕРЬ ПРОКАЧКИ
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(3, 9, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.panel {
  width: min(100%, 440px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 22px;
  text-align: center;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: panelIn 0.25s ease;
}

.modal-wide {
  width: min(100%, 780px);
  text-align: left;
}

@keyframes panelIn {
  from {
    transform: translateY(10px) scale(0.96);
    opacity: 0;
  }
}

.result-icon {
  font-size: 46px;
  margin-bottom: 4px;
}

.result-stars {
  font-size: 32px;
  letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.6);
  margin: 4px 0 8px;
}

.result-story {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #dbeafe;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.result-stat {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.final-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.final-score {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
}

.reward-tokens {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 900;
  color: var(--gold);
}

.note {
  min-height: 18px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.shop-balance {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--gold);
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
}

.btn-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

/* Карта глав и этапов */
.chapters-container {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.chapter-block {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chapter-block-title {
  font-size: 14px;
  font-weight: 900;
  color: #6ee7b7;
  margin-bottom: 8px;
}

.levels-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.level-node {
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 29, 44, 0.85);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.level-node:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.level-node.current {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.22);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}

.level-node:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.level-num {
  font-size: 14px;
  font-weight: 900;
}

.level-stars {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
}

/* Сетка улучшений в Лагере */
.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.upgrade-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.upg-info {
  min-width: 0;
  flex: 1;
}

.upg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 900;
}

.upg-lvl {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}

.upg-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==========================================================================
   МОБИЛЬНАЯ И ПОРТРЕТНАЯ АДАПТАЦИЯ (< 860px)
   ========================================================================== */
@media (max-width: 859px) {
  body {
    align-items: flex-start;
    padding: 8px;
  }

  .app {
    width: min(100%, 520px);
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-card,
  .boss-card,
  .objectives-card,
  .toolkit-card {
    padding: 9px 11px;
  }

  .brand-row {
    margin-bottom: 6px;
  }

  .story-ticker {
    -webkit-line-clamp: 2;
  }

  .objectives-list {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  }

  .board-wrap {
    width: min(95vw, 470px);
    padding: 7px;
  }

  .fx {
    inset: 7px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .stat {
    padding: 6px 4px;
  }

  .value {
    font-size: 16px;
  }

  .boosters-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .nav-buttons {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .nav-buttons .btn {
    padding: 8px 6px;
    font-size: 11.5px;
  }

  .upgrades-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ОПТИМИЗАЦИЯ GPU ТОЛЬКО ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (ПК не затрагивается)
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  .blob {
    filter: none;
    animation: none;
    opacity: 0.24;
  }

  .brand-card,
  .boss-card,
  .objectives-card,
  .toolkit-card,
  .board-wrap {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--panel-strong);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  }

  .overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(3, 9, 16, 0.9);
  }

  .radar-ping,
  .radar-cat,
  .target-banner {
    animation: none;
  }

  .gem {
    will-change: auto;
  }

  .gem-body {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.28);
  }

  .gem-icon,
  .boss-icon,
  .board-cell.cell-vine-1::after,
  .board-cell.cell-vine-2::after {
    filter: none;
  }

  .rock-body {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  }

  .board.reshuffling {
    filter: none;
  }
}
