/* Операція: Порятунок Світу — стилі UI */
:root {
  --ui-bg: rgba(18, 30, 46, 0.78);
  --ui-border: rgba(255, 255, 255, 0.16);
  --accent: #ffd23f;
  --hp: #5ad465;
  --hp-low: #ff5d5d;
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0c1622; }
/* 📱 Динамічний вьюпорт: на телефоні адресний рядок не має перекривати нижні кнопки.
   100% лишається запасним варіантом, далі — 100dvh для браузерів, що це вміють. */
html, body { height: 100dvh; }
body { font-family: var(--font); user-select: none; -webkit-user-select: none; }
#game-canvas { position: fixed; inset: 0; display: block; }
#game-canvas { height: 100dvh; }
/* палець крутить глобус (pointer events у globe.js) замість прокрутки/зуму браузера */
#game-canvas { touch-action: none; }

/* ================= ГЛОБУС ================= */
#globe-ui {
  position: fixed; inset: 0; display: none; flex-direction: column;
  justify-content: space-between; align-items: center;
  pointer-events: none; z-index: 10; padding: 4vh 20px;
}
.globe-top { text-align: center; }
#globe-ui h1 {
  font-size: clamp(30px, 5.4vw, 62px); font-weight: 900; color: #fff;
  text-shadow: 0 4px 0 #16314e, 0 9px 28px rgba(0, 0, 0, 0.6);
  letter-spacing: 1px;
  animation: float-title 4s ease-in-out infinite;
}
#globe-ui h1 .accent { color: var(--accent); text-shadow: 0 4px 0 #8a6a00, 0 9px 28px rgba(0,0,0,.6); }
@keyframes float-title { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.globe-sub { margin-top: 10px; color: #cfe8ff; font-size: clamp(14px, 2vw, 20px); font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.globe-bottom { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
#globe-progress {
  background: var(--ui-bg); border: 2px solid var(--ui-border); border-radius: 14px;
  color: #fff; font-weight: 800; font-size: 18px; padding: 10px 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
#globe-progress span { color: var(--accent); }
.globe-hint { color: #9fb8d4; font-weight: 700; font-size: 14px; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
#version-tag {
  position: absolute; right: 12px; bottom: 8px; pointer-events: none;
  color: #7a93b0; font-weight: 700; font-size: 12px; text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

#globe-tooltip {
  position: fixed; display: none; z-index: 20; pointer-events: none;
  background: var(--ui-bg); border: 2px solid var(--ui-border); border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 700; padding: 8px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.5); white-space: nowrap;
}
#globe-tooltip.available { border-color: var(--accent); }

/* ================= HUD ================= */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; display: none; }
body.in-level #hud { height: 100dvh; }
body.in-level #hud { display: block; }

/* приціл */
#crosshair {
  --gap: 6px;
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
}
.ch-line { position: absolute; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.9); border-radius: 2px; }
.ch-t { width: 2.5px; height: 9px; left: -1.25px; bottom: var(--gap); }
.ch-b { width: 2.5px; height: 9px; left: -1.25px; top: var(--gap); }
.ch-l { height: 2.5px; width: 9px; top: -1.25px; right: var(--gap); }
.ch-r { height: 2.5px; width: 9px; top: -1.25px; left: var(--gap); }
.ch-dot { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; background: #fff; border-radius: 50%; box-shadow: 0 0 3px rgba(0,0,0,.9); }

#hitmarker {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.6);
  color: #fff; font-size: 30px; font-weight: 900; opacity: 0;
  text-shadow: 0 0 6px rgba(0,0,0,.8); transition: none;
}
#hitmarker.show { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: all .12s ease-out; }
#hitmarker.crit { color: #ffd23f; font-size: 38px; }

/* місії */
#mission-panel {
  position: absolute; left: 18px; top: 18px; min-width: 250px; max-width: 330px;
  background: var(--ui-bg); border: 2px solid var(--ui-border); border-radius: 16px;
  padding: 12px 16px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.panel-title { color: var(--accent); font-weight: 900; font-size: 13px; letter-spacing: 2px; margin-bottom: 8px; }
.mission { color: #fff; font-weight: 700; font-size: 14.5px; padding: 4px 0; line-height: 1.35; }
.mission.done { color: #8aa3be; text-decoration: line-through; }
.mission .mi { margin-right: 4px; }

/* верх-право: монети + мінікарта */
#topright { position: absolute; right: 18px; top: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#coins {
  background: var(--ui-bg); border: 2px solid var(--ui-border); border-radius: 14px;
  color: var(--accent); font-weight: 900; font-size: 22px; padding: 8px 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35); display: flex; align-items: center; gap: 8px;
}
.coin-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe27a, #f5b921 70%);
  border: 2px solid #c8860d; color: #8a5a00; font-size: 13px; font-weight: 900;
  flex-shrink: 0;
}
#minimap {
  width: 200px; height: 200px; border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}

/* здоров'я */
#health { position: absolute; left: 18px; bottom: 18px; width: 290px; }
/* броня */
#armor-bar {
  display: none; height: 12px; margin-bottom: 5px;
  background: rgba(0,0,0,.55); border: 2px solid var(--ui-border);
  border-radius: 8px; overflow: hidden;
}
#armor-fill {
  height: 100%; width: 100%; border-radius: 6px;
  background: linear-gradient(180deg, #9fd8ff, #4a8ad4);
  transition: width .25s ease;
}
/* активні бафи */
#buffs { display: flex; gap: 8px; margin-bottom: 6px; }
.buff {
  display: flex; align-items: center; gap: 3px; padding: 3px 9px;
  background: rgba(0,0,0,.55); border: 2px solid var(--ui-border); border-radius: 12px;
  animation: buff-pop .25s ease;
}
.buff-icon { font-size: 17px; }
.buff-t { color: #ffd23f; font-weight: 900; font-size: 14px; }
@keyframes buff-pop { from { transform: scale(0.6); } to { transform: scale(1); } }
#health-bar {
  height: 26px; background: rgba(0,0,0,.55); border: 2px solid var(--ui-border);
  border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
#health-fill {
  height: 100%; width: 100%; border-radius: 10px;
  background: linear-gradient(180deg, #7be887, var(--hp));
  transition: width .25s ease;
}
#health-fill.low { background: linear-gradient(180deg, #ff8a8a, var(--hp-low)); animation: hp-pulse 0.8s infinite; }
@keyframes hp-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.45); } }
#health-text {
  margin-top: 4px; color: #fff; font-weight: 800; font-size: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,.8); padding-left: 6px;
}

/* патрони */
#ammo { position: absolute; right: 18px; bottom: 18px; text-align: right; }
#weapon-name { color: #cfe8ff; font-weight: 800; font-size: 16px; text-shadow: 0 2px 4px rgba(0,0,0,.8); }
#ammo-nums { color: #fff; font-weight: 900; font-size: 44px; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.5); line-height: 1.1; }
#ammo-mag.low { color: var(--hp-low); }
.ammo-sep { color: #8aa3be; font-size: 30px; margin: 0 4px; }
#ammo-reserve { color: #9fb8d4; font-size: 28px; }

/* підказка взаємодії */
#prompt {
  position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  background: var(--ui-bg); border: 2px solid var(--accent); border-radius: 14px;
  padding: 12px 26px; text-align: center; opacity: 0; transition: opacity .15s;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
#prompt.show { opacity: 1; }
#prompt-text { color: #fff; font-weight: 800; font-size: 18px; }
#prompt-bar { display: none; margin-top: 8px; height: 10px; width: 220px; background: rgba(0,0,0,.5); border-radius: 6px; overflow: hidden; }
#prompt-fill { height: 100%; width: 0; background: var(--accent); border-radius: 6px; }

/* бос */
#bossbar {
  position: absolute; left: 50%; top: 24px; transform: translateX(-50%);
  width: min(560px, 70vw); display: none; text-align: center;
}
#bossbar.show { display: block; }
#boss-name { color: #ff7ad9; font-weight: 900; font-size: 19px; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,.8); margin-bottom: 6px; }
#boss-bar-bg { height: 20px; background: rgba(0,0,0,.6); border: 2px solid rgba(255,122,217,.6); border-radius: 12px; overflow: hidden; }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(180deg, #ff9be4, #e0359f); transition: width .2s; border-radius: 8px; }

/* орда */
#horde-counter {
  position: absolute; left: 50%; top: 84px; transform: translateX(-50%);
  background: rgba(160, 30, 30, 0.85); border: 2px solid rgba(255,120,120,.7); border-radius: 12px;
  color: #fff; font-weight: 900; font-size: 18px; padding: 7px 20px; display: none;
  animation: hp-pulse 1s infinite;
}
#horde-counter.show { display: block; }

/* банер */
#banner {
  position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%) scale(.8);
  text-align: center; opacity: 0; pointer-events: none; padding: 0 20px; width: 100%;
}
#banner.show { animation: banner-in .45s ease forwards; }
@keyframes banner-in {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.7); }
  60% { opacity: 1; transform: translate(-50%,-50%) scale(1.07); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
#banner-title {
  color: #fff; font-size: clamp(28px, 4.6vw, 52px); font-weight: 900; letter-spacing: 1px;
  text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.55);
}
#banner-sub { color: var(--accent); font-size: clamp(15px, 2.2vw, 22px); font-weight: 800; margin-top: 6px; text-shadow: 0 2px 8px rgba(0,0,0,.7); }

/* тости */
#toasts { position: absolute; left: 50%; bottom: 32%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ui-bg); border: 2px solid var(--ui-border); border-radius: 12px;
  color: #fff; font-weight: 700; font-size: 16px; padding: 9px 20px;
  opacity: 0; transform: translateY(12px); transition: all .35s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* віньєтка пошкоджень + лікування */
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 9; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 20, 20, 0.55) 100%);
  transition: opacity .12s;
}
#heal-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 9; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(60, 220, 110, 0.4) 100%);
}
#fps {
  position: fixed; left: 50%; transform: translateX(-50%); top: 6px; z-index: 99; display: none;
  color: #7dffb0; font-weight: 800; font-size: 13px; text-shadow: 0 1px 3px #000;
}

/* ================= ОВЕРЛЕЇ ================= */
.overlay {
  position: fixed; inset: 0; z-index: 30; display: none;
  align-items: center; justify-content: center;
  background: rgba(8, 14, 22, 0.7); backdrop-filter: blur(5px);
  height: 100dvh;
}
.overlay.show { display: flex; }
.overlay-card {
  background: linear-gradient(180deg, rgba(28, 44, 66, 0.97), rgba(18, 30, 46, 0.97));
  border: 2px solid var(--ui-border); border-radius: 24px;
  padding: 38px 48px; text-align: center; color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  max-width: min(620px, 92vw); max-height: 90vh; overflow-y: auto;
}
.overlay-card h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 900; }
.overlay-card h2 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 900; }
.overlay-card.clickable { cursor: pointer; animation: card-pulse 1.6s ease-in-out infinite; }
@keyframes card-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.overlay-card p { color: #b9d0e8; font-weight: 700; margin-top: 10px; }

.spinner { font-size: 64px; animation: spin 2.2s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* екран завантаження рівня */
#overlay-level-loading {
  background: linear-gradient(180deg, #15263c 0%, #1d3a55 55%, #234a38 100%);
}
.level-loading-inner { text-align: center; width: min(560px, 86vw); }
#ll-title {
  color: #fff; font-size: clamp(34px, 6vw, 58px); font-weight: 900;
  text-shadow: 0 4px 0 #16314e, 0 9px 28px rgba(0,0,0,.6);
  animation: float-title 3s ease-in-out infinite;
}
.ll-bar {
  position: relative; height: 18px; margin: 38px 0 22px;
  background: rgba(0,0,0,.45); border: 2px solid var(--ui-border); border-radius: 12px;
  overflow: visible;
}
.ll-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, #5ad465, #ffd23f);
  border-radius: 9px;
  animation: ll-progress 2.2s ease-in-out infinite;
}
@keyframes ll-progress {
  0% { width: 5%; }
  60% { width: 80%; }
  100% { width: 96%; }
}
.ll-zombie {
  position: absolute; top: -34px; font-size: 30px;
  animation: ll-walk 2.2s ease-in-out infinite;
}
@keyframes ll-walk {
  0% { left: 2%; transform: scaleX(1) translateY(0); }
  30% { transform: scaleX(1) translateY(-4px); }
  60% { left: 76%; transform: scaleX(1) translateY(0); }
  100% { left: 92%; transform: scaleX(1) translateY(-3px); }
}
#ll-tip { color: #ffd23f; font-weight: 800; font-size: clamp(14px, 2.2vw, 19px); text-shadow: 0 2px 6px rgba(0,0,0,.7); }


