/* 2048 Game Styles */

/* Game container */
.game-2048-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 15px;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  color: #776e65;
}

/* Header */
.game-2048-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.game-2048-title {
  font-size: 32px;
  font-weight: bold;
}

.game-2048-title h1 {
  font-size: 60px;
  font-weight: bold;
  margin: 0;
  color: #776e65;
}

.game-2048-scores {
  display: flex;
  gap: 10px;
}

.game-2048-score-container {
  position: relative;
  background: #bbada0;
  padding: 8px 15px;
  border-radius: 6px;
  text-align: center;
  min-width: 70px;
}

.game-2048-score-label {
  color: #eee4da;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: bold;
}

.game-2048-score {
  color: white;
  font-size: 20px;
  font-weight: bold;
}

/* Description and new game button */
.game-2048-description {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.game-2048-description p {
  margin: 0;
}

.game-2048-new-game-button {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 3px;
  padding: 8px 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-2048-new-game-button:hover {
  background: #9f8b77;
}

/* Grid container */
.game-2048-grid-container {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Make it square */
  background: #bbada0;
  border-radius: 6px;
  overflow: hidden;
}

/* Background grid */
.game-2048-grid-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 15px;
  padding: 15px;
}

.game-2048-grid-cell {
  background: #cdc1b4;
  border-radius: 3px;
}

/* Tile container */
.game-2048-grid-tile-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Tiles */
.game-2048-tile {
  position: absolute;
  width: calc(25% - 15px - 15px/4);
  height: calc(25% - 15px - 15px/4);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: bold;
  border-radius: 3px;
  transition: all 0.1s ease;
}

/* Tile colors */
.game-2048-tile-2 {
  background: #eee4da;
  color: #776e65;
}

.game-2048-tile-4 {
  background: #ede0c8;
  color: #776e65;
}

.game-2048-tile-8 {
  background: #f2b179;
  color: #f9f6f2;
}

.game-2048-tile-16 {
  background: #f59563;
  color: #f9f6f2;
}

.game-2048-tile-32 {
  background: #f67c5f;
  color: #f9f6f2;
}

.game-2048-tile-64 {
  background: #f65e3b;
  color: #f9f6f2;
}

.game-2048-tile-128 {
  background: #edcf72;
  color: #f9f6f2;
  font-size: 28px;
}

.game-2048-tile-256 {
  background: #edcc61;
  color: #f9f6f2;
  font-size: 28px;
}

.game-2048-tile-512 {
  background: #edc850;
  color: #f9f6f2;
  font-size: 28px;
}

.game-2048-tile-1024 {
  background: #edc53f;
  color: #f9f6f2;
  font-size: 24px;
}

.game-2048-tile-2048 {
  background: #edc22e;
  color: #f9f6f2;
  font-size: 24px;
}

/* Tile animations */
.game-2048-tile-new {
  animation: tile-appear 0.2s ease;
}

@keyframes tile-appear {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

/* Message container */
.game-2048-message {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(238, 228, 218, 0.73);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fade-in 0.3s ease;
  z-index: 100;
}

.game-2048-message-text {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
}

.game-2048-buttons {
  margin-top: 10px;
}

.game-2048-retry-button {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 3px;
  padding: 8px 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-2048-retry-button:hover {
  background: #9f8b77;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive design */
@media (max-width: 520px) {
  .game-2048-container {
    padding: 10px;
  }
  
  .game-2048-header {
    margin-bottom: 15px;
  }
  
  .game-2048-title h1 {
    font-size: 40px;
  }
  
  .game-2048-score-container {
    padding: 5px 10px;
    min-width: 60px;
  }
  
  .game-2048-score {
    font-size: 16px;
  }
  
  .game-2048-description {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .game-2048-new-game-button {
    width: 100%;
    padding: 10px;
  }
  
  /* Adjust tile font sizes for smaller screens */
  .game-2048-tile {
    font-size: 26px;
  }
  
  .game-2048-tile-128,
  .game-2048-tile-256,
  .game-2048-tile-512 {
    font-size: 22px;
  }
  
  .game-2048-tile-1024,
  .game-2048-tile-2048 {
    font-size: 18px;
  }
}

/* Handle very small screens */
@media (max-width: 360px) {
  .game-2048-title h1 {
    font-size: 32px;
  }
  
  .game-2048-score-container {
    min-width: 50px;
  }
  
  .game-2048-tile {
    font-size: 22px;
  }
  
  .game-2048-tile-128,
  .game-2048-tile-256,
  .game-2048-tile-512 {
    font-size: 18px;
  }
  
  .game-2048-tile-1024,
  .game-2048-tile-2048 {
    font-size: 16px;
  }
}