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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #05070a;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e8f0ff;
  user-select: none;
}

#game {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  background: #0a0e14;
  cursor: crosshair;
}

#vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 220px rgba(0,0,0,0.75);
  z-index: 5;
}

.hidden { display: none !important; }

#settingsBtn {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  width: 38px; height: 38px; padding: 0;
  background: rgba(10,14,22,0.7); border: 1px solid #263447; border-radius: 50%;
  color: #e8f0ff; font-size: 1.1em; box-shadow: none;
}
#settingsBtn:hover { transform: none; box-shadow: 0 0 0 2px #4cc9f0; }

#settingsPanel {
  position: fixed; top: 58px; right: 14px; z-index: 60;
  background: linear-gradient(160deg, #131a26 0%, #0c1119 100%);
  border: 1px solid #263447; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; min-width: 190px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#settingsPanel label { font-size: 0.78em; color: #8ba0bd; display: flex; flex-direction: column; gap: 4px; }
#settingsPanel label.toggleRow { flex-direction: row; align-items: center; justify-content: space-between; }
#settingsPanel input[type="range"] { width: 100%; }
#muteBtn { padding: 8px; font-size: 0.85em; }

.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,14,22,0.75) 0%, rgba(4,6,10,0.95) 100%);
  z-index: 50;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  background: linear-gradient(160deg, #131a26 0%, #0c1119 100%);
  border: 1px solid #263447;
  border-radius: 14px;
  padding: 34px 42px;
  min-width: 340px;
  max-width: 90vw;
  box-shadow: 0 0 60px rgba(76, 201, 240, 0.08), 0 20px 50px rgba(0,0,0,0.6);
  text-align: center;
}

