/* Typographies : SSX Display = Jersey 15 (logo, titres, gros boutons) · SSX Label = Chakra Petch 600 (labels, boutons) · SSX Text = Chakra Petch 400 (descriptions, chiffres).
   size-adjust cale leur taille sur l'ancien jeu (Press Start 2P / VT323), donc les tailles en px du reste du CSS restent valables. Hors ligne : tout est embarqué. */
@font-face{ font-family:'SSX Display'; src:url('../assets/fonts/Jersey15.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; size-adjust:185%; }
@font-face{ font-family:'SSX Label'; src:url('../assets/fonts/ChakraPetch-600.woff2') format('woff2'); font-weight:100 900; font-style:normal; font-display:swap; size-adjust:132%; }
@font-face{ font-family:'SSX Text'; src:url('../assets/fonts/ChakraPetch-400.woff2') format('woff2'); font-weight:100 900; font-style:normal; font-display:swap; size-adjust:78%; }

  :root{
    --bg-void: #070a09;
    --bg-void-2: #0c110f;
    --neon-cyan: #ffc21a;
    --neon-magenta: #ff7a2b;
    --neon-amber: #ffd75a;
    --ink: #e8efe9;
    --ink-dim: #7f948a;
    --panel: #0e1412;
    --danger: #ff4438;
  }
  *{ box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
  html,body{
    -webkit-text-size-adjust:100%; text-size-adjust:100%; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
    margin:0; padding:0; width:100%; height:100%; overflow:hidden;
    background:var(--bg-void);
    font-family:'SSX Text', monospace;
    color:var(--ink);
    touch-action:none;
    overscroll-behavior:none;
  }
  #stage{
    position:fixed; inset:0;
    display:flex; align-items:center; justify-content:center;
    background:
      radial-gradient(ellipse at 50% -10%, #12261c 0%, var(--bg-void) 55%),
      var(--bg-void);
  }
  /* Zone de jeu : TOUJOURS 400x700 « logiques », mise à l'échelle d'un bloc (JS : --ui-s, voir src/main.js fitUi) pour tenir dans la fenêtre.
     Le canevas Phaser et tout le HTML (menus, HUD, rapport) sont dans ce même bloc : même proportions, même lisibilité sur téléphone, tablette et PC. */
  #game-container{
    position:relative; flex:none; width:400px; height:700px;
    transform:scale(var(--ui-s, 1)); transform-origin:50% 50%;
    box-shadow: 0 0 0 2px #1b2a23, 0 0 40px 4px rgba(255,194,26,0.15), 0 0 90px 10px rgba(255,122,43,0.08);
    image-rendering: pixelated;
  }
  #game-container canvas{
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display:block;
  }
  .scanlines{
    position:absolute; inset:0; pointer-events:none; z-index:50;
    background: repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0) 0px,
      rgba(0,0,0,0) 1px,
      rgba(0,0,0,0.12) 2px,
      rgba(0,0,0,0.12) 3px
    );
    mix-blend-mode:multiply;
    opacity:0.5;
  }
  .vignette{
    position:absolute; inset:0; pointer-events:none; z-index:51;
    box-shadow: inset 0 0 60px 18px rgba(0,0,0,0.65);
  }

  /* ---------- HUD ---------- */
  #hud{
    position:absolute; top:0; left:0; right:0; z-index:20;
    padding:10px 12px 0 12px;
    display:flex; flex-direction:column; gap:6px;
    pointer-events:none;
    font-family:'SSX Label', monospace;
  }
  #hud-top{ display:flex; justify-content:space-between; align-items:flex-start; }
  .mute-btn{
    pointer-events:auto; background:rgba(14,20,17,0.7); border:2px solid #28362f; color:var(--ink);
    font-size:14px; padding:5px 8px; cursor:pointer; align-self:flex-start;
  }
  .hp-wrap{ display:flex; flex-direction:column; gap:4px; }
  .hp-label{ font-size:8px; color:var(--ink-dim); letter-spacing:1px; }
  #achvToast{ position:absolute; top:92px; left:50%; transform:translate(-50%,-14px); z-index:45; opacity:0; pointer-events:none;
    transition:opacity .3s, transform .3s; background:rgba(14,12,34,.94); border:2px solid #ffd76a; padding:8px 14px; text-align:center;
    box-shadow:0 0 18px rgba(255,215,106,.35); max-width:86%; }
  #achvToast.show{ opacity:1; transform:translate(-50%,0); }
  #gameNotice{ position:absolute; top:128px; left:50%; transform:translate(-50%,-8px); z-index:44; opacity:0; pointer-events:none; text-align:center; transition:opacity .35s, transform .35s; max-width:90%; text-shadow:0 0 6px #000, 0 2px 0 #000, 0 0 14px rgba(0,0,0,.9); }
  #gameNotice.show{ opacity:1; transform:translate(-50%,0); }
  #gameNotice .gn-name{ font-family:'SSX Label',monospace; font-size:11px; color:#fff; }
  #gameNotice .gn-desc{ font-family:'SSX Text',monospace; font-size:17px; color:#9fe8ff; margin-top:3px; }
  #gameNotice.alert .gn-name{ color:#ff9a6a; }
  #achvToast .at-title{ font-family:'SSX Label',monospace; font-size:8px; color:#ffd76a; }
  #achvToast .at-name{ font-family:'SSX Label',monospace; font-size:11px; color:#fff; margin:5px 0 3px; }
  #achvToast .at-desc{ font-family:'SSX Text',monospace; font-size:17px; color:#9fe8ff; }
  input, textarea{ font-size:16px !important; -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; }        /* en dessous de 16px, iOS zoome la page quand on touche le champ */
  #saveBox{ width:100%; max-width:320px; height:84px; background:rgba(6,9,8,.85); border:2px solid #28362f; color:#d9e3dc; font-family:'SSX Text',monospace; font-size:14px; padding:6px; resize:none; }
  #saveBox.hidden, #btnImportOk.hidden{ display:none; }
  .cdx-row{ display:flex; gap:10px; align-items:center; padding:7px 9px; border:1px solid #28362f; background:var(--panel); }
  .cdx-row .ci{ width:34px; flex:none; text-align:center; }
  .cdx-row .cm{ flex:1; min-width:0; }
  .cdx-row .cn{ font-family:'SSX Label',monospace; font-size:8px; color:#d9e3dc; }
  .cdx-row .cd{ font-family:'SSX Text',monospace; font-size:14px; color:#8aa196; line-height:1.05; margin-top:2px; }
  .cdx-row.got{ border-color:#3a3566; }
  .cdx-row.locked{ opacity:.36; filter:grayscale(1); }
  .cdx-sub{ font-family:'SSX Label',monospace; font-size:8px; color:#9db0a4; margin:8px 0 0; }
  .pact-row{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; text-align:left; cursor:pointer; color:#d9e3dc;
    border:1px solid #28362f; background:var(--panel); }
  .pact-row.on{ border-color:#ff7088; background:rgba(255,60,90,.14); box-shadow:0 0 10px rgba(255,80,110,.35); }
  .pact-row .pi{ font-size:24px; flex:none; width:34px; text-align:center; }
  .pact-row .pm{ flex:1; min-width:0; }
  .pact-row .pn{ font-family:'SSX Label',monospace; font-size:9px; }
  .pact-row .pd{ font-family:'SSX Text',monospace; font-size:15px; color:#8aa196; line-height:1.05; margin-top:3px; }
  .pact-row .pb{ flex:none; font-family:'SSX Label',monospace; font-size:9px; color:#ffd76a; }
  .ach-sec{ font-family:'SSX Label',monospace; font-size:9px; color:#ffd76a; margin:10px 0 2px; }
  .ach-row{ display:flex; gap:10px; align-items:center; padding:7px 9px; border:1px solid #28362f; background:var(--panel); }
  .ach-row.done{ border-color:#ffd76a; }
  .ach-row img{ width:34px; height:34px; image-rendering:pixelated; object-fit:contain; flex:none; }
  .ach-main{ flex:1; min-width:0; }
  .ach-name{ font-family:'SSX Label',monospace; font-size:8px; color:#d9e3dc; }
  .ach-desc{ font-family:'SSX Text',monospace; font-size:13px; color:#8aa196; line-height:1.05; margin-top:2px; }
  .ach-bar{ height:5px; background:#111a16; margin-top:4px; }
  .ach-bar > i{ display:block; height:100%; background:#38c6ff; }
  .ach-pips{ flex:none; color:#ffd76a; font-size:14px; letter-spacing:2px; }
  @keyframes odPulse{ from{ filter:brightness(1); } to{ filter:brightness(1.9); } }
  #relicRow{ margin:2px 12px 0; font-size:15px; letter-spacing:2px; min-height:16px; }
  /* bouton OVERDRIVE: petit, transparent, il se remplit (anneau) et s'active quand il est plein */
  #odBtn{ position:absolute; right:14px; bottom:18px; z-index:29; width:46px; height:46px; border-radius:50%; display:none; cursor:default; touch-action:none; padding:0;
    border:0; color:rgba(255,230,160,.9); font-family:'SSX Label',monospace; font-size:9px; opacity:.5; --deg:0deg;
    background:conic-gradient(rgba(255,215,106,.9) var(--deg), rgba(255,215,106,.16) 0); transition:opacity .25s, transform .15s; }
  #odBtn::before{ content:''; position:absolute; inset:4px; border-radius:50%; background:rgba(8,12,10,.72); }
  #odBtn > span{ position:relative; z-index:1; }
  #odBtn.show{ display:block; pointer-events:none; }      /* tant qu'il n'est pas plein, il laisse passer les touches (pilotage) */
  #odBtn.ready{ pointer-events:auto; }
  #levelup:not(.hidden) ~ #odBtn, #pauseMenu:not(.hidden) ~ #odBtn{ z-index:60; }           /* visible et utilisable par-dessus les menus (amélioration, pause) */
  #odBtn.queued{ outline:3px solid #fff; outline-offset:2px; }
  #odBtn.ready{ opacity:.95; cursor:pointer; animation:odPulse .55s infinite alternate; box-shadow:0 0 14px rgba(255,215,106,.7); }
  #odBtn.active{ opacity:.9; background:conic-gradient(rgba(255,255,255,.95) var(--deg), rgba(255,215,106,.18) 0); }
  .card.fusion{ border-color:#ffd76a; box-shadow:0 0 14px rgba(255,215,106,.55); }
  #styleHud{ position:absolute; top:104px; right:10px; z-index:26; pointer-events:none; display:flex; align-items:center; gap:8px; padding:5px 9px;
    background:rgba(8,12,10,.62); border:2px solid #9db0a4; opacity:0; transform:translateX(18px); transition:opacity .2s, transform .2s; }
  #styleHud.show{ opacity:1; transform:translateX(0); }
  #styleRank{ font-family:'SSX Label',monospace; font-size:26px; line-height:1; text-shadow:2px 2px 0 #000; min-width:46px; text-align:center; }
  #styleRank.bump{ animation:rankBump .45s ease-out; }
  @keyframes rankBump{ 0%{ transform:scale(1.9); filter:brightness(2); } 100%{ transform:scale(1); filter:brightness(1); } }
  #styleInfo{ min-width:92px; }
  #styleName{ font-family:'SSX Label',monospace; font-size:7px; color:#d9e3dc; }
  #styleXp{ font-family:'SSX Label',monospace; font-size:8px; margin:1px 0 3px; }
  #styleCount{ font-family:'SSX Text',monospace; font-size:16px; color:#ffd76a; line-height:1.05; margin:2px 0 3px; }
  .style-track{ height:4px; background:rgba(255,255,255,.12); }
  .style-track > i{ display:block; height:100%; width:100%; background:linear-gradient(90deg,#ff7088,#ffd76a); }
  #comboTxt{ position:absolute; top:30%; left:50%; transform:translateX(-50%); z-index:28; pointer-events:none; opacity:0; white-space:nowrap;
    font-family:'SSX Label',monospace; font-size:22px; text-shadow:3px 3px 0 #000, -2px -2px 0 #000, 0 0 16px currentColor; }
  #comboTxt.pop{ animation:comboPop .9s ease-out forwards; }
  @keyframes comboPop{ 0%{ opacity:1; transform:translateX(-50%) scale(1.5); } 12%{ opacity:1; transform:translateX(-50%) scale(1); } 75%{ opacity:1; } 100%{ opacity:0; transform:translateX(-50%) scale(0.95); } }
  #redVig{ position:absolute; inset:0; z-index:27; pointer-events:none; opacity:0;
    background:radial-gradient(ellipse at center, rgba(255,0,40,0) 45%, rgba(255,0,40,0.55) 100%); }
  #redVig.show{ animation:redVig 1.6s ease-out forwards; }
  @keyframes redVig{ 0%{opacity:1;} 30%{opacity:.35;} 45%{opacity:.9;} 100%{opacity:0;} }
  #gameover.fadein{ animation:goFade .7s ease-out; }
  #gameover > *{ animation:none !important; }      /* l'entrée des éléments est jouée par GSAP (Motion.result) */
  @keyframes goFade{ from{ opacity:0; } to{ opacity:1; } }
  .go-extra{ font-family:'SSX Text',monospace; font-size:17px; color:#a9bbb0; text-align:center; line-height:1.15; margin:6px 0 8px; }
  .go-extra .go-boss{ color:#ff7088; } .go-extra .go-near{ color:#ffd76a; }
  .go-name{ display:flex; align-items:center; gap:8px; margin:6px 0 12px; font-family:'SSX Label',monospace; font-size:10px; color:var(--neon-cyan); }
  .go-name input{ width:150px; background:rgba(6,9,8,.8); border:2px solid var(--neon-cyan); color:#fff; font-family:'SSX Label',monospace;
    font-size:11px; padding:8px; text-transform:uppercase; outline:none; text-align:center; }
  .lb-row{ display:flex; align-items:center; gap:8px; padding:7px 10px; border:1px solid rgba(120,140,255,.25); background:rgba(10,12,30,.6);
    font-family:'SSX Text',monospace; font-size:19px; color:#d9e3dc; width:100%; box-sizing:border-box; }
  .lb-row.me{ border-color:var(--neon-cyan); box-shadow:0 0 8px rgba(56,198,255,.35); }
  .lb-rank{ width:26px; color:#ffd76a; font-family:'SSX Label',monospace; font-size:10px; }
  .lb-name{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-transform:uppercase; }
  .lb-meta{ color:#7f9a8c; font-size:15px; }
  .lb-score{ color:#ffd76a; min-width:60px; text-align:right; }
  @keyframes hudShake {
    0%{transform:translate(0,0)} 15%{transform:translate(-3px,1px)} 30%{transform:translate(3px,-1px)}
    45%{transform:translate(-2px,1px)} 60%{transform:translate(2px,0)} 80%{transform:translate(-1px,0)} 100%{transform:translate(0,0)}
  }
  .hud-shake{ animation:hudShake .3s linear; }
  .hud-shake-strong{ animation:hudShake .5s linear; filter:brightness(1.7); }
  .hp-bar-track{
    width:130px; height:12px; background:#0f1613; border:2px solid #28362f;
    position:relative; overflow:hidden;
  }
  .hp-bar-fill{
    height:100%; width:100%;
    background: linear-gradient(90deg, var(--neon-magenta), var(--danger));
    transition: width 0.18s steps(8);
  }
  .hp-bar-ghost{ position:absolute; left:0; top:0; height:100%; width:100%; background:#fff; opacity:.6; }
  .hp-bar-fill{ position:relative; }
  .hp-low .hp-bar-fill{ animation:hpLow .55s ease-in-out infinite alternate; }
  @keyframes hpLow{ from{ filter:brightness(1); } to{ filter:brightness(1.9) saturate(1.4); } }
  .score-val{ display:inline-block; transform-origin:right center; }
  .shield-bar-track{
    width:130px; height:7px; background:#0f1613; border:2px solid #17324a;
    position:relative; overflow:hidden; margin-top:3px;
  }
  .shield-bar-fill{
    height:100%; width:0%;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px rgba(255,194,26,0.7);
    transition: width 0.15s;
  }
  .score-wrap{ text-align:right; }
  .score-label{ font-size:8px; color:var(--ink-dim); }
  .score-val{ font-size:14px; color:var(--neon-amber); text-shadow:0 0 6px rgba(255,206,74,0.6); }

  .xp-wrap{ display:flex; align-items:center; gap:8px; }
  .lvl-badge{
    font-size:9px; color:var(--bg-void); background:var(--neon-cyan);
    padding:3px 6px; text-shadow:none; flex:0 0 auto;
  }
  .xp-track{
    flex:1; height:8px; background:#0f1613; border:2px solid #28362f; position:relative; overflow:hidden;
  }
  .xp-fill{ height:100%; width:0%; background: var(--neon-cyan); transition: width 0.2s; }

  .wave-note{
    align-self:center; font-size:10px; color:var(--ink); letter-spacing:1px;
    background:rgba(6,9,8,0.55); padding:4px 10px; border:1px solid #28362f;
  }

  /* ---------- Overlays ---------- */
  .overlay{
    position:absolute; inset:0; z-index:40;
    background: rgba(6,9,8,0.86);
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    text-align:center; padding:24px;
    font-family:'SSX Label', monospace;
  }
  .hidden{ display:none !important; }

  .title-logo{
    font-size:28px; line-height:1.4; color:var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan), 0 0 22px rgba(255,194,26,0.5);
    margin-bottom:4px;
  }
  .title-logo span{ color:var(--neon-magenta); text-shadow:0 0 8px var(--neon-magenta), 0 0 22px rgba(255,122,43,0.5); }
  .subtitle{ font-family:'SSX Text', monospace; font-size:20px; color:var(--ink-dim); margin-bottom:28px; }

  .btn{
    font-family:'SSX Label', monospace;
    background:var(--neon-cyan); color:#04121a;
    border:none; padding:14px 22px; font-size:13px;
    box-shadow: 0 4px 0 #1a7a86, 0 0 18px rgba(255,194,26,0.35);
    cursor:pointer; pointer-events:auto;
    letter-spacing:1px;
  }
  .btn:active{ transform:translateY(3px); box-shadow:0 1px 0 #1a7a86; }
  .btn.secondary{
    background:transparent; color:var(--ink-dim); box-shadow:none; border:2px solid #28362f;
    margin-top:14px; font-size:10px; padding:10px 16px;
  }

  /* barres de volume */
  #settingsMenu{ overflow-y:auto; justify-content:flex-start; }
  #settingsMenu > :first-child{ margin-top:auto; } #settingsMenu > :last-child{ margin-bottom:auto; }
  .vol-row{ display:flex; align-items:center; gap:8px; width:100%; max-width:320px; margin:5px 0; font-size:10px; color:var(--ink-dim); }
  .vol-row label{ flex:0 0 76px; text-align:left; letter-spacing:1px; }
  .vol-row span{ flex:0 0 32px; text-align:right; font-family:'SSX Text', monospace; font-size:20px; color:var(--neon-cyan); }
  .vol-row input[type=range]{ -webkit-appearance:none; appearance:none; flex:1; height:22px; margin:0; background:transparent; --p:100%; touch-action:pan-y; pointer-events:auto; cursor:pointer; }
  .vol-row input[type=range]::-webkit-slider-runnable-track{ height:10px; border:2px solid #3b5046; background:linear-gradient(to right, var(--neon-cyan) var(--p), #101815 var(--p)); }
  .vol-row input[type=range]::-moz-range-track{ height:6px; border:2px solid #3b5046; background:linear-gradient(to right, var(--neon-cyan) var(--p), #101815 var(--p)); }
  .vol-row input[type=range]::-webkit-slider-thumb{ -webkit-appearance:none; width:16px; height:22px; margin-top:-8px; background:#ffe14a; border:2px solid #7a5c00; border-radius:0; box-shadow:0 0 8px rgba(255,225,74,.6); }
  .vol-row input[type=range]::-moz-range-thumb{ width:12px; height:18px; background:#ffe14a; border:2px solid #7a5c00; border-radius:0; }

  .hi-row{ font-family:'SSX Text', monospace; font-size:18px; color:var(--neon-amber); margin-bottom:8px; }
  .frag-row{ font-family:'SSX Text', monospace; font-size:18px; color:var(--neon-cyan); margin-bottom:18px; }

  #pauseGear{ width:100%; max-width:340px; border:1px solid #2b3550; background:rgba(8,10,24,.78); padding:6px 8px 6px; margin:0 0 8px; font-family:'SSX Text',monospace; }
  #pauseGear .pg-head{ display:flex; justify-content:space-between; font-size:15px; color:#8aa196; letter-spacing:1px; margin-bottom:5px; }
  #pgGrid{ display:grid; grid-template-columns:repeat(6,1fr); gap:5px; min-height:46px; }
  #pgGrid .pg-it{ position:relative; aspect-ratio:1; border:1px solid #2b3550; background:#0e1524; display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0; }
  #pgGrid .pg-it.sel{ border-color:#ffd76a; box-shadow:0 0 6px rgba(255,215,106,.6); }
  #pgGrid .pg-it.rel{ border-color:#ffc21a; }
  #pgGrid .pg-it b{ position:absolute; right:1px; bottom:0; font-size:12px; color:#ffd76a; text-shadow:0 0 2px #000; }
  #pgDetail{ margin-top:6px; min-height:42px; font-size:16px; color:#d9e3dc; line-height:1.05; }
  #pgDetail em{ color:#ffd76a; font-style:normal; }
  #pauseGear .pg-nav{ display:flex; gap:6px; margin-top:4px; }
  #pauseGear .pg-nav .btn{ flex:1; padding:3px 0; font-size:14px; min-width:0; margin:0; }
  .tree-overlay{ justify-content:flex-start; align-items:stretch; padding:10px; text-align:left; }
  .tree-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; pointer-events:auto; }
  .tree-header .frag-row{ margin:0; font-size:16px; }
  .btn.small{ padding:8px 12px; font-size:9px; margin:0; }

  .info-list{ flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:6px; pointer-events:auto; }
  .stat-row{
    display:flex; justify-content:space-between; align-items:center; background:var(--panel);
    border:1px solid #28362f; padding:9px 12px; font-family:'SSX Text',monospace; font-size:16px; color:var(--ink-dim);
  }
  .stat-row b{ color:var(--neon-cyan); font-family:'SSX Label'; font-size:11px; }
  .bestiary-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; align-content:start; }
  .bestiary-cell{ background:var(--panel); border:1px solid #28362f; padding:8px 4px; text-align:center; }
  .bestiary-cell img{ width:46px; height:46px; object-fit:contain; image-rendering:pixelated; display:block; margin:0 auto 6px; }
  .bestiary-name{ font-family:'SSX Label'; font-size:7px; color:var(--ink); line-height:1.4; }
  .bestiary-count{ font-family:'SSX Text',monospace; font-size:15px; color:var(--neon-amber); margin-top:3px; }
  .bestiary-count.zero{ color:var(--ink-dim); }

  .controls-hint{ font-family:'SSX Text', monospace; font-size:16px; color:var(--ink-dim); max-width:260px; margin-top:22px; line-height:1.5; }

  /* level up cards */
  #levelup .lu-title{ font-size:16px; color:var(--neon-amber); text-shadow:0 0 10px rgba(255,206,74,0.5); margin-bottom:22px; }
  .cards{ display:flex; gap:12px; pointer-events:auto; flex-wrap:wrap; justify-content:center; }
  .cards.many .card{ width:112px; padding:10px 6px; }
  .cards.many .card-name{ font-size:8px; }
  .cards.many .card-desc{ font-size:14px; }
  .card{
    width:150px; background:var(--panel); border:2px solid #28362f;
    padding:14px 10px; cursor:pointer; text-align:left;
    transition: border-color .12s, transform .12s;
  }
  .card:active{ transform:scale(0.96); }
  .card:hover{ border-color:var(--neon-cyan); }
  .card-icon{ font-size:22px; margin-bottom:10px; }
  .card-name{ font-family:'SSX Label'; font-size:10px; color:var(--ink); line-height:1.5; margin-bottom:8px; }
  .card-desc{ font-family:'SSX Text'; font-size:15px; color:var(--ink-dim); line-height:1.3; }

  #gameover .go-title{ font-size:22px; color:var(--danger); text-shadow:0 0 10px rgba(255,79,109,0.6); margin-bottom:18px; }
  .go-stats{ font-family:'SSX Text'; font-size:19px; line-height:1.7; margin-bottom:10px; }
  .go-stats b{ color:var(--neon-amber); }
  .new-best{ font-family:'SSX Text'; font-size:18px; color:var(--neon-cyan); margin-bottom:18px; }
  #gameover.win{ --accent:#7bff9a; --accent-dim:rgba(123,255,154,.16); }
  #gameover.win .go-title{ color:#7bff9a; text-shadow:0 0 10px rgba(123,255,154,0.55); }
  #gameover .go-title{ margin-bottom:8px; }
  .go-level{ font-family:'SSX Text'; font-size:20px; color:var(--ink-dim); margin-bottom:8px; letter-spacing:1px; }
  .go-prog{ display:flex; align-items:center; gap:8px; width:100%; max-width:280px; margin:0 0 10px; font-family:'SSX Text'; font-size:19px; color:var(--ink-dim); }
  .go-prog-bar{ flex:1; height:8px; background:#111a16; border:1px solid #28362f; }
  .go-prog-bar > i{ display:block; height:100%; width:0; background:var(--accent); box-shadow:0 0 8px var(--accent-dim); }
  .go-rewards{ width:100%; max-width:280px; margin:2px 0 6px; font-family:'SSX Text'; font-size:19px; }
  .go-rw{ display:flex; justify-content:space-between; padding:1px 0; color:var(--ink-dim); }
  .go-rw b{ color:var(--neon-cyan); font-weight:normal; }
  .go-rw.total{ border-top:1px solid #28362f; margin-top:3px; padding-top:3px; color:var(--ink); } .go-rw.total b{ color:var(--neon-amber); }
  .go-unlock{ margin-top:6px; color:#ffd76a; text-align:center; text-shadow:0 0 8px rgba(255,215,106,.45); }

  #boss-banner{
    position:absolute; top:34%; left:8%; right:8%; z-index:30;
    text-align:center; pointer-events:none;
    font-family:'SSX Label'; font-size:17px; line-height:1.6; color:#fff;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 18px rgba(255,79,109,0.9);
    background:rgba(30,4,10,0.55); border:2px solid var(--danger); padding:14px 8px;
    opacity:0; transition:opacity .3s; transform:scale(0.9);
  }
  #boss-banner.show{ opacity:1; transform:scale(1); }

  #boss-hp-wrap{
    position:absolute; top:44px; left:14px; right:14px; z-index:20;
    display:flex; flex-direction:column; align-items:center; gap:3px; opacity:0; transition:opacity .3s;
    pointer-events:none;
  }
  #boss-hp-wrap.show{ opacity:1; }
  #boss-hp-wrap2{
    position:absolute; top:44px; left:14px; right:14px; z-index:20;
    display:flex; flex-direction:column; align-items:center; gap:3px; opacity:0; transition:opacity .3s;
    pointer-events:none;
  }
  #boss-hp-wrap2.show{ opacity:1; }
  #boss-hp-wrap3{ position:absolute; top:44px; left:14px; right:14px; z-index:20; display:flex; flex-direction:column; align-items:center; gap:3px; opacity:0; transition:opacity .3s; pointer-events:none; }
  #boss-hp-wrap3.show{ opacity:1; }
  .boss-hp-label{
    font-family:'SSX Label'; font-size:9px; color:#fff; letter-spacing:1px;
    text-shadow:1px 1px 0 #000, -1px -1px 0 #000;
    background:rgba(30,4,10,0.65); padding:3px 8px; border:1px solid var(--danger);
  }
  .boss-hp-track{ width:100%; height:11px; background:#0f1613; border:2px solid #3a1420; }
  .boss-hp-fill{ height:100%; width:100%; background:linear-gradient(90deg,#ff4f6d,#ff9a4f); transition:width .15s; }
  .boss-hp-fill.p2{ background:linear-gradient(90deg,#ff8a2a,#ffd24a); }
  .boss-hp-fill.p3{ background:linear-gradient(90deg,#ff1f45,#ff6a2a); animation:bossP3 .45s ease-in-out infinite alternate; }
  @keyframes bossP3{ from{ filter:brightness(1); } to{ filter:brightness(1.6); } }
  .boss-hp-track{ position:relative; }
  .boss-sh-track{ display:none; width:100%; height:6px; margin-top:2px; background:#07202c; border:1px solid #1d5a73; }
  .boss-sh-fill{ height:100%; width:100%; background:linear-gradient(90deg,#3ad0ff,#b8f2ff); transition:width .12s; }
  .boss-sh-fill.wait{ background:linear-gradient(90deg,#d99a3a,#ffd9a0); }
  .boss-tick{ position:absolute; top:-3px; bottom:-3px; width:2px; background:#fff; opacity:.75; pointer-events:none; }

  /* ---------- INTERFACE ALLEGEE (actuel nettoyé + minimaliste) ---------- */
  .hp-label, .score-label{ display:none; }
  #hud{ padding-top:9px; gap:5px; }
  .hp-bar-track{ height:10px; width:140px; }
  .shield-bar-track{ height:6px; width:140px; margin-top:2px; }
  .score-val{ font-size:13px; }
  .mute-btn{ padding:4px 7px; font-size:12px; }
  .xp-track{ height:6px; }
  .lvl-badge{ font-size:8px; padding:2px 5px; }
  .wave-note{ background:none; border:0; font-size:8px; color:#9db0a4; padding:0; }
  #relicRow{ position:absolute; top:30px; right:12px; margin:0; letter-spacing:1px; min-height:0; }
  #boss-hp-wrap{ top:98px; left:44px; right:44px; }
  #boss-hp-wrap2{ top:142px; left:44px; right:44px; }
  #boss-hp-wrap3{ top:186px; left:44px; right:44px; }
  #boss-hp-wrap, #boss-hp-wrap2, #boss-hp-wrap3{ gap:1px; }
  .boss-hp-label{ padding:1px 6px; }
  .boss-sh-track{ height:4px; margin-top:1px; }
  .boss-hp-label{ font-size:8px; }
  .boss-hp-track{ height:8px; }
  #styleHud{ top:134px; right:12px; padding:3px 8px; background:rgba(14,20,17,.6); border-width:1px; }
  #styleName{ display:none; }
  #styleRank{ font-size:18px; min-width:26px; }
  #styleCount{ font-size:14px; }
  .lu-title{ font-size:12px; }
  .uii{ image-rendering:pixelated; image-rendering:crisp-edges; display:inline-block; vertical-align:-2px; flex:none; pointer-events:none; }      /* icônes d'interface en pixel art (ui/ui-icons.js) */
  .mute-btn .uii, .home-ico .uii, .map-arrow .uii, .btn .uii, .nd-badge .uii{ vertical-align:middle; }
  .pxi{ image-rendering:pixelated; image-rendering:crisp-edges; display:inline-block; vertical-align:middle; }
  .card-icon{ height:34px; display:flex; align-items:center; }

  /* ================= STYLE COHERENT DES MENUS =================
     Une seule signature pour tous les écrans: cadre à coins, fond à grille qui dérive, boutons biseautés avec reflet,
     lignes/cartes à liseré d'accent, et entrée animée (fondu + glissement + cascade) à chaque ouverture. */
  :root{ --accent:#ffc21a; --accent-dim:rgba(255,194,26,.16); }
  #gameover{ --accent:#ff4f6d; --accent-dim:rgba(255,79,109,.16); }
  #levelup{ --accent:#ffd76a; --accent-dim:rgba(255,215,106,.16); }
  #pauseMenu, #settingsMenu{ z-index:42; }
  #pauseMenu, #settingsMenu{ --accent:#9aa8ff; --accent-dim:rgba(154,168,255,.15); }
  #pageTree, #pactsPage, #codexPage{ --accent:#ffc21a; --accent-dim:rgba(255,194,26,.15); }
  .overlay{
    background:
      radial-gradient(ellipse at 50% -5%, rgba(22,40,32,.92) 0%, rgba(6,10,8,.94) 62%),
      rgba(6,9,8,.9);
    overflow:hidden;
    animation: menuFade .26s ease-out backwards;
  }
  .overlay::before{                                    /* cadre: quatre coins lumineux */
    content:''; position:absolute; inset:7px; pointer-events:none; z-index:-1; opacity:.55;
    --c:var(--accent); --L:18px; --T:2px;
    background:
      linear-gradient(var(--c),var(--c)) top left/var(--L) var(--T) no-repeat, linear-gradient(var(--c),var(--c)) top left/var(--T) var(--L) no-repeat,
      linear-gradient(var(--c),var(--c)) top right/var(--L) var(--T) no-repeat, linear-gradient(var(--c),var(--c)) top right/var(--T) var(--L) no-repeat,
      linear-gradient(var(--c),var(--c)) bottom left/var(--L) var(--T) no-repeat, linear-gradient(var(--c),var(--c)) bottom left/var(--T) var(--L) no-repeat,
      linear-gradient(var(--c),var(--c)) bottom right/var(--L) var(--T) no-repeat, linear-gradient(var(--c),var(--c)) bottom right/var(--T) var(--L) no-repeat;
    animation: frameIn .5s ease-out backwards;
  }
  .overlay::after{                                     /* grille discrète qui dérive lentement */
    content:''; position:absolute; left:0; right:0; top:-40px; bottom:-40px; pointer-events:none; z-index:-1; opacity:.5;
    background:
      linear-gradient(to right, var(--accent-dim) 1px, transparent 1px) 0 0/40px 40px,
      linear-gradient(to bottom, var(--accent-dim) 1px, transparent 1px) 0 0/40px 40px;
    -webkit-mask-image:radial-gradient(ellipse at 50% 40%, #000 0%, transparent 72%); mask-image:radial-gradient(ellipse at 50% 40%, #000 0%, transparent 72%);
    animation: gridDrift 9s linear infinite;
  }
  .overlay:not(.tree-overlay) > *{ animation: menuItem .34s cubic-bezier(.2,.8,.25,1) backwards; }
  .overlay.tree-overlay > *{ animation: menuFade .3s ease-out backwards; }
  .overlay > *:nth-child(1){ animation-delay:.02s } .overlay > *:nth-child(2){ animation-delay:.06s } .overlay > *:nth-child(3){ animation-delay:.10s }
  .overlay > *:nth-child(4){ animation-delay:.14s } .overlay > *:nth-child(5){ animation-delay:.18s } .overlay > *:nth-child(6){ animation-delay:.22s }
  .overlay > *:nth-child(7){ animation-delay:.26s } .overlay > *:nth-child(8){ animation-delay:.30s } .overlay > *:nth-child(n+9){ animation-delay:.34s }
  @keyframes menuFade{ from{ opacity:0; } to{ opacity:1; } }
  @keyframes menuItem{ from{ opacity:0; transform:translateY(16px) scale(.97); filter:blur(3px); } to{ opacity:1; transform:none; filter:none; } }
  @keyframes frameIn{ from{ opacity:0; inset:22px; } to{ opacity:.55; inset:7px; } }
  @keyframes gridDrift{ from{ transform:translateY(0); } to{ transform:translateY(40px); } }
  @keyframes sheen{ 0%,55%{ left:-70%; } 100%{ left:140%; } }
  @keyframes logoGlow{ from{ filter:brightness(.95); } to{ filter:brightness(1.25); } }
  .title-logo{ animation: logoGlow 2.6s ease-in-out infinite alternate, menuItem .5s cubic-bezier(.2,.8,.25,1) backwards; }

  /* boutons: biseau + reflet; le secondaire garde un liseré d'accent */
  .btn{ position:relative; overflow:hidden; transition: transform .1s, filter .15s; }
  .btn:not(.secondary):not(.small){
    clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);
    background:var(--accent); background:linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, #fff 25%), var(--accent));
    box-shadow:none; border-bottom:4px solid rgba(0,0,0,.35); filter:drop-shadow(0 0 7px var(--accent-dim));
  }
  .btn:not(.secondary):not(.small)::after{
    content:''; position:absolute; top:0; bottom:0; left:-70%; width:35%; pointer-events:none;
    background:linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform:skewX(-20deg); animation:sheen 3.4s ease-in-out infinite;
  }
  .btn:not(.secondary):not(.small):active{ transform:translateY(2px); border-bottom-width:2px; }
  .btn.secondary{
    border:2px solid #28362f; border-left:4px solid var(--accent); background:linear-gradient(90deg, var(--accent-dim), rgba(10,8,24,.55) 55%);
    color:#d9e3dc; letter-spacing:1px;
  }
  .btn.secondary:hover{ border-color:var(--accent); background:linear-gradient(90deg, rgba(255,255,255,.14), var(--accent-dim) 70%); }
  .btn.secondary:active{ transform:translateX(3px); filter:brightness(1.3); }

  /* lignes / cartes: même liseré d'accent à gauche */
  .cdx-row, .ach-row, .pact-row, .card{
    border-left:3px solid var(--accent); background:linear-gradient(90deg, var(--accent-dim), var(--panel) 45%);
  }
  .ach-row.done{ border-left-color:#ffd76a; } .pact-row.on{ border-left-color:#ff7088; }
  .card{ transition: border-color .12s, transform .16s, box-shadow .16s; }
  .card:hover{ box-shadow:0 0 14px var(--accent-dim); transform:translateY(-3px); }
  #levelup .card, #cardsWrap .card{ animation: cardIn .45s cubic-bezier(.2,.9,.3,1.15) backwards; }
  #cardsWrap .card:nth-child(1){ animation-delay:.10s } #cardsWrap .card:nth-child(2){ animation-delay:.2s } #cardsWrap .card:nth-child(3){ animation-delay:.3s }
  #cardsWrap .card:nth-child(4){ animation-delay:.4s } #cardsWrap .card:nth-child(n+5){ animation-delay:.48s }
  @keyframes cardIn{ from{ opacity:0; transform:perspective(500px) rotateY(80deg) translateY(14px); } to{ opacity:1; transform:none; } }
  #pauseGear{ border-color:color-mix(in srgb, var(--accent) 35%, #28362f); box-shadow: inset 0 0 22px var(--accent-dim); }
  .overlay .btn.secondary{ min-width:210px; }
  @media (prefers-reduced-motion: reduce){ .overlay, .overlay::before, .overlay::after, .overlay > *, .btn::after, .title-logo{ animation:none !important; } }


/* ---------- ACCUEIL (scène HomeScene + panneaux HTML) ---------- */
body.at-home #hud, body.at-home #boss-hp-wrap, body.at-home #boss-hp-wrap2, body.at-home #boss-hp-wrap3, body.at-home #boss-banner,
body.at-home #comboTxt, body.at-home #styleHud, body.at-home #odBtn, body.at-home #gameNotice, body.at-home #redVig{ display:none !important; }
#home{ position:absolute; inset:0; z-index:35; pointer-events:none; overflow:hidden; font-family:'SSX Label',monospace; color:var(--ink); animation:menuFade .4s ease-out backwards; }
#home button{ pointer-events:auto; cursor:pointer; font-family:inherit; }
#homeTop{ position:absolute; top:10px; left:12px; right:12px; z-index:3; display:flex; justify-content:space-between; align-items:center; }
.home-frag{ font-family:'SSX Text',monospace; font-size:22px; color:var(--neon-cyan); background:rgba(6,9,8,.55); border:1px solid #28362f; padding:1px 12px; }
.home-ico{ width:40px; height:40px; background:rgba(6,9,8,.55); border:2px solid #28362f; color:#d9e3dc; font-size:20px; padding:0; }
.home-ico:active{ filter:brightness(1.4); }
#homeTrack{ position:absolute; top:0; bottom:58px; left:0; width:300%; display:flex; transform:translateX(-33.3333%); transition:transform .45s cubic-bezier(.65,0,.25,1); }
#homeTrack.p-1{ transform:translateX(0); } #homeTrack.p1{ transform:translateX(-66.6667%); }
.home-page{ width:33.3333%; height:100%; display:flex; flex-direction:column; align-items:center; padding:56px 16px 0; text-align:center; }
.hp-title{ font-size:18px; color:var(--neon-cyan); text-shadow:0 0 10px rgba(255,194,26,.5); margin-top:6px; }

/* carte */
.map-world{ display:flex; align-items:center; justify-content:space-between; width:100%; }
.map-arrow{ width:40px; height:40px; background:rgba(6,9,8,.5); border:2px solid #28362f; color:#d9e3dc; font-size:14px; padding:0; }
.map-arrow:disabled{ opacity:.25; cursor:default; } .map-arrow:not(:disabled):active{ filter:brightness(1.5); }
.mw-n{ font-size:9px; color:var(--ink-dim); letter-spacing:2px; }
.mw-name{ font-size:15px; color:#fff; margin:5px 0 4px; text-shadow:0 0 10px rgba(255,194,26,.45); }
.mw-prog{ font-family:'SSX Text',monospace; font-size:19px; color:var(--neon-amber); }
.map-gap{ flex:1; } .hangar-gap{ flex:0 0 196px; }
.map-arrow.ghost{ visibility:hidden; }
#pageMap{ position:relative; }
#pageMap[data-mode=galaxy] .world-only, #pageMap[data-mode=world] .galaxy-only{ display:none; }
#pageMap.swap > *{ animation:menuFade .45s ease-out backwards; }
#mapOrbit{ position:absolute; left:0; top:0; width:100%; height:calc(100% + 58px); pointer-events:none; }
.node-slot{ position:absolute; transform:translate(-50%,-50%); }
.node{ position:relative; width:42px; height:42px; border-radius:50%; background:rgba(8,12,10,.82); border:2px solid #3b5046; color:var(--ink-dim); font-size:12px; padding:0; transition:transform .15s, box-shadow .2s; }
.node.done{ border-color:#7bff9a; color:#7bff9a; }
.node.open{ border-color:var(--neon-cyan); color:var(--neon-cyan); animation:nodePulse 1.8s ease-in-out infinite; }
.node.locked{ opacity:.5; cursor:default; }
.node.boss{ width:48px; height:48px; border-radius:6px; border-color:#ff4f6d; color:#ff4f6d; transform:rotate(45deg); } .node.boss > span{ display:block; transform:rotate(-45deg); }
.node.boss.locked{ border-color:#5a2a3a; color:#5a2a3a; }
.node.sel{ box-shadow:0 0 0 3px rgba(255,255,255,.28), 0 0 18px var(--neon-cyan); }
.node.pop{ animation:nodePop .7s cubic-bezier(.2,1.4,.3,1) backwards; }
@keyframes nodePop{ 0%{ transform:scale(0); opacity:0; } 60%{ transform:scale(1.35); opacity:1; box-shadow:0 0 26px #fff; } 100%{ transform:scale(1); } }
.node.boss.pop{ animation-name:nodePopBoss; }
@keyframes nodePopBoss{ 0%{ transform:rotate(45deg) scale(0); opacity:0; } 60%{ transform:rotate(45deg) scale(1.35); opacity:1; box-shadow:0 0 26px #fff; } 100%{ transform:rotate(45deg) scale(1); } }
@keyframes nodePulse{ 0%,100%{ box-shadow:0 0 4px rgba(255,194,26,.3); } 50%{ box-shadow:0 0 14px rgba(255,194,26,.8); } }
.level-card{ width:100%; min-height:70px; padding:8px 12px; text-align:left; border:2px solid #28362f; border-left:4px solid var(--neon-cyan); background:linear-gradient(90deg, rgba(255,194,26,.12), rgba(10,8,24,.8) 60%); margin-bottom:10px; }
.lc-name{ font-size:11px; color:#fff; margin-bottom:5px; }
.lc-line{ font-family:'SSX Text',monospace; font-size:18px; color:#c3d2c8; line-height:1.1; }
.lc-line b{ color:var(--neon-amber); font-weight:normal; }
#btnLaunch{ min-width:230px; padding:15px 22px; margin-bottom:12px; } #btnLaunch:disabled{ opacity:.35; filter:grayscale(1); cursor:default; }
.gx-title{ font-size:15px; color:var(--neon-cyan); text-shadow:0 0 10px rgba(255,194,26,.5); margin-top:8px; }
.gx-hint{ position:absolute; left:0; right:0; bottom:66px; font-family:'SSX Text',monospace; font-size:18px; color:var(--ink-dim); }
#btnBackWorld{ position:absolute; left:50%; transform:translateX(-50%); bottom:18px; min-width:200px; margin:0; }
#homeToast{ position:absolute; left:50%; top:112px; transform:translate(-50%,-8px); z-index:4; opacity:0; padding:7px 14px; max-width:92%; text-align:center; font-family:'SSX Text',monospace; font-size:20px; color:#ffd76a; background:rgba(6,9,8,.85); border:1px solid #6a5a2a; text-shadow:0 0 8px rgba(255,215,106,.5); transition:opacity .3s, transform .3s; }
#homeToast.show{ opacity:1; transform:translate(-50%,0); }

/* hangar */
.hangar-tier{ font-size:9px; color:var(--neon-amber); letter-spacing:2px; margin-bottom:8px; }
.skin-row{ display:flex; gap:14px; justify-content:center; margin-bottom:10px; }
.skin{ background:none; border:none; padding:0; display:flex; flex-direction:column; align-items:center; gap:4px; color:var(--ink-dim); font-size:7px; letter-spacing:1px; }
.skin i{ width:34px; height:34px; border-radius:50%; border:2px solid #3b5046; background:radial-gradient(circle at 35% 30%, #fff, var(--sw) 55%, #000 140%); transition:transform .15s, box-shadow .2s; }
.skin.sel{ color:var(--neon-cyan); } .skin.sel i{ border-color:var(--neon-cyan); box-shadow:0 0 0 3px rgba(255,194,26,.2), 0 0 14px var(--sw); transform:scale(1.12); }
.hangar-seg{ display:flex; width:100%; max-width:300px; margin-bottom:6px; }
.hangar-seg button{ flex:1; padding:7px 0; font-size:8px; letter-spacing:1px; background:rgba(8,12,10,.7); border:2px solid #28362f; color:var(--ink-dim); }
.hangar-seg button.on{ color:var(--neon-cyan); border-color:var(--neon-cyan); background:rgba(255,194,26,.1); }
.hangar-body{ width:100%; max-width:300px; flex:1; min-height:0; overflow-y:auto; touch-action:pan-y; pointer-events:auto; padding-bottom:8px; }
.hangar-body .stat-row{ padding:4px 0; }
.mod-grid{ display:grid; grid-template-columns:repeat(6, 1fr); gap:5px; }
.mod{ position:relative; aspect-ratio:1; padding:0; background:rgba(8,12,10,.8); border:2px solid #28362f; display:flex; align-items:center; justify-content:center; }
.mod.sel{ border-color:var(--neon-cyan); box-shadow:0 0 10px rgba(255,194,26,.4); }
.mod b{ position:absolute; right:1px; bottom:0; font-family:'SSX Text',monospace; font-weight:normal; font-size:14px; color:var(--neon-amber); text-shadow:0 0 3px #000; }
.mod-detail{ margin-top:8px; text-align:left; font-family:'SSX Text',monospace; font-size:17px; color:#c3d2c8; line-height:1.1; min-height:56px; }
.mod-detail em{ font-style:normal; font-family:'SSX Label',monospace; font-size:9px; color:#fff; display:block; margin-bottom:4px; }
.mod-empty{ padding:18px 6px; font-family:'SSX Text',monospace; font-size:19px; color:var(--ink-dim); text-align:center; }

/* arbre (page de droite) : onglets de branche, cartes par paliers, fiche en bas */
#pageTree{ padding:50px 8px 8px; align-items:stretch; text-align:left; --accent:#ffc21a; --accent-dim:rgba(255,194,26,.15); }
#pageTree{ --c:#ff7a45; }
.tree-tabs{ display:flex; gap:6px; padding:6px 4px 8px; margin:0 -4px; overflow-x:auto; touch-action:pan-x; pointer-events:auto; scrollbar-width:none; }
.tree-tabs::-webkit-scrollbar{ display:none; }
.ttab{ flex:0 0 auto; width:46px; height:50px; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:0;
  background:rgba(8,12,10,.8); border:2px solid color-mix(in srgb, var(--c) 40%, #1a1f33); color:var(--ink-dim); opacity:.75; }
.ttab .tt-p{ font-family:'SSX Text',monospace; font-size:14px; line-height:1; }
.ttab.on{ opacity:1; border-color:var(--c); background:color-mix(in srgb, var(--c) 22%, #0a0e1e); box-shadow:0 0 12px color-mix(in srgb, var(--c) 40%, transparent); color:#fff; }
.tt-dot{ position:absolute; top:-5px; right:-5px; width:10px; height:10px; border-radius:50%; background:#ffd76a; box-shadow:0 0 8px #ffd76a; animation:ttDot 1.3s ease-in-out infinite; }
@keyframes ttDot{ 50%{ transform:scale(1.35); opacity:.7; } }
.tree-bhead{ display:flex; justify-content:space-between; align-items:baseline; padding:0 2px 6px; }
#treeBName{ font-size:10px; letter-spacing:1px; color:var(--c); text-shadow:0 0 8px color-mix(in srgb, var(--c) 50%, transparent); }
#treeBProg{ font-family:'SSX Text',monospace; font-size:17px; color:var(--ink-dim); }
.tree-bbar{ height:4px; background:#141a2e; margin-bottom:6px; }
.tree-bbar i{ display:block; height:100%; width:0; background:var(--c); box-shadow:0 0 8px var(--c); transition:width .3s; }
.tree-scroll{ flex:1; min-height:0; overflow-y:auto; touch-action:pan-y; pointer-events:auto; padding:0 2px 10px; scrollbar-width:none; }
.tree-scroll::-webkit-scrollbar{ display:none; }
/* GSAP anime le transform des boutons : on retire la transition CSS qui se battrait avec lui */
.mo{ transition-property:filter, box-shadow, border-color, background, opacity !important; }

/* onglets */
#homeTabs{ position:absolute; left:0; right:0; bottom:0; height:58px; z-index:3; display:flex; background:linear-gradient(to top, rgba(6,9,8,.92) 55%, rgba(6,9,8,0)); }
.home-tab{ flex:1; position:relative; background:none; border:none; color:var(--ink-dim); font-size:9px; letter-spacing:1px; padding:14px 4px 0; }
.home-tab::before{ content:''; position:absolute; left:22%; right:22%; top:6px; height:3px; background:transparent; }
.home-tab.on{ color:var(--neon-cyan); } .home-tab.on::before{ background:var(--neon-cyan); box-shadow:0 0 8px var(--neon-cyan); }
.home-tab.buy::after{ content:''; position:absolute; top:10px; right:26%; width:8px; height:8px; border-radius:50%; background:var(--neon-amber); box-shadow:0 0 8px var(--neon-amber); animation:nodePulse 1.2s infinite; }
#btnDevHome{ position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:3; font-size:8px; padding:5px 8px; background:rgba(30,0,0,.6); border:2px solid #ff3a3a; color:#ffe14a; }
@media (prefers-reduced-motion: reduce){ #home, .node.open, .home-tab.buy::after{ animation:none !important; } #homeTrack{ transition:none; } }

#vfxCover{ position:absolute; inset:0; z-index:90; pointer-events:none; opacity:0; visibility:hidden; background:radial-gradient(ellipse at 50% 62%, #1b2c5a 0%, #070614 62%, #070a09 100%); }

/* ---------- TUTO : bilan de finition (%) en fin de partie ---------- */
#tutoEnd{ z-index:70; overflow-y:auto; justify-content:flex-start; padding-top:5%; }
#tutoEnd .te-big{ font-family:'SSX Label',monospace; font-size:44px; color:var(--neon-amber); text-shadow:0 0 18px rgba(255,200,80,.55); line-height:1.1; } #tutoEnd .te-big b{ font-weight:normal; }
#tutoEnd .te-sub{ font-family:'SSX Text'; font-size:19px; color:var(--ink-dim); margin-bottom:8px; } #tutoEnd .te-sub em, #tutoEnd .te-row em{ font-style:normal; color:#7bff9a; }
#tutoEnd .te-bar{ position:relative; width:100%; max-width:300px; height:14px; background:#111a16; border:1px solid #3b5046; margin-bottom:10px; }
#tutoEnd .te-bar i{ position:absolute; left:0; top:0; bottom:0; display:block; } #tutoEnd .te-old{ background:#6b5a2a; } #tutoEnd .te-new{ background:linear-gradient(90deg,#ffb03a,#ffe27a); box-shadow:0 0 10px rgba(255,200,80,.6); }
#tutoEnd .te-bar s{ position:absolute; top:0; bottom:0; width:1px; background:rgba(255,255,255,.4); }
#tutoEnd .te-rows{ width:100%; max-width:300px; font-family:'SSX Text'; font-size:18px; }
#tutoEnd .te-row{ display:grid; grid-template-columns:1fr auto; gap:0 8px; margin-bottom:5px; color:var(--ink-dim); opacity:0; animation:teIn .35s ease-out forwards; } #tutoEnd .te-row.ok{ color:#7bff9a; }
#tutoEnd .te-v{ color:var(--ink); } #tutoEnd .te-b{ grid-column:1 / 3; height:4px; background:#111a16; } #tutoEnd .te-b i{ display:block; height:100%; background:var(--neon-cyan); } #tutoEnd .te-row.ok .te-b i{ background:#7bff9a; }
@keyframes teIn{ from{ opacity:0; transform:translateX(-14px); } to{ opacity:1; transform:none; } }
#tutoEnd .te-next{ font-family:'SSX Text'; font-size:18px; color:#ffd76a; text-align:center; max-width:300px; margin:4px 0 8px; line-height:1.1; } #tutoEnd .te-next b, #tutoEnd .te-next em{ color:#fff; font-style:normal; font-weight:normal; }
/* carte des mondes : % de finition */
.node-pct{ position:absolute; left:50%; top:100%; transform:translateX(-50%); margin-top:2px; font-size:7px; color:var(--neon-amber); text-shadow:1px 1px 0 #000; pointer-events:none; white-space:nowrap; } .node-pct.full{ color:#7bff9a; }
.lc-comp{ display:flex; align-items:center; gap:6px; } .lc-comp i{ flex:1; height:6px; background:#111a16; border:1px solid #28362f; position:relative; } .lc-comp i u{ position:absolute; left:0; top:0; bottom:0; background:linear-gradient(90deg,#ffb03a,#ffe27a); }

/* ---------- PAUSE / PARAMÈTRES : feuille modale commune (.sheet) ---------- */
.sheet-overlay{ background:rgba(4,3,12,.76) !important; -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); padding:14px; overflow:hidden; }
.sheet-overlay::before, .sheet-overlay::after{ display:none; }
.overlay.sheet-overlay > *{ animation:none; }
.sheet{ position:relative; width:min(100%, 340px); max-height:100%; display:flex; flex-direction:column; gap:10px; padding:16px 14px 14px; text-align:center; font-family:'SSX Label',monospace;
  background:linear-gradient(180deg,#15133b,#0b0a1e); border:2px solid #35316a; box-shadow:0 0 0 2px #070a09, 0 18px 50px rgba(0,0,0,.65), inset 0 0 34px var(--accent-dim); }
.sheet::before{ content:''; position:absolute; left:-2px; right:-2px; top:-2px; height:3px; background:linear-gradient(90deg, transparent, var(--accent), transparent); }
.sheet-lg{ width:min(100%, 380px); }
.sheet .btn{ width:100%; margin:0; display:flex; align-items:center; justify-content:center; gap:10px; }
.sheet .btn svg{ width:14px; height:14px; fill:currentColor; flex:none; }
.sheet .btn.secondary{ min-width:0; margin:0; }
.sheet .btn.small{ padding:10px 8px; }
.sh-title{ font-size:15px; color:#fff; letter-spacing:2px; text-shadow:0 0 14px var(--accent-dim); }
.sh-sub{ margin-top:6px; font-family:'SSX Text',monospace; font-size:19px; color:var(--ink-dim); letter-spacing:1px; }
.sh-bar{ display:grid; grid-template-columns:40px 1fr 40px; align-items:center; gap:6px; }
.sh-bar .sh-title{ font-size:12px; }
.bk{ width:40px; height:40px; background:#0e1412; border:2px solid #35316a; color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; transition:border-color .15s, background .15s; }
.bk svg{ width:16px; height:16px; } .bk:hover{ border-color:var(--accent); background:var(--accent-dim); }
.sh-scroll{ display:flex; flex-direction:column; gap:10px; overflow-y:auto; min-height:0; padding:2px 2px 4px; scrollbar-width:thin; scrollbar-color:#35316a transparent; }

/* pause */
.tiles{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.tile{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px 2px 10px; background:#0e1412; border:2px solid #28362f; color:#d9e3dc; cursor:pointer; font-family:inherit; transition:border-color .15s, background .15s, box-shadow .15s; }
.tile svg{ width:24px; height:24px; fill:var(--accent); transition:transform .25s cubic-bezier(.3,1.6,.5,1); } .tile span{ font-size:7px; letter-spacing:1px; }
.tile:hover{ border-color:var(--accent); background:var(--accent-dim); box-shadow:0 0 14px var(--accent-dim); } .tile:hover svg{ transform:rotate(-8deg) scale(1.12); }
#pauseGear{ width:auto; max-width:none; margin:0; padding:0; text-align:left; }
.acc-head{ width:100%; display:flex; justify-content:space-between; align-items:center; padding:10px 10px; background:none; border:none; color:#d9e3dc; font-family:inherit; font-size:8px; letter-spacing:1px; cursor:pointer; }
.acc-head{ font-family:'SSX Label',monospace; } .acc-head b{ color:#ffd76a; font-weight:normal; margin-left:6px; }
.acc-head i{ width:8px; height:8px; border-right:2px solid var(--accent); border-bottom:2px solid var(--accent); transform:rotate(45deg) translate(-2px,-2px); transition:transform .3s; }
#pauseGear.open .acc-head i{ transform:rotate(225deg) translate(-2px,-2px); }
.acc-body{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .32s cubic-bezier(.3,.8,.3,1); }
#pauseGear.open .acc-body{ grid-template-rows:1fr; }
.acc-in{ overflow:hidden; min-height:0; padding:0 8px; } #pauseGear.open .acc-in{ padding-bottom:8px; }
.quit{ text-align:center; }
.lnk{ background:none; border:none; padding:10px 8px; color:#ff8aa0; font-family:inherit; font-size:8px; letter-spacing:2px; cursor:pointer; transition:color .15s, letter-spacing .2s; } .lnk:hover{ color:#fff; letter-spacing:3px; }
.qc{ border:2px solid rgba(255,79,109,.55); background:rgba(255,79,109,.09); padding:10px; } .qc.hidden{ display:none; }
.qc-msg{ font-family:'SSX Text',monospace; font-size:19px; color:#ffd0d8; line-height:1.05; margin-bottom:10px; }
.qc-row{ display:flex; gap:8px; } .qc-row .btn{ flex:1; }
.btn.danger.small{ background:#ff4f6d; color:#1a0509; border:none; box-shadow:0 3px 0 #8a1f33; }
.sheet .btn.danger.small:hover{ filter:brightness(1.12); }

/* paramètres */
.grp{ border:2px solid #2a2650; background:rgba(8,8,24,.55); padding:10px 10px 12px; text-align:left; }
.grp h3{ margin:0 0 8px; font-size:8px; font-weight:normal; letter-spacing:2px; color:var(--ink-dim); }
.grp.danger{ border-color:rgba(255,79,109,.35); } .grp.danger h3{ color:#ff8aa0; }
.grp.danger .btn.danger{ background:transparent; color:#ff8aa0; border:2px solid #ff4f6d; box-shadow:none; } .grp.danger .btn.danger:hover{ background:rgba(255,79,109,.15); color:#fff; }
.grp .btn + .btn{ margin-top:8px; } .row2 .btn{ margin:0 !important; }
.sheet .vol-row{ display:grid; grid-template-columns:34px 64px 1fr 34px; align-items:center; gap:8px; max-width:none; margin:6px 0; }
.sheet .vol-row label{ flex:none; font-size:7px; letter-spacing:1px; text-align:left; }
.sheet .vol-row input[type=range]::-webkit-slider-thumb{ transition:transform .15s; } .sheet .vol-row input[type=range]:active::-webkit-slider-thumb{ transform:scale(1.25); }
.sw{ width:34px; height:34px; display:flex; align-items:center; justify-content:center; padding:0; background:#0e1412; border:2px solid #35316a; color:var(--accent); cursor:pointer; transition:color .2s, border-color .2s, background .2s; }
.sw svg{ width:16px; height:16px; fill:currentColor; overflow:visible; }
.sw svg path.x{ fill:none; stroke:#ff4f6d; stroke-width:2.2; opacity:0; stroke-dasharray:21; stroke-dashoffset:21; transition:stroke-dashoffset .25s, opacity .2s; }
.sw.off{ color:#5a5a7e; border-color:#2a2650; } .sw.off svg path.x{ opacity:1; stroke-dashoffset:0; }
.grp .row{ display:flex; align-items:center; justify-content:space-between; gap:10px; } .grp .row label{ font-size:7px; letter-spacing:1px; color:var(--ink-dim); }
.grp .name-input{ flex:1; max-width:190px; background:rgba(6,9,8,.8); border:2px solid #35316a; color:#fff; font-family:'SSX Label',monospace; padding:9px 8px; text-align:center; text-transform:uppercase; transition:border-color .15s, box-shadow .15s; }
.grp .name-input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 12px var(--accent-dim); }
.cloud{ font-family:'SSX Text',monospace; font-size:17px; color:var(--ink-dim); margin-bottom:8px; line-height:1.05; } .cloud::before{ content:''; display:inline-block; width:8px; height:8px; margin-right:8px; background:var(--dot,#ffb35a); box-shadow:0 0 8px var(--dot,#ffb35a); }
.row2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.sheet #saveBox{ max-width:none; margin:8px 0 0; }
@media (prefers-reduced-motion: reduce){ .acc-body, .tile svg, .sw, .sw svg path.x{ transition:none; } }

/* gros titres en Jersey 15 (le reste de l'interface est en Chakra Petch) */
.title-logo, .sh-title, .go-title, .lu-title, #btnLaunch, #btnResume, #mwName, .lc-name, .te-big{ font-family:'SSX Display', monospace !important; }
body, .overlay, .btn, button, input, textarea{ font-variant-numeric:tabular-nums; }
