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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.instructions {
  font-size: 1.1em;
  margin-top: 15px;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-block;
}

main {
  display: flex;
  gap: 30px;
  padding: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-area {
  flex: 1;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#gameCanvas {
  border: 4px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  background: white;
}

.stats-panel {
  flex: 0 0 280px;
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats-panel h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.5em;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

.stats-panel p {
  margin: 10px 0;
  font-size: 1.1em;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border-left: 4px solid #f5576c;
}

.inventory {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #ddd;
}

.inventory h4 {
  color: #764ba2;
  margin-bottom: 12px;
  font-size: 1.2em;
}

.inventory p {
  border-left-color: #764ba2;
  font-size: 1em;
}

footer {
  background: #f8f9fa;
  padding: 25px 30px;
  border-top: 3px solid #e9ecef;
}

.legend h4 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.legend-items {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.color-box {
  width: 25px;
  height: 25px;
  border: 2px solid #333;
  border-radius: 4px;
  display: inline-block;
}

.color-box.meadow {
  background-color: #7ec850;
}

.color-box.sand {
  background-color: #f5deb3;
}

.color-box.lake {
  background-color: #4a90e2;
}

.color-box.stone {
  background-color: #8b8680;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8em;
  }

  main {
    flex-direction: column;
    padding: 20px;
  }

  .stats-panel {
    flex: 1;
  }

  .legend-items {
    flex-direction: column;
  }
}
