/* ===== ShenPachi v3.0 ART DIRECTION — gameplay HUD + console jump polish ===== */
:root{
  --ng-cyan:#42f8ff;
  --ng-magenta:#ff4fd8;
  --ng-gold:#ffe66d;
  --ng-red:#ff315f;
}
body.nextgen-enabled .frame{
  box-shadow:
    0 26px 80px rgba(0,0,0,.68),
    0 0 0 1px rgba(255,255,255,.10) inset,
    0 0 46px rgba(66,248,255,.12),
    0 0 70px rgba(255,79,216,.08);
}
body.nextgen-enabled .frame::after{
  background:
    radial-gradient(ellipse at center,rgba(0,0,0,0) 56%,rgba(0,0,0,.42) 100%),
    linear-gradient(110deg, transparent 0%, rgba(255,255,255,.055) 38%, transparent 52%),
    repeating-linear-gradient(to bottom,rgba(255,255,255,.035) 0,rgba(255,255,255,.035) 1px,transparent 2px,transparent 5px);
  mix-blend-mode:screen;
}
.ng-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid rgba(66,248,255,.25);
  background:linear-gradient(135deg,rgba(66,248,255,.13),rgba(255,79,216,.11));
  color:#f4fbff;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  box-shadow:0 0 18px rgba(66,248,255,.08) inset;
}
.ng-menu-chip{margin:8px auto 0; width:max-content; max-width:100%}
.ng-option{margin-top:8px;justify-content:center;color:rgba(230,242,255,.84)}
.ng-option input{accent-color:var(--ng-cyan)}
#nextgenHud{
  position:absolute;
  left:8px;
  right:8px;
  bottom:24px;
  z-index:3;
  display:grid;
  grid-template-columns:1fr auto;
  gap:6px 8px;
  align-items:end;
  pointer-events:none;
  font-family:var(--font-display),var(--font-ui);
  color:#ecfbff;
  text-shadow:0 1px 2px #000,0 0 10px rgba(66,248,255,.25);
}
#nextgenHud[hidden]{display:none!important}
.ng-meter-wrap{
  min-width:0;
  padding:5px 7px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background:rgba(0,5,15,.38);
  backdrop-filter:blur(3px);
}
.ng-meter-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:4px;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.ng-meter{
  height:7px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  box-shadow:0 0 0 1px rgba(255,255,255,.08) inset;
}
.ng-meter-fill{
  height:100%;
  width:0%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--ng-cyan),var(--ng-magenta),var(--ng-gold));
  box-shadow:0 0 16px rgba(66,248,255,.45);
  transition:width .12s linear;
}
.ng-status{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:flex-end;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.ng-status span{
  padding:4px 7px;
  border-radius:999px;
  background:rgba(0,5,15,.42);
  border:1px solid rgba(255,255,255,.12);
}
#nextgenToast{
  position:absolute;
  left:50%;
  top:18%;
  z-index:6;
  transform:translate(-50%,-8px) scale(.96);
  opacity:0;
  pointer-events:none;
  min-width:220px;
  max-width:88%;
  text-align:center;
  padding:10px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.18);
  background:linear-gradient(135deg,rgba(4,9,20,.78),rgba(27,7,31,.72));
  color:#fff;
  font-family:var(--font-display),var(--font-ui);
  font-size:15px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  text-shadow:0 0 12px rgba(66,248,255,.4);
  box-shadow:0 18px 44px rgba(0,0,0,.42),0 0 34px rgba(255,79,216,.12) inset;
  transition:opacity .18s ease, transform .18s ease;
}
#nextgenToast.on{opacity:1;transform:translate(-50%,0) scale(1)}
body.nextgen-overdrive #nextgenHud .ng-meter-wrap,
body.nextgen-overdrive #nextgenHud .ng-status span{
  border-color:rgba(255,230,109,.32);
  box-shadow:0 0 22px rgba(255,230,109,.12),0 0 22px rgba(255,79,216,.10) inset;
}
body.nextgen-overdrive #game{
  filter:saturate(1.16) contrast(1.08);
}
@media (max-width:480px){
  #nextgenHud{left:6px;right:6px;bottom:56px;grid-template-columns:1fr;gap:4px}
  .ng-meter-wrap{padding:4px 6px;border-radius:10px}
  .ng-status{flex-direction:row;justify-content:space-between;align-items:center;font-size:8px;gap:4px}
  .ng-status span{padding:3px 6px}
  .ng-meter-top{font-size:8px;margin-bottom:3px}
  .ng-meter{height:6px}
  #nextgenToast{top:16%;font-size:13px;min-width:190px}
}
@media (pointer:coarse){
  #nextgenHud{bottom:68px}
}
@media (prefers-reduced-motion:reduce){
  .ng-meter-fill,#nextgenToast{transition:none}
}

