html,body{height:100%;overflow:hidden}body{display:grid;place-items:center}.world{width:min(100vw,70.71svh);height:auto;max-height:100svh;aspect-ratio:1334/1888}.entry .label{animation:none}.layer-serpent{animation:serpent-levitate 6s ease-in-out infinite!important;transform-origin:45% 40%}.layer-mouche{animation:fly-levitate 4.8s ease-in-out infinite!important;transform-origin:76% 69%}.scene-layer{will-change:transform}.entrance-ghost{display:none}.welcome{width:min(350px,calc(100vw - 28px))}.home-player{position:fixed;left:18px;bottom:18px;width:min(350px,calc(100vw - 36px));z-index:25;background:#fffffff0;border:1px solid #111;border-radius:12px;overflow:hidden}.home-player summary{padding:10px 14px;cursor:pointer;color:#111;font:19px 'PicNic',sans-serif;text-transform:none}.home-player iframe{display:block;width:100%;height:270px;border:0}.email-hook{margin:0;padding:10px 14px;color:#111;border-top:1px solid #ddd;font:17px 'PicNic',sans-serif;text-transform:none}body:has(.view:not([hidden])) .home-player{display:none}@keyframes serpent-levitate{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-9px) rotate(-.35deg)}}@keyframes fly-levitate{0%,100%{transform:translateY(0) rotate(-.3deg)}50%{transform:translateY(-12px) rotate(.4deg)}}@media(max-width:700px){.welcome{top:12px;left:14px;width:290px}.welcome-card{padding:17px 23px;min-height:125px}.welcome h1{font-size:18px}.welcome p{font-size:15px}.home-player{left:14px;bottom:max(12px,env(safe-area-inset-bottom));width:calc(100vw - 28px)}.home-player iframe{height:250px}}@media(prefers-reduced-motion:reduce){.layer-serpent,.layer-mouche{animation:none!important}}

.entry[data-route="game"] .label,.entry[data-route="game"]:hover .label{animation:play-pulse 2.2s ease-in-out infinite;transform-box:fill-box;transform-origin:center}@keyframes play-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.065)}}@media(prefers-reduced-motion:reduce){.entry[data-route="game"] .label{animation:none!important}}

.scene-paused .scene-layer,.scene-paused .label{animation-play-state:paused!important}@media(max-width:700px){.scene-layer{will-change:auto}.layer-serpent,.layer-mouche{animation:none!important}.entry[data-route="game"] .label{animation-duration:3s}.world{transform:none!important}}

