* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  background: #0a0a0f;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  color: #00ffc8;
  user-select: none;
  -webkit-user-select: none;
}
#gameContainer {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
canvas {
  display: block;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}
#hud {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
}
#title {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 14px; font-weight: bold; color: #00ffc8;
  text-shadow: 0 0 10px #00ffc8, 0 0 20px #00ffc888;
  letter-spacing: 3px; white-space: nowrap;
}
#depth {
  position: absolute; top: 32px; left: 12px;
  font-size: 14px; color: #aaffcc;
  text-shadow: 0 0 5px #00ffc866;
}
#score {
  position: absolute; top: 50px; left: 12px;
  font-size: 14px; font-weight: bold; color: #ffd700;
  text-shadow: 0 0 8px #ffd70088;
}
#pickaxeDisplay {
  position: absolute; top: 68px; left: 12px;
  font-size: 11px; color: #88ccff;
}
#inventory {
  position: absolute; top: 90px; left: 8px;
  font-size: 11px; line-height: 1.6; color: #ccc;
  background: rgba(0,0,0,0.55); padding: 6px 10px;
  border: 1px solid #00ffc833; border-radius: 4px;
  max-height: 40vh; overflow-y: auto;
}
.inv-row { display: flex; align-items: center; gap: 5px; }
.inv-icon { width: 10px; height: 10px; display: inline-block; border-radius: 2px; flex-shrink: 0; }
/* Health + Stamina bars */
#barsContainer {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: min(300px, 60vw);
}
#staminaBarOuter {
  width: 100%; height: 12px;
  background: #1a1a1a; border: 1px solid #3355ff55; border-radius: 6px;
  overflow: hidden; position: relative;
}
#staminaBarInner {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #2255ff, #55aaff);
  border-radius: 6px; transition: width 0.15s;
}
#lowEnergyText {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #ffaa00; font-weight: bold;
  display: none;
}
@keyframes flicker { 0%,100%{opacity:1} 50%{opacity:0.2} }
.lowEnergyFlicker { animation: flicker 0.4s infinite; display: flex !important; }
#energyLabel {
  font-size: 9px; color: #5599ff; align-self: flex-start;
}
#healthBarOuter {
  width: 100%; height: 14px;
  background: #1a1a1a; border: 1px solid #00ffc855; border-radius: 7px;
  overflow: hidden;
}
#healthBarInner {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #ff3333, #ffaa00, #33ff66);
  border-radius: 7px; transition: width 0.2s;
}
#healthText {
  font-size: 9px; color: #aaffcc; align-self: flex-start;
}
/* Wallet section */
#walletSection {
  position: absolute; top: 30px; right: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  pointer-events: auto;
}
#connectWalletBtn {
  background: rgba(0,255,200,0.1); border: 1px solid #00ffc855;
  color: #00ffc8; font-family: 'Courier New', monospace; font-size: 10px;
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
  pointer-events: auto;
}
#connectWalletBtn:hover { background: rgba(0,255,200,0.25); }
#walletInfo { display: none; flex-direction: column; align-items: flex-end; gap: 3px; }
#walletAddr { font-size: 9px; color: #88ccaa; }
#redeemBtn {
  background: rgba(255,215,0,0.1); border: 1px solid #ffd70055;
  color: #ffd700; font-family: 'Courier New', monospace; font-size: 10px;
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
  pointer-events: auto;
}
#redeemBtn:hover { background: rgba(255,215,0,0.25); }
/* Event banner */
#eventBanner {
  position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); border: 1px solid #ffd700;
  color: #ffd700; font-size: 16px; font-weight: bold;
  padding: 8px 24px; border-radius: 6px;
  letter-spacing: 2px; white-space: nowrap;
  transition: opacity 0.5s;
  opacity: 0; pointer-events: none;
  text-shadow: 0 0 12px #ffd700;
}
/* Mission flash */
#missionFlash {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 28px; font-weight: bold; color: #ffd700;
  text-shadow: 0 0 20px #ffd700, 0 0 40px #ffd70066;
  letter-spacing: 4px;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
/* Missions Button */
#missionsBtn {
  position: absolute; bottom: 50px; right: 8px;
  background: rgba(0,0,0,0.75); border: 1px solid #00ffc8;
  color: #00ffc8; font-family: monospace; font-size: 10px;
  font-weight: bold; letter-spacing: 2px; padding: 6px 12px;
  border-radius: 6px; cursor: pointer;
  transition: background 0.2s; z-index: 80; display: none;
}
#missionsBtn:hover { background: rgba(0,255,200,0.15); }

