@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Noto+Sans+SC:wght@400;700&display=swap');

:root {
  --bg: #07070f;
  --neon: #00f0ff;
  --hot: #ff2d6a;
  --gold: #ffd166;
  --panel: rgba(10, 12, 28, 0.88);
}

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

html, body {
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #14142b 0%, #07070f 70%);
  color: #fff;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  overflow: hidden;
}

#boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: #07070f;
  transition: opacity .4s ease;
}
#boot.hide { opacity: 0; pointer-events: none; }
.boot-title {
  font-family: Orbitron, sans-serif;
  font-weight: 900;
  font-size: 48px;
  letter-spacing: 8px;
  color: var(--neon);
  text-shadow: 0 0 24px var(--neon), 0 0 48px #0066ff;
}
.boot-sub {
  margin-top: 8px;
  letter-spacing: 10px;
  color: #9aa;
  font-size: 12px;
}
.boot-hint { margin-top: 28px; color: #666; font-size: 13px; }

#game-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#game {
  box-shadow: 0 0 0 2px rgba(0,240,255,.25), 0 20px 80px rgba(0,0,0,.65);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

#hud {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: min(960px, 96vw);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 1px 2px #000;
}

.hud-left, .hud-right, .hud-center { display: flex; flex-direction: column; }
.hud-right { align-items: flex-end; }
.hud-center { align-items: center; justify-content: flex-start; }

.bar-label {
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--neon);
  margin-bottom: 4px;
}

.bar-track {
  width: 220px;
  height: 14px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.bar-track.special { height: 8px; width: 180px; }
.bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2d6a, #ff8fab);
  box-shadow: 0 0 12px rgba(255,45,106,.7);
  transition: width .12s linear;
}
.bar-fill.sp {
  background: linear-gradient(90deg, #00f0ff, #7b61ff);
  box-shadow: 0 0 12px rgba(0,240,255,.7);
}

.combo {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--gold);
  min-height: 28px;
  text-shadow: 0 0 12px rgba(255,209,102,.8);
}

#wave-text {
  font-family: Orbitron, sans-serif;
  font-size: 14px;
  letter-spacing: 3px;
  color: #fff;
}
#score-text {
  font-family: Orbitron, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.help {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: rgba(255,255,255,.55);
  text-align: right;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 20;
}
.overlay.hidden { display: none; }

.panel {
  background: var(--panel);
  border: 1px solid rgba(0,240,255,.35);
  box-shadow: 0 0 40px rgba(0,240,255,.15), inset 0 0 40px rgba(0,0,0,.3);
  padding: 36px 48px;
  text-align: center;
  border-radius: 8px;
  min-width: 360px;
}
.panel h1 {
  font-family: Orbitron, sans-serif;
  font-weight: 900;
  font-size: 42px;
  letter-spacing: 4px;
  color: var(--neon);
  text-shadow: 0 0 20px var(--neon);
}
.panel .tag {
  margin: 10px 0 24px;
  color: #bbb;
  letter-spacing: 2px;
}
.panel .credits {
  margin-top: 20px;
  font-size: 11px;
  color: #666;
}

.btn {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 16px;
  padding: 14px 36px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  color: #041018;
  background: linear-gradient(135deg, #00f0ff, #7b61ff);
  box-shadow: 0 0 24px rgba(0,240,255,.45);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 36px rgba(0,240,255,.7);
}
.btn:active { transform: scale(.98); }

#go-title {
  color: var(--hot);
  text-shadow: 0 0 24px var(--hot);
}
#go-score { margin: 12px 0 22px; font-size: 20px; color: var(--gold); }

