/* Hadal Bloom (Abyss, felt_hadal_bloom): black-blue woven water, a rim of living light, and the `biolume` win.
   Drawn by static/js/abyss_felt.js from static/js/abyss_art.js. Load after felt_fx.css.
   Comfort: calm motion holds the still print (no drift, no breathing; the win is one soft wash with no travelling ring);
   reduce flashing caps every lit layer at a third; low graphics drops the far snow field and the breathing. The win fits
   FeltLook.moment's 2.4 s window. */

/* The weave: fine dark threads crossed by a faint cyan ripple, like water seen through cloth. */
[data-felt-weave="bathyal"] {
    --felt-weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Cpath d='M0 3.5Q3.5 2 7 3.5T14 3.5M0 10.5Q3.5 9 7 10.5T14 10.5' fill='none' stroke='%234ff0dc' stroke-opacity='.045' stroke-width='.7'/%3E%3Cpath d='M3 0V14M10 0V14' stroke='%23000' stroke-opacity='.2' stroke-width='.8'/%3E%3C/svg%3E") 0 0 / 14px 14px,
        radial-gradient(ellipse 50% 40% at 18% 70%, rgba(20, 80, 106, .14), transparent 74%),
        radial-gradient(ellipse 40% 34% at 82% 26%, rgba(157, 134, 255, .05), transparent 72%);
}
[data-felt-light][data-felt-fx="biolum"] {
    --felt-light: radial-gradient(ellipse 44% 38% at 50% 50%, rgba(79, 240, 220, .05), transparent 72%),
        radial-gradient(ellipse 120% 105% at 50% 48%, transparent 48%, rgba(0, 2, 8, .66) 100%);
}
[data-felt-fx="biolum"] .felt-fx::after {
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(79, 240, 220, .07), inset 0 0 120px rgba(0, 2, 10, .5);
}
[data-felt-fx="biolum"] .bet-zone:not(.has-bet):not(.zone-selected):not(.zone-clickable):not(.drag-hover) {
    border-color: rgba(79, 240, 220, .38);
    box-shadow: var(--well), 0 0 12px rgba(79, 240, 220, .1);
}

/* The art: a wide drawing (like Flight Plan's), quieter on a phone, where the seal is cropped. */
.felt-art[data-art="hadal_bloom"] { inset: calc(var(--felt-art-grow, 48%) * -1) calc(var(--felt-art-grow-x, 170%) * -1); }
@media (max-width: 640px) {
    .felt-art[data-art="hadal_bloom"]:not([data-felt-surface="lounge"] *) { --felt-art-grow-x: 8%; --felt-art-opacity: .5; }
}
.felt-art[data-art="hadal_bloom"] .fa-body { opacity: var(--felt-art-opacity, .78); }
[data-felt-art="hadal_bloom"] .fa-glow { opacity: .5; }
.fa-hb-snow, .fa-hb-lure, .fa-hb-answer, .fa-hb-bloom { position: absolute; inset: 0; pointer-events: none; }
.fa-hb-snow > svg, .fa-hb-lure > svg, .fa-hb-answer > svg, .fa-hb-bloom > svg {
    position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
}
.fa-hb-snow.s1 { opacity: .55; }
.fa-hb-snow.s2 { opacity: .7; }
.fa-hb-lure { opacity: .85; }
.fa-hb-answer, .fa-hb-bloom { opacity: 0; }
.fa-hb-bloom { transform-origin: 50% 50%; }
.fa-hb-jelly { transform-box: fill-box; transform-origin: 50% 20%; }

