/* ===== Ninja Foudre – styles ===== */
:root {
  --cyan: #3ee8ff;
  --blue: #2a7bff;
  --yellow: #ffd23f;
  --green: #5dff4a;
  --red: #ff3b4f;
  --panel: rgba(8, 12, 40, 0.88);
  --ink: #eaf4ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02010a;
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#game, #game canvas { position: fixed; inset: 0; display: block; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

.bars {
  position: absolute; top: 18px; left: 18px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  background: rgba(5, 10, 35, 0.55);
  border: 2px solid rgba(62, 232, 255, 0.35);
  border-radius: 14px;
}
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label {
  width: 78px; font-family: 'Lilita One', cursive; font-size: 14px;
  letter-spacing: 1px; color: #bfe9ff;
}
.bar {
  width: 220px; height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px; overflow: hidden;
}
.bar.big { width: min(520px, 50vw); height: 20px; }
.fill { height: 100%; width: 100%; transition: width 0.15s ease-out; border-radius: 6px; }
.fill.hp { background: linear-gradient(90deg, #ff3b4f, #ff8a3d); }
.fill.en { background: linear-gradient(90deg, #2a7bff, #3ee8ff); }
.fill.sp { background: linear-gradient(90deg, #ffd23f, #fff6a8); }
.fill.sp.full { animation: pulse 0.6s infinite alternate; }
.fill.boss-fill { background: linear-gradient(90deg, #2fd12a, #a6ff4a); }

.ready {
  font-family: 'Lilita One', cursive; color: var(--yellow);
  text-shadow: 0 0 10px var(--yellow); animation: pulse 0.5s infinite alternate;
}

@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.6); } }

.stats {
  position: absolute; top: 18px; right: 18px;
  display: flex; gap: 12px; align-items: center;
}
.stat {
  min-width: 92px; padding: 8px 14px; text-align: center;
  background: rgba(5, 10, 35, 0.55);
  border: 2px solid rgba(62, 232, 255, 0.35);
  border-radius: 14px;
}
.stat span { display: block; font-size: 11px; letter-spacing: 2px; color: #9fc6e8; font-weight: 800; }
.stat b { font-family: 'Lilita One', cursive; font-size: 26px; color: #fff; }
.combo {
  font-family: 'Lilita One', cursive; font-size: 30px; color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 210, 63, 0.9);
  animation: pop 0.25s ease-out;
}

.boss {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
.boss-name {
  font-family: 'Lilita One', cursive; font-size: 18px; color: var(--green);
  text-shadow: 0 0 10px rgba(93, 255, 74, 0.7); margin-bottom: 6px;
}

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 34px; height: 34px; transform: translate(-50%, -50%);
  border: 2px solid rgba(62, 232, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(62, 232, 255, 0.6);
}
.ch-dot {
  position: absolute; left: 50%; top: 50%; width: 4px; height: 4px;
  transform: translate(-50%, -50%); background: #fff; border-radius: 50%;
}
#hitmarker {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  transform: translate(-50%, -50%) rotate(45deg); opacity: 0;
  background:
    linear-gradient(#fff, #fff) center top / 3px 12px no-repeat,
    linear-gradient(#fff, #fff) center bottom / 3px 12px no-repeat,
    linear-gradient(#fff, #fff) left center / 12px 3px no-repeat,
    linear-gradient(#fff, #fff) right center / 12px 3px no-repeat;
}
#hitmarker.show { animation: hit 0.25s ease-out; }
@keyframes hit { from { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(0.7); }
                 to   { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(1.2); } }

#radar {
  position: absolute; right: 18px; bottom: 18px;
  width: 170px; height: 170px; border-radius: 50%;
  border: 2px solid rgba(62, 232, 255, 0.5);
  background: rgba(5, 10, 35, 0.55);
}

.warn {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  font-family: 'Lilita One', cursive; font-size: 22px; color: var(--yellow);
  text-shadow: 0 0 10px #000; animation: pulse 0.4s infinite alternate;
}

/* ---------- FX ---------- */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.dmg {
  position: absolute; font-family: 'Lilita One', cursive; font-size: 22px;
  color: #fff; text-shadow: 0 0 6px var(--cyan), 2px 2px 0 #000;
  transform: translate(-50%, -50%); white-space: nowrap; will-change: transform, opacity;
}
.dmg.crit { color: var(--yellow); font-size: 28px; }
.dmg.heal { color: var(--green); }
.dmg.points { color: var(--yellow); font-size: 20px; }

#damage-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 7; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 30, 50, 0.65) 100%);
  transition: opacity 0.35s ease-out;
}

.banner {
  position: fixed; top: 30%; left: 50%; transform: translateX(-50%);
  z-index: 8; pointer-events: none; text-align: center;
  animation: bannerIn 0.5s ease-out;
}
#banner-title {
  font-family: 'Lilita One', cursive; font-size: clamp(42px, 8vw, 86px);
  color: #fff; letter-spacing: 3px;
  text-shadow: 0 0 20px var(--cyan), 0 0 40px var(--blue), 4px 4px 0 #0a1440;
}
#banner-sub {
  font-family: 'Lilita One', cursive; font-size: clamp(18px, 3vw, 28px);
  color: var(--yellow); text-shadow: 2px 2px 0 #000;
}
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) scale(1.6); }
                      to   { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes pop { from { transform: scale(1.6); } to { transform: scale(1); } }

/* ---------- Écrans ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10, 20, 70, 0.55), rgba(0, 0, 10, 0.85));
  padding: 16px;
}
.panel {
  max-width: 640px; width: 100%;
  background: var(--panel);
  border: 3px solid var(--cyan);
  border-radius: 22px;
  padding: 28px 30px;
  text-align: center;
  box-shadow: 0 0 40px rgba(62, 232, 255, 0.35), inset 0 0 30px rgba(42, 123, 255, 0.2);
  max-height: 100%; overflow-y: auto;
}
.panel.small { max-width: 440px; }

h1 {
  font-family: 'Lilita One', cursive; font-size: clamp(30px, 6vw, 54px);
  letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 16px var(--cyan), 0 0 32px var(--blue), 4px 4px 0 #0a1440;
}
h1.red { text-shadow: 0 0 16px var(--red), 4px 4px 0 #300; }
h2 {
  font-family: 'Lilita One', cursive; font-size: 24px; color: var(--yellow);
  margin: 4px 0 14px; letter-spacing: 1px;
}
.bolt { color: var(--yellow); text-shadow: 0 0 12px var(--yellow); }
.story { font-size: 16px; line-height: 1.5; margin-bottom: 18px; color: #cfe3ff; }
.story b { color: var(--cyan); }

.controls {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 16px;
  text-align: left; align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 20px;
  font-size: 14px;
}
.controls span { color: #8aa6c8; margin: 0 4px; font-size: 12px; }
kbd {
  display: inline-block; min-width: 26px; padding: 3px 7px; margin: 1px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; text-align: center;
  color: #0a1440; background: linear-gradient(#fff, #cfe0f5);
  border-radius: 6px; box-shadow: 0 3px 0 #6a86b0;
}

.btn {
  font-family: 'Lilita One', cursive; font-size: 26px; letter-spacing: 2px;
  color: #0a1440; background: linear-gradient(180deg, #fff27a, var(--yellow));
  border: none; border-radius: 16px; padding: 12px 40px; cursor: pointer;
  box-shadow: 0 6px 0 #b8860b, 0 0 24px rgba(255, 210, 63, 0.5);
  transition: transform 0.1s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b8860b; }

.best { margin-top: 14px; color: var(--yellow); font-weight: 800; min-height: 20px; }

.final { display: flex; justify-content: space-around; margin: 18px 0; gap: 10px; }
.final div { display: flex; flex-direction: column; }
.final span { font-size: 12px; color: #9fc6e8; letter-spacing: 1px; font-weight: 800; }
.final b { font-family: 'Lilita One', cursive; font-size: 32px; }
.record {
  font-family: 'Lilita One', cursive; font-size: 22px; color: var(--yellow);
  margin-bottom: 14px; animation: pulse 0.5s infinite alternate;
}

@media (max-width: 700px) {
  .bar { width: 130px; }
  .bar-label { width: 62px; font-size: 12px; }
  .stat { min-width: 64px; padding: 6px 8px; }
  .stat b { font-size: 20px; }
  #radar { width: 120px; height: 120px; }
}
