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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Baloo 2', sans-serif;
  cursor: crosshair;
}

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

#scene-container canvas {
  display: block;
}

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 0 4px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 100;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.3s;
}

#crosshair.visible {
  opacity: 1;
}

#instructions {
  position: fixed;
  top: 16px;
  left: 16px;
  background: rgba(15, 15, 30, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px 24px;
  color: #fff;
  z-index: 200;
  transition: opacity 0.8s ease, transform 0.8s ease;
  max-width: 280px;
}

#instructions.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.instructions-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #FFD93D, #FF6B6B, #6BCB77, #4D96FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.key-row {
  font-size: 14px;
  margin-bottom: 6px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.key-row kbd {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
  min-width: 48px;
  text-align: center;
}

.click-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#block-counter {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(15, 15, 30, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  z-index: 100;
}

#palette {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(15, 15, 30, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 10px 16px;
  z-index: 100;
}

.palette-color {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.palette-color:hover {
  transform: scale(1.15);
}

.palette-color.selected {
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.5), 0 0 24px rgba(255,255,255,0.2);
  transform: scale(1.1);
}

.palette-color .key-hint {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 700;
}

#reset-btn {
  position: fixed;
  bottom: 80px;
  right: 16px;
  background: rgba(255, 60, 60, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 8px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Baloo 2', sans-serif;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s;
}

#reset-btn:hover {
  background: rgba(255, 40, 40, 0.9);
  transform: scale(1.05);
}

#block-limit-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 60, 60, 0.9);
  border-radius: 16px;
  padding: 16px 28px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

#block-limit-msg.show {
  opacity: 1;
}

#footer-link {
  position: fixed;
  bottom: 8px;
  right: 16px;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  text-decoration: none;
  font-family: 'Baloo 2', sans-serif;
  z-index: 100;
  transition: color 0.2s;
}

#footer-link:hover {
  color: rgba(255,255,255,0.7);
}