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

:root {
  --cyan: #4be8ff;
  --magenta: #ff4bd8;
  --gold: #ffd54a;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #04050e;
  font-family: "Noto Sans JP", sans-serif;
  color: #e8f6ff;
  user-select: none;
  cursor: default;
}

#cv { position: fixed; inset: 0; display: block; }

.hidden { display: none !important; }

/* ===== overlays ===== */
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,10,.55) 100%);
}
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 41; opacity: .14;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.6) 2px 4px);
}

/* ===== HUD ===== */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 26px; pointer-events: none;
}
#floor {
  font-family: Orbitron, monospace; font-weight: 700; font-size: 22px;
  letter-spacing: .18em; color: var(--cyan);
  text-shadow: 0 0 14px rgba(75,232,255,.8);
}
#hpbar {
  position: relative; width: 280px; height: 18px; margin-top: 10px;
  border: 1px solid rgba(75,232,255,.45); border-radius: 9px;
  background: rgba(8,14,30,.6); overflow: hidden;
  box-shadow: 0 0 12px rgba(75,232,255,.25), inset 0 0 8px rgba(0,0,0,.6);
}
#hpfill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #2effc8, #4be8ff);
  border-radius: 9px;
  transition: width .25s ease, background .3s;
  box-shadow: 0 0 14px rgba(75,232,255,.8);
}
#hpfill.low { background: linear-gradient(90deg, #ff4b6e, #ff9a4b); }
#hptext {
  position: absolute; inset: 0; text-align: center; line-height: 17px;
  font-family: Orbitron, monospace; font-size: 11px; font-weight: 700;
  color: #fff; text-shadow: 0 0 4px #000;
}
#relics { margin-top: 10px; font-size: 20px; letter-spacing: 4px; filter: drop-shadow(0 0 6px rgba(255,213,74,.6)); }

#hud-right { text-align: right; }
#score-label {
  font-family: Orbitron, monospace; font-size: 11px; letter-spacing: .4em;
  color: rgba(232,246,255,.55);
}
#score {
  font-family: Orbitron, monospace; font-weight: 900; font-size: 34px;
  color: #fff; text-shadow: 0 0 18px rgba(75,232,255,.7);
}
#combo-wrap { margin-top: 14px; }
#combo {
  font-family: Orbitron, monospace; font-weight: 900; font-size: 56px; line-height: 1;
  color: var(--gold); text-shadow: 0 0 24px rgba(255,213,74,.8);
  transform-origin: right center;
}
#combo.hot { color: #ff7b4b; text-shadow: 0 0 30px rgba(255,123,75,.95); }
#combo.pop { animation: pop .18s ease-out; }
@keyframes pop {
  0% { transform: scale(1.5) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}
#combo-label {
  font-family: Orbitron, monospace; font-size: 12px; letter-spacing: .3em;
  color: rgba(255,213,74,.75);
}

/* ===== boss bar ===== */
#bossbar-wrap {
  position: fixed; top: 86px; left: 50%; transform: translateX(-50%);
  width: min(560px, 70vw); z-index: 30; text-align: center; pointer-events: none;
}
#bossname {
  font-family: Orbitron, monospace; font-weight: 700; font-size: 15px;
  letter-spacing: .35em; color: #ff5d7a;
  text-shadow: 0 0 16px rgba(255,93,122,.9);
  animation: bosspulse 1.2s ease-in-out infinite;
}
@keyframes bosspulse { 50% { opacity: .55; } }
#bossbar {
  margin-top: 6px; height: 12px; border-radius: 6px; overflow: hidden;
  border: 1px solid rgba(255,93,122,.6); background: rgba(20,6,14,.7);
  box-shadow: 0 0 16px rgba(255,93,122,.35);
}
#bossfill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #ff2d55, #ff8a5c);
  box-shadow: 0 0 14px rgba(255,93,122,.9);
  transition: width .3s ease;
}

