/* Portrait rooms pan sideways (scene.js toggles .pan-on): soft dark edges where more room lies, a thin position bar,
   a one-time "drag to look" hint. Nothing here shows on desktop or a sideways phone. */
.pan-edge,.pan-bar,.pan-hint{display:none}
.game.pan-on .pan-edge{display:block;position:absolute;top:0;bottom:0;width:34px;pointer-events:none;transition:opacity .25s}
.game.pan-on .pan-edge-l{left:0;background:linear-gradient(90deg,#2a1d3a5c,#2a1d3a00)}
.game.pan-on .pan-edge-r{right:0;background:linear-gradient(270deg,#2a1d3a5c,#2a1d3a00)}
.game.pan-on.panning .pan-edge{transition:none}
.game.pan-on .pan-bar{display:block;position:absolute;z-index:5;left:16px;bottom:max(16px,env(safe-area-inset-bottom));width:calc(64px * var(--k,1));height:calc(5px * var(--k,1));border-radius:5px;background:#2a1d3a52;box-shadow:0 0 0 1px #fffaf133;pointer-events:none}
.pan-bar i{position:absolute;top:0;bottom:0;border-radius:5px;background:#fffaf1;box-shadow:0 0 4px #2a1d3a66}
.game.pan-on .pan-hint:not([hidden]){display:flex;flex-direction:column;position:absolute;z-index:5;left:8px;bottom:calc(max(16px,env(safe-area-inset-bottom)) + 15px);max-width:min(calc(124px * var(--k,1)),calc(100% - 256px));align-items:center;gap:2px;padding:7px 9px 8px;border-radius:14px;background:#2f2140e0;color:#fffaf1;font-size:calc(11.5px * var(--k,1));line-height:1.25;font-weight:900;text-align:center;box-shadow:0 4px 14px #2a1d3a40;pointer-events:none;animation:pan-hint-in .35s ease both}
.pan-hint-icon{flex:none;display:grid;place-items:center;color:#ffd43c;animation:pan-hint-sway 1.6s ease-in-out infinite}
.pan-hint-icon svg{display:block}
@keyframes pan-hint-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes pan-hint-sway{0%,100%{transform:translateX(-3px)}50%{transform:translateX(3px)}}
/* The browser leaves sideways drags on the room to the game (no page scroll exists here anyway). */
.game.pan-on #room-art,.game.pan-on #navigation,.game.pan-on #navigation .nav-button{touch-action:none}
.game.pan-on.panning #room-art{cursor:grabbing}
@media(hover:hover){.game.pan-on #room-art{cursor:grab}}

/* The way back, when it is the right way (cup found, dead end): the same warm yellow as the suggested door, with a slow pulse. */
.room-back.recommended{box-shadow:0 0 0 2px #fff3b0,0 0 14px 3px #ffcf3299,0 6px 20px #34274613;animation:room-back-pulse 1.8s ease-in-out infinite}
@keyframes room-back-pulse{0%,100%{box-shadow:0 0 0 2px #fff3b0,0 0 8px 1px #ffcf3266,0 6px 20px #34274613}50%{box-shadow:0 0 0 4px #fff3b0,0 0 22px 7px #ffcf32cc,0 6px 20px #34274613}}
@media(prefers-reduced-motion:reduce){.room-back.recommended{animation:none;box-shadow:0 0 0 3px #fff3b0,0 0 16px 4px #ffcf32aa,0 6px 20px #34274613}.pan-hint-icon{animation:none}}
/* A door tab on the screen edge stays above any painted door the pan has brought under it. */
.navigation .nav-button.door.door-offscreen{z-index:1}
/* While the room pans, door signs follow it exactly (their hover/focus easing would make them trail behind). */
.game.pan-on .navigation .door .nav-name{transition:opacity .3s ease}

/* Portrait companion (scene.js): Ponçik is not in the room, he talks to us from the screen. Default: a chat strip along the
   bottom (round avatar, bubble beside it); the held phone sits above the strip, its hand passes behind it. */
/* --k (scene.js): 1 on a phone, larger on an upright tablet; every size of the strip follows it. */
.game.companion-serit{--k:1;--strip-b:max(10px,env(safe-area-inset-bottom));--strip-h:calc(84px * var(--k))}
.game.companion-serit .guide{left:10px;right:10px;top:auto;bottom:var(--strip-b);width:auto;min-height:var(--strip-h);transform:none;display:flex;align-items:center;gap:calc(14px * var(--k));max-width:calc(620px * var(--k));padding:calc(8px * var(--k)) calc(10px * var(--k)) calc(8px * var(--k)) calc(8px * var(--k));border-radius:calc(22px * var(--k));background:#2f2140d9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:0 6px 22px #1e12304d;z-index:7}
.game.companion-serit .guide::before{content:'';position:absolute;left:calc(82px * var(--k));top:50%;transform:translateY(-50%);border-style:solid;border-width:calc(7px * var(--k)) calc(9px * var(--k)) calc(7px * var(--k)) 0;border-color:transparent #fffaf1 transparent transparent;z-index:1}
.game.companion-serit .guide-character{order:-1;flex:none;width:calc(68px * var(--k));height:calc(68px * var(--k));aspect-ratio:auto;border-radius:50%;overflow:hidden;background:radial-gradient(circle at 50% 30%,#fff7e0,#ffdf94);box-shadow:0 0 0 3px #ffd43c,0 3px 10px #1e12305c}
.game.companion-serit .guide-character>*{transform:translateY(16%) scale(1.45);transform-origin:50% 35%}
.game.companion-serit .contact-shadow{display:none}
.game.companion-serit .guide-bubble{position:relative;inset:auto;flex:1;min-width:0;width:auto;margin:0;padding:calc(9px * var(--k)) calc(12px * var(--k));font-size:calc(13px * var(--k));line-height:1.35;border-radius:calc(14px * var(--k));box-shadow:none;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}
.game.companion-serit .guide-bubble:after{display:none}
.game.companion-serit:not(.phone-focused):not(.epilogue):not(.story) .phone-rig{margin-bottom:calc(var(--strip-h) + 22px)}
.game.companion-serit .pan-bar{bottom:calc(var(--strip-b) + var(--strip-h) + 12px)}
.game.companion-serit .pan-hint:not([hidden]){bottom:calc(var(--strip-b) + var(--strip-h) + 29px * var(--k))}
/* ?poncik=kenar: he leans in from the left screen edge, about half of him outside the screen; no floor shadow, he is not in the room. */
.game.companion-kenar .guide-character{transform:rotate(12deg);transform-origin:50% 100%;filter:drop-shadow(0 4px 10px #1e123059)}
.game.companion-kenar .contact-shadow{display:none}
/* Quiet: only the round avatar shows (the rest of the strip is clipped away and takes no taps). Speaking (scene.js adds
   .companion-open for a reading time): the strip and the bubble open out from beside the avatar. Tap the avatar for the last line. */
.game.companion-serit .guide{background-color:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;clip-path:inset(0 calc(100% - 84px * var(--k)) 0 0 round calc(42px * var(--k)));transition:clip-path .26s cubic-bezier(.4,0,.6,1),background-color .26s}
.game.companion-serit.companion-open .guide{transition:clip-path .34s cubic-bezier(.2,.8,.25,1),background-color .25s;clip-path:inset(0 0 0 0 round calc(22px * var(--k)));background-color:#2f2140d9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.game.companion-serit .guide-bubble,.game.companion-serit .guide::before{opacity:0;transition:opacity .26s cubic-bezier(.4,0,.6,1)}
.game.companion-serit.companion-open .guide-bubble,.game.companion-serit.companion-open .guide::before{opacity:1;transition:opacity .24s .1s}
.game.companion-serit .guide-character{pointer-events:auto;cursor:pointer}
.game.companion-serit .guide-character:focus-visible{outline:3px solid #ffcf32;outline-offset:3px}
.game.companion-serit.moving .guide,.game.companion-serit.moving .guide-bubble,.game.companion-serit.moving .guide::before{transition:none}
/* A sideways drag that starts on the held phone or on Ponçik's avatar pans the room too (a short tap still opens them). */
.game.pan-on #phone-rig,.game.pan-on #poncik-actor{touch-action:none}
/* The phone brought forward is the app: on a tablet (a card, not the whole screen) the strip under it steps away too. */
.game.companion-serit.phone-focused .guide{visibility:hidden}
