* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow: hidden;
  background: #073b4c;
  font-family: 'Bubblegum Sans', cursive;
  user-select: none;
  -webkit-user-select: none;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#title-area {
  text-align: center;
  padding-top: 16px;
  animation: floatIn 1.2s ease-out;
}

#main-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 700;
  color: #ffd166;
  text-shadow: 0 2px 12px rgba(230, 57, 70, 0.5), 0 0 30px rgba(255, 209, 102, 0.3);
  letter-spacing: 2px;
}

#subtitle {
  font-size: clamp(0.85rem, 2.5vw, 1.15rem);
  color: #f1faee;
  opacity: 0.8;
  margin-top: 2px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

#stats-panel {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.stat-bubble {
  background: rgba(241, 250, 238, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 209, 102, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: #f1faee;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.stat-bubble.pop {
  transform: scale(1.2);
}

#controls {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  pointer-events: auto;
  z-index: 20;
}

.ctrl-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 209, 102, 0.5);
  background: rgba(241, 250, 238, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 1.6rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ctrl-btn:hover, .ctrl-btn:active {
  transform: scale(1.15);
  background: rgba(255, 209, 102, 0.25);
  border-color: #ffd166;
}

#charge-bar-container {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 14px;
  background: rgba(7, 59, 76, 0.5);
  border-radius: 7px;
  border: 1.5px solid rgba(255, 209, 102, 0.3);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}

#charge-bar-container.visible {
  opacity: 1;
}

#charge-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2d9fd9, #ffd166, #e63946);
  border-radius: 7px;
  transition: width 0.05s linear;
}

#charge-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: #f1faee;
  white-space: nowrap;
  opacity: 0.7;
}

#footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 8px;
  font-size: 0.75rem;
  color: rgba(241, 250, 238, 0.5);
  z-index: 20;
  background: linear-gradient(transparent, rgba(7, 59, 76, 0.6));
}

#footer a {
  color: #ffd166;
  text-decoration: none;
  margin-left: 10px;
}

#footer a:hover {
  text-decoration: underline;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  #controls {
    bottom: 46px;
  }
  #charge-bar-container {
    bottom: 112px;
  }
  .ctrl-btn {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
}