/* ===== banner ===== */
#banner {
  position: fixed; top: 34%; left: 0; right: 0; z-index: 35;
  text-align: center; pointer-events: none;
}
#banner-text {
  font-family: Orbitron, "Noto Sans JP", monospace; font-weight: 900; font-size: 64px;
  letter-spacing: .22em; color: #fff;
  text-shadow: 0 0 30px rgba(75,232,255,.9), 0 0 80px rgba(75,232,255,.5);
}
#banner-sub {
  margin-top: 8px; font-size: 18px; font-weight: 700; letter-spacing: .3em;
  color: var(--gold); text-shadow: 0 0 14px rgba(255,213,74,.8);
}
#banner.show { animation: bannerAnim 1.5s ease-out forwards; }
#banner.danger #banner-text { color: #ff5d7a; text-shadow: 0 0 30px rgba(255,93,122,.95), 0 0 90px rgba(255,45,85,.5); }
@keyframes bannerAnim {
  0%   { opacity: 0; transform: scale(1.6); filter: blur(8px); }
  18%  { opacity: 1; transform: scale(1);   filter: blur(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: scale(.92); }
}

/* ===== full screens ===== */
.screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: radial-gradient(ellipse at center, rgba(6,10,26,.82), rgba(2,3,10,.94));
  backdrop-filter: blur(3px);
  text-align: center;
}
.title-deco {
  font-family: Orbitron, monospace; font-size: 13px; letter-spacing: .5em;
  color: var(--magenta); text-shadow: 0 0 12px rgba(255,75,216,.8);
  margin-bottom: 14px;
}
#game-title {
  font-family: Orbitron, monospace; font-weight: 900; font-size: clamp(54px, 9vw, 110px);
  letter-spacing: .08em; line-height: 1;
  background: linear-gradient(180deg, #ffffff 10%, #4be8ff 55%, #ff4bd8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 28px rgba(75,232,255,.55)) drop-shadow(0 4px 40px rgba(255,75,216,.35));
}
.title-jp {
  margin-top: 8px; font-weight: 700; font-size: 18px; letter-spacing: .8em;
  color: rgba(232,246,255,.8);
}
.title-best {
  margin-top: 18px; font-family: Orbitron, monospace; font-size: 15px;
  letter-spacing: .2em; color: var(--gold); text-shadow: 0 0 12px rgba(255,213,74,.7);
}
.howto {
  margin-top: 34px; font-size: 15px; font-weight: 500; line-height: 2.1;
  color: rgba(232,246,255,.85);
}
.press {
  margin-top: 40px; font-family: Orbitron, monospace; font-size: 15px;
  letter-spacing: .3em; color: var(--cyan);
  text-shadow: 0 0 12px rgba(75,232,255,.8);
}
.blink { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ===== relic screen ===== */
.relic-head {
  font-family: Orbitron, monospace; font-weight: 900; font-size: 46px; letter-spacing: .25em;
  color: #fff; text-shadow: 0 0 26px rgba(75,232,255,.85);
}
.relic-sub { margin-top: 8px; font-size: 16px; font-weight: 700; letter-spacing: .4em; color: var(--gold); }
#relic-cards { display: flex; gap: 26px; margin-top: 44px; }
.relic-card {
  width: 230px; padding: 28px 20px 24px;
  border-radius: 16px; cursor: pointer;
  background: linear-gradient(165deg, rgba(20,30,60,.85), rgba(8,12,28,.9));
  border: 1px solid rgba(75,232,255,.35);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), inset 0 0 30px rgba(75,232,255,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  animation: cardIn .5s cubic-bezier(.2,1.4,.4,1) backwards;
}
.relic-card:nth-child(2) { animation-delay: .08s; }
.relic-card:nth-child(3) { animation-delay: .16s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(50px) scale(.85); }
}
.relic-card:hover, .relic-card.sel {
  transform: translateY(-10px) scale(1.05);
  border-color: var(--gold);
  box-shadow: 0 14px 44px rgba(255,213,74,.25), 0 0 30px rgba(255,213,74,.3), inset 0 0 30px rgba(255,213,74,.06);
}
.relic-owned {
  margin-top: 10px; font-family: Orbitron, monospace; font-size: 11px;
  letter-spacing: .15em; color: var(--gold); opacity: .85;
}
#relics sub {
  font-family: Orbitron, monospace; font-size: 11px; color: var(--gold);
  vertical-align: baseline;
}
.relic-icon { font-size: 46px; filter: drop-shadow(0 0 12px rgba(255,213,74,.6)); }
.relic-name { margin-top: 14px; font-size: 18px; font-weight: 900; color: #fff; letter-spacing: .05em; }
.relic-desc { margin-top: 10px; font-size: 13px; line-height: 1.7; color: rgba(232,246,255,.78); }

/* ===== game over ===== */
#over-title {
  font-family: Orbitron, monospace; font-weight: 900; font-size: 64px; letter-spacing: .2em;
  color: #ff5d7a; text-shadow: 0 0 30px rgba(255,93,122,.9), 0 0 90px rgba(255,45,85,.45);
}
#over-stats { margin-top: 30px; font-size: 17px; line-height: 2.2; }
#over-stats .v {
  font-family: Orbitron, monospace; font-weight: 700; color: var(--cyan);
  text-shadow: 0 0 10px rgba(75,232,255,.7); margin-left: 14px;
}
#over-stats .newbest { color: var(--gold); text-shadow: 0 0 14px rgba(255,213,74,.9); }

#over-title.win {
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,213,74,.9), 0 0 90px rgba(255,213,74,.45);
}

/* ===== world map info ===== */
#map-info {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 30; display: flex; gap: 18px; align-items: center;
  padding: 14px 24px; border-radius: 14px; min-width: 420px; max-width: 80vw;
  background: rgba(10,16,36,.78); border: 1px solid rgba(75,232,255,.35);
  box-shadow: 0 0 26px rgba(75,232,255,.18), 0 10px 30px rgba(0,0,0,.5);
  pointer-events: none;
}
#mi-icon { font-size: 36px; filter: drop-shadow(0 0 10px rgba(75,232,255,.5)); }
#mi-body { flex: 1; }
#mi-name { font-weight: 900; font-size: 17px; }
#mi-name .locked { color: rgba(232,246,255,.5); }
#mi-name .star { color: var(--gold); text-shadow: 0 0 8px rgba(255,213,74,.8); }
#mi-desc { margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: rgba(232,246,255,.75); }
#mi-best {
  margin-top: 3px; font-family: Orbitron, monospace; font-size: 11px;
  letter-spacing: .1em; color: var(--gold);
}
#mi-action {
  font-size: 12px; line-height: 1.8; text-align: right; white-space: nowrap;
  color: var(--cyan); text-shadow: 0 0 8px rgba(75,232,255,.5);
}

#pause-screen h2 {
  font-family: Orbitron, monospace; font-weight: 900; font-size: 52px; letter-spacing: .3em;
  color: var(--cyan); text-shadow: 0 0 26px rgba(75,232,255,.85);
}

/* ===== mute ===== */
#mute {
  position: fixed; right: 18px; bottom: 16px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(10,16,36,.7); border: 1px solid rgba(75,232,255,.35);
  color: #fff; font-size: 18px; cursor: pointer;
  transition: box-shadow .2s;
}
#mute:hover { box-shadow: 0 0 16px rgba(75,232,255,.5); }
