* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a0a; font-family: 'Segoe UI', sans-serif; }
#game-container { width: 100vw; height: 100vh; position: relative; overflow: hidden; }
#gameCanvas { display: block; width: 100%; height: 100%; }

#hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
  pointer-events: none;
}
#score-display { color: #f0d050; font-size: 22px; font-weight: bold; text-shadow: 1px 1px 3px #000; }
#stamina-container {
  flex: 1; max-width: 220px; margin: 0 16px; height: 16px;
  background: rgba(255,255,255,0.15); border-radius: 8px; overflow: hidden; position: relative;
}
#stamina-bar {
  width: 100%; height: 100%; background: linear-gradient(to right, #2e8b57, #50c878);
  border-radius: 8px; transition: width 0.15s ease;
}
#stamina-bar.low { background: linear-gradient(to right, #c0392b, #e74c3c); }
#stamina-label { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); color: #aaa; font-size: 10px; white-space: nowrap; }
#rain-warning { color: #e74c3c; font-size: 20px; font-weight: bold; animation: pulse 0.5s ease infinite alternate; text-shadow: 1px 1px 4px #000; }
#rain-warning.hidden { display: none; }
#mute-btn { pointer-events: all; background: none; border: none; font-size: 20px; cursor: pointer; opacity: 0.7; }
#mute-btn:hover { opacity: 1; }

@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

#start-screen, #game-over-screen {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 100; background: rgba(0,0,0,0.85);
}
#start-screen .title { font-size: 48px; color: #f0d050; font-weight: bold; margin-bottom: 8px; text-shadow: 2px 2px 4px #000; }
#start-screen .subtitle { color: #888; font-size: 16px; margin-bottom: 32px; }
#start-screen .controls-hint { color: #666; font-size: 13px; margin-top: 24px; text-align: center; line-height: 1.6; }
button {
  padding: 12px 36px; font-size: 18px; font-weight: bold;
  background: linear-gradient(180deg, #50c878, #2e8b57); color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.5); }
button:active { transform: translateY(1px); }

#game-over-screen .go-title { font-size: 42px; color: #e74c3c; font-weight: bold; margin-bottom: 12px; text-shadow: 2px 2px 4px #000; }
#final-score { font-size: 28px; color: #f0d050; margin-bottom: 8px; }
#high-score { font-size: 20px; color: #888; margin-bottom: 24px; }
#game-over-screen.hidden, #start-screen.hidden { display: none; }

#mobile-controls {
  position: absolute; bottom: 20px; left: 0; width: 100%;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 20px; z-index: 20; pointer-events: none;
}
#mobile-controls.hidden { display: none; }
#joystick-area {
  width: 130px; height: 130px; position: relative; pointer-events: all;
}
#joystick-base {
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 3px solid rgba(255,255,255,0.3);
}
#joystick-knob {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,0.5); border: 2px solid rgba(255,255,255,0.7);
  position: absolute; top: 40px; left: 40px;
}
#cling-btn {
  pointer-events: all; width: 80px; height: 80px; border-radius: 50%;
  background: rgba(100,150,255,0.3); border: 3px solid rgba(100,150,255,0.6);
  color: #88bbff; font-size: 12px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.2; user-select: none; -webkit-user-select: none;
  touch-action: none;
}

@media (max-width: 768px) {
  #start-screen .title { font-size: 32px; }
  #start-screen .subtitle { font-size: 14px; }
  #score-display { font-size: 16px; }
  #hud { padding: 8px 12px; }
  #stamina-container { max-width: 140px; }
}
