body {
  margin: 0;
  overflow: hidden;
  background: #111;
  color: white;
  font-family: sans-serif;
  user-select: none;
}
#debugPanel {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: #0f0;
  font-family: monospace;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid #0f0;
  border-radius: 6px;
  z-index: 9999;
}

#gameCanvas {
  display: block;
  margin: 0 auto;
  background: #222;
  border: 2px solid #444;
  cursor: none;
}
#ui {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
}
#skillTree, #tempUpgradeScreen {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5); /* lighter, semi-transparent background */
  padding: 20px;
  border: 2px solid #555;
  display: none;
  z-index: 20;
  border-radius: 12px;
}

#upgradeContainer, #tempUpgradeContainer {
  position: relative;
  width: 800px;
  height: 500px;
  overflow: visible; /* allow cards to hover outside */
}

.upgrade {
  position: absolute;
  width: 220px;       /* slightly larger for a card feel */
  height: 140px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(40,40,40,0.2);  /* subtle floating card look */
  border: 3px solid #888;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  color: #fff;
  font-weight: bold;
}

.upgrade.unlocked {
  border-color: #0f0;
  color: #0f0;
}

.upgrade.locked {
  border-color: #444;
  color: #666;
  cursor: not-allowed;
}

.upgrade:hover:not(.locked) {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  border-color: #fff;
}


.skill-upgrade {
  position: absolute;
  width: 160px;       /* can adjust for skill tree layout */
  height: 100px;       /* let it grow with content */
  padding: 8px;
  border-radius: 8px;
  background: #222;
  border: 2px solid #555;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}
.skill-upgrade.unlocked {
  background: #333;
  border-color: #0f0;
}

.skill-upgrade.locked {
  background: #111;
  border-color: #444;
  color: #666;
  cursor: not-allowed;
}

.skill-upgrade:hover:not(.locked) {
  transform: scale(1.05);
  background: #333;
}


#restartBtn {
  margin-top: 10px;
  padding: 10px 20px;
  background: #555;
  border: 2px solid #888;
  cursor: pointer;
}
/* Start screen overlay */
#startScreen {
  position: fixed;
  top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 25;
  cursor: pointer;
}
#startScreen h1 {
  font-size: 36px;
  margin-bottom: 20px;
}
#startScreen p {
  font-size: 18px;
}

.rainbow-border {
  border: 3px solid transparent;
  border-image-slice: 1;
  border-image-source: linear-gradient(
    90deg,
    red,
    orange,
    yellow,
    lime,
    cyan,
    blue,
    violet
  );
}
.rainbow-text {
  display: inline-block;
  background: linear-gradient(
    90deg,
    red,
    orange,
    yellow,
    lime,
    cyan,
    blue,
    violet
  );
  background-size: 400% auto; /* required if animating */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes rainbowText {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

#prestigeOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: radial-gradient(circle, rgba(255,0,150,0.8), rgba(0,0,0,0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-family: sans-serif;
  color: white;
  z-index: 9999;
  opacity: 0;
  animation: prestigeFade 2s forwards;
}

#achievementsPanel {
    width: 200px;
}

@keyframes prestigeFade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}