/* Grand Theft Altcoin — CTFR Edition v1.1 — thème synthwave / Outrun 80s.
   Perf : pas de backdrop-filter, pas d'ombres animées, seules transform/opacity sont animées. */

:root {
  --night: #0d0221; --night2: #1a0b3a; --panel: #140a2e; --line: #3a1f6e;
  --pink: #ff2a6d; --cyan: #05d9e8; --orange: #ff9e00; --yellow: #f9c80e; --purple: #7b2cbf;
  --green: #39ff14; --red: #ff3355; --text: #f4eaff; --muted: #a89bc9;
  --f-pixel: 'Press Start 2P', monospace; --f-lcd: 'VT323', monospace;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --well: #07010f;
  --sep: rgba(58, 31, 110, .6);
  --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: transparent; color: var(--text); /* le fond est sur html + body::before (sinon il masquerait le dégradé) */
  font: 15px/1.4 var(--f-body);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* fond de nuit statique + scanlines CRT (une seule couche fixe, jamais animée) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, #2a0d57 0%, var(--night) 60%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 95; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px);
}
img, svg { flex-shrink: 0; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }
/* le bouton reste la cible du tap même si son contenu est re-rendu entre pointerdown et pointerup */
.screen button *, .sheet button *, .chal-modal button *, .radio-dock-head button * { pointer-events: none; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
p { margin: 0 0 8px; }

/* ---------------------------------------------------------------- typo & utilitaires */
.mini { font: 8px/1.5 var(--f-pixel); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0; }
.lcd { font-family: var(--f-lcd); font-size: 1.3em; line-height: 1; font-weight: 400; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.neon { font-family: var(--f-pixel); color: var(--pink); text-shadow: 0 0 8px rgba(255, 42, 109, .65); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.c-green { color: var(--green); } .c-red { color: var(--red); } .c-cyan { color: var(--cyan); }
.c-yellow { color: var(--yellow); } .c-pink { color: var(--pink); }
.ico { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.warn { color: var(--orange); background: rgba(255, 158, 0, .08); border: 1px solid rgba(255, 158, 0, .4); border-radius: 4px; padding: 8px 10px; font-size: 13.5px; }
.ok { color: var(--green); }
.safe { color: var(--green); font-size: 14px; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; margin: 0; list-style: none; }
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* ---------------------------------------------------------------- boutons arcade */
.btn {
  appearance: none; -webkit-appearance: none; border: 0; border-bottom: 3px solid rgba(0, 0, 0, .45);
  border-radius: 4px; min-height: 44px; padding: 10px 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 10px/1.25 var(--f-pixel); text-transform: uppercase; text-decoration: none; text-align: center;
  color: #fff; background: var(--purple); cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .06s;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled, .btn.is-busy { opacity: .45; cursor: not-allowed; }
.btn.dim, .btn[aria-disabled="true"] { opacity: .5; }
.btn svg { width: 16px; height: 16px; }
.btn-pink { background: var(--pink); }
.btn-red { background: var(--red); }
.btn-cyan { background: var(--cyan); color: var(--night); }
.btn-yellow { background: var(--yellow); color: var(--night); }
.btn-green { background: var(--green); color: var(--night); }
.btn-ghost { background: transparent; color: var(--text); border: 2px solid var(--line); border-bottom-width: 3px; }
.btn-sm { min-height: 38px; padding: 8px 10px; font-size: 9px; }
.btn-big { width: 100%; min-height: 54px; font-size: 11px; }
.btn-sq { width: 52px; height: 52px; padding: 0; }
.btn-sq svg { width: 22px; height: 22px; }

.ibtn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; flex: none;
  background: var(--panel); color: var(--cyan); border: 2px solid var(--line); border-radius: 4px; cursor: pointer;
  font-size: 22px; line-height: 1; touch-action: manipulation;
}
.ibtn svg { width: 20px; height: 20px; }
.ibtn:active { transform: translateY(2px); }
.ibtn.on, .ibtn[aria-pressed="true"] { border-color: var(--cyan); background: #0b2440; }

/* ---------------------------------------------------------------- champs */
input:not([type=range]) {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--well); color: var(--text); border: 2px solid var(--line); border-radius: 4px;
  font: 16px var(--f-body);
}
input:focus { outline: none; border-color: var(--cyan); }
input::placeholder { color: #6c5f8f; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

.slider { width: 100%; height: 40px; margin: 6px 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.slider::-webkit-slider-runnable-track { height: 8px; background: var(--line); border-radius: 0; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; background: var(--yellow); border: 3px solid var(--night); border-radius: 3px; }
.slider::-moz-range-track { height: 8px; background: var(--line); }
.slider::-moz-range-thumb { width: 26px; height: 26px; background: var(--yellow); border: 3px solid var(--night); border-radius: 3px; }

/* ---------------------------------------------------------------- panneaux */
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 12px; }
.ptitle {
  margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
  font: 10px/1.4 var(--f-pixel); text-transform: uppercase; color: var(--cyan);
}
.ptitle small { font: 18px/1 var(--f-lcd); color: var(--muted); }
.ptitle svg { width: 16px; height: 16px; }
.sec {
  margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font: 9px/1.5 var(--f-pixel); text-transform: uppercase; color: var(--cyan);
}
.sec small { font: 12px var(--f-body); text-transform: none; color: var(--muted); }
.quote { margin: 6px 0 0; color: var(--muted); font-style: italic; font-size: 13px; }
.tag {
  display: inline-block; font: 7px/1 var(--f-pixel); text-transform: uppercase; white-space: nowrap;
  padding: 4px 5px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); vertical-align: middle;
}
.t-ok { color: var(--green); border-color: var(--green); }
.t-lock { color: var(--yellow); border-color: var(--yellow); }
.t-rank { color: var(--yellow); border-color: rgba(249, 200, 14, .5); }
.badge { display: inline-block; font: 7px/1 var(--f-pixel); padding: 3px 4px; border-radius: 2px; color: var(--night); white-space: nowrap; }
.badge.b-up { background: var(--pink); color: #fff; }
.badge.b-down { background: var(--cyan); }
.badge.b-emi { background: var(--yellow); }
.badge.b-tip { background: var(--purple); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; min-height: 26px;
  background: var(--well); border: 1px solid var(--line); border-radius: 3px; font-size: 13px; white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------------------------------------------------------------- écrans */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot-txt { font: 12px var(--f-pixel); color: var(--cyan); }

/* ---------------------------------------------------------------- accueil : coucher de soleil animé
   Animations GPU uniquement (transform / opacity), aucun repaint par image. Coupées si prefers-reduced-motion. */
.landing { position: relative; min-height: 100vh; min-height: 100dvh; }
.sunset {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #0d0221 0%, #240a4a 34%, #5a1a8c 50%, #b3226e 60%, #ff6a3d 66.5%, #12032a 66.6%, #0d0221 100%);
}
.sun {
  position: absolute; left: 50%; top: 66.5%; width: 46vmin; height: 46vmin; transform: translate(-50%, -88%);
  border-radius: 50%; background: linear-gradient(180deg, var(--yellow) 0%, var(--orange) 45%, var(--pink) 100%);
  -webkit-mask-image: linear-gradient(#000 52%, transparent 52%), repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 13px);
  mask-image: linear-gradient(#000 52%, transparent 52%), repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 13px);
  opacity: .95;
}
/* halo du soleil qui respire */
.sun-glow {
  position: absolute; left: 50%; top: 66.5%; width: 120vmin; height: 120vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 158, 0, .55) 0%, rgba(255, 42, 109, .32) 26%, rgba(123, 44, 191, .14) 46%, transparent 66%);
  transform: translate(-50%, -60%) scale(.94); opacity: .7;
  animation: gtaSunPulse 4.5s ease-in-out infinite alternate; will-change: transform, opacity;
}
@keyframes gtaSunPulse { to { transform: translate(-50%, -60%) scale(1.06); opacity: 1; } }
/* étoiles : deux couches de motifs qui scintillent en décalé */
.stars { position: absolute; left: 0; right: 0; top: 0; height: 60%; will-change: opacity; }
.stars.s1 {
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 140px 90px, #f4eaff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 260px 40px, #05d9e8 50%, transparent 51%),
    radial-gradient(1px 1px at 80px 150px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 200px 180px, #ff2a6d 50%, transparent 51%);
  background-size: 300px 220px;
  animation: gtaTwinkle 3.1s ease-in-out infinite alternate;
}
.stars.s2 {
  background-image:
    radial-gradient(1px 1px at 60px 70px, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 190px 20px, #f9c80e 50%, transparent 51%),
    radial-gradient(1px 1px at 310px 130px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 200px, #05d9e8 50%, transparent 51%);
  background-size: 370px 250px; background-position: 90px 40px;
  animation: gtaTwinkle 4.3s ease-in-out infinite alternate-reverse;
}
@keyframes gtaTwinkle { from { opacity: .25; } to { opacity: 1; } }
/* montagnes en ombre chinoise avec un liseré néon (filtre statique : rendu une seule fois) */
.mtn-wrap { position: absolute; left: 0; right: 0; top: calc(66.6% - 13vmin); height: 13vmin; filter: drop-shadow(0 -1px 0 rgba(255, 42, 109, .9)) drop-shadow(0 0 6px rgba(255, 42, 109, .55)); }
.mountains {
  position: absolute; inset: 0; background: linear-gradient(180deg, #2b0b55 0%, #14042c 100%);
  clip-path: polygon(0 100%, 0 62%, 7% 40%, 13% 58%, 21% 22%, 29% 55%, 36% 38%, 44% 66%, 52% 30%, 60% 56%, 68% 18%, 77% 52%, 84% 34%, 92% 58%, 100% 40%, 100% 100%);
}
/* sol : grille néon qui défile vers le joueur (translation d'une couche, le plan 3D la projette) */
.floor {
  position: absolute; left: -60%; right: -60%; top: 66.6%; bottom: -10%; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 42, 109, .28) 0%, rgba(13, 2, 33, 0) 45%);
  transform: perspective(260px) rotateX(58deg); transform-origin: 50% 0;
}
.floor-lines {
  position: absolute; left: 0; right: 0; top: -46px; bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 1px, rgba(255, 42, 109, .22) 1px 3px, rgba(255, 70, 140, .95) 3px 5px, rgba(255, 42, 109, .22) 5px 7px, transparent 7px 64px),
    repeating-linear-gradient(180deg, rgba(255, 70, 140, .95) 0 2px, rgba(255, 42, 109, .25) 2px 5px, transparent 5px 46px);
  animation: gtaFloor 1.25s linear infinite; will-change: transform;
}
@keyframes gtaFloor { to { transform: translateY(46px); } }
/* brume à l'horizon par-dessus la grille */
.floor::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #2a0a4a 0%, rgba(13, 2, 33, 0) 30%); }
/* ligne d'horizon néon qui grésille */
.horizon {
  position: absolute; left: 0; right: 0; top: 66.6%; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, transparent, var(--pink) 12%, var(--yellow) 50%, var(--pink) 88%, transparent);
  box-shadow: 0 0 10px 2px rgba(255, 42, 109, .85), 0 0 36px 8px rgba(255, 106, 61, .35);
  animation: gtaFlicker 7s steps(1) infinite; will-change: opacity;
}
/* glow néon (statique) sur la bannière et les cartes de l'accueil */
.landing .banner-wrap { border-color: rgba(255, 42, 109, .8); box-shadow: 0 0 18px rgba(255, 42, 109, .45), 0 0 46px rgba(5, 217, 232, .16); }
.landing .panel { border-color: rgba(5, 217, 232, .45); box-shadow: 0 0 14px rgba(5, 217, 232, .22), inset 0 0 18px rgba(123, 44, 191, .18); background: rgba(20, 10, 46, .74); }
@keyframes gtaFlicker { 0%, 100% { opacity: 1; } 41% { opacity: .55; } 42% { opacity: 1; } 43% { opacity: .7; } 44% { opacity: 1; } 78% { opacity: .8; } 79% { opacity: 1; } }
.landing-inner {
  position: relative; z-index: 1; max-width: 1000px; margin: 0 auto;
  padding: calc(8px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l));
}
.landing-top { display: flex; justify-content: flex-end; gap: 6px; min-height: 42px; }
.banner-wrap { margin: 8px 0 12px; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--night2); }
.banner { display: block; width: 100%; height: auto; background: var(--night2); }
/* bandeau du sponsor, sous l'affiche et dans le même cadre (couleurs de Nodz : nuit et sarcelle) */
.sponsor {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px 9px;
  background: linear-gradient(90deg, #0b0f14 0%, #0b1a19 100%); border-top: 1px solid rgba(0, 122, 112, .75);
  color: #dfeeeb; text-decoration: none;
}
.sponsor:hover .sp-txt, .sponsor:focus-visible .sp-txt { color: #fff; }
.sponsor:focus-visible { outline: 2px solid #00a596; outline-offset: -3px; }
.sp-lbl { font: 7px/1.3 var(--f-pixel); text-transform: uppercase; letter-spacing: .5px; color: #7fc8bf; }
.sp-logo { display: block; height: 22px; width: auto; flex: none; }
.sp-txt { flex: 1 1 260px; min-width: 0; font-size: 13px; line-height: 1.35; color: #cfe3df; }
@media (min-width: 600px) { .sponsor { padding: 9px 14px 10px; } .sp-logo { height: 27px; } .sp-txt { font-size: 14px; } }
.land-cols { display: grid; gap: 12px; }
.land-cols .auth { order: -1; } /* mobile : le formulaire d'abord */
.season-block { min-height: 140px; }
.sb-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sb-status { font: 8px/1 var(--f-pixel); padding: 4px 6px; border-radius: 2px; background: var(--purple); color: #fff; }
.st-live { background: var(--green); color: var(--night); }
.st-countdown { background: var(--yellow); color: var(--night); }
.st-closed { background: var(--pink); color: #fff; }
.sb-title { margin: 0 0 8px; font: 13px/1.5 var(--f-pixel); color: var(--yellow); text-shadow: 0 0 8px rgba(249, 200, 14, .45); }
.sb-cd { margin: 6px 0 10px; }
.sb-cd .big, .lcd.big { display: block; font-size: 44px; color: var(--cyan); }
.sb-online { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
/* accès privé : le compte à rebours seul, centré dans le panneau */
.season-block:has(.sb-cd-only) { display: flex; align-items: center; justify-content: center; }
.sb-cd-only { margin: 0; text-align: center; }
.sb-cd-only .lcd.big { font-size: clamp(34px, 9vw, 60px); white-space: nowrap; }
.auth-t { margin: 0 0 6px; font: 12px/1.4 var(--f-pixel); color: var(--cyan); text-transform: uppercase; }
.btn-x { margin-top: 12px; background: #f4eaff; color: #0b0b14; }
.btn-x .x-logo {
  display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; margin-left: 8px;
  background: #0b0b14; color: #fff; border-radius: 4px; font-size: 1.15em;
}
.dev-login { margin-top: 12px; padding: 8px; border: 1px dashed var(--line); border-radius: 4px; }
.dev-row { display: flex; gap: 6px; margin-top: 6px; }
.dev-row input { flex: 1; min-width: 0; }
.auth .err { color: var(--red); min-height: 1.3em; font-size: 14px; margin: 10px 0 4px; }
.disclaimer { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.prizes { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.prizes li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pz-rank { font: 9px var(--f-pixel); color: var(--yellow); width: 14px; }
.pz-ic { width: 16px; height: 16px; color: var(--yellow); }
.podium { margin-top: 10px; }
.podium ol { list-style: none; padding: 0; margin: 6px 0 0; }
.podium li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--sep); }
.podium li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-rank { font: 9px var(--f-pixel); width: 16px; color: var(--muted); }
.pd-1 .pd-rank { color: var(--yellow); }
.pd-1 .lcd { color: var(--yellow); }

/* ---------------------------------------------------------------- barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--night2); border-bottom: 2px solid var(--line);
  padding: calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) 6px calc(10px + var(--safe-l));
}
.tb-row { display: flex; align-items: center; gap: 8px; max-width: 1280px; margin: 0 auto; }
/* jeu : logo à gauche ; sur téléphone les stats prennent toute la largeur sous la 1re ligne, dès 600 px le logo
   couvre les deux lignes et se centre verticalement dans la barre */
.tb-in {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "logo row" "stats stats";
  align-items: center; column-gap: 8px; max-width: 1280px; margin: 0 auto;
}
.tb-in > .logo { grid-area: logo; }
.tb-in > .tb-row { grid-area: row; max-width: none; margin: 0; }
.tb-in > .tb-stats { grid-area: stats; max-width: none; margin: 6px 0 0; }
@media (min-width: 600px) {
  .tb-in { grid-template-areas: "logo row" "logo stats"; column-gap: 12px; }
  .tb-in > .logo img { margin: 0; }
}
.logo { display: flex; flex: none; }
/* logo un peu plus haut que les boutons (42 px) : il déborde dans le padding sans agrandir la barre */
.logo img { display: block; height: 48px; width: auto; margin: -3px 0; }
/* centre : timer de saison + horloge des cours en 2e ligne compacte (aucune ligne en plus dans la barre) */
.tb-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tb-season { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--yellow); line-height: 1; }
.tb-season .lcd { font-size: 20px; }
.tb-px { display: flex; align-items: center; gap: 3px; color: var(--cyan); line-height: 1; white-space: nowrap; }
.tb-px .ico { width: 12px; height: 12px; vertical-align: 0; }
.tb-pxl { font: 7px/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .5px; }
.tb-px .lcd { font-size: 17px; }
.tb-px.hot { color: var(--orange); }
.tb-btns { display: flex; gap: 5px; flex: none; }
.tb-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 5px; margin: 6px auto 0; max-width: 1280px; }
.tb-stats .lcd { font-size: 19px; }
.c-cash .lcd { color: var(--green); }
.c-bank .lcd { color: var(--cyan); }
.c-bag .lcd { color: var(--yellow); }
.c-bag.full { border-color: var(--red); }
.c-atk .lcd { color: var(--pink); }
.c-def .lcd { color: var(--cyan); }
.c-prot { border-color: var(--green); } .c-prot .lcd, .c-prot svg { color: var(--green); }
.c-radar { border-color: var(--pink); } .c-radar .lcd, .c-radar svg { color: var(--pink); }
/* Zone PvP : le cash est en jeu (liseré rouge + crâne, détail au toucher) */
.c-cash.risk { border-color: var(--red); cursor: pointer; touch-action: manipulation; }
.c-cash.risk .c-risk { color: var(--red); }
@media (max-width: 359px) {
  .ibtn { width: 38px; height: 38px; }
  .logo img { height: 42px; margin: -2px 0; }
  .tb-pxl { display: none; }
  .tb-mid { gap: 1px; }
  .tb-px .lcd { font-size: 16px; }
  .tb-season { white-space: nowrap; }
  .tb-season .lcd { font-size: 17px; } /* « 12j 03h » sur une ligne : 17 + 1 + 16 tient dans les 38 px des boutons */
}

/* ---------------------------------------------------------------- mise en page du jeu */
.game { padding-bottom: calc(76px + var(--safe-b)); }
.cols {
  display: flex; flex-direction: column; gap: 10px; max-width: 1280px; margin: 0 auto;
  padding: 10px calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l));
}
.col { display: contents; }
.city-head { order: 1; } .bag-line { order: 2; } .market-panel { order: 3; } .bosses { order: 4; }
.travel-cta { order: 5; } .rivals-panel { order: 6; } .social-slot { order: 7; }
/* ligne du sac */
.bag-line:empty { display: none; }
.bagline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 10px;
  background: var(--well); border: 1px solid var(--line); border-radius: 4px; font-size: 13px;
}
.bl-cash, .bl-cap, .bl-it { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bl-cash, .bl-cap { padding-right: 8px; border-right: 1px solid var(--line); }
.bl-cash { color: var(--green); }
.bl-cap { color: var(--cyan); }
.bl-cap.full { color: var(--red); }
.bagline .lcd { font-size: 18px; color: var(--text); }
.bl-cash .lcd { color: var(--green); }
.bl-empty { color: var(--muted); font-style: italic; }
@media (min-width: 900px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 14px; padding-top: 14px; }
  .col { display: flex; flex-direction: column; gap: 12px; }
  .game { padding-bottom: calc(24px + var(--safe-b)); }
}

/* ville */
.city-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.city-name { margin: 0; font-size: 15px; line-height: 1.4; }
.tier { font: 8px/1 var(--f-pixel); padding: 4px 6px; border: 1px solid currentColor; border-radius: 3px; white-space: nowrap; }
.tier.t1 { color: var(--green); } .tier.t2 { color: var(--pink); } .tier.t3 { color: var(--yellow); }
.city-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.city-meta .lcd { color: var(--text); font-size: 19px; }
.city-tag { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-style: italic; }
/* Zone PvP : ce que tu perds si tu tombes (ligne fine, rouge) */
.city-risk { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 8px 0 0; padding: 5px 8px; font-size: 13px;
  color: var(--text); background: rgba(255, 51, 85, .1); border-left: 3px solid var(--red); border-radius: 2px; }
.city-risk > .ico { color: var(--red); align-self: center; }
.city-risk > span .lcd { color: var(--red); font-size: 20px; }
.city-risk small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.city-risk small .lcd { color: var(--text); font-size: 16px; }
.trv-show { margin-top: 10px; }
/* avatars des villes : portrait pixelisé à droite de la carte, fondu vers le texte, trame CRT */
.city-head, .tcity { position: relative; overflow: hidden; isolation: isolate; }
.city-head > :not(.cav), .tcity > :not(.cav) { position: relative; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .85); }
.cav {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(48%, 190px); z-index: -1; pointer-events: none; opacity: .62;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 55%); mask-image: linear-gradient(to right, transparent, #000 55%);
}
.cav img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; image-rendering: pixelated; }
.cav::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px); }
.tcity .cav { width: min(42%, 150px); opacity: .55; }

/* marché */
.mrow {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
  grid-template-areas: "ic name price" "ic btns btns";
  padding: 10px 0; border-top: 1px solid var(--sep);
}
.mrow:first-child { border-top: 0; padding-top: 2px; }
.m-ic, .it-ic, .sh-ic, .fi-ic {
  display: grid; place-items: center; background: var(--well); border: 1px solid var(--line); border-radius: 4px; color: var(--yellow);
}
.m-ic { grid-area: ic; width: 38px; height: 38px; align-self: start; }
.m-ic svg, .it-ic svg { width: 26px; height: 26px; }
.m-name { grid-area: name; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-width: 0; }
.m-name b { font-size: 15px; }
.m-name small { flex-basis: 100%; color: var(--cyan); font-size: 12.5px; }
.m-name small.m-raid { color: var(--yellow); } /* came raflée par Emi : pas en vente dans sa ville de commande */
.m-price { grid-area: price; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.m-price .lcd { font-size: 25px; }
.m-btns { grid-area: btns; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.trend { display: inline-flex; align-items: center; gap: 1px; font: 16px/1 var(--f-lcd); }
.trend svg { width: 11px; height: 11px; }
.trend.up { color: var(--green); } .trend.down { color: var(--red); } .trend.flat { color: var(--muted); }
.m-foot { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
@media (min-width: 540px) and (max-width: 899px), (min-width: 1140px) {
  .mrow { grid-template-columns: 40px minmax(0, 1fr) auto 196px; grid-template-areas: "ic name price btns"; }
  .m-ic { align-self: center; }
}
.lbl-s { display: none; }
/* téléphones : une seule ligne par drogue pour limiter le défilement */
@media (min-width: 350px) and (max-width: 539px) {
  .mrow { grid-template-columns: 32px minmax(0, 1fr) auto 118px; grid-template-areas: "ic name price btns"; gap: 4px 8px; padding: 7px 0; }
  .m-ic { width: 32px; height: 32px; align-self: center; }
  .m-ic svg { width: 22px; height: 22px; }
  .m-name b { font-size: 14px; }
  .m-name small { font-size: 11.5px; }
  .m-price .lcd { font-size: 21px; }
  .trend { font-size: 14px; }
  .m-btns { gap: 4px; }
  .m-btns .btn { min-height: 40px; padding: 6px 2px; font-size: 8px; }
  .lbl-l { display: none; } .lbl-s { display: inline; }
}

/* boss */
.bosses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.boss {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 6px 4px 8px; background: var(--panel); color: var(--text); cursor: pointer;
  border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 6px; touch-action: manipulation;
}
.boss:active { transform: translateY(2px); }
.boss img { display: block; width: 100%; max-width: 104px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--night2); }
.boss-name { margin-top: 5px; font: 8px/1.3 var(--f-pixel); text-transform: uppercase; text-align: center; }
.boss-role { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.2; }
.boss-tag {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 6px/1 var(--f-pixel); padding: 3px 4px; border-radius: 2px; background: var(--night); border: 1px solid var(--line); color: var(--muted);
}
.boss-tag.hot { background: var(--yellow); border-color: var(--yellow); color: var(--night); }
.boss.off img { opacity: .35; }
.boss.off .boss-name, .boss.off .boss-role { opacity: .6; }

/* rivaux */
.rivals { display: flex; flex-direction: column; }
.rv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--sep); }
.rv:first-child { border-top: 0; }
.rv-main {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; min-width: 0;
  background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer;
}
.rv-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.rv-stats { color: var(--muted); font-size: 18px; }
.rv-go { min-width: 96px; }
.rv-go .cd { font: 18px/1 var(--f-lcd); }
.rv.open .rv-name { color: var(--cyan); }
.rv-odds { grid-column: 1 / -1; background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.rv-odds p { margin: 0 0 6px; }
.odds { margin: 4px 0 8px; }
.odds-bar { display: block; width: 100%; height: 8px; }
.ob-w { fill: var(--green); } .ob-n { fill: #5b4d80; } .ob-l { fill: var(--red); }
.odds-txt { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font: 18px/1.1 var(--f-lcd); }

/* bouton route */
.travel-cta { display: flex; flex-direction: column; gap: 6px; }
.travel-cta:empty { display: none; }
.btn-road {
  width: 100%; min-height: 66px; font-size: 13px; letter-spacing: 1px;
  background: var(--orange); color: var(--night); border-bottom: 5px solid #a35f00;
}
.btn-road svg { width: 28px; height: 28px; }

/* actus / chat */
.stabs { display: flex; gap: 6px; margin-bottom: 8px; }
.stab {
  flex: 1; position: relative; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 9px var(--f-pixel); text-transform: uppercase; color: var(--muted); cursor: pointer;
  background: transparent; border: 2px solid var(--line); border-radius: 4px; touch-action: manipulation;
}
.stab svg { width: 14px; height: 14px; }
.stab.on { color: var(--night); background: var(--cyan); border-color: var(--cyan); }
.dot { font: 7px/1 var(--f-pixel); background: var(--pink); color: #fff; padding: 3px 4px; border-radius: 6px; }
.feed, .chat {
  list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.fd { display: flex; gap: 8px; padding: 7px 0; border-top: 1px solid var(--sep); font-size: 13.5px; }
.fd:first-child { border-top: 0; }
.fd img { width: 28px; height: 28px; border-radius: 3px; object-fit: cover; }
.fd-ic { width: 28px; height: 28px; display: grid; place-items: center; color: var(--cyan); flex: none; }
.fd-ic svg { width: 18px; height: 18px; }
.fd p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fd-meta { display: block; font-size: 11px; color: var(--muted); }
.k-kill p { color: #ffc2cf; } .k-kill .fd-ic { color: var(--red); }
.k-crisis p { color: var(--orange); } .k-crisis .fd-ic { color: var(--orange); }
.k-order p { color: #ffe680; }
.k-system p { color: var(--cyan); }
.chat li { padding: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
.chat b { color: var(--cyan); }
.chat .mine b { color: var(--pink); }
.ch-t { color: var(--muted); font-size: 11px; margin-right: 6px; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { flex: 1; min-width: 0; }

/* bannière défi sortant (fixe en bas) */
.chal-banner:empty { display: none; }
.chal-banner {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding: 0 calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l));
  pointer-events: none;
}
.cbar {
  pointer-events: auto; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--night2); border: 2px solid var(--pink); border-radius: 6px;
}
.cbar > svg { width: 20px; height: 20px; color: var(--pink); }
.cbar span { flex: 1; min-width: 0; font-size: 13.5px; }
.cbar .lcd { color: var(--yellow); font-size: 20px; }
.cbar.hot { border-color: var(--yellow); }

/* ---------------------------------------------------------------- feuilles (bottom sheet / modale desktop) */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 0, 15, .8); opacity: 0; transition: opacity .18s; }
.sheet-panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 580px;
  max-height: 90vh; max-height: 90dvh; overflow: hidden;
  background: var(--night2); border: 2px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0;
  transform: translateY(30px); opacity: 0; transition: transform .2s ease-out, opacity .2s;
}
.sheet.in .sheet-backdrop { opacity: 1; }
.sheet.in .sheet-panel { transform: none; opacity: 1; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px calc(14px + var(--safe-r)) calc(20px + var(--safe-b)) calc(14px + var(--safe-l));
}
.sheet-close { position: absolute; top: 8px; right: 8px; z-index: 2; color: var(--text); }
@media (min-width: 700px) {
  .sheet { align-items: center; padding: 20px; }
  .sheet-panel { border-radius: 8px; border-bottom: 2px solid var(--line); max-height: 86vh; }
  .sheet-body { padding: 18px; }
}
.sh-head, .boss-head { display: flex; align-items: center; gap: 12px; padding-right: 46px; margin-bottom: 10px; }
.sh-ic { width: 52px; height: 52px; border-width: 2px; border-radius: 6px; flex: none; }
.sh-ic svg { width: 34px; height: 34px; }
.sh-title { margin: 2px 0 4px; font: 13px/1.4 var(--f-pixel); text-transform: uppercase; overflow-wrap: anywhere; }
.sh-head p, .boss-head p { margin: 0; }
.boss-head img { width: 80px; height: 80px; border-radius: 6px; border: 2px solid var(--line); object-fit: cover; flex: none; }
.sh-foot { margin-top: 20px; }
/* « Repartir à zéro » (profil) et rappel quand le joueur est bloqué (au-dessus de la ligne du sac) */
.restart-box p { margin: 0 0 10px; }
.warn.stuck { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; text-decoration: underline; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 4px 0 12px; }

/* échange */
.qty-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
.qty { min-width: 120px; text-align: center; font-size: 52px; color: var(--yellow); }
.preview { background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; margin-bottom: 12px; }
.preview p { margin: 8px 0 0; }
.pv-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pv-total .big { font-size: 36px; color: var(--green); }
.sh-trade .pv-grid { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin-top: 8px; color: var(--muted); font-size: 13px; align-items: center; }
.pv-grid b { color: var(--text); text-align: right; font-size: 21px; }

/* banque */
.bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.bal > div { display: flex; flex-direction: column; gap: 4px; background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 10px; min-width: 0; }
.bal .big { font-size: 30px; color: var(--text); overflow-wrap: anywhere; }
.bal .big.c-cyan { color: var(--cyan); }
.bank-form { margin-top: 12px; }
.bank-form .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* armurerie */
.item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--sep); }
.it-ic { width: 38px; height: 38px; }
.it-name b { display: block; font-size: 14px; }
.it-name small { display: block; font-size: 12px; }
.it-stat { font-size: 20px; color: var(--cyan); white-space: nowrap; }
.it-buy .btn { min-width: 84px; }
.item.owned .it-name b { color: var(--green); }
.item.worse { opacity: .45; }
.item.poor .it-buy .btn { opacity: .5; }

/* mehdi */
.intel { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.in-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center;
  background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 8px;
}
.in-row.here { border-color: var(--pink); }
.in-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.in-who small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.in-row .lcd { font-size: 20px; text-align: right; }
.in-row .lcd.small { font-size: 17px; color: var(--muted); text-align: left; }
.tipbox { background: rgba(123, 44, 191, .18); border: 1px solid var(--purple); border-radius: 4px; padding: 10px; }
.tipbox small { display: block; margin-top: 4px; }

/* voyage */
.tgroup { margin-bottom: 4px; }
.tgroup .sec { margin-top: 12px; }
.tcity {
  display: block; width: 100%; margin-bottom: 8px; padding: 10px 12px; text-align: left; cursor: pointer;
  background: var(--panel); color: var(--text); border: 2px solid var(--line); border-left-width: 5px; border-bottom-width: 4px; border-radius: 6px;
  touch-action: manipulation;
}
.tcity:active:not(:disabled) { transform: translateY(2px); }
.tcity:disabled { cursor: default; }
.tgroup.t1 .tcity { border-left-color: var(--green); }
.tgroup.t2 .tcity { border-left-color: var(--pink); }
.tgroup.t3 .tcity { border-left-color: var(--yellow); }
.tcity.here { opacity: .7; }
.tcity.locked { opacity: .55; }
.tc-top, .tc-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.tc-sub { margin-top: 6px; }
.tc-name { flex: 1; min-width: 0; font-size: 15px; }
.tc-n { display: inline-flex; align-items: center; gap: 3px; font: 18px/1 var(--f-lcd); color: var(--muted); }
.tc-n svg { width: 13px; height: 13px; }
.tc-time { display: inline-flex; align-items: center; gap: 5px; color: var(--cyan); }
.tc-time svg { width: 18px; height: 18px; }
.tc-time .lcd { font-size: 21px; }
.tc-prices { display: flex; flex-wrap: wrap; flex-basis: 100%; gap: 4px 10px; }
.tp { display: inline-flex; align-items: center; gap: 3px; }
.tp .lcd { font-size: 19px; }
/* came que tu n'as pas : en grisé (le vert / rouge reste lisible, les badges restent vifs) */
.tp.other > svg, .tp.other > .lcd { opacity: .55; }
.tp .badge { margin-left: 2px; }
.tc-renew { display: inline-flex; align-items: center; gap: 4px; color: var(--orange); font-size: 12px; font-style: italic; }
.trv-sub > span { display: block; white-space: nowrap; }
.trv-sub .lcd { color: var(--cyan); font-size: 18px; }
.tlegend { margin-top: 4px; }
.tlegend b { color: var(--text); font-weight: 600; }
.tlegend .dimmed { opacity: .55; }
.tlegend .badge { vertical-align: 1px; }

/* profil / classement */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; font-size: 14px; }
.kv b { text-align: right; font-size: 21px; }
.fights { display: flex; flex-direction: column; gap: 6px; }
.fight {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 8px; align-items: center;
  background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 8px;
}
.fi-ic { width: 30px; height: 30px; color: var(--cyan); }
.fi-ic svg { width: 18px; height: 18px; }
.fi-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.fi-txt > b:first-child { font: 9px/1.5 var(--f-pixel); }
.fi-txt .fi-why { color: var(--yellow); font-size: 12px; line-height: 1.3; margin-top: 2px; } /* butin bloqué : la raison */
.fight .lcd { font-size: 19px; }
.fight .btn { min-width: 44px; }
.lb-season { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; font-size: 13px; }
.lb-season > b { font: 9px/1.5 var(--f-pixel); color: var(--yellow); }
.lb-season .lcd { color: var(--cyan); font-size: 20px; }
.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 6px; border-top: 1px solid var(--sep); }
.lb li.mine { background: rgba(5, 217, 232, .1); outline: 1px solid var(--cyan); }
.lb-rank { font: 10px var(--f-pixel); color: var(--muted); text-align: center; }
.lb-rank svg { width: 18px; height: 18px; color: var(--yellow); }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .lcd { font-size: 21px; }
.top1 .lcd { color: var(--yellow); } .top2 .lb-rank, .top3 .lb-rank { color: var(--text); }
.lb-me { margin: 12px 0 0; text-align: center; }

/* ---------------------------------------------------------------- écran compte à rebours de saison */
.cd-top .tb-row { justify-content: space-between; }
.cd-body { max-width: 640px; margin: 0 auto; padding: 12px calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l)); }
.cdx { text-align: center; }
.cdx-emi { width: 120px; height: 120px; border-radius: 8px; border: 2px solid var(--pink); object-fit: cover; margin-bottom: 8px; }
.cdx-title { margin: 6px 0; font-size: 16px; line-height: 1.5; }
.cdx-lcd { margin: 6px 0 10px; font-size: 64px; color: var(--cyan); }
.cdx .prizes { align-items: center; }
.cd-social { max-width: 640px; margin: 0 auto; padding: 12px calc(12px + var(--safe-r)) calc(16px + var(--safe-b)) calc(12px + var(--safe-l)); }

