/* Операція: Порятунок Світу — стилі 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; }

/* ================= ГЛОБУС ================= */
#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(178px + 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(280px, 34vw); }
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; }

/* 🐣 Режим Малюк: більші кнопки + ховаємо рідковживане для найменших */
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)); }
  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 {
  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-side {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
}
.globe-side .globe-act { font-size: 14px; padding: 9px 14px; text-align: left; }

/* головні кнопки: ГРАТИ / ГРАТИ РАЗОМ */
.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-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-tag { font-size: 12px; font-weight: 700; color: #9fb8d4; margin-top: 3px; }
.ward-card.equipped .ward-tag { color: #58c14c; }
#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; }

/* ================= ОНОВЛЕННЯ 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); }
/* кнопка оптики на мобільному — біля кнопки вогню, лише коли в руках снайперка */
#tb-scope { position: fixed; right: calc(100px + env(safe-area-inset-right)); bottom: calc(84px + 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); }

/* вкладки магазину */
#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; }
@media (orientation: portrait) and (max-width: 620px) {
  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;
}
.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;
}
#coop-room b { color: #4dd6a8; letter-spacing: 2px; }

@media (max-width: 900px) {
  .globe-side {
    position: static; transform: none; flex-direction: row; flex-wrap: wrap;
    justify-content: center; gap: 6px; max-width: 92vw; margin-top: 6px;
  }
  .globe-side .globe-act { font-size: 11px; padding: 6px 9px; text-align: center; }
  .globe-play { font-size: 15px; padding: 11px 20px; }
}

/* 💾 панель «Мій прогрес» і аварійний екран */
.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; }
