:root {
    --tile-bg: rgba(248, 250, 252, 0.08);
    --tile-border: rgba(255, 255, 255, 0.08);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-icon {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.game-instructions {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 18px;
    text-align: center;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 100px));
    grid-template-rows: repeat(4, minmax(70px, 100px));
    gap: 12px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.board-cell,
.tile {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
}

.board-cell {
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
}

.tile {
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: #111827;
    text-shadow: 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    transform: scale(0.98);
    animation: pop 0.18s ease-out;
}

@keyframes pop {
    from { transform: scale(0.85); }
    to { transform: scale(1); }
}

.tile-2 { background: #f3f4f6; color: #111827; }
.tile-4 { background: #e2e8f0; color: #111827; }
.tile-8 { background: #fbbf24; color: #111827; }
.tile-16 { background: #f59e0b; color: #111827; }
.tile-32 { background: #f97316; color: #ffffff; }
.tile-64 { background: #ef4444; color: #ffffff; }
.tile-128 { background: #8b5cf6; color: #ffffff; }
.tile-256 { background: #6366f1; color: #ffffff; }
.tile-512 { background: #14b8a6; color: #ffffff; }
.tile-1024 { background: #0ea5e9; color: #ffffff; }
.tile-2048 { background: #22c55e; color: #ffffff; }
.tile-4096 { background: #e879f9; color: #ffffff; }
.tile-8192 { background: #f43f5e; color: #ffffff; }

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 24px;
}

.overlay.hidden {
    display: none;
}

.board-wrapper {
    position: relative;
}

@media (max-width: 640px) {
    .game-board {
        grid-template-columns: repeat(4, minmax(60px, 1fr));
        gap: 10px;
    }
    .tile { font-size: 1.1rem; }
}
