@font-face { font-family: 'Archivo'; src: url('../fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'JB'; src: url('../fonts/jbmono.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #07080c;
  --panel: rgba(9, 10, 16, 0.78);
  --panel-solid: #0c0e15;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text: #f4f1ec;
  --muted: #9a98a6;
  --pink: #ff3e8a;
  --sun: #ffb347;
  --teal: #2ad3c9;
  --cut: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ink); color: var(--text); }
body { font-family: 'Archivo', system-ui, sans-serif; font-stretch: 100%; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: 'JB', ui-monospace, monospace; }

/* --- carte --- */
#map { position: fixed; inset: 0; }
#map canvas { display: block; touch-action: none; }
.labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.zlabel { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 15px; font-weight: 900; font-stretch: 125%; letter-spacing: .04em; text-transform: uppercase; color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 0 14px rgba(0,0,0,.55); transition: opacity .3s; }
.zlabel i { width: 9px; height: 9px; background: var(--zc); transform: rotate(45deg); box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.zlabel:hover { color: var(--zc); }
.blip { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: opacity .3s; }
.blip b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(7,8,12,.9);
  border: 3px solid var(--zc); color: var(--zc); font-size: 14px; font-weight: 900; box-shadow: 0 2px 10px rgba(0,0,0,.5); transition: transform .15s; }
.blip.live b { box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 2px 10px rgba(0,0,0,.5); }
.blip span { font-size: 11px; font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: .03em; color: #fff;
  background: rgba(7,8,12,.78); padding: 3px 7px; white-space: nowrap; opacity: 0; transform: translateY(-3px); transition: .2s; }
.blip.near span, .blip:hover span { opacity: 1; transform: none; }
.blip:hover b { transform: scale(1.12); }
.blip::after { content: ''; width: 2px; height: 14px; background: linear-gradient(var(--zc), transparent); order: -1; display: none; }

