/* ===== Базовое ===== */
* { box-sizing: border-box; }

:root {
  --ink: #effbea;
  --lime: #8cff6a;
  --lime-dark: #57c84d;
  --gold: #ffd166;
  --panel: rgba(11, 25, 23, 0.82);
  --panel-solid: #162823;
  --line: rgba(140, 255, 106, 0.35);
  --danger: #ff6b6b;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1a22;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(224, 244, 205, 0.85), transparent 55%),
    linear-gradient(180deg, #2b5f8c 0%, #4d94c4 34%, #92cbe4 58%, #cfe8f4 78%, #e6f1d9 100%);
}

#app {
  position: fixed;
  inset: 0;
  isolation: isolate;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Лёгкие скан-линии для ретро-настроения */
#app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px);
  opacity: 0.32;
  mix-blend-mode: multiply;
}

.hidden { display: none !important; }

/* ===== Панели и кнопки ===== */
.panel {
  background: var(--panel);
  border: 3px solid rgba(6, 18, 12, 0.9);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 2px rgba(140, 255, 106, 0.28),
    0 8px 22px rgba(4, 16, 20, 0.32);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.btn {
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f6fff2;
  background: linear-gradient(#43a04b, #2b6f35);
  border: 3px solid #08160c;
  border-radius: 9px;
  box-shadow: 0 5px 0 #05100a, inset 0 3px 0 rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.06s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #05100a, inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.btn:disabled { filter: grayscale(0.7) brightness(0.65); cursor: not-allowed; transform: none; }

.btn.big {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  text-align: left;
  font-size: 16px;
}
.btn.big small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.8;
}
.btn-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #f2ffe6;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.btn-icon svg { width: 100%; height: 100%; }

.ico {
  display: inline-flex;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  flex: none;
}
.ico svg { width: 100%; height: 100%; }

.coin-ico {
  display: inline-flex;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  color: var(--gold);
  flex: none;
}
.coin-ico svg { width: 100%; height: 100%; }
.btn .coin-ico { width: 13px; height: 13px; vertical-align: -2px; }
.lvl-badge .coin-ico { width: 11px; height: 11px; vertical-align: -1px; }

.btn-text { display: block; }

.btn.gold {
  background: linear-gradient(#eab236, #b97f14);
  box-shadow: 0 5px 0 #5a3a05, inset 0 3px 0 rgba(255, 255, 255, 0.32);
  color: #2c1c02;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.ghost {
  background: linear-gradient(#3a4c52, #26343a);
  box-shadow: 0 5px 0 #0a1014, inset 0 2px 0 rgba(255, 255, 255, 0.12);
}
.btn.danger {
  background: linear-gradient(#a83c3c, #7f2626);
  box-shadow: 0 4px 0 #3b0c0c, inset 0 2px 0 rgba(255, 255, 255, 0.14);
}
.btn.tiny { font-size: 11px; padding: 8px 11px; letter-spacing: 0.02em; }
.btn.small { font-size: 12px; padding: 8px 13px; }

/* ===== Экраны ===== */
#screens { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  pointer-events: auto;
}

.screen.overlay {
  background: rgba(5, 14, 19, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 34;
}

/* ===== Главное меню ===== */
#menu {
  background:
    radial-gradient(circle at 50% 38%, rgba(9, 24, 30, 0.02), rgba(4, 13, 18, 0.62) 78%),
    linear-gradient(180deg, rgba(6, 18, 26, 0.3), rgba(4, 12, 18, 0.44));
  pointer-events: auto;
}

.menu-inner {
  width: min(520px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: menuIn 0.45s ease-out;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo { text-align: center; }
.logo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3em;
  padding: 5px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(10, 30, 22, 0.55);
  margin-bottom: 12px;
}
.logo h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.92;
  letter-spacing: 0.05em;
  color: #f4ffe9;
  text-shadow:
    0 4px 0 #123318,
    0 8px 0 #0a1f10,
    0 16px 32px rgba(0, 0, 0, 0.45);
}
.logo h1 span {
  background: linear-gradient(180deg, #e2ff9c, #8cf05f 55%, #48bd48);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 0 #123318) drop-shadow(0 8px 0 #0a1f10);
}
.subtitle {
  margin: 14px 0 0;
  font-size: 13px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #d8f3c9;
  opacity: 0.85;
}

.menu-buttons { width: 100%; display: flex; flex-direction: column; gap: 10px; }

.stats-row {
  width: 100%;
  display: flex;
  align-items: stretch;
  padding: 12px 8px;
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.stat:last-child { border-right: 0; }
.stat-label { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.65; }
.stat b { font-size: 20px; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }

.small-actions { display: flex; gap: 8px; }

.version {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 255, 235, 0.55);
  pointer-events: none;
}

/* ===== Магазин ===== */
#shop {
  z-index: 33;
  padding: 16px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(44, 93, 67, 0.24), transparent 56%),
    radial-gradient(circle at 50% 110%, rgba(140, 255, 106, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(2, 8, 11, 0.975), rgba(3, 13, 15, 0.995));
  backdrop-filter: blur(15px) saturate(0.55);
  -webkit-backdrop-filter: blur(15px) saturate(0.55);
}
#shop::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(140, 255, 106, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 255, 106, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 48%, #000 12%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 48%, #000 12%, transparent 76%);
}
.shop-inner {
  position: relative;
  z-index: 1;
  width: min(1360px, 96vw);
  min-height: min(580px, 80vh);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 28px 30px 22px;
  background:
    linear-gradient(180deg, rgba(18, 40, 35, 0.985), rgba(8, 21, 20, 0.995));
  border: 4px solid #06130e;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 2px rgba(140, 255, 106, 0.24),
    inset 0 34px 80px rgba(140, 255, 106, 0.025),
    0 32px 90px rgba(0, 0, 0, 0.8);
  animation: shopIn 0.25s ease-out;
}
@keyframes shopIn {
  from { opacity: 0; transform: scale(0.985) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.shop-head { display: flex; align-items: center; gap: 18px; }
.shop-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shop-head h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0.13em;
  display: flex;
  align-items: center;
  gap: 11px;
}
.shop-head h2 .ico { width: 30px; height: 30px; color: var(--lime); }
.shop-subtitle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(213, 241, 220, 0.46);
}
.private-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(140, 255, 106, 0.85);
  flex: none;
}
.shop-coins {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.36);
  border: 2px solid rgba(255, 209, 102, 0.38);
  border-radius: 10px;
  padding: 8px 18px;
}
#btn-shop-back { font-size: 13px; padding: 10px 16px; }
.coin { filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.4)); }

