* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #7fb8e0;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #eef4fa;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: difference;
}

#hud {
  position: fixed;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  pointer-events: none;
}

#quiver {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: min(94vw, 640px);
  pointer-events: auto;
}

.quiver-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 20, 20, 0.45);
  color: #eef4fa;
  cursor: pointer;
}

.quiver-slot.is-active {
  border-color: #ffe08a;
  background: rgba(255, 224, 138, 0.22);
}

.quiver-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.quiver-swatch--wood { background: #a9743a; }
.quiver-swatch--metal { background: #c8ccd4; }
.quiver-swatch--magnetic { background: #4fc3ff; box-shadow: 0 0 6px #4fc3ff; }
.quiver-swatch--explosive { background: #ff5b45; box-shadow: 0 0 6px #ff5b45; }
.quiver-swatch--teleport { background: #b388ff; box-shadow: 0 0 6px #b388ff; }
.quiver-swatch--breaker { background: #c9c3b0; }
.quiver-swatch--fire { background: #ff7a33; box-shadow: 0 0 6px #ff7a33; }
.quiver-swatch--water { background: #4fb3ff; box-shadow: 0 0 6px #4fb3ff; }

#drawMeter {
  width: 160px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

#drawMeterFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffe08a, #ff9d4d);
  transition: width 0.03s linear;
}

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: rgba(8, 18, 24, 0.72);
  z-index: 3;
  padding: 24px;
}

#overlay[hidden] { display: none; }

#overlay h1 { margin: 0; font-size: 2rem; }
#overlay p { max-width: 420px; color: #d6e4ee; margin: 0 0 4px; }
#overlay ul { list-style: none; padding: 0; margin: 0 0 10px; color: #cfe0ec; font-size: 0.9rem; line-height: 1.7; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid #ffe08a;
  background: #ffe08a;
  color: #23180a;
  cursor: pointer;
}

button:hover { background: #ffe9ad; }

#hint {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  z-index: 2;
}

#hint[hidden] { display: none; }

#teleportHint {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  color: #2a1547;
  background: #b388ff;
  padding: 6px 16px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 0 12px rgba(179, 136, 255, 0.7);
  pointer-events: none;
}

#teleportHint[hidden] { display: none; }