/* ===== ShenPachi v3.0 — Art Direction / High Fidelity pass ===== */
body.nextgen-enabled{
  background:
    radial-gradient(900px 700px at 50% -10%, rgba(66,248,255,.12), transparent 55%),
    radial-gradient(900px 900px at 80% 25%, rgba(255,79,216,.08), transparent 60%),
    linear-gradient(180deg,#090513 0%,#03050b 68%,#010208 100%);
}
body.nextgen-enabled .frame{
  border-radius:18px;
  background:linear-gradient(180deg,#050712,#02040a 74%,#010208);
  box-shadow:
    0 30px 90px rgba(0,0,0,.78),
    0 0 0 1px rgba(66,248,255,.20) inset,
    0 0 0 2px rgba(255,79,216,.06) inset,
    0 0 58px rgba(66,248,255,.16),
    0 0 86px rgba(255,79,216,.10);
}
body.nextgen-enabled .frame::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:
    linear-gradient(90deg,rgba(66,248,255,.25),transparent 9%,transparent 91%,rgba(255,79,216,.22)),
    linear-gradient(180deg,rgba(255,255,255,.07),transparent 10%,transparent 86%,rgba(66,248,255,.08));
  opacity:.38;
  mix-blend-mode:screen;
}
body.nextgen-enabled canvas{
  filter:saturate(1.18) contrast(1.08);
}
body.nextgen-enabled .hud{
  padding:7px 8px 0;
  gap:5px;
  align-items:flex-start;
  font-family:var(--font-display),var(--font-ui);
  letter-spacing:.055em;
  text-transform:uppercase;
  text-shadow:0 1px 2px #000,0 0 12px rgba(66,248,255,.25);
}
body.nextgen-enabled .hud .left,
body.nextgen-enabled .hud .right{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  justify-content:center;
  width:100%;
}
body.nextgen-enabled .tag,
body.nextgen-enabled .pause-btn,
body.nextgen-enabled .hint-badge{
  position:relative;
  border:1px solid rgba(66,248,255,.32);
  border-radius:0;
  clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,10px 100%,0 50%);
  background:
    linear-gradient(180deg,rgba(18,28,56,.78),rgba(4,8,20,.66)),
    radial-gradient(circle at 20% 0%,rgba(66,248,255,.24),transparent 45%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.05) inset,
    0 0 20px rgba(66,248,255,.10) inset,
    0 7px 20px rgba(0,0,0,.28);
  color:#f0fbff;
  font-weight:900;
}
body.nextgen-enabled #stage,
body.nextgen-enabled #lives{
  border-color:rgba(255,79,216,.42);
  background:
    linear-gradient(180deg,rgba(52,16,55,.72),rgba(7,8,24,.68)),
    radial-gradient(circle at 22% 0%,rgba(255,79,216,.24),transparent 45%);
}
body.nextgen-enabled #bombs{border-color:rgba(255,230,109,.36)}
body.nextgen-enabled #charge{
  min-width:100px;
  text-align:center;
  border-color:rgba(255,255,255,.24);
}
body.nextgen-enabled .pause-btn{
  left:8px;
  top:8px;
  padding:5px 9px;
  font-size:14px;
  z-index:70;
  backdrop-filter:blur(8px);
}
body.nextgen-enabled .watermark{
  right:10px;
  bottom:18px;
  border-radius:999px;
  border-color:rgba(66,248,255,.18);
  background:rgba(5,10,22,.46);
  backdrop-filter:blur(8px);
  color:rgba(236,251,255,.78);
}
body.nextgen-enabled #nextgenHud{
  left:10px;
  right:10px;
  bottom:28px;
  gap:7px 10px;
  z-index:4;
}
body.nextgen-enabled #nextgenHud .ng-meter-wrap,
body.nextgen-enabled #nextgenHud .ng-status span{
  border-radius:0;
  clip-path:polygon(13px 0,calc(100% - 13px) 0,100% 50%,calc(100% - 13px) 100%,13px 100%,0 50%);
  border:1px solid rgba(66,248,255,.26);
  background:
    linear-gradient(180deg,rgba(7,15,34,.62),rgba(2,6,15,.68)),
    radial-gradient(circle at 10% 0%,rgba(66,248,255,.16),transparent 48%);
  box-shadow:0 0 0 1px rgba(255,255,255,.05) inset,0 0 22px rgba(66,248,255,.10) inset,0 10px 25px rgba(0,0,0,.28);
  backdrop-filter:blur(8px);
}
body.nextgen-enabled .ng-meter-wrap{padding:7px 10px}
body.nextgen-enabled .ng-meter-top{font-size:10px;color:#f3fbff}
body.nextgen-enabled .ng-meter{
  height:8px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,4,12,.78);
}
body.nextgen-enabled .ng-meter-fill{
  background:linear-gradient(90deg,#42f8ff 0%,#78a7ff 42%,#ff4fd8 72%,#ffe66d 100%);
  box-shadow:0 0 18px rgba(66,248,255,.62),0 0 28px rgba(255,79,216,.28);
}
body.nextgen-enabled .ng-status{
  gap:6px;
}
body.nextgen-enabled .ng-status span{
  min-width:96px;
  text-align:center;
  padding:6px 10px;
}
body.nextgen-enabled #touchControls{
  z-index:7;
}
body.nextgen-enabled #joy{
  left:14px;
  bottom:18px;
  width:126px;
  height:126px;
  border:1px solid rgba(66,248,255,.36);
  background:
    radial-gradient(circle at center,rgba(255,255,255,.10) 0 25%,transparent 27%),
    radial-gradient(circle at center,rgba(5,12,28,.62),rgba(2,4,10,.32));
  box-shadow:0 0 0 1px rgba(255,255,255,.06) inset,0 0 30px rgba(66,248,255,.15),0 16px 38px rgba(0,0,0,.45);
  backdrop-filter:blur(7px);
}
body.nextgen-enabled #joy::before,
body.nextgen-enabled #joy::after{
  content:"";
  position:absolute;
  inset:24px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.28);
  box-shadow:0 0 16px rgba(66,248,255,.14) inset;
}
body.nextgen-enabled #joy::after{
  inset:46px;
  background:radial-gradient(circle,rgba(255,255,255,.14),rgba(66,248,255,.04));
}
body.nextgen-enabled #btns{
  right:14px;
  bottom:22px;
  gap:13px;
}
body.nextgen-enabled #btnBomb,
body.nextgen-enabled #btnCharge{
  width:74px;
  height:74px;
  border-radius:50%;
  border:1px solid rgba(66,248,255,.32);
  background:
    radial-gradient(circle at 50% 38%,rgba(255,255,255,.15),transparent 28%),
    linear-gradient(180deg,rgba(8,14,30,.76),rgba(2,5,13,.62));
  box-shadow:0 0 0 1px rgba(255,255,255,.06) inset,0 0 28px rgba(66,248,255,.14),0 14px 35px rgba(0,0,0,.45);
  color:#eef8ff;
  font-family:var(--font-display),var(--font-ui);
  font-weight:900;
  letter-spacing:.08em;
  backdrop-filter:blur(8px);
}
body.nextgen-enabled #btnBomb{
  border-color:rgba(255,79,216,.42);
  box-shadow:0 0 0 1px rgba(255,255,255,.06) inset,0 0 30px rgba(255,79,216,.18),0 14px 35px rgba(0,0,0,.45);
}
body.nextgen-enabled #nextgenToast{
  clip-path:polygon(15px 0,calc(100% - 15px) 0,100% 50%,calc(100% - 15px) 100%,15px 100%,0 50%);
  border-radius:0;
  border-color:rgba(255,255,255,.24);
  background:linear-gradient(135deg,rgba(6,15,34,.86),rgba(38,9,47,.78));
}
@media (pointer:coarse){
  body.nextgen-enabled #nextgenHud{bottom:148px;}
  body.nextgen-enabled .watermark{bottom:156px;}
}
@media (max-width:480px){
  body.nextgen-enabled .hud{padding-top:6px;font-size:10.5px;}
  body.nextgen-enabled .tag{padding:3px 7px;}
  body.nextgen-enabled #nextgenHud{left:8px;right:8px;}
  body.nextgen-enabled .ng-status span{min-width:0;flex:1;padding:6px 8px;}
}


