/* Tip modal — used on Live (and anywhere @include tip-modal) */
.tip-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.tip-modal[hidden] {
    display: none !important;
}

.tip-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 6, 4, 0.72);
    backdrop-filter: blur(4px);
}

.tip-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: min(90vh, 560px);
    overflow: auto;
    padding: 1.35rem 1.5rem 1.5rem;
    border-radius: 14px;
    border: 1px solid rgba(201, 146, 42, 0.35);
    background: linear-gradient(165deg, rgba(28, 18, 10, 0.98), rgba(14, 10, 6, 0.99));
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

.tip-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    color: rgba(232, 216, 188, 0.65);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

.tip-modal-close:hover {
    color: #f5d070;
}

.tip-modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: #f5d070;
    margin: 0 1.75rem 0.85rem 0;
}

.tip-modal-body {
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(232, 216, 188, 0.92);
}

.tip-modal-body p {
    margin: 0 0 0.85rem;
}

.tip-modal-balance {
    font-size: 1.25rem;
    color: #e8d8bc;
    margin: 0.35rem 0 0.75rem;
}

.tip-modal-balance strong {
    color: #86efac;
}

.tip-modal-panel[hidden] {
    display: none !important;
}

.tip-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.tip-modal-actions a,
.tip-modal-actions button {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(201, 146, 42, 0.45);
    background: rgba(201, 146, 42, 0.12);
    color: #f5d070;
}

.tip-modal-actions a:hover,
.tip-modal-actions button:hover:not(:disabled) {
    background: rgba(201, 146, 42, 0.22);
}

.tip-modal-actions button.tip-modal-primary {
    background: linear-gradient(180deg, rgba(201, 146, 42, 0.35), rgba(122, 85, 32, 0.5));
    border-color: rgba(245, 208, 112, 0.45);
    color: #fff8e8;
}

.tip-modal-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tip-modal-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(201, 146, 42, 0.85);
    margin-bottom: 0.35rem;
}

.tip-modal-input {
    width: 100%;
    max-width: 12rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(122, 85, 32, 0.5);
    background: rgba(0, 0, 0, 0.35);
    color: #e8d8bc;
    font-size: 1.1rem;
    font-family: 'EB Garamond', serif;
}

.tip-modal-err {
    margin: 0.75rem 0 0;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
    font-size: 0.95rem;
}

.tip-modal-err[hidden] {
    display: none !important;
}

.tip-modal-hint {
    margin: 0.65rem 0 0;
    font-size: 0.92rem;
    color: rgba(208, 185, 140, 0.65);
}

.tip-modal-success {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.tip-modal-success-icon {
    font-size: 2.75rem;
    line-height: 1;
    color: #f5d070;
    text-shadow: 0 0 24px rgba(245, 208, 112, 0.55);
    margin-bottom: 0.65rem;
    animation: tip-success-glow 1.2s ease-out 1;
}

.tip-modal-success-text {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: #e8d8bc;
    margin: 0;
    line-height: 1.5;
}

.tip-modal-success--animate .tip-modal-success-icon {
    animation: tip-success-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 1;
}

.tip-modal-success--animate .tip-modal-success-text {
    animation: tip-success-fade 0.5s ease-out 0.15s both;
}

@keyframes tip-success-pop {
    0% {
        transform: scale(0.25);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes tip-success-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tip-success-glow {
    0%,
    100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.25);
    }
}
