/* DOUBLE-V URGENCES V0.1.2A — interface paysage */
:root {
  --bg-deep: #060913; --bg-panel: rgba(13, 19, 36, 0.97); --bg-card: rgba(22, 31, 56, 0.9);
  --border-subtle: rgba(139, 92, 246, 0.3);
  --accent-violet: #8b5cf6; --accent-cyan: #22d3ee;
  --alert-orange: #f97316; --alert-red: #ef4444; --ok-green: #10b981;
  --text-main: #f1f5f9; --text-muted: #94a3b8;
  --radius: 12px; --top-h: 48px; --panel-w: clamp(230px, 29vw, 350px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: var(--bg-deep); color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; overflow: hidden; }
button { font-family: inherit; }
body { display: flex; flex-direction: column; height: 100dvh; }
.hidden { display: none !important; }

/* ---------- Barre haute ---------- */
.hud-top { flex: 0 0 auto; min-height: var(--top-h); display: flex; align-items: center; gap: 8px;
  padding: 5px max(10px, var(--sar)) 5px max(10px, var(--sal)); padding-top: max(5px, var(--sat));
  background: var(--bg-panel); border-bottom: 1px solid var(--border-subtle); position: relative; z-index: 40; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .4px; white-space: nowrap; }
.brand-badge { background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan)); color: #060913;
  padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 900; }
