/* Spellbound Relics v1.0.4: world-space atmosphere and meaningful spell lighting.
   All four scene treatments are attached to the camera plane. They cannot drift
   away from the river, garden, bridge, lake, or gate as the background pans.
   Resting animation is intentionally minimal to avoid competing with grammar. */
.scene-backdrop .world-plane .world-backdrop {
  filter:brightness(.95) saturate(1.035) contrast(1.03)!important;
}
.world-ambient {
  position:absolute;top:0;bottom:0;width:25%;pointer-events:none;z-index:1;
  opacity:.9;overflow:hidden;
}
.world-ambient-river{left:0}
.world-ambient-garden{left:25%}
.world-ambient-lake{left:50%}
.world-ambient-gate{left:75%}
/* Soft local atmosphere, not a single uniform overlay over the characters. */
.world-ambient::before,.world-ambient::after {content:'';position:absolute;inset:0;pointer-events:none;}
.world-ambient-river::before{background:linear-gradient(180deg,#071b3b25 0%,transparent 52%,#12455f12 100%)}
.world-ambient-garden::before{background:radial-gradient(ellipse at 51% 65%,#ffaece25,transparent 58%)}
.world-ambient-lake::before{background:radial-gradient(ellipse at 67% 26%,#b4deff2a,transparent 55%)}
.world-ambient-gate::before{background:linear-gradient(90deg,transparent,#08162b26 70%,#09152935)}
.world-water-shine,.world-lake-shine,.world-flower-stars,.world-gate-radiance,.world-river-haze {
 position:absolute;pointer-events:none;z-index:2;transition:opacity .65s ease;
}
.world-water-shine{
 left:1%;top:62%;width:24%;height:33%;opacity:.13;
 background:repeating-linear-gradient(175deg,transparent 0 17px,#9edbe145 19px,transparent 21px 33px);
 clip-path:polygon(1% 38%,40% 12%,100% 28%,98% 100%,0% 100%);
 mix-blend-mode:screen;filter:blur(1.5px);
}
.world-river-haze{
 left:2%;top:50%;width:21%;height:37%;opacity:.16;
 background:radial-gradient(ellipse at 38% 75%,#c6edff50,transparent 73%);
}
.world-lake-shine{
 left:51.5%;top:65%;width:23%;height:31%;opacity:.09;
 background:repeating-linear-gradient(173deg,transparent 0 17px,#cae5ff71 19px,transparent 22px 34px);
 clip-path:polygon(10% 20%,80% 4%,100% 100%,0% 100%);
 mix-blend-mode:screen;filter:blur(1px);
}
.world-flower-stars{
 left:28%;top:28%;width:20%;height:58%;opacity:0;
 background-image:
 radial-gradient(circle at 13% 68%,#fff2c5 0 3px,transparent 5px),
 radial-gradient(circle at 32% 56%,#ffe8fd 0 4px,transparent 7px),
 radial-gradient(circle at 49% 72%,#ffefb8 0 4px,transparent 6px),
 radial-gradient(circle at 74% 49%,#ffdbfa 0 3px,transparent 7px),
 radial-gradient(circle at 88% 77%,#ffe6a3 0 3px,transparent 6px);
 filter:drop-shadow(0 0 7px #ffe9d6);mix-blend-mode:screen;
}
.world-gate-radiance{
 left:88.1%;top:6%;width:7.5%;height:81%;opacity:0;
 background:radial-gradient(ellipse at center,#9ddfffb3, #8675cf58 37%,transparent 71%);
 filter:blur(8px);mix-blend-mode:screen;
}
/* All illumination is subordinate to the spell state. */
.world[data-water-flowing="true"] .world-water-shine{opacity:.7;animation:v104Current var(--v104-water-speed,5.5s) linear infinite}
.world[data-water-manner="slowly"]{--v104-water-speed:10s}
.world[data-water-manner="softly"]{--v104-water-speed:5.5s}
.world[data-moon-lit="true"] .world-lake-shine{opacity:.65;animation:v104Current 7s linear infinite}
.world[data-flower-glowing="true"] .world-flower-stars{opacity:.9;animation:v104Blooms 3.5s ease-in-out infinite alternate}
.world[data-gate-open="true"] .world-gate-radiance{opacity:.72;animation:v104Gate 3.2s ease-in-out infinite alternate}
.world[data-lantern-lit="true"] .world-bridge {filter:brightness(1.09) drop-shadow(0 0 10px #ffe2a677)!important}
.world[data-bridge-ready="true"] .world-bridge {filter:brightness(1.16) drop-shadow(0 0 12px #a1f5de77)!important}
@keyframes v104Current{to{background-position:0 76px}}
@keyframes v104Blooms{to{opacity:.5;filter:drop-shadow(0 0 10px #f8e1ff)}}
@keyframes v104Gate{to{opacity:1;filter:blur(13px)}}
/* Less foliage and text competition. The spell construction panel keeps priority. */
.world>.scene-atmosphere{opacity:.18!important}
.scene-backdrop{background:#0c1c35}
.story-panel{border-color:#66758d}
.scene-topline{background:linear-gradient(100deg,#111d34,#1b2e44)}
/* No ambient drift on loading or when reduced motion is requested. Keep the final visible state. */
body.reduce-motion .world-water-shine,body.reduce-motion .world-lake-shine,
body.reduce-motion .world-flower-stars,body.reduce-motion .world-gate-radiance{
 animation:none!important;transition:none!important;
}
@media(prefers-reduced-motion:reduce){
 .world-water-shine,.world-lake-shine,.world-flower-stars,.world-gate-radiance{animation:none!important;transition:none!important}
}
/* On small screens, mobile image retains legibility and ambient overlays don't compete. */
@media(max-width:720px){
 .world-ambient,.world-water-shine,.world-lake-shine,.world-flower-stars,.world-gate-radiance,.world-river-haze{opacity:0!important}
 .scene-backdrop .mobile-scene{filter:brightness(.89) saturate(1.04)!important}
}

/* A semi-transparent walkable stone path beneath actors, following the camera. */
.scene-backdrop .world-plane .world-ground-path{
 position:absolute;inset:0;width:100%!important;height:100%!important;max-width:none!important;
 object-fit:fill!important;pointer-events:none;z-index:2;opacity:.85;
 transform:none!important;filter:none!important;
}
@media(max-width:720px){.scene-backdrop .world-plane .world-ground-path{display:none!important}}
/* Explicit-motion preference overrides earlier high-specificity travel rules. */
body.reduce-motion .world .world-plane .actor-art,
body.reduce-motion .world .world-plane .world-actor,
body.reduce-motion .world .world-plane .world-gate-leaf,
body.reduce-motion .world .world-plane .actor-prop {
 animation:none!important;transition:none!important;
}
@media(prefers-reduced-motion:reduce){
 .world .world-plane .actor-art,.world .world-plane .world-actor,
 .world .world-plane .world-gate-leaf,.world .world-plane .actor-prop{
  animation:none!important;transition:none!important;
 }
}
/* Remove the previous rectangular ground-strip treatment; keep an unobtrusive
   darker ledge under the actors rather than hiding the illustrated river. */
.world-plane .world-shore{
 border:0!important;box-shadow:none!important;opacity:.38!important;
 background:radial-gradient(ellipse at 50% 100%,#1d344ab8 0%,#244a5540 42%,transparent 79%)!important;
}
.scene-backdrop .world-plane .world-ground-path{opacity:.48!important}
