/*
 * Z-LAND — the game menu, ONE for every scene (the market, Iraq Center, Trade
 * City, the planet, a store you walk into). Markup: partials/world-menu.blade.php.
 * The button guide is not on the menu itself: it is behind its own button.
 */
#game-menu-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
/* Always reachable however long the panel is or whether it has scrolled. */
#game-menu-close-fixed {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 65;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f5f5f7;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#game-menu-panel .panel-inner {
  font-family: "Tajawal", -apple-system, "Segoe UI", sans-serif;
  background: rgba(16, 16, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 20px;
  max-width: 340px;
  width: 90%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
}
#game-menu-panel h3 { color: #fff; font-size: 16px; margin: 0 0 14px; text-align: center; }
#game-menu-panel a,
#game-menu-panel button.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin: 0 0 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  font-family: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  text-align: start;
}
#game-menu-panel a:hover,
#game-menu-panel button.menu-item:hover { background: rgba(255, 255, 255, 0.1); }
#game-menu-panel a:focus-visible,
#game-menu-panel button:focus-visible { outline: 2px solid #8fb2ff; outline-offset: 2px; }
#game-menu-panel a.danger { border-color: rgba(255, 45, 67, 0.4); color: #ff5a6a; }
#game-menu-panel .close-btn { background: none; border: none; justify-content: center; color: #9a9aa5; margin: 4px 0 0; }
#game-menu-panel .menu-item .chev { margin-inline-start: auto; font-size: 12px; opacity: 0.7; transition: transform 0.15s; }
#game-menu-panel .menu-item[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* The guide: closed until its button is pressed. */
#game-menu-panel .controls-guide {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  margin: 0 0 10px;
}
#game-menu-panel .controls-guide[hidden] { display: none; }
#game-menu-panel .controls-guide .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #d0d0d5;
  padding: 4px 0;
}
/* Keyboard rows or touch rows, never both — whichever this device has. */
#game-menu-panel .controls-guide .row.ctrl-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  #game-menu-panel .controls-guide .row.ctrl-desktop { display: none; }
  #game-menu-panel .controls-guide .row.ctrl-touch { display: flex; }
}
#game-menu-panel .controls-guide .key {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* The cart's count, on its item in the menu — and a dot on the menu button. */
#game-menu-panel .cart-link-btn .cart-badge {
  margin-inline-start: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #3d6bf0;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game-menu-btn { position: relative; }
#game-menu-btn.has-cart::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3d6bf0;
  border: 2px solid #0b0b10;
}

/* The travel block of the market's menu (return point, other complexes). */
#game-menu-panel .menu-travel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 10px;
}
#game-menu-panel .menu-travel .controls-guide-title { color: #9a9aa5; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
#game-menu-panel .menu-travel .row { display: block; font-size: 12px; color: #d0d0d5; }

@media (prefers-reduced-motion: reduce) {
  #game-menu-panel .menu-item .chev { transition: none; }
}
