/* ===== 30-ui.css — элементы интерфейса (кнопки, модалки, тосты, ранг) ===== */

/* Кнопки общего назначения */
.btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 10px 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25), var(--shadow-1);
    transition: transform .2s, background .25s;
}

.btn:active {
    transform: scale(.95);
}

.btn.retry {
    background: red;
    color: #fff;
}

.btn.retry:hover {
    background: #b30000;
}

.btn.menu {
    background: #444;
    color: #fff;
}

.btn.menu:hover {
    background: #666;
}

/* UI-кнопки */
.btn-ui {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 10px 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25), var(--shadow-1);
    transition: transform .15s, filter .2s, background .2s;
}

.btn-ui:active {
    transform: scale(.97);
}

.btn-primary {
    color: #2b1d00;
    background: linear-gradient(180deg, var(--ui-yellow) 0%, var(--ui-yellow-2) 100%);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, .45);
}

.btn-secondary {
    color: var(--ui-text);
    background: linear-gradient(180deg, #2a3b5c 0%, #1b273f 100%);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(180deg, #ff6b6b 0%, #d63031 100%);
}

/* Бейдж */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font: 10px 'Press Start 2P', monospace;
    color: #2b1d00;
    background: var(--ui-yellow);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

/* Тосты */
.toast-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    gap: 8px;
    z-index: 1300;
}

.toast {
    background: #101c36;
    color: #fff;
    border: 1px solid rgba(34, 60, 110, .65);
    padding: 8px 10px;
    font: 10px 'Press Start 2P', monospace;
    box-shadow: var(--shadow-1);
    animation: toastIn .18s ease-out;
}

@keyframes toastIn {
    from {
        transform: translate(-50%, 8px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Модалки */
.modal {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .7);
    z-index: 1200;
}

.modal.show {
    display: flex;
}

.modal-card {
    width: 86%;
    max-width: 340px;
    color: var(--ui-text);
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(42, 22, 78, .92), rgba(59, 31, 118, .92));
    border: 2px solid rgba(255, 255, 255, .06);
    box-shadow: var(--shadow-1);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-title {
    font: 14px 'Press Start 2P', monospace;
    color: var(--ui-yellow);
}

.modal-close {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
}

/* Модалка «inline» (когда контент встраивается в вкладку) */
.modal.inline {
    position: static;
    display: block;
    background: transparent;
}

.modal.inline .modal-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal.inline .modal-close {
    display: none;
}

/* Карточка ранга */
.rank-card {
    position: absolute;
    left: 50%;
    top: var(--rank-y);
    transform: translate(-50%, -50%);
    width: 78%;
    color: #fff;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(42, 22, 78, .85), rgba(59, 31, 118, .85));
    box-shadow: var(--shadow-1);
    z-index: 5;
    display: none;
    /* видна только на battle */
}

.rank-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rank-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-icon {
    font-size: 14px;
    opacity: .9;
}

.rank-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .3px;
}

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font: 10px 'Press Start 2P', monospace;
    color: #fff;
    background: linear-gradient(180deg, #67c1ff, #4ba6e9);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

.rank-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    padding: 2px;
    box-shadow: var(--shadow-inner);
}

.rank-fill {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ui-yellow), var(--ui-yellow-2));
    box-shadow: 0 0 10px rgba(255, 216, 74, .35);
    width: 0%;
}

.rank-dot {
    position: absolute;
    left: 6px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffcf4d;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(255, 220, 90, .4);
}

.rank-text {
    margin-top: 6px;
    font: 10px 'Press Start 2P', monospace;
    color: #e9e4ff;
    opacity: .85;
    text-align: right;
}