/* v3.3 — mobile premium HUD and control polish */
@media (hover:none), (pointer:coarse){
  #nextgenHud, body.nextgen-enabled #nextgenHud{
    left:8px;
    right:8px;
    bottom:52px;
    gap:4px 6px;
  }
  .ng-meter-wrap, body.nextgen-enabled .ng-meter-wrap{
    padding:4px 6px;
    border-radius:10px;
  }
  .ng-meter-top, body.nextgen-enabled .ng-meter-top{font-size:8px; margin-bottom:3px;}
  .ng-meter, body.nextgen-enabled .ng-meter{height:6px;}
  .ng-status, body.nextgen-enabled .ng-status{gap:4px;}
  .ng-status span, body.nextgen-enabled .ng-status span{
    min-width:0;
    flex:1 1 0;
    padding:3px 5px;
    font-size:7.5px;
    letter-spacing:.06em;
  }
  body.nextgen-enabled #joy{
    transition:transform .10s ease, box-shadow .10s ease, border-color .10s ease;
  }
  body.nextgen-enabled #joy.is-active{
    border-color:rgba(66,248,255,.58);
    box-shadow:0 0 0 1px rgba(255,255,255,.08) inset,0 0 30px rgba(66,248,255,.24),0 14px 35px rgba(0,0,0,.45);
  }
  body.nextgen-enabled #btnBomb,
  body.nextgen-enabled #btnCharge{
    transition:transform .10s ease, box-shadow .10s ease, border-color .10s ease, filter .10s ease;
  }
  body.nextgen-enabled #btnBomb.is-active,
  body.nextgen-enabled #btnCharge.is-active{
    filter:brightness(1.08);
    box-shadow:0 0 0 1px rgba(255,255,255,.06) inset,0 0 36px rgba(66,248,255,.22),0 8px 22px rgba(0,0,0,.42);
  }
  body.nextgen-enabled #btnBomb.is-active{box-shadow:0 0 0 1px rgba(255,255,255,.06) inset,0 0 36px rgba(255,79,216,.26),0 8px 22px rgba(0,0,0,.42);}
  body.nextgen-enabled .watermark{bottom:6px;}
}

