* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #d9ecff 0%, #9cc6f5 50%, #7ab0e6 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  touch-action: manipulation;
}

canvas {
  display: block;
  margin: 0 auto;
  width: 95vw;
  max-width: 900px;
  height: auto;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 14px;
  border-radius: 10px;
  color: #0f3a68;
  font-weight: 700;
  letter-spacing: 0.4px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 210px;
  z-index: 10;
}

#hud .bar {
  margin-top: 6px;
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  overflow: hidden;
}

#hud .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6bd6ff, #3f92ff);
}

#mute-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 36, 82, 0.8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  z-index: 11;
}

#mute-btn:hover {
  background: rgba(0, 55, 110, 0.95);
}

#mute-btn:active {
  transform: translateY(1px);
}

#restart-hint {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #0f3a68;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  #hud {
    font-size: 14px;
    padding: 8px 10px;
    min-width: 160px;
  }

  #mute-btn {
    font-size: 14px;
    padding: 8px 10px;
  }
}
