::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.score-box {
    min-width: 110px;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.55rem 0.75rem;
}

.score-label {
    color: #64748b;
    font-size: 0.75rem;
}

.score-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.game-wrap {
    width: min(92vw, 460px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 1rem;
    background: #bbada0;
    padding: 10px;
    position: relative;
    outline: none;
    touch-action: none;
}

.grid-bg {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
}

.grid-cell {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 0.55rem;
}

.tiles {
    position: absolute;
    inset: 10px;
}

.tile {
    position: absolute;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    transition: transform 120ms ease;
    user-select: none;
}

.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; color: #f9f6f2; }
.tile-16 { background: #f59563; color: #f9f6f2; }
.tile-32 { background: #f67c5f; color: #f9f6f2; }
.tile-64 { background: #f65e3b; color: #f9f6f2; }
.tile-128 { background: #edcf72; color: #f9f6f2; }
.tile-256 { background: #edcc61; color: #f9f6f2; }
.tile-512 { background: #edc850; color: #f9f6f2; }
.tile-1024 { background: #edc53f; color: #f9f6f2; }
.tile-2048 { background: #edc22e; color: #f9f6f2; }
.tile-super { background: #3b82f6; color: #f8fafc; }

.overlay {
    position: absolute;
    inset: 10px;
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.overlay-panel {
    background: #fff;
    border-radius: 0.8rem;
    padding: 1rem 1.1rem;
    text-align: center;
    width: min(280px, calc(100% - 1.5rem));
}

.overlay-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.overlay-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0.3rem 0 0.8rem;
}

.hidden { display: none; }
