/* =========================================================================
   SKYLINE RENAISSANCE — interface
   Palette tirée des maquettes : bleu nuit, acier, lueurs bleues, or des objectifs
   ========================================================================= */

@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("../fonts/exo-2-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("../fonts/exo-2-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("../fonts/exo-2-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --night: #050c1a;
  --navy: #0a1730;
  --fill: rgba(7, 17, 36, 0.80);
  --fill-strong: rgba(9, 22, 46, 0.92);
  --edge: linear-gradient(115deg, rgba(126, 200, 255, 0.95), rgba(58, 130, 220, 0.42) 38%, rgba(58, 130, 220, 0.30) 62%, rgba(126, 200, 255, 0.85));
  --edge-soft: linear-gradient(115deg, rgba(110, 180, 255, 0.55), rgba(58, 120, 200, 0.22) 50%, rgba(110, 180, 255, 0.45));
  --glow: #3aa3ff;
  --glow-2: #79cbff;
  --text: #e9f2ff;
  --text-dim: #9db2d2;
  --gold: #f6c744;
  --red: #ff4a5a;
  --green: #58e0a0;
  --c: 0.9rem;
  --shape: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  --f-title: "Orbitron", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --f-ui: "Rajdhani", "Segoe UI", "Roboto Condensed", system-ui, sans-serif;
  --f-text: "Exo 2", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: clamp(10.5px, calc(0.52vw + 0.55vh), 17px); }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--text); font-family: var(--f-text); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 1em; height: 1em; }
kbd { font-family: var(--f-ui); }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; user-select: none; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; pointer-events: auto; }
.screen.hud.active { pointer-events: none; }
.muted { color: var(--text-dim); }
.small { font-size: 0.9rem; }

/* ------------------------------------------------------------------------
   Panneau à coins coupés + liseré lumineux (les pseudo-éléments dessinent la forme)
   ------------------------------------------------------------------------ */
.cut { position: relative; isolation: isolate; }
.cut::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--edge); clip-path: var(--shape); }
.cut::after  { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--fill); clip-path: var(--shape);
               box-shadow: inset 0 0 2.2rem rgba(40, 130, 255, 0.10); }
.col-inner { padding: 1.4rem 1.6rem; }

/* ------------------------------------------------------------------------
   Logo
   ------------------------------------------------------------------------ */