/* ---------------------------------------------------------------- alarme de défi (z 130) */
.chal-modal {
  position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center;
  padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
  background: repeating-linear-gradient(45deg, rgba(255, 51, 85, .12) 0 16px, rgba(0, 0, 0, 0) 16px 32px), rgba(26, 0, 8, .94);
  opacity: 0; transition: opacity .15s;
}
.chal-modal.in { opacity: 1; }
.cm-box {
  width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; text-align: center;
  background: var(--night2); border: 3px solid var(--red); border-radius: 8px; padding: 16px;
}
.cm-alarm { margin: 0 0 8px; font: 12px var(--f-pixel); color: var(--red); animation: blink 1s steps(2, start) infinite; }
.cm-title { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.cm-title small { display: block; margin-top: 6px; font-size: 10px; color: var(--text); text-shadow: none; }
.cm-gear { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 4px; font-size: 14px; }
.cm-gear .lcd { color: var(--yellow); margin-left: 4px; }
.cm-ring { position: relative; width: 96px; height: 96px; margin: 8px auto; }
.cm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rg-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.rg-fg { fill: none; stroke: var(--red); stroke-width: 8; transition: stroke-dashoffset 1s linear; }
.cm-ring > .lcd { position: absolute; inset: 0; display: grid; place-items: center; font-size: 36px; }
.cm-choice { text-align: left; background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin: 10px 0 12px; }
.cm-choice .mini { color: var(--text); }
.cm-btns { display: flex; flex-direction: column; gap: 10px; }
.cm-box > .small { margin: 10px 0 0; }
/* petits écrans (iPhone SE, vieux Android) : l'alarme doit tenir sans défiler, boutons compris */
@media (max-height: 680px) {
  .chal-modal { padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); }
  .cm-box { padding: 10px 12px; border-width: 2px; }
  .cm-alarm { margin-bottom: 4px; font-size: 10px; }
  .cm-title { font-size: 14px; }
  .cm-title small { margin-top: 3px; }
  .cm-gear { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px 12px; margin: 6px 0 2px; font-size: 13px; }
  .cm-ring { width: 64px; height: 64px; margin: 4px auto; }
  .cm-ring > .lcd { font-size: 26px; }
  .cm-choice { padding: 6px 8px; margin: 6px 0 8px; font-size: 13px; }
  .cm-btns { gap: 6px; }
  .cm-btns .btn { min-height: 46px; }
  .cm-box > .small { margin-top: 6px; }
}