.hud-spacer { flex: 1; }
.hud-group { display: flex; align-items: center; gap: 6px; }
.stat-pill { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.stat-credits { color: var(--accent-cyan); }
.stat-level { color: #c4b5fd; display: flex; align-items: center; gap: 7px; padding: 2px 8px 2px 6px; }
.level-badge { background: linear-gradient(135deg, #8b5cf6, #3b82f6); color: #fff; border-radius: 999px; padding: 2px 6px; font-size: 11px; font-weight: 900; }
.xp-bar-container { position: relative; width: 75px; height: 14px; background: rgba(0,0,0,0.5); border-radius: 999px; overflow: hidden; border: 1px solid rgba(139,92,246,0.3); display: flex; align-items: center; justify-content: center; }
.xp-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #8b5cf6, #22d3ee); border-radius: 999px; transition: width 0.3s ease; }
.xp-text { position: relative; z-index: 2; font-size: 9px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.top-btn { background: rgba(255,255,255,.06); color: var(--text-main); border: 1px solid var(--border-subtle);
  border-radius: 10px; min-height: 34px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; }
.top-btn:hover { border-color: var(--accent-cyan); }
.top-btn.active { background: rgba(139,92,246,.28); border-color: var(--accent-violet); }
.top-btn.paused { background: rgba(249,115,22,.25); border-color: var(--alert-orange); color: #fed7aa; }
.top-btn.shop { background: linear-gradient(135deg, rgba(139,92,246,.45), rgba(34,211,238,.3)); }

/* ---------- Zone principale : Missions | Carte | Casernes ---------- */
.app-main { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
.side-panel { flex: 0 0 var(--panel-w); width: var(--panel-w); min-width: 0; display: flex; flex-direction: column;
  background: var(--bg-panel); position: relative; z-index: 20; overflow: hidden; }
#panel-left { border-right: 1px solid var(--border-subtle); padding-left: var(--sal); }
#panel-right { border-left: 1px solid var(--border-subtle); padding-right: var(--sar); }
.side-panel.collapsed { flex-basis: 0; width: 0; border: 0; padding: 0; }
.panel-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.panel-head h2 { margin: 0; font-size: 14px; white-space: nowrap; }
.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px;
  overscroll-behavior: contain; }
.icon-btn { background: rgba(255,255,255,.08); border: none; color: #fff; min-width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; font-weight: 700; font-size: 14px; }
.counts { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 10px 0; font-size: 11px; }
.count-chip { background: rgba(255,255,255,.07); border-radius: 999px; padding: 2px 8px; font-weight: 700; }
.pause-note { margin: 6px 10px 0; padding: 5px 8px; border-radius: 8px; background: rgba(249,115,22,.2);
  border: 1px solid var(--alert-orange); font-size: 11px; font-weight: 700; color: #fed7aa; }

#map-wrap { flex: 1 1 auto; min-width: 0; position: relative; background: #0b1020; }
#map { position: absolute; inset: 0; }
.map-tactical .maplibregl-canvas { filter: invert(1) hue-rotate(180deg) saturate(.8) brightness(.9) contrast(.92); }
.panel-tab { position: absolute; top: 50%; transform: translateY(-50%); z-index: 15; background: var(--bg-panel);
  border: 1px solid var(--border-subtle); color: #fff; padding: 12px 7px; font-size: 13px; font-weight: 800; cursor: pointer;
  writing-mode: vertical-rl; display: none; align-items: center; gap: 6px; min-height: 90px; }
.panel-tab.show { display: flex; }
#tab-left { left: 0; border-radius: 0 10px 10px 0; } #tab-right { right: 0; border-radius: 10px 0 0 10px; }
.panel-tab.ping { animation: pulseRing 1.2s infinite; border-color: var(--alert-orange); }
.badge-count { background: var(--alert-red); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }

/* superpositions de carte */
.radio-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 18; width: min(480px, calc(100% - 100px));
  background: rgba(15,23,42,.96); border: 1px solid rgba(34,211,238,.4); border-left: 4px solid var(--accent-cyan);
  border-radius: 10px; padding: 8px 12px; font-size: 12px; display: none; box-shadow: 0 10px 25px rgba(0,0,0,.5); }
.radio-banner.show { display: block; animation: slideIn .25s ease; }
.map-degraded { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 17; max-width: min(520px, calc(100% - 100px));
  background: rgba(124,45,18,.95); border: 1px solid var(--alert-orange); border-radius: 10px; padding: 7px 12px; font-size: 12px; font-weight: 700; display: none; }
.map-degraded.show { display: block; }
.overlay-bottom { position: absolute; left: 50px; right: 50px; bottom: max(8px, var(--sab)); z-index: 19; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; }
.overlay-bottom > * { pointer-events: auto; }
.tuto-bar, .placement-bar { background: linear-gradient(135deg, rgba(88,28,135,.96), rgba(15,23,42,.97)); border: 1px solid var(--accent-cyan);
  border-radius: 12px; padding: 8px 12px; max-width: 560px; width: 100%; font-size: 12px; display: none; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.tuto-bar.show { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.placement-bar.show { display: block; }
.placement-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
#placement-status { font-weight: 700; }
#placement-status.bad { color: #fca5a5; } #placement-status.good { color: #6ee7b7; }
.call-popup { background: linear-gradient(160deg, #16102b, #0b1224); border: 1px solid var(--alert-orange); border-radius: 14px;
  padding: 10px 12px; width: min(380px, 100%); box-shadow: 0 0 30px rgba(249,115,22,.35); display: none; }
.call-popup.show { display: block; animation: popCall .3s cubic-bezier(.16,1,.3,1); }
.pulse-phone { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(249,115,22,.2); color: var(--alert-orange); font-size: 16px; animation: pulseRing 1.4s infinite; flex: 0 0 auto; }
.call-popup p { font-size: 12px; color: #cbd5e1; margin: 6px 0 8px; }

/* menu carte */
.dropdown { position: absolute; top: calc(var(--top-h) + var(--sat) - 2px); right: max(10px, var(--sar)); z-index: 45; width: 290px;
  max-width: calc(100vw - 20px); max-height: calc(100dvh - 70px); overflow-y: auto; background: var(--bg-panel);
  border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.7); display: none; }
.dropdown.open { display: block; }
.dropdown h4 { margin: 8px 0 5px; font-size: 11px; color: var(--accent-cyan); text-transform: uppercase; letter-spacing: .5px; }
.dropdown h4:first-child { margin-top: 0; }
.seg { display: flex; gap: 5px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; }

/* ---------- Cartes et boutons ---------- */
.card { background: var(--bg-card); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 9px; }
.card-alert { border-left: 4px solid var(--alert-orange); } .card-active { border-left: 4px solid var(--accent-cyan); }
.card h3 { margin: 5px 0; font-size: 13px; }
.muted { color: var(--text-muted); } .small { font-size: 11px; }
.btn { background: linear-gradient(135deg, var(--accent-violet), #6d28d9); color: #fff; border: none; border-radius: 9px; padding: 8px 12px;
  font-weight: 700; font-size: 12px; cursor: pointer; min-height: 34px; }
.btn:hover { filter: brightness(1.1); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-cyan { background: linear-gradient(135deg, #0891b2, var(--accent-cyan)); color: #041019; }
.btn-outline { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-main); }
.btn-danger { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.btn-sm { padding: 4px 8px; font-size: 11px; min-height: 28px; } .btn-block { width: 100%; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; background: rgba(255,255,255,.1); }
.badge.ok { background: rgba(16,185,129,.25); color: #6ee7b7; } .badge.warn { background: rgba(249,115,22,.25); color: #fdba74; }
.badge.cy { background: rgba(34,211,238,.2); color: #67e8f9; }

/* listes compactes de véhicules / personnel */
.vrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 8px;
  background: rgba(255,255,255,.05); font-size: 12px; }
.vrow .vname { font-weight: 800; } .vrow .vmeta { font-size: 10px; color: var(--text-muted); }
.vrow.dim { opacity: .55; }
.vrow label { display: contents; }
.vrow input[type=checkbox] { width: 18px; height: 18px; }
.need-box { background: rgba(0,0,0,.3); padding: 6px 8px; border-radius: 8px; font-size: 12px; margin: 6px 0; }
/* ---------- Style des filtres missions & status GAMORSEC ---------- */
.mission-filter-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-chip { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); border-radius: 6px; padding: 2px 6px; font-size: 10px; font-weight: 700; cursor: pointer; }
.filter-chip.active { background: rgba(34,211,238,0.2); color: var(--accent-cyan); border-color: var(--accent-cyan); }

.mission-status-box { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; background: rgba(0,0,0,0.35); padding: 6px 8px; border-radius: 8px; margin: 6px 0; font-size: 11px; border: 1px solid rgba(255,255,255,0.05); }
.status-col { display: flex; flex-direction: column; gap: 2px; }
.status-col strong { color: var(--text-muted); font-size: 10px; text-transform: uppercase; }

/* ---------- Casernes : Tableau & Onglets verticaux GAMORSEC ---------- */
.station-side-layout { display: flex; gap: 8px; margin-top: 8px; }
.station-vertical-tabs { display: flex; flex-direction: column; gap: 4px; width: 85px; flex-shrink: 0; }
.v-tab-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); border-radius: 8px; padding: 6px 4px; font-size: 11px; font-weight: 700; cursor: pointer; text-align: left; }
.v-tab-btn.active { background: rgba(139,92,246,0.3); border-color: var(--accent-violet); color: #fff; }
.station-tab-content { flex: 1; min-width: 0; }

.building-info-view { display: flex; flex-direction: column; gap: 6px; }
.building-header-row { display: flex; gap: 6px; align-items: center; }
.building-name-input { flex: 1; font-weight: 800; font-size: 13px; padding: 4px 8px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; color: #fff; }
.building-stats-table { display: flex; flex-direction: column; gap: 4px; font-size: 11px; background: rgba(0,0,0,0.25); padding: 6px 8px; border-radius: 6px; }
.b-stat-row { display: flex; justify-content: space-between; }
.b-stat-row span { color: var(--text-muted); }

.gamorsec-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.gamorsec-table th { text-align: left; padding: 4px 5px; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 800; font-size: 10px; }
.gamorsec-table td { padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.gamorsec-table tr:hover { background: rgba(255,255,255,0.03); }
.stack { display: flex; flex-direction: column; gap: 5px; }

/* ---------- Fenêtres modales ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(3,6,15,.86); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal-box { background: #0e1629; border: 1px solid var(--accent-violet); border-radius: 16px; max-width: 640px; width: 100%;
  padding: 16px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.8); max-height: calc(100dvh - 24px); overflow-y: auto; }
.modal-box h2 { margin: 0 0 6px; font-size: 18px; }
input[type="text"], select { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35); color: #fff; font-size: 14px; outline: none; min-height: 36px; }
input[type="text"]:focus, select:focus { border-color: var(--accent-cyan); }
select option { background: #0e1629; }
.field { margin-bottom: 10px; } .field label { font-size: 12px; font-weight: 700; display: block; margin-bottom: 4px; }
.search-results { max-height: 130px; overflow-y: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.search-item { padding: 8px 10px; background: rgba(255,255,255,.05); border-radius: 8px; cursor: pointer; display: flex;
  justify-content: space-between; gap: 8px; font-size: 13px; min-height: 36px; align-items: center; }
.search-item:hover { background: rgba(139,92,246,.25); }
.branch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.branch-card { background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.12); border-radius: 10px; padding: 8px; font-size: 11px;
  color: var(--text-main); text-align: left; cursor: pointer; }
.branch-card.selected { border-color: var(--accent-cyan); background: rgba(34,211,238,.12); }
.branch-card.locked { opacity: .5; cursor: not-allowed; }
.branch-card strong { display: block; font-size: 13px; margin-bottom: 2px; }
.selected-box { background: rgba(34,211,238,.12); border: 1px solid var(--accent-cyan); padding: 8px; border-radius: 9px; margin-bottom: 10px; font-size: 12px; }

/* ---------- Boutique plein écran ---------- */
.shop-screen { position: fixed; inset: 0; z-index: 70; background: radial-gradient(circle at 20% 0%, #1a1440 0%, #0a1020 55%, #060913 100%);
  display: flex; flex-direction: column; padding-left: var(--sal); padding-right: var(--sar); }
.shop-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: max(8px, var(--sat));
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-panel); }
.shop-head h2 { margin: 0; font-size: 16px; flex: 1; }
.shop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; padding-bottom: max(12px, var(--sab)); }
.shop-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.07); border: 1px solid transparent; color: var(--text-main); border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 700; cursor: pointer; min-height: 32px; }
.chip.active { background: rgba(139,92,246,.35); border-color: var(--accent-violet); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.product { background: var(--bg-card); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 8px; cursor: pointer; text-align: left;
  color: var(--text-main); display: flex; flex-direction: column; gap: 4px; }
.product:hover { border-color: var(--accent-cyan); } .product.locked { opacity: .6; }
.product svg { width: 100%; height: auto; border-radius: 8px; background: rgba(0,0,0,.25); }
.detail { display: grid; grid-template-columns: minmax(200px, 42%) 1fr; gap: 16px; max-width: 980px; margin: 0 auto; }
.detail .art svg { width: 100%; height: auto; border-radius: 12px; background: rgba(0,0,0,.3); }
.detail table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail td { padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
.detail td:first-child { color: var(--text-muted); width: 42%; }
.buy-note { font-size: 12px; margin: 6px 0; font-weight: 700; }
.buy-note.bad { color: #fca5a5; } .buy-note.good { color: #6ee7b7; }

/* ---------- Divers ---------- */
.toast-wrap { position: fixed; top: calc(var(--top-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 120; display: flex;
  flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(460px, calc(100vw - 20px)); }
.toast { background: rgba(15,23,42,.97); border: 1px solid var(--accent-cyan); border-radius: 10px; padding: 8px 12px; font-size: 12px;
  font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.6); animation: fadeUp .2s ease; }
.toast.bad { border-color: var(--alert-orange); } .toast.good { border-color: var(--ok-green); }
.marker-station { width: 34px; height: 34px; border-radius: 50%; background: #8b5cf6; border: 3px solid #fff; color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 0 16px #8b5cf6; cursor: pointer; }
.marker-mission { width: 22px; height: 22px; border-radius: 50%; background: #ef4444; border: 1.5px solid #fff; color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 900; font-size: 11px; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); cursor: pointer; animation: pulseRing 1.6s infinite; }
.marker-vehicle { padding: 3px 7px; border-radius: 999px; background: #22d3ee; color: #060913; font-weight: 900; font-size: 11px;
  border: 2px solid #060913; box-shadow: 0 0 12px #22d3ee; }
.maplibregl-ctrl-attrib { font-size: 10px; }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(249,115,22,.65); } 70% { box-shadow: 0 0 0 12px rgba(249,115,22,0); } 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); } }
@keyframes popCall { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Paysage mobile / petite hauteur ---------- */
@media (max-height: 460px) {
  :root { --top-h: 40px; --panel-w: clamp(200px, 30vw, 290px); }
  .hud-top { gap: 5px; padding-top: max(3px, var(--sat)); padding-bottom: 3px; }
  .brand { font-size: 12px; } .stat-pill { padding: 3px 6px; font-size: 11px; }
  .top-btn { min-height: 32px; padding: 3px 7px; font-size: 11px; }
  .panel-head { padding: 4px 8px; } .panel-body { padding: 6px; gap: 6px; }
  .card { padding: 7px; } .modal-box { padding: 11px 13px; } .modal-box h2 { font-size: 15px; }
  .search-results { max-height: 80px; } .detail { gap: 10px; } .btn { padding: 6px 9px; }
}
@media (max-width: 960px) { .brand .brand-title, .hide-small { display: none; } .top-btn .lbl { display: none; } .detail { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .branch-grid { grid-template-columns: 1fr; } }

/* ---------- Portrait : invitation à tourner l'appareil ---------- */
.portrait-warning { display: none; }
@media (max-width: 850px) and (orientation: portrait) {
  .portrait-warning { display: flex; position: fixed; z-index: 9999; inset: 0; padding: 32px; padding-top: max(40px, var(--sat));
    flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: radial-gradient(circle at 50% 35%, #233256 0%, #101628 55%, #060913 100%); }
  .portrait-warning .rotate-symbol { font-size: 88px; line-height: 1; color: var(--accent-cyan); }
  .portrait-warning h1 { font-size: 25px; margin: 14px 0; }
  .portrait-warning p { font-size: 15px; line-height: 1.5; max-width: 310px; color: #bfcbdf; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =========================
   DOUBLE-V URGENCES V1 UI
   Refonte paysage plein écran
   ========================= */
:root {
  --bg-deep: #09111f;
  --bg-panel: rgba(11, 19, 35, 0.82);
  --bg-card: rgba(18, 28, 48, 0.92);
  --border-subtle: rgba(120, 145, 185, 0.25);
  --accent-violet: #8b5cf6;
  --accent-cyan: #63d4ff;
  --alert-orange: #ff9d3f;
  --text-main: #f8fbff;
  --text-muted: #adc0d8;
  --top-h: 54px;
  --panel-w: min(340px, calc(100vw - 34px));
}
body { background: #0b1324; }
.app-main { min-height: 100dvh; }
.hud-top {
  position: absolute;
  top: max(10px, calc(var(--sat) + 8px));
  left: max(12px, calc(var(--sal) + 12px));
  right: max(12px, calc(var(--sar) + 12px));
  min-height: var(--top-h);
  background: rgba(10, 17, 31, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(147, 197, 253, 0.15);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  padding: 6px 10px;
}
.brand-badge {
  color: #fff;
  background: linear-gradient(135deg, #79a7ff, #7c5cff);
  border-radius: 999px;
  padding: 5px 10px;
}
.brand-title { color: #fff; font-size: 15px; }
.hud-group { flex-wrap: wrap; }
.stat-pill, .top-btn {
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.stat-pill { padding: 6px 11px; }
.top-btn { min-height: 36px; padding: 6px 12px; }
.top-btn.shop { background: rgba(255,255,255,.14); }
.xp-bar-container { width: 92px; }
.app-main { position: relative; }
#map-wrap { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; }
.side-panel {
  position: absolute;
  top: calc(max(10px, calc(var(--sat) + 8px)) + var(--top-h) + 12px);
  bottom: max(12px, calc(var(--sab) + 12px));
  width: var(--panel-w);
  background: rgba(8, 14, 27, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 212, 255, .16);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0,0,0,.34);
  overflow: hidden;
  z-index: 25;
  padding: 0 !important;
}
#panel-left { left: max(12px, calc(var(--sal) + 12px)); border-right: 0; }
#panel-right { right: max(12px, calc(var(--sar) + 12px)); border-left: 0; }
.side-panel.collapsed {
  display: flex;
  width: var(--panel-w);
  opacity: 0;
  pointer-events: none;
}
#panel-left.collapsed { transform: translateX(calc(-1 * (var(--panel-w) + 14px))); }
#panel-right.collapsed { transform: translateX(calc(var(--panel-w) + 14px)); }
.panel-head { padding: 12px 14px; background: rgba(255,255,255,.03); }
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 10px; gap: 10px; }
.counts { padding: 8px 12px 0; }
#tab-left, #tab-right {
  display: flex;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 14px;
  padding: 12px 9px;
  background: rgba(10, 17, 31, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(147, 197, 253, 0.16);
  box-shadow: 0 14px 36px rgba(0,0,0,.34);
}
#tab-left { left: 10px; }
#tab-right { right: 10px; }
.panel-tab.show { display: flex; }
.maplibregl-ctrl-top-right, .maplibregl-ctrl-top-left { margin-top: 90px; }
.overlay-bottom { left: 50%; right: auto; transform: translateX(-50%); width: min(760px, calc(100vw - 30px)); }
.tuto-bar, .placement-bar, .call-popup {
  background: rgba(10, 17, 31, 0.92);
  border: 1px solid rgba(99, 212, 255, .22);
  border-radius: 18px;
}
.card {
  border-radius: 14px;
  background: rgba(17, 27, 47, 0.94);
  border: 1px solid rgba(255,255,255,.06);
}
.modal-backdrop {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}
.modal-box {
  border-radius: 22px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: rgba(56, 63, 75, 0.94);
  box-shadow: 0 24px 60px rgba(0,0,0,.38);
}
.intro-box {
  max-width: 520px;
  text-align: center;
  padding: 26px 28px;
}
.intro-box h2 { font-size: 24px; margin-bottom: 10px; }
.intro-copy { font-size: 16px; line-height: 1.5; color: #eef4ff; margin: 0 0 18px; }
input[type="text"], select {
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  color: #1f2937;
  border: 1px solid rgba(0,0,0,.12);
}
.search-item, .branch-card, .selected-box {
  border-radius: 12px;
}
.search-item { background: rgba(255,255,255,.9); color: #17212f; }
.branch-card {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}
.branch-card.selected {
  background: rgba(37, 99, 235, .22);
  border-color: #60a5fa;
}
.selected-box {
  background: rgba(191, 219, 254, .2);
  border-color: rgba(147, 197, 253, .45);
}
.icon-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.06); }
.toast-wrap { top: calc(max(10px, calc(var(--sat) + 8px)) + var(--top-h) + 10px); }
.shop-screen {
  background: radial-gradient(circle at top, #18263f 0%, #0b1324 60%, #07101d 100%);
}
.shop-head { background: rgba(10, 17, 31, 0.88); }
.gamorsec-table th { color: #cfe5ff; }
.marker-station { background: #ffb341; box-shadow: 0 0 20px rgba(255,179,65,.55); }
.marker-mission { background: #ff5a5f; box-shadow: 0 0 18px rgba(255,90,95,.55); }
.marker-vehicle { background: #7ce7ff; color: #07101d; }
@media (max-width: 960px) {
  .hud-top { gap: 6px; }
  .side-panel { width: min(320px, calc(100vw - 26px)); }
}
@media (max-height: 520px) {
  .hud-top { min-height: 48px; }
  .side-panel { top: calc(max(8px, calc(var(--sat) + 6px)) + 48px + 10px); }
}
