* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #7fa8d0;
  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;
}

#timerHud {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

#timer {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

#bestTime {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

#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, 480px);
  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--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; }

#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, #victoryOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: rgba(8, 14, 24, 0.78);
  z-index: 3;
  padding: 24px;
}

#overlay[hidden], #victoryOverlay[hidden] { display: none; }

#overlay h1, #victoryOverlay h1 { margin: 0; font-size: 2rem; }
#overlay p, #victoryOverlay p { max-width: 460px; color: #d6e4ee; margin: 0 0 4px; }
#overlay ul { list-style: none; padding: 0; margin: 0 0 10px; color: #cfe0ec; font-size: 0.88rem; line-height: 1.65; max-width: 480px; }

#finalTime { font-size: 1.4rem; font-weight: 700; color: #ffe08a; }
#finalBest { font-size: 0.95rem; }

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: 76px;
  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; }

#fallToast {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  color: #2a1210;
  background: #ff9d80;
  padding: 6px 16px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 0 12px rgba(255, 100, 60, 0.6);
  pointer-events: none;
}

#fallToast[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; }