/* Character select */
.select-panel { min-width: 560px; max-width: 820px; }
.dungeon-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}
.dungeon-card {
  background: rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  min-height: 92px;
  transition: .12s ease;
}
.dungeon-card.active {
  box-shadow: 0 0 16px rgba(0,240,255,.35);
  background: rgba(0,40,60,.45);
}
.dungeon-card .d-name {
  font-family: Orbitron, sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.dungeon-card .tag {
  margin-top: 4px;
  font-size: 10px;
  color: #9c9;
}
.dungeon-card .tag.warn { color: #f96; }
.boss-thumb {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  display: block;
  margin-bottom: 6px;
}
@media (max-width: 900px) {
  .dungeon-row { grid-template-columns: 1fr 1fr; }
}
.hero-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 18px 0 12px;
}
.hero-card {
  width: 150px;
  padding: 12px 10px 14px;
  border-radius: 8px;
  background: rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.12);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.hero-card img {
  width: 96px;
  height: 100px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto 8px;
}
.hero-card .hero-name {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.hero-card .hero-role {
  margin-top: 4px;
  font-size: 11px;
  color: #99a;
}
.hero-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,240,255,.45);
}
.hero-card.active {
  border-color: var(--neon);
  box-shadow: 0 0 24px rgba(0,240,255,.35);
  background: rgba(0,40,60,.45);
}
.select-desc {
  min-height: 44px;
  margin: 8px 0 16px;
  color: #ccc;
  font-size: 13px;
  line-height: 1.5;
}
.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-hot {
  background: linear-gradient(135deg, #ff2d6a, #ff8f4a);
  box-shadow: 0 0 24px rgba(255,45,106,.45);
  color: #fff;
}
.btn-hot:hover {
  box-shadow: 0 0 36px rgba(255,45,106,.7);
}
.btn-ghost {
  background: transparent;
  color: var(--neon);
  border: 1px solid rgba(0,240,255,.45);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(0,240,255,.1);
  box-shadow: 0 0 16px rgba(0,240,255,.25);
}

/* HUD meta */
.meta-mini {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #cde;
  margin: 4px 0 2px;
  font-family: Orbitron, sans-serif;
}
.bar-track.exp { height: 6px; width: 180px; margin-bottom: 4px; }
.bar-fill.exp {
  background: linear-gradient(90deg, #7b61ff, #00f0ff);
  box-shadow: 0 0 8px rgba(123,97,255,.5);
}
.meta-atk { font-size: 11px; color: #9ab; }
.hud-btn { pointer-events: auto; margin-top: 6px; }

/* Meta panel */
.meta-panel {
  min-width: min(720px, 94vw);
  max-width: 820px;
  max-height: 86vh;
  overflow: auto;
  text-align: left;
  padding: 22px 24px 26px;
}
.meta-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.meta-head h2 {
  font-family: Orbitron, sans-serif;
  color: var(--neon);
  letter-spacing: 2px;
}
.meta-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.meta-tab {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #ccc;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: Orbitron, sans-serif;
  font-size: 12px;
}
.meta-tab.active {
  color: #041018;
  background: linear-gradient(135deg, #00f0ff, #7b61ff);
  border-color: transparent;
}
.meta-pane.hidden { display: none; }
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: 13px;
}
.meta-note {
  margin-top: 12px;
  font-size: 12px;
  color: #889;
  line-height: 1.5;
}
.meta-note.warn { color: #ffb070; }
.muted { color: #889; font-size: 12px; margin-top: 2px; }

.eq-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.eq-slot {
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 10px;
  min-height: 96px;
}
.eq-slot.empty { opacity: .7; }
.eq-title {
  font-size: 11px;
  color: var(--neon);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.bag-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.bag-item, .shop-item, .boss-card, .pay-card {
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: 10px;
}
.row-btns { display: flex; gap: 6px; margin-top: 6px; }
.mini-btn {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  color: #041018;
  background: linear-gradient(135deg, #00f0ff, #7b61ff);
}
.mini-btn.ghost {
  background: transparent;
  color: #bcd;
  border: 1px solid rgba(255,255,255,.2);
}
.boss-grid, .pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.boss-name, .pay-name {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
}
.pay-price {
  font-size: 20px;
  color: var(--gold);
  margin: 4px 0;
}
.pay-card .tag {
  font-size: 10px;
  color: var(--hot);
}
#meta-toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.8);
  border: 1px solid rgba(0,240,255,.35);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 40;
  font-size: 13px;
}
#meta-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 720px) {
  .bag-list, .boss-grid, .pay-grid, .eq-row, .meta-grid { grid-template-columns: 1fr; }
}
