/* Ancient Waters */
.wishing-well {
    position: relative;
    width: 500px;
    max-width: 100%;
    margin: auto auto 70px;
    padding: 40px 0 80px;
    text-align: center;
    z-index: 2;
    cursor: pointer;
    overflow: hidden;
}

/* Prompt text — in-flow, centered naturally by parent text-align */
.well-prompt {
    position: relative;
    z-index: 3;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.8), 0 2px 4px rgba(0,0,0,0.8);
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.wishing-well:hover .well-prompt:not(.disabled) {
    transform: translateY(-5px);
}

.well-prompt.disabled {
    color: var(--text-dim);
    text-shadow: none;
    opacity: 0.7;
}

/* Ripple effect container — decorative backdrop */
.well-ripples {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 665px;
    height: 200px;
    margin-left: -332px;
    margin-top: -100px;
    border-radius: 50%;
    border: 3px solid rgba(120, 200, 255, 0.7);
    box-shadow:
        0 0 30px rgba(120, 200, 255, 0.4),
        0 0 60px rgba(100, 180, 240, 0.2);
    opacity: 0;
    transform: scale(0.012, 0.02);
    will-change: transform, opacity;
    animation: ripple-phosphor 14s ease-out infinite;
}

.ripple:nth-child(1) { animation-delay: 0s; }
.ripple:nth-child(2) { animation-delay: 2.8s; }
.ripple:nth-child(3) { animation-delay: 5.6s; }
.ripple:nth-child(4) { animation-delay: 8.4s; }
.ripple:nth-child(5) { animation-delay: 11.2s; }

@keyframes ripple-phosphor {
    0% {
        transform: scale(0.012, 0.02);
        opacity: 0;
    }
    2% {
        opacity: 0.8;
    }
    8% {
        opacity: 0.4;
    }
    26% {
        opacity: 0.12;
    }
    52% {
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Glow at ripple origin — fixed size, not affected by ripple's transform: scale */
.ripple-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 4px;
    margin-left: -4px;
    margin-top: -2px;
    border-radius: 50%;
    border: 2px solid rgba(120, 200, 255, 0.9);
    box-shadow:
        0 0 8px rgba(120, 200, 255, 0.8),
        0 0 16px rgba(100, 180, 240, 0.5),
        0 0 24px rgba(80, 160, 220, 0.3),
        inset 0 0 8px rgba(120, 200, 255, 0.4);
    opacity: 0;
    will-change: opacity;
    animation: ripple-glow-fade 14s ease-out infinite;
}

.ripple-glow:nth-child(6) { animation-delay: 0s; }
.ripple-glow:nth-child(7) { animation-delay: 2.8s; }
.ripple-glow:nth-child(8) { animation-delay: 5.6s; }
.ripple-glow:nth-child(9) { animation-delay: 8.4s; }
.ripple-glow:nth-child(10) { animation-delay: 11.2s; }

@keyframes ripple-glow-fade {
    0% { opacity: 0; }
    2% { opacity: 1; }
    5% { opacity: 0.3; }
    12% { opacity: 0; }
    100% { opacity: 0; }
}

/* Coin animation */
.coin {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    border-radius: 50%;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 10px #ffd700;
}

@keyframes coin-toss {
    0% { transform: translateY(0) rotateX(0deg) scale(1); opacity: 1; }
    50% { transform: translateY(-100px) rotateX(540deg) scale(1.2); }
    100% { transform: translateY(200px) rotateX(1080deg) scale(0.5); opacity: 0; }
}

/* Fortune text box overlay (shared by wish & whisp blessing) */
.fortune-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.fortune-overlay.visible {
    display: flex;
}

.fortune-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.fortune-box {
    position: relative;
    text-align: center;
    animation: fortune-appear 0.4s ease-out;
    max-width: 90vw;
    z-index: 1;
}

@keyframes fortune-appear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.fortune-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}

.fortune-close:hover,
.fortune-close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* Wish result (inside fortune box) */

.wish-text {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #87ceeb;
    text-shadow: 0 0 20px rgba(135, 206, 235, 0.8), 0 2px 4px rgba(0,0,0,0.8);
    line-height: 1.6;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

/* Golden laurels for subscribed wish result */
.wish-result-laureled {
    position: relative;
    display: inline-block;
}

.wish-laurel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)) drop-shadow(0 0 10px rgba(201, 162, 39, 0.6));
    animation: laurel-shimmer 3s ease-in-out infinite alternate;
    pointer-events: none;
}

.wish-laurel-left {
    right: 100%;
    margin-right: 10px;
}

.wish-laurel-right {
    left: 100%;
    margin-left: 10px;
}

@keyframes laurel-shimmer {
    from {
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)) drop-shadow(0 0 8px rgba(201, 162, 39, 0.4)) brightness(0.9);
    }
    to {
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)) drop-shadow(0 0 15px rgba(201, 162, 39, 0.7)) brightness(1.1);
    }
}

.wish-text-laureled {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold-light);
    text-shadow: 0 0 20px rgba(240, 208, 96, 0.8), 0 0 40px rgba(201, 162, 39, 0.4), 0 2px 4px rgba(0,0,0,0.8);
    line-height: 1.6;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

/* Subscriber wishing well shimmer */
.wishing-well.subscribed-well .well-shimmer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.well-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold-light);
    pointer-events: none;
    opacity: 0;
    animation: well-sparkle-rise 3s ease-out infinite;
}

@keyframes well-sparkle-rise {
    0% { transform: translateY(0) scale(0); opacity: 0; }
    15% { opacity: 0.9; transform: translateY(-5px) scale(1); }
    50% { opacity: 0.6; }
    100% { transform: translateY(-60px) scale(0.3); opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
    .wish-text,
    .wish-text-laureled {
        font-size: 1.1rem;
        max-width: 85vw;
    }

    .wish-laurel {
        width: 48px;
        height: 48px;
    }
}