.controls-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
  margin-top: 24px; text-align: left; color: #cfe8ff; font-size: 15px; font-weight: 600;
}
.controls-grid.small { font-size: 13px; margin-top: 22px; color: #9fb8d4; }
.controls-grid b { color: var(--accent); }

.btn {
  font-family: var(--font); cursor: pointer; border: none; border-radius: 14px;
  font-size: 18px; font-weight: 900; padding: 13px 30px; margin: 6px;
  background: rgba(255,255,255,0.12); color: #fff; letter-spacing: 0.5px;
  box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .12s, filter .12s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.15); }
.btn-primary {
  background: linear-gradient(180deg, #ffe07a, #ffc233); color: #3a2c00;
  box-shadow: 0 5px 0 #c98f12, 0 8px 18px rgba(0,0,0,.35);
}
.btn.big { font-size: 22px; padding: 16px 44px; }
.btn-row { margin-top: 22px; }

.death-card h2 { color: var(--hp-low); }
.countdown { font-size: 76px; font-weight: 900; color: var(--accent); margin-top: 12px; text-shadow: 0 5px 0 rgba(0,0,0,.3); }

.victory-card h1 {
  color: var(--accent);
  text-shadow: 0 4px 0 #8a6a00, 0 10px 30px rgba(0,0,0,.5);
  animation: float-title 3s ease-in-out infinite;
}
.victory-sub { font-size: 18px; }
#victory-stats { display: flex; flex-direction: column; gap: 7px; margin: 26px auto 8px; max-width: 380px; }
.stat {
  display: flex; align-items: center; background: rgba(0,0,0,.3);
  border-radius: 12px; padding: 9px 18px; font-weight: 800; font-size: 17px;
}
.stat-icon { margin-right: 12px; font-size: 21px; }
.stat-name { flex: 1; text-align: left; color: #b9d0e8; }
.stat-val { color: var(--accent); font-size: 20px; }

/* конфеті */
#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -22px; width: 11px; height: 18px; border-radius: 3px;
  animation: confetti-fall linear infinite;
}
@keyframes confetti-fall {
  0% { transform: translateY(-30px) rotate(0deg); }
  100% { transform: translateY(105vh) rotate(640deg); }
}

/* гранати */
#grenades {
  margin-top: 4px; color: #cfe8ff; font-weight: 800; font-size: 17px;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}
#grenades.none { opacity: 0.45; }
.grenade-key { color: #8aa3be; font-size: 13px; }
/* на телефоні немає клавіші G — підказка зайва (граната кидається кнопкою 💣) */
body.touch-mode .grenade-key { display: none; }

/* комбо */
#combo {
  position: absolute; left: 50%; top: 35%; transform: translateX(-50%);
  color: #ffd23f; font-weight: 900; font-size: 34px; opacity: 0;
  text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.5);
  pointer-events: none;
}
#combo.show { opacity: 1; }
#combo.pop { animation: combo-pop .25s ease-out; }
@keyframes combo-pop {
  0% { transform: translateX(-50%) scale(1.6); }
  100% { transform: translateX(-50%) scale(1); }
}
.record-badge { color: #ffd23f; font-size: 12px; font-weight: 900; margin-left: 6px; }
.stat.best { background: rgba(255, 210, 63, 0.12); }

/* ================= МОБІЛЬНЕ КЕРУВАННЯ ================= */
/* тач-кермо видно ЛИШЕ в бою (body.in-level) — на глобусі/в меню джойстик і кнопки сховані */
#touch-ui { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 15; }
body.touch-mode.in-level #touch-ui { display: block; }
/* нижні кнопки прив'язані до low edge малого вьюпорта → завжди над адресним рядком */
#touch-ui { height: 100dvh; }
#joy-base {
  display: none; position: fixed; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.35);
  pointer-events: none;
}
#joy-knob {
  position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,0.55); box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
/* бойовий кластер: сітка 3×2 + велика кнопка вогню внизу праворуч */
#touch-right {
  position: fixed; right: calc(10px + env(safe-area-inset-right)); bottom: calc(78px + env(safe-area-inset-bottom)); display: grid;
  grid-template-columns: repeat(3, 50px); gap: 6px;
  justify-items: center; align-items: center; pointer-events: auto;
}
#tb-fire { grid-column: 2 / 4; justify-self: end; }
/* службові кнопки — рядок угорі, лівіше мінімапи (мінімапа 116px + 8px справа = 124px) */
#touch-util {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); right: calc(132px + env(safe-area-inset-right)); display: flex; gap: 6px; pointer-events: auto;
}
/* компактний HUD у тач-режимі: нічого не накладається */
body.touch-mode #ammo { right: calc(214px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); }
body.touch-mode #health { bottom: calc(14px + env(safe-area-inset-bottom)); left: calc(12px + env(safe-area-inset-left)); }
body.touch-mode #topright { top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); gap: 4px; }
body.touch-mode #minimap { width: 116px; height: 116px; }
/* монети стоять у колонці #topright НАД мінімапою (справа), а не окремим блоком ліворуч —
   так увесь верхній лівий простір вільний для службового рядка, і ніщо не накладається */
body.touch-mode #coins { padding: 6px 12px; font-size: 17px; }
body.touch-mode #bossbar { top: 48px; width: min(240px, 26vw); }
body.touch-mode #boss-name { font-size: 12px; letter-spacing: 1px; margin-bottom: 3px; }
body.touch-mode #boss-bar-bg { height: 12px; }
body.touch-mode #horde-counter { top: 108px; font-size: 14px; padding: 5px 14px; }
body.touch-mode #combo { top: 46%; font-size: 26px; }
body.touch-mode #xp-chip { display: none; }
body.touch-mode #waypoint { font-size: 13px; }
.tb {
  width: 50px; height: 50px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4);
  background: rgba(18, 30, 46, 0.55); font-size: 21px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.35); position: relative;
}
.tb.tb-big { width: 76px; height: 76px; font-size: 33px; background: rgba(200, 60, 50, 0.5); border-color: rgba(255,150,130,0.6); }
.tb.tb-small { width: 44px; height: 44px; font-size: 18px; }
.tb.active { filter: brightness(1.6); transform: scale(0.93); }
.tb-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  background: var(--accent); color: #5a3c00; border-radius: 9px;
  font-size: 11px; font-weight: 900; line-height: 18px; padding: 0 3px;
}
/* 🔫 Колесо зброї — велике, дитяче, по центру з напівпрозорим тлом */
#weapon-wheel {
  display: none; position: fixed; inset: 0; z-index: 30;
  background: rgba(6, 12, 22, 0.62);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none;
}
#weapon-wheel.show { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#weapon-wheel-title {
  color: #fff; font-size: 22px; font-weight: 900; margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8); letter-spacing: 0.5px;
}
#weapon-wheel-grid {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  max-width: 92vw; padding: 0 12px;
}
.ww-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 96px; min-height: 96px; padding: 10px 12px;
  border-radius: 18px; border: 3px solid rgba(255,255,255,0.45);
  background: rgba(20, 34, 52, 0.92); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.ww-item:active { transform: scale(0.94); }