/* --- forme unique : rectangle à coin coupé (HUD) --- */
.cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  font-size: 12px; font-weight: 700; font-stretch: 112%; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.08); border: 0; position: relative;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: background .15s, color .15s;
}
.btn:hover { background: rgba(255,255,255,.16); }
.btn.solid { background: var(--pink); color: #fff; }
.btn.solid:hover { background: #ff5c9d; }
.btn svg { width: 15px; height: 15px; }

/* --- barre haute --- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: 64px;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: linear-gradient(to bottom, rgba(5,6,10,.85), rgba(5,6,10,0));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.mark { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.mark b { font-size: 26px; font-weight: 900; font-stretch: 125%; letter-spacing: -.01em; transform: skewX(-8deg); display: inline-block; }
.mark b i { font-style: normal; color: var(--pink); }
.mark span { font-size: 11px; font-weight: 600; font-stretch: 100%; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.top nav { display: flex; gap: 6px; }
.ca-chip { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; background: rgba(255,255,255,.06);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); font-size: 12px; }
.ca-chip em { font-style: normal; font-weight: 800; color: var(--sun); font-stretch: 112%; }
.ca-chip .mono { color: var(--muted); }
.ca-chip button { color: var(--text); opacity: .8; } .ca-chip button:hover { opacity: 1; }

/* --- panneau gauche : légende des zones --- */
.legend {
  position: fixed; z-index: 9; left: 18px; top: 84px; width: 300px; max-height: calc(100% - 200px);
  display: flex; flex-direction: column; background: var(--panel); backdrop-filter: blur(10px);
  border-left: 2px solid var(--pink);
}
.legend h2 { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 14px 16px 8px; display: flex; justify-content: space-between; }
.zones { overflow-y: auto; scrollbar-width: thin; }
.zone { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 16px; border-top: 1px solid var(--line); transition: background .15s; }
.zone:hover, .zone.on { background: rgba(255,255,255,.06); }
.zone .sw { width: 10px; height: 10px; transform: rotate(45deg); }
.zone strong { display: block; font-size: 16px; font-weight: 800; font-stretch: 115%; letter-spacing: .01em; text-transform: uppercase; }
.zone small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.zone .n { font-family: 'JB', monospace; font-size: 12px; color: var(--muted); }
.zone.on strong { color: var(--zc); }
.coins { border-top: 1px solid var(--line); background: rgba(0,0,0,.25); display: none; }
.zone.on + .coins { display: block; }
.coin-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 16px 8px 38px; font-size: 13px; text-align: left; }
.coin-row:hover { background: rgba(255,255,255,.05); }
.coin-row .bl { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #0b0b0b; flex: none; }
.coin-row .t { margin-left: auto; font-family: 'JB', monospace; font-size: 11px; color: var(--muted); }
.coin-row.empty { color: var(--muted); font-size: 12px; cursor: default; }

/* --- bas gauche : chiffres de l'écosystème --- */
.stats { position: fixed; z-index: 9; left: 18px; bottom: 18px; display: flex; gap: 2px; }
.stat { background: var(--panel); backdrop-filter: blur(10px); padding: 10px 14px; min-width: 140px; }
.stat label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; font-family: 'JB', monospace; font-size: 18px; font-weight: 600; margin-top: 3px; }
.stat b.pink { color: var(--pink); } .stat b.sun { color: var(--sun); }

/* --- fiche à droite --- */
.card {
  position: fixed; z-index: 9; right: 18px; top: 84px; width: 340px; background: var(--panel); backdrop-filter: blur(10px);
  border-right: 2px solid var(--zc, var(--pink)); transform: translateX(calc(100% + 30px)); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.card.show { transform: none; }
.card .head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); position: relative; }
.card .head small { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--zc, var(--muted)); }
.card .head h3 { font-size: 28px; font-weight: 900; font-stretch: 120%; text-transform: uppercase; line-height: 1.05; margin-top: 4px; }
.card .head .tk { font-family: 'JB', monospace; font-size: 13px; color: var(--muted); margin-top: 4px; }
.card .x { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); }
.card .x:hover { color: var(--text); }
.card .img { width: 100%; aspect-ratio: 1.6; object-fit: cover; display: block; background: #111; }
.card .rows { padding: 6px 18px; }
.card .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.card .row:last-child { border-bottom: 0; }
.card .row span { color: var(--muted); }
.card .row b { font-family: 'JB', monospace; font-weight: 600; }
.card .up { color: #3ddc84; } .card .down { color: #ff5a5a; }
.card .acts { display: flex; gap: 6px; padding: 12px 18px 18px; }
.card p.blurb { padding: 12px 18px 0; font-size: 14px; line-height: 1.5; color: #d8d5de; }

/* --- compte à rebours --- */
.count { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.count b { font-family: 'JB', monospace; font-size: 13px; color: var(--text); letter-spacing: 0; }

/* --- boussole / contrôles bas droite --- */
.ctrl { position: fixed; z-index: 9; right: 18px; bottom: 34px; display: flex; gap: 2px; }
.ctrl button { width: 40px; height: 40px; background: var(--panel); display: grid; place-items: center; backdrop-filter: blur(10px); }
.ctrl button:hover { background: rgba(30,32,44,.9); }
.ctrl svg { width: 18px; height: 18px; }
.ctrl .sep { width: 8px; }
.ctrl .compass svg { width: 22px; height: 22px; transition: transform .08s linear; }
.hint-rot { position: fixed; z-index: 9; right: 18px; bottom: 80px; font: 11px 'JetBrains Mono', monospace; letter-spacing: .04em; color: rgba(255,255,255,.55); background: var(--panel); padding: 6px 10px; backdrop-filter: blur(10px); transition: opacity .6s; pointer-events: none; }
.hint-rot.gone { opacity: 0; }

/* --- voile de chargement --- */
.veil { position: fixed; inset: 0; z-index: 50; background: var(--ink); display: grid; place-items: center; transition: opacity .9s; }
.veil.off { opacity: 0; pointer-events: none; }
.veil b { font-size: 46px; font-weight: 900; font-stretch: 125%; transform: skewX(-8deg); letter-spacing: -.01em; }
.veil b i { font-style: normal; color: var(--pink); }
.veil .bar { width: 220px; height: 2px; background: var(--line); margin: 18px auto 0; overflow: hidden; }
.veil .bar i { display: block; height: 100%; width: 40%; background: var(--pink); animation: load 1.1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--panel-solid); padding: 10px 16px; font-size: 13px; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  /* barre haute : logo + compte à rebours, puis CA + Buy + menu */
  .top { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 6px; background: linear-gradient(to bottom, rgba(5,6,10,.92), rgba(5,6,10,.55) 75%, rgba(5,6,10,0)); }
  .mark { margin-right: auto; } .mark span { display: none; } .mark b { font-size: 21px; }
  .count { height: 30px; padding: 0 9px; gap: 6px; font-size: 9px; }
  .count b { font-size: 12px; } .count .csub { display: none; }
  .ca-chip { order: 3; flex: 1 1 180px; min-width: 0; height: 34px; } .top nav { order: 4; } .ca-chip .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .top nav { gap: 4px; }
  .top nav .btn { height: 34px; padding: 0 11px; }
  .top nav .hide-m { display: none; }
  .top nav #xlink { padding: 0 10px; } .top nav #xlink .xl { display: none; }
  .top nav .menu-m { display: inline-flex !important; padding: 0 9px !important; }
  .top.menu-open nav { position: absolute; top: 100%; right: 10px; flex-direction: column; align-items: stretch; background: var(--panel-solid); padding: 6px; gap: 4px; margin-top: 4px; }
  .top.menu-open nav .hide-m, .top.menu-open nav #xlink { display: inline-flex; }
  .top.menu-open nav .menu-m { order: -1; align-self: flex-end; }
  /* tiroir des régions en bas : replié par défaut, la carte garde l'écran */
  .legend { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 64px; border-left: 0; border-top: 2px solid var(--pink); clip-path: none; transition: max-height .35s cubic-bezier(.2,.8,.2,1); }
  .legend.open { max-height: 62%; }
  .legend h2 { cursor: pointer; padding: 12px 16px 6px; align-items: center; }
  .legend .chev { display: block; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(-45deg); margin-left: 10px; transition: transform .3s; }
  .legend.open .chev { transform: rotate(135deg); }
  .legend .search { margin: 0 12px 10px; }
  .legend:not(.open) .zones, .legend:not(.open) .results { display: none; }
  .stats { display: none; }
  .card { left: 0; right: 0; width: auto; top: auto; bottom: 0; z-index: 12; border-right: 0; border-top: 2px solid var(--zc, var(--pink)); clip-path: none; transform: translateY(105%); max-height: 70%; overflow-y: auto; }
  .card .pic { height: 120px; }
  .ctrl { right: 8px; bottom: auto; top: 104px; flex-direction: column; }
  .ctrl #c-overview, .ctrl #c-orbit, .ctrl .sep { display: none; }
  .ctrl button { width: 38px; height: 38px; }
  .hint-rot { display: none; }
  .blip b { width: 32px !important; height: 32px !important; }
  .plabel span { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .veil .bar i { animation: none; } .card { transition: none; } }
.card .row b.loc { font-family: 'Archivo', sans-serif; font-weight: 700; text-align: right; max-width: 60%; }

/* portraits des coins */
.blip b { background-size: cover; background-position: center; color: transparent; width: 38px; height: 38px; }
.coin-row .bl { width: 26px; height: 26px; background-size: cover; background-position: center; box-shadow: 0 0 0 2px var(--zc); color: transparent; }
.card .pic { position: relative; height: 150px; overflow: hidden; border-bottom: 1px solid var(--line); }
.card .pic .ban { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .pic .ava { position: absolute; left: 16px; bottom: 12px; width: 76px; height: 76px; object-fit: cover; border: 3px solid var(--zc, var(--pink)); background: #111; }

/* ---- lieux nommés (Launch Gallery / base gtadb) ---- */
.plabel { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; pointer-events: none; transition: opacity .35s; }
.plabel i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
.plabel span { font: 600 11px 'Archivo', sans-serif; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.6); letter-spacing: .02em; }
.plabel em { font: 500 9px 'JB', monospace; font-style: normal; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.65); margin-left: 6px; }
/* nouveaux coins */
.blip.fresh b::after { content: 'NEW'; position: absolute; top: -7px; right: -14px; font: 800 8px 'Archivo', sans-serif; letter-spacing: .06em; color: #0b0c12; background: var(--sun); padding: 2px 4px; }
.blip b { position: relative; }
.coin-row .new { font: 800 8px 'Archivo', sans-serif; font-style: normal; letter-spacing: .06em; color: #0b0c12; background: var(--sun); padding: 2px 4px; margin-left: 6px; vertical-align: 2px; }
/* compte à rebours : étape suivante */
.count .csub { font: 600 9px 'JB', monospace; letter-spacing: .08em; color: var(--sun); text-transform: uppercase; }
body.released .count { background: rgba(255,62,138,.18); }
body.released .count b { color: var(--pink); }
/* jour J */
.launch { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 60%, rgba(255,62,138,.28), rgba(7,8,12,.86) 60%); opacity: 0; transition: opacity .7s; }
.launch.show { opacity: 1; }
.launch .in { text-align: center; padding: 24px; transform: translateY(14px); transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.launch.show .in { transform: none; }
.launch small { font: 600 11px 'JB', monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--sun); }
.launch h2 { font: 900 clamp(44px, 8vw, 96px)/1 'Archivo', sans-serif; font-stretch: 125%; text-transform: uppercase; margin: 14px 0; color: #fff; }
.launch h2 b { color: var(--pink); text-shadow: 0 0 30px rgba(255,62,138,.7); }
.launch p { color: rgba(255,255,255,.75); margin: 0 auto 22px; max-width: 420px; }

/* ---- recherche ---- */
.menu-m { display: none !important; }
.legend .chev { display: none; }
.search { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; height: 36px; padding: 0 10px; background: rgba(255,255,255,.06); }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font: 500 13px 'Archivo', sans-serif; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 600 10px 'JB', monospace; color: var(--muted); border: 1px solid var(--line-strong); padding: 1px 5px; }
.search:focus-within { background: rgba(255,255,255,.1); box-shadow: inset 0 -2px 0 var(--pink); }
.results { border-top: 1px solid var(--line); }
.legend.searching .zones { display: none; }
.hit { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; text-align: left; border-left: 2px solid transparent; }
.hit:hover, .hit.on { background: rgba(255,255,255,.07); border-left-color: var(--zc); }
.hit .bl { width: 26px; height: 26px; border-radius: 50%; background: center / cover; box-shadow: 0 0 0 2px var(--zc); flex: none; }
.hit .kd { width: 26px; text-align: center; color: var(--zc); flex: none; }
.hit .nm { font-size: 13px; font-weight: 700; }
.hit .nm small { display: block; font: 500 11px 'JB', monospace; color: var(--muted); font-weight: 400; margin-top: 1px; }
.results .none { padding: 12px 16px; color: var(--muted); font-size: 12px; }
.card .acts .btn svg { width: 14px; height: 14px; }
/* ---- chaleur : les coins les plus échangés grossissent et pulsent ---- */
.blip b { transform: scale(calc(1 + var(--heat, 0) * .55)); }
.blip:hover b { transform: scale(calc(1.12 + var(--heat, 0) * .55)); }
.blip.hot b { animation: hot 1.8s ease-in-out infinite; }
@keyframes hot { 0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 0 0 0 var(--zc); } 50% { box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 0 22px 8px var(--zc); } }
@media (prefers-reduced-motion: reduce) { .blip.hot b { animation: none; } }

/* ---- événement daté (GTA VI: The Festival) ---- */
.blip.event b::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--pink); animation: evt 2.2s ease-out infinite; }
.blip .evt { order: 3; font: 800 8px 'JB', monospace; font-style: normal; letter-spacing: .1em; color: #0b0c12; background: var(--pink); padding: 2px 5px; margin-top: -2px; }
.blip.live-evt .evt { background: #3ddc84; animation: livep 1s ease-in-out infinite; }
@keyframes evt { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes livep { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .blip.event b::before, .blip.live-evt .evt { animation: none; } }

/* bouton X bien visible */
#xlink { background: #fff; color: #0b0c12; }
#xlink:hover { background: #ffe6f0; }
#xlink .xl { margin-left: 2px; }
.top.menu-open nav #xlink .xl { display: inline; }
