html {
  height: 100%;
  width: 100%;
}

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

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #333;
}

.game-container {
  width: 800px;
  height: 600px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
}

.header {
  background: #2c3e50;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-info {
  display: flex;
  gap: 20px;
}

.score-info > div {
  font-weight: bold;
}

.screen {
  display: none;
  height: calc(100% - 60px);
  padding: 20px;
}

.screen.active {
  display: block;
}

#menuScreen {
  text-align: center;
}

#menuScreen h1 {
  color: #2c3e50;
  margin-bottom: 30px;
  font-size: 2.5em;
}

.mode-selection {
  margin: 30px 0;
}

.mode-btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 15px 30px;
  margin: 10px;
  border-radius: 10px;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s;
}

.mode-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.level-selection {
  margin: 20px 0;
}

.level-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.level-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
}

.level-btn:hover {
  background: #c0392b;
}

.level-btn.selected {
  background: #27ae60;
}

#startGame {
  background: #27ae60;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 1.2em;
  cursor: pointer;
  margin-top: 20px;
}

.instructions {
  background: #ecf0f1;
  padding: 20px;
  border-radius: 10px;
  margin-top: 30px;
  text-align: left;
}

.game-area {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 20px auto;
  background: #34495e;
  border-radius: 10px;
  overflow: hidden;
}

.game-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 2px;
}

.game-grid.grid-3x3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.game-grid.grid-1x5 {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr;
}

.grid-cell {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.player {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: all 0.3s ease-in-out;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.player.skin-default {
  background: radial-gradient(circle, #3498db, #2980b9);
}

.player.skin-fire {
  background: radial-gradient(circle, #e74c3c, #c0392b);
}

.player.skin-gold {
  background: radial-gradient(circle, #f1c40f, #f39c12);
}

.player.skin-emerald {
  background: radial-gradient(circle, #2ecc71, #27ae60);
}

.obstacle {
  position: absolute;
  background: #e74c3c;
  border-radius: 5px;
  z-index: 5;
}

.obstacle.from-top {
  width: 20px;
  height: 40px;
}

.obstacle.from-side {
  width: 40px;
  height: 20px;
}

.coin {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #f1c40f;
  border-radius: 50%;
  z-index: 8;
  animation: coinSpin 1s infinite linear;
}

@keyframes coinSpin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.game-controls {
  text-align: center;
  margin-top: 20px;
}

.game-controls button {
  background: #95a5a6;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 0 10px;
  border-radius: 5px;
  cursor: pointer;
}

#gameOverScreen {
  text-align: center;
}

#gameOverScreen h2 {
  color: #e74c3c;
  margin-bottom: 30px;
}

.final-score {
  background: #ecf0f1;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

#gameOverScreen button {
  background: #3498db;
  color: white;
  border: none;
  padding: 15px 30px;
  margin: 10px;
  border-radius: 10px;
  cursor: pointer;
}

#skinShop {
  text-align: center;
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.shop-item {
  background: #ecf0f1;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.shop-item.owned {
  opacity: 0.5;
}

.shop-item button {
  background: #27ae60;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

.shop-item button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

.skin-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 10px auto;
}