/* Missions Overlay */
#missionsOverlay {
  display: none; position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  align-items: center; justify-content: center;
  z-index: 90; pointer-events: auto;
}
#missionsOverlay.open { display: flex; }
#missionsBox {
  background: #0a0a1a; border: 1px solid #00ffc8;
  border-radius: 10px; padding: 24px 32px; min-width: 300px;
  max-width: 400px; text-align: center;
}
#missionTitle {
  color: #00ffc8; font-weight: bold; font-size: 14px;
  margin-bottom: 16px; letter-spacing: 3px;
}
.mission-item {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; color: #aaa; font-size: 11px;
  text-align: left;
}
.mission-item.done { color: #ffd700; }
.mission-check { width: 14px; height: 14px; border: 1px solid #555; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.mission-item.done .mission-check { border-color: #ffd700; background: #ffd700; color: #000; }
#closeMissionsBtn {
  margin-top: 16px; background: transparent; border: 1px solid #00ffc8;
  color: #00ffc8; font-family: monospace; font-size: 11px;
  padding: 6px 20px; border-radius: 6px; cursor: pointer;
  letter-spacing: 2px;
}
#closeMissionsBtn:hover { background: rgba(0,255,200,0.1); }
/* Upgrade overlay */
#upgradeOverlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
  display: none; align-items: center; justify-content: center;
  z-index: 60; pointer-events: auto;
}
#upgradeBox {
  border: 1px solid #00ffc8; border-radius: 8px;
  padding: 24px 32px; min-width: 280px;
  background: #0a0a1a;
}
#upgradeBox h2 { color: #00ffc8; font-size: 18px; letter-spacing: 3px; margin-bottom: 16px; text-align: center; }
.upgrade-tier {
  border: 1px solid #333; border-radius: 4px; padding: 10px;
  margin-bottom: 8px; cursor: pointer;
}
.upgrade-tier.current { border-color: #00ffc8; background: rgba(0,255,200,0.08); }
.upgrade-tier.affordable { border-color: #ffd70055; }
.upgrade-tier:hover:not(.current) { background: rgba(255,255,255,0.05); }
.upgrade-tier h3 { font-size: 13px; color: #fff; margin-bottom: 4px; }
.upgrade-tier p { font-size: 10px; color: #888; }
.upgrade-tier .cost { font-size: 11px; color: #ffd700; margin-top: 4px; }
#upgradeClose {
  display: block; margin: 16px auto 0;
  background: transparent; border: 1px solid #555;
  color: #aaa; font-family: 'Courier New', monospace; font-size: 12px;
  padding: 6px 20px; border-radius: 4px; cursor: pointer;
}
#upgradeClose:hover { border-color: #00ffc8; color: #00ffc8; }
/* Ore breakdown in redeem modal */
.redeem-breakdown {
  background: rgba(0,0,0,0.4);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 8px;
  max-height: 160px;
  overflow-y: auto;
}
.redeem-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  border-bottom: 1px solid #222;
}
.redeem-row:last-child { border-bottom: none; }
.redeem-ore-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.redeem-ore-name { color: #ccc; flex: 1; }
.redeem-ore-count { color: #888; width: 35px; text-align: right; }
.redeem-ore-rate { color: #666; width: 45px; text-align: right; }
.redeem-ore-val { color: #ffd700; width: 70px; text-align: right; font-weight: bold; }

/* Redeem modal */
#redeemModal {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.9);
  display: none; align-items: center; justify-content: center;
  z-index: 70; pointer-events: auto;
}
#redeemBox {
  border: 1px solid #ffd700; border-radius: 8px;
  padding: 24px 32px; max-width: 460px; width: 90%; text-align: center;
  background: #0a0a0a;
}
#redeemBox h2 { color: #ffd700; font-size: 18px; margin-bottom: 12px; letter-spacing: 2px; }
#redeemBox p { color: #aaa; font-size: 12px; line-height: 1.6; margin-bottom: 8px; }
#redeemClose {
  margin-top: 16px;
  background: transparent; border: 1px solid #ffd700;
  color: #ffd700; font-family: 'Courier New', monospace; font-size: 12px;
  padding: 6px 20px; border-radius: 4px; cursor: pointer;
}
/* Start screen */
#startScreen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: #0a0a0f;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 100;
}
#startScreen h1 {
  font-size: clamp(24px, 5vw, 48px); color: #00ffc8;
  text-shadow: 0 0 20px #00ffc8, 0 0 40px #00ffc866, 0 0 80px #00ffc833;
  letter-spacing: 6px; margin-bottom: 20px; text-align: center;
}
#startScreen .subtitle {
  font-size: clamp(11px, 2vw, 16px); color: #88ccaa; margin-bottom: 8px; text-align: center; padding: 0 20px;
}
#startScreen .prompt {
  font-size: clamp(14px, 2.5vw, 20px); color: #ffd700;
  margin-top: 30px; animation: blink 1.2s infinite;
}
#startBest { font-size: 13px; color: #ffd700; margin-top: 10px; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
#startCanvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}
/* Death overlay */
#deathOverlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(180,0,0,0.25);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; z-index: 50; pointer-events: auto;
}
#deathOverlay h2 { font-size: 36px; color: #ff4444; text-shadow: 0 0 20px #ff0000; margin-bottom: 10px; }
#deathOverlay .death-score { color: #ffd700; font-size: 18px; margin-bottom: 4px; }
#deathOverlay .death-best { color: #ffaa88; font-size: 14px; margin-bottom: 4px; }
#deathOverlay .death-new { color: #00ffc8; font-size: 16px; font-weight: bold; margin-bottom: 10px; text-shadow: 0 0 10px #00ffc8; display: none; }
#deathOverlay .death-hint { color: #888; font-size: 12px; margin-top: 10px; }
#deathOverlay .death-penalty { color: #ffaa88; font-size: 11px; }
#deathClaimBtn {
  margin-top: 14px;
  background: rgba(255,215,0,0.15); border: 1px solid #ffd700;
  color: #ffd700; font-family: 'Courier New', monospace; font-size: 13px;
  padding: 8px 20px; border-radius: 4px; cursor: pointer;
  display: none;
}
#deathRestartBtn {
  margin-top: 10px;
  background: rgba(0,255,200,0.1); border: 1px solid #00ffc8;
  color: #00ffc8; font-family: 'Courier New', monospace; font-size: 13px;
  padding: 8px 20px; border-radius: 4px; cursor: pointer;
}
/* Ore rush tint */
#oreRushOverlay {
  position: absolute; inset: 0;
  background: rgba(255,200,0,0.07);
  pointer-events: none; z-index: 12;
  display: none;
}
/* Rare flash */
#rareFlash {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 15;
  background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.1s;
}
/* Mobile controls — bottom-left to avoid overlapping HUD buttons on the right */
#mobileControls {
  display: none;
  position: absolute; bottom: 50px; left: 10px;
  z-index: 20; pointer-events: auto;
}
.mBtn {
  width: 48px; height: 48px; background: rgba(0,255,200,0.15);
  border: 1px solid #00ffc855; border-radius: 8px;
  color: #00ffc8; font-size: 20px; display: flex;
  align-items: center; justify-content: center;
  pointer-events: auto; touch-action: none;
}
.mBtn:active { background: rgba(0,255,200,0.4); }
#mobileGrid {
  display: grid;
  grid-template-columns: 48px 48px 48px;
  grid-template-rows: 48px 48px 48px;
  gap: 4px;
}
@media (pointer: coarse) {
  #mobileControls { display: block; }
}
/* Minimap hint */
#minimapHint {
  position: absolute; bottom: 8px; right: 8px;
  font-size: 8px; color: #00ffc844;
  pointer-events: none;
}

