/* Base Reset and Typography */
* {
  box-sizing: border-box;
  font-family: 'Nunito Sans', sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background: #faf8f5;
  padding: 20px;
  color: #333;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #4c7ef3;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.navbar-logo {
  font-weight: 700;
  font-size: 20px;
}

.navbar-links {
  list-style: none;
  display: flex;
  gap: 15px;
}

.navbar-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.navbar-links a.active {
  text-decoration: underline;
}

.navbar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  display: none;
  cursor: pointer;
}

@media (max-width: 600px) {
  .navbar-toggle {
    display: block;
  }

  .navbar-links {
    flex-direction: column;
    width: 100%;
    display: none;
    margin-top: 10px;
  }

  .navbar-links.show {
    display: flex;
  }
}

/* Game Container */
.merger-container {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

header h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.score-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f0f0f0;
  padding: 10px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 600;
}

.score-panel button {
  background: #4c7ef3;
  border: none;
  color: white;
  padding: 8px 16px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}

/* Grid Styling */
.grid {
  background: #bbada0;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 10px;
}

/* Tiles */
.tile {
  width: 80px;
  height: 80px;
  background: #ccc0b3;
  border-radius: 8px;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #776e65;
  transition: all 0.2s ease;
}

/* Tile Colors */
.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; color: #fff; }
.tile-16 { background: #f59563; color: #fff; }
.tile-32 { background: #f67c5f; color: #fff; }
.tile-64 { background: #f65e3b; color: #fff; }
.tile-128 { background: #edcf72; color: #fff; }
.tile-256 { background: #edcc61; color: #fff; }
.tile-512 { background: #edc850; color: #fff; }
.tile-1024 { background: #edc53f; color: #fff; }
.tile-2048 { background: #edc22e; color: #fff; }

/* Game Over */
#game-over {
  margin-top: 20px;
  font-size: 20px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.95);
  border: 2px dashed #ec3636;
  border-radius: 10px;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

#game-over.hidden {
  display: none;
}

#game-over button {
  margin-top: 10px;
  padding: 10px 20px;
  background: #4c7ef3;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