.tabs { display: flex; gap: 10px; margin-top: 22px; }
.tab {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #cfe6d8;
  background: #16292a;
  border: 2px solid #2e4a41;
  border-radius: 9px;
  padding: 11px 20px;
  cursor: pointer;
}
.tab:hover { border-color: #4d7a5f; }
.tab.active {
  background: linear-gradient(#3e9348, #2c6a36);
  border-color: var(--lime);
  color: #fff;
}

.shop-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  grid-auto-rows: minmax(250px, 1fr);
  gap: 16px;
  align-content: start;
  overflow-y: auto;
  padding: 4px 8px 8px 4px;
  margin-top: 20px;
  scrollbar-width: thin;
  scrollbar-color: #3e6a4d transparent;
}
.shop-grid::-webkit-scrollbar { width: 9px; }
.shop-grid::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.16); border-radius: 8px; }
.shop-grid::-webkit-scrollbar-thumb {
  background: #3e6a4d;
  border-radius: 8px;
  border: 2px solid #10211c;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 245px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(33, 59, 53, 0.96), rgba(16, 34, 31, 0.99));
  border: 2px solid #2f4f42;
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: #578f63; transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: 9px; }
.card-icon { width: 28px; height: 28px; display: inline-flex; color: #a8e698; flex: none; }
.card-icon svg { width: 100%; height: 100%; }
.card h3 { margin: 0; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; flex: 1; }
.lvl-badge {
  font-size: 11px;
  font-weight: 800;
  color: #a9e698;
  background: #0f211b;
  border: 1px solid #2f5c43;
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}
.card-desc { margin: 0; font-size: 13px; line-height: 1.45; opacity: 0.72; min-height: 38px; }
.card-value {
  font-size: 13px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 7px;
  padding: 8px 10px;
  color: #bfe6c5;
}
.card-value b { color: var(--lime); }
.card .btn { margin-top: auto; width: 100%; font-size: 13px; padding: 11px 8px; }

.pips { display: flex; gap: 4px; }
.pip { width: 100%; height: 8px; background: #213a31; border-radius: 2px; }
.pip.on { background: linear-gradient(90deg, #6fdd53, #8cff6a); box-shadow: 0 0 7px rgba(140, 255, 106, 0.6); }

/* Превью скина из CSS-фигур */
.skin-preview {
  position: relative;
  height: 112px;
  border-radius: 9px;
  background:
    radial-gradient(ellipse at 50% 82%, rgba(140, 255, 106, 0.18), transparent 68%),
    linear-gradient(180deg, rgba(12, 30, 28, 0.6), rgba(8, 20, 18, 0.2));
  border: 1px solid rgba(140, 255, 106, 0.12);
  overflow: hidden;
}
/* Скины компактнее: все шесть карточек видны сразу. */
.shop-grid[data-view="skins"] { grid-auto-rows: minmax(0, 1fr); }
.shop-grid[data-view="skins"] .card {
  min-height: 0;
  padding: 12px;
  gap: 7px;
}
.shop-grid[data-view="skins"] .skin-preview { height: 78px; }
.shop-grid[data-view="skins"] .card h3 { font-size: 15px; }
.shop-grid[data-view="skins"] .card-desc { min-height: 0; font-size: 12px; }
.shop-grid[data-view="skins"] .card .btn { padding: 8px 8px; font-size: 12px; }
.shop-grid[data-view="skins"] .lvl-badge { font-size: 10px; }
.skin-preview div { position: absolute; }
.sp-body {
  left: 20%; bottom: 22px; width: 56%; height: 20px;
  background: var(--body);
  border: 2px solid rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}
.sp-cab {
  left: 46%; bottom: 39px; width: 24%; height: 20px;
  background: var(--body);
  border: 2px solid rgba(0, 0, 0, 0.45);
}
.sp-roof {
  left: 44%; bottom: 57px; width: 28%; height: 7px;
  background: var(--roof);
  border: 2px solid rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}
.sp-accent {
  left: 20%; bottom: 16px; width: 56%; height: 5px;
  background: var(--accent);
  border-radius: 2px;
}
.sp-wheel {
  width: 24px; height: 24px; border-radius: 50%;
  background: #232326;
  border: 3px solid #111;
  bottom: 8px;
}
.sp-wheel.r { left: 22%; }
.sp-wheel.f { left: 68%; width: 18px; height: 18px; bottom: 11px; }

.shop-foot {
  margin-top: 14px;
  font-size: 12px;
  opacity: 0.52;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ===== Пауза / результат ===== */
.pause-inner, .result-inner {
  width: min(420px, 92vw);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  background: rgba(11, 26, 23, 0.95);
}
.pause-inner h2, .result-inner h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pause-inner p, .result-inner p { margin: 0 0 8px; font-size: 13px; opacity: 0.7; }
.pause-inner .btn { width: 100%; }

.result-inner { width: min(460px, 94vw); }
.result-badge {
  align-self: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: #0e2514;
  background: linear-gradient(#b9ff8d, #6fdd53);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 4px;
  box-shadow: 0 0 20px rgba(140, 255, 106, 0.4);
}
.result-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0;
  background: rgba(0, 0, 0, 0.26);
  border-radius: 8px;
  padding: 10px 14px;
}
.result-stats > div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  color: #cfe6d8;
}
.result-stats b { color: var(--ink); }
.result-stats .total {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  font-size: 15px;
}
.result-stats .total b { color: var(--gold); }
.result-inner .btn { width: 100%; }

/* ===== HUD ===== */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }

.hud-row.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}
.level-panel { width: min(430px, 48vw); padding: 10px 14px; }
.level-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.level-line b { font-size: 18px; color: var(--gold); }
.tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  background: rgba(140, 255, 106, 0.15);
  color: var(--lime);
  border: 1px solid rgba(140, 255, 106, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
}
.map-hint {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(234, 255, 221, 0.62);
  border-left: 1px solid rgba(234, 255, 221, 0.2);
  padding-left: 8px;
  white-space: nowrap;
}
.goal-hint { margin-left: auto; font-size: 10px; opacity: 0.68; white-space: nowrap; }
.map-arrow { color: var(--lime); padding: 0 3px; }
.result-stats .map-arrow { color: var(--lime); }

.progress {
  position: relative;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: #081611;
  border: 2px solid #2b5237;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4bb543, #a8ee58);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.35);
  transition: width 0.18s ease-out;
}
.progress span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px #000;
}

.coin-panel { padding: 10px 16px; font-size: 20px; font-weight: 800; color: var(--gold); display: flex; align-items: center; gap: 6px; }

.compass-wrap {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
}
.compass {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease;
}
.compass .arrow {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--lime);
  transform: rotate(0rad);
  transition: transform 0.08s linear;
  filter: drop-shadow(0 0 6px rgba(140, 255, 106, 0.8));
}
.compass .arrow svg { width: 100%; height: 100%; }
.compass .compass-icon { width: 16px; height: 16px; display: inline-flex; opacity: 0.9; }
.compass .compass-icon svg { width: 100%; height: 100%; }
.compass.at-base { border-color: var(--lime); box-shadow: 0 0 22px rgba(140, 255, 106, 0.35); }

.hud-row.bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
}
.cargo { width: 200px; padding: 9px 12px; }
.cargo.full { border-color: var(--danger); box-shadow: 0 0 18px rgba(255, 107, 107, 0.3), inset 0 0 0 2px rgba(255, 107, 107, 0.25); }
.cargo-line { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.08em; margin-bottom: 6px; }
.cargo-line b { color: var(--gold); }
.boost-panel { width: 150px; padding: 9px 12px; font-size: 10px; letter-spacing: 0.1em; }
.boost-panel span { display: block; margin-bottom: 6px; opacity: 0.75; }
.bar { height: 10px; border-radius: 4px; background: #081611; overflow: hidden; border: 1px solid #2b5237; }
.bar.small { height: 8px; }
.bar-fill { height: 100%; width: 0%; transition: width 0.1s linear; }
.cargo-fill { background: linear-gradient(90deg, #e8c04a, #ffd166); width: 0%; }
.boost-fill { background: linear-gradient(90deg, #ff7a3c, #ffd166); width: 100%; }
.hint { margin-left: auto; font-size: 10px; letter-spacing: 0.06em; opacity: 0.55; text-shadow: 0 1px 2px #000; padding-bottom: 6px; }

/* Прицел и хотбар строителя */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  opacity: 0.85;
}
.crosshair::before, .crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}
.crosshair::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
.crosshair::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }

.walk-panel { padding: 10px 14px; }
.panel-title { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: var(--lime); margin-bottom: 4px; }
.walk-hint { font-size: 10px; opacity: 0.7; }

.hotbar-wrap {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.selected-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(8, 20, 16, 0.8);
  border: 1px solid rgba(140, 255, 106, 0.25);
  border-radius: 5px;
  padding: 3px 10px;
  color: #dcf7cd;
}
.hotbar {
  display: flex;
  gap: 6px;
  padding: 7px;
  background: rgba(8, 20, 17, 0.9);
  border: 3px solid #07130e;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(140, 255, 106, 0.18), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.slot {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: rgba(28, 44, 40, 0.95);
  border: 2px solid #3a5049;
  border-radius: 7px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.slot.selected {
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.28), 0 0 18px rgba(255, 209, 102, 0.35);
}
.slot.empty { opacity: 0.45; }
.slot .swatch {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.25), inset 0 4px 0 rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
.slot .count {
  position: absolute;
  right: 4px;
  bottom: 1px;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 1px 1px 0 #000, 0 0 6px #000;
}
.slot .num { position: absolute; top: 2px; left: 4px; font-size: 8px; opacity: 0.5; }
.walk-stats { font-size: 10px; opacity: 0.65; letter-spacing: 0.06em; }

/* ===== Тосты ===== */
#toasts {
  position: absolute;
  right: 18px;
  bottom: 120px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 330px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(10, 26, 22, 0.95);
  border: 1px solid rgba(140, 255, 106, 0.3);
  border-left: 4px solid var(--lime);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  line-height: 1.4;
  color: #e8ffe0;
  animation: toastIn 0.2s ease-out;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.warn { border-left-color: #ffb14e; }
.toast.error { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateX(16px); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Фатальная ошибка (для отладки) ===== */
#fatal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(28, 4, 4, 0.96);
  color: #ffd9d9;
  padding: 32px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: auto;
}

/* ===== Адаптив ===== */
@media (max-width: 760px) {
  .logo h1 { font-size: 44px; }
  .level-panel { width: 60vw; }
  .goal-hint, .hint { display: none; }
  .compass-wrap { top: 78px; }
  .slot { width: 44px; height: 44px; }
  .slot .swatch { width: 24px; height: 24px; }
  .hud-row.bottom { padding: 10px; gap: 8px; }
  .cargo { width: 140px; }
  .boost-panel { width: 110px; }
  .hotbar-wrap { bottom: 8px; }
  #shop { padding: 8px; }
  .shop-inner {
    width: 98vw;
    min-height: 0;
    max-height: 96vh;
    padding: 16px 14px 14px;
    border-width: 3px;
  }
  .shop-head { gap: 10px; }
  .shop-head h2 { font-size: 19px; gap: 7px; }
  .shop-head h2 .ico { width: 22px; height: 22px; }
  .shop-subtitle { font-size: 7px; letter-spacing: 0.16em; }
  .shop-coins { font-size: 15px; padding: 6px 10px; }
  #btn-shop-back { font-size: 11px; padding: 8px 10px; }
  .tabs { margin-top: 14px; gap: 6px; }
  .tab { font-size: 10px; padding: 8px 11px; }
  .shop-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 10px;
    margin-top: 12px;
  }
  .card { min-height: 0; padding: 14px; }
  .skin-preview { height: 96px; }
  .shop-foot { display: none; }
  #toasts { bottom: 150px; right: 10px; }
}
