/* A warm, quiet bath scene that gathers into a gentle beat with the song. */
.rave-scene-overlay {
    position: absolute;
    z-index: 6;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    isolation: isolate;
}
.rave-scene-overlay::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: radial-gradient(ellipse at 50% 52%, rgba(242, 221, 165, .24), rgba(206, 231, 201, .12) 42%, transparent 74%);
}

.capy-container.is-rave-active > .capy-wrapper {
    height: calc(100% - 24px);
    align-self: flex-end;
}
.capy-container.is-rave-active > .mud-puddle { opacity: 0; }
.capy-container.is-rave-active .capy-img {
    transform-origin: 50% 90%;
    animation: rave-capy-drift 5.2s ease-in-out infinite;
}
.capy-container.is-rave-active:has(.rave-scene-overlay[data-phase="drop"]) .capy-img,
.capy-container.is-rave-active:has(.rave-scene-overlay[data-phase="climax"]) .capy-img {
    animation-name: rave-capy-groove;
    animation-duration: 2.35s;
}

.rave-water-rings {
    position: absolute;
    z-index: 1;
    top: 64%;
    right: -10%;
    bottom: -30%;
    left: -10%;
    overflow: hidden;
    border-top: 1px solid rgba(235, 250, 220, .88);
    border-radius: 50% 50% 0 0 / 9% 9% 0 0;
    background:
        radial-gradient(ellipse at 23% 9%, transparent 0 18%, rgba(222, 246, 220, .23) 19% 20%, transparent 22%),
        radial-gradient(ellipse at 79% 13%, transparent 0 20%, rgba(222, 246, 220, .2) 21% 22%, transparent 24%),
        linear-gradient(180deg, rgba(119, 166, 143, .74), rgba(76, 126, 111, .84));
    box-shadow: inset 0 2px 0 rgba(245, 255, 228, .34);
    transform-origin: 50% 0;
    animation: rave-water-drift 7s ease-in-out infinite alternate;
}
.rave-water-rings::before,
.rave-water-rings::after {
    content: "";
    position: absolute;
    height: 8px;
    border-top: 1px solid rgba(233, 249, 221, .47);
    border-radius: 50%;
}
.rave-water-rings::before { top: 12px; left: 12%; width: 76%; }
.rave-water-rings::after { top: 27px; left: 34%; width: 32%; opacity: .72; }
.rave-scene-overlay.drop-vibration .rave-water-rings {
    animation: rave-water-drift 7s ease-in-out infinite alternate, rave-water-beat 1.875s ease-in-out infinite;
}

.rave-lyrics-overlay {
    position: absolute;
    z-index: 8;
    top: 5px;
    left: 50%;
    width: min(94%, 405px);
    padding: 5px 10px;
    border: 1px solid rgba(255, 250, 225, .88);
    border-radius: 12px;
    background: rgba(42, 65, 54, .88);
    color: #fffdf1;
    font: 800 clamp(.68rem, 2.25vw, .8rem)/1.18 system-ui, sans-serif;
    letter-spacing: .015em;
    text-align: center;
    text-wrap: balance;
    text-shadow: 0 1px 2px rgba(24, 43, 35, .88);
    transform: translateX(-50%);
    transition: color .45s ease, background-color .45s ease, text-shadow .45s ease;
}
.rave-scene-overlay[data-phase="float"] .rave-lyrics-overlay {
    color: #f5fff0;
    background: rgba(47, 78, 69, .83);
    animation: rave-lyric-drift 6s ease-in-out infinite alternate;
}
.rave-scene-overlay[data-phase="drop"] .rave-lyrics-overlay,
.rave-scene-overlay[data-phase="climax"] .rave-lyrics-overlay {
    color: #fff9df;
    background: rgba(58, 70, 55, .91);
    text-shadow: 0 0 5px rgba(250, 210, 112, .6), 0 1px 2px rgba(24, 43, 35, .88);
    animation: rave-lyric-glow 4.5s ease-in-out infinite alternate;
}

