.g2048-play {
  --size: min(70vh, 54vw);
  --key: max(var(--tap), calc(var(--size) / 5.4));
  display: flex; align-items: center; gap: clamp(20px, 3vw, 56px);
}
.g2048-board {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 10px;
  width: var(--size); height: var(--size);
  padding: 10px; border-radius: var(--radius); background: var(--sea-deep);
  touch-action: none; cursor: grab;
}
.g2048-cell { position: relative; border-radius: 12px; background: #24434c; }
.g2048-tile {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 12px; background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-weight: 600; line-height: 1; font-variant-numeric: lining-nums tabular-nums;
  font-size: calc(var(--size) / 8.5);
}
.g2048-tile[data-len="3"] { font-size: calc(var(--size) / 10.5); }
.g2048-tile[data-len="4"] { font-size: calc(var(--size) / 13); }
.g2048-tile[data-len="5"] { font-size: calc(var(--size) / 17); }
.g2048-tile[data-len="6"] { font-size: calc(var(--size) / 20); }

/* sand -> coral -> sea */
.g2048-tile[data-value="2"] { background: var(--cream); }
.g2048-tile[data-value="4"] { background: var(--sand-deep); }
.g2048-tile[data-value="8"] { background: #e3c7a4; }
.g2048-tile[data-value="16"] { background: #d4ad85; }
.g2048-tile[data-value="32"] { background: #c49a72; }
.g2048-tile[data-value="64"] { background: #a8784f; color: #fff; }
.g2048-tile[data-value="128"] { background: #8e6140; color: #fff; }
.g2048-tile[data-value="256"] { background: #7aa3a6; color: var(--sea-deep); }
.g2048-tile[data-value="512"] { background: #5b8a8f; color: #fff; }
.g2048-tile[data-value="1024"] { background: #3e6c74; color: #fff; }
.g2048-tile[data-value="2048"] { background: #f2cf8f; color: var(--sea-deep); box-shadow: 0 0 0 4px var(--coral) inset; }
.g2048-tile[data-value="big"] { background: var(--cream); color: var(--sea-deep); box-shadow: 0 0 0 4px var(--coral) inset; }

.g2048-tile.is-new { animation: g2048-pop 0.18s ease-out 0.08s backwards; }
.g2048-tile.is-merged { animation: g2048-bump 0.2s ease-out 0.06s; }
@keyframes g2048-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes g2048-bump { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .g2048-tile.is-new, .g2048-tile.is-merged { animation: none; } }

/* "Keep playing" (added by game.js to the win message) only after reaching 2048 */
.game-win-actions .gbtn[hidden] { display: none; }

/* On-screen arrows in a plus shape beside the board */
.g2048-pad {
  display: grid; grid-template-columns: repeat(3, var(--key)); grid-template-rows: repeat(3, var(--key)); gap: 10px;
}
.g2048-pad .gbtn { width: var(--key); height: var(--key); padding: 0; border-radius: 20px; background: var(--sand-deep); }
.g2048-pad .gbtn svg { width: 46%; height: 46%; stroke-width: 2.4; }
.g2048-up { grid-area: 1 / 2; }
.g2048-left { grid-area: 2 / 1; }
.g2048-right { grid-area: 2 / 3; }
.g2048-down { grid-area: 3 / 2; }
