/* SPACE_EMPIRE_V3_FLIGHT_UI — HUD de cockpit, hangar et superpositions */
:root {
  --se-cyan: #5fd4ff;
  --se-cyan-soft: rgba(95, 212, 255, .16);
  --se-line: rgba(95, 212, 255, .24);
  --se-glass: rgba(5, 12, 24, .64);
  --se-glass-strong: rgba(4, 10, 20, .88);
  --se-text: #d9ecfb;
  --se-dim: #7f9bb8;
  --se-amber: #ffb347;
  --se-red: #ff5f6e;
  --se-green: #7dffb3;
  --se-gold: #f2c572;
  --se-violet: #c07cff;
  --se-font: ui-sans-serif, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --se-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --se-cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

body.mode-flight { background: #01030a; }
.flight-screen { position: fixed; inset: 0; overflow: hidden; background: #01030a; font-family: var(--se-font); color: var(--se-text); user-select: none; -webkit-user-select: none; touch-action: none; }
#flightCanvas { position: absolute; inset: 0; display: block; }
body.mode-flight:not(.touch) #flightCanvas { cursor: none; }
body.hangar-open #flightCanvas { visibility: visible; filter: saturate(.65) brightness(.42) blur(.35px); transform: scale(1.015); transition: filter .35s ease, transform .35s ease; }
body.hangar-open .flight-sky { filter: brightness(.55) saturate(.7); }
body.flight-panel-open #flightCanvas { filter: brightness(.58) saturate(.82); transition: filter .2s ease; }

.fh { position: absolute; inset: 0; pointer-events: none; }
.fh button, .fh .fh-comm, .fh .fh-target { pointer-events: auto; }
.fh button { font-family: inherit; }
.fh kbd, .fx-window kbd { font-family: var(--se-mono); font-size: 10px; padding: 1px 5px; border: 1px solid var(--se-line); border-bottom-width: 2px; border-radius: 4px; color: var(--se-text); background: rgba(95, 212, 255, .08); }

.fh-panel { background: linear-gradient(135deg, rgba(10, 30, 52, .72), rgba(4, 10, 20, .6)); border: 1px solid var(--se-line); clip-path: var(--se-cut); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 24px rgba(95, 212, 255, .05); }

/* ---- statut vaisseau ------------------------------------------------ */
.fh-status { position: absolute; top: calc(14px + var(--safe-t)); left: calc(14px + var(--safe-l)); width: 290px; padding: 12px 14px 10px; }
.fh-ship { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.fh-ship b { display: block; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.fh-ship small { display: block; font-size: 10px; color: var(--se-dim); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.fh-rank { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--se-gold); border: 1px solid rgba(242, 197, 114, .4); padding: 3px 7px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); white-space: nowrap; }
.fh-bar { display: grid; grid-template-columns: 64px 1fr 38px; align-items: center; gap: 8px; margin: 5px 0; }
.fh-bar span { font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--se-dim); }
.fh-bar div { height: 7px; background: rgba(255, 255, 255, .06); position: relative; overflow: hidden; clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.fh-bar i { position: absolute; inset: 0 auto 0 0; transition: width .12s linear; background-size: 8px 100%; }
.fh-bar em { font-style: normal; font-family: var(--se-mono); font-size: 11px; text-align: right; color: #fff; }
.fh-bar.shield i { background: linear-gradient(90deg, #2a8fd8, #7fe6ff); box-shadow: 0 0 10px rgba(95, 212, 255, .7); }
.fh-bar.hull i { background: linear-gradient(90deg, #d8732a, #ffd27a); box-shadow: 0 0 10px rgba(255, 179, 71, .55); }
.fh-bar.energy i { background: linear-gradient(90deg, #a2c93a, #f0ff7a); box-shadow: 0 0 10px rgba(220, 255, 120, .45); }
.fh-bar.hull.critical i { background: linear-gradient(90deg, #b3102a, #ff5f6e); animation: fh-blink .6s steps(2) infinite; }
.fh-xp { height: 2px; margin-top: 8px; background: rgba(242, 197, 114, .12); }
.fh-xp i { display: block; height: 100%; background: var(--se-gold); box-shadow: 0 0 8px var(--se-gold); transition: width .4s; }
.fh-wanted { margin-top: 8px; font-size: 10px; font-weight: 800; letter-spacing: .16em; color: #fff; background: rgba(255, 60, 80, .35); border: 1px solid var(--se-red); padding: 3px 8px; text-align: center; animation: fh-blink 1.2s steps(2) infinite; }
@keyframes fh-blink { 50% { opacity: .45; } }

/* ---- secteur ------------------------------------------------------- */
.fh-sector { position: absolute; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); text-align: center; padding: 8px 22px 9px; background: linear-gradient(180deg, rgba(4, 12, 24, .72), rgba(4, 12, 24, .25)); border-bottom: 1px solid var(--se-line); clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 16px 100%); min-width: 300px; }
.fh-sector-name { font-size: 15px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px rgba(95, 212, 255, .5); }
.fh-sector-meta { display: flex; flex-wrap: nowrap; white-space: nowrap; justify-content: center; align-items: center; gap: 10px; margin-top: 4px; font-size: 10px; letter-spacing: .1em; color: var(--se-dim); text-transform: uppercase; }
.fh-sector-meta .coords { font-family: var(--se-mono); }
.fh-sector-meta .danger { display: inline-flex; gap: 2px; }
.fh-sector-meta .danger i { width: 7px; height: 9px; background: rgba(255, 255, 255, .12); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }
.fh-sector-meta .danger i.on { background: var(--se-amber); }
.fh-sector-meta .danger i.on.d4, .fh-sector-meta .danger i.on.d5 { background: var(--se-red); }
.fh-sector-meta .sec.high { color: var(--se-green); } .fh-sector-meta .sec.low { color: var(--se-amber); } .fh-sector-meta .sec.lawless { color: var(--se-red); }
.fh-sector-meta .fac { color: var(--fc); border: 1px solid var(--fc); padding: 0 5px; font-weight: 700; }

/* ---- portefeuille & menus ------------------------------------------ */
.fh-wallet { position: absolute; top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fh-chip { border: 1px solid var(--se-line); background: var(--se-glass); color: var(--se-text); padding: 7px 12px; font-family: var(--se-mono); font-size: 13px; clip-path: var(--se-cut); cursor: pointer; backdrop-filter: blur(8px); }
.fh-chip.credits { color: var(--se-green); font-weight: 700; min-width: 140px; text-align: right; }
.fh-chip.cargo { display: grid; grid-template-columns: auto auto; gap: 2px 10px; align-items: center; min-width: 140px; position: relative; }
.fh-chip.cargo span { font-family: var(--se-font); font-size: 9px; letter-spacing: .14em; color: var(--se-dim); }
.fh-chip.cargo b { text-align: right; }
.fh-chip.cargo i { grid-column: 1 / -1; height: 3px; background: var(--se-cyan); box-shadow: 0 0 8px var(--se-cyan); transition: width .3s; }
.fh-chip.cargo.full { border-color: var(--se-amber); } .fh-chip.cargo.full i { background: var(--se-amber); }
.fh-menu { display: flex; gap: 6px; }
.fh-menu button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 56px; padding: 6px 8px; background: var(--se-glass); border: 1px solid var(--se-line); color: var(--se-text); clip-path: var(--se-cut); cursor: pointer; }
.fh-menu button span { font-size: 16px; line-height: 1; }
.fh-menu button small { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--se-dim); }
.fh-menu button:hover, .fh-chip:hover { border-color: var(--se-cyan); box-shadow: 0 0 16px rgba(95, 212, 255, .25); background: rgba(95, 212, 255, .12); }

/* ---- missions ------------------------------------------------------ */
.fh-missions { position: absolute; top: calc(172px + var(--safe-t)); left: calc(14px + var(--safe-l)); width: 290px; display: flex; flex-direction: column; gap: 4px; }
.fh-missions-title { font-size: 9px; letter-spacing: .2em; color: var(--se-gold); }
.fh-mission { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: linear-gradient(90deg, rgba(242, 197, 114, .1), transparent); border-left: 2px solid var(--se-gold); }
.fh-mission b { display: block; font-size: 11px; font-weight: 600; }
.fh-mission small { font-size: 10px; color: var(--se-dim); }
.fh-mission.done { border-left-color: var(--se-green); } .fh-mission.done b { color: var(--se-green); }

/* ---- communications ------------------------------------------------ */
.fh-comms { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(64px + var(--safe-b)); width: min(380px, 40vw); display: flex; flex-direction: column-reverse; gap: 6px; }
.fh-comm { position: relative; padding: 8px 12px 9px 14px; background: linear-gradient(90deg, rgba(4, 12, 24, .88), rgba(4, 12, 24, .55)); border-left: 3px solid var(--cc); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); animation: fh-in .3s ease-out; }
.fh-comm .who { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cc); }
.fh-comm .who i { width: 6px; height: 6px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 8px var(--cc); animation: fh-blink 1s steps(2) infinite; }
.fh-comm .txt { font-size: 13px; line-height: 1.35; margin-top: 3px; color: #eaf5ff; }
.fh-comm .choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fh-comm .choices button { font-size: 12px; font-weight: 700; padding: 7px 12px; color: #fff; background: rgba(95, 212, 255, .14); border: 1px solid var(--cc); clip-path: var(--se-cut); cursor: pointer; }
.fh-comm .choices button:hover { background: rgba(95, 212, 255, .3); }
@keyframes fh-in { from { transform: translateX(-16px); opacity: 0; } }

/* ---- cible --------------------------------------------------------- */
.fh-target { position: absolute; top: calc(150px + var(--safe-t)); right: calc(14px + var(--safe-r)); width: 240px; padding: 10px 12px; background: var(--se-glass); border: 1px solid var(--se-line); clip-path: var(--se-cut); backdrop-filter: blur(8px); }
.fh-target-head { border-left: 3px solid var(--tc); padding-left: 8px; }
.fh-target-head small { display: block; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--se-dim); }
.fh-target-head b { display: block; font-size: 14px; color: #fff; margin: 2px 0; }
.fh-target-head .rel { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rel.hostile { color: var(--se-red); } .rel.warn { color: var(--se-amber); } .rel.friendly { color: var(--se-green); } .rel.neutral { color: var(--se-cyan); }
.fh-target-body { margin-top: 8px; }
.fh-target .mini { height: 4px; background: rgba(255, 255, 255, .07); margin-bottom: 3px; }
.fh-target .mini i { display: block; height: 100%; transition: width .15s; }
.fh-target .mini.shield i { background: var(--se-cyan); } .fh-target .mini.hull i { background: var(--se-amber); }
.fh-target-info { font-size: 11px; color: var(--se-dim); margin-top: 4px; }
.fh-target-dist { font-family: var(--se-mono); font-size: 12px; color: #fff; text-align: right; margin-top: 2px; }

/* ---- alertes, bannières, toasts ---------------------------------- */
.fh-alert { position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; letter-spacing: .2em; color: var(--se-amber); text-shadow: 0 0 12px rgba(255, 150, 60, .7); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.fh-alert.show { opacity: 1; animation: fh-blink 1s steps(2) infinite; }
.fh-banner { position: absolute; top: 24%; left: 50%; transform: translate(-50%, -10px); text-align: center; opacity: 0; transition: opacity .5s, transform .5s; pointer-events: none; }
.fh-banner.show { opacity: 1; transform: translate(-50%, 0); }
.fh-banner small { display: block; font-size: 11px; letter-spacing: .32em; color: var(--se-cyan); }
.fh-banner b { display: block; font-size: clamp(22px, 4.2vw, 42px); font-weight: 300; letter-spacing: .28em; text-transform: uppercase; color: #fff; text-shadow: 0 0 26px rgba(95, 212, 255, .8); }
.fh-banner.warn small { color: var(--se-amber); } .fh-banner.bad small { color: var(--se-red); } .fh-banner.gold small, .fh-banner.gold b { color: var(--se-gold); text-shadow: 0 0 26px rgba(242, 197, 114, .8); }
.fh-toast { position: absolute; left: 50%; bottom: calc(170px + var(--safe-b)); transform: translate(-50%, 10px); padding: 8px 16px; font-size: 13px; background: var(--se-glass-strong); border: 1px solid var(--se-line); clip-path: var(--se-cut); opacity: 0; transition: .25s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.fh-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fh-toast.good { border-color: var(--se-green); color: var(--se-green); } .fh-toast.bad { border-color: var(--se-red); color: #ffd0d4; } .fh-toast.warn { border-color: var(--se-amber); color: var(--se-amber); }
.fh-jump { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%; background: conic-gradient(var(--se-cyan) var(--p, 0deg), rgba(95, 212, 255, .08) 0); -webkit-mask: radial-gradient(circle, transparent 74px, #000 76px); mask: radial-gradient(circle, transparent 74px, #000 76px); opacity: 0; transition: opacity .3s; }
.fh-jump.show { opacity: .9; }
.fh-jump span { position: absolute; inset: 0; display: grid; place-items: center; }

/* ---- action contextuelle ----------------------------------------- */
.fh-prompt { position: absolute; left: 50%; bottom: calc(118px + var(--safe-b)); transform: translateX(-50%); }
.fh-prompt button { display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: 14px; font-weight: 700; letter-spacing: .06em; color: #fff; background: linear-gradient(180deg, rgba(40, 140, 110, .55), rgba(10, 60, 50, .7)); border: 1px solid var(--se-green); clip-path: var(--se-cut); cursor: pointer; box-shadow: 0 0 22px rgba(125, 255, 179, .3); animation: fh-pulse 1.6s ease-in-out infinite; }
.fh-prompt[data-tone="warn"] button { border-color: var(--se-amber); background: linear-gradient(180deg, rgba(140, 90, 20, .55), rgba(60, 30, 5, .7)); box-shadow: 0 0 22px rgba(255, 179, 71, .3); }
.fh-prompt[data-tone="gold"] button { border-color: var(--se-gold); }
@keyframes fh-pulse { 50% { box-shadow: 0 0 34px rgba(125, 255, 179, .55); } }

/* ---- vitesse & modes ---------------------------------------------- */
.fh-flight { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 18px; padding: 8px 18px; background: linear-gradient(0deg, rgba(4, 12, 24, .75), rgba(4, 12, 24, .2)); border-top: 1px solid var(--se-line); clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 100%, 0 100%); }
.fh-speed { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 5px; min-width: 110px; }
.fh-speed b { font-family: var(--se-mono); font-size: 26px; font-weight: 600; color: #fff; text-align: right; min-width: 3ch; }
.fh-speed small { font-size: 10px; color: var(--se-dim); }
.fh-speedbar { grid-column: 1 / -1; height: 3px; background: rgba(255, 255, 255, .08); }
.fh-speedbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--se-cyan), #fff); }
.fh-modes { display: flex; gap: 6px; }
.fh-modes span { font-size: 10px; font-weight: 800; letter-spacing: .14em; padding: 5px 8px; color: var(--se-dim); border: 1px solid rgba(255, 255, 255, .1); }
.fh-modes span.on { color: #fff; border-color: var(--se-cyan); background: rgba(95, 212, 255, .18); box-shadow: 0 0 12px rgba(95, 212, 255, .35); }
#fhWeapon.on { border-color: var(--se-red); background: rgba(255, 95, 110, .2); box-shadow: 0 0 12px rgba(255, 95, 110, .4); }
#fhMining.on { border-color: var(--se-amber); background: rgba(255, 179, 71, .2); }
.fh-modes span.disabled { opacity: .35; text-decoration: line-through; }

.fh-radar { position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); width: 190px; height: 190px; border-radius: 50%; box-shadow: 0 0 30px rgba(95, 212, 255, .15); }
.fh-keys { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 34vw; font-size: 10px; color: rgba(160, 190, 215, .55); }

/* ---- commandes tactiles -------------------------------------------- */
.fh-stick-zone, .fh-stick-base, .fh-stick, .fh-touch { display: none; }
body.touch .fh-keys { display: none; }
body.touch .fh-stick-zone { display: block; position: absolute; left: 0; bottom: 0; width: 50%; height: 62%; pointer-events: auto; touch-action: none; }
body.touch .fh-stick-base, body.touch .fh-stick { display: block; position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .15s; }
body.touch .fh-stick-base { width: 132px; height: 132px; margin: -66px 0 0 -66px; border: 2px solid rgba(95, 212, 255, .35); background: radial-gradient(circle, rgba(95, 212, 255, .08), rgba(95, 212, 255, .02) 70%); }
body.touch .fh-stick { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: radial-gradient(circle at 35% 30%, #d8f6ff, #3aa9e0 60%, #1a4f78); box-shadow: 0 0 20px rgba(95, 212, 255, .6); }
body.touch .stick-on .fh-stick-base, body.touch .stick-on .fh-stick, body.touch .flight-screen.stick-on .fh-stick-base, body.touch .flight-screen.stick-on .fh-stick { opacity: 1; }
body.touch .fh-touch { display: block; position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); width: 210px; height: 210px; pointer-events: none; }
.fh-touch button { position: absolute; border-radius: 50%; border: 2px solid var(--se-line); background: radial-gradient(circle at 40% 35%, rgba(95, 212, 255, .22), rgba(4, 12, 24, .72)); color: #fff; font-size: 22px; font-weight: 700; pointer-events: auto; touch-action: none; backdrop-filter: blur(6px); display: grid; place-items: center; }
.fh-touch button.on { transform: scale(.92); border-color: #fff; box-shadow: 0 0 24px rgba(95, 212, 255, .6); }
.fh-touch .t-fire { width: 96px; height: 96px; right: 0; bottom: 0; font-size: 34px; border-color: rgba(255, 95, 110, .7); background: radial-gradient(circle at 40% 35%, rgba(255, 95, 110, .35), rgba(40, 6, 12, .75)); }
.fh-touch .t-mine { width: 70px; height: 70px; right: 104px; bottom: 6px; border-color: rgba(255, 179, 71, .7); background: radial-gradient(circle at 40% 35%, rgba(255, 179, 71, .3), rgba(40, 20, 4, .75)); }
.fh-touch .t-boost { width: 62px; height: 62px; right: 18px; bottom: 108px; font-size: 26px; }
.fh-touch .t-target { width: 54px; height: 54px; right: 100px; bottom: 96px; font-size: 22px; }

/* ---- superpositions génériques ------------------------------------- */
.fx-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: rgba(1, 4, 10, .6); backdrop-filter: blur(4px); pointer-events: auto; }
.fx-overlay.side { place-items: center end; }
.fx-window { width: min(980px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(160deg, rgba(10, 28, 48, .96), rgba(3, 8, 16, .97)); border: 1px solid var(--se-line); clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); padding: 18px 20px; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
.fx-window header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; border-bottom: 1px solid var(--se-line); padding-bottom: 10px; }
.fx-window header small { display: block; font-size: 10px; letter-spacing: .22em; color: var(--se-cyan); }
.fx-window header strong { font-size: 20px; font-weight: 600; letter-spacing: .04em; }
.fx-window h4 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--se-dim); margin: 14px 0 8px; }
.fx-window h4 small { letter-spacing: 0; text-transform: none; }
.fx-close { width: 38px; height: 38px; font-size: 16px; color: var(--se-text); background: rgba(255, 255, 255, .05); border: 1px solid var(--se-line); cursor: pointer; }
.map-window { width: min(1100px, 100%); }
.map-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.map-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mg-cell { position: relative; aspect-ratio: 1; padding: 4px; font-family: var(--se-mono); color: var(--se-dim); background: rgba(95, 212, 255, .03); border: 1px solid rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--fc, transparent); display: flex; flex-direction: column; justify-content: space-between; align-items: center; cursor: default; }
.mg-cell small { font-size: 9px; }
.mg-cell.d2 { background: rgba(255, 179, 71, .06); } .mg-cell.d3 { background: rgba(255, 140, 60, .1); } .mg-cell.d4 { background: rgba(255, 80, 90, .12); } .mg-cell.d5 { background: rgba(255, 40, 60, .2); }
.mg-cell.here { border-color: var(--se-cyan); color: #fff; box-shadow: 0 0 18px rgba(95, 212, 255, .35); }
.mg-cell.here b { font-size: 9px; color: var(--se-cyan); }
.mg-cell.adj { cursor: pointer; border-color: rgba(95, 212, 255, .35); color: var(--se-text); }
.mg-cell.adj:hover { background: rgba(95, 212, 255, .2); }
.mg-cell.mission::after { content: "★"; position: absolute; top: 2px; right: 4px; color: var(--se-gold); font-size: 10px; }
.mg-cell .icons { display: flex; gap: 3px; margin-top: 6px; }
.mg-cell .icons i, .map-legend .lg { display: inline-block; width: 7px; height: 7px; }
.icons .star, .lg.star { border-radius: 50%; background: #ffe39a; box-shadow: 0 0 6px #ffd27a; }
.icons .st, .lg.st { background: var(--se-cyan); } .icons .st.pirate, .lg.st.pirate { background: var(--se-red); }
.icons .an, .lg.an { background: var(--se-violet); transform: rotate(45deg); }
.lg.dz { background: rgba(255, 80, 90, .5); }
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--se-dim); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
#sectorCanvas { width: 100%; aspect-ratio: 1; display: block; border: 1px solid var(--se-line); margin-bottom: 10px; cursor: crosshair; }
.cargo-window { width: min(420px, 100%); }
.cargo-list { display: flex; flex-direction: column; gap: 6px; }
.cg-row { display: grid; grid-template-columns: 14px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .05); }
.cg-row small { color: var(--se-dim); font-family: var(--se-mono); }
.cg-row button { font-size: 11px; padding: 5px 8px; background: rgba(255, 95, 110, .12); border: 1px solid rgba(255, 95, 110, .4); color: #ffd0d4; cursor: pointer; }
.menu-window { width: min(640px, 100%); }
.menu-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-stats div { padding: 10px; background: rgba(95, 212, 255, .05); border: 1px solid rgba(95, 212, 255, .12); }
.menu-stats b { display: block; font-family: var(--se-mono); font-size: 18px; color: #fff; }
.menu-stats small { font-size: 10px; color: var(--se-dim); }
.menu-reps .rep { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; margin: 5px 0; font-size: 12px; }
.menu-reps .rep span { color: var(--fc); }
.menu-reps .rep div { position: relative; height: 6px; background: rgba(255, 255, 255, .06); }
.menu-reps .rep div::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, .3); }
.menu-reps .rep i { position: absolute; top: 0; bottom: 0; background: var(--se-green); }
.menu-reps .rep b { font-family: var(--se-mono); text-align: right; }
.menu-help { font-size: 12px; line-height: 1.6; color: var(--se-dim); display: grid; gap: 8px; }
.menu-help b { color: var(--se-cyan); margin-right: 6px; }
.fx-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; margin: 8px 0; }
.fx-switch input { width: auto; margin: 0; accent-color: var(--se-cyan); }
.intro-window { width: min(560px, 100%); }
.intro-window small { font-size: 10px; letter-spacing: .24em; color: var(--se-gold); }
.intro-window h2 { font-weight: 300; font-size: 28px; letter-spacing: .06em; margin: 6px 0 12px; }
.intro-window p, .intro-window li { font-size: 14px; line-height: 1.55; color: #c9dcec; }
.intro-window ol { margin: 12px 0 18px 20px; display: grid; gap: 6px; }
.death { background: radial-gradient(circle, rgba(80, 0, 10, .55), rgba(0, 0, 0, .9)); text-align: center; }
.death small { font-size: 11px; letter-spacing: .3em; color: var(--se-red); }
.death h2 { font-size: clamp(28px, 6vw, 56px); font-weight: 200; letter-spacing: .2em; text-transform: uppercase; margin: 8px 0; }
.death p { color: #e8c9cd; max-width: 520px; margin: 0 auto; }
.flight-loading { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; align-content: center; gap: 16px; background: #01030a; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--se-cyan); }
.flight-loading i { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(95, 212, 255, .15); border-top-color: var(--se-cyan); animation: fl-spin 1s linear infinite; }
.flight-loading.hidden { display: none; }
@keyframes fl-spin { to { transform: rotate(360deg); } }

/* ---- hangar -------------------------------------------------------- */
.hangar { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; background: radial-gradient(ellipse at 30% 20%, rgba(30, 80, 130, .35), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(120, 60, 160, .18), transparent 60%), linear-gradient(180deg, #050b16, #02050b); pointer-events: auto; touch-action: auto; user-select: text; -webkit-user-select: text; }
.hg-head { display: flex; align-items: center; gap: 16px; padding: calc(12px + var(--safe-t)) calc(20px + var(--safe-r)) 12px calc(20px + var(--safe-l)); border-bottom: 1px solid var(--se-line); background: rgba(3, 10, 20, .7); }
.hg-station { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.hg-icon { font-size: 30px; width: 54px; height: 54px; display: grid; place-items: center; background: rgba(95, 212, 255, .08); border: 1px solid var(--se-line); clip-path: var(--se-cut); }
.hg-station small { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--se-dim); }
.hg-station h2 { font-size: 22px; font-weight: 500; letter-spacing: .05em; margin: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-owner { font-size: 12px; color: var(--se-dim); display: inline-flex; align-items: center; gap: 6px; }
.hg-owner i { width: 8px; height: 8px; background: var(--fc); box-shadow: 0 0 8px var(--fc); }
.hg-wallet { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--se-mono); font-size: 13px; }
.hg-wallet span:first-child { color: var(--se-green); font-size: 17px; font-weight: 700; }
.hg-wallet span:last-child { color: var(--se-dim); }
.hg-undock { padding: 12px 20px; font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: linear-gradient(180deg, rgba(60, 170, 230, .5), rgba(20, 70, 120, .6)); border: 1px solid var(--se-cyan); clip-path: var(--se-cut); cursor: pointer; }
.hg-undock:hover { box-shadow: 0 0 20px rgba(95, 212, 255, .5); }
.hg-body { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.hg-ship { position: relative; border-right: 1px solid var(--se-line); display: flex; flex-direction: column; min-height: 0; overflow: auto; }
#hgPreview { width: 100%; height: 250px; flex-shrink: 0; }
.hg-shipinfo { padding: 0 18px 18px; }
.hg-shipname b { display: block; font-size: 20px; }
.hg-shipname small { color: var(--se-dim); font-size: 12px; }
.hg-rank { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 10px 0 12px; font-size: 12px; color: var(--se-gold); }
.hg-rank div { height: 4px; background: rgba(242, 197, 114, .15); }
.hg-rank i { display: block; height: 100%; background: var(--se-gold); }
.hg-rank small { color: var(--se-dim); font-family: var(--se-mono); }
.hg-stat { display: grid; grid-template-columns: 90px 1fr 56px; gap: 8px; align-items: center; font-size: 11px; margin: 5px 0; color: var(--se-dim); }
.hg-stat div { height: 5px; background: rgba(255, 255, 255, .06); }
.hg-stat i { display: block; height: 100%; background: linear-gradient(90deg, #2a8fd8, var(--se-cyan)); }
.hg-stat.warn i { background: linear-gradient(90deg, #b3102a, var(--se-amber)); }
.hg-stat b { font-family: var(--se-mono); color: #fff; text-align: right; font-weight: 500; }
.hg-ok { margin: 12px 0; font-size: 12px; color: var(--se-green); }
.hg-license { margin-top: 12px; font-size: 11px; padding: 8px 10px; border: 1px dashed rgba(242, 197, 114, .4); color: var(--se-dim); }
.hg-license.ok { color: var(--se-gold); border-style: solid; }
.hg-main { display: flex; flex-direction: column; min-height: 0; }
.hg-tabs { display: flex; gap: 4px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--se-line); flex-shrink: 0; }
.hg-tabs::-webkit-scrollbar { display: none; }
.hg-tabs button { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--se-dim); background: transparent; border: 1px solid transparent; border-bottom: none; cursor: pointer; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%); }
.hg-tabs button.active { color: #fff; background: rgba(95, 212, 255, .12); border-color: var(--se-line); }
.hg-panel { flex: 1; overflow: auto; padding: 16px 20px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.hg-hint { font-size: 12px; color: var(--se-dim); margin-bottom: 12px; line-height: 1.5; }
.hg-empty { padding: 30px; text-align: center; color: var(--se-dim); font-size: 13px; }
.hg-subtitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--se-cyan); margin: 16px 0 8px; }
.hg-btn { font-family: var(--se-font); font-size: 12px; font-weight: 700; padding: 8px 12px; color: #eaf6ff; background: rgba(95, 212, 255, .12); border: 1px solid rgba(95, 212, 255, .45); clip-path: var(--se-cut); cursor: pointer; white-space: nowrap; }
.hg-btn:hover:not([disabled]) { background: rgba(95, 212, 255, .26); box-shadow: 0 0 14px rgba(95, 212, 255, .3); }
.hg-btn[disabled] { opacity: .35; cursor: not-allowed; }
.hg-btn.good { background: rgba(125, 255, 179, .14); border-color: rgba(125, 255, 179, .6); color: #dfffea; }
.hg-btn.warn { background: rgba(255, 179, 71, .14); border-color: rgba(255, 179, 71, .6); }
.hg-btn.gold { background: rgba(242, 197, 114, .14); border-color: rgba(242, 197, 114, .6); color: #fff1c1; }
.hg-btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .18); }
.hg-btn.wide { width: 100%; padding: 11px; margin-top: 10px; }
.hg-btn.on { background: rgba(95, 212, 255, .35); }
.res-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--rc); box-shadow: 0 0 6px var(--rc); margin-right: 7px; transform: rotate(45deg); flex-shrink: 0; }
.hg-table { display: flex; flex-direction: column; gap: 3px; }
.hg-tr { display: grid; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .04); font-size: 13px; }
.hg-table.market .hg-tr { grid-template-columns: 1.4fr .5fr .6fr .7fr .7fr 2fr; }
.hg-table.storage .hg-tr { grid-template-columns: 1.4fr .5fr .6fr 2fr; }
.hg-tr.head { background: none; border: none; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--se-dim); }
.hg-tr.dim { opacity: .55; }
.hg-tr .name { display: flex; align-items: center; font-weight: 600; }
.hg-tr .price { font-family: var(--se-mono); }
.hg-tr .price.sell { color: var(--se-green); } .hg-tr .price.buy { color: var(--se-amber); }
.hg-tr .acts, .hg-card .acts { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; align-items: center; }
.hg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.hg-grid.ships { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hg-card { position: relative; padding: 12px; background: linear-gradient(160deg, rgba(95, 212, 255, .06), rgba(255, 255, 255, .015)); border: 1px solid rgba(95, 212, 255, .14); clip-path: var(--se-cut); display: flex; flex-direction: column; gap: 5px; }
.hg-card small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--se-dim); }
.hg-card b { font-size: 14px; }
.hg-card p { font-size: 12px; color: #a9c1d6; line-height: 1.4; flex: 1; }
.hg-card .acts { justify-content: space-between; margin-top: 6px; }
.hg-card .price { font-family: var(--se-mono); color: var(--se-green); font-size: 13px; }
.hg-card .lock { font-size: 11px; color: var(--se-amber); }
.hg-card.locked { opacity: .72; }
.hg-card.active { border-color: var(--se-cyan); box-shadow: inset 0 0 20px rgba(95, 212, 255, .12); }
.hg-card.done { border-color: rgba(125, 255, 179, .5); }
.hg-card .mats { display: flex; flex-wrap: wrap; gap: 4px; }
.mat { display: inline-flex; align-items: center; font-size: 11px; padding: 2px 6px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.mat.ok { color: #cfe8d8; } .mat.miss { color: #ffb0b8; border-color: rgba(255, 95, 110, .4); }
.recipe-flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.recipe-flow > div { display: flex; flex-direction: column; gap: 4px; }
.recipe-flow em { color: var(--se-cyan); font-style: normal; font-size: 20px; }
.hull-thumb { width: 100%; height: 110px; background: radial-gradient(ellipse, rgba(95, 212, 255, .12), transparent 70%); }
.cmps { display: flex; flex-wrap: wrap; gap: 4px; }
.cmp { font-size: 11px; font-family: var(--se-mono); padding: 2px 6px; background: rgba(255, 255, 255, .04); color: var(--se-dim); }
.cmp.up { color: var(--se-green); } .cmp.down { color: #ff9aa4; }
.badge { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--se-cyan); padding: 3px 8px; border: 1px solid var(--se-line); }
.hg-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.hg-slot { position: relative; text-align: left; padding: 9px 10px; color: var(--se-text); background: rgba(255, 255, 255, .03); border: 1px solid rgba(95, 212, 255, .18); clip-path: var(--se-cut); cursor: pointer; }
.hg-slot small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--se-dim); }
.hg-slot b { display: block; font-size: 12px; margin-top: 2px; }
.hg-slot em { position: absolute; top: 6px; right: 8px; font-style: normal; font-size: 10px; color: var(--se-gold); }
.hg-slot.empty b { color: var(--se-dim); font-style: italic; }
.hg-slot.active { border-color: var(--se-cyan); background: rgba(95, 212, 255, .16); }
.hg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hg-row.end { justify-content: flex-end; margin-top: 18px; }
.hg-row input:not([type]) , .hg-row input[type="text"] { width: auto; flex: 1; min-width: 160px; margin: 0; }
.hg-row.colors label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--se-dim); }
.hg-row.colors input[type="color"] { width: 48px; height: 34px; padding: 0; margin: 0; border: 1px solid var(--se-line); background: none; }
.hg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.hg-swatch { display: flex; align-items: center; gap: 8px; padding: 7px; font-size: 11px; color: var(--se-text); background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08); cursor: pointer; text-align: left; }
.hg-swatch i { width: 26px; height: 26px; flex-shrink: 0; background: linear-gradient(135deg, var(--a) 0 45%, var(--b) 45% 80%, var(--c) 80%); clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%); }
.hg-light { width: 34px; height: 34px; border-radius: 50%; background: var(--l); box-shadow: 0 0 12px var(--l); border: 2px solid transparent; cursor: pointer; }
.hg-light.active { border-color: #fff; }
.hg-opt { font-size: 12px; padding: 7px 11px; color: var(--se-text); background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; }
.hg-opt em { font-style: normal; color: var(--se-green); font-family: var(--se-mono); }
.hg-opt.active { border-color: var(--se-cyan); background: rgba(95, 212, 255, .16); }

/* Retour cockpit depuis le commandement impérial */
.cockpit-return { pointer-events: auto; padding: 8px 12px; font-size: 12px; background: linear-gradient(180deg, rgba(60, 170, 230, .45), rgba(20, 70, 120, .55)); border: 1px solid #5fd4ff; }

/* =====================================================================
   RESPONSIVE — tablette et mobile
   ===================================================================== */
@media (max-width: 1100px) {
  .fh-keys { display: none; }
  .fh-sector { min-width: 0; }
}

@media (max-width: 860px), (pointer: coarse) {
  .fh-status { width: min(250px, 56vw); padding: 9px 10px 8px; top: calc(8px + var(--safe-t)); left: calc(8px + var(--safe-l)); }
  .fh-ship { margin-bottom: 4px; }
  .fh-ship b { font-size: 13px; }
  .fh-ship small { display: none; }
  .fh-rank { font-size: 9px; padding: 2px 5px; }
  .fh-bar { grid-template-columns: 50px 1fr 30px; gap: 6px; margin: 3px 0; }
  .fh-bar span { font-size: 8px; letter-spacing: .08em; }
  .fh-bar em { font-size: 10px; }
  .fh-wallet { top: calc(8px + var(--safe-t)); right: calc(8px + var(--safe-r)); gap: 4px; }
  .fh-chip { padding: 5px 9px; font-size: 12px; }
  .fh-chip.credits, .fh-chip.cargo { min-width: 112px; }
  .fh-menu button { min-width: 42px; padding: 5px 6px; }
  .fh-menu button small { display: none; }
  .fh-sector { top: calc(104px + var(--safe-t)); padding: 4px 14px 5px; max-width: 70vw; }
  .fh-sector-name { font-size: 11px; letter-spacing: .14em; }
  .fh-sector-meta { gap: 6px; font-size: 9px; }
  .fh-sector-meta .sec { display: none; }
  .fh-flight { bottom: auto; top: calc(150px + var(--safe-t)); left: calc(8px + var(--safe-l)); transform: none; padding: 4px 10px; gap: 8px; clip-path: none; background: none; border: 0; }
  .fh-speed { min-width: 0; }
  .fh-speed b { font-size: 18px; }
  .fh-modes { display: none; }
  .fh-radar { width: 100px; height: 100px; top: calc(150px + var(--safe-t)); bottom: auto; right: calc(8px + var(--safe-r)); }
  .fh-target { top: calc(156px + var(--safe-t)); right: auto; left: 50%; transform: translateX(-50%); width: min(170px, 42vw); padding: 6px 8px; }
  .fh-target-body .fh-target-info { display: none; }
  .fh-target-head b { font-size: 12px; }
  .fh-missions { display: none; }
  .fh-comms { left: 50%; transform: translateX(-50%); top: calc(262px + var(--safe-t)); bottom: auto; width: min(420px, 92vw); flex-direction: column; }
  .fh-comms .fh-comm:nth-child(n+3) { display: none; }
  .fh-comm .txt { font-size: 12px; }
  .fh-alert { top: auto; bottom: calc(300px + var(--safe-b)); font-size: 10px; letter-spacing: .12em; }
  .fh-banner { top: 36%; }
  .fh-prompt { bottom: calc(236px + var(--safe-b)); right: calc(14px + var(--safe-r)); left: auto; transform: none; }
  .fh-prompt button { padding: 12px 16px; font-size: 14px; }
  .fh-prompt kbd { display: none; }
  .fh-toast { bottom: calc(330px + var(--safe-b)); font-size: 12px; white-space: normal; text-align: center; }
  .map-body { grid-template-columns: 1fr; }
  .menu-stats { grid-template-columns: repeat(2, 1fr); }
  .menu-reps .rep { grid-template-columns: 110px 1fr 34px; }
  .hg-head { flex-wrap: wrap; gap: 10px; padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
  .hg-icon { width: 42px; height: 42px; font-size: 22px; }
  .hg-station h2 { font-size: 17px; }
  .hg-wallet { flex-direction: row; gap: 12px; align-items: center; order: 3; width: 100%; justify-content: space-between; }
  .hg-undock { padding: 10px 14px; font-size: 12px; }
  .hg-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; overflow-y: auto; overflow-x: hidden; }
  .hg-main, .hg-panel, .hg-shipinfo { min-width: 0; }
  .hg-hint { overflow-wrap: anywhere; }
  .hg-ship { border-right: 0; border-bottom: 1px solid var(--se-line); overflow: visible; display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: start; }
  .hg-stat { grid-template-columns: 70px minmax(0, 1fr) 44px; }
  .hg-license { font-size: 10px; }
  #hgPreview { height: 140px; }
  .hg-shipinfo { padding: 8px 12px 10px 0; }
  .hg-shipinfo .hg-stat:nth-of-type(n+5) { display: none; }
  .hg-shipname b { font-size: 16px; }
  .hg-main { min-height: 60vh; }
  .hg-panel { padding: 12px 12px calc(24px + var(--safe-b)); overflow: visible; }
  .hg-tabs { padding: 8px 10px 0; position: sticky; top: 0; background: #040a14; z-index: 2; }
  .hg-tabs button { padding: 10px 12px; font-size: 12px; }
  .hg-table .hg-tr, .hg-table.market .hg-tr, .hg-table.storage .hg-tr { grid-template-columns: 1fr auto auto; }
  .hg-table .hg-tr.head { display: none; }
  .hg-table.market .hg-tr span:nth-child(2), .hg-table.market .hg-tr span:nth-child(3) { font-size: 11px; color: var(--se-dim); }
  .hg-table.market .hg-tr span:nth-child(2)::before { content: "Soute "; } .hg-table.market .hg-tr span:nth-child(3)::before { content: "Entr. "; }
  .hg-table.storage .hg-tr span:nth-child(2)::before { content: "Soute "; } .hg-table.storage .hg-tr span:nth-child(3)::before { content: "Entr. "; }
  .hg-tr .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .hg-btn { padding: 10px 12px; font-size: 12px; }
  .hg-grid, .hg-grid.ships { grid-template-columns: 1fr; }
}

@media (max-width: 860px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .fh-flight { top: auto; bottom: calc(8px + var(--safe-b)); left: calc(8px + var(--safe-l)); }
  .fh-radar { top: calc(108px + var(--safe-t)); width: 92px; height: 92px; }
  .fh-banner { top: 16%; }
  .fh-banner b { font-size: 24px; }
  .fh-target { top: calc(92px + var(--safe-t)); right: calc(110px + var(--safe-r)); }
  .fh-comms { top: calc(8px + var(--safe-t)); width: min(360px, 40vw); }
  .fh-sector { display: none; }
  .fh-target { top: calc(108px + var(--safe-t)); left: auto; transform: none; right: calc(110px + var(--safe-r)); }
  .fh-alert { top: auto; bottom: calc(40px + var(--safe-b)); }
  .fh-prompt { bottom: calc(150px + var(--safe-b)); right: calc(230px + var(--safe-r)); }
  .fh-toast { bottom: calc(70px + var(--safe-b)); }
  body.touch .fh-touch { transform: scale(.88); transform-origin: bottom right; }
  body.touch .fh-stick-zone { height: 80%; }
  .hg-ship { grid-template-columns: 220px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .fh-alert.show, .fh-wanted, .fh-prompt button, .fh-comm .who i { animation: none; }
}

/* Neutralise le survol générique hérité de style.css à l'intérieur du cockpit */
.flight-screen button:hover { background: rgba(95, 212, 255, .16); box-shadow: 0 0 12px rgba(95, 212, 255, .18); }
.flight-screen .fh-prompt button:hover { background: linear-gradient(180deg, rgba(50, 170, 130, .7), rgba(10, 70, 55, .8)); }
.flight-screen .hg-undock:hover { background: linear-gradient(180deg, rgba(80, 190, 250, .65), rgba(20, 80, 140, .7)); }
.flight-screen .fh-touch .t-fire:hover { background: radial-gradient(circle at 40% 35%, rgba(255, 95, 110, .35), rgba(40, 6, 12, .75)); }
.flight-screen .fh-touch .t-mine:hover { background: radial-gradient(circle at 40% 35%, rgba(255, 179, 71, .3), rgba(40, 20, 4, .75)); }
.flight-screen .mg-cell:not(.adj):hover { background: rgba(95, 212, 255, .03); box-shadow: inset 0 0 0 1px var(--fc, transparent); }
.flight-screen .hg-tabs button:not(.active):hover { color: #fff; }
.flight-screen .hg-light:hover { background: var(--l); }
.flight-screen button { border-radius: 0; transition: background .15s, box-shadow .15s, border-color .15s, transform .08s; }
.flight-screen .fh-touch button, .flight-screen .hg-light { border-radius: 50%; }

/* =====================================================================
   SPACE_EMPIRE_V4_FLIGHT_UI — ciel WebGL, modes, capacités, chaleur,
   sous-systèmes, supercroisière, drones, pilote automatique, hyperespace
   ===================================================================== */
.flight-sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.flight-sky.hidden { display: none; }
body.hangar-open .flight-sky { visibility: hidden; }

.fh-bar.heat { grid-template-columns: 64px 1fr auto; }
.fh-bar.heat i { background: linear-gradient(90deg, #3a6f8a, #ffb347 60%, #ff4d3d); box-shadow: 0 0 10px rgba(255, 120, 60, .45); }
.fh-status.hot .fh-bar.heat span, .fh-bar.heat.hot span { color: #ff8a5f; animation: fh-blink .5s steps(2) infinite; }
.fh-subs { display: flex; gap: 3px; }
.fh-subs span { font-size: 8px !important; font-weight: 800; letter-spacing: .06em !important; padding: 1px 3px; color: var(--se-green) !important; border: 1px solid rgba(125, 255, 179, .35); }
.fh-subs span.warn { color: var(--se-amber) !important; border-color: rgba(255, 179, 71, .5); }
.fh-subs span.bad { color: var(--se-red) !important; border-color: rgba(255, 95, 110, .6); animation: fh-blink .7s steps(2) infinite; }

.fh-modebar { position: absolute; top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; background: rgba(4, 12, 24, .55); border: 1px solid var(--se-line); clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%); }
.fh-modebar button { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--se-dim); background: transparent; border: 0; padding: 5px 10px; cursor: pointer; }
.fh-modebar button kbd { font-size: 9px; margin-left: 4px; opacity: .7; }
.fh-modebar button:hover, .fh-modebar button.active { color: #fff; background: rgba(95, 212, 255, .14); }
.fh-alert { top: calc(104px + var(--safe-t)); }

.fh-abilities { position: absolute; left: 50%; bottom: calc(74px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 8px; align-items: flex-end; }
.fh-ab { --cd: 0deg; position: relative; min-width: 128px; padding: 7px 30px 7px 12px; text-align: left; color: #fff; background: linear-gradient(180deg, rgba(20, 50, 80, .7), rgba(4, 12, 24, .8)); border: 1px solid var(--se-line); clip-path: var(--se-cut); cursor: pointer; overflow: hidden; }
.fh-ab::before { content: ""; position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, .55) var(--cd), transparent 0); pointer-events: none; }
.fh-ab b { position: relative; display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.fh-ab small { position: relative; display: block; font-size: 9px; color: var(--se-dim); letter-spacing: .12em; font-family: var(--se-mono); }
.fh-ab kbd { position: absolute; top: 5px; right: 6px; }
.fh-ab.ready { border-color: rgba(125, 255, 179, .6); box-shadow: inset 0 0 18px rgba(125, 255, 179, .12); }
.fh-ab.ready small { color: var(--se-green); }
.fh-ab.origin.ready { border-color: rgba(242, 197, 114, .7); box-shadow: inset 0 0 18px rgba(242, 197, 114, .14); }
.fh-ab.origin.ready small { color: var(--se-gold); }
.fh-ab.active { border-color: #fff; box-shadow: 0 0 22px rgba(255, 224, 138, .5), inset 0 0 22px rgba(255, 224, 138, .25); animation: fh-pulse 1s ease-in-out infinite; }
.fh-ab.small { min-width: 96px; }
.fh-ab.on { border-color: var(--se-cyan); background: linear-gradient(180deg, rgba(40, 120, 170, .7), rgba(4, 20, 40, .85)); }
#fhCruise.spool { animation: fh-blink .35s steps(2) infinite; }
.fh-ab.hidden { display: none; }

.fh-autopilot { position: absolute; top: calc(128px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 14px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--se-green); background: rgba(4, 30, 22, .7); border: 1px solid rgba(125, 255, 179, .5); clip-path: var(--se-cut); cursor: pointer; white-space: nowrap; }
.fh-autopilot i { width: 8px; height: 8px; border-radius: 50%; background: var(--se-green); box-shadow: 0 0 10px var(--se-green); animation: fh-blink .8s steps(2) infinite; }
.fh-autopilot em { font-style: normal; color: var(--se-dim); }
.fh-autopilot.hidden { display: none; }
.fh-prompt { bottom: calc(146px + var(--safe-b)); }
.fh-toast { bottom: calc(196px + var(--safe-b)); }

.map-stations { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.map-stations .hg-btn { font-size: 11px; padding: 6px 9px; }
.map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* Hyperespace */
.ftl-overlay { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: grid; grid-template-rows: auto 1fr auto; padding: calc(24px + var(--safe-t)) calc(20px + var(--safe-r)) calc(24px + var(--safe-b)) calc(20px + var(--safe-l)); color: #eaf6ff; text-align: center; }
.ftl-overlay.hidden { display: none; }
.ftl-top small, .ftl-center > small { display: block; font-size: 11px; letter-spacing: .34em; color: var(--se-cyan); }
.ftl-top b { display: block; margin-top: 6px; font-size: clamp(16px, 2.4vw, 24px); font-weight: 300; letter-spacing: .18em; font-family: var(--se-mono); }
.ftl-center { align-self: start; margin-top: 12vh; }
.ftl-eta { font-size: clamp(34px, 7vw, 76px); font-weight: 200; letter-spacing: .06em; font-family: var(--se-mono); text-shadow: 0 0 30px rgba(95, 212, 255, .8); }
.ftl-bar { width: min(560px, 80vw); height: 4px; margin: 14px auto; background: rgba(255, 255, 255, .1); overflow: hidden; }
.ftl-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5fd4ff, #c07cff); box-shadow: 0 0 14px #5fd4ff; transition: width .25s linear; }
.ftl-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: 12px; color: var(--se-dim); letter-spacing: .06em; }
.ftl-meta b { color: #fff; font-family: var(--se-mono); }
.ftl-log { margin-top: 18px; font-size: 11px; letter-spacing: .14em; color: rgba(160, 220, 255, .7); font-family: var(--se-mono); }
.ftl-log.fade { animation: ftl-fade 6s ease-in-out; }
@keyframes ftl-fade { 0% { opacity: 0; } 12% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.ftl-actions { display: flex; justify-content: center; gap: 10px; pointer-events: auto; }
body.ftl-active .fh > *:not(.fh-banner):not(.fh-toast) { display: none !important; }
body.ftl-active #flightCanvas { cursor: default; }

/* Tactile : boutons de capacités */
.fh-touch .t-ab1, .fh-touch .t-ab2, .fh-touch .t-cruise, .fh-touch .t-drones { font-size: 16px; font-weight: 800; }
.fh-touch .t-ab1 { width: 52px; height: 52px; right: 172px; bottom: 74px; border-color: rgba(125, 255, 179, .6); }
.fh-touch .t-ab2 { width: 48px; height: 48px; right: 160px; bottom: 138px; border-color: rgba(242, 197, 114, .7); }
.fh-touch .t-cruise { width: 46px; height: 46px; right: 58px; bottom: 180px; }
.fh-touch .t-drones { width: 42px; height: 42px; right: 112px; bottom: 160px; }
body.touch .fh-abilities { display: none; }
.fh-touch .t-ab1, .fh-touch .t-ab2 { --cd: 0deg; overflow: hidden; }
.fh-touch .t-ab1::after, .fh-touch .t-ab2::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(0, 0, 0, .6) var(--cd), transparent 0); pointer-events: none; }
.fh-touch .t-ab1.ready { box-shadow: 0 0 16px rgba(125, 255, 179, .45); }
.fh-touch .t-ab2.ready { box-shadow: 0 0 16px rgba(242, 197, 114, .5); }
.fh-touch .active { border-color: #fff !important; box-shadow: 0 0 24px rgba(255, 224, 138, .7) !important; }
.fh-touch .hidden { display: none; }

@media (max-width: 860px), (pointer: coarse) {
  .fh-modebar { display: none; }
  .fh-menu button { width: 38px; min-width: 0; padding: 4px 2px; }
  .fh-menu button small { display: none; }
  .fh-status { width: min(230px, 54vw); }
  .fh-bar.heat { grid-template-columns: 50px 1fr auto; }
  body.touch .fh-prompt { bottom: calc(300px + var(--safe-b)); }
  .fh-autopilot { top: auto; bottom: calc(250px + var(--safe-b)); font-size: 10px; padding: 5px 10px; max-width: 80vw; overflow: hidden; }
  .fh-menu button small { font-size: 8px; }
  .ftl-center { margin-top: 6vh; }
}
@media (max-width: 860px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  body.touch .fh-abilities { top: calc(8px + var(--safe-t)); right: calc(290px + var(--safe-r)); flex-direction: row; }
  .fh-autopilot { bottom: calc(110px + var(--safe-b)); }
}

/* Hangar 4.0 : rôles, qualité, maîtrise */
.hg-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.hg-tag { font-size: 10px; padding: 2px 6px; border: 1px solid var(--se-line); color: var(--se-text); letter-spacing: .04em; }
.hg-tag.good { border-color: rgba(125, 255, 179, .45); color: var(--se-green); }
.hg-tag.bad { border-color: rgba(255, 95, 110, .45); color: var(--se-red); }
.hg-role { font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; color: var(--rc); border: 1px solid var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.hg-card.module.quality { border-color: var(--qc); box-shadow: inset 0 0 22px color-mix(in srgb, var(--qc) 22%, transparent); }
.hg-card.module .q { color: var(--qc); font-weight: 800; }
.hg-slot[style*="--qc"] { border-color: var(--qc); }
.hg-slot[style*="--qc"] b { color: var(--qc); }
.em.fuel, .hg-tr .fuel { font-style: normal; font-size: 9px; color: #8fe3f2; border: 1px solid rgba(143, 227, 242, .4); padding: 0 4px; margin-left: 4px; }
.hg-card.origin { border-color: var(--oc); box-shadow: inset 0 0 30px color-mix(in srgb, var(--oc) 16%, transparent); margin-bottom: 10px; }
.hg-card.role { border-left: 3px solid var(--rc); }
.hg-card.role.active { box-shadow: inset 0 0 26px color-mix(in srgb, var(--rc) 22%, transparent); }
.hg-card.role .hg-rank div i { background: var(--rc); }
.hg-card .perks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.hg-card .perks li { font-size: 11px; color: var(--se-dim); display: flex; gap: 6px; align-items: center; }
.hg-card .perks li em { font-style: normal; font-family: var(--se-mono); font-size: 10px; min-width: 20px; text-align: center; border: 1px solid rgba(255, 255, 255, .15); }
.hg-card .perks li.on { color: #fff; }
.hg-card .perks li.on em { border-color: var(--rc); color: var(--rc); }

/* 4.2 : une seule barre de modes sur ordinateur (les boutons carrés restent sur mobile) */
@media (min-width: 861px) and (pointer: fine) {
  .fh-menu #fhBtnMap, .fh-menu #fhBtnUniverse, .fh-menu #fhBtnEmpire { display: none; }
  .fh-modebar { box-shadow: 0 0 22px rgba(95, 212, 255, .08) inset; }
  .fh-modebar button.active { box-shadow: inset 0 -2px 0 #5fd4ff; text-shadow: 0 0 10px rgba(95, 212, 255, .7); }
}

/* =====================================================================
   4.4 — Fusion immersive : progression Pilote → Empire
   ===================================================================== */
.fh-career { position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: center; margin: -1px 0 7px; padding: 5px 8px 7px; text-align: left; color: var(--se-text); background: rgba(95, 212, 255, .055); border: 1px solid rgba(95, 212, 255, .16); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); cursor: pointer; overflow: hidden; }
.fh-career small { grid-row: 1 / 3; align-self: stretch; display: flex; align-items: center; padding-right: 7px; border-right: 1px solid rgba(95, 212, 255, .15); font-size: 8px; font-weight: 800; letter-spacing: .14em; color: var(--se-cyan); writing-mode: vertical-rl; transform: rotate(180deg); }
.fh-career b { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-career span { display: block; font-size: 9px; color: var(--se-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-career i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--se-cyan), var(--se-gold)); box-shadow: 0 0 8px rgba(95, 212, 255, .65); transition: width .35s ease; }
.fh-career:hover { border-color: rgba(95, 212, 255, .5); background: rgba(95, 212, 255, .1); }

.menu-career { display: grid; gap: 6px; margin-bottom: 12px; }
.menu-career-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid rgba(95, 212, 255, .18); background: rgba(95, 212, 255, .06); }
.menu-career-head div { min-width: 0; }
.menu-career-head small { display: block; font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--se-cyan); }
.menu-career-head b { display: block; color: #fff; font-size: 13px; margin-top: 2px; }
.menu-career-head em { font-style: normal; font-family: var(--se-mono); font-size: 11px; color: var(--se-gold); white-space: nowrap; }
.menu-career-next { padding: 8px 10px; border-left: 2px solid var(--se-gold); background: linear-gradient(90deg, rgba(242, 197, 114, .09), transparent); }
.menu-career-next small { display: block; font-size: 9px; letter-spacing: .12em; color: var(--se-gold); text-transform: uppercase; }
.menu-career-next b { display: block; margin-top: 2px; font-size: 12px; color: var(--se-text); }
.menu-career-list { display: grid; gap: 3px; }
.menu-career-step { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 5px 7px; font-size: 11px; color: var(--se-dim); background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.045); }
.menu-career-step i { font-style: normal; text-align: center; color: rgba(255,255,255,.28); }
.menu-career-step.done { color: #bfead1; border-color: rgba(125,255,179,.11); }
.menu-career-step.done i { color: var(--se-green); }
.menu-career-step.next { color: #fff; border-color: rgba(242,197,114,.28); background: rgba(242,197,114,.06); }
.menu-career-step em { font-style: normal; font-family: var(--se-mono); font-size: 9px; color: var(--se-dim); }

.fh-missions { top: calc(208px + var(--safe-t)); }

@media (max-width: 860px), (pointer: coarse) {
  .fh-career { grid-template-columns: 1fr; margin-bottom: 4px; padding: 3px 6px 5px; }
  .fh-career small, .fh-career span { display: none; }
  .fh-career b { font-size: 8px; letter-spacing: .07em; }
}

@media (min-width: 861px) and (pointer: fine) {
  .fh-menu #fhBtnSystem { display: none; }
}


/* =====================================================================
   4.5 — UNIFIED FLIGHT EXPERIENCE
   ===================================================================== */
.fx-overlay { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: radial-gradient(circle at 50% 45%, rgba(24,58,88,.18), rgba(1,5,12,.52)); }
.fx-window { box-shadow: 0 22px 80px rgba(0,0,0,.62), inset 0 0 40px rgba(95,212,255,.035); }
.hangar { background: linear-gradient(90deg, rgba(2,7,15,.91), rgba(3,12,24,.72) 42%, rgba(3,10,20,.86)), radial-gradient(circle at 30% 45%, rgba(95,212,255,.09), transparent 48%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body.station-minimized::after { content:'AMARRÉ · SERVICES RÉDUITS · E POUR ROUVRIR'; position:fixed; z-index:90; left:50%; bottom:calc(18px + var(--safe-b)); transform:translateX(-50%); padding:7px 12px; color:#bfefff; background:rgba(3,12,24,.88); border:1px solid var(--se-line); font:10px var(--se-mono); letter-spacing:.12em; pointer-events:none; }
body.mode-command.cockpit-behind-command #flightScreen { display:block !important; filter:brightness(.34) saturate(.62); transform:scale(1.015); }
body.mode-command.cockpit-behind-command .game-screen { background:rgba(2,7,17,.86); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
body.mode-command.cockpit-behind-command .command-hud { background:linear-gradient(180deg, rgba(4,13,27,.92), rgba(3,9,19,.74)); }
.fh-flight::after { content:'LMB HOLD · THRUST   RMB · FIRE   F · MINING'; position:absolute; left:50%; top:100%; transform:translate(-50%,8px); white-space:nowrap; font:9px var(--se-mono); letter-spacing:.11em; color:rgba(180,220,245,.5); }
@media (max-width:860px),(pointer:coarse){ .fh-flight::after{display:none} }