h1 { font-size: 2.4em; letter-spacing: 4px; font-weight: 800; }
h2 { font-size: 1.8em; letter-spacing: 2px; margin-bottom: 4px; }
.accent { color: #ef476f; text-shadow: 0 0 20px rgba(239,71,111,0.6); }
.subtitle { color: #8ba0bd; margin: 8px 0 22px; font-size: 0.95em; }

.highScoreHint { color: #ffd166; margin-top: 14px; }
.scorePanel {
  background: rgba(10, 15, 23, 0.7);
  border: 1px solid #2a3a50;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 22px;
  text-align: left;
}
.scoreTotal {
  font-size: 1.6em;
  font-weight: 800;
  color: #4cc9f0;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.scoreTotal.newRecord { color: #ffd166; text-shadow: 0 0 16px rgba(255, 209, 102, 0.35); }
.scoreBreakdown { color: #8ba0bd; font-size: 0.88em; line-height: 1.7; }
.scoreBreakdown b { color: #c5d4e8; font-weight: 600; }
.scoreRecord { margin-top: 10px; color: #6d8099; font-size: 0.82em; }
.scoreRecord b { color: #8ba0bd; }

.joinPanel label {
  display: block; text-align: left; font-size: 0.8em; color: #8ba0bd;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px;
}

#nameInput {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  background: #0a0f17; border: 1px solid #2a3a50; border-radius: 8px;
  color: #e8f0ff; font-size: 1em;
}
#nameInput:focus { outline: none; border-color: #4cc9f0; }

button {
  width: 100%; padding: 14px; font-size: 1.05em; font-weight: 700; letter-spacing: 1.5px;
  background: linear-gradient(135deg, #4cc9f0, #4361ee);
  color: #05070a; border: none; border-radius: 8px; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(76,201,240,0.25);
}
button:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(76,201,240,0.4); }
button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

/* Secondary action: online session buttons sit below the primary solo button. */
button.secondary {
  background: linear-gradient(135deg, #1b2534, #141c28);
  color: #cfe0f5; border: 1px solid #2a3a50; box-shadow: none;
}
button.secondary:hover { border-color: #4cc9f0; box-shadow: 0 6px 18px rgba(76,201,240,0.18); }

.onlineSplit {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 12px; color: #4a5d78; font-size: 0.72em;
  text-transform: uppercase; letter-spacing: 2px;
}
.onlineSplit::before, .onlineSplit::after {
  content: ''; flex: 1; height: 1px; background: #263447;
}

.onlineRow { display: flex; flex-direction: column; gap: 8px; }
.joinCodeRow { display: flex; gap: 8px; }
#codeInput {
  flex: 1; min-width: 0; padding: 12px 14px; text-align: center;
  background: #0a0f17; border: 1px solid #2a3a50; border-radius: 8px;
  color: #e8f0ff; font-size: 1.15em; font-weight: 700;
  letter-spacing: 6px; text-transform: uppercase;
}
#codeInput:focus { outline: none; border-color: #4cc9f0; }
.joinCodeRow button { flex: 0 0 auto; width: auto; padding: 12px 18px; font-size: 0.85em; }

#sessionCodeBox {
  margin: 4px 0 18px; padding: 14px 18px; border-radius: 12px;
  background: rgba(76,201,240,0.08); border: 1px solid #2a5a72;
}
.sessionCodeLabel {
  font-size: 0.7em; letter-spacing: 3px; text-transform: uppercase; color: #7fb3cc;
}
#sessionCodeValue {
  font-size: 2.4em; font-weight: 900; letter-spacing: 10px; color: #4cc9f0;
  text-shadow: 0 0 24px rgba(76,201,240,0.5); margin: 4px 0 2px;
}
.sessionCodeHint { font-size: 0.72em; color: #5d7290; }

.hint { margin-top: 14px; font-size: 0.8em; color: #5d7290; line-height: 1.5; }
.hint.error { color: #ef476f; font-weight: 600; }

#lobbyPlayers { margin: 18px 0; display: flex; flex-direction: column; gap: 8px; }
.skinSection { margin: 6px 0 14px; }
.skinLabel {
  font-size: 0.78em; font-weight: 700; letter-spacing: 1.2px; color: #8ba0bd;
  text-transform: uppercase; margin-bottom: 8px;
}
#skinPicker.locked { opacity: 0.45; pointer-events: none; }
.skinCard { padding: 10px 8px !important; }
.skinCard canvas {
  display: block; margin: 0 auto 6px; border-radius: 50%;
  background: rgba(0,0,0,0.22); width: 48px; height: 48px;
}
.lobbyRowLeft { display: flex; align-items: center; gap: 10px; }
.lobbySkinPreview {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: rgba(0,0,0,0.25);
}
.classGrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 14px 0 6px;
}
.classCard {
  background: rgba(10,14,22,0.75); border: 2px solid #263447; border-radius: 10px;
  padding: 12px 10px; cursor: pointer; text-align: center; transition: border-color 0.15s, transform 0.15s;
}
.classCard:hover { border-color: #4cc9f0; transform: translateY(-2px); }
.classCard.selected { border-color: #7bf1a8; box-shadow: 0 0 14px rgba(123,241,168,0.25); }
.classCard .classIcon { font-size: 1.8em; line-height: 1; }
.classCard .className { font-weight: 700; font-size: 0.88em; margin-top: 6px; letter-spacing: 0.5px; }
.classCard .classTag { font-size: 0.68em; color: #5d7290; margin-top: 2px; }
.classCard .classDesc { font-size: 0.72em; color: #8ba0bd; margin-top: 6px; line-height: 1.35; }
#readyBtn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.lobbyRow {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(10,14,22,0.6); border: 1px solid #263447; border-radius: 8px;
  padding: 8px 14px; font-size: 0.9em;
}
.lobbyRow .readyTag { font-size: 0.78em; font-weight: 700; color: #5d7290; }
.lobbyRow.isReady .readyTag { color: #7bf1a8; }
#readyBtn.isReady { background: linear-gradient(135deg, #7bf1a8, #4cc9f0); }

.controlsList {
  margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px;
  font-size: 0.82em; color: #8ba0bd; text-align: left; border-top: 1px solid #263447; padding-top: 18px;
}
.controlsList b { color: #4cc9f0; margin-right: 4px; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-variant-numeric: tabular-nums; }

#topBar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#waveInfo {
  background: rgba(10,14,22,0.7); border: 1px solid #263447; border-radius: 20px;
  padding: 4px 22px; font-weight: 700; letter-spacing: 2px; font-size: 0.95em;
}
#waveInfo span { color: #ffd166; }
#difficultyNum { color: #f4a261; }

#pressureHud {
  width: 340px; background: rgba(10,14,22,0.82); border: 1px solid #3d2a1a;
  border-radius: 10px; padding: 6px 12px; transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#pressureHud.active {
  border-color: #e85d04;
  box-shadow: 0 0 16px rgba(232,93,4,0.35);
  animation: pressurePulse 1.2s ease-in-out infinite;
}
#pressureLabel {
  font-size: 0.72em; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #8ba0bd; text-align: center; margin-bottom: 4px;
}
#pressureHud.active #pressureLabel { color: #ffd166; }
#pressureBarWrap {
  height: 8px; background: #0a0f17; border-radius: 4px; overflow: hidden;
  border: 1px solid #1c2735; margin-bottom: 4px;
}
#pressureBarFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #e85d04, #ff006e);
  transition: width 0.15s linear;
}
#pressureDetail {
  font-size: 0.68em; font-weight: 700; letter-spacing: 1px; text-align: center; color: #e85d04;
}
@keyframes pressurePulse {
  0%, 100% { box-shadow: 0 0 12px rgba(232,93,4,0.25); }
  50% { box-shadow: 0 0 22px rgba(255,0,110,0.45); }
}

#xpBarWrap {
  width: 340px; height: 20px; background: rgba(10,14,22,0.8);
  border: 1px solid #263447; border-radius: 10px; overflow: hidden; position: relative;
}
#xpBarFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7bf1a8, #4cc9f0);
  transition: width 0.2s ease;
}
#xpLabel {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.72em; font-weight: 700; letter-spacing: 1px; color: #05070a; text-shadow: 0 0 4px rgba(255,255,255,0.4);
}

#waveCountdown, #mapTransitionCountdown {
  position: absolute; top: 28%; left: 50%; transform: translate(-50%, -100%);
  text-align: center; pointer-events: none; animation: fadeIn 0.3s ease;
}
#waveCountdown .countdownLabel, #mapTransitionCountdown .countdownLabel {
  font-size: 1.1em; letter-spacing: 4px; text-transform: uppercase; color: #ffd166;
  text-shadow: 0 0 20px rgba(255,209,102,0.6); margin-bottom: 6px; font-weight: 600;
}
#waveCountdown .countdownNum, #mapTransitionCountdown .countdownNum {
  font-size: 5.5em; font-weight: 900; color: #fff; line-height: 1;
  text-shadow: 0 0 30px rgba(76,201,240,0.7), 0 4px 14px rgba(0,0,0,0.8);
}
#waveCountdown .specialWaveLabel, #mapTransitionCountdown .specialWaveLabel {
  margin-top: 12px; font-size: 1.3em; font-weight: 800; letter-spacing: 3px;
  text-transform: uppercase; color: #00b4d8;
  text-shadow: 0 0 22px rgba(0,180,216,0.7), 0 2px 8px rgba(0,0,0,0.8);
}
#waveCountdown .specialWaveLabel.hidden { display: none; }

/* ---- Prominent next-map transition banner ---- */
#mapTransitionCountdown {
  top: 30%;
  min-width: 340px;
  padding: 22px 40px;
  background: rgba(8, 12, 20, 0.82);
  border: 2px solid rgba(76, 201, 240, 0.55);
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(76, 201, 240, 0.25), 0 12px 40px rgba(0,0,0,0.6);
}
#mapTransitionCountdown .mapTransitionKicker {
  font-size: 1.05em; letter-spacing: 6px; text-transform: uppercase; color: #ffd166;
  text-shadow: 0 0 20px rgba(255,209,102,0.6); margin-bottom: 10px; font-weight: 700;
}
#mapTransitionCountdown .mapTransitionName {
  font-size: 3.2em; font-weight: 900; line-height: 1; color: #fff;
  text-shadow: 0 0 34px rgba(76,201,240,0.8), 0 4px 14px rgba(0,0,0,0.85);
  margin-bottom: 16px;
}
#mapTransitionCountdown .mapTransitionBar {
  height: 10px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(76,201,240,0.35);
}
#mapTransitionCountdown .mapTransitionBarFill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #4cc9f0, #00b4d8);
  box-shadow: 0 0 16px rgba(76,201,240,0.7);
  transition: width 0.25s linear;
}
#mapTransitionCountdown .mapTransitionTimerRow {
  margin-top: 12px; font-size: 1.1em; letter-spacing: 2px; color: #cfe8ff;
  text-transform: uppercase;
}
#mapTransitionCountdown .mapTransitionTimerRow .countdownNum {
  font-size: 1.4em; font-weight: 900; color: #fff; margin-left: 6px;
  text-shadow: 0 0 18px rgba(76,201,240,0.7);
}