/* ===== EARNINGS MENU ===== */
#earningsBtn {
  position: absolute; bottom: 90px; right: 8px;
  background: rgba(0,0,0,0.75); border: 1px solid #ffd700;
  color: #ffd700; font-family: monospace; font-size: 10px;
  font-weight: bold; letter-spacing: 2px; padding: 6px 12px;
  border-radius: 6px; cursor: pointer;
  transition: background 0.2s; z-index: 80; display: none;
  pointer-events: auto;
}
#earningsBtn:hover { background: rgba(255,215,0,0.15); }
#earningsOverlay {
  display: none; position: absolute; inset: 0;
  background: rgba(0,0,0,0.82);
  align-items: center; justify-content: center;
  z-index: 95; pointer-events: auto;
}
#earningsOverlay.open { display: flex; }
#earningsBox {
  background: #0a0a1a; border: 1px solid #ffd700;
  border-radius: 10px; padding: 24px 28px; min-width: 320px;
  max-width: 90vw; font-family: monospace; color: #ffd700;
  box-shadow: 0 0 30px rgba(255,215,0,0.3);
  pointer-events: auto;
}
#earningsTitle {
  font-size: 16px; font-weight: bold; letter-spacing: 3px;
  text-align: center; margin-bottom: 18px;
  text-shadow: 0 0 10px #ffd700;
}
.earnings-row {
  display: flex; justify-content: space-between;
  border-bottom: 1px solid #222; padding: 7px 0; font-size: 12px;
}
.earnings-label { color: #aaa; }
.earnings-value { color: #ffd700; font-weight: bold; }
#earningsTotal {
  margin-top: 14px; font-size: 18px; text-align: center;
  color: #00ffc8; font-weight: bold;
  text-shadow: 0 0 10px #00ffc8;
}
#cashoutBtn {
  margin-top: 18px; width: 100%;
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(0,255,200,0.1));
  border: 1px solid #ffd700; color: #ffd700;
  font-family: monospace; font-size: 13px; font-weight: bold;
  letter-spacing: 2px; padding: 10px; border-radius: 6px;
  cursor: pointer; transition: all 0.2s; pointer-events: auto;
}
#cashoutBtn:hover { background: rgba(255,215,0,0.3); box-shadow: 0 0 15px rgba(255,215,0,0.4); }
#cashoutBtn:disabled { opacity: 0.4; cursor: not-allowed; }
#cashoutStatus {
  margin-top: 8px; font-size: 10px; text-align: center;
  color: #00ffc8; min-height: 14px;
}
#closeEarningsBtn {
  margin-top: 12px; width: 100%;
  background: transparent; border: 1px solid #444;
  color: #666; font-family: monospace; font-size: 11px;
  padding: 6px; border-radius: 4px; cursor: pointer;
  pointer-events: auto;
}
#closeEarningsBtn:hover { border-color: #888; color: #aaa; }
.ore-breakdown { max-height: 180px; overflow-y: auto; margin-bottom: 6px; }
.ore-breakdown::-webkit-scrollbar { width: 4px; }
.ore-breakdown::-webkit-scrollbar-thumb { background: #333; }

/* Wallet Modal (WalletConnect) */
#walletModal {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.88);
  align-items: center; justify-content: center;
  z-index: 9999; pointer-events: auto; padding: 1rem;
}
#walletModal.show { display: flex; }
#walletModalBox {
  background: #0d0d1a; border: 1px solid #00ffc844;
  border-radius: 16px; padding: 1.5rem;
  width: 100%; max-width: 360px;
  max-height: 90vh; overflow-y: auto;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 40px rgba(0,255,200,0.15);
}
#walletModalHeader {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
#walletModalHeader span {
  font-size: 13px; font-weight: bold; color: #00ffc8; letter-spacing: 2px;
}
#walletModalHeader button {
  background: none; border: none; color: #555; font-size: 18px; cursor: pointer;
  line-height: 1;
}
#walletModalHeader button:hover { color: #fff; }
#wcModalError {
  background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.3);
  border-radius: 8px; padding: 0.75rem; margin-bottom: 1rem;
  color: #ff6666; font-size: 10px; text-align: center;
}
.wc-wallet-opt {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.875rem; margin-bottom: 0.5rem;
  background: #0a0a14; border: 1px solid #1e1e2e; border-radius: 10px;
  color: #fff; font-family: 'Courier New', monospace; cursor: pointer;
  transition: border-color 0.2s;
}
.wc-wallet-opt:hover { border-color: #00ffc8; }
.wc-wallet-opt img { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.wc-wallet-opt-name { font-size: 12px; font-weight: bold; color: #00ffc8; text-align: left; }
.wc-wallet-opt-desc { font-size: 9px; color: #555; text-align: left; margin-top: 2px; }
.wc-divider {
  text-align: center; color: #333; font-size: 9px; margin: 0.875rem 0;
  letter-spacing: 2px;
}
#wcLoading {
  text-align: center; padding: 0.875rem; color: #666; font-size: 11px;
}
#wcQrContainer { margin-bottom: 0.875rem; }
#wcQrWrap {
  display: flex; justify-content: center;
  background: white; border-radius: 10px; padding: 12px;
}
#wcMobileLinks { margin-bottom: 0.5rem; }
#wcMobileGrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.wc-mobile-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
  padding: 0.875rem 0.5rem;
  background: #0a0a14; border: 1px solid #1e1e2e; border-radius: 10px;
  color: #aaa; font-family: 'Courier New', monospace; font-size: 10px;
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.wc-mobile-btn:hover { border-color: #00ffc8; color: #00ffc8; }
.wc-mobile-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wc-mobile-btn img { width: 30px; height: 30px; border-radius: 7px; }
#wcCopyBtn {
  width: 100%; padding: 0.75rem;
  background: linear-gradient(135deg, rgba(0,255,200,0.2), rgba(0,180,140,0.1));
  border: 1px solid #00ffc866; border-radius: 10px;
  color: #00ffc8; font-family: 'Courier New', monospace; font-size: 11px;
  font-weight: bold; letter-spacing: 1px; cursor: pointer;
  transition: background 0.2s;
}
#wcCopyBtn:hover { background: linear-gradient(135deg, rgba(0,255,200,0.3), rgba(0,180,140,0.2)); }


/* === MISSION SYSTEM v2 === */

/* Mission cards */
.mission-card {
  background: rgba(20,20,30,0.9);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #333;
  transition: all 0.3s ease;
}

.mission-card:hover {
  background: rgba(30,30,45,0.95);
}

.mission-done {
  opacity: 0.7;
  background: rgba(20,30,20,0.9) !important;
  border-color: #4ade8044 !important;
}

.mission-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.mission-tier-badge {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.mission-check-badge {
  color: #4ade80;
  font-size: 14px;
  font-weight: bold;
}

.mission-card-desc {
  color: #ddd;
  font-size: 11px;
  margin-bottom: 6px;
}

.mission-done .mission-card-desc {
  text-decoration: line-through;
  color: #888;
}

.mission-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}

.mission-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease-out;
  box-shadow: 0 0 6px currentColor;
}

.mission-done .mission-progress-fill {
  opacity: 0.5;
}

.mission-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
}

