* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  background: #0a0a0a;
  font-family: 'Segoe UI', Arial, sans-serif;
  touch-action: none;
  user-select: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  display: block;
  cursor: crosshair;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
}

#score-display {
  font-size: 48px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px #ff6b35, 2px 2px 4px rgba(0,0,0,0.5);
}

#timer {
  font-size: 42px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px #4ecdc4, 2px 2px 4px rgba(0,0,0,0.5);
}

#timer.warning {
  color: #ff6b6b;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

#lives {
  display: flex;
  gap: 8px;
}

.life {
  font-size: 28px;
  color: #ff6b6b;
  text-shadow: 0 0 8px #ff6b6b;
  transition: opacity 0.3s;
}

.life.lost {
  opacity: 0.2;
}

#combo-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 20px #ffd700, 0 0 40px #ff8c00;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

#combo-display.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: auto;
  backdrop-filter: blur(5px);
}

.screen.hidden {
  display: none;
}

h1 {
  font-size: 72px;
  color: #fff;
  text-shadow: 0 0 20px #ff6b35, 0 4px 8px rgba(0,0,0,0.5);
  margin-bottom: 10px;
}

.subtitle {
  font-size: 32px;
  color: #4ecdc4;
  margin-bottom: 50px;
  letter-spacing: 5px;
}

.btn {
  padding: 15px 50px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  margin: 10px;
  box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  pointer-events: auto;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 107, 53, 0.6);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
  box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

.btn.secondary:hover {
  box-shadow: 0 8px 30px rgba(78, 205, 196, 0.6);
}

#final-score {
  font-size: 52px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 20px #ffd700;
  margin: 20px 0;
}

#final-stats {
  font-size: 22px;
  color: #fff;
  text-align: center;
  line-height: 1.8;
  margin-bottom: 30px;
}

#name-input {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#player-name {
  padding: 12px 20px;
  font-size: 20px;
  border: 2px solid #4ecdc4;
  border-radius: 25px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
  text-align: center;
}

#player-name::placeholder {
  color: rgba(255,255,255,0.5);
}

#leaderboard-list {
  max-height: 50vh;
  overflow-y: auto;
  margin: 20px 0;
  min-width: 350px;
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  margin: 8px 0;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
}

.leaderboard-entry.rank-1 {
  background: linear-gradient(135deg, rgba(255,215,0,0.3) 0%, rgba(255,215,0,0.1) 100%);
  border: 1px solid rgba(255,215,0,0.5);
}

.leaderboard-entry.rank-2 {
  background: linear-gradient(135deg, rgba(192,192,192,0.3) 0%, rgba(192,192,192,0.1) 100%);
  border: 1px solid rgba(192,192,192,0.5);
}

.leaderboard-entry.rank-3 {
  background: linear-gradient(135deg, rgba(205,127,50,0.3) 0%, rgba(205,127,50,0.1) 100%);
  border: 1px solid rgba(205,127,50,0.5);
}

.rank {
  font-size: 20px;
  font-weight: bold;
  width: 40px;
  color: #888;
}

.rank-1 .rank { color: #ffd700; }
.rank-2 .rank { color: #c0c0c0; }
.rank-3 .rank { color: #cd7f32; }

.name {
  flex: 1;
  font-size: 18px;
  margin: 0 15px;
}

.score {
  font-size: 22px;
  font-weight: bold;
  color: #ffd700;
}

.score-details {
  font-size: 12px;
  color: #aaa;
  margin-left: 10px;
}

@media (max-width: 768px) {
  h1 { font-size: 48px; }
  .subtitle { font-size: 24px; }
  #score-display { font-size: 36px; }
  #timer { font-size: 32px; }
  #final-score { font-size: 40px; }
  .btn { padding: 12px 40px; font-size: 20px; }
}