#playersPanel { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 8px; }
.playerCard {
  background: rgba(10,14,22,0.75); border: 1px solid #263447; border-radius: 10px;
  padding: 8px 12px; min-width: 190px;
}
.playerCard .pname { font-size: 0.78em; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 4px; display:flex; justify-content: space-between;}
.playerCard .killCount { font-weight: 400; color: #8ba0bd; font-size: 0.9em; }
.hpBarWrap { height: 12px; background: #0a0f17; border-radius: 6px; overflow: hidden; border: 1px solid #1c2735; position: relative; }
/* Ghost bar sits behind the fill and transitions much slower, so a sudden
   drop briefly leaves it poking out past the fill — a visible "chunk" of
   just-lost HP, à la fighting-game health bars. */
.hpBarGhost { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: rgba(255,255,255,0.5); transition: width 0.6s ease; z-index: 1; }
.hpBarFill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: linear-gradient(90deg, #ef476f, #ffd166); transition: width 0.15s ease; z-index: 2; }
.playerCard.dead { opacity: 0.4; }
.playerCard.downed { border-color: #ffd166; animation: downedPulse 1s ease-in-out infinite; }
@keyframes downedPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,209,102,0); } 50% { box-shadow: 0 0 12px rgba(255,209,102,0.5); } }
.playerCard.you { border-color: #4cc9f0; }

#bottomCenterHud {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 45; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
#weaponHud {
  background: rgba(10,14,22,0.78); border: 1px solid #263447; border-radius: 12px;
  padding: 10px 24px; text-align: center; min-width: 200px;
}
#weaponName { font-weight: 800; letter-spacing: 2px; font-size: 1.05em; }
#weaponPath { margin-top: 4px; font-size: 0.75em; color: #8ba0bd; }

#killFeed { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.killMsg { font-size: 0.75em; background: rgba(10,14,22,0.7); padding: 3px 10px; border-radius: 8px; color: #8ba0bd; animation: fadeIn 0.2s ease; }

#connStatus { position: absolute; bottom: 16px; right: 16px; font-size: 0.7em; color: #4a5d78; }

.levelupStats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px;
  margin: 2px auto 14px; max-width: 640px;
}
.levelupStats .lstatTitle {
  width: 100%; text-align: center; font-size: 0.72em; letter-spacing: 3px;
  text-transform: uppercase; color: #7d93b0; margin-bottom: 2px;
}
.levelupStats .lstat {
  display: flex; align-items: center; gap: 6px;
  background: rgba(76,201,240,0.08); border: 1px solid rgba(76,201,240,0.22);
  border-radius: 8px; padding: 4px 10px; font-size: 0.82em;
}
.levelupStats .lstatLabel { color: #9fb4d0; }
.levelupStats .lstatVal { color: #fff; font-weight: 700; }

#ownHpBar {
  position: relative;
  width: 340px; height: 30px;
  background: rgba(8, 12, 20, 0.82); border: 2px solid #2a3a50; border-radius: 14px;
  overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
#ownHpBar.hidden { display: none; }
#ownHpBar.low { border-color: #ef476f; box-shadow: 0 0 24px rgba(239,71,111,0.5); }
#ownHpFill {
  position: absolute; top: 0; left: 0; height: 100%; width: 100%;
  background: linear-gradient(90deg, #2ecc71, #7bf1a8);
  transition: width 0.18s ease, background 0.2s ease;
}
#ownHpBar.low #ownHpFill { background: linear-gradient(90deg, #c0392b, #ef476f); }
#ownHpShieldFill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(76,201,240,0.55), rgba(160,231,255,0.7));
  transition: width 0.18s ease; z-index: 2;
}
#ownHpText {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9em; color: #fff; z-index: 3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9); letter-spacing: 1px;
}

