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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #1a1a2e;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  text-align: center;
  padding: 20px;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #4CAF50;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.card {
  background: #16213e;
  border-radius: 15px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.intro {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #aaa;
}

.btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

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

.btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
}

.status {
  margin-top: 15px;
  color: #ff9800;
}

.game-container {
  width: 100%;
  max-width: 450px;
  padding: 10px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #16213e;
  border-radius: 10px;
  margin-bottom: 10px;
}

.player-info, .score-info {
  font-size: 0.9rem;
}

.timer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ff9800;
}

.game-area {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #333;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.start-overlay, .game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.overlay-content {
  text-align: center;
  padding: 20px;
}

.overlay-content h2 {
  font-size: 2rem;
  color: #4CAF50;
  margin-bottom: 15px;
}

.overlay-content p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #aaa;
}

#submitSection {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

#playerNameInput {
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid #4CAF50;
  background: #1a1a2e;
  color: #fff;
  text-align: center;
}

#playerNameInput:focus {
  outline: none;
  border-color: #8BC34A;
}

#submitStatus {
  margin-top: 15px;
  font-size: 1rem;
}

.controls {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.control-row {
  display: flex;
  gap: 5px;
}

.control-btn {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
  background: #16213e;
  color: #fff;
  border: 2px solid #333;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-btn.pressed {
  transform: scale(0.8);
  background: #ff9800;
  border-color: #ff9800;
  box-shadow: 0 0 15px rgba(255, 152, 0, 0.6);
}

.admin-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.admin-header {
  text-align: center;
  margin-bottom: 30px;
}

.admin-header h1 {
  color: #ff9800;
}

.rankings-list {
  list-style: none;
}

.rank-item {
  display: flex;
  align-items: center;
  background: #16213e;
  margin: 10px 0;
  padding: 15px 20px;
  border-radius: 10px;
  transition: transform 0.2s;
}

.rank-item:hover {
  transform: scale(1.02);
}

.rank-item.top-1 {
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #000;
}

.rank-item.top-2 {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #000;
}

.rank-item.top-3 {
  background: linear-gradient(135deg, #cd7f32, #b06020);
  color: #000;
}

.rank-number {
  font-size: 1.5rem;
  font-weight: bold;
  width: 40px;
}

.rank-name {
  flex: 1;
  font-size: 1.1rem;
}

.rank-score {
  font-size: 1.3rem;
  font-weight: bold;
  color: inherit;
}

.refresh-btn {
  display: block;
  margin: 20px auto 0;
  background: #2196F3;
}

.total-players {
  text-align: center;
  margin-top: 20px;
  color: #aaa;
}