.ww-item.ww-current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,200,60,0.35), 0 6px 18px rgba(0,0,0,.5); }
.ww-icon { font-size: 40px; line-height: 1; }
.ww-name { color: #fff; font-size: 14px; font-weight: 800; margin-top: 5px; }
.ww-ammo { color: #ffd24a; font-size: 13px; font-weight: 800; margin-top: 2px; }

/* 🎯 Чип авто-прицілу: видно лише на телефоні в режимі Малюк під час гри */
#kid-chip {
  display: none;
  position: absolute;
  left: calc(12px + env(safe-area-inset-left));
  bottom: calc(92px + env(safe-area-inset-bottom));
  background: rgba(30, 180, 100, 0.82);
  border: 2px solid rgba(100, 255, 160, 0.6);
  border-radius: 12px;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  padding: 5px 12px;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
  white-space: nowrap;
  z-index: 11;
}
body.touch-mode.kid-mode.in-level #kid-chip { display: block; }
/* на малих екранах (ландшафт 360px висоти) трохи підіймаємо */
@media (max-height: 460px) {
  #kid-chip { bottom: calc(80px + env(safe-area-inset-bottom)); font-size: 11px; padding: 4px 10px; }
}

/* рядок авто-прицілу у тач-коучі (показується лише в kid-mode) */
.coach-auto {
  display: none;
  color: #7dffb0;
  font-weight: 800;
  font-size: 15px;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
  margin-top: 8px;
  text-align: center;
}
body.kid-mode .coach-auto { display: block; }

/* 🐣 Режим Малюк: більші кнопки + ховаємо рідковживане для найменших */
body.kid-mode .tb { width: 60px; height: 60px; font-size: 26px; }
body.kid-mode .tb.tb-big { width: 92px; height: 92px; font-size: 40px; }
body.kid-mode .tb.tb-small { width: 52px; height: 52px; font-size: 22px; }
body.kid-mode #tb-dance,
body.kid-mode #tb-camera,
body.kid-mode #tb-scope { display: none; }
/* сітка кластера мусить повторювати розмір кнопки Малюка (60px), інакше сусідні кнопки налазять */
body.kid-mode #touch-right { grid-template-columns: repeat(3, 60px); gap: 8px; }

/* телефон у ландшафті (низька висота, типово з адрес-баром браузера ~360–460px):
   кластер дій мусить прочистити мінімапу, тож опускаємо його нижче, трохи стискаємо
   мінімапу й кнопку вогню Малюка, а службовий рядок тримаємо лівіше мінімапи */
@media (max-height: 460px) {
  .tb { width: 44px; height: 44px; font-size: 18px; }
  .tb.tb-big { width: 66px; height: 66px; font-size: 28px; }
  #touch-right { grid-template-columns: repeat(3, 44px); gap: 5px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* кластер опустився на 10px і стиснувся (44 + 5 + 66 = 115) → оптика над ним ≈ 133px */
  #tb-scope { bottom: calc(182px + env(safe-area-inset-bottom)); }
  body.touch-mode #minimap { width: 84px; height: 84px; }
  /* службовий рядок не повинен залазити під мінімапу (мінімапа: 84px + 8px справа) */
  body.touch-mode #touch-util { right: calc(100px + env(safe-area-inset-right)); }
  /* 🐣 Малюк: трохи менша кнопка вогню, щоб увесь високий кластер прочистив мінімапу */
  body.kid-mode .tb.tb-big { width: 72px; height: 72px; font-size: 30px; }
}

/* компактний HUD на малих екранах */
@media (max-width: 900px), (max-height: 560px) {
  #mission-panel { min-width: 180px; max-width: 230px; padding: 8px 10px; }
  .mission { font-size: 11.5px; padding: 2px 0; }
  .panel-title { font-size: 10px; margin-bottom: 4px; }
  #minimap { width: 120px; height: 120px; }
  #coins { font-size: 16px; padding: 5px 12px; }
  #health { width: 190px; }
  #health-bar { height: 18px; }
  #ammo-nums { font-size: 30px; }
  #ammo-reserve { font-size: 20px; }
  #weapon-name { font-size: 13px; }
  #grenades { font-size: 13px; }
  #banner-title { font-size: 26px; }
  #banner-sub { font-size: 14px; }
  .overlay-card { padding: 20px 22px; }
  .controls-grid { font-size: 12px; gap: 5px 14px; margin-top: 14px; }
}

/* ================= МАГАЗИН ================= */
.shop-card { width: min(940px, 96vw); max-width: min(940px, 96vw); }
.shop-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.shop-balance { font-size: 24px; font-weight: 900; color: var(--accent); }
.btn-x {
  font-size: 20px; font-weight: 900; color: #fff; background: rgba(255,255,255,.12);
  border: none; border-radius: 10px; width: 42px; height: 42px; cursor: pointer;
}
.btn-x:hover { background: rgba(255, 90, 90, 0.5); }
#shop-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px; margin-top: 12px;
  max-height: min(64vh, 620px); overflow-y: auto; padding-right: 6px;
}
.shop-cat {
  grid-column: 1 / -1; text-align: left; color: var(--accent);
  font-weight: 900; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  margin-top: 6px; border-bottom: 1px solid var(--ui-border); padding-bottom: 4px;
}
.shop-item {
  position: relative;
  background: rgba(255,255,255,0.07); border: 2px solid var(--ui-border);
  border-radius: 16px; padding: 16px 12px; cursor: pointer; transition: all .14s;
}
.shop-item:hover { transform: translateY(-3px); border-color: var(--accent); background: rgba(255,255,255,0.12); }
.shop-item.poor { opacity: 0.55; }
.shop-item.maxed { opacity: 0.45; cursor: default; }
.shop-item.maxed:hover { transform: none; border-color: var(--ui-border); }
.shop-icon { font-size: 38px; }
.shop-name { font-weight: 900; font-size: 17px; margin-top: 6px; }
.shop-lvl { color: #9fb8d4; font-size: 13px; }
.shop-desc { color: #b9d0e8; font-size: 13px; font-weight: 600; margin-top: 3px; min-height: 32px; }
.shop-price { color: var(--accent); font-weight: 900; font-size: 18px; margin-top: 6px; }
.shop-hint { margin-top: 18px; color: #9fb8d4; font-size: 13px; }
.shop-hint b { color: var(--accent); }

/* ================= ОНОВЛЕННЯ 4: ШТОРМ І ЗОРЯНИЙ ШЛЯХ ================= */

/* живе меню глобуса */
#globe-ui h1 { animation: float-title 4.5s ease-in-out infinite; }
@keyframes float-title { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
/* ☰ кнопка меню — у верхньому лівому куті, не над центром глобуса */
.globe-menu-btn {
  position: absolute; left: calc(14px + env(safe-area-inset-left));
  top: calc(14px + env(safe-area-inset-top));
  pointer-events: auto; font-size: 16px; font-weight: 900; padding: 10px 16px;
  z-index: 12;
}
/* список кнопок усередині висувного ☰-меню */
#menu-list { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
#menu-list .globe-act { font-size: 15px; padding: 11px 16px; text-align: left; width: 100%; }
#overlay-menu .overlay-card {
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 24px); overflow: hidden;
}
#overlay-menu #menu-list {
  overflow-y: auto; padding-right: 4px;
  max-height: min(540px, calc(100dvh - 180px));
  -webkit-overflow-scrolling: touch;
}

/* 🌍 список країн — компактна горизонтальна стрічка чіпів (не над глобусом) */
#country-list {
  pointer-events: auto; display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; max-width: min(94vw, 760px);
  overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch;
}
.country-item {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  background: rgba(28, 44, 66, 0.9); border: 2px solid var(--ui-border);
  border-radius: 14px; padding: 8px 12px; cursor: pointer; font-weight: 800;
  color: #fff; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.35);
  transition: transform .12s, border-color .12s;
}
.country-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.country-item.locked { opacity: 0.55; }
.country-item .ci-flag { font-size: 18px; }
.country-item .ci-name { font-size: 14px; }
.country-item .ci-badge { font-size: 14px; }

