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

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #4a90e2, #7bb3f0);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #333;
}

#gameContainer {
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  max-width: 1200px;
  width: 100%;
  margin: 20px;
}

#gameCanvas {
  border: 3px solid #2c5aa0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #87ceeb 0%, #4682b4 100%);
  display: block;
}

#ui {
  width: 300px;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  border-radius: 0 10px 10px 0;
}

#playersList {
  flex: 1;
  padding: 20px;
  border-bottom: 2px solid #dee2e6;
  max-height: 300px;
  overflow-y: auto;
}

#playersList h3 {
  color: #2c5aa0;
  margin-bottom: 15px;
  font-size: 18px;
  text-align: center;
}

.player-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin: 5px 0;
  background: rgba(76, 144, 226, 0.1);
  border-radius: 20px;
  font-size: 14px;
}

.player-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 8px;
  background: #4a90e2;
}

#chatContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

#chatMessages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.4;
  max-height: 250px;
  background: #ffffff;
}

.chat-message {
  margin: 8px 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(76, 144, 226, 0.1);
  word-wrap: break-word;
}

.chat-message .player-name {
  font-weight: bold;
  color: #2c5aa0;
  margin-right: 6px;
}

.chat-message .timestamp {
  font-size: 11px;
  color: #666;
  float: right;
}

#chatInput {
  display: flex;
  padding: 15px;
  background: #e9ecef;
  border-top: 1px solid #dee2e6;
}

#messageInput {
  flex: 1;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  margin-right: 10px;
}

#messageInput:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.25);
}

#sendButton {
  padding: 10px 20px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.2s;
}

#sendButton:hover {
  background: #357abd;
}

#sendButton:active {
  transform: translateY(1px);
}

/* Connection status indicator */
.connection-status {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  z-index: 1000;
}

.connection-status.connected {
  background: #28a745;
  color: white;
}

.connection-status.disconnected {
  background: #dc3545;
  color: white;
}

.connection-status.connecting {
  background: #ffc107;
  color: #333;
}

/* Responsive design */
@media (max-width: 1024px) {
  #gameContainer {
    flex-direction: column;
    max-width: 800px;
  }
  
  #gameCanvas {
    border-radius: 10px 10px 0 0;
  }
  
  #ui {
    width: 100%;
    flex-direction: row;
    border-radius: 0 0 10px 10px;
  }
  
  #playersList {
    flex: 1;
    border-right: 2px solid #dee2e6;
    border-bottom: none;
    max-height: 200px;
  }
  
  #chatContainer {
    flex: 1;
    min-height: 200px;
  }
  
  #chatMessages {
    max-height: 120px;
  }
}

/* Modal styles */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal-content h2 {
  color: #2c5aa0;
  margin-bottom: 15px;
}

.modal-content p {
  color: #666;
  margin-bottom: 25px;
  line-height: 1.5;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: #4a90e2;
  color: white;
}

.btn-primary:hover {
  background: #357abd;
  transform: translateY(-1px);
}

.btn-google {
  background: white;
  color: #333;
  border: 2px solid #ddd;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #4a90e2;
  transform: translateY(-1px);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* User info bar */
#userInfo {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1000;
}

#currentUser {
  color: #2c5aa0;
  font-weight: bold;
}

@media (max-width: 768px) {
  #gameCanvas {
    width: 100%;
    height: 400px;
  }
  
  #ui {
    flex-direction: column;
  }
  
  #playersList {
    border-right: none;
    border-bottom: 2px solid #dee2e6;
  }
  
  .auth-buttons {
    flex-direction: column;
  }
  
  #userInfo {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 10px;
    justify-content: center;
  }
}