/* ============================================================
   Game World UI — Unified modern layout
   Central scene + topbar + bottom panel + NPC avatars
   Responsive, compact on mobile
   ============================================================ */

:root{
  --gw-bg:#f0f2f5;
  --gw-card-bg:#fff;
  --gw-radius:12px;
  --gw-radius-sm:8px;
  --gw-shadow:0 2px 12px rgba(0,0,0,.06);
  --gw-shadow-hover:0 4px 20px rgba(0,0,0,.1);
  --gw-overlay:rgba(0,0,0,.45);
}

/* ── Game World Container ── */
.gw {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--gw-bg);
  overflow: hidden;
  z-index: 1;
}

/* ── SCENE: Central visual area ── */
.gw-scene {
  position: relative;
  flex: 1;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

/* ── PC: larger scene so location image is more prominent ── */
@media (min-width: 769px) {
  .gw-scene {
    flex: 0 0 auto;
    max-height: 85vh;
    min-height: 520px;
  }
}
.gw-scene__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gw-scene__bg--placeholder {
  background: linear-gradient(135deg, #a8d8ea 0%, #aa96da 50%, #fcbad3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-scene__ph-icon {
  font-size: 80px;
  opacity: .5;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.15));
}

/* Top bar overlay */
.gw-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, transparent 100%);
  z-index: 10;
}
.gw-topbar__loc {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}
.gw-topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.gw-topbar__time {
  font-variant-numeric: tabular-nums;
}
.gw-topbar__icon-btn--vault {
  position: relative;
  overflow: hidden;
  background: rgba(30,64,175,.75);
  box-shadow: 0 0 0 1px rgba(148,163,184,.7), 0 4px 10px rgba(15,23,42,.8);
  animation: gwVaultIdle 2.4s ease-in-out infinite;
}
.gw-topbar__icon-btn--vault:hover {
  background: rgba(37,99,235,.95);
}
.gw-topbar__vault-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background-image: url('/assets/items/chest.png');
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 12px rgba(251,191,36,.8);
}
@keyframes gwVaultIdle {
  0%,100% { transform: translateY(0) rotate(0deg); }
  12%     { transform: translateY(-1px) rotate(-4deg); }
  24%     { transform: translateY(0) rotate(3deg); }
  32%     { transform: translateY(-0.5px) rotate(-2deg); }
  40%     { transform: translateY(0) rotate(0deg); }
}
.gw-topbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.gw-topbar__icon-btn:hover {
  background: rgba(255,255,255,.4);
  transform: scale(1.05);
}
.gw-topbar__icon-btn:active {
  transform: scale(0.98);
}
.gw-topbar__battle-link {
  padding: 4px 10px;
  font-size: 11px;
}
.gw-topbar__name {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.gw-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.gw-btn {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gw-btn--danger {
  background: rgba(239,68,68,.9);
  color: #fff;
  animation: gw-pulse 1.5s infinite;
}
@keyframes gw-pulse {
  0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)} 50%{box-shadow:0 0 0 8px rgba(239,68,68,0)}
}

/* ── TRAINER LEVEL BAR ── */
.gw-level-bar {
  position: absolute;
  bottom: 60px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 11;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 6px 12px;
}
.gw-level-bar__badge {
  font-size: 12px;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  white-space: nowrap;
}
.gw-level-bar__track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.2);
  overflow: hidden;
}
.gw-level-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width .4s ease;
}
.gw-level-bar__xp {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}

