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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
}

/* Animations */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(147, 51, 234, 0.5); }
  50% { box-shadow: 0 0 40px rgba(147, 51, 234, 0.8); }
}

#playBtn {
  animation: pulse 2s ease-in-out infinite;
}

#playBtn:hover {
  animation: none;
}

/* Leaderboard items */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.leaderboard-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.leaderboard-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e5e7eb;
}

.leaderboard-score {
  color: #9ca3af;
  font-weight: 600;
}

.leaderboard-item.self {
  background: rgba(147, 51, 234, 0.2);
  border-radius: 4px;
  padding: 4px 6px;
  margin: -4px -6px;
}

.leaderboard-item.self .leaderboard-name {
  color: #a78bfa;
}

/* Death screen animation */
#deathScreen {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile optimizations */
@media (max-width: 640px) {
  #startScreen > div {
    margin: 16px;
    padding: 24px;
  }
  
  #startScreen h1 {
    font-size: 2.5rem;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(147, 51, 234, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 51, 234, 0.7);
}
