.arena-card {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

/* ЭКРАНЫ */

.screen {
    display: none;
}

.screen-active {
    display: block;
}

/* ВЕРХНЯЯ ПАНЕЛЬ */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    min-width: 30px;
}

.back-btn {
    display: block;
    position: relative;
    padding: 6px 12px;
    border-radius: 8px;
    background: #1f1f1f;
    border: 1px solid #444;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    opacity: 0.85;
    justify-content: flex-end;
}

/* ТЕКСТ */

h1 {
    margin: 0 0 4px;
}

.subtitle {
    margin: 0 0 18px;
    opacity: 0.8;
    font-size: 14px;
}

/* ИГРОК */

.player-block {
    margin-top: 10px;
    margin-bottom: 10px;
}

.player-block label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    opacity: 0.9;
}

#player-name {
    width: 100%;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #151515;
    color: #fff;
    font-size: 14px;
}

#player-name:focus {
    outline: none;
    border-color: #d51ac3;
}

.player-hint {
    margin: 4px 0 0;
    font-size: 11px;
    opacity: 0.7;
}

/* ДОСКА */

.board-wrapper {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}

.board {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: repeat(4, 80px);
    gap: 8px;
    background: #1b1b1b;
    padding: 10px;
    border-radius: 12px;
}

.cell {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #2b2b2b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    transition: background .1s ease, transform .08s ease;
}

/* Цвета плиток */

.tile-2  { background: #3c3c3c; }
.tile-4  { background: #4b4b4b; }
.tile-8  { background: #805ad5; }
.tile-16 { background: #d53f8c; }
.tile-32 { background: #dd6b20; }
.tile-64 { background: #e53e3e; }
.tile-128 { background: #38a169; }
.tile-256 { background: #3182ce; }
.tile-512 { background: #d69e2e; }
.tile-1024 { background: #b83280; }
.tile-2048 { background: #ecc94b; }

.cell.spawn {
    transform: scale(1.05);
}

/* КНОПКИ */

.controls {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.primary-btn,
.secondary-btn {
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.primary-btn {
    background: #d51ac3;
    border: none;
    color: #fff;
}

.secondary-btn {
    background: #1f1f1f;
    border: 1px solid #444;
    color: #fff;
}

/* РЕЗУЛЬТАТ */

.result-layout {
    margin-top: 10px;
}

.result-info p {
    margin: 4px 0;
}

.result-player {
    margin: 4px 0 8px;
    font-size: 13px;
    opacity: 0.8;
}

.result-controls {
    margin-top: 20px;
}

/* АДАПТИВ */

@media (max-width: 600px) {
    .board {
        grid-template-columns: repeat(4, 64px);
        grid-template-rows: repeat(4, 64px);
        gap: 6px;
    }

    .cell {
        width: 64px;
        height: 64px;
        font-size: 18px;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .stats {
        justify-content: flex-start;
    }

    .controls {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        text-align: center;
    }
}