/* ── Player bar (nickname + avatar on location card) ── */
.gw-player-bar {
  position: absolute;
  bottom: 98px;
  left: 16px;
  right: 16px;
  z-index: 11;
  display: flex;
  align-items: center;
}
.gw-player-bar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width: 100%;
  min-width: 0;
}
.gw-player-bar__link:hover { color: inherit; text-decoration: none; opacity: .95; }
.gw-player-bar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(251,191,36,.4), rgba(245,158,11,.3));
  border: 2px solid rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fbbf24;
}
.gw-player-bar__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gw-player-bar__avatar-letter {
  text-transform: uppercase;
}
.gw-player-bar__name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gw-player-bar__loc {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

/* Bottom row: NPCs + wild button (one row, wild right of NPCs on desktop/tablet) */
.gw-scene__bottom-row {
  position: absolute;
  bottom: 95px;
  left: 0;
  right: 0;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  z-index: 11;
}
.gw-scene__bottom-row .gw-npcs {
  position: static;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}
.gw-wild-inline {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-wild__toggle--circle {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.9);
  background: linear-gradient(180deg, #e5e7eb, #d1d5db); /* серая, когда неактивна */
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.gw-wild__toggle--circle .gw-wild__icon-paw {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-wild__toggle--circle .gw-wild__text--a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.gw-wild__toggle--circle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.gw-wild__toggle--on.gw-wild__toggle--circle {
  background: linear-gradient(135deg, #f87171, #9ca3af); /* красно‑серая, когда активна */
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 3px 12px rgba(0,0,0,.35);
}

/* NPC avatars at bottom of scene — above the level bar */
.gw-npcs {
  position: absolute;
  bottom: 95px;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  z-index: 10;
  justify-content: flex-start;
}
.gw-npcs::-webkit-scrollbar {
  height: 4px;
}
.gw-npcs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.4);
  border-radius: 2px;
}
.gw-npc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 2px;
  font: inherit;
  flex-shrink: 0;
  min-width: 78px;
}
.gw-npc__avatar-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  transition: transform .15s;
}
.gw-npc__avatar-btn:hover { transform: translateY(-3px); }
.gw-npc__avatar-btn:active { transform: translateY(0); }
.gw-npc__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: box-shadow .15s;
}
.gw-npc__avatar-btn:hover .gw-npc__avatar {
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.gw-npc__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.gw-npc:hover .gw-npc__avatar {
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.gw-npc__name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100px;
}
.gw-npc__quest-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#facc15;
  box-shadow:0 0 0 2px rgba(0,0,0,.85);
}
.gw-npc__name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
/* Тучка сообщения — квесты и диалоги только по нажатию на неё */
.gw-npc__quest-bubble {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #e0e7ff 100%);
  color: #4f46e5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .15s, background .15s, box-shadow .15s;
  line-height: 1;
}
.gw-npc__quest-bubble:hover {
  background: linear-gradient(180deg, #fff 0%, #c7d2fe 100%);
  transform: scale(1.12);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.gw-npc__quest-bubble:active { transform: scale(0.95); }
.gw-npc__subloc {
  font-size: 8px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ── ENCOUNTERS LIST ── */
.gw-encounters {
  flex-shrink: 0;
  padding: 8px 12px 0;
}
.gw-encounters__title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted, #64748b);
  margin-bottom: 6px;
}
.gw-encounters__list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.gw-enc-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  min-width: 140px;
}
.gw-enc-card:hover {
  border-color: rgba(59,130,246,.3);
  box-shadow: 0 2px 8px rgba(59,130,246,.1);
}
.gw-enc-card--rare {
  border-color: rgba(168,85,247,.25);
  background: linear-gradient(135deg, rgba(168,85,247,.06), rgba(236,72,153,.04));
}
.gw-enc-card--rare:hover {
  border-color: rgba(168,85,247,.45);
  box-shadow: 0 2px 8px rgba(168,85,247,.15);
}
.gw-enc-card__sprite {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.gw-enc-card__sprite--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  background: rgba(0,0,0,.04);
  border-radius: 8px;
}
.gw-enc-card__info {
  min-width: 0;
}
.gw-enc-card__name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gw-enc-card__meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted, #64748b);
  white-space: nowrap;
}

