.contact-game{max-width:820px;margin:0 auto 70px}.contact-routing{border-left:3px solid #9bad9f;padding:0 0 0 20px;margin-bottom:34px}.contact-routing h2{font-size:18px;margin-top:0}.contact-routing a{font-weight:600}.world-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:32px 0 12px}.world-bar>span{font-size:14px;color:#52645a}.world-choices{display:flex;gap:4px}.world-choices button{font:inherit;font-size:12px;padding:7px 10px;border:1px solid transparent;background:transparent;color:#52645a;cursor:pointer;border-radius:4px}.world-choices button[aria-pressed=true]{border-color:#b3c2b6;background:#edf1ea;color:#163d30}.world{position:relative;isolation:isolate;aspect-ratio:9/4;background:#29392e;overflow:hidden;border:5px solid #36483b;box-shadow:0 5px 0 #d9dfd3;--row:0%}.world-frame{position:absolute;inset:0;background-image:url('/portfolio/assets/contact-worlds.png');background-size:200% 300%;background-repeat:no-repeat;image-rendering:pixelated;pointer-events:none}.world-before{background-position:0% var(--row)}.world-after{background-position:100% var(--row);opacity:0;transition:opacity 1s steps(8,end)}.world.revealed .world-after{opacity:1}.world button{position:absolute;border:0;padding:0;background:transparent;cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}.world-item{z-index:3;width:9%;height:23%;min-width:40px;min-height:40px;transform:translate(-50%,-50%);filter:drop-shadow(2px 3px 0 #1a241b80);animation:item-breathe 2.4s steps(2,end) infinite}.world-item svg{width:100%;height:100%;image-rendering:pixelated;overflow:visible}.world-item.selected{filter:drop-shadow(0 0 5px #ffe3a3)}.world-item.dragging{animation:none;cursor:grabbing}.world-target{z-index:2;transform:translate(-50%,-50%);min-width:44px;min-height:44px}.world.selecting .world-target{outline:2px dashed #f7e7b5;outline-offset:2px}.world button:focus-visible{outline:3px solid #fff1b1;outline-offset:2px}.world-entrance{z-index:4;transform:translate(-50%,-50%);box-shadow:inset 0 0 14px #ffd78740}.world-entrance:hover{background:#ffe6a31a}.world [hidden],.contact-controls [hidden]{display:none!important}.contact-status{min-height:3em;line-height:1.8;font-size:14px;margin:20px 0 8px}.contact-controls{display:flex;gap:10px;flex-wrap:wrap}.contact-controls button{font:inherit;font-size:13px;cursor:pointer;border:1px solid #b6c4b9;background:transparent;color:#165e57;padding:9px 14px;border-radius:4px;min-height:44px}.contact-controls #contact-open{background:#165e57;color:#fff}.contact-controls button:disabled{opacity:.5;cursor:wait}.contact-game details{margin-top:22px;font-size:13px}.contact-game summary{cursor:pointer}.contact-game p{overflow-wrap:anywhere}.world-fire{position:absolute;inset:0;z-index:2;pointer-events:none;display:none}.world.burning .world-fire{display:block}.world-fire i{position:absolute;width:3%;height:15%;background:#ffd166;box-shadow:4px 0 #f49b38,-4px 7px #c7532b,0 -5px #fff0ac;left:42%;top:42%;animation:flame .3s steps(2,end) infinite alternate}.world-fire i:nth-child(2){left:51%;top:54%;animation-delay:-.1s}.world-fire i:nth-child(3){left:63%;top:42%;animation-delay:-.2s}.world-fire i:nth-child(4){left:48%;top:31%;animation-delay:-.15s}.world-fire i:nth-child(5){left:59%;top:62%;animation-delay:-.05s}@keyframes flame{to{transform:translateY(-7px) scaleY(.7);opacity:.7}}@keyframes item-breathe{50%{margin-top:-3px}}@media(prefers-reduced-motion:reduce){.world-item,.world-fire i{animation:none}.world-after{transition:none}}@media(max-width:540px){.world-bar{align-items:flex-start;flex-direction:column;gap:6px}.world{border-width:3px;aspect-ratio:9/4}.world-item{min-width:36px;min-height:36px}.world-choices button{min-height:40px}}

.world[data-world="2"] .world-target:before{content:"";position:absolute;left:31%;top:8%;width:38%;height:68%;background:#25251c;box-shadow:inset 3px 2px #171a16,2px 0 #8b6339;pointer-events:none}

.world[data-world="0"] .world-item{width:7.55%;height:18.16%;min-width:0;min-height:0}

/* Hide the revealed layer immediately on Reset, before the next paint. */
.world:not(.revealed) .world-after{transition:none;visibility:hidden}
.world.revealed .world-after{visibility:visible}
.world[data-world="2"] .world-item{width:4.95%;height:22%;min-width:0;min-height:0}
.world-fire i,.world-fire i:nth-child(n){left:var(--x);top:var(--y);width:4%;height:var(--h);transform-origin:50% 100%;background:linear-gradient(to top,#fff4b1 0 25%,#ffc64c 25% 55%,#f17b2d 55% 80%,#bd4328 80%);clip-path:polygon(0 100%,0 50%,20% 50%,20% 25%,40% 25%,40% 0,60% 0,60% 35%,80% 35%,80% 60%,100% 60%,100% 100%);box-shadow:none;animation:fire-spread 1.3s steps(7,end) var(--delay) both;}
.world-fire:before{content:"";position:absolute;left:27%;top:25%;width:48%;height:65%;background:radial-gradient(ellipse,#ffad384d,transparent 70%);animation:fire-glow .22s steps(2,end) infinite alternate}
.world-fire:after{content:"";position:absolute;left:46%;top:51%;width:4px;height:4px;background:#ffdc72;box-shadow:32px -20px #ffb746,-36px 9px #ffd885,70px 2px #ffdc72,-65px -12px #ff9c36,15px 24px #fff0a4;animation:embers .7s steps(7,end) infinite}
@keyframes fire-spread{0%{opacity:0;transform:scale(.2,.15) translateY(20%)}20%{opacity:1;transform:scale(.8,.7)}40%{transform:scale(1.1,1.25)}60%{transform:scale(.85,.8)}80%{opacity:1;transform:scale(1.1,1.05)}100%{opacity:0;transform:scale(.7,.35) translateY(-25%)}}
@keyframes fire-glow{to{opacity:.45}}
@keyframes embers{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translate(8px,-65px)}}
@media(prefers-reduced-motion:reduce){.world-fire i,.world-fire:before,.world-fire:after{animation:none}}

/* The book uses a viewBox crop of the shared scene atlas. */
.world[data-world="2"] .world-item svg { overflow: hidden; }
