* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #050811;
  color: #f1f5f9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 12px;
}

.arena-shell {
  width: 100%;
  max-width: 764px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: #0f172a;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

.hud {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hud-group {
  display: flex;
  gap: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 3px;
}

.value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #38bdf8;
}

.value.accent {
  color: #a78bfa;
}

.value.gold {
  color: #facc15;
}

.hud-meters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meter-block {
  width: 90px;
}

.bar-track {
  height: 9px;
  background-color: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 100%;
}

.hp-fill {
  background: linear-gradient(90deg, #ef4444, #22c55e);
}

.dash-fill {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.sound-btn {
  background-color: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 760 / 500;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #1e293b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  touch-action: none;
}

.stage-wrap.shake {
  animation: screenShake 0.18s linear;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-5px, 3px); }
  50% { transform: translate(5px, -4px); }
  75% { transform: translate(-3px, -2px); }
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #090e1a;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 17, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.overlay.hidden {
  display: none;
}

.tag {
  font-size: 0.68rem;
  letter-spacing: 1.4px;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 8px;
}

.overlay h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.overlay p {
  color: #cbd5e1;
  line-height: 1.65;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.overlay strong {
  color: #38bdf8;
}

.difficulty-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.diff-btn {
  background-color: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.diff-btn.active {
  background-color: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
}

.start-btn {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #ffffff;
  border: none;
  padding: 13px 32px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
}

.touch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  touch-action: none;
}

.stick-zone {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stick-knob {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #38bdf8;
  opacity: 0.85;
  transition: transform 0.05s linear;
}

.stick-knob.aim {
  background-color: #facc15;
}

.stick-label {
  position: absolute;
  bottom: -18px;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: #94a3b8;
  font-weight: 700;
}

.dash-touch-btn {
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid #38bdf8;
  background-color: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  cursor: pointer;
}