/* Les étincelles du MoHo — habillage NØDE : bleu nuit, corail du Ø, Manrope pour les titres,
   Inter pour le texte (polices hébergées ici), filets fins, aucun dégradé. Univers sombre assumé :
   bandeaux de cinéma pendant les séquences, HUD discret aux quatre coins pendant le jeu. */
  @font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
    src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2'); }
  @font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2'); }
  :root {
    --ink: #0e1b2c; --beton: #1b2a3e; --beton-clair: #9aa6b5; --papier: #f4f6f8;
    --corten: #b23434; --corten-vif: #e56e6e; --verre: #9fd3e0;
    --f-titre: 'Manrope', system-ui, sans-serif;
    --f-texte: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --f-chiffre: 'Inter', system-ui, sans-serif;
    color-scheme: dark;
  }
  [hidden] { display: none !important; }
  html, body { height: 100%; }
  body { margin: 0; overflow: hidden; background: var(--ink); color: var(--papier); font: 15px/1.5 var(--f-texte); }
  canvas#gl { display: block; position: fixed; inset: 0; }
  button, a.bouton { font: 600 14px var(--f-texte); text-decoration: none; display: inline-block; color: var(--papier); background: rgba(18,19,21,.72); border: 1px solid rgba(243,239,232,.25);
           border-radius: 999px; padding: 8px 16px; cursor: pointer; }
  button:hover, a.bouton:hover { border-color: var(--corten-vif); }
  button:focus-visible, a:focus-visible { outline: 2px solid var(--corten-vif); outline-offset: 2px; }
  .plein { background: var(--corten); border-color: var(--corten); color: #fff; font-size: 16px; padding: 12px 26px; }
  .plein:hover { background: var(--corten-vif); border-color: var(--corten-vif); }
  kbd { font: 500 12px var(--f-chiffre); border: 1px solid rgba(243,239,232,.35); border-radius: 4px; padding: 0 5px; }
  .ecran { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30;
           padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
           background: rgba(14,27,44,.72); }
  .carte { max-width: 640px; width: 100%; display: grid; gap: 14px; }
  .surtitre { font: 700 12px var(--f-texte); letter-spacing: .18em; text-transform: uppercase; color: var(--corten-vif); }
  h1 { font: 600 clamp(44px, 9vw, 96px)/.95 var(--f-titre); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
  h1 span { color: var(--corten-vif); }
  h2 { font: 700 clamp(28px, 6vw, 44px)/1 var(--f-titre); margin: 0; text-transform: uppercase; text-wrap: balance; }
  .lead { font-size: 17px; max-width: 58ch; color: #e2ddd4; margin: 0; }
  .note { font-size: 12px; color: var(--beton-clair); max-width: 62ch; margin: 0; }
  .ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .touches { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: #d8d3ca; }
  #barre { position: fixed; left: 0; right: 0; top: 0; height: 0; background: #000; z-index: 20; transition: height .6s ease; }
  #barre2 { position: fixed; left: 0; right: 0; bottom: 0; height: 0; background: #000; z-index: 20; transition: height .6s ease; }
  body.cine #barre, body.cine #barre2 { height: 11vh; }
  body.cine .hud { opacity: 0; pointer-events: none; }
  #legende { position: fixed; left: 0; right: 0; bottom: calc(11vh + 18px); z-index: 21; text-align: center; pointer-events: none;
             padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  #legende .t { font: 600 clamp(26px, 5vw, 44px)/1.05 var(--f-titre); text-shadow: 0 2px 18px rgba(0,0,0,.7); }
  #legende .s { font-size: 16px; max-width: 60ch; margin: 8px auto 0; text-shadow: 0 1px 10px rgba(0,0,0,.9); }
  #legende .t, #legende .s { opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
  #legende.on .t, #legende.on .s { opacity: 1; transform: none; }
  #passer { position: fixed; z-index: 22; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(11vh + 12px); display: none; }
  body.cine #passer { display: block; }
  #fondu { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 25; transition: opacity .45s; }
  .hud { transition: opacity .4s; }
  #score { position: fixed; z-index: 10; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); }
  #score .n { font: 600 34px/1 var(--f-titre); }
  #score .n b { color: var(--corten-vif); }
  #pips { display: flex; gap: 5px; margin-top: 6px; }
  #pips i { width: 14px; height: 14px; transform: rotate(45deg) scale(.7); border: 1.5px solid var(--corten-vif); }
  #pips i.ok { background: var(--corten-vif); box-shadow: 0 0 10px var(--corten-vif); }
  #chrono { font-variant-numeric: tabular-nums; position: fixed; z-index: 10; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
            font: 500 22px var(--f-chiffre); font-variant-numeric: tabular-nums; background: rgba(18,19,21,.6); padding: 4px 14px; border-radius: 8px; }
  #outils { position: fixed; z-index: 10; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
            display: flex; gap: 8px; }
  #carte { position: fixed; z-index: 10; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
           background: rgba(18,19,21,.7); border-radius: 10px; padding: 6px; }
  #carte canvas { display: block; width: 200px; }
  #invite { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(26px + env(safe-area-inset-bottom, 0px));
            background: rgba(18,19,21,.78); border: 1px solid var(--corten); border-radius: 10px; padding: 8px 14px; text-align: center; }
  #invite .ligne { justify-content: center; margin-top: 6px; }
  #boussole { position: fixed; z-index: 10; left: 50%; top: 70px; transform: translateX(-50%); text-align: center; font-size: 13px; }
  #boussole .fl { font: 700 34px/1 var(--f-texte); color: var(--corten-vif); display: inline-block; transition: transform .1s; }
  #viseur { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(243,239,232,.85);
            box-shadow: 0 0 3px #000; z-index: 9; pointer-events: none; }
  #pad { position: fixed; z-index: 10; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
         display: none; grid-template-columns: repeat(3, 52px); gap: 6px; }
  #pad button { padding: 0; height: 48px; border-radius: 10px; font-size: 18px; }
  #aide { position: fixed; z-index: 10; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
          font-size: 12px; color: #cfc9bf; background: rgba(18,19,21,.6); padding: 6px 10px; border-radius: 8px; max-width: 46ch; }
  #charge { font: 500 13px var(--f-chiffre); color: var(--beton-clair); }
  .temps { font-variant-numeric: tabular-nums; font: 600 clamp(56px, 12vw, 96px)/1 var(--f-titre); color: var(--corten-vif); }
  .pitch { border-left: 3px solid var(--corten); padding-left: 14px; display: grid; gap: 6px; }
  .pitch .p { font: 600 26px/1.15 var(--f-titre); }
  .contact { font: 500 14px var(--f-chiffre); user-select: all; background: rgba(243,239,232,.08); padding: 4px 8px; border-radius: 6px; }
  @media (max-width: 640px) { #carte canvas { width: 130px; } #aide { display: none; } #chrono { font-size: 18px; top: calc(60px + env(safe-area-inset-top, 0px)); } }
  @media (prefers-reduced-motion: reduce) { #legende .t, #legende .s, #barre, #barre2, #fondu { transition: none; } }
  a { color: var(--corten-vif); }
  a.marque { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }
  .note a { color: var(--papier); }
