body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

#main-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('2025-03-13_14-53-13.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
}

#main-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.menu-content {
  position: relative;
  background: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 600px;
  width: 90%;
}

.tutorial {
  margin-top: 2rem;
  text-align: left;
}

.tutorial ul {
  list-style-type: none;
  padding: 0;
}

.tutorial li {
  margin: 0.8rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.tutorial li:before {
  content: "•";
  position: absolute;
  left: 0;
}

button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #2980b9;
}

#game-container {
  display: none;
}

.build-menu {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  padding: 10px;
  width: 200px;
  max-height: 300px;
  overflow-y: auto;
}

.build-menu h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.building-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.building-button {
  background: rgba(52, 152, 219, 0.7);
  color: white;
  border: 1px solid white;
  border-radius: 3px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.building-button:hover {
  background: rgba(52, 152, 219, 0.9);
}

.building-button.selected {
  background: rgba(231, 76, 60, 0.7);
}

.building-icon {
  margin-bottom: 5px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cost-label {
  display: none;
}

.terraform-menu {
  position: absolute;
  left: 10px;
  top: 150px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  padding: 10px;
  width: 200px;
}

.terraform-menu h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.biome-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.biome-button {
  border: 1px solid white;
  border-radius: 3px;
  padding: 5px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
}

.biome-button:hover {
  opacity: 0.8;
  border: 1px solid #f1c40f;
}

.biome-button.selected {
  border: 2px solid white;
  box-shadow: 0 0 5px white;
}

#gameCanvas {
  width: 100vw;
  height: 100vh;
  background: #000000;
}

.leaderboard {
  margin-top: 2rem;
  text-align: center;
}

.leaderboard table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.leaderboard th, .leaderboard td {
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.leaderboard th {
  background: rgba(255, 255, 255, 0.1);
}

.leaderboard tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 1000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #3498db;
  border-top: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 1.5rem;
  margin-top: 1rem;
  color: #3498db;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-tips {
  margin-top: 2rem;
  max-width: 400px;
  text-align: center;
  color: #bdc3c7;
  font-style: italic;
}

.result-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1001;
}

.result-content {
  position: relative;
  background: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 600px;
  width: 90%;
  color: white;
}

.result-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #f1c40f;
}

.result-title.victory {
  color: #2ecc71;
}

.result-title.defeat {
  color: #e74c3c;
}

.elo-change {
  font-size: 2rem;
  margin: 1rem 0;
}

.elo-change.positive {
  color: #2ecc71;
}

.elo-change.negative {
  color: #e74c3c;
}

.army-details {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 1rem;
  background: rgba(52, 73, 94, 0.5);
  border-radius: 5px;
}

.army-column {
  flex: 1;
  padding: 0 1rem;
}

.army-column h3 {
  color: #3498db;
  margin-bottom: 1rem;
}

.continue-button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 2rem;
}

.continue-button:hover {
  background: #2980b9;
}