#spectateHint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 60; pointer-events: none;
  background: rgba(10, 14, 22, 0.78); border: 1px solid rgba(76, 201, 240, 0.5);
  color: #cfe8ff; padding: 6px 16px; border-radius: 10px;
  font-size: 0.95em; letter-spacing: 0.04em; box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  animation: fadeIn 0.2s ease;
}

/* ---------------- Dev perf overlay (F3) ---------------- */
#perfHud {
  position: fixed; top: 58px; left: 16px; z-index: 65;
  pointer-events: none; font-family: Consolas, 'Courier New', monospace;
  font-size: 11px; line-height: 1.45; color: #b8f0c8;
  background: rgba(4, 8, 12, 0.88); border: 1px solid #1e3a2a;
  border-radius: 8px; padding: 8px 10px; min-width: 210px;
  white-space: pre; tab-size: 2;
}
#perfHud.warn { color: #ffd166; border-color: #4a3a1a; }
#perfHud.bad { color: #ff8a8a; border-color: #4a1a1a; }

/* ---------------- Dev panel (F2) ---------------- */
#devBtn {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 38px; height: 38px; padding: 0;
  background: rgba(10,14,22,0.7); border: 1px solid #3a2a47; border-radius: 50%;
  color: #e8f0ff; font-size: 1.05em; box-shadow: none;
}
#devBtn:hover { transform: none; box-shadow: 0 0 0 2px #b388ff; }

