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

body {
  overflow: hidden;
  background: #0a0e1a;
  font-family: 'Share Tech Mono', monospace;
  color: #e0e8ff;
  -webkit-user-select: none;
  user-select: none;
}

#scene-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* Progress Bar */
#progress-bar-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: rgba(10, 14, 26, 0.8);
  z-index: 100;
}
#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f0ff, #00ff88, #ffd700);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px #00f0ff;
}
#progress-bar-text {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: #00f0ff;
  text-shadow: 0 0 8px #00f0ff;
}

/* Top Bar */
#top-bar {
  position: fixed;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 30px;
  z-index: 50;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 10px 24px;
}
#points-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.points-icon {
  font-size: 24px;
  animation: pulse-glow 2s ease-in-out infinite;
}
#points-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  min-width: 80px;
}
.points-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: #8899bb;
  text-transform: uppercase;
}
#build-tier {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: #00f0ff;
  text-shadow: 0 0 8px #00f0ff;
}

/* Skill Tree */
#skill-tree-toggle {
  position: fixed;
  top: 80px; left: 10px;
  z-index: 60;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: #00f0ff;
  text-shadow: 0 0 6px #00f0ff;
  transition: all 0.3s;
}
#skill-tree-toggle:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00f0ff;
}

#skill-tree-panel {
  position: fixed;
  top: 0; left: -400px;
  width: 370px;
  height: 100vh;
  z-index: 70;
  background: rgba(8, 12, 24, 0.92);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0, 240, 255, 0.2);
  transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  padding: 20px;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}
#skill-tree-panel.open {
  left: 0;
}
#skill-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}
#skill-tree-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  letter-spacing: 3px;
  color: #00f0ff;
  text-shadow: 0 0 10px #00f0ff;
}
#skill-tree-close {
  background: none;
  border: 1px solid rgba(255, 0, 170, 0.4);
  color: #ff00aa;
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
#skill-tree-close:hover {
  background: rgba(255, 0, 170, 0.2);
}

.tree-branch {
  margin-bottom: 20px;
}
.branch-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-left: 3px solid;
}
.tree-nodes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 12px;
}
.tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s;
  position: relative;
}
.tree-node::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 12px;
  height: 2px;
}
.tree-node.locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.tree-node.locked::before { background: #333; }
.tree-node.available {
  border-color: rgba(0, 255, 136, 0.4);
  animation: node-pulse 2s ease-in-out infinite;
}
.tree-node.available::before { background: #00ff88; }
.tree-node.cant-afford {
  border-color: rgba(255, 0, 170, 0.3);
}
.tree-node.cant-afford::before { background: #ff00aa; }
.tree-node.unlocked {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.08);
}
.tree-node.unlocked::before { background: #00f0ff; }
.tree-node:not(.locked):hover {
  background: rgba(0, 240, 255, 0.1);
  transform: translateX(4px);
}
.node-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}
.node-info {
  flex: 1;
}
.node-name {
  font-size: 12px;
  font-weight: bold;
  color: #e0e8ff;
}
.node-cost {
  font-size: 10px;
  color: #8899bb;
}
.node-cost.affordable { color: #00ff88; }
.node-cost.expensive { color: #ff00aa; }
.node-status {
  font-size: 14px;
}

/* Detail Panel */
#detail-panel {
  position: fixed;
  top: 50%; right: 20px;
  transform: translateY(-50%);
  width: 300px;
  z-index: 60;
  background: rgba(8, 12, 24, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#detail-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(30px);
}
#detail-close {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: none;
  color: #8899bb;
  font-size: 18px;
  cursor: pointer;
}
#detail-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 10px;
}
#detail-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  text-align: center;
  color: #00f0ff;
  text-shadow: 0 0 8px #00f0ff;
  margin-bottom: 6px;
}
#detail-cost {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  font-family: 'Orbitron', sans-serif;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  margin-bottom: 12px;
}
#detail-flavor {
  font-style: italic;
  font-size: 12px;
  color: #8899bb;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(0, 240, 255, 0.04);
  border-radius: 8px;
  border-left: 2px solid rgba(0, 240, 255, 0.2);
}
#detail-stats {
  font-size: 11px;
  margin-bottom: 10px;
}
.detail-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.detail-stat-row .val { color: #00ff88; }
#detail-deps {
  font-size: 10px;
  color: #ff00aa;
  margin-bottom: 14px;
}
#detail-unlock-btn {
  display: block;
  width: 100%;
  padding: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  border: 2px solid #00ff88;
  border-radius: 10px;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  cursor: pointer;
  transition: all 0.3s;
  text-shadow: 0 0 8px #00ff88;
}
#detail-unlock-btn:hover {
  background: rgba(0, 255, 136, 0.25);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}
