/* Shared bits for the games */
.board { flex: 1; min-height: 0; border-radius: 16px; background: var(--surface); position: relative; overflow: hidden; display: grid; place-items: center; }
.board canvas { display: block; max-width: 100%; max-height: 100%; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(10, 12, 16, .78); text-align: center; padding: 20px; }
.overlay.hidden { display: none; }
.overlay .big { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.overlay .sub { font-size: 17px; color: var(--muted); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; height: 100%; padding: 10px; }
.cell { border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 34px; background: var(--surface-2); color: #fff; transition: transform .12s; }
.cell.new { animation: popin .16s ease-out; }
@keyframes popin { from { transform: scale(.6); } }
.t2 { background: #eee4da; color: #776e65; } .t4 { background: #ede0c8; color: #776e65; }
.t8 { background: #f2b179; } .t16 { background: #f59563; } .t32 { background: #f67c5f; } .t64 { background: #f65e3b; }
.t128 { background: #edcf72; font-size: 30px; } .t256 { background: #edcc61; font-size: 30px; } .t512 { background: #edc850; font-size: 30px; }
.t1024 { background: #edc53f; font-size: 26px; } .t2048 { background: #edc22e; font-size: 26px; }
.board:focus { outline: none; box-shadow: 0 0 0 2px var(--accent), 0 0 20px var(--glow); }