.logo { display: flex; flex-direction: column; align-items: center; color: #fff; pointer-events: none; }
.logo svg.emblem { width: 7.2em; height: 4em; color: #fff; filter: drop-shadow(0 0 0.5rem rgba(90, 170, 255, 0.85)); }
.logo .l1 { font-family: var(--f-title); font-weight: 800; letter-spacing: 0.30em; margin-right: -0.30em; line-height: 1;
            text-shadow: 0 0 1.2rem rgba(80, 160, 255, 0.55), 0 0.15rem 0 rgba(0,0,0,.35); }
.logo .l2 { font-family: var(--f-title); font-weight: 600; letter-spacing: 0.78em; margin-right: -0.78em; line-height: 1; color: #dfe9ff; }
.logo-big { font-size: 1rem; }
.logo-big svg.emblem { width: 12rem; height: 6.4rem; margin-bottom: -0.6rem; }
.logo-big .l1 { font-size: 4.6rem; }
.logo-big .l2 { font-size: 1.32rem; margin-top: 1.1rem; }
.logo-mid svg.emblem { width: 9rem; height: 5rem; }
.logo-mid .l1 { font-size: 3rem; }
.logo-mid .l2 { font-size: 0.95rem; margin-top: 0.8rem; }
.logo-small { flex-direction: row; gap: 0.8rem; }
.logo-small svg.emblem { width: 4.2rem; height: 3rem; }
.logo-small .ltext { display: flex; flex-direction: column; }
.logo-small .l1 { font-size: 2rem; }
.logo-small .l2 { font-size: 0.72rem; margin-top: 0.45rem; }

/* ------------------------------------------------------------------------
   Chargement
   ------------------------------------------------------------------------ */
#screen-loading { background: radial-gradient(ellipse at 50% 40%, #12284d 0%, #050c1a 70%); }
.loading-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(40rem, 80vw); text-align: center; }
.loading-bar { margin: 3rem auto 1rem; height: 0.35rem; width: 100%; background: rgba(120, 170, 255, 0.15); clip-path: polygon(0.3rem 0, 100% 0, calc(100% - 0.3rem) 100%, 0 100%); }
.loading-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #2c7be0, #8fd6ff); box-shadow: 0 0 1rem #3aa3ff; transition: width 0.2s; }
#loading-text { font-family: var(--f-ui); font-weight: 600; letter-spacing: 0.08em; color: var(--text-dim); }

/* ------------------------------------------------------------------------
   Menu principal
   ------------------------------------------------------------------------ */
#screen-menu { background: linear-gradient(90deg, rgba(3, 9, 22, 0.70) 0%, rgba(3, 9, 22, 0.25) 34%, rgba(0,0,0,0) 52%); }
.menu-left { position: absolute; left: 3.6vw; top: 3.4vh; width: min(34rem, 36vw); }
.menu-left .logo { align-items: center; width: max-content; margin: 0 0 3.2rem 1rem; }
.menu-buttons { display: flex; flex-direction: column; gap: 0.75rem; }

.mbtn { --c: 0.7rem; position: relative; isolation: isolate; display: flex; align-items: center; gap: 1.4rem;
        height: 4.6rem; width: 100%; padding: 0 2.4rem 0 0; text-align: left;
        font-family: var(--f-ui); font-weight: 700; font-size: 1.45rem; letter-spacing: 0.12em; text-transform: uppercase; color: #dbe7ff;
        transition: transform 0.18s ease, filter 0.18s ease, color 0.18s; }
.mbtn::before, .mbtn::after { content: ""; position: absolute; z-index: -2; inset: 0;
        clip-path: polygon(var(--c) 0, 100% 0, calc(100% - 1.6rem) 100%, 0 100%, 0 var(--c)); }
.mbtn::before { background: linear-gradient(100deg, rgba(110, 180, 255, 0.55), rgba(60, 110, 190, 0.25) 60%, rgba(110, 180, 255, 0.4)); }
.mbtn::after  { inset: 1px; z-index: -1; background: linear-gradient(90deg, rgba(10, 22, 44, 0.92), rgba(12, 26, 52, 0.70)); }
.mbtn-ico { flex: 0 0 4.6rem; height: 100%; display: grid; place-items: center; font-size: 1.9rem; color: #cfe3ff;
            border-right: 1px solid rgba(120, 180, 255, 0.18); }
.mbtn-label { flex: 1; }
.mbtn-sub { font-family: var(--f-text); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--text-dim); }
.mbtn.primary, .mbtn:hover, .mbtn:focus-visible, .mbtn.focus { color: #fff; outline: none; filter: drop-shadow(0 0 0.7rem rgba(60, 160, 255, 0.75)); transform: translateX(0.5rem); }
.mbtn.primary::before, .mbtn:hover::before, .mbtn:focus-visible::before, .mbtn.focus::before { background: linear-gradient(100deg, #9fdcff, #3d8fe6 50%, #8ad2ff); }
.mbtn.primary::after, .mbtn:hover::after, .mbtn:focus-visible::after, .mbtn.focus::after { background: linear-gradient(90deg, rgba(28, 92, 190, 0.95), rgba(18, 58, 130, 0.88) 60%, rgba(20, 70, 150, 0.75)); }
.mbtn.primary:not(:hover):not(:focus-visible):not(.focus) { transform: none; }
.mbtn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.mbtn:disabled::before { background: rgba(110, 160, 220, 0.25); }
.mbtn:disabled::after { background: rgba(8, 18, 36, 0.8); }
.mbtn.compact { height: 3.6rem; font-size: 1.15rem; gap: 1rem; }
.mbtn.compact .mbtn-ico { flex-basis: 3.6rem; font-size: 1.4rem; }

.player-card { --c: 0.8rem; position: absolute; right: 2.4vw; top: 3vh; display: flex; align-items: center; gap: 1rem; padding: 0.8rem 2.4rem 0.8rem 0.9rem; min-width: 19rem; pointer-events: none; }
.pc-avatar { width: 3.6rem; height: 3.6rem; display: grid; place-items: center; font-size: 2.6rem; color: #e8eef8;
             background: radial-gradient(circle at 50% 35%, #2d4f86, #0d1c38); clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%); }
.pc-text { display: flex; flex-direction: column; }
.pc-text b { font-family: var(--f-ui); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.04em; }
.pc-text small { font-family: var(--f-ui); font-weight: 600; letter-spacing: 0.1em; color: var(--glow-2); font-size: 0.9rem; }
.player-card.small { position: static; min-width: 15rem; padding: 0.5rem 1.6rem 0.5rem 0.6rem; }
.player-card.small .pc-avatar { width: 2.8rem; height: 2.8rem; font-size: 2rem; }

.menu-compass { position: absolute; left: 2.2vw; bottom: 3vh; width: 12rem; height: 12rem; pointer-events: none; }
.menu-compass canvas { width: 100%; height: 100%; }

.district-card { --c: 0.9rem; position: absolute; right: 2vw; bottom: 4vh; display: flex; align-items: center; gap: 1.2rem; padding: 0.7rem 1.4rem 0.7rem 0.7rem; width: min(30rem, 34vw); text-align: left; transition: filter 0.2s, transform 0.2s; }
.district-card:hover, .district-card:focus-visible, .district-card.focus { outline: none; filter: drop-shadow(0 0 0.6rem rgba(60, 160, 255, 0.7)); transform: translateY(-0.2rem); }
.dc-thumb { flex: 0 0 8.6rem; height: 5.6rem; background: #0d2244 center/cover no-repeat; clip-path: polygon(0.6rem 0, 100% 0, 100% 100%, 0 100%, 0 0.6rem); }
.dc-text { display: flex; flex-direction: column; gap: 0.3rem; }
.dc-text b { font-family: var(--f-ui); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dc-text small { font-size: 0.92rem; color: #c3d2ea; line-height: 1.35; }
.dc-arrow { margin-left: auto; font-size: 1.6rem; color: #cfe3ff; flex: 0 0 auto; }

/* ------------------------------------------------------------------------
   Barre d'onglets + pied de page des sous-écrans
   ------------------------------------------------------------------------ */
.topbar { position: absolute; left: 0; right: 0; top: 0; height: 6.4rem; display: none; align-items: center; justify-content: space-between; padding: 0 2.4vw;
          background: linear-gradient(180deg, rgba(3, 10, 24, 0.92), rgba(3, 10, 24, 0.55) 80%, rgba(3,10,24,0)); pointer-events: auto; }
.topbar.active { display: flex; }
.tabs { display: flex; align-items: stretch; height: 100%; gap: 0.4rem; }
.tab { position: relative; padding: 0 1.6rem; font-family: var(--f-ui); font-weight: 600; font-size: 1.35rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8ea6c8; transition: color 0.2s; }
.tab:hover, .tab:focus-visible { color: #fff; outline: none; }
.tab.active { color: #fff; text-shadow: 0 0 0.8rem rgba(90, 170, 255, 0.8); }
.tab.active::after { content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 1.3rem; height: 0.18rem; background: linear-gradient(90deg, transparent, #6cc4ff, transparent); box-shadow: 0 0 0.8rem #3aa3ff; }
.tab-arrow { font-size: 1.5rem; color: #cfe3ff; padding: 0 0.6rem; }
.tab-arrow:hover { color: #fff; }

.subfooter { position: absolute; left: 0; right: 0; bottom: 0; height: 3.8rem; display: none; align-items: center; justify-content: space-between; padding: 0 2.6vw;
             background: linear-gradient(0deg, rgba(3, 10, 24, 0.9), rgba(3,10,24,0)); pointer-events: auto; font-family: var(--f-ui); font-size: 1.1rem; color: var(--text-dim); }
.subfooter.active { display: flex; }
.back { display: flex; align-items: center; gap: 0.7rem; font-family: var(--f-ui); font-weight: 600; font-size: 1.2rem; color: #dbe7ff; }
.back:hover, .back:focus-visible, .back.focus { color: #fff; outline: none; text-shadow: 0 0 0.6rem #3aa3ff; }
.pad-btn { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: 1rem; }

.screen.sub { top: 0; }
.screen.sub.active { background: linear-gradient(90deg, rgba(3,9,22,0.55), rgba(3,9,22,0.1) 30%, rgba(3,9,22,0.1) 70%, rgba(3,9,22,0.55)); }

/* ------------------------------------------------------------------------
   Modes de jeu
   ------------------------------------------------------------------------ */
.modes-wrap { position: absolute; left: 2.6vw; right: 2.6vw; top: 8rem; bottom: 5rem; display: grid; grid-template-columns: minmax(18rem, 30rem) 1fr; gap: 2rem; }
.mode-list { display: flex; flex-direction: column; gap: 0.9rem; }
.mode-card { --c: 0.8rem; display: flex; align-items: center; gap: 1.2rem; padding: 1.3rem 1.4rem; text-align: left; transition: filter 0.2s, transform 0.2s; }
.mode-card > svg { font-size: 2.6rem; color: #9fd2ff; flex: 0 0 auto; }
.mode-card b { display: block; font-family: var(--f-ui); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.1em; text-transform: uppercase; }
.mode-card small { display: block; margin-top: 0.25rem; font-size: 0.95rem; color: #b9c9e4; line-height: 1.35; }
.mode-card:hover, .mode-card:focus-visible, .mode-card.focus { outline: none; filter: drop-shadow(0 0 0.5rem rgba(60, 160, 255, 0.6)); }
.mode-card.active { filter: drop-shadow(0 0 0.7rem rgba(60, 160, 255, 0.8)); }
.mode-card.active::before { background: linear-gradient(110deg, #a8e0ff, #3d8fe6 50%, #8ad2ff); }
.mode-card.active::after { background: linear-gradient(90deg, rgba(26, 82, 170, 0.92), rgba(12, 40, 92, 0.85)); }
.mode-detail { --c: 1.1rem; overflow: hidden; }
.mode-detail-inner { height: 100%; overflow-y: auto; padding: 1.8rem 2.2rem 2.2rem; display: flex; flex-direction: column; gap: 1rem; }
.mode-detail h2 { margin: 0; font-family: var(--f-ui); font-weight: 700; font-size: 2.2rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mode-detail h3 { margin: 0.4rem 0 0; font-family: var(--f-ui); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.12em; color: var(--glow-2); text-transform: uppercase; }
.mode-detail p { margin: 0; line-height: 1.5; max-width: 60ch; }
.circuit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.8rem; }
.circuit { --c: 0.6rem; padding: 0.9rem 1rem; text-align: left; transition: filter 0.2s; }
.circuit b { display: block; font-family: var(--f-ui); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.06em; }
.circuit small { display: block; color: #b4c6e2; font-size: 0.85rem; margin-top: 0.2rem; line-height: 1.35; }
.circuit .cmeta { display: flex; gap: 0.9rem; margin-top: 0.5rem; font-family: var(--f-ui); font-weight: 600; font-size: 0.95rem; color: var(--glow-2); }
.circuit:hover, .circuit:focus-visible, .circuit.focus { outline: none; filter: drop-shadow(0 0 0.4rem rgba(60, 160, 255, 0.6)); }
.circuit.active::before { background: linear-gradient(110deg, #a8e0ff, #3d8fe6 50%, #8ad2ff); }
.circuit.active::after { background: rgba(20, 64, 140, 0.9); }
.opt-grid { display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; margin-top: 0.4rem; }
.opt { display: flex; flex-direction: column; gap: 0.45rem; font-family: var(--f-ui); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.06em; color: #c6d6ee; }
.stepper { display: flex; align-items: center; gap: 0.2rem; }
.stepper button { width: 2.4rem; height: 2.4rem; font-size: 1.5rem; line-height: 1; color: #dbe7ff; background: rgba(40, 90, 170, 0.35); border: 1px solid rgba(110, 180, 255, 0.45); }
.stepper button:hover, .stepper button:focus-visible { background: rgba(60, 130, 230, 0.6); outline: none; }
.stepper output { min-width: 3rem; text-align: center; font-family: var(--f-title); font-weight: 700; font-size: 1.3rem; }
.seg { display: inline-flex; border: 1px solid rgba(110, 180, 255, 0.45); }
.seg button { padding: 0.55rem 1.1rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; color: #a9bddc; }
.seg button + button { border-left: 1px solid rgba(110, 180, 255, 0.3); }
.seg button:hover, .seg button:focus-visible { color: #fff; outline: none; background: rgba(50, 110, 200, 0.3); }
.seg button.on { color: #fff; background: linear-gradient(180deg, #2f7fdc, #1b4f9e); box-shadow: inset 0 0 0.8rem rgba(140, 210, 255, 0.5); }
.seg.big button { padding: 0.8rem 1.8rem; font-size: 1.2rem; }
.record { font-family: var(--f-ui); font-weight: 600; font-size: 1.05rem; color: var(--gold); letter-spacing: 0.04em; }.bigbtn { --c: 0.7rem; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; gap: 1rem; margin-top: auto; min-width: 16rem; height: 4rem; padding: 0 2rem;
          font-family: var(--f-ui); font-weight: 700; font-size: 1.45rem; letter-spacing: 0.2em; text-transform: uppercase; color: #fff; transition: filter 0.2s; }
.bigbtn::before { background: linear-gradient(100deg, #a8e0ff, #3d8fe6 50%, #8ad2ff); }
.bigbtn::after { background: linear-gradient(180deg, rgba(30, 96, 196, 0.95), rgba(16, 52, 120, 0.95)); }
.bigbtn:hover, .bigbtn:focus-visible, .bigbtn.focus { outline: none; filter: drop-shadow(0 0 0.8rem rgba(60, 160, 255, 0.9)); }
.bigbtn svg { font-size: 1.3rem; }
.bigbtn .pad-btn { font-size: 0.95rem; margin-left: 0.6rem; }
.bigbtn.equipped::after { background: linear-gradient(180deg, rgba(20, 70, 60, 0.95), rgba(10, 46, 40, 0.95)); }
.bigbtn.equipped::before { background: linear-gradient(100deg, #9fffd6, #2fbf8a 50%, #8affd0); }

/* ------------------------------------------------------------------------
   Garage
   ------------------------------------------------------------------------ */
.cat-list { position: absolute; left: 2.4vw; top: 8.2rem; width: min(24rem, 26vw); display: flex; flex-direction: column; gap: 0.7rem; }
.cat { --c: 0.7rem; display: flex; align-items: center; gap: 1.2rem; height: 3.9rem; padding: 0 1.5rem 0 1.2rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase; color: #d4e2f8; transition: filter 0.2s; }
.cat::before { background: var(--edge-soft); }
.cat svg.cico { width: 3.2rem; height: 1.6rem; color: #b8cdef; }
.cat .count { margin-left: auto; font-family: var(--f-title); font-weight: 600; font-size: 1.1rem; color: #cfe0ff; }
.cat:hover, .cat:focus-visible, .cat.focus { outline: none; filter: drop-shadow(0 0 0.45rem rgba(60, 160, 255, 0.6)); color: #fff; }
.cat.active { color: #fff; filter: drop-shadow(0 0 0.7rem rgba(60, 160, 255, 0.85)); }
.cat.active::before { background: linear-gradient(110deg, #a8e0ff, #3d8fe6 50%, #8ad2ff); }
.cat.active::after { background: linear-gradient(90deg, rgba(28, 92, 190, 0.92), rgba(16, 52, 120, 0.85)); }
.cat.active svg.cico { color: #fff; }

.car-panel { --c: 1.1rem; position: absolute; right: 2.4vw; top: 9.6rem; width: min(27rem, 29vw); }
.car-panel-inner { padding: 1.5rem 1.7rem 1.7rem; display: flex; flex-direction: column; gap: 1rem; }
.cp-head { display: flex; align-items: center; gap: 1.1rem; }
.cp-emblem { width: 3.6rem; height: 3.6rem; display: grid; place-items: center; border: 1.5px solid rgba(160, 210, 255, 0.8); border-radius: 50%; color: #fff; font-size: 1.9rem; }
.cp-head h2 { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 2rem; letter-spacing: 0.08em; }
.cp-head p { margin: 0.1rem 0 0; font-family: var(--f-ui); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.16em; color: var(--glow-2); text-transform: uppercase; }
.cp-desc { margin: 0; font-size: 1rem; line-height: 1.5; color: #c9d7ec; min-height: 4.5em; }
.stat { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 1rem; row-gap: 0.35rem; align-items: center; }
.stat span { grid-column: 1; font-family: var(--f-ui); font-weight: 600; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: #cddcf3; }
.stat .bar { grid-column: 1; grid-row: 2; height: 0.42rem; background: rgba(120, 170, 255, 0.16); }
.stat .bar i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #2a7ad8, #8fd8ff); box-shadow: 0 0 0.6rem rgba(70, 170, 255, 0.8); transition: width 0.35s ease; }
.stat b { grid-column: 2; grid-row: 2; font-family: var(--f-ui); font-weight: 700; font-size: 1.15rem; min-width: 5.6rem; text-align: right; }
#btn-select-car { align-self: stretch; margin-top: 0.6rem; }

.garage-hint { position: absolute; left: 50%; bottom: 13.8rem; transform: translateX(-50%); font-size: 0.88rem; color: rgba(200, 220, 255, 0.55); pointer-events: none; white-space: nowrap; }
.carousel { position: absolute; left: 1.6vw; right: 1.6vw; bottom: 4.4rem; display: flex; align-items: center; gap: 0.8rem; }
.car-arrow { flex: 0 0 auto; font-size: 2.4rem; color: #dbe7ff; padding: 0.4rem; }
.car-arrow:hover, .car-arrow:focus-visible { color: #fff; outline: none; filter: drop-shadow(0 0 0.5rem #3aa3ff); }
.car-cards { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; }
.ccard { --c: 0.6rem; position: relative; height: 8.4rem; display: flex; flex-direction: column; justify-content: flex-end; transition: filter 0.2s, transform 0.2s; }
.ccard::after { background: linear-gradient(180deg, rgba(14, 30, 58, 0.88), rgba(6, 14, 30, 0.95)); }
.ccard img { position: absolute; left: 4%; right: 4%; top: 0.3rem; width: 92%; height: 72%; object-fit: contain; pointer-events: none; }
.ccard .cname { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.9rem 0.6rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.1em; position: relative; z-index: 1; }
.ccard .cname svg { color: #b9cff0; font-size: 1.2rem; }
.ccard .tag { position: absolute; top: 0.5rem; right: 0.6rem; z-index: 1; font-family: var(--f-ui); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.1em; color: var(--green); }
.ccard:hover, .ccard:focus-visible, .ccard.focus { outline: none; filter: drop-shadow(0 0 0.45rem rgba(60, 160, 255, 0.6)); transform: translateY(-0.2rem); }
.ccard.active { filter: drop-shadow(0 0 0.8rem rgba(60, 160, 255, 0.9)); }
.ccard.active::before { background: linear-gradient(110deg, #c4ecff, #4aa0f0 50%, #a2dcff); }
.ccard.active::after { background: linear-gradient(180deg, rgba(26, 64, 120, 0.9), rgba(8, 22, 48, 0.95)); }

/* ------------------------------------------------------------------------
   Paramètres
   ------------------------------------------------------------------------ */
.settings-wrap { position: absolute; left: 2.6vw; right: 2.6vw; top: 8rem; bottom: 5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.settings-wrap.single { grid-template-columns: minmax(20rem, 46rem); justify-content: center; }
.settings-col { --c: 1rem; overflow: hidden; }
.settings-col .col-inner { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; padding: 1.4rem 1.8rem 1.8rem; }
.settings-col h2 { display: flex; align-items: center; gap: 0.7rem; margin: 0.6rem 0 0.1rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow-2); }
.settings-col h2:first-child { margin-top: 0; }
.settings-col h2 svg { font-size: 1.3rem; }
.slider { display: grid; grid-template-columns: 1fr 12rem 3.4rem; align-items: center; gap: 1rem; font-family: var(--f-ui); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.04em; color: #d0def3; }
.slider output { text-align: right; font-family: var(--f-title); font-weight: 600; font-size: 0.95rem; color: #fff; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 0.3rem; background: linear-gradient(90deg, #3aa3ff var(--p, 50%), rgba(120, 170, 255, 0.2) var(--p, 50%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.1rem; height: 1.1rem; background: #dff2ff; transform: rotate(45deg); box-shadow: 0 0 0.6rem #3aa3ff; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 1rem; height: 1rem; border: 0; border-radius: 0; background: #dff2ff; transform: rotate(45deg); box-shadow: 0 0 0.6rem #3aa3ff; cursor: pointer; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 0.25rem rgba(120, 200, 255, 0.6); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-family: var(--f-ui); font-weight: 600; font-size: 1.1rem; letter-spacing: 0.03em; color: #d0def3; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { flex: 0 0 auto; position: relative; width: 3.2rem; height: 1.5rem; background: rgba(120, 170, 255, 0.18); border: 1px solid rgba(120, 180, 255, 0.5); transition: background 0.2s; }
.toggle i::after { content: ""; position: absolute; top: 0.18rem; left: 0.2rem; width: 1.05rem; height: 1.05rem; background: #9fb6d8; transition: transform 0.2s, background 0.2s; }
.toggle input:checked + i { background: rgba(45, 130, 230, 0.75); }
.toggle input:checked + i::after { transform: translateX(1.65rem); background: #fff; box-shadow: 0 0 0.6rem #8fd8ff; }
.toggle input:focus-visible + i { outline: 2px solid #8fd8ff; outline-offset: 2px; }
.text-field { display: grid; grid-template-columns: 1fr 15rem; align-items: center; gap: 1rem; font-family: var(--f-ui); font-weight: 600; font-size: 1.1rem; color: #d0def3; }
.text-field input { pointer-events: auto; user-select: text; font-family: var(--f-ui); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.06em; color: #fff; background: rgba(8, 20, 42, 0.9); border: 1px solid rgba(120, 180, 255, 0.5); padding: 0.45rem 0.8rem; outline: none; }
.text-field input:focus { border-color: #8fd8ff; box-shadow: 0 0 0.6rem rgba(60, 160, 255, 0.6); }
.ghostbtn { align-self: flex-start; margin-top: 0.4rem; padding: 0.6rem 1.2rem; font-family: var(--f-ui); font-weight: 700; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: #cfe3ff; border: 1px solid rgba(120, 180, 255, 0.55); background: rgba(20, 50, 100, 0.3); }
.ghostbtn:hover, .ghostbtn:focus-visible { outline: none; background: rgba(40, 100, 190, 0.5); color: #fff; }
.ghostbtn.danger { border-color: rgba(255, 110, 120, 0.6); color: #ffc0c6; background: rgba(110, 20, 30, 0.25); }
.ghostbtn.danger:hover, .ghostbtn.danger:focus-visible { background: rgba(170, 30, 50, 0.5); color: #fff; }
.bindings { display: flex; flex-direction: column; gap: 0.35rem; }
.bind-row { display: grid; grid-template-columns: 1fr 8.4rem 8.4rem; gap: 0.6rem; align-items: center; font-family: var(--f-ui); font-weight: 600; font-size: 1.05rem; color: #d0def3; }
.bind-row button { height: 2.3rem; font-family: var(--f-ui); font-weight: 700; font-size: 1rem; letter-spacing: 0.05em; color: #fff; background: rgba(16, 40, 80, 0.75); border: 1px solid rgba(120, 180, 255, 0.4); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 0.4rem; }
.bind-row button:hover, .bind-row button:focus-visible { outline: none; border-color: #8fd8ff; background: rgba(30, 80, 150, 0.8); }
.bind-row button.listening { background: rgba(246, 199, 68, 0.25); border-color: var(--gold); color: var(--gold); }
.bind-row button.empty { color: #6f84a6; }
.pad-help h3 { margin: 1rem 0 0.3rem; font-family: var(--f-ui); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--glow-2); font-size: 1.05rem; }
.pad-help p { line-height: 1.5; }

/* ------------------------------------------------------------------------
   HUD (en jeu)
   ------------------------------------------------------------------------ */
.hud-objective { --c: 0.9rem; position: absolute; left: 1.6vw; top: 2.4vh; display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 2.4rem 1rem 1.1rem; min-width: 21rem; max-width: 28rem; transition: opacity 0.3s; }
.hud-objective .obj-ico { font-size: 1.7rem; color: var(--gold); filter: drop-shadow(0 0 0.4rem rgba(246, 199, 68, 0.7)); flex: 0 0 auto; margin-top: 0.1rem; }
.hud-objective small { display: block; font-family: var(--f-ui); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.06em; color: #e5edf9; }
.hud-objective b { display: block; margin-top: 0.3rem; font-family: var(--f-text); font-weight: 500; font-size: 1.25rem; color: #fff; border-left: 2px solid var(--gold); padding-left: 0.7rem; margin-left: -0.5rem; }
.hud-objective span { display: block; padding-left: 0.2rem; margin-top: 0.15rem; font-family: var(--f-text); font-weight: 500; font-size: 1.1rem; color: #dbe6f7; }
.hud-objective.done::before { background: linear-gradient(110deg, #c8ffe6, #2fbf8a 50%, #8affd0); }

.hud-race { --c: 0.8rem; position: absolute; left: 1.6vw; top: 2.4vh; display: flex; gap: 0; padding: 0.6rem 0.4rem; }
.hr-cell { padding: 0.2rem 1.2rem; display: flex; flex-direction: column; border-right: 1px solid rgba(120, 180, 255, 0.2); }
.hr-cell:last-child { border-right: 0; }
.hr-cell small { font-family: var(--f-ui); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); font-size: 0.9rem; }
.hr-cell b { font-family: var(--f-title); font-weight: 700; font-size: 1.6rem; }
.hr-cell.wide b { min-width: 7.6rem; }

#hud-compass { position: absolute; left: 50%; top: 2.2vh; width: min(46rem, 44vw); height: auto; aspect-ratio: 760 / 56; transform: translateX(-50%); }

.hud-car { --c: 0.9rem; position: absolute; right: 1.6vw; top: 2.4vh; display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.6rem 0.8rem 0.9rem; min-width: 22rem; }
.hud-car::after { background: linear-gradient(100deg, rgba(10, 26, 56, 0.88), rgba(8, 20, 42, 0.78)); }
#hud-car-img { width: 8.4rem; height: 4.4rem; object-fit: contain; filter: drop-shadow(0 0 0.4rem rgba(80, 170, 255, 0.4)); }
.hc-right { flex: 1; display: flex; flex-direction: column; align-items: flex-end; }
.hc-right b { font-family: var(--f-ui); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.1em; color: #e6eefb; }
.hc-speed { display: flex; align-items: baseline; gap: 0.4rem; margin-top: -0.2rem; }
.hc-speed span { font-family: var(--f-ui); font-weight: 700; font-style: italic; font-size: 3.3rem; line-height: 1; letter-spacing: 0.02em; transform: skewX(-6deg); text-shadow: 0 0 1rem rgba(80, 170, 255, 0.45); min-width: 4.8rem; text-align: right; }
.hc-speed small { font-family: var(--f-ui); font-weight: 600; font-size: 1.1rem; color: #cfe0f8; }
.hc-bar { width: 100%; height: 0.28rem; margin-top: 0.35rem; background: rgba(120, 170, 255, 0.16); }
.hc-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #2a7ad8, #8fd8ff); box-shadow: 0 0 0.6rem rgba(70, 170, 255, 0.9); }
.hc-turbo { display: flex; align-items: center; gap: 0.5rem; width: 100%; margin-top: 0.3rem; color: #ffd27a; font-size: 0.95rem; }
.hc-turbo .hc-bar { margin: 0; }
.hc-bar.turbo i { background: linear-gradient(90deg, #ff9f2a, #ffe08a); box-shadow: 0 0 0.6rem rgba(255, 180, 60, 0.9); }
.hc-bar.turbo.low i { background: #a35a2a; box-shadow: none; }

.hud-minimap { position: absolute; left: 1.4vw; bottom: 2.4vh; width: 15.6rem; height: 15.6rem; }
.hud-minimap canvas { width: 100%; height: 100%; }

.hud-status { --c: 0.8rem; position: absolute; right: 1.6vw; bottom: 2.4vh; display: flex; flex-direction: column; gap: 0.9rem; padding: 1rem 1.6rem 1.1rem 1.1rem; min-width: 15.5rem; }
.hs-row { display: flex; align-items: center; gap: 1rem; }
.hs-row svg { font-size: 1.8rem; color: #e6eefb; flex: 0 0 auto; }
.hs-row div { flex: 1; }
.hs-row small { display: block; font-family: var(--f-ui); font-weight: 600; font-size: 1rem; color: #e1e9f6; }
.hs-row b { display: block; font-family: var(--f-text); font-weight: 500; font-size: 1.15rem; }
.hc-bar.health i { background: linear-gradient(90deg, #2a7ad8, #8fd8ff); }
.hc-bar.health.mid i { background: linear-gradient(90deg, #d88a2a, #ffd27a); box-shadow: 0 0 0.6rem rgba(255, 170, 60, 0.8); }
.hc-bar.health.low i { background: linear-gradient(90deg, #c4202f, #ff6d7a); box-shadow: 0 0 0.6rem rgba(255, 70, 90, 0.9); }

.hud-markers { position: absolute; inset: 0; overflow: hidden; }
.wmark { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 0.6rem; transform: translate(-1.2rem, -50%); will-change: transform; }
.wmark svg { font-size: 2.2rem; color: var(--gold); filter: drop-shadow(0 0 0.5rem rgba(246, 199, 68, 0.85)); flex: 0 0 auto; }
.wmark span { font-family: var(--f-text); font-weight: 500; font-size: 1.15rem; line-height: 1.25; color: #fff; text-shadow: 0 0 0.4rem rgba(0,0,0,0.9), 0 0 0.9rem rgba(0, 0, 0, 0.6); white-space: pre; }
.wmark.edge svg { font-size: 1.7rem; }
.wmark.left { flex-direction: row-reverse; }
.wmark.left span { text-align: right; }
.wmark.user svg { color: #6cc4ff; filter: drop-shadow(0 0 0.5rem rgba(80, 180, 255, 0.85)); }
.wmark.race svg { color: #ffb347; }

.hud-center { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); text-align: center; font-family: var(--f-title); font-weight: 800; font-size: 6rem; color: #fff; text-shadow: 0 0 2rem rgba(80, 170, 255, 0.8); pointer-events: none; }
.hud-center small { display: block; font-family: var(--f-ui); font-weight: 700; font-size: 1.6rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 1rem rgba(0,0,0,.8); }
.hud-center.pop { animation: pop 0.6s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: translate(-50%, -50%) scale(1); } }
.hud-delta { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); font-family: var(--f-title); font-weight: 700; font-size: 1.6rem; text-shadow: 0 0 0.6rem rgba(0,0,0,.9); opacity: 0; transition: opacity 0.3s; }
.hud-delta.show { opacity: 1; }
.hud-delta.good { color: var(--green); }
.hud-delta.bad { color: var(--red); }

.hud-toasts { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.toast { --c: 0.6rem; padding: 0.7rem 1.6rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.1em; text-transform: uppercase; animation: toast-in 0.35s ease-out; white-space: nowrap; }
.toast.gold { color: var(--gold); }
.toast.gold::before { background: linear-gradient(110deg, #ffe7a0, #c99a22 50%, #ffe08a); }
.toast.red { color: #ffb3bb; }
.toast.red::before { background: linear-gradient(110deg, #ffb3bb, #b8323f 50%, #ff8a96); }
.toast.out { opacity: 0; transform: translateY(-0.6rem); transition: opacity 0.4s, transform 0.4s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.8rem); } to { opacity: 1; transform: none; } }

.hud-help { --c: 0.6rem; position: absolute; left: 50%; bottom: 2.4vh; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.2rem; padding: 0.6rem 1.4rem; max-width: 52vw; font-family: var(--f-ui); font-weight: 600; font-size: 0.98rem; color: #cfdcf0; }
.hud-help kbd { display: inline-block; min-width: 1.5rem; padding: 0.05rem 0.4rem; margin-right: 0.3rem; text-align: center; font-weight: 700; color: #fff; background: rgba(40, 90, 170, 0.5); border: 1px solid rgba(140, 200, 255, 0.5); }
.hud-lock { position: absolute; left: 50%; bottom: 13vh; transform: translateX(-50%); padding: 0.5rem 1rem; font-family: var(--f-ui); font-weight: 600; font-size: 1rem; color: #cfe3ff; background: rgba(5, 14, 30, 0.6); border: 1px solid rgba(120, 180, 255, 0.3); opacity: 0; transition: opacity 0.4s; }
.hud-lock.show { opacity: 1; }
.hud-fps { position: absolute; right: 1.6vw; top: 12.5rem; font-family: var(--f-ui); font-weight: 700; font-size: 1rem; color: #9fffd0; text-shadow: 0 0 0.3rem #000; }
.hud-fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 0.45s; }
.hud-fade.on { opacity: 1; }

/* ------------------------------------------------------------------------
   Pause, résultats, modale
   ------------------------------------------------------------------------ */
.screen.overlay.active { background: rgba(2, 8, 20, 0.55); backdrop-filter: blur(3px); }
.pause-box { --c: 1rem; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(30rem, 90vw); }
.pause-box .col-inner, .results-box .col-inner { display: flex; flex-direction: column; gap: 0.7rem; padding: 1.6rem 1.8rem 2rem; }
.pause-box h2, .results-box h2 { margin: 0 0 0.6rem; font-family: var(--f-title); font-weight: 700; font-size: 2rem; letter-spacing: 0.2em; text-transform: uppercase; text-align: center; }
.results-box { --c: 1.1rem; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(60rem, 92vw); }
.results-box p { text-align: center; margin: -0.4rem 0 0.6rem; }
.res-table { width: 100%; border-collapse: collapse; font-family: var(--f-ui); font-size: 1.15rem; }
.res-table th { text-align: left; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.9rem; color: var(--text-dim); padding: 0.3rem 0.6rem; border-bottom: 1px solid rgba(120, 180, 255, 0.3); }
.res-table td { padding: 0.45rem 0.6rem; font-weight: 600; border-bottom: 1px solid rgba(120, 180, 255, 0.1); }
.res-table td:nth-child(4), .res-table td:nth-child(5) { font-family: var(--f-title); font-size: 1rem; }
.res-table tr.me td { color: var(--gold); background: rgba(246, 199, 68, 0.08); }
.res-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1rem; }
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2, 8, 20, 0.6); pointer-events: auto; }
.modal-box { --c: 0.9rem; width: min(30rem, 90vw); }
.modal-box p { font-size: 1.1rem; line-height: 1.5; margin: 0 0 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.8rem; }
.fatal { position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; background: #050c1a; color: #ffd0d4; font-size: 1.2rem; line-height: 1.6; pointer-events: auto; text-align: center; white-space: pre-line; }

/* ------------------------------------------------------------------------
   Carte du monde
   ------------------------------------------------------------------------ */
.map-screen.active { background: radial-gradient(ellipse at 50% 50%, rgba(6, 18, 40, 0.92), rgba(2, 7, 18, 0.97)); }
.map-side { position: absolute; left: 1.6vw; top: 2.4vh; bottom: 2.4vh; width: min(20rem, 21vw); display: flex; flex-direction: column; gap: 1.3rem; }
.map-side .logo { margin: 0.4rem auto 0.2rem; }
.map-title { --c: 0.7rem; padding: 1rem 1.4rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.map-info { --c: 0.8rem; }
.mi-row { display: flex; gap: 1rem; align-items: center; padding: 0.55rem 0; }
.mi-row svg { font-size: 1.6rem; color: #e6eefb; flex: 0 0 auto; }
.mi-row svg.blue { color: #4aa8ff; transform: rotate(-90deg); }
.mi-row small { display: block; font-family: var(--f-ui); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--glow-2); }
.mi-row b { display: block; font-family: var(--f-text); font-weight: 500; font-size: 1.05rem; }
.map-snap { --c: 0.8rem; flex: 1; min-height: 6rem; padding: 0.35rem; }
.map-snap img { width: 100%; height: 100%; object-fit: cover; display: block; clip-path: var(--shape); }
.map-motto { margin: 0; text-align: center; font-family: var(--f-ui); font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: #c6d6ee; font-size: 0.95rem; }
.map-view { --c: 1.2rem; position: absolute; left: calc(1.6vw + min(20rem, 21vw) + 1.4rem); right: calc(1.6vw + min(17rem, 18vw) + 1.4rem); top: 2.4vh; bottom: 2.4vh; overflow: hidden; cursor: grab; }
.map-view:active { cursor: grabbing; }
.map-view::after { background: #071a33; }
#map-canvas { position: absolute; inset: 0.25rem; width: calc(100% - 0.5rem); height: calc(100% - 0.5rem); clip-path: var(--shape); }
.map-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mlabel { position: absolute; transform: translate(-50%, -1.3rem); display: flex; flex-direction: column; align-items: center; text-align: center; }
.mlabel .badge { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bc, #6cc4ff); background: radial-gradient(circle, rgba(8, 20, 40, 0.95), rgba(8, 20, 40, 0.75)); color: var(--bc, #6cc4ff); font-size: 1.4rem; box-shadow: 0 0 0.8rem var(--bc, #6cc4ff); }
.mlabel b { margin-top: 0.3rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; text-shadow: 0 0 0.4rem #000, 0 0 0.8rem #000; white-space: nowrap; }
.mlabel small { font-family: var(--f-text); font-weight: 500; font-size: 0.88rem; color: #dce7f7; text-shadow: 0 0 0.4rem #000; white-space: nowrap; }
.map-legend { position: absolute; right: 1.6vw; top: 2.4vh; bottom: 2.4vh; width: min(17rem, 18vw); display: flex; flex-direction: column; gap: 1.2rem; }
.legend { --c: 0.8rem; }
.legend h3 { margin: 0 0 0.7rem; font-family: var(--f-ui); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase; }
.legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.legend li { display: flex; align-items: center; gap: 0.8rem; font-size: 0.98rem; color: #dbe5f4; }
.legend li .lg { width: 1.6rem; height: 1.6rem; display: grid; place-items: center; flex: 0 0 auto; color: var(--bc, #fff); font-size: 1.15rem; }
.legend li .lg.ring { border-radius: 50%; border: 1.5px solid var(--bc); font-size: 0.95rem; }
.legend .shortcuts kbd { display: inline-block; min-width: 4.4rem; text-align: center; margin-right: 0.4rem; padding: 0.1rem 0.4rem; font-weight: 700; font-size: 0.85rem; color: #fff; border: 1px solid rgba(140, 200, 255, 0.5); background: rgba(40, 90, 170, 0.35); }
.map-screen.no-legend #map-legend { display: none; }

/* ------------------------------------------------------------------------
   Multijoueur : salon et étiquettes des joueurs
   ------------------------------------------------------------------------ */
.lobby-wrap { position: absolute; left: 2.6vw; right: 2.6vw; top: 8rem; bottom: 5rem; display: grid; grid-template-columns: minmax(18rem, 28rem) 1fr; gap: 2rem; }
.lobby-side, .lobby-col { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.lobby-card { --c: 0.9rem; padding: 1.3rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }
.lobby-card h3, .lobby-sub { margin: 0; font-family: var(--f-ui); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glow-2); }
.lobby-card p { margin: 0; line-height: 1.45; color: #c9d7ec; }
.lobby-card .bigbtn { margin-top: 0.2rem; align-self: stretch; }
.code-input { width: 100%; padding: 0.4rem; font-family: var(--f-title); font-weight: 700; font-size: 2.2rem; letter-spacing: 0.5em; text-indent: 0.5em; text-align: center; color: #fff;
  background: rgba(8, 20, 42, 0.9); border: 1px solid rgba(120, 180, 255, 0.5); outline: none; pointer-events: auto; user-select: text; }
.code-input:focus { border-color: #8fd8ff; box-shadow: 0 0 0.8rem rgba(60, 160, 255, 0.6); }
.code-big { font-family: var(--f-title); font-weight: 800; font-size: 4.2rem; letter-spacing: 0.3em; text-indent: 0.3em; text-align: center; color: #fff; text-shadow: 0 0 1.2rem rgba(80, 170, 255, 0.7); }
.mp-status { margin: 0; min-height: 1.4em; font-family: var(--f-ui); font-weight: 600; font-size: 1.05rem; color: var(--gold); }
.mp-status.err { color: #ff9aa5; }
.lobby-main { --c: 1.1rem; overflow: hidden; }
.lobby-main-inner { height: 100%; overflow-y: auto; padding: 1.6rem 2rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.lobby-title { margin: 0; font-family: var(--f-ui); font-weight: 700; font-size: 2rem; letter-spacing: 0.08em; text-transform: uppercase; }
.lobby-title small { font-family: var(--f-title); font-size: 1.1rem; color: var(--glow-2); margin-left: 0.6rem; }
#mp-settings { display: flex; flex-direction: column; gap: 0.9rem; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.6rem; }
.prow { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0.8rem; background: rgba(20, 46, 90, 0.45); border: 1px solid rgba(120, 180, 255, 0.3); }
.prow svg { font-size: 1.7rem; color: #cfe3ff; flex: 0 0 auto; }
.prow b { display: block; font-family: var(--f-ui); font-weight: 700; font-size: 1.1rem; }
.prow small { font-family: var(--f-ui); font-weight: 600; letter-spacing: 0.06em; color: var(--text-dim); }
.prow .badge { margin-left: auto; font-family: var(--f-ui); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; color: var(--gold); }
.prow.me { border-color: rgba(246, 199, 68, 0.6); }
#mp-settings.locked .seg, #mp-settings.locked .stepper, #mp-settings.locked .circuit, #mp-settings.locked .toggle { pointer-events: none; opacity: 0.7; }
.hud-peers { position: absolute; inset: 0; overflow: hidden; }
.ptag { position: absolute; left: 0; top: 0; text-align: center; font-family: var(--f-ui); white-space: nowrap; will-change: transform; }
.ptag b { display: block; font-weight: 700; font-size: 1.05rem; color: #fff; text-shadow: 0 0 0.4rem #000, 0 0 0.8rem #000; }
.ptag small { font-weight: 600; font-size: 0.85rem; color: #9fe0ff; text-shadow: 0 0 0.4rem #000; }
.ptag::after { content: ""; display: block; width: 0.6rem; height: 0.6rem; margin: 0.2rem auto 0; background: #6cf0ff; transform: rotate(45deg); box-shadow: 0 0 0.5rem #6cf0ff; }

/* Petits écrans (hauteur réduite) */
@media (max-height: 700px) {
  .menu-compass { display: none; }
  .cp-desc { display: none; }
  .ccard { height: 6.6rem; }
  .garage-hint { display: none; }
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .mbtn, .mode-card, .ccard, .district-card, .toast, .hud-center.pop { transition: none; animation: none; }
}

.opt .seg { align-self: flex-start; }

/* message ponctuel (plein écran refusé…) */
.notice { position: fixed; left: 50%; top: 22px; transform: translate(-50%, -12px); z-index: 60; max-width: min(640px, 90vw);
  padding: 12px 20px; background: rgba(6, 16, 34, 0.94); border: 1px solid rgba(110, 200, 255, 0.6); color: #e8f4ff;
  font: 600 15px/1.35 Rajdhani, sans-serif; letter-spacing: 0.02em; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.notice.on { opacity: 1; transform: translate(-50%, 0); }

/* cache-cache : chercheurs en rouge, notes */
.ptag.seek b { color: #ffc2c2; }
.ptag.seek::after { background: #ff5a6a; box-shadow: 0 0 0.5rem #ff5a6a; }
.hs-note { font-size: 0.9rem; margin-top: 0.6rem; }

/* caméra libre : l'interface de jeu se masque (les messages restent) */
#screen-hud.photo > :not(#hud-toasts) { display: none !important; }
/* animations discrètes de l'interface */
@keyframes srPulse { 0%, 100% { filter: drop-shadow(0 0 6px rgba(80, 180, 255, 0.45)); } 50% { filter: drop-shadow(0 0 16px rgba(80, 180, 255, 0.85)); } }
.logo-big { animation: srPulse 4.5s ease-in-out infinite; }
@keyframes srIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.screen.active .menu-buttons .mbtn, .screen.active .pause-box .mbtn { animation: srIn 0.38s ease-out both; }
.screen.active .menu-buttons .mbtn:nth-child(2), .screen.active .pause-box .mbtn:nth-child(3) { animation-delay: 0.04s; }
.screen.active .menu-buttons .mbtn:nth-child(3), .screen.active .pause-box .mbtn:nth-child(4) { animation-delay: 0.08s; }
.screen.active .menu-buttons .mbtn:nth-child(4), .screen.active .pause-box .mbtn:nth-child(5) { animation-delay: 0.12s; }
.screen.active .menu-buttons .mbtn:nth-child(5), .screen.active .pause-box .mbtn:nth-child(6) { animation-delay: 0.16s; }
.screen.active .menu-buttons .mbtn:nth-child(6), .screen.active .pause-box .mbtn:nth-child(7) { animation-delay: 0.2s; }
.screen.active .menu-buttons .mbtn:nth-child(7), .screen.active .pause-box .mbtn:nth-child(8) { animation-delay: 0.24s; }
.screen.active .menu-buttons .mbtn:nth-child(8) { animation-delay: 0.28s; }
@keyframes srSheen { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
.mbtn { position: relative; overflow: hidden; }
.mbtn::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(160, 220, 255, 0.18), transparent); transform: translateX(-120%) skewX(-20deg); }
.mbtn:hover::after, .mbtn:focus-visible::after { animation: srSheen 0.7s ease-out; }
@keyframes srGlow { 0%, 100% { box-shadow: 0 0 0 rgba(80, 180, 255, 0); } 50% { box-shadow: 0 0 18px rgba(80, 180, 255, 0.35); } }
.hud-speed-card, #hud-objective:not([hidden]) { animation: srGlow 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* curseur d'heure dans le menu pause */
.pause-time { margin: 0.2rem 0 0.8rem; }