.rave-yuzu,
.rave-steam,
.rave-guest {
    position: absolute;
    pointer-events: none;
}
.rave-yuzu {
    z-index: 5;
    top: calc(64% - 25px);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    transform-origin: 50% 65%;
    filter: drop-shadow(0 2px 2px rgba(48, 66, 48, .28));
    animation: rave-yuzu-float 4.6s ease-in-out infinite;
}
.rave-yuzu--left { left: calc(50% - 142px); }
.rave-yuzu--right { right: calc(50% - 142px); animation-delay: -2.3s; }
.rave-yuzu svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rave-yuzu-fruit { fill: #e7ae51; stroke: #8d6136; stroke-width: 1.5; stroke-linejoin: round; }
.rave-yuzu-leaf { fill: #63845c; stroke: #405f45; stroke-width: 1.3; stroke-linejoin: round; }
.rave-yuzu-highlight { fill: none; stroke: rgba(255, 239, 185, .9); stroke-width: 1.8; stroke-linecap: round; }
.rave-yuzu-dimple { fill: #ad7539; }
.rave-yuzu::after {
    content: "";
    position: absolute;
    z-index: -1;
    bottom: 0;
    left: 50%;
    width: 42px;
    height: 8px;
    border: 1px solid rgba(238, 250, 221, .88);
    border-top-color: rgba(247, 255, 232, .96);
    border-radius: 50%;
    background: rgba(165, 207, 174, .2);
    box-shadow: 0 1px 2px rgba(47, 88, 72, .15);
    transform: translateX(-50%);
}
.rave-scene-overlay.drop-vibration .rave-yuzu { animation-name: rave-yuzu-groove; animation-duration: 2.35s; }

.rave-steam {
    z-index: 3;
    top: 43%;
    width: 12px;
    height: 28px;
    border-left: 2px solid rgba(255, 250, 225, .76);
    border-radius: 50%;
    opacity: .58;
    filter: drop-shadow(0 0 3px rgba(245, 246, 202, .48));
    animation: rave-steam-rise 4.8s ease-in-out infinite;
}
.rave-steam-one { left: 35%; transform: rotate(17deg); }
.rave-steam-two { right: 35%; transform: rotate(-17deg); animation-delay: -2.4s; }

.rave-guest {
    z-index: 4;
    bottom: 20%;
    display: block;
    width: clamp(40px, 6.5vw, 62px);
    height: clamp(38px, 6vw, 56px);
    opacity: 0;
    transform: translateY(5px) scale(.96);
    transition: opacity .5s ease, transform .5s ease;
    filter: drop-shadow(0 2px 2px rgba(52, 66, 47, .3));
}
.rave-guest img { display:block; width:100%; height:100%; object-fit:contain; }
.rave-guest--duckling { left: 11%; }
.rave-guest--turtle { right: 11%; }
.rave-guest::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -2px;
    left: -5px;
    height: 7px;
    border-bottom: 1px solid rgba(235, 250, 224, .72);
    border-radius: 50%;
    box-shadow: 0 2px 2px rgba(57, 89, 72, .18);
}
.rave-scene-overlay[data-phase="arrival"] .rave-guest,
.rave-scene-overlay[data-phase="build"] .rave-guest,
.rave-scene-overlay[data-phase="drop"] .rave-guest,
.rave-scene-overlay[data-phase="float"] .rave-guest,
.rave-scene-overlay[data-phase="build-again"] .rave-guest,
.rave-scene-overlay[data-phase="climax"] .rave-guest {
    opacity: .98;
    transform: translateY(0) scale(1);
}
.rave-scene-overlay[data-phase="float"] .rave-guest { animation: rave-guest-float 4.6s ease-in-out infinite alternate; }

.rave-scene-overlay.is-audio-paused .rave-water-rings,
.rave-scene-overlay.is-audio-paused .rave-yuzu,
.rave-scene-overlay.is-audio-paused .rave-steam,
.rave-scene-overlay.is-audio-paused .rave-guest,
.rave-scene-overlay.is-audio-paused .rave-lyrics-overlay {
    animation-play-state: paused;
    transition: none;
}
.capy-container.is-rave-active:has(.rave-scene-overlay.is-audio-paused) > .capy-wrapper,
.capy-container.is-rave-active:has(.rave-scene-overlay.is-audio-paused) .capy-img {
    animation-play-state: paused;
}

.rave-prep-panel { margin-top: 8px; padding: 9px 10px; border: 1px solid #e2d6a8; border-radius: 12px; background: #fff9e7; color: #66583a; text-align: left; }
.rave-prep-panel strong { display: block; margin-bottom: 3px; color: #765626; font-size: .78rem; }
.rave-prep-panel p { margin: 0 0 6px; font-size: .67rem; line-height: 1.4; }
.rave-prep-panel .help-button { min-height: 32px; margin: 2px 4px 2px 0; padding: 5px 9px; font-size: .68rem; }
.rave-prep-panel .rave-event-status { margin: 4px 0 0; color: #52736b; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@keyframes rave-water-drift { from { translate: -1% 0; } to { translate: 1% 0; } }
@keyframes rave-water-beat { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.015); } }
@keyframes rave-capy-drift {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-1.5px) rotate(.25deg); }
}
@keyframes rave-capy-groove {
    0%, 100% { transform: translateY(0) rotate(0) scale(1); }
    24% { transform: translateY(-2px) rotate(-.75deg) scale(1.012, .995); }
    52% { transform: translateY(0) rotate(.2deg) scale(1); }
    76% { transform: translateY(-1.5px) rotate(.75deg) scale(.995, 1.008); }
}
@keyframes rave-yuzu-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-1px) rotate(2deg); }
}
@keyframes rave-yuzu-groove {
    0%, 100% { transform: translateY(0) rotate(-2deg) scale(1); }
    50% { transform: translateY(-2px) rotate(2deg) scale(1.025); }
}
@keyframes rave-steam-rise { 0%,100% { translate: 0 3px; opacity: .38; } 50% { translate: 0 -4px; opacity: .68; } }
@keyframes rave-lyric-drift { from { transform: translateX(-50%) translateY(-1px); } to { transform: translateX(-50%) translateY(1px); } }
@keyframes rave-lyric-glow {
    from { text-shadow: 0 0 4px rgba(240, 199, 106, .34), 0 1px 2px rgba(24, 43, 35, .88); }
    to { text-shadow: 0 0 7px rgba(240, 199, 106, .65), 0 1px 2px rgba(24, 43, 35, .88); }
}
@keyframes rave-guest-float { from { transform: translateY(0); } to { transform: translateY(-2px); } }