/* ---------------------------------------------------------------- radio, réseau, toasts */
/* z 35 : au-dessus du jeu, sous la bannière de défi (40) et les feuilles (50) — ne cache jamais un bouton de validation */
.radio-dock {
  position: fixed; z-index: 35; right: calc(10px + var(--safe-r)); bottom: calc(10px + var(--safe-b));
  width: min(360px, calc(100vw - 20px)); padding: 6px;
  background: var(--night2); border: 2px solid var(--cyan); border-radius: 6px;
}
.radio-dock-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; }
.radio-dock-head .ibtn { width: 34px; height: 34px; font-size: 18px; }
.net {
  position: fixed; z-index: 190; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%);
  padding: 6px 10px; font: 8px/1.4 var(--f-pixel); color: var(--night); background: var(--orange); border-radius: 3px; white-space: nowrap;
  pointer-events: none;
}
/* écran « Mise à jour en cours » (maintenance.js) : z 210, au-dessus de tout (toasts compris), le jeu est figé derrière */
.upd {
  position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  background: repeating-linear-gradient(0deg, rgba(5, 217, 232, .05) 0 2px, rgba(0, 0, 0, 0) 2px 4px), rgba(13, 2, 33, .96);
  opacity: 0; transition: opacity .2s;
}
.upd.in { opacity: 1; }
.upd-box {
  width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; text-align: center;
  background: var(--night2); border: 3px solid var(--cyan); border-radius: 8px; padding: 20px 16px;
}
.upd-t { margin: 12px 0 10px; font-size: 13px; line-height: 1.6; text-transform: uppercase; overflow-wrap: anywhere; }
.upd-p { font-size: 15px; }
.upd-s { min-height: 12px; margin: 10px 0; color: var(--cyan); }
/* égaliseur pixel (transform seulement) */
.upd-bars { display: flex; justify-content: center; align-items: flex-end; gap: 5px; height: 28px; }
.upd-bars i { width: 8px; height: 100%; background: var(--pink); transform: scaleY(.3); transform-origin: bottom; animation: updBar .9s steps(4) infinite alternate; }
.upd-bars i:nth-child(2) { background: var(--orange); animation-delay: -.3s; }
.upd-bars i:nth-child(3) { background: var(--yellow); animation-delay: -.6s; }
.upd-bars i:nth-child(4) { background: var(--cyan); animation-delay: -.45s; }
.upd-bars i:nth-child(5) { background: var(--purple); animation-delay: -.15s; }
@keyframes updBar { to { transform: scaleY(1); } }
.toasts {
  position: fixed; z-index: 200; left: 0; right: 0; top: calc(8px + var(--safe-t));
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 10px; pointer-events: none;
}
/* purement informatif : un toast ne doit jamais avaler le tap destiné au bouton Fermer d'une feuille */
.toast {
  pointer-events: none; width: 100%; max-width: 460px; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; font-size: 14px; background: var(--night2); border: 2px solid var(--cyan); border-radius: 4px;
  opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: none; }
