/* 2048 小遊戲專用樣式（自行設計，非原作美術） */
.g48-head { display: flex; gap: 10px; justify-content: center; margin: 6px 0; }
.g48-box { position: relative; min-width: 110px; background: #1e3a8a; color: #fff; border-radius: 8px; padding: 6px 14px; text-align: center; }
.g48-box span { display: block; font-size: .8rem; color: #cbd5e1; }
.g48-box strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.g48-add { position: absolute; right: 8px; top: 4px; font-style: normal; font-weight: 700; color: #fde68a; opacity: 0; }
.g48-add.go { animation: g48-float .7s ease-out; }
@keyframes g48-float { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-24px); } }
.g48-actions { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.g48-board { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1 / 1; margin: 8px auto; background: #94a3b8; border-radius: 10px; padding: 3%; box-sizing: border-box; touch-action: none; user-select: none; -webkit-user-select: none; }
.g48-bg, .g48-tiles { position: absolute; inset: 3%; }
.g48-bg i { position: absolute; width: 22%; height: 22%; background: #cbd5e1; border-radius: 6px; }
.g48-bg i:nth-child(4n+1) { left: 0; } .g48-bg i:nth-child(4n+2) { left: 26%; } .g48-bg i:nth-child(4n+3) { left: 52%; } .g48-bg i:nth-child(4n+4) { left: 78%; }
.g48-bg i:nth-child(n+1):nth-child(-n+4) { top: 0; } .g48-bg i:nth-child(n+5):nth-child(-n+8) { top: 26%; }
.g48-bg i:nth-child(n+9):nth-child(-n+12) { top: 52%; } .g48-bg i:nth-child(n+13) { top: 78%; }
.g48-tile { position: absolute; width: 22%; height: 22%; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: 800; font-size: min(8vw, 2.2rem); line-height: 1; color: #1f2937; background: #e2e8f0; transition: left .1s ease-in-out, top .1s ease-in-out; box-sizing: border-box; }
.g48-tiles { container-type: inline-size; }
@supports (font-size: 1cqw) { .g48-tile { font-size: 9cqw; } .g48-tile.v128, .g48-tile.v256, .g48-tile.v512 { font-size: 7.5cqw; } .g48-tile.v1024, .g48-tile.v2048 { font-size: 6cqw; } .g48-tile.vbig { font-size: 5cqw; } }
.g48-tile.v2 { background: #e0e7ff; }
.g48-tile.v4 { background: #c7d2fe; }
.g48-tile.v8 { background: #fdba74; color: #fff; }
.g48-tile.v16 { background: #fb923c; color: #fff; }
.g48-tile.v32 { background: #f87171; color: #fff; }
.g48-tile.v64 { background: #ef4444; color: #fff; }
.g48-tile.v128 { background: #facc15; color: #fff; }
.g48-tile.v256 { background: #eab308; color: #fff; }
.g48-tile.v512 { background: #84cc16; color: #fff; }
.g48-tile.v1024 { background: #22c55e; color: #fff; }
.g48-tile.v2048 { background: #1d4ed8; color: #fff; box-shadow: 0 0 12px 3px rgba(29,78,216,.6); }
.g48-tile.vbig { background: #111827; color: #fff; }
.g48-tile.new { animation: g48-pop .18s ease-out .1s backwards; }
.g48-tile.merge { animation: g48-bump .16s ease-out; }
@keyframes g48-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes g48-bump { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }
.g48-over { position: absolute; inset: 0; border-radius: 10px; background: rgba(241, 245, 249, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 12px; z-index: 5; }
.g48-over[hidden] { display: none; }
.g48-over p { margin: 0; font-size: 1.3rem; font-weight: 800; color: #1e3a8a; }
.g48-over-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .g48-tile { transition: none; } .g48-tile.new, .g48-tile.merge, .g48-add.go { animation: none; } }
