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

body {
  overflow: hidden;
  background: #0a0a0a;
  font-family: 'Share Tech Mono', monospace;
  cursor: crosshair;
  user-select: none;
}

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

#scene-container canvas {
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border: 2px solid #00d4ff;
  border-radius: 4px;
  padding: 40px 50px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.15), inset 0 0 30px rgba(0, 212, 255, 0.03);
}

.modal-box h1 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 5px;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  letter-spacing: 3px;
}

.modal-box .subtitle {
  font-size: 1.4rem;
  color: #00d4ff;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.tip-line {
  color: #6a737d;
  font-size: 0.75rem;
  margin: 15px 0 25px;
  font-style: italic;
}

.controls-ref {
  text-align: left;
  margin: 0 auto 25px;
  max-width: 300px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  color: #c9d1d9;
  font-size: 0.8rem;
}

.key {
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.72rem;
  min-width: 55px;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
}

.gmod-btn {
  background: linear-gradient(180deg, #00d4ff 0%, #0099cc 100%);
  color: #0d1117;
  border: none;
  padding: 12px 40px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 3px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
  text-transform: uppercase;
}

.gmod-btn:hover {
  background: linear-gradient(180deg, #33e0ff 0%, #00bbee 100%);
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
  transform: translateY(-1px);
}

.gmod-btn.danger {
  background: linear-gradient(180deg, #ff4444 0%, #cc2222 100%);
  color: #fff;
  padding: 6px 16px;
  font-size: 0.7rem;
  letter-spacing: 2px;
  margin-top: 10px;
}

.gmod-btn.danger:hover {
  box-shadow: 0 0 25px rgba(255, 68, 68, 0.4);
}

/* HUD */
#hud {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 100;
  pointer-events: none;
}

#hud button, #hud a, #hud .spawn-btn {
  pointer-events: auto;
}

.hud-panel {
  background: rgba(13, 17, 23, 0.82);
  border: 1px solid rgba(0, 212, 255, 0.25);
  backdrop-filter: blur(8px);
  color: #e6e6e6;
  padding: 10px 14px;
  border-radius: 3px;
}

/* Tool Display */
#tool-display {
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

#tool-icon {
  font-size: 1.6rem;
}

#tool-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #00d4ff;
  letter-spacing: 2px;
}

/* Counters */
#counters {
  position: absolute;
  top: 15px;
  right: 15px;
  text-align: right;
  font-size: 0.78rem;
}

#prop-count {
  color: #00d4ff;
  font-weight: bold;
  margin-bottom: 4px;
}

#fps-counter {
  color: #6a737d;
  font-size: 0.68rem;
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
}

.ch-h, .ch-v {
  position: absolute;
  background: rgba(0, 212, 255, 0.8);
}

.ch-h {
  width: 100%; height: 1px;
  top: 50%;
}

.ch-v {
  height: 100%; width: 1px;
  left: 50%;
}

.ch-dot {
  position: absolute;
  width: 3px; height: 3px;
  background: #00d4ff;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* Grab Info */
#grab-info {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.72rem;
  color: #00d4ff;
}

/* Spawn Menu */
#spawn-menu {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}

#spawn-menu.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none !important;
}

#spawn-menu.hidden * {
  pointer-events: none !important;
}

.spawn-title {
  font-size: 0.65rem;
  color: #6a737d;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

#spawn-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.spawn-btn {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: #c9d1d9;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.12s;
  min-width: 60px;
  font-family: 'Share Tech Mono', monospace;
}

.spawn-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.spawn-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.spawn-label {
  font-size: 0.6rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Tool Switcher */
#tool-switcher {
  position: absolute;
  top: 70px;
  left: 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.tool-btn {
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.15);
  color: #8b949e;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  text-align: left;
  transition: all 0.12s;
}

.tool-btn span {
  color: rgba(0, 212, 255, 0.5);
  margin-right: 4px;
}

.tool-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  color: #c9d1d9;
}

.tool-btn.active {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  color: #00d4ff;
}

.tool-btn.active span {
  color: #00d4ff;
}

/* Footer */
#footer-link {
  position: absolute;
  bottom: 5px;
  right: 10px;
  pointer-events: auto;
}

#footer-link a {
  color: #30363d;
  font-size: 0.6rem;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
}

#footer-link a:hover {
  color: #00d4ff;
}

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

@keyframes spawnPoof {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.poof-particle {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #00d4ff;
  pointer-events: none;
  animation: spawnPoof 0.4s ease-out forwards;
  z-index: 200;
}