.ritmo-ambient{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0;opacity:.6;contain:strict;--glow:#91c9a5;--speed:16s;background:radial-gradient(ellipse at 20% 40%,#dfecddaa,transparent 65%)}
.app-shell,body>.shell{position:relative;z-index:1}body:has(.ritmo-ambient) .app-shell{background:transparent}.site-header{backdrop-filter:blur(18px)}
.ambient-glow{position:absolute;inset:-25%;background:radial-gradient(ellipse at 65% 35%,var(--glow),transparent 53%);opacity:.3;animation:ambient-drift var(--speed) ease-in-out infinite alternate}
.ambient-grid{position:absolute;inset:-30%;background:repeating-linear-gradient(90deg,transparent 0 130px,#2e685017 131px 133px,transparent 134px 240px),repeating-linear-gradient(0deg,transparent 0 130px,#2e685017 131px 133px,transparent 134px 240px);transform:perspective(700px) rotateX(35deg) rotate(-18deg);animation:ambient-court 24s linear infinite}
.ambient-orbit{position:absolute;width:65vmax;aspect-ratio:1;border:1px solid #4c8d6930;border-radius:50%;left:-15vmax;top:5%;animation:ambient-spin 30s linear infinite}.ambient-orbit:after{content:'';position:absolute;width:15px;height:15px;left:12%;top:12%;border-radius:50%;background:#8db64c80;box-shadow:0 0 35px #91bc70}.ambient-orbit.second{left:45%;top:20%;width:45vmax;animation-direction:reverse}
.ambient-ball{position:absolute;left:15%;top:30%;width:60px;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 30% 25%,#e5ffa3,#a6cb6c 60%,#456f43);opacity:.22;filter:blur(1px);animation:ambient-rally 14s ease-in-out infinite}
.ambient-streak{position:absolute;left:20%;top:10%;height:90%;width:14%;background:linear-gradient(90deg,transparent,#8cae6938,transparent);transform:rotate(30deg);animation:ambient-sweep 18s ease-in-out infinite}
[data-scene=lanes]{--glow:#7eb6c0;--speed:20s}[data-scene=lanes] .ambient-grid{transform:rotate(-26deg);background:repeating-linear-gradient(90deg,transparent 0 140px,#3e8c7e20 140px 143px,transparent 143px 220px)}[data-scene=lanes] .ambient-ball{display:none}
[data-scene=rally]{--glow:#a5bd65;--speed:12s}[data-scene=rally] .ambient-ball{width:90px;opacity:.28;animation-duration:8s}[data-scene=rally] .ambient-grid{opacity:.6}
[data-scene=orbits]{--glow:#e0be83;--speed:24s}[data-scene=orbits] .ambient-grid,[data-scene=orbits] .ambient-ball{display:none}[data-scene=orbits] .ambient-orbit{border-width:2px;border-color:#b9915430}[data-scene=orbits] .ambient-orbit:after{background:#b99c5970}
[data-scene=focus]{--glow:#91a9cc;--speed:10s}[data-scene=focus] .ambient-grid,[data-scene=focus] .ambient-streak{display:none}[data-scene=focus] .ambient-orbit{left:calc(50% - 30vmax);top:calc(50% - 30vmax);width:60vmax;animation:ambient-breathe 8s ease-in-out infinite}[data-scene=focus] .ambient-orbit.second{width:80vmax;left:calc(50% - 40vmax);top:calc(50% - 40vmax);animation-delay:-4s}[data-scene=focus] .ambient-ball{animation:ambient-rally 12s ease-in-out infinite;opacity:.15}
[data-scene=rise]{--glow:#90bb7b;--speed:18s}[data-scene=rise] .ambient-orbit,[data-scene=rise] .ambient-ball{display:none}[data-scene=rise] .ambient-grid{background:repeating-linear-gradient(125deg,transparent 0 150px,#4a96682b 150px 154px,transparent 154px 260px);animation:ambient-rise 16s linear infinite}
[data-scene=strength]{--glow:#73a04c;background:transparent;opacity:.45}[data-scene=strength] .ambient-grid{background:repeating-linear-gradient(110deg,transparent 0 180px,#cbff7220 180px 183px,transparent 183px 320px)}[data-scene=strength] .ambient-ball{display:none}[data-scene=strength] .ambient-orbit{border-color:#bbef5625}.ritmo-ambient.is-training{opacity:.14}
[data-scene=calm] .ambient-ball,[data-scene=calm] .ambient-grid,[data-scene=calm] .ambient-streak{display:none}.ritmo-ambient.is-still *{animation-play-state:paused!important}
.ambient-toggle{position:fixed;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:35;border:1px solid #bbcebf;background:#f5f8f0ed;color:#284936;border-radius:22px;padding:9px 12px;font-size:11px;box-shadow:0 4px 20px #1233230b;cursor:pointer}.is-training .ambient-toggle{display:none}body:has(dialog[open]) .ambient-toggle{display:none}
@keyframes ambient-drift{from{transform:translate(-3%,-4%) scale(.95)}to{transform:translate(6%,7%) scale(1.1)}}@keyframes ambient-court{to{translate:120px 100px}}@keyframes ambient-spin{to{rotate:360deg}}@keyframes ambient-rally{0%,100%{transform:translate(0,0) scale(.7)}35%{transform:translate(62vw,24vh) scale(1.3)}70%{transform:translate(12vw,52vh) scale(.9)}}@keyframes ambient-sweep{0%,100%{translate:-20vw 0;opacity:0}50%{translate:55vw 0;opacity:.55}}@keyframes ambient-breathe{0%,100%{scale:.86;opacity:.35}50%{scale:1.08;opacity:.8}}@keyframes ambient-rise{to{translate:0 -180px}}
@media(max-width:600px){.ambient-toggle{bottom:calc(80px + env(safe-area-inset-bottom))}.ritmo-ambient{opacity:.45}.ambient-ball{width:40px}}@media(prefers-reduced-motion:reduce){.ritmo-ambient *{animation:none!important}.ambient-toggle{display:none}}

.fs-live .fs-glow{animation:ambient-drift 18s ease-in-out infinite alternate}.fs-live .fs-ball{animation:ambient-spin 36s linear infinite}.ambient-paused .fs-live *{animation-play-state:paused!important}@media(prefers-reduced-motion:reduce){.fs-live *{animation:none!important}}