@media(max-width:700px){.world{background:#fff url('../assets/accueil-mobile-leger.jpg') center/100% 100% no-repeat}.world .scene-layer{display:none}.entry .label,.entry[data-route="game"] .label{animation:none!important}.entry text{paint-order:stroke fill}.world>img{display:none}}

/* Accueil plein écran, texte simple et place réservée au-dessus du dessin. */
html,body{width:100%;height:100%;height:100dvh;overflow:hidden}.world{position:fixed;inset:0;width:100%;height:100%;max-height:none;aspect-ratio:auto;background:#fff;box-shadow:none}.world .map{top:105px;bottom:0;height:calc(100% - 105px);width:100%;overflow:hidden}.welcome{position:fixed;top:max(16px,env(safe-area-inset-top));left:max(18px,env(safe-area-inset-left));width:min(390px,calc(100vw - 36px));background:#fff;pointer-events:none}.welcome .welcome-card{padding:0;min-height:0;gap:5px;display:flex;align-items:flex-start}.welcome .welcome-card::before{display:none}.welcome h1{font-size:19px;line-height:1.12}.welcome p{font-size:15px;line-height:1.15}.scene-layer{will-change:auto}
@media(max-width:700px){.world{background:#fff}.world::before{content:'';position:absolute;inset:115px 0 max(8px,env(safe-area-inset-bottom));background:url('../assets/accueil-mobile-leger.jpg') center bottom/contain no-repeat;pointer-events:none}.world .map{top:115px;bottom:max(8px,env(safe-area-inset-bottom));height:calc(100% - 115px - max(8px,env(safe-area-inset-bottom)))}.welcome{left:16px;top:max(12px,env(safe-area-inset-top));width:calc(100vw - 32px);max-width:365px}.welcome h1{font-size:18px}.welcome p{font-size:14px}.welcome .welcome-card{padding:0;min-height:0;gap:4px}}

.world .map{top:0;bottom:0;height:100%;width:100%}.welcome{background:rgba(255,255,255,.94);padding:10px 12px;left:8px;top:max(8px,env(safe-area-inset-top));width:min(390px,calc(100vw - 16px))}.welcome .play-cta{pointer-events:auto;align-self:flex-start;border:2px solid #111;background:#111;color:#fff;font:20px/1.1 'PicNic',sans-serif;padding:11px 16px;margin-top:8px;cursor:pointer;text-transform:none;min-height:44px}.play-cta:hover{background:#f5e500;color:#111}.play-cta:focus-visible{outline:3px solid #111;outline-offset:4px}@media(max-width:700px){.world::before{inset:0;background-size:cover;background-position:center bottom}.world .map{top:0;bottom:0;height:100%}.welcome{left:8px;top:max(8px,env(safe-area-inset-top));width:calc(100vw - 16px);max-width:365px}.welcome .play-cta{font-size:18px;padding:10px 14px}}

/* Les illustrations signalent elles-mêmes les passages. */
.entry .label{display:none!important}.layer-serpent,.layer-cloture,.layer-mouche{animation:portal-glitch 7s linear infinite!important}.layer-cloture{animation-delay:-2.3s!important}.layer-mouche{animation-delay:-4.6s!important}
@keyframes portal-glitch{0%,89%,92%,95%,100%{transform:translate(0,0)}90%{transform:translate(5px,-2px)}91%{transform:translate(-4px,1px)}93%{transform:translate(3px,0)}94%{transform:translate(-2px,-1px)}}
.portal-glitch-patch{display:none;position:absolute;inset:0;pointer-events:none;background:url('../assets/accueil-mobile-leger.jpg') center bottom/cover no-repeat;animation:portal-glitch 7s linear infinite;will-change:transform}
@media(max-width:700px){.portal-glitch-patch{display:block}.portal-glitch-serpent{clip-path:polygon(3% 30%,45% 23%,75% 15%,76% 43%,47% 56%,4% 64%)}.portal-glitch-cloture{clip-path:polygon(2% 45%,45% 45%,46% 86%,2% 89%);animation-delay:-2.3s}.portal-glitch-mouche{clip-path:polygon(50% 40%,100% 40%,100% 88%,53% 88%);animation-delay:-4.6s}}
.scene-paused .portal-glitch-patch{animation-play-state:paused}@media(prefers-reduced-motion:reduce){.layer-serpent,.layer-cloture,.layer-mouche,.portal-glitch-patch{animation:none!important}}

@media(max-width:700px){.world .layer-serpent,.world .layer-cloture,.world .layer-mouche{display:block;will-change:auto}.portal-glitch-patch{display:none}}

/* Même cadrage proportionnel pour les dessins et les zones interactives. */
.world .map{inset:0;width:100%;height:100%;overflow:visible}.welcome{max-width:min(350px,calc(100vw - 16px))}@media(max-width:700px){.world::before{inset:0;background-size:contain;background-position:center center}.world .map{inset:0;height:100%;width:100%}.welcome h1{font-size:clamp(16px,4.2vw,18px)}.welcome p{font-size:14px}.welcome .play-cta{font-size:17px;padding:9px 12px}}@media(max-height:500px) and (orientation:landscape){.welcome{width:230px}.welcome h1{font-size:16px}.welcome p{font-size:13px}.welcome .play-cta{font-size:16px;padding:8px 10px}}

.welcome{display:none!important}

.ep-ghost{position:fixed;top:max(20px,env(safe-area-inset-top));left:max(20px,env(safe-area-inset-left));z-index:50;border:0;padding:8px;background:transparent;cursor:pointer;width:76px;animation:ep-float 4s ease-in-out infinite}.ep-ghost span{display:block;animation:ep-glitch 8s linear infinite}.ep-ghost img{display:block;width:100%;height:auto}.ep-ghost:focus-visible{outline:2px dashed #111;outline-offset:4px}.ep-popup{position:fixed;border:2px solid #111;background:white;color:#111;padding:40px 26px 30px;width:min(400px,calc(100vw - 36px));text-align:center;text-transform:none}.ep-popup::backdrop{background:#ffffffa8}.ep-popup h2{font:40px/1.1 'PicNic',sans-serif;margin:0 0 14px}.ep-popup p{font:23px/1.3 'PicNic',sans-serif;margin:0 0 24px}.ep-popup a{display:block;background:#111;color:white;text-decoration:none;padding:15px;font:20px/1.3 'PicNic',sans-serif}.ep-close{position:absolute;right:5px;top:3px;background:none;border:0;font:30px Arial,sans-serif;color:#111;cursor:pointer;width:40px;height:40px}body:has(.view:not([hidden])) .ep-ghost{display:none}@keyframes ep-float{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-8px) rotate(2deg)}}@keyframes ep-glitch{0%,90%,94%,100%{transform:translateX(0)}91%{transform:translateX(4px) skewX(5deg)}92%{transform:translateX(-3px)}93%{transform:translateX(2px) skewX(-4deg)}}@media(max-width:700px){.ep-ghost{width:62px;top:max(16px,env(safe-area-inset-top));left:14px}}@media(prefers-reduced-motion:reduce){.ep-ghost,.ep-ghost span{animation:none}}

.ep-ghost{left:clamp(36px,6vw,90px);top:clamp(45px,10svh,110px);width:clamp(80px,8vw,104px)}.ep-ghost span{animation:portal-glitch 7s linear infinite}.ep-ghost img{max-height:170px;object-fit:contain}@media(max-width:700px){.ep-ghost{left:30px;top:max(50px,8svh);width:80px}}

/* Appel visuel au repos : impulsions plus franches et décalées. */
.layer-serpent,.layer-cloture,.layer-mouche{animation-name:portal-idle-glitch!important;animation-duration:5.8s!important;animation-timing-function:steps(1,end)!important}
.layer-cloture{animation-delay:-1.9s!important}.layer-mouche{animation-delay:-3.8s!important}
.ep-ghost span{animation:portal-idle-glitch 5.8s steps(1,end) infinite;animation-delay:-.8s}
@keyframes portal-idle-glitch{
0%,83%,94%,100%{transform:translate(0,0) skewX(0);opacity:1}
84%{transform:translate(9px,-3px) skewX(2deg)}
85%{transform:translate(-8px,2px) skewX(-2deg)}
86%{transform:translate(5px,0);opacity:.65}
87%{transform:translate(-4px,-2px);opacity:1}
88%{transform:translate(0,0)}
91%{transform:translate(7px,1px) skewX(-1deg)}
92%{transform:translate(-5px,-1px)}
93%{transform:translate(2px,0)}
}
@media(prefers-reduced-motion:reduce){.layer-serpent,.layer-cloture,.layer-mouche,.ep-ghost span{animation:none!important}}

.layer-serpent,.layer-cloture,.layer-mouche{animation-timing-function:ease-in-out!important}.ep-ghost span{animation-timing-function:ease-in-out}
@keyframes portal-idle-glitch{
0%,80%,96%,100%{transform:translate(0,0) skewX(0);opacity:1}
84%{transform:translate(4px,-1px) skewX(.6deg);opacity:1}
87%{transform:translate(-3px,1px) skewX(-.5deg);opacity:.9}
90%{transform:translate(2px,0) skewX(.3deg);opacity:1}
93%{transform:translate(-1px,0) skewX(0);opacity:1}
}
