.game-2048-page {
    background: #f5f7fb;
}

.logo-symbol {
    margin-right: 10px;
    font-size: 1.8rem;
    line-height: 1;
}

.game-shell {
    min-height: calc(100vh - 80px);
}

.compact-hero {
    padding: 48px 20px 72px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

.game-container {
    max-width: 760px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 24px;
}

.back-link:hover {
    color: #fff;
    text-decoration: underline;
}

.game-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    color: #fff;
    margin-bottom: 24px;
}

.game-heading h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    margin-bottom: 0.35rem;
    color: #fff;
}

.game-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 420px;
}

.score-panel {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.score-box {
    min-width: 96px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    text-align: center;
    color: #fff;
}

.score-box span {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    opacity: 0.78;
    margin-bottom: 4px;
}

.score-box strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.1;
}

.best-score {
    background: rgba(255, 255, 255, 0.22);
}

.game-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.game-actions .btn-primary {
    background: #fff;
    color: #4361ee;
    border-color: #fff;
}

.game-actions .btn-primary:hover {
    background: #f0f0f0;
}

.game-message {
    color: #fff;
    font-weight: 700;
    margin: 0;
    min-height: 1.6em;
    text-align: right;
}

.board-wrap {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: clamp(8px, 2vw, 14px);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.22);
    touch-action: none;
}

.board-2048 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: clamp(7px, 2vw, 12px);
    aspect-ratio: 1 / 1;
}

.tile {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: clamp(8px, 2vw, 14px);
    background: rgba(255, 255, 255, 0.24);
    color: #2f2f3a;
    font-size: clamp(1.35rem, 8vw, 3rem);
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    transition: transform 120ms ease, background-color 120ms ease, color 120ms ease;
}

.tile:not(:empty) {
    animation: tile-pop 140ms ease-out;
}

.tile-2 { background: #eee4da; }
.tile-4 { background: #ede0c8; }
.tile-8 { background: #f2b179; color: #fff; }
.tile-16 { background: #f59563; color: #fff; }
.tile-32 { background: #f67c5f; color: #fff; }
.tile-64 { background: #f65e3b; color: #fff; }
.tile-128 { background: #edcf72; color: #fff; font-size: clamp(1.15rem, 6.5vw, 2.4rem); }
.tile-256 { background: #edcc61; color: #fff; font-size: clamp(1.15rem, 6.5vw, 2.4rem); }
.tile-512 { background: #edc850; color: #fff; font-size: clamp(1.15rem, 6.5vw, 2.4rem); }
.tile-1024 { background: #edc53f; color: #fff; font-size: clamp(0.95rem, 5.8vw, 2rem); }
.tile-2048 { background: #edc22e; color: #fff; font-size: clamp(0.95rem, 5.8vw, 2rem); }
.tile-super { background: #2f2f3a; color: #fff; font-size: clamp(0.9rem, 5vw, 1.8rem); }

.instructions {
    margin: 22px auto 0;
    width: min(100%, 560px);
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.instructions p {
    margin-bottom: 0.45rem;
}

@keyframes tile-pop {
    0% { transform: scale(0.92); }
    70% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@media (max-width: 680px) {
    .compact-hero {
        padding-top: 32px;
    }

    .game-heading,
    .game-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .score-panel {
        justify-content: stretch;
    }

    .score-box {
        flex: 1;
    }

    .game-message {
        text-align: left;
    }
}

@media (max-width: 420px) {
    .compact-hero {
        padding-left: 12px;
        padding-right: 12px;
    }

    .board-wrap {
        border-radius: 16px;
    }
}
