.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; display: flex; flex-direction: column; }
.box .lbl { font-size: 12px; color: var(--muted); }
.box strong { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

.board {
  --gap: 2.4cqw;
  position: relative; width: 100%; aspect-ratio: 1; container-type: size;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 18px;
  touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; overflow: hidden;
}
.board:focus-visible { outline: 3px solid #F2C94C; outline-offset: 3px; }
.cells, .tiles { position: absolute; inset: 2.4cqw; }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: var(--gap); }
.cells > i { background: #0B2415; border-radius: 10px; display: block; }

.tile {
  --r: 0; --c: 0;
  position: absolute; left: 0; top: 0;
  width: calc((100% - 3 * var(--gap)) / 4); height: calc((100% - 3 * var(--gap)) / 4);
  transform: translate(calc(var(--c) * (100% + var(--gap))), calc(var(--r) * (100% + var(--gap))));
  transition: transform 110ms ease-out;
  z-index: 2;
}
.tile.gone { z-index: 1; }
.tile.top { z-index: 3; }
.tile > b {
  position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 9cqw; font-variant-numeric: tabular-nums;
  background: #0F2E1C; color: #CFEBD9;
}
.tile.len3 > b { font-size: 7.6cqw; }
.tile.len4 > b { font-size: 6.2cqw; }
.tile.len5 > b, .tile.len6 > b { font-size: 5cqw; }
.tile.born > b { animation: born 160ms ease-out 90ms backwards; }
.tile.pop > b { animation: pop 160ms ease-out 90ms; }
@keyframes born { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.14); } 100% { transform: scale(1); } }

.v2    > b { background: #0F2E1C; color: #CFEBD9; }
.v4    > b { background: #14402A; color: #E8F5EC; }
.v8    > b { background: #1F6B43; color: #FFFFFF; }
.v16   > b { background: #2A9156; color: #02100A; }
.v32   > b { background: #35D07F; color: #02100A; }
.v64   > b { background: #7BE0A0; color: #02100A; }
.v128  > b { background: #C9B26A; color: #1B1203; }
.v256  > b { background: #D79B4A; color: #1B1203; }
.v512  > b { background: #B8742E; color: #1B0E02; }
.v1024 > b { background: #8A4F1E; color: #FFFFFF; }
.v2048 > b { background: #F2C94C; color: #1B1203; box-shadow: 0 0 18px 2px rgba(242,201,76,.55); }
.vbig  > b { background: #FFF1B8; color: #1B1203; box-shadow: 0 0 18px 2px rgba(255,241,184,.55); }

.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 10px; }
.pad .btn { font-size: 18px; padding: 8px 0; }