@media (hover:none), (pointer:coarse) and (max-height:760px){
  #nextgenHud, body.nextgen-enabled #nextgenHud{bottom:48px;}
}

@media (hover:none), (pointer:coarse) and (max-height:700px){
  #nextgenHud, body.nextgen-enabled #nextgenHud{bottom:44px;}
  .ng-status span, body.nextgen-enabled .ng-status span{font-size:7px;padding:3px 4px;}
}

body.mobile-landscape #nextgenHud,
body.mobile-landscape.nextgen-enabled #nextgenHud{bottom:36px;left:6px;right:6px;}
body.mobile-landscape .ng-status span,
body.mobile-landscape.nextgen-enabled .ng-status span{font-size:6.8px;padding:2px 4px;}
body.mobile-landscape .ng-meter-wrap,
body.mobile-landscape.nextgen-enabled .ng-meter-wrap{padding:3px 5px;}
body.mobile-landscape .ng-meter,
body.mobile-landscape.nextgen-enabled .ng-meter{height:5px;}
body.mobile-landscape.nextgen-enabled .watermark{bottom:2px;}

/* v3.4 — Gameplay feedback */
#bossbar.gp-boss-pulse{
  animation:gpBossPulse .42s cubic-bezier(.2,.8,.2,1);
  transform-origin:center;
}
#bossbar.gp-boss-pulse #bossfill,
#bossbar.gp-boss-pulse .fill{
  filter:brightness(1.38) saturate(1.18);
  box-shadow:0 0 18px rgba(255,255,255,.28),0 0 34px rgba(255,79,216,.20);
}
@keyframes gpBossPulse{
  0%{transform:scaleX(1);filter:brightness(1)}
  30%{transform:scaleX(1.025);filter:brightness(1.24)}
  100%{transform:scaleX(1);filter:brightness(1)}
}
@media (prefers-reduced-motion:reduce){
  #bossbar.gp-boss-pulse{animation:none}
}

/* v3.4.1 — HUD bureau sans doublon sur les informations de combo */
@media (hover:hover) and (pointer:fine){
  #nextgenHud,
  body.nextgen-enabled #nextgenHud{
    left:10px;
    right:auto;
    bottom:38px;
    width:min(230px, 56%);
    display:block;
  }
  #nextgenHud .ng-status,
  body.nextgen-enabled #nextgenHud .ng-status{
    display:none;
  }
  #nextgenHud .ng-meter-wrap,
  body.nextgen-enabled #nextgenHud .ng-meter-wrap{
    width:100%;
    padding:5px 8px;
  }
}


/* v3.4.2 — stabilité mobile : aucun filtre GPU coûteux sur le canvas */
@media (hover:none), (pointer:coarse){
  body.nextgen-enabled canvas,
  body.nextgen-enabled #game{filter:none!important;}
  body.nextgen-overdrive #game{filter:none!important;}
  body.nextgen-enabled .frame::after{opacity:.28;}
}
