/* map.gtacali.net: a website look in the GTA Cali brand (night blue, gold,
   Cairo + Inter, Tajawal for Arabic), not the in-game UI style. */
@font-face { font-family: Cairo; font-weight: 200 1000; font-display: swap; src: url(../fonts/cairo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Cairo; font-weight: 200 1000; font-display: swap; src: url(../fonts/cairo-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Tajawal; font-weight: 400; font-display: swap; src: url(../fonts/tajawal-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Tajawal; font-weight: 500; font-display: swap; src: url(../fonts/tajawal-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Tajawal; font-weight: 700; font-display: swap; src: url(../fonts/tajawal-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --body: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: Cairo, Inter, 'Segoe UI', sans-serif;
  --gold: #ffc72c;
  --sun: #ff7a3d;
  --sunset: linear-gradient(100deg, #ffd23f 0%, #ff9a3c 45%, #ff5e62 100%);
  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
}
:root[lang="ar"] { --body: Tajawal, Inter, 'Segoe UI', sans-serif; --display: Cairo, Tajawal, sans-serif; }
:root, :root[data-theme="dark"] {
  --bg: #070a12;
  --glass: rgba(11, 15, 25, .86);
  --glass-2: rgba(255, 255, 255, .05);
  --glass-3: rgba(255, 255, 255, .09);
  --edge: rgba(255, 255, 255, .09);
  --text: #f5f2ea;
  --soft: #a9adbb;
  --faint: #6f7484;
  --accent-text: #ffd45c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e9edf2;
  --glass: rgba(255, 255, 255, .92);
  --glass-2: rgba(10, 20, 40, .045);
  --glass-3: rgba(10, 20, 40, .08);
  --edge: rgba(10, 20, 40, .1);
  --text: #141821;
  --soft: #545b6b;
  --faint: #8a90a0;
  --accent-text: #9a6a00;
  --shadow: 0 16px 44px rgba(20, 30, 50, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: 10px; inset-inline-start: 10px; z-index: 99; background: var(--gold); color: #111; padding: 8px 14px; border-radius: 999px; transform: translateY(-200%); font-weight: 700; text-decoration: none; }
.skip:focus { transform: none; }
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip svg { transform: scaleX(-1); }
.muted { color: var(--soft); }
.small { font-size: 12px; }

#app { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#map.dragging { cursor: grabbing; }
#map.picking { cursor: crosshair; }

.glass { background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }

/* ---------- top bar ---------- */
.topbar { position: absolute; top: 14px; inset-inline: 14px; display: flex; align-items: center; gap: 12px; pointer-events: none; z-index: 5; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px 0 12px; border-radius: var(--r-lg); text-decoration: none; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.brand img { width: 58px; height: 36px; object-fit: contain; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.brand-t b { font: 800 16px/1.1 var(--display); letter-spacing: .01em; }
.brand-t b::after { content: ''; display: block; width: 26px; height: 3px; margin-top: 4px; border-radius: 3px; background: var(--sunset); }
.brand-t small { color: var(--soft); font-size: 11px; margin-top: 3px; }
.search { position: relative; flex: 0 1 460px; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 12px 0 16px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.search:focus-within { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.search > .ic { color: var(--soft); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.top-actions { margin-inline-start: auto; display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); font-weight: 600; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.icon-btn:hover, .pill:hover { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.icon-btn.small { width: 30px; height: 30px; box-shadow: none; background: var(--glass-2); border: 0; }
.phone-only { display: none !important; }

/* search results */
.results { position: absolute; top: calc(100% + 8px); inset-inline: 0; max-height: min(60vh, 520px); overflow: auto; padding: 8px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.res-h { margin: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
:root[lang="ar"] .res-h { letter-spacing: 0; text-transform: none; }
.res { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: var(--r-md); text-align: start; }
.res:hover, .res.on { background: var(--glass-3); }
.res b { display: block; font-weight: 600; }
.res small { display: block; color: var(--soft); font-size: 12px; }
.res .dot { flex: none; }
.res-empty { padding: 14px 12px; color: var(--soft); }

/* ---------- side panel ---------- */
.panel { position: absolute; top: 82px; bottom: 14px; inset-inline-start: 14px; width: 330px; z-index: 4; overflow: auto; overscroll-behavior: contain; padding: 8px 14px 14px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); scrollbar-width: thin; }
.sec { padding: 12px 0 14px; border-bottom: 1px solid var(--edge); }
.sec:last-of-type { border-bottom: 0; }
.sec-h { margin: 0 0 10px; font: 700 12px/1.2 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
:root[lang="ar"] .sec-h { letter-spacing: 0; text-transform: none; font-size: 13px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; }
.sec-row .sec-h { margin-bottom: 10px; }
.link-btn { color: var(--accent-text); font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.link-btn:hover { text-decoration: underline; }

.looks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.look { display: flex; flex-direction: column; gap: 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--edge); background: var(--glass-2); text-align: start; }
.look[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.look-img { display: block; height: 64px; background-size: 256px 256px; background-position: 40% 55%; }
.look-city { background-image: url(../../tiles/city-dark/4/5/9.webp); }
:root[data-theme="light"] .look-city { background-image: url(../../tiles/city-light/4/5/9.webp); }
.look-game { background-image: url(../../tiles/game/4/5/9.webp); }
.look-t { padding: 8px 10px 9px; }
.look-t b { display: block; font-weight: 700; font-size: 13px; }
.look-t small { display: block; color: var(--soft); font-size: 11px; line-height: 1.3; }

.switches { display: grid; gap: 2px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-radius: var(--r-sm); cursor: pointer; }
.switch:hover { background: var(--glass-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.sw { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--glass-3); border: 1px solid var(--edge); transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--soft); transition: inset-inline-start .15s, background .15s; }
.switch input:checked + .sw { background: color-mix(in srgb, var(--gold) 30%, transparent); border-color: color-mix(in srgb, var(--gold) 70%, transparent); }
.switch input:checked + .sw::after { inset-inline-start: 16px; background: var(--gold); }
.switch input:focus-visible + .sw { outline: 2px solid var(--gold); outline-offset: 2px; }

.legend { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; color: var(--soft); max-height: 220px; overflow: auto; }
.legend span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.legend i { flex: none; width: 12px; height: 12px; border-radius: 4px; }
.legend em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* categories */
.grp { margin-top: 6px; }
.grp-h { margin: 10px 4px 4px; font-size: 12px; font-weight: 600; color: var(--soft); }
.cat { border-radius: var(--r-md); }
.cat-row { display: flex; align-items: center; gap: 4px; }
.cat-btn { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 7px 6px; border-radius: var(--r-sm); text-align: start; }
.cat-btn:hover { background: var(--glass-2); }
.cat-btn .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cat-btn .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cat.off .cat-btn .name { color: var(--faint); }
.cat.off .dot { filter: grayscale(1); opacity: .45; }
.cat-more { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--faint); }
.cat-more:hover { background: var(--glass-2); color: var(--text); }
.cat-more .ic { transition: transform .15s; }
.cat.open .cat-more .ic { transform: rotate(180deg); }
.cat-list { margin: 2px 0 8px; padding-inline-start: 36px; display: grid; gap: 1px; max-height: 260px; overflow: auto; }
.cat-item { display: block; width: 100%; padding: 5px 8px; border-radius: 7px; text-align: start; font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-item:hover { background: var(--glass-2); color: var(--text); }
.dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #0b0e14; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.dot .ic { width: 15px; height: 15px; }
.dot .ic svg { stroke-width: 2.2; }

/* tools */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--r-md); background: var(--glass-2); border: 1px solid var(--edge); font-weight: 600; font-size: 13px; text-align: start; }
.tool:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.tool[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 16%, transparent); border-color: var(--gold); }
.toolbox { margin-top: 10px; padding: 12px; border-radius: var(--r-md); background: var(--glass-2); border: 1px solid var(--edge); display: grid; gap: 10px; }
.toolbox p { margin: 0; }
.tb-big { font: 800 22px/1.1 var(--display); }
.tb-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 13px; border-radius: 10px; background: var(--glass-3); border: 1px solid var(--edge); font-weight: 600; font-size: 13px; }
.btn:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.btn.primary { background: var(--gold); color: #17130a; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.on { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: var(--gold); }
.btn .ic { width: 16px; height: 16px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; color: var(--soft); font-weight: 600; }
.field-val { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px 6px 12px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--edge); }
.field-val b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-val.empty b { color: var(--faint); }
.input { width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--edge); outline: none; }
.input:focus { border-color: var(--gold); }
.draw-list { display: grid; gap: 4px; max-height: 170px; overflow: auto; }
.draw-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 4px 4px 8px; border-radius: 8px; background: var(--glass-2); }
.draw-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel-foot { padding-top: 12px; }
.panel-foot p { margin: 0 0 6px; }
.foot-links { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; font-weight: 600; }
.foot-links a { color: var(--accent-text); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

/* ---------- place card ---------- */
.card { position: absolute; top: 82px; inset-inline-end: 14px; width: 340px; max-height: calc(100% - 150px); overflow: auto; z-index: 4; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }
.card-head { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 12px; }
.card-head::before { content: ''; position: absolute; top: 0; inset-inline: 16px; height: 3px; border-radius: 0 0 3px 3px; background: var(--sunset); }
.card-head .dot { width: 38px; height: 38px; }
.card-head .dot .ic { width: 20px; height: 20px; }
.card-title { flex: 1; min-width: 0; }
.card-title h2 { margin: 2px 0 2px; font: 800 19px/1.2 var(--display); overflow-wrap: anywhere; }
.card-title p { margin: 0; color: var(--soft); font-size: 13px; }
.card-body { padding: 0 16px 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--soft); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--edge); }
.price { font: 800 20px/1.2 var(--display); color: var(--accent-text); }

/* ---------- map controls + status ---------- */
.mapctl { position: absolute; inset-inline-end: 14px; bottom: 56px; z-index: 3; display: grid; gap: 8px; }
.status { position: absolute; bottom: 14px; inset-inline-end: 14px; z-index: 3; display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 6px 0 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow); font-size: 12px; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.coords { display: inline-flex; gap: 10px; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; font-weight: 600; direction: ltr; }
.coords:hover { background: var(--glass-3); }
.c-area { color: var(--soft); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-area:empty { display: none; }
.scale { display: inline-flex; align-items: center; gap: 8px; padding-inline-end: 8px; color: var(--soft); direction: ltr; }
.scale-bar { display: block; height: 6px; border: 2px solid currentColor; border-top: 0; }

.toast { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 9; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 28px); overflow-wrap: anywhere; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .phone-only { display: inline-grid !important; }
  .topbar { top: 10px; inset-inline: 10px; gap: 8px; flex-wrap: wrap; }
  .brand { height: 46px; padding: 0 10px; }
  .brand img { width: 44px; height: 28px; }
  .brand-t small { display: none; }
  .search { order: 3; flex: 1 0 100%; height: 46px; }
  .pill span { display: none; }
  .pill { width: 44px; padding: 0; justify-content: center; }
  .panel { top: auto; bottom: 0; inset-inline: 0; width: auto; max-height: 72vh; border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(105%); transition: transform .25s ease; padding-top: 0; }
  .panel.open { transform: none; }
  .sheet-grip { display: block !important; width: 44px; height: 5px; margin: 10px auto 2px; border-radius: 5px; background: var(--faint); }
  .card { top: auto; bottom: 0; inset-inline: 0; width: auto; max-height: 60vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .toast { bottom: auto; top: 128px; }
  .mapctl { bottom: 58px; }
  .status { inset-inline: 10px auto; bottom: 10px; }
  .c-area { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