/* головні кнопки: ГРАТИ / ГРАТИ РАЗОМ */
.globe-play-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.globe-play {
  pointer-events: auto; font-size: clamp(17px, 2.2vw, 22px); font-weight: 900;
  padding: 16px 34px; border-radius: 16px; border-width: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.globe-play:hover { transform: translateY(-3px) scale(1.03); }
.globe-play.coop-btn { background: rgba(26, 92, 78, 0.9); border-color: rgba(77, 214, 168, 0.6); color: #eafff6; }
.globe-play.coop-btn:hover { border-color: #4dd6a8; }
.globe-act {
  position: relative; font-size: 15px; font-weight: 900; padding: 11px 18px;
  background: rgba(28, 44, 66, 0.85); border: 2px solid var(--ui-border);
  pointer-events: auto; /* #globe-ui має pointer-events:none — кнопки мусять ловити кліки самі */
}
.globe-act:hover { border-color: var(--accent); transform: translateY(-2px); }
.globe-act.locked { opacity: 0.55; }
.act-badge {
  display: none; min-width: 20px; height: 20px; border-radius: 10px; margin-left: 4px;
  background: #ff5d5d; color: #fff; font-size: 12px; line-height: 20px; padding: 0 5px;
}
.act-badge.show { display: inline-block; animation: buff-pop .3s ease; }

/* bump-анімація (монети, місії) */
.bump { animation: card-bump .4s ease; }
@keyframes card-bump { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* стрілка-вказівник до цілі */
#waypoint {
  position: fixed; left: 0; top: 0; display: none; z-index: 11;
  pointer-events: none; font-weight: 900; text-align: center; will-change: transform;
}
#waypoint.show { display: block; }
#wp-arrow {
  display: none; font-size: 26px; color: var(--accent);
  text-shadow: 0 0 8px rgba(0,0,0,.8); line-height: 1;
}
#waypoint.edge #wp-arrow { display: block; }
#wp-label {
  display: inline-block; background: rgba(15, 25, 40, 0.75); border: 2px solid rgba(255, 210, 63, 0.55);
  border-radius: 12px; color: #fff; font-size: 14px; padding: 4px 10px; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
#waypoint.on #wp-label { animation: wp-bob 1.4s ease-in-out infinite; }
@keyframes wp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* зірковий рівень (XP) */
#xp-chip {
  background: var(--ui-bg); border: 2px solid var(--ui-border); border-radius: 12px;
  padding: 5px 12px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
#xp-lvl { color: #ffd23f; font-weight: 900; font-size: 15px; white-space: nowrap; }
#xp-bar { width: 70px; height: 8px; background: rgba(0,0,0,.5); border-radius: 5px; overflow: hidden; }
#xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #ff9d3f); border-radius: 5px; transition: width .3s; }

/* чипи гаджетів біля гранат */
#gadget-chips { color: #cfe8ff; font-weight: 800; font-size: 14px; margin-top: 3px; text-shadow: 0 2px 4px rgba(0,0,0,.8); }
#gadget-chips .none { opacity: 0.45; }

/* панелі глобуса (пасс/завдання/гардероб) */
.panel-card { width: min(640px, 94vw); max-width: min(640px, 94vw); text-align: left; }
.panel-card.wide { width: min(820px, 96vw); max-width: min(820px, 96vw); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-sub { color: #9fb8d4; font-size: 14px; font-weight: 600; margin-top: 4px; }
#pass-progress { margin: 14px 0 10px; color: #fff; font-weight: 800; font-size: 16px; }
#pass-progress .xpbar { height: 14px; background: rgba(0,0,0,.5); border-radius: 8px; overflow: hidden; margin-top: 6px; }
#pass-progress .xpbar div { height: 100%; background: linear-gradient(90deg, #ffd23f, #ff9d3f); border-radius: 8px; }
#pass-track { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 6px; }
.pass-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  background: rgba(255,255,255,0.06); border: 2px solid var(--ui-border); border-radius: 12px;
}
.pass-row.got { opacity: 0.55; }
.pass-row.current { border-color: var(--accent); background: rgba(255, 210, 63, 0.1); }
.pass-row.locked { opacity: 0.8; }
.pass-lvl { min-width: 46px; text-align: center; color: var(--accent); font-weight: 900; font-size: 17px; }
.pass-ico { font-size: 26px; }
.pass-name { flex: 1; color: #fff; font-weight: 800; font-size: 15px; }
.pass-state { font-size: 18px; }

/* завдання дня */
#quest-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.quest-row {
  padding: 12px 14px; background: rgba(255,255,255,0.06);
  border: 2px solid var(--ui-border); border-radius: 14px;
}
.quest-row.done { border-color: #58c14c; background: rgba(88, 193, 76, 0.12); }
.quest-title { color: #fff; font-weight: 800; font-size: 16px; }
.quest-reward { color: var(--accent); font-weight: 800; font-size: 13px; margin-top: 3px; }
.quest-bar { height: 10px; background: rgba(0,0,0,.5); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.quest-bar div { height: 100%; background: linear-gradient(90deg, #6fd86f, #3cba4d); border-radius: 6px; }
.quest-prog { color: #9fb8d4; font-weight: 700; font-size: 13px; margin-top: 4px; }

/* гардероб */
.ward-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.ward-section { color: var(--accent); font-weight: 900; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; margin: 14px 0 8px; border-bottom: 1px solid var(--ui-border); padding-bottom: 4px; }
.ward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ward-card {
  background: rgba(255,255,255,0.07); border: 2px solid var(--ui-border); border-radius: 14px;
  padding: 12px 8px; text-align: center; cursor: pointer; transition: all .14s;
}
.ward-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.ward-card.equipped { border-color: #58c14c; background: rgba(88, 193, 76, 0.14); }
.ward-card.locked { opacity: 0.45; cursor: default; }
.ward-card.locked:hover { transform: none; border-color: var(--ui-border); }
.ward-ico { font-size: 34px; }
.ward-name { color: #fff; font-weight: 800; font-size: 14px; margin-top: 5px; }
.ward-desc { color: #cfe0f5; font-weight: 700; font-size: 12px; line-height: 1.25; margin-top: 5px; min-height: 30px; }
.ward-stat { color: var(--accent); font-weight: 900; font-size: 12px; margin-top: 4px; }
.ward-tag { font-size: 12px; font-weight: 700; color: #9fb8d4; margin-top: 3px; }
.ward-card.equipped .ward-tag { color: #58c14c; }
.ward-try {
  margin-top: 7px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--ui-border);
  background: rgba(255,210,63,.16); color: var(--accent); font: inherit; font-size: 12px; font-weight: 900; cursor: pointer;
}
.ward-try:hover { border-color: var(--accent); background: rgba(255,210,63,.28); }
.hero-swatch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 4px 0; }
.hero-swatch-lbl { color: #9fb8d4; font-weight: 800; font-size: 13px; min-width: 72px; margin-right: 6px; }
.hero-swatch { width: 40px; height: 40px; border-radius: 9px; border: 2px solid rgba(255,255,255,.3); margin: 3px; cursor: pointer; transition: all .14s; padding: 0; }
.hero-swatch.on { border-color: #fff; transform: scale(1.12); }
/* 🎨 редактор кастом-героя: 3D-прев'ю + контролі */
.hero-editor { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.hero-stage { flex: 0 0 260px; }
.hero-preview { width: 260px; height: 300px; border-radius: 14px; background: linear-gradient(180deg, #bfe3ff, #e7d2ff); flex: 0 0 auto; box-shadow: inset 0 0 0 1px var(--ui-border); }
.hero-preview-tools { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.hero-view-btn, .hero-pose-btn {
  min-height: 34px; border: 1px solid var(--ui-border); border-radius: 8px;
  background: rgba(255,255,255,0.08); color: #fff; font-weight: 800; cursor: pointer;
}
.hero-view-btn.on, .hero-pose-btn.on {
  border-color: #58c14c;
  background: rgba(88, 193, 76, 0.22);
}
.hero-view-btn { width: 40px; }
.hero-pose-btn { flex: 1; padding: 0 8px; }
#hero-zoom { flex: 1; min-width: 86px; }
.hero-random { margin: 0 0 8px; }
.hero-controls { flex: 1 1 320px; min-width: 280px; }
.hero-sub { color: var(--accent); font-weight: 900; font-size: 13px; margin: 12px 0 6px; }
.hero-parts { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.hero-pick { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 9px; border: 2px dashed rgba(255,255,255,.6); margin: 3px; cursor: pointer; font-size: 16px; overflow: hidden; position: relative; }
.hero-pick input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; border: 0; padding: 0; }
@media (max-width: 640px) { .hero-stage, .hero-preview { width: 100%; flex-basis: 100%; } .hero-preview { height: 240px; } }
#wardrobe-content { max-height: 62vh; overflow-y: auto; padding-right: 6px; }

/* шторм */
.storm-sub { color: #d8c2f2; font-weight: 700; }
#storm-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }

/* ⚔️ PvP: табло фрагів */
#pvp-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
#pvp-stats .stat.me { outline: 2px solid var(--accent); }

/* 👥 лічильник гравців у лобі (до 50) */
.lobby-count { color: var(--accent); font-weight: 800; margin-bottom: 8px; text-align: center; }

/* ================= ОНОВЛЕННЯ 5 ================= */
/* 🔭 оптичний приціл снайперки */
#scope {
  position: fixed; inset: 0; display: none; pointer-events: none; z-index: 12;
  background: radial-gradient(circle at 50% 50%, transparent 0%, transparent 31%,
    rgba(5, 10, 16, 0.55) 36%, rgba(3, 6, 10, 0.97) 44%, #02050a 52%);
}
#scope.show { display: block; }
.scope-cross { position: absolute; background: rgba(20, 30, 40, 0.85); }
.scope-h { left: 50%; top: 50%; width: min(62vh, 62vw); height: 2px; transform: translate(-50%, -50%); }
.scope-v { left: 50%; top: 50%; width: 2px; height: min(62vh, 62vw); transform: translate(-50%, -50%); }
.scope-tick { position: absolute; left: 50%; width: 14px; height: 2px; background: rgba(20, 30, 40, 0.85); transform: translateX(-50%); }
.scope-t1 { top: calc(50% + 7vh); }
.scope-t2 { top: calc(50% + 12vh); }
/* кнопка оптики на мобільному — НАД бойовим кластером (а не поверх кнопок дій).
   Кластер: bottom 78px + висота сітки (top-row 50 + gap 6 + fire 76 = 132) + зазор 8 → ~218px. */
#tb-scope { position: fixed; right: calc(10px + env(safe-area-inset-right)); bottom: calc(276px + env(safe-area-inset-bottom)); display: none; pointer-events: auto; }
#tb-scope.avail { display: block; }
#tb-scope.on { background: rgba(255, 210, 63, 0.45); border-color: var(--accent); }

/* 📣 тач-кнопка командних пінгів: показуємо ЛИШЕ у кооп-рівні (клас .avail з hud.js) */
#tb-ping { display: none; }
#tb-ping.avail { display: block; }
/* ✋ кнопка взаємодії: коли поряд є об'єкт (вежа/мегабокс/самокат/барикада) — пульсуюча жовта рамка.
   #tb-interact завжди видима, тож НЕ чіпаємо display — лише підсвітка. */
#tb-interact.avail {
  border-color: var(--accent);
  background: rgba(255, 210, 63, 0.28);
  animation: tb-interact-pulse 0.9s ease-in-out infinite;
}
@keyframes tb-interact-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,.35), 0 0 0 0 rgba(255, 210, 63, 0.55); }
  50%      { box-shadow: 0 4px 12px rgba(0,0,0,.35), 0 0 0 7px rgba(255, 210, 63, 0); }
}

/* вкладки магазину */
#shop-tabs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.shop-tab {
  padding: 8px 16px; border-radius: 12px; border: 2px solid var(--ui-border);
  background: rgba(255,255,255,0.06); color: #cfe0f5; font-weight: 800; font-size: 14px;
  cursor: pointer; font-family: var(--font);
}
.shop-tab:hover { border-color: var(--accent); }
.shop-tab.on { background: rgba(255, 210, 63, 0.16); border-color: var(--accent); color: var(--accent); }

/* 🔄 портретна орієнтація на телефоні — чистий повноекранний екран «поверни телефон».
   Непрозоре тло + перехоплення дотиків повністю ховають захаращене меню, що клекоче знизу. */
#rotate-hint {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(circle at 50% 38%, #16263b 0%, #0a121e 70%, #060b13 100%);
  color: #fff; pointer-events: auto;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 30px;
}
#rotate-hint .rh-icon { font-size: 96px; animation: rh-spin 2s ease-in-out infinite; }
@keyframes rh-spin { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(90deg); } }
#rotate-hint .rh-text { font-size: 24px; font-weight: 900; }
#rotate-hint .rh-sub { font-size: 15px; color: #9fb8d4; font-weight: 700; }
/* портрет на телефоні І планшеті (до 1024px) — HUD розрахований на ландшафт,
   тож просимо повернути пристрій. Ландшафт планшета (ширина > висота) не зачіпається. */
@media (orientation: portrait) and (max-width: 1024px) {
  body.touch-mode #rotate-hint { display: flex; }
}

/* ⌨️→📱 На телефоні клавіатурні підказки зайві — ховаємо, показуємо легенду дотику */
.touch-legend { display: none; }
body.touch-mode .keyboard-grid { display: none; }
body.touch-mode .touch-legend {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  margin-top: 20px; text-align: left;
  color: #d6ecff; font-size: clamp(15px, 2.4vw, 19px); font-weight: 800;
}
.touch-legend span {
  background: rgba(255,255,255,0.07); border-radius: 12px;
  padding: 9px 14px; line-height: 1.25;
}
.touch-legend b { font-size: 1.35em; margin-right: 6px; }
.touch-legend i { color: #ffd23f; font-style: normal; font-weight: 800; }

/* 👆 Перше знайомство з керуванням — повноекранний оверлей, з'являється раз */
#touch-coach { display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 12, 20, 0.82); backdrop-filter: blur(2px);
  color: #fff; font-family: var(--font);
  opacity: 1; /* видимість гарантована display+opacity, НЕ анімацією (інакше reduced-motion/headless лишає коуч прозорим) */
  transition: opacity .35s ease;
}
body.touch-mode #touch-coach.show { display: block; }
.coach-zone { position: absolute; top: 0; bottom: 0; width: 42%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.coach-left { left: 0; border-right: 3px dashed rgba(90, 212, 101, 0.55); }
.coach-right { right: 0; border-left: 3px dashed rgba(77, 195, 255, 0.55); }
.coach-arrow { font-size: clamp(54px, 12vw, 96px); animation: coach-bob 1.2s ease-in-out infinite; }
.coach-arrow-down { animation: coach-bob-down 1.1s ease-in-out infinite; }
@keyframes coach-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes coach-bob-down { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
.coach-label { text-align: center; font-weight: 900; letter-spacing: 1px;
  font-size: clamp(20px, 4vw, 34px); text-shadow: 0 3px 10px rgba(0,0,0,.7); }
.coach-label small { display: block; font-size: 0.5em; font-weight: 800; color: #cfe8ff; letter-spacing: 0; margin-top: 4px; }
/* стрілка «вогонь» націлена на кнопку 🔫 у правому нижньому куті */
.coach-fire { position: absolute; right: calc(34px + env(safe-area-inset-right)); bottom: calc(150px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2; }
.coach-fire .coach-label { color: #ff6b5e; }
.coach-tap { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center; font-size: clamp(16px, 3vw, 22px); font-weight: 900; color: #ffd23f;
  animation: coach-pulse 1.3s ease-in-out infinite; }
@keyframes coach-pulse { 0%,100% { opacity: .6; } 50% { opacity: 1; } }

/* ============ 🤝 Кооператив ============ */
.globe-act.coop-btn { background: rgba(26, 92, 78, 0.85); border-color: rgba(77, 214, 168, 0.5); }
.globe-act.coop-btn:hover { border-color: #4dd6a8; }

.coop-card { max-width: 480px; width: min(92vw, 480px); }
.coop-card-wide { max-width: 760px; width: min(94vw, 760px); }
.coop-columns { display: flex; gap: 18px; text-align: left; align-items: stretch; }
.coop-left { flex: 1.05; min-width: 0; }
.coop-right {
  flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px;
  padding: 12px 14px; max-height: 420px; overflow-y: auto;
}
.coop-me { font-size: 15px; color: #bcd2e2; margin: 2px 0 10px; }
.coop-me b { color: #fff; font-size: 17px; }
.coop-rename {
  background: none; border: none; cursor: pointer; font-size: 15px;
  opacity: 0.75; padding: 2px 4px;
}
.coop-rename:hover { opacity: 1; }
.coop-public {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  color: #9fb6c9; font-size: 13px; font-weight: 700; margin-top: 10px; cursor: pointer;
}
.coop-public input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.coop-online-head {
  display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 16px;
  color: #d9ecdf; margin-bottom: 8px;
}
.coop-today-head {
  font-weight: 800; font-size: 14px; color: #c6d2e6; margin: -2px 0 10px 18px;
}
.online-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #4dd6a8;
  box-shadow: 0 0 8px #4dd6a8; animation: online-pulse 1.6s ease-in-out infinite;
}
@keyframes online-pulse { 50% { opacity: 0.45; } }
.coop-side-title {
  font-weight: 900; font-size: 12px; letter-spacing: 1.5px; color: var(--accent);
  margin: 10px 0 6px; text-transform: uppercase;
}
.coop-side-empty { color: #7e94a8; font-size: 13px; font-weight: 600; padding: 6px 2px; line-height: 1.5; }
.coop-rooms { display: flex; flex-direction: column; gap: 6px; }
.coop-room {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px; padding: 6px 8px;
}
.cr-mode { font-size: 20px; }
.cr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cr-info b { font-size: 14px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-info small { font-size: 11px; color: #9fb6c9; font-weight: 700; }
.cr-n { font-size: 12px; font-weight: 800; color: #bcd2e2; }
.cr-join { padding: 6px 10px; font-size: 12px; }
.cr-join[disabled] { opacity: 0.4; cursor: default; }
.coop-players { display: flex; flex-wrap: wrap; gap: 6px; }
.coop-player {
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: #d7e6f2;
}
.coop-player.me { border-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) {
  .coop-columns { flex-direction: column; }
  .coop-right { max-height: 220px; }
}
.coop-label { display: block; text-align: left; font-weight: 800; font-size: 14px; color: #bcd2e2; margin: 10px 2px 6px; }
.coop-input {
  width: 100%; box-sizing: border-box; font-family: var(--font); font-weight: 800; font-size: 20px;
  padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.25);
  background: rgba(10, 20, 30, 0.6); color: #fff; outline: none;
}
.coop-input:focus { border-color: var(--accent); }
.coop-code { text-transform: uppercase; letter-spacing: 8px; text-align: center; font-size: 26px; width: 170px; }
.coop-wide { width: 100%; margin-top: 14px; }
.coop-or { color: #8aa0b5; font-weight: 700; margin: 16px 0 10px; font-size: 14px; }
.coop-join-row { display: flex; gap: 10px; justify-content: center; align-items: stretch; }
.coop-join-row .btn { flex: 1; }
.coop-error {
  display: none; margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  background: rgba(180, 50, 50, 0.25); border: 1px solid rgba(255, 100, 100, 0.5);
  color: #ffb3b3; font-weight: 700; font-size: 14px;
}

.lobby-code-box { margin: 6px 0 14px; }
.lobby-code-label { color: #8aa0b5; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.lobby-code {
  font-size: 52px; font-weight: 900; letter-spacing: 16px; color: var(--accent);
  text-shadow: 0 4px 0 #8a6a00, 0 8px 24px rgba(0,0,0,.5); padding-left: 16px;
}
#lobby-roster { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lobby-player {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  font-weight: 800; font-size: 16px;
}
.lobby-player.me { border-color: var(--accent); }
.lobby-player.empty { opacity: 0.4; font-weight: 600; }
.lp-skin { font-size: 22px; }
.lp-nick { flex: 1; text-align: left; }
.lp-role { font-size: 12px; color: var(--accent); }
.lobby-section { font-weight: 900; font-size: 13px; letter-spacing: 2px; color: var(--accent); text-align: left; margin: 8px 2px 6px; }
#lobby-countries { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 6px; }
.lobby-country {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 86px;
  padding: 10px 8px; border-radius: 12px; font-size: 26px;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.12);
}
.lobby-country span { font-size: 12px; font-weight: 800; }
.lobby-country.pick { cursor: pointer; }
.lobby-country.pick:hover { border-color: rgba(255, 210, 63, 0.6); }
.lobby-country.sel { border-color: var(--accent); background: rgba(255, 210, 63, 0.12); }
.lobby-country.locked { opacity: 0.45; }

/* панель команди в бою */
#team-panel {
  position: absolute; left: 14px; top: 46%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.team-row {
  background: var(--ui-bg); border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  padding: 5px 9px; min-width: 130px;
}
.team-nick { font-size: 12px; font-weight: 800; color: #9fe8ff; }
.team-nick.dead { color: #ff8080; }
.team-hp { height: 6px; border-radius: 3px; background: rgba(0,0,0,0.5); margin-top: 3px; overflow: hidden; }
.team-hp > div { height: 100%; background: #4cff7a; border-radius: 3px; }
.team-hp > div.low { background: #ff5d5d; }

.overlay.see-through { background: rgba(8, 14, 20, 0.55); }

/* кооп: вміст не вилазить за низькі екрани (телефон у ландшафті) */
.coop-card { max-height: 92vh; overflow-y: auto; }
@media (max-height: 460px) {
  .coop-card { padding: 12px 18px; }
  .coop-card .panel-header h2 { font-size: 20px; }
  .coop-card .panel-sub { margin: 4px 0; font-size: 12px; }
  .coop-input { font-size: 16px; padding: 8px 12px; }
  .coop-or { margin: 8px 0 6px; }
  .lobby-code { font-size: 34px; letter-spacing: 10px; }
  .lobby-player { padding: 5px 10px; font-size: 14px; }
  .lobby-country { min-width: 64px; padding: 6px 6px; font-size: 20px; }
}

/* кооп: компактна панель команди на телефонах (до 4 рядків без перекриттів) */
@media (max-height: 480px) {
  #team-panel { top: 40%; gap: 4px; }
  .team-row { min-width: 96px; padding: 3px 7px; }
  .team-nick { font-size: 10px; }
}

/* кооп: перемикач режиму в лобі */
#lobby-modes { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.lobby-mode {
  padding: 9px 16px; border-radius: 12px; font-weight: 800; font-size: 14px;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.12);
}
.lobby-mode.pick { cursor: pointer; }
.lobby-mode.pick:hover { border-color: rgba(255, 210, 63, 0.6); }
.lobby-mode.sel { border-color: var(--accent); background: rgba(255, 210, 63, 0.12); }
.lobby-mode.locked { opacity: 0.45; }

/* 🏆 Ліга */
.globe-act.league-btn { background: rgba(110, 84, 20, 0.85); border-color: rgba(255, 210, 63, 0.5); }
.globe-act.league-btn:hover { border-color: var(--accent); }
.league-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.league-tab {
  font-family: var(--font); cursor: pointer; font-weight: 800; font-size: 14px;
  padding: 8px 16px; border-radius: 12px; color: #fff;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.12);
}
.league-tab.on { border-color: var(--accent); background: rgba(255, 210, 63, 0.12); }
.league-countries { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.league-cty {
  font-size: 20px; cursor: pointer; padding: 4px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.12);
}
.league-cty.on { border-color: var(--accent); background: rgba(255, 210, 63, 0.12); }
.league-list { max-height: 46vh; overflow-y: auto; text-align: left; }
.league-loading { color: #8aa0b5; font-weight: 700; padding: 18px; text-align: center; }
.league-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px;
  font-weight: 800; font-size: 15px; margin-bottom: 3px;
  background: rgba(255,255,255,0.04);
}
.league-row.me { border: 2px solid var(--accent); background: rgba(255, 210, 63, 0.1); }
.league-row.gap { margin-top: 10px; }
.lr-rank { min-width: 34px; color: var(--accent); }
.lr-nick { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-team { color: #8aa0b5; font-size: 12px; font-weight: 700; }
.lr-score { color: #9fe8ff; }
/* місце у світі на фінальних екранах */
.league-place { margin: 8px 0 2px; font-weight: 900; font-size: 18px; color: var(--accent); }


.shop-surge { font-size: 12px; }

/* ============ 🎮 меню «Грати» (соло-режими) ============ */
.solo-card { max-width: 560px; width: min(94vw, 560px); }
.solo-modes { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.solo-mode {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; padding: 12px 16px; transition: border-color .15s, transform .15s;
}
.solo-mode:hover { border-color: var(--accent); transform: translateY(-2px); }
.solo-mode.sel { border-color: var(--accent); background: rgba(255, 210, 63, 0.1); }
.solo-mode.locked { opacity: 0.5; cursor: default; }
.solo-mode.locked:hover { border-color: rgba(255, 255, 255, 0.12); transform: none; }
.sm-ico { font-size: 34px; }
.sm-body { flex: 1; min-width: 0; }
.sm-name { font-weight: 900; font-size: 17px; letter-spacing: 1px; color: #fff; }
.sm-desc { font-size: 13px; color: #9fb6c9; font-weight: 700; margin-top: 2px; }
.sm-go { font-size: 20px; color: var(--accent); }
.solo-countries { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.solo-cty-title { width: 100%; font-weight: 900; font-size: 13px; letter-spacing: 1.5px; color: var(--accent); }
.solo-cty { font-size: 14px; padding: 9px 14px; }

/* 🤝 чип кімнати в HUD: код + лічильник + множник зомбі */
#coop-room {
  background: rgba(13, 26, 38, 0.78); border: 2px solid rgba(77, 214, 168, 0.45);
  border-radius: 12px; padding: 6px 12px; color: #d7efe5; font-weight: 800; font-size: 14px;
  text-align: center; letter-spacing: 0.5px; cursor: pointer;
}
#coop-room b { color: #4dd6a8; letter-spacing: 2px; }

/* 📣 колесо пінгів: 5 фраз великими кнопками (зручно з телефона) */
.ping-btn {
  font-size: 18px; display: block; width: 100%; margin: 6px 0; padding: 12px;
  border-radius: 12px; border: none; background: rgba(255, 255, 255, 0.1);
  color: #fff; cursor: pointer; text-align: left;
}
.ping-btn:hover { background: rgba(255, 255, 255, 0.18); }

@media (max-width: 900px) {
  .globe-menu-btn { font-size: 14px; padding: 8px 12px; }
  .globe-play { font-size: 15px; padding: 11px 20px; }
  .country-item { padding: 7px 10px; }
  .country-item .ci-name { font-size: 13px; }
}

/* короткий ландшафт (телефон боком): тісно по висоті — підтискаємо все */
@media (max-height: 460px) {
  #globe-ui { padding: 8px 16px; }
  #globe-ui h1 { font-size: clamp(20px, 4vw, 30px); }
  .globe-sub { display: none; }
  .globe-hint { display: none; }
  #globe-progress { font-size: 14px; padding: 6px 14px; }
  .globe-play { font-size: 14px; padding: 9px 18px; }
  .country-item { padding: 5px 9px; }
  .country-item .ci-name { font-size: 12px; }
  #overlay-menu .overlay-card { padding: 12px 14px; }
  #overlay-menu #menu-list { gap: 5px; max-height: calc(100dvh - 118px); }
  #overlay-menu #menu-list .globe-act { font-size: 13px; padding: 8px 10px; }
  body.touch-mode #banner {
    top: 52%;
    width: min(560px, 58vw);
    padding: 0;
  }
}

/* 💾 панель «Мій прогрес» і аварійний екран */
.progress-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.progress-row .coop-input { width: 210px; text-transform: uppercase; letter-spacing: 3px; text-align: center; }
.cloud-status { min-height: 20px; color: #bcd2e2; font-weight: 700; font-size: 14px; margin: 6px 0 2px; }
.cloud-code { font-size: 30px; font-weight: 900; letter-spacing: 5px; color: #ffd54a; min-width: 150px; }
#crash-info { max-height: 90px; overflow: hidden; color: #8aa0b5; font-size: 11px; white-space: pre-wrap; text-align: left; margin: 10px 0; }

/* Штаб Рятівника: Мої цифри */
.hq-h { margin: 14px 0 6px; font-size: 18px; }
.hq-goal { display:flex; gap:10px; align-items:center; background:rgba(245,197,66,.12); border:1px solid rgba(245,197,66,.5); border-radius:12px; padding:10px; }
.hq-goal.empty { opacity:.8; font-size:13px; }
.hq-goal-i { font-size:30px; }
.hq-goal-n { font-weight:800; }
.hq-goal-r { font-weight:700; color:#f5c542; }
.hq-goal-d { font-size:12px; opacity:.8; }
.hq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.hq-stat { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 10px; }
.hq-stat-i { font-size: 22px; }
.hq-stat-l { flex: 1; font-size: 13px; opacity: .85; }
.hq-stat-n { font-weight: 800; font-size: 18px; }
.hq-prestige { margin-top: 10px; font-weight: 800; font-size: 16px; text-align: center; }
.hq-star { font-size: 22px; background: rgba(255,255,255,.08); border: none; border-radius: 8px; padding: 4px 8px; margin: 2px; cursor: pointer; opacity: .5; }
.hq-star.on { opacity: 1; background: #f5c542; }
.hq-star-note { font-size: 12px; opacity: .8; margin-top: 4px; }
.hq-countries { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.hq-country { text-align: center; font-size: 30px; background: rgba(255,255,255,.07); border-radius: 12px; padding: 10px 6px; }
.hq-country.locked { opacity: .4; }
.hq-country.saved { outline: 2px solid #6fe06f; }
.hq-c-name { font-size: 12px; margin-top: 4px; }
.hq-c-seals { font-size: 13px; margin-top: 4px; }
.hq-bestiary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.hq-beast { background: rgba(255,255,255,.07); border-radius: 12px; padding: 10px; text-align: center; }
.hq-beast.locked { opacity: .4; }
.hq-beast-i { font-size: 30px; }
.hq-beast-name { font-weight: 700; font-size: 14px; margin-top: 4px; }
.hq-beast-desc { font-size: 11px; opacity: .8; margin-top: 2px; }
.hq-beast-n { font-size: 11px; margin-top: 4px; opacity: .9; }
.hq-chapter { display:flex; flex-direction:column; gap:6px; }
.hq-step { display:flex; align-items:center; gap:8px; background:rgba(255,255,255,.06); border-radius:10px; padding:7px 10px; }
.hq-step.done { background:rgba(111,224,111,.14); }
.hq-st-i { font-size:18px; }
.hq-st-t { font-size:13px; }
.hq-medal { margin-top:8px; font-weight:800; color:#f5c542; text-align:center; }

/* 🎯 Моя ціль: рядок у шапці магазину + кнопка на картці товару */
.shop-goal { text-align: center; font-weight: 700; margin: 6px 0; opacity: .95; }
.shop-goal-btn {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.25); border: none; border-radius: 8px;
  padding: 2px 6px; cursor: pointer; font-size: 14px; opacity: .6;
}
.shop-goal-btn.on { opacity: 1; background: #f5c542; }
.shop-item.goal { outline: 2px solid #f5c542; }

/* 🏠 Живий Штаб */
.hqbase-row { display: flex; justify-content: center; margin: 8px 0 14px; }
.hqbase-enter { width: min(100%, 360px); }
#hqbase-ui {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 20;
}
.hqbase-counter {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

/* 🎲 Драфт «Прокачка» — великі тап-картки, кольори за тегом */
.draft-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.draft-card {
  width: 150px; min-height: 150px; padding: 16px 12px; border-radius: 18px;
  border: 3px solid rgba(255,255,255,.25); background: rgba(20,16,40,.85);
  color: #fff; font: inherit; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; transition: transform .08s;
}
.draft-card:active { transform: scale(.94); }
.draft-card .draft-icon { font-size: 48px; line-height: 1; }
.draft-card .draft-name { font-size: 16px; font-weight: 700; text-align: center; }
.draft-card.tag-power { border-color: #ff5a4d; box-shadow: 0 0 18px rgba(255,90,77,.4); }
.draft-card.tag-speed { border-color: #ffd23d; box-shadow: 0 0 18px rgba(255,210,61,.4); }
.draft-card.tag-tank  { border-color: #4db8ff; box-shadow: 0 0 18px rgba(77,184,255,.4); }

/* ===================== v126 UI: PvP · Solana-гаманець · лобі ===================== */

/* 🔗 Кнопка під'єднання Solana-гаманця — фірмовий фіолетово-бірюзовий градієнт */
#btn-coop-wallet {
  background: linear-gradient(135deg, #9945FF 0%, #14F195 100%);
  color: #0b1020; box-shadow: 0 5px 0 #5a2b99, 0 10px 28px rgba(153,69,255,.45);
  letter-spacing: .4px;
}
#btn-coop-wallet:hover { filter: brightness(1.08) saturate(1.12); }
#btn-coop-wallet:disabled { opacity: .65; cursor: progress; filter: grayscale(.35); transform: none; }
#coop-step-nick { text-align: center; padding: 4px 0 2px; }
#coop-step-nick .panel-sub { margin-bottom: 16px; line-height: 1.5; }
#coop-step-nick .coop-input { margin-top: 4px; text-align: center; }
.coop-auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: #7892a4; font-size: 12px; font-weight: 800; }
.coop-auth-divider::before, .coop-auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(150, 210, 235, .16); }
#btn-coop-wallet { margin-top: 10px; }

/* 👥 лічильник гравців — пілюля */
.lobby-count {
  display: inline-block; background: rgba(255,210,63,.14);
  border: 1px solid rgba(255,210,63,.4); border-radius: 999px;
  padding: 4px 16px; font-size: 13px; letter-spacing: 1px;
}

/* ростер на БАГАТО гравців (до 50): сітка + прокрутка, нік не ламає верстку */
#lobby-roster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px; max-height: 230px; overflow-y: auto; align-content: start;
  padding-right: 4px; margin-bottom: 12px;
}
#lobby-roster .lobby-count { grid-column: 1 / -1; justify-self: center; }
.lobby-player { padding: 7px 10px; font-size: 14px; min-width: 0; }
.lp-skin { font-size: 19px; }
.lp-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-player.me { background: rgba(255,210,63,.12); }

/* ⚔️ PvP режим-картка у лобі */
.lobby-mode[data-mode="pvp"] {
  background: linear-gradient(135deg, rgba(255,93,93,.24), rgba(153,69,255,.24));
  border: 1px solid rgba(255,93,93,.5); color: #fff; font-weight: 900;
  letter-spacing: .5px;
}

/* ⚔️ PvP кінець матчу: підсвітка лідера */
#pvp-stats .stat { transition: transform .12s; }
#pvp-stats .stat.best {
  background: linear-gradient(90deg, rgba(255,210,63,.22), rgba(255,210,63,.04));
  border-radius: 10px;
}
#overlay-pvp-end .victory-card { border-color: rgba(153,69,255,.5); }

/* 🌐 ONLINE-ONLY: офлайн-входи прибрані, лишається тільки мережева гра */
#btn-solo,                       /* 🎮 соло-гра */
#globe-progress,                 /* лічильник звільнених країн (кампанія) */
#globe-ui .globe-hint,           /* підказка «звільни країну» */
#globe-ui .globe-sub,            /* підзаголовок про зомбі/соло */
#btn-pass,                       /* 🎖️ зоряний шлях (прогресія кампанії) */
#btn-quests,                     /* 📅 щоденні завдання */
#btn-hq,                         /* 🎖️ штаб рятівника */
#btn-league {                    /* 🏆 ліга (рекорди кампанії/шторму) */
  display: none !important;
}
/* єдина дія на глобусі — мережевий PvP: робимо кнопку широкою й помітною */
.globe-play-row { justify-content: center; }
#btn-coop.globe-play {
  background: linear-gradient(135deg, #9945FF 0%, #14F195 100%);
  color: #0b1020; border: none; min-width: 280px;
  box-shadow: 0 5px 0 #5a2b99, 0 10px 28px rgba(153,69,255,.4);
}
#btn-coop.globe-play:hover { filter: brightness(1.08) saturate(1.1); }

/* ================= HUD / RESCUE OPS REDESIGN ================= */
:root {
  --hud-night: rgba(6, 15, 25, 0.91);
  --hud-panel: rgba(10, 25, 39, 0.88);
  --hud-line: rgba(100, 210, 244, 0.42);
  --hud-line-soft: rgba(180, 229, 247, 0.15);
  --hud-cyan: #67ddff;
  --hud-yellow: #ffd454;
  --hud-red: #ff685f;
  --hud-green: #6bea8b;
  --hud-texture: url('./assets/hud-tactical-texture.webp');
  --ui-bg: var(--hud-panel);
  --ui-border: var(--hud-line-soft);
  --accent: var(--hud-yellow);
}

#hud {
  color: #f4fbff;
  isolation: isolate;
  --hud-x: max(18px, env(safe-area-inset-left));
  --hud-r: max(18px, env(safe-area-inset-right));
  --hud-y: max(18px, env(safe-area-inset-top));
  --hud-b: max(18px, env(safe-area-inset-bottom));
}
#hud::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 10, 18, .28), transparent 17%, transparent 83%, rgba(3, 10, 18, .28)),
    linear-gradient(0deg, rgba(3, 10, 18, .24), transparent 18%, transparent 82%, rgba(3, 10, 18, .12));
  z-index: -1;
}

#mission-panel,
#health,
#ammo,
#coins,
#xp-chip,
#coop-room,
#prompt,
.toast,
#horde-counter,
#bossbar {
  background-image:
    linear-gradient(135deg, rgba(13, 34, 51, .94), rgba(5, 14, 24, .91)),
    var(--hud-texture);
  background-size: auto, 540px 360px;
  background-blend-mode: normal, screen;
  border: 1px solid var(--hud-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 22px rgba(27, 142, 187, .07),
    0 12px 34px rgba(0, 0, 0, .32);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
}

#mission-panel {
  left: var(--hud-x);
  top: var(--hud-y);
  min-width: 282px;
  max-width: 360px;
  padding: 14px 16px 15px 18px;
  border-radius: 5px 16px 16px 5px;
  overflow: hidden;
}
#mission-panel::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--hud-yellow), #ff9f43);
  box-shadow: 0 0 15px rgba(255, 212, 84, .55);
}
#mission-panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 1px;
  background: var(--hud-cyan);
  box-shadow: 0 0 8px var(--hud-cyan);
}
.panel-title {
  color: var(--hud-yellow);
  font-size: 11px;
  letter-spacing: 2.6px;
  margin-bottom: 9px;
  text-shadow: 0 0 14px rgba(255, 212, 84, .22);
}
.mission {
  position: relative;
  color: #edf8ff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  padding: 5px 7px 5px 0;
  border-top: 1px solid rgba(160, 221, 245, .07);
  text-shadow: 0 2px 5px rgba(0, 0, 0, .7);
}
.mission:first-child { border-top: 0; }
.mission .mi {
  display: inline-flex;
  width: 24px;
  height: 24px;
  margin-right: 7px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(105, 218, 255, .09);
  border: 1px solid rgba(105, 218, 255, .13);
  vertical-align: middle;
}
.mission.done { color: #7893a3; text-decoration: none; }

#topright {
  right: var(--hud-r);
  top: var(--hud-y);
  gap: 9px;
}
#coins {
  min-width: 98px;
  justify-content: center;
  border-radius: 10px 4px 10px 10px;
  padding: 8px 14px;
  color: var(--hud-yellow);
  font-size: 20px;
  letter-spacing: .5px;
}
.coin-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #ffcf3f;
  background: radial-gradient(circle at 35% 28%, #fff5a8 0 9%, #ffd454 10% 45%, #d78c19 78%);
  box-shadow: 0 0 14px rgba(255, 212, 84, .25);
}
#minimap {
  border: 2px solid rgba(129, 222, 255, .78);
  outline: 5px solid rgba(5, 17, 29, .78);
  box-shadow:
    0 0 0 7px rgba(103, 221, 255, .17),
    0 10px 28px rgba(0, 0, 0, .45),
    inset 0 0 22px rgba(73, 206, 255, .18);
}
#xp-chip {
  min-width: 138px;
  border-radius: 5px 10px 10px 10px;
  padding: 6px 10px;
}
#xp-lvl { color: var(--hud-yellow); font-size: 13px; }
#xp-bar { height: 6px; background: rgba(145, 195, 215, .16); }
#xp-fill { background: linear-gradient(90deg, #62d8ff, var(--hud-yellow)); box-shadow: 0 0 9px rgba(99, 217, 255, .38); }

#health {
  left: var(--hud-x);
  bottom: var(--hud-b);
  width: 330px;
  padding: 11px 13px 13px;
  border-radius: 14px 14px 14px 4px;
  overflow: hidden;
}
#health::after {
  content: '';
  position: absolute;
  left: 0;
  right: 45%;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hud-green), transparent);
  box-shadow: 0 0 12px rgba(107, 234, 139, .45);
}
#health-head {
  display: flex;
  align-items: center;
  height: 24px;
  margin-bottom: 7px;
}
.health-mark {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(107, 234, 139, .14);
  color: var(--hud-green);
  border: 1px solid rgba(107, 234, 139, .35);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.health-code {
  margin-left: 8px;
  color: #83a9ba;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}
#health-text {
  margin: 0 1px 0 auto;
  padding: 0;
  color: #fff;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .4px;
}
#buffs { margin: 0 0 7px; }
.buff { background: rgba(4, 13, 22, .7); border: 1px solid rgba(255, 212, 84, .34); border-radius: 8px; }
#armor-bar {
  height: 8px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 2px;
  background: rgba(100, 160, 190, .15);
}
#armor-fill { border-radius: 2px; background: linear-gradient(90deg, #6dc6ff, #bfe8ff); box-shadow: 0 0 10px rgba(88, 191, 255, .4); transition: width .25s ease-out; }
#health-bar {
  position: relative;
  height: 15px;
  padding: 3px;
  border: 1px solid rgba(138, 222, 166, .24);
  border-radius: 5px;
  background: rgba(1, 9, 15, .72);
  box-shadow: inset 0 0 9px rgba(0, 0, 0, .8);
  overflow: hidden;
}
/* тактичні поділки гаугу — тонкі вертикальні риски поверх смуги */
#health-bar::after {
  content: '';
  position: absolute;
  inset: 3px;
  pointer-events: none;
  border-radius: 2px;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent 9.5%, rgba(1, 9, 15, .55) 9.5%, rgba(1, 9, 15, .55) 10%);
  z-index: 2;
}
#health-ghost {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff5a5a, #ffae6b);
  box-shadow: 0 0 10px rgba(255, 90, 90, .5);
  z-index: 0;
  transition: width .5s cubic-bezier(.4, 0, .2, 1) .18s;
}
#health-fill {
  position: relative;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #2eac65, #74ef8e 74%, #d2ffb0);
  box-shadow: 0 0 12px rgba(91, 232, 132, .48);
  z-index: 1;
  transition: width .18s ease-out;
}
/* критичне HP: червоне пульсуюче світіння всієї панелі здоров'я */
#health.critical {
  border-color: rgba(255, 90, 90, .6);
  animation: hud-crit 1s ease-in-out infinite;
}
@keyframes hud-crit {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 34px rgba(0, 0, 0, .32), 0 0 0 rgba(255, 64, 64, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 34px rgba(0, 0, 0, .32), 0 0 22px rgba(255, 64, 64, .45); }
}

#ammo {
  right: var(--hud-r);
  bottom: var(--hud-b);
  width: 260px;
  min-height: 116px;
  padding: 11px 14px 12px 16px;
  border-radius: 14px 14px 4px 14px;
  text-align: left;
  overflow: hidden;
}
#ammo::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 4px;
  height: 64%;
  background: linear-gradient(0deg, var(--hud-cyan), transparent);
  box-shadow: 0 0 12px rgba(103, 221, 255, .5);
}
#weapon-head { display: flex; align-items: center; gap: 8px; }
.weapon-mark { color: var(--hud-cyan); font-size: 9px; text-shadow: 0 0 8px var(--hud-cyan); }
#weapon-name {
  color: #caefff;
  font-size: 12px;
  letter-spacing: 1.35px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ammo-nums {
  display: flex;
  align-items: baseline;
  margin: 1px 0 -1px;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  text-shadow: 0 0 14px rgba(103, 221, 255, .14), 0 3px 9px rgba(0, 0, 0, .8);
}
.ammo-sep { color: #46677b; font-size: 24px; margin: 0 7px; }
#ammo-reserve { color: #9ac5d7; font-size: 24px; letter-spacing: 0; }
/* мало набоїв — число пульсує, привертає увагу до перезарядки */
#ammo-mag.low { animation: ammo-low .7s ease-in-out infinite; }
@keyframes ammo-low { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
#grenades,
#gadget-chips {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin: 5px 6px 0 0;
  padding: 3px 8px;
  border: 1px solid rgba(142, 207, 232, .14);
  border-radius: 6px;
  background: rgba(2, 11, 19, .46);
  color: #cceaf6;
  font-size: 12px;
  text-shadow: none;
}
#gadget-chips:empty { display: none; }
.grenade-key { color: #668799; font-size: 10px; }

#crosshair { filter: drop-shadow(0 0 3px rgba(0, 0, 0, .9)); }
#crosshair::before {
  content: '';
  position: absolute;
  left: -15px;
  top: -15px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(103, 221, 255, .2);
  border-radius: 50%;
}
.ch-line { background: #e9fbff; box-shadow: 0 0 5px rgba(103, 221, 255, .75), 0 0 2px #000; }
.ch-t, .ch-b { width: 2px; left: -1px; height: 8px; }
.ch-l, .ch-r { height: 2px; top: -1px; width: 8px; }
.ch-dot { width: 3px; height: 3px; background: var(--hud-cyan); box-shadow: 0 0 7px var(--hud-cyan); }
#hitmarker { color: #ecfbff; text-shadow: 0 0 9px var(--hud-cyan), 0 0 4px #000; }
#hitmarker.crit { color: var(--hud-yellow); text-shadow: 0 0 12px rgba(255, 212, 84, .8); }

#prompt {
  bottom: 20%;
  min-width: 280px;
  padding: 11px 20px;
  border-radius: 4px 12px 4px 12px;
  border-color: rgba(255, 212, 84, .66);
}
#prompt::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hud-yellow), transparent);
}
#prompt-text { font-size: 15px; letter-spacing: .15px; }
#prompt-bar { height: 5px; margin: 8px auto 0; border-radius: 2px; }
#prompt-fill { border-radius: 2px; background: linear-gradient(90deg, #ffae43, var(--hud-yellow)); box-shadow: 0 0 8px rgba(255, 212, 84, .5); transition: width .12s linear; }

#bossbar {
  top: var(--hud-y);
  width: min(560px, 54vw);
  padding: 10px 14px 12px;
  border-radius: 5px 5px 14px 14px;
  border-color: rgba(255, 103, 157, .45);
}
#boss-name { color: #ff93bd; font-size: 14px; margin-bottom: 7px; }
#boss-bar-bg { height: 11px; border: 0; border-radius: 2px; background: rgba(1, 7, 13, .72); }
#boss-fill { border-radius: 2px; background: linear-gradient(90deg, #c62b75, #ff6d9e 72%, #ffd0e0); box-shadow: 0 0 12px rgba(255, 91, 150, .5); }
#horde-counter { top: 91px; border-radius: 7px; border-color: rgba(255, 104, 95, .55); color: #ffe7e3; font-size: 14px; letter-spacing: 1px; }

#banner { top: 25%; }
#banner-title {
  color: #fff;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 2px;
  text-shadow: 0 3px 0 #16344a, 0 0 24px rgba(90, 206, 255, .25), 0 12px 28px rgba(0, 0, 0, .48);
}
#banner-sub { color: var(--hud-yellow); font-size: clamp(14px, 1.8vw, 19px); letter-spacing: .4px; }
#toasts { bottom: 30%; }
.toast { border-radius: 5px 10px 5px 10px; border-left: 3px solid var(--hud-green); font-size: 14px; }

#wp-label {
  padding: 6px 10px;
  border: 1px solid rgba(255, 212, 84, .48);
  border-radius: 6px;
  background-image: linear-gradient(135deg, rgba(9, 23, 35, .92), rgba(5, 13, 22, .88)), var(--hud-texture);
  background-size: auto, 420px 280px;
  color: #f7fbff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .35);
}
#wp-arrow { color: var(--hud-yellow); filter: drop-shadow(0 0 5px rgba(255, 212, 84, .5)); }
#combo { color: var(--hud-yellow); letter-spacing: 1px; text-shadow: 0 0 18px rgba(255, 166, 47, .45), 0 4px 8px rgba(0, 0, 0, .8); }

.tb {
  color: #f2fbff;
  border: 1px solid rgba(130, 221, 255, .48);
  background-image: linear-gradient(145deg, rgba(20, 51, 71, .86), rgba(5, 16, 27, .86)), var(--hud-texture);
  background-size: auto, 280px 180px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 16px rgba(0, 0, 0, .4), 0 0 0 3px rgba(9, 29, 43, .35);
}
.tb.tb-big { background-image: linear-gradient(145deg, rgba(157, 47, 43, .92), rgba(63, 18, 22, .9)), var(--hud-texture); border-color: rgba(255, 139, 123, .78); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 4px rgba(255, 77, 68, .12), 0 8px 18px rgba(0,0,0,.46); }
.tb.active { filter: brightness(1.35); transform: scale(.94); box-shadow: inset 0 0 18px rgba(103, 221, 255, .28), 0 3px 8px rgba(0,0,0,.4); }
#joy-base { background: rgba(7, 22, 34, .38); border: 1px solid rgba(117, 218, 255, .42); box-shadow: inset 0 0 28px rgba(36, 154, 199, .12), 0 0 0 5px rgba(3, 12, 20, .18); }
#joy-knob { background: radial-gradient(circle at 35% 30%, #9bebff, #28799d 65%, #0d3047); border: 1px solid rgba(201, 243, 255, .7); }

@media (max-width: 900px), (max-height: 560px) {
  #mission-panel { min-width: 190px; max-width: 238px; padding: 9px 10px 10px 13px; }
  .mission { font-size: 11px; padding: 3px 4px 3px 0; }
  .mission .mi { width: 19px; height: 19px; margin-right: 4px; border-radius: 5px; }
  .panel-title { font-size: 9px; margin-bottom: 4px; }
  #health { width: 235px; padding: 8px 10px 10px; }
  #health-head { height: 20px; margin-bottom: 5px; }
  .health-mark { width: 20px; height: 20px; font-size: 16px; }
  #health-bar { height: 12px; }
  #health-text { font-size: 12px; }
  #ammo { width: 205px; min-height: 91px; padding: 8px 10px 9px 12px; }
  #ammo-nums { font-size: 30px; }
  #ammo-reserve { font-size: 18px; }
  .ammo-sep { font-size: 18px; margin: 0 5px; }
  #weapon-name { font-size: 10px; }
  #grenades, #gadget-chips { min-height: 18px; margin-top: 3px; padding: 2px 5px; font-size: 10px; }
  #minimap { width: 116px; height: 116px; outline-width: 3px; }
  #coins { min-width: 74px; padding: 5px 9px; font-size: 15px; }
  #banner-title { font-size: 28px; }
}

body.touch-mode #health { left: calc(12px + env(safe-area-inset-left)); bottom: calc(12px + env(safe-area-inset-bottom)); }
body.touch-mode #ammo { right: calc(210px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); width: 184px; }
body.touch-mode #topright { top: calc(9px + env(safe-area-inset-top)); right: calc(9px + env(safe-area-inset-right)); }
body.touch-mode #bossbar { padding: 6px 9px 8px; }

@media (max-height: 460px) {
  body.touch-mode #health { width: 210px; padding: 6px 8px 8px; }
  body.touch-mode #health-head { margin-bottom: 3px; }
  body.touch-mode #ammo { right: calc(210px + env(safe-area-inset-right)); width: 164px; min-height: 78px; }
  body.touch-mode #grenades, body.touch-mode #gadget-chips { margin-right: 2px; }
  body.touch-mode #banner { top: 18%; width: min(360px, 42vw); }
  body.touch-mode #banner-title { font-size: 22px; }
  body.touch-mode #banner-sub { font-size: 11px; }
}

/* ════════════════════════════════════════════════════════════════
   🪩 BOLD UI REDESIGN — «neon web3 arcade»
   Свіжа візуальна мова для всіх меню/оверлеїв: глибокий космічний фон,
   скляні панелі з неоновими кромками, градієнтні кнопки (Solana-палітра).
   HUD усередині бою лишається тактичним — це diegetic-шар.
   ════════════════════════════════════════════════════════════════ */
:root {
  --nx-purple: #9945ff;
  --nx-violet: #6b46ff;
  --nx-cyan: #2ee6ff;
  --nx-green: #14f195;
  --nx-pink: #ff4dba;
  --nx-glass: rgba(16, 19, 40, 0.86);
  --nx-line: rgba(150, 130, 255, 0.26);
  --nx-text: #eaf2ff;
  --nx-muted: #93a0cf;
}

/* ── затемнення позаду оверлеїв: космічна заграва ── */
.overlay {
  background:
    radial-gradient(125% 80% at 50% -12%, rgba(153, 69, 255, .20), transparent 55%),
    radial-gradient(95% 70% at 85% 115%, rgba(20, 241, 149, .12), transparent 55%),
    radial-gradient(80% 60% at 12% 108%, rgba(46, 230, 255, .12), transparent 55%),
    rgba(5, 7, 16, 0.80);
  backdrop-filter: blur(11px) saturate(1.15);
  -webkit-backdrop-filter: blur(11px) saturate(1.15);
}

/* ── скляна картка з неоновою верхньою кромкою ── */
.overlay-card {
  background:
    linear-gradient(90deg, transparent 4%, var(--nx-purple), var(--nx-cyan) 50%, var(--nx-green), transparent 96%) top center / 100% 3px no-repeat,
    linear-gradient(160deg, rgba(24, 28, 58, .96), rgba(9, 11, 24, .97));
  border: 1px solid var(--nx-line);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(46, 230, 255, .05),
    0 28px 80px rgba(0, 0, 0, .62),
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 0 60px rgba(70, 40, 140, .12);
}
.overlay-card h1, .overlay-card h2 {
  color: #fff;
  letter-spacing: .5px;
  text-shadow: 0 2px 18px rgba(46, 230, 255, .22), 0 4px 22px rgba(0, 0, 0, .5);
}
.overlay-card p { color: var(--nx-muted); }

/* ── шапка панелі: лінія-роздільник + крапка-індикатор ── */
.panel-header {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(150, 130, 255, .16);
}
.panel-header::after {
  content: '';
  position: absolute; left: 0; bottom: -1px;
  width: 56px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--nx-cyan), var(--nx-purple));
  box-shadow: 0 0 12px rgba(46, 230, 255, .5);
}
.panel-sub { color: var(--nx-muted); }

/* ── кнопки: скляні, з неоновим світінням на hover ── */
.btn {
  background: linear-gradient(180deg, rgba(58, 64, 108, .55), rgba(26, 30, 56, .62));
  border: 1px solid rgba(150, 140, 255, .22);
  border-radius: 13px;
  color: var(--nx-text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--nx-cyan);
  filter: brightness(1.06);
  box-shadow: 0 11px 26px rgba(0, 0, 0, .5), 0 0 20px rgba(46, 230, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.btn:active { transform: translateY(0); filter: brightness(.98); }

/* ── головна дія: фірмовий градієнт Solana з повільним переливом ── */
.btn-primary {
  background: linear-gradient(110deg, var(--nx-purple), var(--nx-violet) 28%, var(--nx-cyan) 64%, var(--nx-green));
  background-size: 220% 100%;
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
  box-shadow: 0 9px 26px rgba(99, 60, 255, .42), 0 0 24px rgba(46, 230, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .3);
  animation: nx-flow 7s ease-in-out infinite;
}
@keyframes nx-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn-primary:hover {
  filter: brightness(1.08) saturate(1.06);
  box-shadow: 0 13px 32px rgba(99, 60, 255, .52), 0 0 34px rgba(46, 230, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* ── закрити (✕): кружок із червоним світінням ── */
.btn-x {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(150, 140, 255, .2);
  border-radius: 11px;
  color: #cdd6f5;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn-x:hover {
  background: rgba(255, 77, 109, .22);
  border-color: #ff6d7d;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 77, 109, .35);
}

/* ── поля вводу: темне скло з неоновим фокус-кільцем ── */
.coop-input {
  background: rgba(7, 9, 20, .72);
  border: 1px solid rgba(150, 140, 255, .26);
  border-radius: 12px;
  color: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.coop-input::placeholder { color: #6c77a6; }
.coop-input:focus {
  border-color: var(--nx-cyan);
  box-shadow: 0 0 0 3px rgba(46, 230, 255, .16), 0 0 18px rgba(46, 230, 255, .22);
}
input[type="checkbox"] { accent-color: var(--nx-purple); width: 16px; height: 16px; }

/* ── меню-кнопки на глобусі (☰) ── */
.globe-act {
  background: linear-gradient(180deg, rgba(40, 44, 80, .62), rgba(20, 23, 46, .66));
  border: 1px solid rgba(150, 140, 255, .2);
  border-radius: 12px;
}
.globe-act:hover { border-color: var(--nx-cyan); transform: translateY(-2px); }

/* ── globe: заголовок із градієнтним акцентом ── */
#globe-ui h1 { text-shadow: 0 4px 26px rgba(0, 0, 0, .7), 0 0 34px rgba(99, 60, 255, .22); }
#globe-ui h1 .accent {
  color: transparent;
  background: linear-gradient(90deg, var(--nx-cyan), var(--nx-green));
  -webkit-background-clip: text; background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 16px rgba(46, 230, 255, .38));
}
.globe-sub { color: #cfe0ff; }
.globe-hint { color: var(--nx-muted); }
#globe-progress {
  background: var(--nx-glass);
  border: 1px solid var(--nx-line);
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
#globe-progress span { color: var(--nx-cyan); }

/* ── головні кнопки старту ── */
.globe-play { border-radius: 16px; border-width: 1px; }
.globe-play.coop-btn {
  background: linear-gradient(135deg, rgba(20, 241, 149, .26), rgba(14, 110, 84, .55));
  border: 1px solid rgba(20, 241, 149, .5);
  color: #eafff6;
  box-shadow: 0 9px 26px rgba(0, 0, 0, .45), 0 0 20px rgba(20, 241, 149, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.globe-play.coop-btn:hover { border-color: var(--nx-green); box-shadow: 0 13px 30px rgba(0, 0, 0, .5), 0 0 30px rgba(20, 241, 149, .32); }

/* ── 🔗 екран під'єднання гаманця ── */
.wallet-gate { text-align: center; padding: 6px 0 2px; }
.wg-icon {
  width: 78px; height: 78px; margin: 4px auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; border-radius: 22px;
  background: radial-gradient(circle at 38% 30%, rgba(46, 230, 255, .28), rgba(153, 69, 255, .22));
  border: 1px solid rgba(150, 140, 255, .4);
  box-shadow: 0 0 0 6px rgba(99, 60, 255, .1), 0 10px 30px rgba(99, 60, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  animation: wg-pulse 2.6s ease-in-out infinite;
}
@keyframes wg-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(99, 60, 255, .1), 0 10px 30px rgba(99, 60, 255, .26), inset 0 1px 0 rgba(255, 255, 255, .2); }
  50% { box-shadow: 0 0 0 10px rgba(99, 60, 255, .04), 0 12px 38px rgba(46, 230, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .25); }
}
.wg-lead { max-width: 360px; margin: 0 auto; font-size: 15px; line-height: 1.45; color: #c3cef2; }
.wg-wallets { margin-top: 14px; color: var(--nx-muted); font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.coop-auth-divider { color: var(--nx-muted); }
.coop-auth-divider::before, .coop-auth-divider::after { background: rgba(150, 140, 255, .18); }

/* ── фокус із клавіатури — доступність ── */
.btn:focus-visible, .btn-x:focus-visible, .coop-input:focus-visible {
  outline: 2px solid var(--nx-cyan);
  outline-offset: 2px;
}

/* 🎯 Меню-лого Shooter Online (бренд на екрані глобуса) */
.game-logo {
  display: block;
  margin: 0 auto 4px;
  width: clamp(88px, 16vw, 148px);
  height: auto;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  user-select: none;
}

/* ============ 🎮 СТАРТОВИЙ ЕКРАН (Shooter Online) ============ */
/* Опак-шар над глобусом: бренд + велика PLAY. z-index 20 — вище globe-ui(10),
   нижче модалок(30), тож «Play Together» спливає поверх, а глобус не видно. */
#overlay-title {
  position: fixed; inset: 0; z-index: 20; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  height: 100dvh; padding: 5vh 20px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 18%, #1a2750 0%, #0d1430 45%, #070a18 100%);
  color: #fff; text-align: center;
}
#overlay-title.show { display: flex; }
/* анімований неон-ореол за лого */
.title-glow {
  position: absolute; top: 16%; left: 50%; transform: translate(-50%, -50%);
  width: min(70vw, 560px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,77,255,.45), rgba(0,230,150,.18) 45%, transparent 70%);
  filter: blur(30px); pointer-events: none; animation: title-pulse 5s ease-in-out infinite;
}
@keyframes title-pulse { 0%,100% { opacity:.65; transform:translate(-50%,-50%) scale(1);} 50% { opacity:1; transform:translate(-50%,-50%) scale(1.12);} }
.title-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.title-logo-img {
  width: clamp(140px, 30vw, 240px); height: auto;
  filter: drop-shadow(0 10px 34px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(124,77,255,.35));
  animation: title-float 4s ease-in-out infinite; user-select: none;
}
@keyframes title-float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-10px);} }
.title-wordmark {
  margin: 0; font-size: clamp(36px, 8vw, 76px); font-weight: 900; letter-spacing: 2px;
  color: #fff; text-shadow: 0 4px 0 #1a2240, 0 10px 30px rgba(0,0,0,.6); line-height: .95;
}
.title-wordmark .accent {
  background: linear-gradient(90deg, #7c4dff, #19e6a0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
}
.title-tag { margin: 2px 0 6px; color: #b9c9e6; font-weight: 700; font-size: clamp(14px, 2.2vw, 19px); max-width: 30ch; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.btn-title-play {
  margin-top: 10px; cursor: pointer; border: 0; color: #08130d;
  font-size: clamp(22px, 4.4vw, 34px); font-weight: 900; letter-spacing: 2px;
  padding: clamp(16px, 2.6vw, 22px) clamp(54px, 11vw, 96px); border-radius: 999px;
  background: linear-gradient(95deg, #7c4dff 0%, #4d8bff 35%, #19e6a0 100%);
  box-shadow: 0 12px 34px rgba(124,77,255,.5), 0 4px 14px rgba(25,230,160,.4), inset 0 2px 0 rgba(255,255,255,.45);
  animation: title-play-pulse 1.8s ease-in-out infinite; transition: transform .12s ease, filter .12s ease;
}
.btn-title-play .ttp-ico { font-size: .8em; }
.btn-title-play:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.08); }
.btn-title-play:active { transform: translateY(1px) scale(.98); }
@keyframes title-play-pulse {
  0%,100% { box-shadow: 0 12px 34px rgba(124,77,255,.5), 0 4px 14px rgba(25,230,160,.4), inset 0 2px 0 rgba(255,255,255,.45); }
  50% { box-shadow: 0 16px 44px rgba(124,77,255,.75), 0 6px 22px rgba(25,230,160,.6), inset 0 2px 0 rgba(255,255,255,.5); }
}
.title-menu-btn {
  position: absolute; top: max(16px, env(safe-area-inset-top)); left: 18px; z-index: 2;
  width: 50px; height: 50px; border-radius: 14px; cursor: pointer;
  background: rgba(20,30,54,.8); border: 2px solid rgba(124,77,255,.5); color: #fff;
  font-size: 22px; line-height: 1; box-shadow: 0 6px 18px rgba(0,0,0,.4);
  transition: transform .12s ease, background .12s ease;
}
.title-menu-btn:hover { transform: scale(1.06); background: rgba(36,48,80,.95); }
.title-foot {
  position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0;
  color: #6f82a8; font-weight: 700; font-size: 13px; letter-spacing: 1px;
}

/* 💠 символ токена в цінниках магазину */
.tok-sym { font-size: .82em; font-weight: 800; color: #19e6a0; letter-spacing: .3px; }
