/* 2048 — score bar + tile grid only.
   The page shell, buttons, overlay and switcher come from css/game.css,
   which is linked first. Shared by all 8 languages. */

.container {
  max-width: 480px;
}

/* No difficulty screen, so the h1 sits tighter to the score bar. */
h1 {
  margin: 0 0 16px;
}

/* --- Score bar --- */
.score-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 92px;
  padding: 8px 16px;
  border-radius: var(--radius-btn-sm);
  background: var(--surface-grey);
}

.score-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}

.score-box span:last-child {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* --- Board --- */
.board-wrap {
  max-width: 440px;
}

.board-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: var(--radius-btn-sm);
  background: #d6c6b8;
  touch-action: none;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(238, 228, 218, 0.4);
  font-weight: 700;
  line-height: 1;
  color: #776e65;
  font-size: clamp(1.3rem, 8vw, 2.2rem);
  user-select: none;
}

.tile.v128, .tile.v256, .tile.v512 {
  font-size: clamp(1.1rem, 6.5vw, 1.8rem);
}

.tile.v1024, .tile.v2048, .tile.vsuper {
  font-size: clamp(0.9rem, 5.5vw, 1.5rem);
}

.tile.new {
  animation: pop 0.15s ease;
}

@keyframes pop {
  0% { transform: scale(0.5); }
  100% { transform: scale(1); }
}

.tile.v2 { background: #eee4da; }
.tile.v4 { background: #ede0c8; }
.tile.v8 { background: #f2b179; color: #fff; }
.tile.v16 { background: #f59563; color: #fff; }
.tile.v32 { background: #f67c5f; color: #fff; }
.tile.v64 { background: #f65e3b; color: #fff; }
.tile.v128 { background: #edcf72; color: #fff; }
.tile.v256 { background: #edcc61; color: #fff; }
.tile.v512 { background: #edc850; color: #fff; }
.tile.v1024 { background: #edc53f; color: #fff; }
.tile.v2048 { background: #edc22e; color: #fff; }
.tile.vsuper { background: #3c3a32; color: #fff; }

.hint-text {
  margin: 14px 0 16px;
}

.btn-primary {
  padding: 12px 32px;
}

/* --- Win / game-over overlay ---
   Matches the board's own radius rather than the shared 8px. */
.win-overlay {
  gap: 18px;
  border-radius: var(--radius-btn-sm);
}

#overlay-text {
  font-size: 1.6rem;
}

.overlay-actions .hidden {
  display: none;
}

@media (max-width: 480px) {
  body { padding: 12px; }
  .container { padding: 18px 14px; }
  h1 { font-size: 1.5rem; }
  .board-2048 { gap: 8px; padding: 8px; }
}