/* Ambient: snow drifts down and across at two speeds, the jellies pulse, the lure breathes. */
[data-felt-fx="biolum"] .fa-hb-snow.s1 { animation: hbSnowFar 34s linear infinite alternate; }
[data-felt-fx="biolum"] .fa-hb-snow.s2 { animation: hbSnowNear 22s linear infinite alternate; }
[data-felt-fx="biolum"] .fa-hb-jelly { animation: hbJelly 7s ease-in-out infinite; }
[data-felt-fx="biolum"] .fa-hb-jelly.j2 { animation-duration: 8.5s; animation-delay: -3s; }
[data-felt-fx="biolum"] .fa-hb-jelly.j3 { animation-duration: 10s; animation-delay: -6s; }
[data-felt-fx="biolum"] .fa-hb-lure { animation: hbLure 5.5s ease-in-out infinite; }
@keyframes hbSnowFar { from { transform: translate(-.6%, -1.2%); } to { transform: translate(.8%, 1.6%); } }
@keyframes hbSnowNear { from { transform: translate(.8%, -2%); } to { transform: translate(-1%, 2.4%); } }
@keyframes hbJelly {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    40% { transform: translateY(-2.5%) scale(1.04, .95); }
    60% { transform: translateY(-3%) scale(.98, 1.03); }
}
@keyframes hbLure { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* The win: the wash and the ring travel out from the seal, the photophores light round it, then the angler answers. */
[data-felt-moment="biolume"] .felt-win::before {
    inset: 0;
    background: radial-gradient(ellipse 46% 42% at 50% 48%, rgba(204, 255, 247, .22), rgba(79, 240, 220, .1) 40%, rgba(157, 134, 255, .04) 62%, transparent 80%);
    transform-origin: 50% 48%;
    animation: hbWash 2.4s ease-out forwards;
}
@keyframes hbWash {
    0% { opacity: 0; transform: scale(.3); }
    30% { opacity: .8; }
    70% { opacity: .5; }
    100% { opacity: 0; transform: scale(1.15); }
}
.felt-woke [data-art="hadal_bloom"] > .fa-hb-bloom { animation: hbBloom 2.2s cubic-bezier(.2, .65, .3, 1) forwards; }
.felt-woke [data-art="hadal_bloom"] > .fa-wake { animation: hbRingLit 2.4s ease-in-out forwards; }
.felt-woke [data-art="hadal_bloom"] > .fa-hb-answer { animation: hbAnswer 1.5s ease-in-out .8s both; }
.felt-woke [data-art="hadal_bloom"] .fa-glow { animation: hbGlow 2.4s ease-out forwards; }
@keyframes hbBloom {
    0% { opacity: 0; transform: scale(.2); }
    22% { opacity: .85; }
    65% { opacity: .45; }
    100% { opacity: 0; transform: scale(1.3); }
}
@keyframes hbRingLit { 0%, 100% { opacity: 0; } 30%, 64% { opacity: .9; } }
@keyframes hbAnswer { 0%, 100% { opacity: 0; } 35%, 62% { opacity: 1; } }
@keyframes hbGlow { 0%, 100% { opacity: .5; } 35% { opacity: .9; } }

/* Reduce flashing: the same slow travel, every lit layer at a third. */
html.calm-flash [data-felt-moment="biolume"] .felt-win::before { animation-name: hbWashCalm; }
html.calm-flash .felt-woke [data-art="hadal_bloom"] > .fa-hb-bloom { animation-name: hbBloomCalm; }
html.calm-flash .felt-woke [data-art="hadal_bloom"] > .fa-wake { animation-name: hbRingCalm; }
html.calm-flash .felt-woke [data-art="hadal_bloom"] > .fa-hb-answer { animation-name: hbAnswerCalm; }
html.calm-flash .felt-woke [data-art="hadal_bloom"] .fa-glow { animation: none; }
html.calm-flash [data-felt-fx="biolum"] .fa-hb-lure { animation: none; opacity: .75; }
@keyframes hbWashCalm { 0% { opacity: 0; transform: scale(.6); } 35%, 65% { opacity: .32; } 100% { opacity: 0; transform: scale(1.05); } }
@keyframes hbBloomCalm { 0% { opacity: 0; transform: scale(.5); } 35%, 65% { opacity: .3; } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes hbRingCalm { 0%, 100% { opacity: 0; } 30%, 65% { opacity: .34; } }
@keyframes hbAnswerCalm { 0%, 100% { opacity: 0; } 35%, 65% { opacity: .4; } }

/* Calm motion is the still print; the win is the ring of lights coming up and going down, nothing moves. */
html.calm-motion .fa-hb-snow, html.calm-motion .fa-hb-jelly, html.calm-motion .fa-hb-lure { animation: none !important; }
html.calm-motion .fa-hb-bloom { display: none; }
html.calm-motion [data-felt-moment="biolume"] .felt-win::before { animation-name: hbWashCalm; transform: none; }
/* Low graphics: one still snow field, nothing breathing; the one-shot win still plays. */
html.gfx-low .fa-hb-snow, html.gfx-low .fa-hb-jelly, html.gfx-low .fa-hb-lure { animation: none !important; }
html.gfx-low .fa-hb-snow.s1 { display: none; }