#devPanel {
  position: fixed; top: 58px; left: 14px; z-index: 60;
  background: linear-gradient(160deg, #1a1426 0%, #0c1119 100%);
  border: 1px solid #3a2a47; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; min-width: 260px; max-width: 300px;
  max-height: calc(100vh - 72px); overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#devPanel .devHeader {
  font-size: 0.82em; font-weight: 700; letter-spacing: 1px; color: #c9b8ff;
  text-transform: uppercase; margin-bottom: 2px;
}
#devPanel .devHint { font-weight: 400; color: #6d8099; font-size: 0.85em; }
#devPanel label { font-size: 0.78em; color: #8ba0bd; display: flex; flex-direction: column; gap: 4px; }
#devPanel label.toggleRow { flex-direction: row; align-items: center; justify-content: space-between; }
#devPanel input[type="number"], #devPanel select {
  width: 100%; padding: 7px 8px;
  background: #0a0f17; border: 1px solid #2a3a50; border-radius: 6px;
  color: #e8f0ff; font-size: 0.95em;
}
#devPanel input[type="number"]:focus, #devPanel select:focus { outline: none; border-color: #b388ff; }
#devApplyBtn { padding: 9px; font-size: 0.85em; background: #3d2a5c; border-color: #5a3d8a; }
#devApplyBtn:hover { background: #4a3570; }
#devApplyBtn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.devMomentMeta { font-size: 0.72em; line-height: 1.4; color: #8ba0bd; }
.devMomentMeta .devPhase { color: #ffd166; font-weight: 700; letter-spacing: 0.5px; }
.devMomentMeta .devPhaseXp { margin-top: 2px; color: #7bf1a8; font-size: 11px; }
.devMomentMeta .devPhaseDesc { margin-top: 3px; color: #6d8099; }
.devBuildLabel { font-size: 0.72em; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8ba0bd; }
.devBuildList {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 300px; overflow-y: auto; padding-right: 2px;
}
.devBuildCard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 8px 10px; text-align: left;
  background: rgba(10,14,22,0.75); border: 2px solid #263447; border-radius: 8px;
  color: #e8f0ff; cursor: pointer; box-shadow: none; transform: none;
}
.devBuildCard:hover { border-color: #b388ff; transform: none; }
.devBuildCard.selected { border-color: #7bf1a8; box-shadow: 0 0 10px rgba(123,241,168,0.2); }
.devBuildIcon { font-size: 1.1em; line-height: 1; }
.devBuildName { font-size: 0.82em; font-weight: 700; }
.devBuildSub { font-size: 0.68em; color: #6d8099; }
.devStatus { font-size: 0.72em; color: #6d8099; min-height: 1.2em; line-height: 1.4; }
.devStatus.ok { color: #7bf1a8; }
.devStatus.err { color: #ff8a8a; }

/* Test panel: build-quality toggle, boss-level / ascension selectors, readout */
#devPanel { overflow-y: auto; }
.devBuildList { max-height: 300px; }
.devQualityRow { display: flex; gap: 6px; }
.devQualityBtn {
  flex: 1; padding: 6px 4px; font-size: 0.72em; font-weight: 700;
  background: rgba(10,14,22,0.75); border: 2px solid #263447; border-radius: 6px;
  color: #b9c6da; cursor: pointer; box-shadow: none; transform: none;
}
.devQualityBtn:hover { border-color: #b388ff; }
.devQualityBtn.selected { border-color: #7bf1a8; color: #e8f0ff; box-shadow: 0 0 8px rgba(123,241,168,0.2); }
.devReadout {
  font-size: 0.72em; line-height: 1.5; color: #b9c6da;
  background: rgba(10,14,22,0.6); border: 1px solid #2a3a50; border-radius: 6px; padding: 7px 9px;
}
.devReadout .devReadoutRow b { color: #ffd166; }
.devReadout .devReadoutDelta { color: #ff8a8a; }
.devReadoutMods { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.ascChip {
  font-size: 0.9em; padding: 2px 6px; border-radius: 5px;
  background: rgba(179,136,255,0.14); border: 1px solid #4a3570; color: #d7c8ff;
}

/* HUD ascension badge */
.ascensionBadge { color: #ff8a5c; font-weight: 700; letter-spacing: 0.5px; }

/* Lobby ascension picker */
.ascensionSection { margin: 6px 0 14px; }
.ascensionSection.locked { opacity: 0.5; pointer-events: none; }
.ascensionGrid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ascTile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 84px; padding: 8px 6px; cursor: pointer;
  background: rgba(10,14,22,0.7); border: 2px solid #263447; border-radius: 10px;
  color: #e8f0ff; box-shadow: none; transform: none;
}
.ascTile:hover { border-color: #b388ff; }
.ascTile.selected { border-color: #7bf1a8; box-shadow: 0 0 12px rgba(123,241,168,0.25); }
.ascTile.locked { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.6); }
.ascTileIcon { font-size: 1.4em; line-height: 1; }
.ascTileName { font-size: 0.74em; font-weight: 700; text-align: center; }
.ascTileTag { font-size: 0.62em; color: #8ba0bd; letter-spacing: 0.5px; }
.ascTileLock { position: absolute; top: 4px; right: 6px; font-size: 0.7em; opacity: 0; }
.ascTile.locked .ascTileLock { opacity: 0.9; }
.ascensionDesc { margin-top: 10px; font-size: 0.78em; line-height: 1.5; color: #9fb0c9; text-align: left; }
.ascDescRow { margin: 4px 0; }
.ascDescRow b { color: #ffd166; }

/* Victory screen */
.victoryUnlock {
  margin: 10px auto 4px; max-width: 460px; font-size: 0.9em; line-height: 1.5; color: #d7c8ff;
  background: rgba(179,136,255,0.1); border: 1px solid #4a3570; border-radius: 8px; padding: 10px 14px;
}
.victoryButtons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
#victoryScreen h1.accent { color: #ffd166; }
#continueInfiniteBtn { background: #3d2a5c; border-color: #5a3d8a; }
#continueInfiniteBtn:hover { background: #4a3570; }
.victoryButtons .secondary { background: #223047; border-color: #34506e; }

/* ---------------- Upgrade cards ---------------- */
#upgradeCards { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; justify-content: center; max-width: 1200px; }
.upgradeCard {
  width: 190px; background: linear-gradient(160deg, #161f2d, #0d1219);
  border: 1px solid #2a3a50; border-radius: 12px; padding: 18px 14px;
  cursor: pointer; pointer-events: all; transition: transform 0.15s ease, border-color 0.15s ease;
  animation: cardPopIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
/* JS drives the live hover transform (perspective tilt toward the cursor);
   this rule only supplies the glow/border feedback. */
.upgradeCard:hover { border-color: #4cc9f0; box-shadow: 0 10px 30px rgba(76,201,240,0.25); }
/* Inner wrapper carries the JS hover-tilt so the card's hit-box stays put. */
.upgradeCard .cardInner { transition: transform 0.15s ease; transform-style: preserve-3d; }
.upgradeCard:nth-child(1) { animation-delay: 0s; }
.upgradeCard:nth-child(2) { animation-delay: 0.06s; }
.upgradeCard:nth-child(3) { animation-delay: 0.12s; }
.upgradeCard:nth-child(4) { animation-delay: 0.18s; }
.upgradeCard:nth-child(5) { animation-delay: 0.24s; }
@keyframes cardPopIn {
  0% { opacity: 0; transform: translateY(22px) scale(0.82); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.upgradeCard .icon { font-size: 2.2em; margin-bottom: 8px; }
.upgradeCard .uname { font-weight: 700; font-size: 0.95em; margin-bottom: 6px; }
.upgradeCard .udesc { font-size: 0.78em; color: #8ba0bd; line-height: 1.35; }
.upgradeCard .buildTags, #upgradeTip .buildTags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.upgradeCard .buildTag, #upgradeTip .buildTag {
  font-size: 0.62em; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(76,201,240,0.12); color: #8ba0bd; border: 1px solid rgba(76,201,240,0.22);
}
.upgradeCard .buildTag.home, #upgradeTip .buildTag.home {
  background: rgba(123,241,168,0.12); color: #7bf1a8; border-color: rgba(123,241,168,0.35);
}
.upgradeCard .buildTag.spawner, #upgradeTip .buildTag.spawner {
  background: rgba(158,240,26,0.14); color: #9ef01a; border-color: rgba(158,240,26,0.45);
}
.upgradeCard .stackTag { margin-top: 8px; font-size: 0.68em; color: #ffd166; font-weight: 600; cursor: help; text-decoration: underline dotted rgba(255,209,102,0.35); text-underline-offset: 2px; }
.upgradeCard .stackTag.new { color: #7bf1a8; }
.upgradeCard .ustats { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.upgradeCard .ustatRow { display: flex; justify-content: space-between; gap: 8px; font-size: 0.72em; line-height: 1.3; }
.upgradeCard .ustatLabel { color: #8ba0bd; }
.upgradeCard .ustatVal { color: #e8f0fb; font-weight: 600; text-align: right; }
.upgradeCard .ustatDelta { color: #7bf1a8; font-weight: 700; margin-left: 4px; }
.upgradeCard .legendaryNote { margin-top: 8px; font-size: 0.66em; line-height: 1.35; color: #b98a3a; }
.upgradeCard .legendaryNote.reached { color: #ffb703; font-weight: 700; text-shadow: 0 0 8px rgba(255,183,3,0.35); }
.upgradeCard.rarity-rare { border-color: #4361ee; }
.upgradeCard.rarity-legendary { border-color: #f77f00; box-shadow: 0 0 20px rgba(247,127,0,0.15); }
.upgradeCard.weaponCard { border-color: #4cc9f0; width: 210px; }
.upgradeCard.weaponCard:hover { box-shadow: 0 10px 30px rgba(76,201,240,0.35); }
.upgradeCard.weaponCard .icon { font-size: 2.6em; }
.upgradeCard.chosen { border-color: #7bf1a8; box-shadow: 0 0 20px rgba(123,241,168,0.3); }
.upgradeCard.coreCard { width: 230px; border-color: #b98af7; box-shadow: 0 0 22px rgba(157,110,247,0.18); }
.upgradeCard.coreCard:hover { border-color: #c9adff; box-shadow: 0 10px 32px rgba(157,110,247,0.4); }
.upgradeCard.coreCard .icon { font-size: 2.6em; }
.upgradeCard.coreCard .ustats.coreStats { text-align: left; }
.upgradeCard.coreCard .ustats.coreStats .ustatLabel { color: #c9adff; }
.upgradeCard.coreCard .ustats.coreStats .ustatVal { color: #e8f0fb; }

#waitingLabel { margin-top: 18px; color: #8ba0bd; font-size: 0.85em; }
#waitingLabel.goCountdown { color: #ffd166; font-size: 1.6em; font-weight: 700; letter-spacing: 2px; text-shadow: 0 0 18px rgba(255, 209, 102, 0.35); }
.levelupRerollBtn {
  width: auto; min-width: 200px; margin: 16px auto 0; padding: 10px 22px;
  font-size: 0.82em; letter-spacing: 1px;
  background: linear-gradient(135deg, #ffd166, #fb8500);
  box-shadow: 0 6px 18px rgba(255, 184, 77, 0.22);
}
.levelupRerollBtn:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(255, 184, 77, 0.38); }
.levelupRerollBtn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------------- Owned-upgrades bar (blips per level) ---------------- */
#upgradeBar {
  position: fixed; left: 16px; bottom: 16px; z-index: 56;
  display: flex; flex-wrap: wrap; align-content: flex-end; gap: 6px;
  max-width: 320px; max-height: 60vh;
  pointer-events: none;
}
.upgradeChip {
  pointer-events: auto; cursor: help;
  display: flex; align-items: center; gap: 6px;
  background: rgba(10,14,22,0.82); border: 1px solid #2a3a50; border-radius: 9px;
  padding: 4px 8px; transition: border-color 0.12s ease, transform 0.12s ease;
}
.upgradeChip:hover { transform: translateY(-2px); border-color: #4cc9f0; }
.upgradeChip .chipIcon { font-size: 1.05em; line-height: 1; }
.upgradeChip .chipBlips { display: flex; gap: 3px; align-items: center; }
.upgradeChip .blip {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2a3a50; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4);
}
.upgradeChip .blip.on { background: #7bf1a8; box-shadow: 0 0 5px rgba(123,241,168,0.7); }
.upgradeChip.rarity-rare { border-color: #3a4a86; }
.upgradeChip.rarity-rare .blip.on { background: #6c8cff; box-shadow: 0 0 5px rgba(108,140,255,0.7); }
.upgradeChip.rarity-legendary { border-color: #a5691a; }
.upgradeChip.rarity-legendary .blip.on { background: #ffb703; box-shadow: 0 0 5px rgba(255,183,3,0.75); }
.upgradeChip.maxed {
  border-color: #ffb703;
  box-shadow: 0 0 12px rgba(255,183,3,0.3);
}
.upgradeChip.maxed .chipIcon { text-shadow: 0 0 8px rgba(255,183,3,0.6); }

/* timed upgrades: live cooldown/interval bar along the chip's bottom edge */
.upgradeChip.timed { position: relative; padding-bottom: 9px; }
.chipCd {
  position: absolute; left: 7px; right: 7px; bottom: 3px; height: 3px;
  background: rgba(255,255,255,0.09); border-radius: 2px; overflow: hidden;
}
.chipCdFill {
  display: block; height: 100%; width: 0%;
  background: #7bf1a8; border-radius: 2px; transition: width 0.12s linear;
}
.rarity-rare .chipCdFill { background: #6c8cff; }
.rarity-legendary .chipCdFill { background: #ffb703; }
.chipCd.ready .chipCdFill { box-shadow: 0 0 8px currentColor; opacity: 0.95; }

/* activation button for actives (e.g. dash) */
.chipActivate {
  pointer-events: auto; cursor: pointer;
  width: auto; min-width: 26px; height: 20px; padding: 0 6px; margin-left: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7em; font-weight: 700; letter-spacing: 0.5px;
  color: #8ba0bd; background: rgba(255,255,255,0.05);
  border: 1px solid #33465f; border-radius: 6px;
  box-shadow: none; transition: none;
}
.chipActivate:hover { transform: none; box-shadow: none; }
.chipActivate.ready {
  color: #05070a; background: linear-gradient(135deg, #7bf1a8, #4cc9f0);
  border-color: transparent; box-shadow: 0 0 10px rgba(123,241,168,0.5);
}

#upgradeTip {
  position: fixed; z-index: 70; pointer-events: none;
  min-width: 180px; max-width: 300px;
  background: linear-gradient(160deg, #161f2d, #0b0f16);
  border: 1px solid #33465f; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
  animation: fadeIn 0.12s ease;
}
#upgradeTip .tipHead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#upgradeTip .tipIcon { font-size: 1.3em; }
#upgradeTip .tipName { font-weight: 700; font-size: 0.9em; }
#upgradeTip .tipLevel { font-size: 0.7em; color: #ffd166; font-weight: 600; }
#upgradeTip.maxed .tipLevel { color: #ffb703; text-shadow: 0 0 8px rgba(255,183,3,0.4); }
#upgradeTip .tipDesc { font-size: 0.76em; color: #b8c9de; line-height: 1.45; margin-bottom: 8px; }
#upgradeTip .ustatRow { display: flex; justify-content: space-between; gap: 10px; font-size: 0.74em; line-height: 1.4; }
#upgradeTip .ustatLabel { color: #8ba0bd; }
#upgradeTip .ustatVal { color: #e8f0fb; font-weight: 600; text-align: right; }
#upgradeTip .tipLegend { margin-top: 6px; font-size: 0.68em; line-height: 1.35; color: #ffb703; font-weight: 600; }

@media (max-width: 720px) {
  #upgradeCards { flex-direction: column; }
  .upgradeCard { width: 100%; }
}
