/* ===== Orbit Strike UI ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070f; }
body { font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; color: #dfe8ff; user-select: none; }

#boot-warning {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 100; background: #3a1010; border: 1px solid #ff6d6d; color: #ffd7d7;
  padding: 12px 22px; border-radius: 8px; font-size: 14px; line-height: 1.6; text-align: center;
}
#boot-warning code { color: #ffd257; }

#game-container { position: relative; width: 100%; height: 100%; }
#game-canvas { display: block; width: 100%; height: 100%; }

.hidden { display: none !important; }
.screen { position: absolute; inset: 0; }

/* ===== Menu screens ===== */
.menu-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: radial-gradient(ellipse at center, rgba(10,16,38,.92), rgba(3,5,12,.97));
  z-index: 20; text-align: center; padding: 24px;
}
.menu-screen.overlay { background: rgba(4, 6, 14, .82); backdrop-filter: blur(4px); }

.game-title {
  font-size: clamp(48px, 9vw, 96px); letter-spacing: .08em; font-weight: 900;
  color: #64d7ff; text-shadow: 0 0 24px #2a9fff88, 0 0 64px #2a9fff44;
}
.game-title span { color: #ffd257; text-shadow: 0 0 24px #ffb63088; }
.subtitle { color: #8fa3cc; font-size: 18px; }
.controls-hint { color: #6c7ea8; font-size: 13px; line-height: 1.7; }

.screen-title { font-size: 42px; letter-spacing: .12em; color: #64d7ff; text-shadow: 0 0 18px #2a9fff66; }
.screen-title.good { color: #6dff9e; text-shadow: 0 0 18px #2aff7a55; }
.screen-title.bad  { color: #ff6d6d; text-shadow: 0 0 18px #ff2a2a55; }
.screen-title.gold { color: #ffd257; text-shadow: 0 0 22px #ffb63077; }

.btn {
  font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: .08em;
  padding: 12px 34px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(180deg, #1d6fd8, #134a9c); color: #eaf4ff;
  border: 1px solid #4aa3ff; box-shadow: 0 0 14px #1d6fd855;
  transition: transform .08s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 22px #4aa3ff88; }
.btn.big { font-size: 22px; padding: 16px 52px; }
.btn.tiny { font-size: 12px; padding: 6px 16px; }
.btn.ghost { background: transparent; border-color: #3b4d78; color: #8fa3cc; box-shadow: none; }
.btn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; }
.row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.map-stars { font-size: 22px; color: #ffd257; font-weight: 800; letter-spacing: .05em; }

/* ===== Map nodes ===== */
#map-nodes { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 1100px; }
.map-node {
  width: 170px; padding: 16px 12px; border-radius: 12px; cursor: pointer;
  background: #0c1430; border: 2px solid #24345e; transition: all .15s;
}
.map-node .node-num { font-size: 30px; font-weight: 900; color: #4a5f92; }
.map-node .node-name { font-size: 14px; margin-top: 6px; color: #8fa3cc; min-height: 34px; }
.map-node .node-status { font-size: 11px; margin-top: 8px; letter-spacing: .1em; color: #55688f; }
.map-node.completed { border-color: #2f8f5b; }
.map-node.completed .node-status { color: #6dff9e; }
.map-node.available { border-color: #ffd257; box-shadow: 0 0 22px #ffd25744; cursor: pointer; }
.map-node.available:hover { transform: scale(1.06); }
.map-node.available .node-num { color: #ffd257; }
.map-node.available .node-status { color: #ffd257; }
.map-node.locked { opacity: .45; cursor: default; }
.map-connector { width: 34px; height: 3px; background: #24345e; border-radius: 2px; }
.map-connector.done { background: #2f8f5b; }

/* ===== Shop ===== */
#shop-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; width: min(1150px, 92vw); max-height: 62vh; overflow-y: auto; padding: 4px;
}
.shop-item {
  background: #0c1430; border: 1px solid #24345e; border-radius: 10px;
  padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px;
}
.shop-item h3 { font-size: 16px; color: #64d7ff; letter-spacing: .04em; }
.shop-item .desc { font-size: 12px; color: #8fa3cc; min-height: 30px; }
.shop-item .lvl-pips { display: flex; gap: 4px; }
.shop-item .pip { width: 18px; height: 8px; border-radius: 2px; background: #222f52; }
.shop-item .pip.on { background: #ffd257; box-shadow: 0 0 6px #ffd25788; }
.shop-item .buy-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.shop-item .cost { color: #ffd257; font-weight: 800; }
.shop-item .maxed { color: #6dff9e; font-weight: 700; font-size: 13px; }
.shop-item button { padding: 7px 20px; font-size: 13px; }

/* ===== HUD ===== */
#hud { z-index: 10; pointer-events: none; }
#hud-top {
  position: absolute; top: 12px; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 26px;
}
.hud-block { text-align: center; }
.hud-label { font-size: 11px; letter-spacing: .18em; color: #6c7ea8; }
.hud-value { font-size: 24px; font-weight: 800; color: #eaf4ff; text-shadow: 0 0 10px #2a9fff55; }
.hud-value.stars { color: #ffd257; text-shadow: 0 0 10px #ffb63066; }

#hud-progress-wrap {
  position: absolute; top: 0; left: 0; right: 0; height: 4px; background: #101a36;
}
#hud-progress { height: 100%; width: 0%; background: linear-gradient(90deg, #2a9fff, #6dff9e); transition: width .3s linear; }

#boss-bar-wrap { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); width: min(560px, 70vw); text-align: center; }
.boss-name { font-size: 13px; letter-spacing: .3em; color: #ff6d6d; margin-bottom: 4px; text-shadow: 0 0 8px #ff2a2a66; }
#boss-bar-bg { height: 12px; background: #2a1020; border: 1px solid #ff4a5a; border-radius: 6px; overflow: hidden; }
#boss-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4a5a, #ff9a3d); transition: width .15s; }

#hud-bottom { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 26px; align-items: flex-end; }
.bar-group { width: min(300px, 34vw); }
.bar-group.right { text-align: right; }
.bar-bg { height: 14px; background: #101a36; border: 1px solid #24345e; border-radius: 7px; overflow: hidden; margin-top: 4px; }
.bar-bg.thin { height: 7px; }
.bar { height: 100%; width: 100%; transition: width .12s; }
.bar.hp { background: linear-gradient(90deg, #ff4a5a, #6dff9e 70%); }
.bar.shield { background: #4aa3ff; }
.bar.special { background: linear-gradient(90deg, #b04aff, #ff4ad8); }
.key-hint { color: #4a5f92; font-size: 10px; }

/* ===== Stats panels / toast ===== */
.stats-panel {
  background: #0c1430; border: 1px solid #24345e; border-radius: 12px;
  padding: 18px 30px; min-width: 340px; text-align: left; font-size: 15px; line-height: 2;
}
.stats-panel .stat-row { display: flex; justify-content: space-between; gap: 40px; }
.stats-panel .stat-row b { color: #ffd257; }
.stats-panel .obj-ok { color: #6dff9e; }
.stats-panel .obj-fail { color: #ff6d6d; }

/* ===== Dev: level jump hack ===== */
#dev-panel {
  position: absolute; bottom: 14px; right: 14px; z-index: 50;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
#dev-toggle {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(12, 20, 48, .85); border: 1px solid #3b4d78; color: #8fa3cc;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
#dev-toggle:hover { border-color: #ffd257; color: #ffd257; }
#dev-body {
  background: rgba(8, 12, 28, .95); border: 1px solid #3b4d78; border-radius: 10px;
  padding: 10px 12px; min-width: 150px;
}
.dev-label { font-size: 10px; letter-spacing: .12em; color: #6c7ea8; margin-bottom: 6px; }
#dev-levels { display: flex; gap: 6px; flex-wrap: wrap; }
#dev-levels button {
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-weight: 800; font-size: 13px;
  background: #14203e; border: 1px solid #2a3d68; color: #dfe8ff;
}
#dev-levels button:hover { border-color: #ffd257; color: #ffd257; }

#toast {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  background: rgba(12, 20, 48, .9); border: 1px solid #4aa3ff; color: #eaf4ff;
  padding: 10px 26px; border-radius: 8px; font-size: 17px; letter-spacing: .06em;
  z-index: 15; pointer-events: none; text-shadow: 0 0 8px #2a9fff88;
}
