/* IBIS Atlantis 3D v7 — Fortnite-Style Stylized RPG + GTA Minimap + Live 3D Try-On Shop */
:root {
  --bg: #081529;
  --gold: #facc15;
  --cyan: #22d3ee;
  --violet: #c084fc;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(250, 204, 21, 0.32);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

.city-top {
  height: 48px; padding: 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(7, 17, 36, 0.94); border-bottom: 1px solid var(--border);
  position: relative; z-index: 20;
}
.city-brand { display: flex; align-items: center; gap: 7px; min-width: 0; }
.city-brand strong { font-size: 0.9rem; white-space: nowrap; }
.city-brand img { border-radius: 50%; border: 1.5px solid var(--gold); flex-shrink: 0; }
.city-back {
  color: var(--cyan); text-decoration: none; font-size: 0.95rem; font-weight: 700;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(34, 211, 238, 0.4);
}
.city-pill {
  font-size: 0.7rem; font-weight: 700; color: #6ee7b7;
  background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.45);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 6px; }

.city-menu-drop {
  position: fixed; top: 52px; right: 10px; z-index: 30;
  width: min(275px, calc(100vw - 20px));
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  border-radius: 16px; background: rgba(7, 15, 32, 0.97);
  border: 1px solid var(--gold); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72);
}
.cmenu-item {
  text-align: left; padding: 9px 12px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05);
  color: #fff; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.cmenu-item:hover { background: rgba(34, 211, 238, 0.16); border-color: var(--cyan); }