@media (max-width: 520px) {
    .rave-lyrics-overlay { top: 4px; width: calc(100% - 12px); padding: 5px 8px; font-size: clamp(.66rem, 3vw, .75rem); }
    .rave-water-rings { top: 66%; }
    .rave-yuzu { top: calc(66% - 25px); width: 29px; height: 29px; }
    .rave-yuzu--left { left: 6%; }
    .rave-yuzu--right { right: 6%; }
    .rave-guest { bottom: 19%; width: clamp(36px, 10vw, 48px); height: clamp(34px, 9vw, 44px); }
    .rave-guest--duckling { left: 6%; }
    .rave-guest--turtle { right: 6%; }
    .rave-steam-one { left: 30%; }
    .rave-steam-two { right: 30%; }
}
@media (max-width: 360px) {
    .rave-lyrics-overlay { width: calc(100% - 8px); padding: 4px 6px; font-size: .64rem; letter-spacing: .005em; }
    .rave-water-rings { top: 67%; }
    .rave-yuzu { top: calc(67% - 24px); width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
    .rave-scene-overlay *, .rave-scene-overlay::before,
    .rave-scene-overlay *::before, .rave-scene-overlay *::after,
    .capy-container.is-rave-active .capy-img,
    .capy-container.is-rave-active > .capy-wrapper {
        animation: none !important;
        transition: none !important;
    }
    .rave-water-rings, .rave-water-rings::before, .rave-water-rings::after { translate: 0 0; transform: none; }
    .rave-lyrics-overlay { transform: translateX(-50%); }
    .rave-yuzu { transform: none; }
}
