#gameCanvas {
  margin-top: 40px;
  border: 1px solid black;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: #f0f0f0;
  font-family: Arial, sans-serif;
}
.auth-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 300px;
}
.auth-form h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}
.auth-form input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}
.auth-form button {
  width: 100%;
  padding: 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}
.auth-form button:hover {
  background-color: #45a049;
}
.auth-form p {
  text-align: center;
  margin-top: 15px;
}
.auth-form a {
  color: #4CAF50;
  text-decoration: none;
}
.password-strength {
  margin: 10px 0;
}
.strength-bar {
  height: 5px;
  background-color: #ddd;
  border-radius: 2px;
  margin-bottom: 5px;
}
.strength-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: 0;
  background-color: #ff4444;
  border-radius: 2px;
  transition: width 0.3s, background-color 0.3s;
}
.strength-text {
  font-size: 12px;
  color: #666;
}

.h-captcha {
  margin: 15px 0;
  display: flex;
  justify-content: center;
}
.welcome-box {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 500px;
}
.welcome-box h2 {
  color: #333;
  margin-bottom: 20px;
}
.instructions {
  text-align: left;
  margin: 20px 0;
}
.instructions ul {
  list-style-type: none;
  padding: 0;
}
.instructions li {
  margin: 10px 0;
  padding-left: 20px;
  position: relative;
}
.instructions li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #4CAF50;
}
#startGameBtn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#startGameBtn:hover {
  background-color: #45a049;
}
#gameOverBox {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 300px;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  color: white;
  z-index: 1001;
}
.game-over-content {
  padding: 20px;
}
#gameOverBox h2 {
  margin: 0 0 20px 0;
  color: #ff4444;
}
#gameOverBox h3 {
  margin: 10px 0;
  color: #fff;
}

#touchControls {
  position: fixed;
  bottom: 10px;
}
#topScoresList {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
#topScoresList li {
  margin: 5px 0;
}
#playAgainBtn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}
#playAgainBtn:hover {
  background-color: #45a049;
}
.hidden {
  display: none;
}
.menu-container {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1002;
}
.hamburger-menu {
  cursor: pointer;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  border: 1px solid #ddd;
}
.hamburger-menu .line {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 5px 0;
  transition: all 0.3s ease;
}
.dropdown-menu {
  position: absolute;
  top: 40px;
  right: 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 120px;
}
.dropdown-menu a {
  display: block;
  padding: 10px;
  color: #333;
  text-decoration: none;
}
.dropdown-menu a:hover {
  background-color: #f0f0f0;
}
.connections-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 60px auto;
  min-height: 70vh;
}
.connections-container h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}
#connectionsTable {
  width: 100%;
  border-collapse: collapse;
}
#connectionsTable th,
#connectionsTable td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}
#connectionsTable th {
  background-color: #f4f4f4;
}
#connectionsTable button {
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}
#connectionsTable button:hover {
  background-color: #cc0000;
}
.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #4CAF50;
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}
.current-connection {
  color: #4CAF50;
  font-weight: bold;
}
.scores-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 60px auto;
  min-height: 70vh;
  min-width: 70vw;
}
.scores-container h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}
#scoresTable {
  width: 100%;
  border-collapse: collapse;
}
#scoresTable th,
#scoresTable td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}
#scoresTable th {
  background-color: #f4f4f4;
}


.touch-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  height: 150px;
  width: 200px;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
}

.touch-controls.left {
  right: auto;
  left: 20px;
}

.touch-togle-row {
  display: flex;
  justify-content: right;
}

.control-row {
  display: flex;
  justify-content: center;
}

.touch-btn {
  width: 65px;
  height: 65px;
  margin: 5px;
  background-color: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.touch-btn:active {
  background-color: rgba(0, 0, 0, 0.5);
}

.toggle-btn {
  width: 40px;
  height: 40px;
  margin-top: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.toggle-btn:active {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Room Selection Styles */
.room-selection {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.room-selection.hidden {
  display: none !important;
}

.room-selection-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.room-selection-content h2 {
  text-align: center;
  color: #333;
  margin-bottom: 10px;
}

.room-selection-content p {
  text-align: center;
  color: #666;
  margin-bottom: 25px;
}

.auto-join-section {
  margin-bottom: 25px;
}

.auto-join-btn, .wait-room-btn {
  width: 100%;
  padding: 15px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background-color 0.3s;
}

.auto-join-btn:hover {
  background-color: #45a049;
}

.wait-room-btn {
  background-color: #ff9800;
}

.wait-room-btn:hover {
  background-color: #e68900;
}

.rooms-divider {
  text-align: center;
  margin: 25px 0;
  position: relative;
}

.rooms-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #ddd;
}

.rooms-divider span {
  background: white;
  padding: 0 15px;
  color: #666;
  font-size: 14px;
}

.rooms-list {
  margin-bottom: 20px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.room-item:hover {
  border-color: #4CAF50;
  background-color: #f9f9f9;
}

.room-item.full {
  opacity: 0.6;
  cursor: not-allowed;
  border-color: #ccc;
}

.room-item.full:hover {
  border-color: #ccc;
  background-color: white;
}

.room-info {
  flex: 1;
}

.room-name {
  font-weight: bold;
  font-size: 16px;
  color: #333;
  margin-bottom: 5px;
}

.room-players {
  font-size: 14px;
  color: #666;
}

.room-status {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.room-status.available {
  background-color: #e8f5e8;
  color: #4CAF50;
}

.room-status.full {
  background-color: #ffe8e8;
  color: #f44336;
}

.refresh-section {
  text-align: center;
}

.refresh-btn {
  padding: 10px 20px;
  background-color: #2196F3;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.refresh-btn:hover {
  background-color: #1976D2;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

.error-message {
  background-color: #ffe8e8;
  color: #f44336;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  text-align: center;
}

.success-message {
  background-color: #e8f5e8;
  color: #4CAF50;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  text-align: center;
}