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

body {
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
}

#game-container {
  position: relative;
  max-width: 1400px;
  width: 100%;
}

/* Score bar */
#score-bar {
  display: flex;
  justify-content: center;
  gap: 60px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 3px solid #00ff00;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.score-item .label {
  font-size: 14px;
  color: #00ff00;
  letter-spacing: 2px;
}

.score-item .value {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Game canvas */
#game-canvas {
  display: block;
  margin: 0 auto;
  background: #000;
  border: 4px solid #00ff00;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Player panels */
#player-panels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 3px solid #00ff00;
  border-radius: 8px;
}

.player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #444;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.player-panel.active {
  border-color: #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.player-panel.inactive {
  opacity: 0.4;
}

.player-label {
  font-size: 14px;
  letter-spacing: 1px;
  color: #aaa;
}

.player-panel.active .player-label {
  color: #fff;
  font-weight: bold;
}

.next-piece-canvas {
  background: #0a0a0a;
  border: 2px solid #333;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Overlay */
#overlay {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 100px;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#overlay.hidden {
  display: none;
}

#overlay-content {
  text-align: center;
  padding: 40px;
  background: rgba(0, 50, 0, 0.8);
  border: 4px solid #00ff00;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 255, 0, 0.6);
}

#overlay-message {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
  letter-spacing: 4px;
}

#play-again-btn {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: bold;
  padding: 15px 40px;
  background: #00ff00;
  color: #000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

#play-again-btn:hover {
  background: #00cc00;
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

#play-again-btn.hidden {
  display: none;
}

/* Connection status */
#connection-status {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: rgba(255, 0, 0, 0.8);
  border: 2px solid #ff0000;
  border-radius: 4px;
  font-size: 14px;
  z-index: 200;
}

#connection-status.connected {
  background: rgba(0, 255, 0, 0.8);
  border-color: #00ff00;
}

#connection-status.hidden {
  display: none;
}

/* Controls info */
#controls-info {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 4px;
  font-size: 12px;
  max-width: 250px;
}

#controls-info h3 {
  margin-bottom: 10px;
  color: #00ff00;
  letter-spacing: 2px;
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #aaa;
}

/* Responsive */
@media (max-width: 1200px) {
  #player-panels {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  #score-bar {
    gap: 20px;
  }

  .score-item .value {
    font-size: 24px;
  }

  #overlay-message {
    font-size: 32px;
  }

  #controls-info {
    display: none;
  }
}