/* ── Тренеры на локации ── */
.gw-trainers {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--soft, rgba(0,0,0,.03));
  border-radius: 8px;
  margin-bottom: 8px;
}
.gw-trainers__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #334155);
  margin-bottom: 8px;
}
.gw-trainers__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gw-trainers__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.gw-trainers__item:hover {
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.3);
}
.gw-trainers__icon { font-size: 14px; }
.gw-trainers__item-title { font-weight: 500; color: var(--muted, #64748b); font-size: 11px; }

/* ── BOTTOM PANEL ── */
.gw-team-battles {
  flex-shrink: 0;
  padding: 8px 12px;
  background: rgba(34,197,94,.06);
  border-top: 1px solid rgba(34,197,94,.15);
}
.gw-team-battles__title {
  font-size: 12px;
  font-weight: 800;
  color: #15803d;
  margin-bottom: 8px;
}
.gw-team-battles__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gw-tb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(34,197,94,.2);
}
.gw-tb-teams {
  font-size: 12px;
  font-weight: 600;
}
.gw-tb-actions {
  display: flex;
  gap: 6px;
}

.gw-bottom {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Wild search — кнопка «Нападение диких», аккуратная круглая кнопка с лапой */
.gw-wild {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: border-color .2s, box-shadow .2s;
}
.gw-wild:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.gw-wild--on {
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 2px 12px rgba(34,197,94,.12);
}
.gw-wild__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,.08);
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text, #1e293b);
  transition: background .2s, border-color .2s, transform .1s, box-shadow .2s;
  flex-shrink: 0;
}
/* Круглая кнопка с иконкой лапы (как на примере) */
.gw-wild__toggle--circle {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #b91c1c, #991b1b);
  border: 2px solid rgba(0,0,0,.12);
  color: rgba(255,255,255,.95);
  box-shadow: 0 2px 10px rgba(185,28,28,.35);
}
/* Подсветка кнопки «Нападение диких» по подсказке квеста */
.gw-wild__toggle--quest-hint {
  animation: gw-wild-quest-pulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.5), 0 2px 10px rgba(185,28,28,.35);
}
@keyframes gw-wild-quest-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.5), 0 2px 10px rgba(185,28,28,.35); }
  50% { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0.25), 0 2px 14px rgba(185,28,28,.45); }
}
.gw-wild__toggle--circle .gw-wild__icon-paw {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-wild__toggle--circle .gw-wild__icon-paw svg {
  width: 100%;
  height: 100%;
  color: rgba(255,255,255,.9);
}
.gw-wild__toggle--circle .gw-wild__text--a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.gw-wild__toggle--circle:hover {
  background: linear-gradient(180deg, #dc2626, #b91c1c);
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 4px 14px rgba(185,28,28,.4);
}
.gw-wild__toggle--on.gw-wild__toggle--circle {
  background: linear-gradient(135deg, #86efac, #4ade80);
  border-color: rgba(255,255,255,.6);
  color: #166534;
  box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 2px 10px rgba(34,197,94,.3);
}
.gw-wild__toggle--on.gw-wild__toggle--circle .gw-wild__icon-paw svg {
  color: #14532d;
}
.gw-wild__toggle--on.gw-wild__toggle--circle:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 4px 14px rgba(34,197,94,.4);
}
.gw-wild__icon { font-size: 18px; line-height: 1; }
.gw-wild__info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  flex-shrink: 0;
}
.gw-wild__interval {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
}
.gw-wild--on .gw-wild__interval { color: #15803d; }
.gw-wild__count { white-space: nowrap; }
.gw-wild__bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,.06);
  overflow: hidden;
  min-width: 40px;
}
.gw-wild__bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width .3s;
}

