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

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

body {
  font-family: 'Share Tech Mono', monospace;
  background: #0a0a0a;
  color: #ffd700;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(180, 0, 0, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 215, 0, 0.10) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0a 0%, #1a0a0a 50%, #0a0a0a 100%);
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px;
}

header {
  text-align: center;
  padding: 15px 0;
  border-bottom: 2px solid #ffd700;
  margin-bottom: 15px;
}

header h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.8rem;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(180, 0, 0, 0.5);
  letter-spacing: 3px;
}

.subtitle {
  color: #b8860b;
  font-size: 0.9rem;
  margin-top: 6px;
  letter-spacing: 2px;
}

.game-wrapper {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel {
  background: rgba(20, 5, 5, 0.9);
  border: 1px solid #4a0000;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 0 15px rgba(180, 0, 0, 0.2);
}

.panel h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #ff4444;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 1px;
}

.join-panel input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #0d0d0d;
  border: 1px solid #4a0000;
  color: #ffd700;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s;
}

.join-panel input:focus {
  border-color: #ff4444;
}

button {
  width: 100%;
  padding: 10px;
  background: linear-gradient(180deg, #4a0000 0%, #2a0000 100%);
  border: 1px solid #8b0000;
  color: #ffd700;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  cursor: pointer;
  border-radius: 3px;
  letter-spacing: 1px;
  transition: all 0.2s;
}

button:hover {
  background: linear-gradient(180deg, #6b0000 0%, #4a0000 100%);
  border-color: #ff4444;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

button:active {
  transform: scale(0.97);
}

.players-panel #playerList div {
  padding: 5px 8px;
  margin: 3px 0;
  background: rgba(74, 0, 0, 0.3);
  border-radius: 3px;
  font-size: 0.75rem;
  color: #ccc;
  border-left: 2px solid #ff4444;
  transition: all 0.2s;
}

.players-panel #playerList .me {
  border-left-color: #ffd700;
  color: #ffd700;
  font-weight: bold;
}

.stats-panel #playerStats div {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  margin: 2px 0;
  font-size: 0.7rem;
  color: #ccc;
  border-bottom: 1px solid rgba(255, 0, 0, 0.1);
}

.stats-panel #playerStats .stat-val {
  color: #ffd700;
  font-weight: bold;
}

.board-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-status {
  display: flex;
  gap: 30px;
  padding: 8px 20px;
  background: rgba(20, 5, 5, 0.9);
  border: 1px solid #4a0000;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.75rem;
}

.status-text strong {
  color: #ff4444;
}

#statusLabel {
  color: #00ff00;
}

.board-container {
  background: rgba(10, 5, 5, 0.9);
  border: 2px solid #4a0000;
  border-radius: 6px;
  padding: 5px;
  box-shadow: 0 0 20px rgba(180, 0, 0, 0.3);
  display: inline-block;
}

#boardCanvas {
  display: block;
  cursor: pointer;
}

.legend {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 0.7rem;
  color: #666;
}

.legend span {
  background: rgba(20, 5, 5, 0.8);
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid #2a0000;
}

.chat-messages {
  height: 370px;
  overflow-y: auto;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.chat-input {
  width: 100%;
  padding: 7px 10px;
  background: #0d0d0d;
  border: 1px solid #4a0000;
  color: #ffd700;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #ff4444;
}

.chat-messages .chat {
  color: #ccc;
  border-left: 2px solid #ffd700;
}

.chat-messages .chat .sender {
  color: #ff4444;
}

.chat-messages div {
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(74, 0, 0, 0.2);
  word-break: break-all;
}

.chat-messages .join {
  color: #00ff00;
  border-left: 2px solid #00ff00;
}

.chat-messages .leave {
  color: #ff4444;
  border-left: 2px solid #ff4444;
}

.chat-messages .death {
  color: #ff0000;
  background: rgba(255, 0, 0, 0.15);
  border-left: 2px solid #ff0000;
  font-size: 0.8rem;
  padding: 6px 8px;
  font-weight: bold;
}

.chat-messages .win {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  border-left: 2px solid #ffd700;
  font-size: 0.8rem;
  padding: 6px 8px;
  font-weight: bold;
}

.chat-messages .reset {
  color: #b8860b;
  text-align: center;
  font-style: italic;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay-box {
  background: #1a0505;
  border: 2px solid #ff0000;
  padding: 30px 40px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.4);
  max-width: 400px;
}

.overlay-box h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  color: #ff0000;
  margin-bottom: 15px;
}

.overlay-box p {
  color: #ccc;
  font-size: 0.8rem;
  margin: 8px 0;
}

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

::-webkit-scrollbar-track {
  background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
  background: #4a0000;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b0000;
}