/* Streak banner */
.mission-streak {
  text-align: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(255,136,0,0.15), rgba(255,200,0,0.15));
  border: 1px solid #ff880044;
  border-radius: 6px;
  color: #ffaa00;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Refresh countdown */
.mission-refresh {
  text-align: center;
  color: #555;
  font-size: 9px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}


/* === ACHIEVEMENT CELEBRATION POPUP === */
#achieveCelebrate {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10003;
  font-family: 'Courier New', monospace;
}
#achieveCelebrate.show {
  display: flex;
  animation: achOverlayIn 0.4s ease-out;
}
#achieveCelebrate.closing {
  animation: achOverlayOut 0.35s ease-in forwards;
}
#achCelebrateBox {
  background: rgba(10,10,20,0.97);
  border: 2px solid #ffd700;
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  position: relative;
  overflow: visible;
  animation: achCardAppear 0.5s ease-out;
}
#achCelebrateParticles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: visible;
}
#achCelebrateIcon {
  font-size: 52px;
  margin-bottom: 12px;
  display: block;
}
#achCelebrateName {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 3px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
#achCelebrateDesc {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 12px;
  line-height: 1.6;
}
#achCelebrateReward {
  font-size: 16px;
  font-weight: bold;
  color: #00ffc8;
  letter-spacing: 2px;
}
.sparkle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFly var(--dur, 1s) var(--delay, 0s) ease-out forwards;
}
@keyframes sparkleFly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx,0),var(--ty,0)) scale(0); opacity: 0; }
}
@keyframes achOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes achOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes achCardAppear {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Mission celebration popup — reuses celebrate-overlay/card from achievements */
#missionCelebrate {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  font-family: monospace;
}

#missionCelebrate.show {
  display: flex;
  animation: achOverlayIn 0.4s ease-out;
}

#missionCelebrate.closing {
  animation: achOverlayOut 0.35s ease-in forwards;
}

#missionCelebCard {
  background: rgba(10,10,20,0.95);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 28px 36px;
  text-align: center;
  max-width: 320px;
  animation: achCardAppear 0.5s ease-out;
}