#detail-unlock-btn:disabled {
  border-color: #333;
  color: #555;
  background: rgba(50, 50, 50, 0.3);
  cursor: not-allowed;
  text-shadow: none;
}

/* Clicker */
#clicker-area {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  text-align: center;
}
#click-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffd700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 170, 0, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
  animation: btn-breathe 3s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
#click-btn:active {
  transform: scale(0.92);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.4);
}
.click-icon { font-size: 20px; }
.click-text { white-space: nowrap; }
#click-multiplier {
  font-size: 11px;
  color: #8899bb;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* Stats Panel */
#stats-toggle {
  position: fixed;
  bottom: 20px; right: 10px;
  z-index: 60;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 18px;
  display: none;
}
#stats-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 200px;
  z-index: 50;
  background: rgba(8, 12, 24, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
}
#stats-panel h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: #00f0ff;
  text-shadow: 0 0 6px #00f0ff;
  margin-bottom: 10px;
  text-align: center;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stat-val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #00ff88;
}
.stat-val.temp-hot { color: #ff4444; }
.stat-val.temp-warm { color: #ffaa00; }
.stat-val.temp-cool { color: #00ff88; }
.stat-val.temp-cold { color: #00ccff; }

/* Floating text */
#float-texts {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 80;
}
.float-text {
  position: absolute;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  animation: float-up 1s ease-out forwards;
  pointer-events: none;
}

/* Milestone overlay */
#milestone-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  pointer-events: none;
}
#milestone-overlay.hidden { display: none; }
#milestone-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 36px;
  font-weight: 900;
  text-align: center;
  color: #ffd700;
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 80px rgba(255, 215, 0, 0.4);
  animation: milestone-pop 2s ease-out forwards;
}

/* Reset */
#reset-btn {
  position: fixed;
  bottom: 10px; left: 10px;
  z-index: 50;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.3s;
}
#reset-btn:hover {
  color: #ff00aa;
  background: rgba(255, 0, 170, 0.1);
}

/* Footer */
#footer {
  position: fixed;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #334;
  z-index: 40;
}
#footer a { color: #00f0ff; text-decoration: none; }
#footer a:hover { text-decoration: underline; }

/* Animations */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(0, 255, 136, 0.3); }
}
@keyframes btn-breathe {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.15); }
  50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.3); }
}
@keyframes float-up {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.3); }
}
@keyframes milestone-pop {
  0% { opacity: 0; transform: scale(0.3); }
  30% { opacity: 1; transform: scale(1.15); }
  60% { transform: scale(0.95); }
  80% { transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1); }
}

/* Scrollbar */
#skill-tree-panel::-webkit-scrollbar { width: 4px; }
#skill-tree-panel::-webkit-scrollbar-track { background: transparent; }
#skill-tree-panel::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.3); border-radius: 2px; }

/* Responsive */
@media (max-width: 768px) {
  #top-bar {
    padding: 6px 14px;
    gap: 12px;
  }
  #points-value { font-size: 20px; }
  #build-tier { font-size: 9px; }
  #skill-tree-panel { width: 100%; }
  #detail-panel {
    right: 10px; left: 10px;
    width: auto;
    top: auto;
    bottom: 100px;
    transform: none;
  }
  #detail-panel.hidden { transform: translateY(20px); }
  #stats-panel {
    display: none;
  }
  #stats-toggle { display: block; }
  #stats-panel.mobile-open {
    display: block;
    bottom: 60px; right: 10px;
  }
  #click-btn {
    padding: 12px 24px;
    font-size: 13px;
  }
  #clicker-area { bottom: 20px; }
}

@media (max-width: 480px) {
  #points-value { font-size: 18px; }
  .points-label { display: none; }
  #build-tier { display: none; }
  #click-btn { font-size: 11px; padding: 10px 18px; }
}