/* Phantom-style wallet modal (matches phantom-confirm.css) */

.modal-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: block;
    padding: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-hidden {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.modal-visible {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

.modal-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: calc(100% - 40px);
    max-width: 360px;
    max-height: min(90dvh, 640px);
    overflow: auto;
    background: var(--phantom-bg, #111111);
    color: var(--phantom-text, #ffffff);
    border-radius: 20px;
    padding: 24px 20px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-panel__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--phantom-subtext, #a0a0a0);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.modal-panel__close:hover {
    background: var(--phantom-btn-bg, #202020);
    color: var(--phantom-text, #ffffff);
}

.modal-panel__title {
    margin: 0 36px 8px 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.modal-panel__subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--phantom-subtext, #a0a0a0);
}

.modal-panel__error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(242, 90, 103, 0.12);
    border: 1px solid rgba(242, 90, 103, 0.35);
    color: #f25a67;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.modal-panel__list {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.modal-wallet-btn {
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 14px;
    background: var(--phantom-btn-bg, #202020);
    color: var(--phantom-text, #ffffff);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.modal-wallet-btn:hover:not(:disabled) {
    background: #2a2a2a;
}

.modal-wallet-btn:active:not(:disabled) {
    opacity: 0.92;
}

.modal-wallet-btn.wallet-btn-loading {
    cursor: not-allowed;
    opacity: 0.75;
}

.modal-wallet-btn__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex: 0 0 auto;
    object-fit: cover;
    display: block;
}

.modal-wallet-btn__name,
.modal-wallet-btn__loading {
    flex: 1;
    min-width: 0;
}

.modal-wallet-btn__loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--phantom-text, #ffffff);
}

.modal-wallet-btn__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--phantom-text, #ffffff);
    border-radius: 50%;
    animation: modal-spin 0.7s linear infinite;
}

@keyframes modal-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 400px) {
    .modal-panel {
        padding: 20px 16px 16px;
        border-radius: 16px;
    }
}