/* Wild search wrapper — between NPC row and bottom panel */
.gw-wild-wrapper {
  flex-shrink: 0;
  padding: 0 12px 4px;
  position: relative;
}
.gw-wild-hide {
  display: none; /* shown only on mobile via media query */
  position: absolute;
  top: 4px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
  background: rgba(255,255,255,.9);
  font-size: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--muted, #64748b);
  z-index: 2;
  transition: transform .2s;
}
.gw-wild-wrapper--collapsed .gw-wild { display: none; }
.gw-wild-wrapper--collapsed .gw-wild-hide { transform: rotate(180deg); }

/* Travel buttons — transitions between locations */
.gw-travel {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}
.gw-travel__item { flex: 1; min-width: 100px; }
.gw-travel__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,.08);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text, #1e293b);
  transition: background .12s, transform .1s, border-color .12s;
  min-height: 52px;
}
.gw-travel__btn > span:first-child {
  font-size: 20px;
  line-height: 1;
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}
.gw-travel__btn > span:nth-child(2) {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  min-width: 0;
}
.gw-travel__btn:hover {
  background: #f0f9ff;
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.3);
  box-shadow: 0 4px 12px rgba(37,99,235,.12);
}
.gw-travel__btn--home { border-color: rgba(251,191,36,.4); background: #fffbeb; }
.gw-travel__btn--home > span:first-child { color: #d97706; }
.gw-travel__btn--disabled { opacity: .6; cursor: not-allowed; }
.gw-travel__btn--disabled:hover { transform: none; }

/* ── MOBILE (768px) ── */
@media (max-width: 768px) {
  .gw {
    min-height: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
  .gw-scene {
    border-radius: 0 0 20px 20px;
    min-height: min(42vh, 340px);
    flex: 1 1 auto;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
  }
  .gw-topbar {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0));
  }
  .gw-topbar__name { font-size: 16px; font-weight: 800; }
  .gw-pill {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 12px;
  }
  .gw-level-bar {
    bottom: 52px;
    left: 12px;
    right: 12px;
    padding: 8px 14px;
    border-radius: 14px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .gw-player-bar { bottom: 132px; left: 12px; right: 12px; }
  .gw-player-bar__avatar { width: 36px; height: 36px; font-size: 16px; }
  .gw-player-bar__name { font-size: 13px; }
  .gw-player-bar__loc { font-size: 11px; max-width: 35%; }
  .gw-level-bar__badge { font-size: 12px; }
  .gw-level-bar__xp { font-size: 10px; }
  .gw-level-bar__track { height: 7px; border-radius: 4px; }
  .gw-npcs { bottom: 88px; }
  .gw-npc__avatar { width: 54px; height: 54px; font-size: 22px; border-width: 3px; }
  .gw-npc__name { font-size: 10px; }
  .gw-npc__quest-bubble { width: 22px; height: 22px; font-size: 12px; }
  .gw-encounters {
    padding: 10px 12px 0;
  }
  .gw-encounters__title { font-size: 11px; margin-bottom: 8px; }
  .gw-enc-card {
    min-width: 130px;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
  }
  .gw-enc-card__sprite { width: 34px; height: 34px; }
  .gw-enc-card__name { font-size: 13px; }
  .gw-bottom {
    padding: 12px 14px 16px;
    gap: 10px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  }
  .gw-wild-hide { display: flex; }
  .gw-wild {
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    gap: 10px;
  }
  .gw-wild__toggle {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    min-height: 40px;
  }
  .gw-wild__info { font-size: 13px; }
  .gw-travel { gap: 10px; }
  .gw-travel__item { min-width: calc(50% - 5px); }
  .gw-travel__btn {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 12px;
    min-height: 52px;
  }
  .gw-travel__btn > span:first-child { font-size: 22px; }
  .gw-travel__btn > span:nth-child(2) { font-size: 13px; }
}

/* ── Extra narrow (360×640): transitions full width, stacked ── */
@media (max-width: 420px) {
  .gw-travel { flex-wrap: wrap; gap: 8px; }
  .gw-travel__item { min-width: 100%; }
  .gw-travel__btn { min-height: 48px; padding: 12px 16px; }
  .gw-travel__btn > span:first-child { font-size: 24px; }
  .gw-wild__toggle { min-height: 44px; }
}

/* ── MOBILE (480px) — compact ── */
@media (max-width: 480px) {
  .gw-scene {
    min-height: min(38vh, 280px);
    border-radius: 0 0 14px 14px;
  }
  .gw-topbar { padding: 8px 12px; }
  .gw-topbar__name { font-size: 14px; }
  .gw-pill { padding: 2px 6px; font-size: 10px; }
  .gw-npcs { padding: 0 8px; gap: 8px; bottom: 72px; }
  .gw-npc { min-width: 56px; }
  .gw-npc__avatar { width: 48px; height: 48px; font-size: 18px; }
  .gw-npc__name { font-size: 9px; max-width: 56px; }
  .gw-npc__name-row { max-width: 80px; }
  .gw-npc__quest-bubble { width: 20px; height: 20px; font-size: 11px; }
  .gw-npc__subloc { max-width: 60px; }
  .gw-level-bar {
    bottom: 42px;
    left: 8px;
    right: 8px;
    padding: 5px 10px;
  }

  /* On very small screens NPC avatars and wild button go into normal flow under the scene
     so they don't overlap и не «съезжают» наверх/вниз */
  .gw-scene__bottom-row {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    padding: 6px 10px 0;
    margin-top: 4px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .gw-npcs {
    position: static;
    margin-top: 0;
    padding: 0 2px 2px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
  .gw-scene__bottom-row .gw-npc {
    flex: 0 0 auto;
  }
  .gw-wild-inline {
    justify-content: flex-start;
  }
  .gw-level-bar__badge { font-size: 10px; }
  .gw-encounters { padding: 6px 10px 0; }
  .gw-encounters__title { font-size: 10px; margin-bottom: 6px; }
  .gw-enc-card { min-width: 100px; padding: 6px 8px; }
  .gw-enc-card__sprite { width: 26px; height: 26px; }
  .gw-enc-card__name { font-size: 11px; }
  .gw-travel__item { min-width: calc(50% - 4px); flex: 1; }
  .gw-travel__btn { padding: 10px 12px; font-size: 12px; min-height: 48px; }
  .gw-travel__btn > span:first-child { font-size: 20px; }
  .gw-bottom { padding: 8px 10px 12px; gap: 8px; }
  .gw-wild { padding: 8px 10px; }
  .gw-wild__toggle { padding: 6px 12px; font-size: 12px; min-height: 38px; }
}

/* ── In transit (в пути) ── */
.gw--transit {
  display: flex;
  flex-direction: column;
  min-height: 50vh;
}
.gw-scene--transit {
  flex: 0 0 auto;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-scene__bg--transit {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
}
.gw-scene__bg--transit .gw-scene__ph-icon { font-size: 64px; opacity: .9; }
.gw-transit-panel {
  flex: 1;
  padding: 24px 20px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  margin: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.gw-transit-panel__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #1e293b);
}
.gw-transit-panel__line {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted, #64748b);
}
.gw-transit-panel__eta {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary, #2563eb);
}
.gw-transit-panel__eta-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.gw-transit-panel__hint {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--muted);
}
.gw-transit-activities__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.gw-transit-activities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.gw-transit-activity {
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,.1);
  background: #f8fafc;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.gw-transit-activity:hover:not(:disabled) {
  background: #e0f2fe;
  transform: translateY(-1px);
}
.gw-transit-activity:disabled { opacity: .6; cursor: default; }
.gw-transit-activity-result {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #f0fdf4;
  font-size: 13px;
  color: #166534;
}
.gw-transit-activity-result.hidden { display: none; }
.gw-travel__btn--transport { border-color: rgba(34,197,94,.35); background: #f0fdf4; }
.gw-travel__btn--transport > span:first-child { color: #16a34a; }