.toast .ti { width: 18px; height: 18px; flex: none; color: var(--cyan); }
.tt-ok { border-color: var(--green); } .tt-ok .ti { color: var(--green); }
.tt-err, .tt-kill { border-color: var(--red); } .tt-err .ti, .tt-kill .ti { color: var(--red); }
.tt-crisis { border-color: var(--orange); } .tt-crisis .ti { color: var(--orange); }
.tt-order { border-color: var(--yellow); } .tt-order .ti { color: var(--yellow); }

/* ---------------------------------------------------------------- grands écrans */
@media (min-width: 800px) {
  .land-cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .land-cols .auth { order: 0; }
  .city-name { font-size: 18px; }
  .feed, .chat { max-height: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- « Mon gangster » : sprites + éditeur de look
   Sprites = <img> data: (36×30) agrandis en pixelated. Aperçu = canvas 60×38 (≤ 12 i/s, coupé à la fermeture). */
.spr { display: block; width: 36px; height: 30px; flex: none; image-rendering: crisp-edges; image-rendering: pixelated; }
.spr-2 { width: 72px; height: 60px; }
.spr-3 { width: 108px; height: 90px; }
.spr-flip { transform: scaleX(-1); }
.spr-ph { background: var(--well); border-radius: 3px; opacity: .5; }

/* en-tête du profil */
.pf-head { align-items: flex-start; }
.pf-spr {
  flex: none; display: grid; place-items: center; width: 84px; height: 72px; padding: 0; cursor: pointer;
  background: var(--well); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 6px; touch-action: manipulation;
}
.pf-spr:active { transform: translateY(2px); }
.pf-id { min-width: 0; }
.pf-look { margin-top: 8px; }

/* alarme de défi : le gangster de l'attaquant à côté de son blaze */
.cm-who { display: flex; align-items: center; justify-content: center; gap: 10px; }
.cm-who .cm-title { flex: 0 1 auto; min-width: 0; text-align: left; }
.cm-spr { flex: none; }
@media (min-width: 400px) and (min-height: 760px) { .cm-spr .spr { width: 108px; height: 90px; } }
/* écrans courts (Android + barre d'adresse) : ×1,5 (= ×3 physique en DPR 2), les boutons restent atteignables */
@media (max-height: 660px) { .cm-spr .spr { width: 54px; height: 45px; } }

/* feuille : en-tête, aperçu (collant en haut), contenu, boutons (collants en bas) */
.sheet.sh-look .sheet-body { padding: 0; }
.lk-head { padding: 14px calc(60px + var(--safe-r)) 0 calc(14px + var(--safe-l)); margin-bottom: 8px; }
.lk-head p { margin: 0; }
.lk-stage {
  position: relative; z-index: 1; text-align: center; background: var(--night2); border-bottom: 2px solid var(--line);
  padding: 4px calc(14px + var(--safe-r)) 8px calc(14px + var(--safe-l));
}
@media (min-height: 600px) { .lk-stage { position: sticky; top: 0; } }
.lk-cv {
  display: block; margin: 2px auto 0; width: 180px; height: 114px; background: var(--night); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--line); image-rendering: crisp-edges; image-rendering: pixelated;
}
@media (min-height: 680px) { .lk-cv { width: 240px; height: 152px; } }
@media (min-width: 360px) and (min-height: 760px) { .lk-cv { width: 300px; height: 190px; } }
@media (min-width: 520px) and (min-height: 860px) { .lk-cv { width: 360px; height: 228px; } }
.lk-cap { margin: 6px 0 0; display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; font-size: 13px; color: var(--muted); }
.lk-cap b { font: 9px/1.4 var(--f-pixel); color: var(--pink); overflow-wrap: anywhere; }
.lk-main { padding: 0 calc(14px + var(--safe-r)) 14px calc(14px + var(--safe-l)); }
.lk-main > .sec:first-child { margin-top: 12px; }
.lk-wait { padding: 18px 0; text-align: center; }

/* looks tout faits : bande horizontale (défile dans son conteneur, jamais la page) */
.lk-presets {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: thin;
}
.lk-chip {
  position: relative; flex: none; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px; scroll-snap-align: start; cursor: pointer; touch-action: manipulation;
  background: var(--panel); color: var(--text); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 6px;
}
.lk-chip:active { transform: translateY(2px); }
.lk-chip.on { border-color: var(--cyan); background: #0b2440; }
.lk-chip-img { display: grid; place-items: center; width: 72px; height: 60px; }
.lk-chip-ic { width: 32px; height: 32px; color: var(--yellow); }
.lk-chip-lock { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; color: var(--yellow); }
.lk-chip-name { font: 7px/1.4 var(--f-pixel); text-transform: uppercase; text-align: center; overflow-wrap: anywhere; }

/* pièce par pièce : ◀ valeur ▶ */
.lk-rows { display: grid; gap: 6px; }
@media (min-width: 560px) { .lk-rows { grid-template-columns: 1fr 1fr; } }
.lk-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; align-items: stretch; }
.lk-arr {
  display: grid; place-items: center; min-height: 50px; padding: 0; cursor: pointer; color: var(--cyan); touch-action: manipulation;
  background: var(--panel); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 4px;
}
.lk-arr:active { transform: translateY(2px); }
.lk-arr svg { width: 18px; height: 18px; }
.lk-l { transform: scaleX(-1); }
.lk-val {
  min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 8px;
  background: var(--well); border: 1px solid var(--line); border-radius: 4px;
}
.lk-lab { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font: 7px/1.3 var(--f-pixel); text-transform: uppercase; color: var(--muted); }
.lk-lab small { font: 15px/.8 var(--f-lcd); }
.lk-opt { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.lk-opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-sw { flex: none; width: 16px; height: 16px; border: 1px solid rgba(244, 234, 255, .35); border-radius: 2px; background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55% 100%); }
.lk-lock { flex: none; width: 14px; height: 14px; color: var(--yellow); }
.lk-how { font-size: 11.5px; line-height: 1.25; color: var(--yellow); }
.lk-row.is-locked .lk-val { border-color: var(--yellow); }
.lk-row.is-off .lk-val { opacity: .6; }
.lk-row.is-off .lk-how { color: var(--muted); }

/* cosmétiques à débloquer */
.lk-unlocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lk-un {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px; background: var(--well); border: 1px solid var(--line); border-radius: 4px;
}
.lk-un-ic { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; }
.lk-un-ic svg { width: 22px; height: 22px; }
.lk-un-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.lk-un-txt small { font-size: 12px; color: var(--muted); }
.lk-un-st svg { width: 18px; height: 18px; color: var(--muted); }
.lk-un.ok { border-color: var(--green); }
.lk-un.ok .lk-un-ic { color: var(--yellow); border-color: var(--yellow); }
.lk-un.ok .lk-un-st svg, .lk-un.ok .lk-un-txt small { color: var(--green); }

/* boutons collés en bas de la feuille */
.lk-foot {
  position: sticky; bottom: 0; z-index: 1; background: var(--night2); border-top: 2px solid var(--line);
  padding: 10px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l));
}
.lk-warn { margin: 0 0 8px; font-size: 12.5px; }
.lk-warn small { display: block; margin-top: 2px; color: var(--muted); }
.lk-btns { display: grid; gap: 8px; }
@media (min-width: 700px) {
  .lk-head { padding: 18px 64px 0 18px; }
  .lk-stage, .lk-main { padding-left: 18px; padding-right: 18px; }
  .lk-foot { padding: 12px 18px 14px; }
}

/* ---------------------------------------------------------------- communiqués (pop-up « Quoi de neuf ? ») */
.pf-news { width: 100%; margin-top: 20px; }
.pf-news + .sh-foot { margin-top: 8px; }
.t-new { color: var(--yellow); border-color: var(--yellow); }
.cq {
  margin: 0 0 10px; padding: 10px 12px; background: var(--well);
  border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 4px;
}
.cq-announce { border-left-color: var(--yellow); }
.cq-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.cq-kind { font: 8px/1.5 var(--f-pixel); text-transform: uppercase; color: var(--cyan); }
.cq-announce .cq-kind { color: var(--yellow); }
.cq-kind .ico { width: 14px; height: 14px; vertical-align: -3px; }
.cq-date { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cq-title { margin: 6px 0 6px; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.cq-body { font-size: 14px; overflow-wrap: anywhere; }
.cq-body p { margin: 0 0 6px; }
.cq-body ul { margin: 0 0 6px; padding-left: 18px; }
.cq-body li { margin: 0 0 4px; }
.cq-body li::marker { color: var(--pink); }
.cq-body > :last-child { margin-bottom: 0; }
.cq-ok { margin-top: 6px; }
