.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal:not(.hidden) {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 500px;
    height: 85%;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: auto;
}

.modal:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 10;
}

.modal-header h2,
.modal-header h3 {
    color: var(--accent);
    font-weight: 900;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    transition: all 0.2s;
}

.close-btn:active {
    background: rgba(255, 100, 100, 0.2);
}

.scrollable-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
}

.scrollable-list::-webkit-scrollbar {
    width: 3px;
}

.scrollable-list::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 2px;
}

.center-modal {
    align-items: center !important;
}

.modal-content.confirmation-content {
    height: auto !important;
    min-height: 180px;
    width: 90%;
    max-width: 340px;
    border-radius: 24px !important;
    padding: 24px !important;
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    transform: scale(0.85);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.center-modal:not(.hidden) .confirmation-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header.no-border {
    border-bottom: none;
    padding-bottom: 0;
}

.confirm-text {
    text-align: center;
    margin: 10px 0 18px;
    color: #aaa;
    font-size: 14px;
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.confirmation-buttons button {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    border-radius: 14px;
    border: none;
    color: white;
    pointer-events: auto;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.cancel-btn {
    background: rgba(239, 83, 80, 0.8) !important;
}

.confirm-btn {
    background: linear-gradient(135deg, #4caf50, #388e3c) !important;
}

.buy-btn {
    background: linear-gradient(135deg, #ffd700, #ff8800);
    color: #000;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    pointer-events: auto;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    white-space: nowrap;
    min-width: 80px;
}

.buy-btn:active {
    transform: scale(0.95);
}

/* Таблица лидеров */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 769px) {
    .modal {
        align-items: center;
    }

    .modal-content {
        border-radius: 24px;
        height: 80%;
    }
}