.cbtn {
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.09);
  color: var(--text); border-radius: 999px; padding: 6px 12px;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.cbtn-gold { background: linear-gradient(135deg, #fde047, #f59e0b); color: #05070c; border-color: transparent; }
.cbtn-cyan { background: linear-gradient(135deg, #22d3ee, #38bdf8); color: #05070c; border-color: transparent; }
.cbtn-violet { background: linear-gradient(135deg, #c084fc, #818cf8); color: #05070c; border-color: transparent; }
.cbtn-x {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: #fff; cursor: pointer; font-size: 0.95rem;
}

.city-stage { position: relative; width: 100%; height: calc(100dvh - 48px); overflow: hidden; }
#atlantis-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }

/* GTA-STYLE MINIMAP RADAR (TAP TO OPEN FULL MAP!) */
.minimap-wrap {
  position: absolute; top: 10px; left: 10px; z-index: 10;
  width: 112px; height: 112px; border-radius: 18px; overflow: hidden;
  border: 2px solid rgba(250, 204, 21, 0.72);
  background: rgba(5, 16, 34, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.52);
  cursor: pointer;
}
#minimap-canvas { width: 100%; height: 100%; display: block; }
.minimap-badge {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em;
  background: rgba(5, 12, 26, 0.86); color: var(--gold);
  padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(250,204,21,0.35);
  pointer-events: none; white-space: nowrap;
}
@media (min-width: 720px) {
  .minimap-wrap { width: 144px; height: 144px; border-radius: 22px; }
}

/* LIVE GPS WAYPOINT HUD */
.gps-hud {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  z-index: 9; display: flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(34, 12, 58, 0.92); border: 1.5px solid #c084fc;
  color: #f3e8ff; font-size: 0.75rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
  white-space: nowrap; max-width: calc(100vw - 140px);
}
.gps-clear {
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 0.72rem;
}

.city-zone-hud {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - 245px);
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(6, 16, 36, 0.88); border: 1.5px solid var(--border);
  font-size: 0.76rem; font-weight: 700; z-index: 8; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .city-zone-hud { left: auto; right: 10px; transform: none; max-width: calc(100vw - 134px); }
  .gps-hud { top: 50px; left: auto; right: 10px; transform: none; max-width: calc(100vw - 134px); }
}

.build-bar {
  position: absolute; top: 92px; left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - 16px); overflow-x: auto;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 8px; border-radius: 14px; z-index: 9;
  background: rgba(5, 12, 26, 0.94); border: 1px solid var(--cyan);
}
.blk-btn {
  padding: 5px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.06);
  color: #fff; cursor: pointer; white-space: nowrap;
}
.blk-btn.active { background: rgba(250, 204, 21, 0.25); border-color: var(--gold); color: #fef08a; }

.interact-popup {
  position: absolute; top: 94px; right: 10px; z-index: 12; width: min(275px, calc(100vw - 20px));
  padding: 12px; border-radius: 16px;
  background: rgba(8, 16, 34, 0.96); border: 1.5px solid var(--gold);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
}
.interact-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.interact-btns { display: grid; grid-template-columns: 1fr; gap: 6px; }

/* D-PAD BOTTOM-LEFT & ACTION CLUSTER BOTTOM-RIGHT */
.dpad-wrap {
  position: absolute; left: 12px; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 8; display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 3px;
}
.dpad-btn {
  border-radius: 13px; border: 1.5px solid rgba(250, 204, 21, 0.42);
  background: rgba(6, 16, 36, 0.82); color: #f8fafc; font-size: 0.92rem;
  cursor: pointer; touch-action: none; user-select: none;
}
.dpad-btn:active { background: rgba(34, 211, 238, 0.5); }
.d-up { grid-column: 2; grid-row: 1; }
.d-left { grid-column: 1; grid-row: 2; }
.d-right { grid-column: 3; grid-row: 2; }
.d-down { grid-column: 2; grid-row: 3; }

.action-cluster {
  position: absolute; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 8; display: grid; grid-template-columns: repeat(2, 48px); gap: 8px;
}
.act-fab {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid rgba(250, 204, 21, 0.48); background: rgba(6, 16, 36, 0.86);
  color: #fff; font-size: 1.18rem; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.act-fab.active { background: rgba(34, 211, 238, 0.35); border-color: var(--cyan); }
.act-fab-chat { background: linear-gradient(135deg, #22d3ee, #38bdf8); color: #05070c; border-color: transparent; }

/* COLLAPSIBLE CHAT DRAWER */
.chat-drawer {
  position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 460px; margin: 0 auto; z-index: 25;
  padding: 10px; border-radius: 18px;
  background: rgba(6, 13, 28, 0.96); border: 1.5px solid var(--cyan);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.78);
  display: flex; flex-direction: column; gap: 8px;
}
.chat-drawer-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; }
.chat-feed { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.chat-line {
  align-self: flex-start; padding: 5px 10px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(34, 211, 238, 0.22);
  font-size: 0.78rem; color: #e2e8f0;
}
.chat-form {
  display: flex; gap: 6px; padding: 5px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}
.chat-form input { flex: 1; background: transparent; border: none; color: #fff; outline: none; padding: 4px 10px; font-size: 16px; }

/* DIALOGS */
dialog.city-dlg {
  margin: auto; width: min(470px, calc(100vw - 18px)); max-height: 92dvh; overflow-y: auto;
  padding: 16px; border-radius: 20px;
  background: #081326; color: var(--text); border: 1.5px solid var(--border);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.84);
}
dialog.city-dlg-wide { width: min(760px, calc(100vw - 16px)); }
dialog.city-dlg::backdrop { background: rgba(2, 6, 16, 0.78); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.dlg-sub { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.dlg-form { display: flex; flex-direction: column; gap: 9px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dlg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: #cbd5e1; }
.dlg-form input, .dlg-form select, .dlg-form textarea {
  padding: 9px 10px; border-radius: 10px; font-size: 16px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18); color: #fff;
}
.charter-box {
  flex-direction: row !important; align-items: flex-start !important; gap: 8px !important;
  padding: 10px; border-radius: 12px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.76rem !important; line-height: 1.45; color: #d1fae5 !important;
}
.charter-box input { margin-top: 3px; flex-shrink: 0; }

/* LIVE 3D TRY-ON SHOP LAYOUT */
.shop-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.shop-tab {
  flex: 1; padding: 8px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.05); color: #cbd5e1; cursor: pointer;
}
.shop-tab.active { background: linear-gradient(135deg, #fde047, #f59e0b); color: #05070c; border-color: transparent; }

.shop-layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) {
  .shop-layout { grid-template-columns: 265px 1fr; align-items: start; }
}
.shop-stage-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px; border-radius: 16px;
  background: radial-gradient(circle at 50% 35%, #163763, #071226);
  border: 1.5px solid rgba(34, 211, 238, 0.45);
}
#shop-preview-canvas {
  width: 240px; height: 240px; max-width: 100%; border-radius: 12px; cursor: grab; touch-action: none;
}
.shop-stage-title { font-size: 0.88rem; font-weight: 800; color: #fde047; text-align: center; }
.shop-stage-desc { font-size: 0.74rem; color: #cbd5e1; text-align: center; min-height: 30px; }
.shop-stage-btns { display: flex; gap: 6px; width: 100%; justify-content: center; flex-wrap: wrap; }

.shop-grid { display: grid; grid-template-columns: 1fr; gap: 8px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.shop-card {
  padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 5px;
  background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.12);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.shop-card:hover { border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.08); }
.shop-card.selected { border-color: var(--gold); background: rgba(250, 204, 21, 0.13); }
.shop-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.shop-card small { color: var(--muted); font-size: 0.74rem; }
.shop-tag {
  font-size: 0.65rem; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.2); color: #67e8f9; white-space: nowrap;
}
.shop-tag.owned { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.shop-tag.legendary { background: rgba(250, 204, 21, 0.25); color: #fde047; }

/* FULL GTA INTERACTIVE MAP */
.bigmap-wrap {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 420px; margin: 0 auto 10px;
  border-radius: 16px; overflow: hidden; border: 2px solid var(--gold);
  background: #072038; cursor: crosshair;
}
#bigmap-canvas { width: 100%; height: 100%; display: block; }
.map-poi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px;
}
.poi-btn {
  padding: 7px 10px; border-radius: 11px; text-align: left;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05);
  color: #f8fafc; font-size: 0.74rem; font-weight: 600; cursor: pointer;
}
.poi-btn:hover { border-color: var(--violet); background: rgba(192, 132, 252, 0.15); }

.pc-status-strip {
  padding: 8px 12px; border-radius: 10px; margin-bottom: 10px;
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.3);
  font-size: 0.78rem; color: #a5f3fc;
}
.board-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.board-item { padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); font-size: 0.82rem; }
.ethical-partner-slot {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08), rgba(34, 211, 238, 0.08));
  border: 1px dashed rgba(250, 204, 21, 0.35); display: flex; flex-direction: column; gap: 3px; font-size: 0.78rem;
}
.ethical-partner-slot small { color: var(--muted); font-size: 0.72rem; }
.meditate-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 8px; text-align: center; }
.lotus-orb {
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, #fde047 0%, #22d3ee 55%, rgba(34,211,238,0) 75%);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.55); transition: transform 3.8s ease-in-out;
}
