:root {
  --color-bg: #AFC1B6;
  --color-grass: #049D33;
  --color-grass-dark: #038029;
  --color-sand: #E3C16F;
  --color-water: #2B8CE5;
  --color-wood: #704214;
  --color-speedpad-primary: #00B037;
  --color-speedpad-secondary: #4BCC74;
  --color-pinball: #FFCC02;
  --color-flag: #FD0200;
  --color-hole: #000000;
  --color-ui-bg: rgba(20, 20, 20, 0.75);
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #779183 0%, #4D6357 100%);
}

#ui-header {
  position: absolute;
  top: 15px;
  width: 90%;
  max-width: 800px;
  height: 60px;
  background: var(--color-ui-bg);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: #fff;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.player-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.player-badge.active {
  opacity: 1;
  transform: scale(1.1);
}

.player-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #aaa;
}

.player-badge.active .player-name {
  color: #4BCC74;
}

.score {
  font-size: 18px;
  font-weight: 900;
}

#hole-info {
  text-align: center;
  font-weight: 900;
  letter-spacing: 1px;
}

#hole-number {
  display: block;
  font-size: 18px;
  color: #FFCC02;
}

#par-number {
  font-size: 11px;
  color: #ccc;
}

canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none;
}

#ui-footer {
  position: absolute;
  bottom: 20px;
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

#power-meter-container {
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

#power-meter-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4BCC74 0%, #FFCC02 70%, #FD0200 100%);
  transition: width 0.05s linear;
}

#reset-btn {
  background: #FD0200;
  color: white;
  border: none;
  padding: 8px 16px;
  font-weight: 700;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

#reset-btn:active {
  transform: scale(0.95);
}