.tz .panel { min-width: 0; }
.tz-top { align-items: center; justify-content: space-between; gap: 12px; }
.tz-scores { display: flex; gap: 8px; }
.tz-sc { background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; display: flex; flex-direction: column; align-items: center; min-width: 84px; }
.tz-sc b { font: 600 20px/1.2 var(--mono); color: var(--ink); }
.tz-pal { margin-top: 14px; }
.tz-pal-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tz-pb { font: 600 13px/1 var(--font); min-width: 44px; height: 40px; padding: 0 6px; border-radius: 8px; border: 0; cursor: pointer; }
.tz-pb[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.tz-stage { position: relative; max-width: 440px; margin: 16px auto 0; }
.tz-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; background: #bbada0; border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tz-cell { aspect-ratio: 1; border-radius: 8px; background: rgba(238, 228, 218, .35); position: relative; min-width: 0; }
.tz-cell.editable { cursor: pointer; }
.tz-t { position: absolute; inset: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; font: 700 clamp(22px, 8vw, 40px)/1 var(--font); letter-spacing: -1px; }
.tz-t.small { font-size: clamp(16px, 6vw, 30px); }
.tz-t.tiny { font-size: clamp(13px, 4.6vw, 24px); }
.tz-t.new { animation: tz-new .16s ease-out both; }
.tz-t.merged { animation: tz-pop .16s ease-out both; }
@keyframes tz-new { from { transform: scale(.2); opacity: 0; } }
@keyframes tz-pop { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .tz-t.new, .tz-t.merged { animation: none; } }
/* classic tile colors (the puzzle's own colors, the same in both themes) */
.t0 { background: transparent; }
.tz-pb.t0 { background: var(--canvas); border: 1px solid var(--line); color: var(--ink); }
.t2 { background: #eee4da; color: #776e65; } .t4 { background: #ede0c8; color: #776e65; }
.t8 { background: #f2b179; color: #f9f6f2; } .t16 { background: #f59563; color: #f9f6f2; }
.t32 { background: #f67c5f; color: #f9f6f2; } .t64 { background: #f65e3b; color: #f9f6f2; }
.t128 { background: #edcf72; color: #f9f6f2; } .t256 { background: #edcc61; color: #f9f6f2; }
.t512 { background: #edc850; color: #f9f6f2; } .t1024 { background: #edc53f; color: #f9f6f2; }
.t2048 { background: #edc22e; color: #f9f6f2; }
.t4096, .t8192, .t16384, .t32768, .t65536 { background: #3c3a32; color: #f9f6f2; }
.tz-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(238, 228, 218, .72); border-radius: 14px; }
.tz-over > div { background: var(--canvas); color: var(--body); border-radius: 16px; padding: 18px 22px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.tz-over b { font-size: 20px; color: var(--ink); }
.tz-arrows { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.tz-arrows .btn-icon { width: 52px; height: 48px; font-size: 22px; }
.tz-arrows .btn.hint { background: var(--ink); color: var(--canvas); }
.tz-actions { justify-content: center; }
.tz-ai { margin-top: 16px; justify-content: center; gap: 12px 20px; }
.tz-msg { max-width: 560px; margin: 14px auto 0; }
.tz-msg:empty { display: none; }
.tz-rank { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tz-rank li { display: flex; gap: 10px; align-items: baseline; }
.tz-rank li b { min-width: 72px; font-weight: 500; }
.tz-rank li.best b { font-weight: 700; color: var(--ink); }
.tz-rank li span { color: var(--muted); }
.tz-keys { text-align: center; max-width: 560px; margin: 12px auto 0; }
