.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* ---- the unit: during the ending the phone comes forward as the whole rig (a CSS frame, w:h .5),
   stretched by tour.css's B values. The unit vars below are the site's original frame metrics. ---- */
:root{
  --hg-ar:.6863;
  --hp-inset:50.27% 26.4% .54% 26.3%;            /* phone inside the unit (t r b l), centred on his body */
  --hp-rad:15% / 9.9%;                            /* outer corner */
  --hs-inset:2.77% 4.2% 2.77% 4.2%;               /* screen glass inside the frame */
  --hs-rad:12% / 7.7%;
  /* wide screens: the unit stays put in the middle; its narrow top (tuft) never meets the corner buttons */
  --u-h:min(calc(100dvh - 8px),980px,calc(42vw / var(--hg-ar)));
  --u-w:calc(var(--u-h) * var(--hg-ar));
  --u-top:calc((100dvh - var(--u-h)) / 2);
}
@media(max-width:1099px){
  /* narrow screens: the unit hangs under the buttons, as wide as the screen allows; headline and store badges below it */
  :root{--u-h:max(240px,min(calc(100dvh - 64px - 222px),calc((100vw - 16px) / var(--hg-ar)),680px));--u-top:64px}
}

.epilogue .hud,.epilogue .game-tools,.epilogue .game-caption{opacity:0;visibility:hidden;transition:opacity .7s,visibility .7s}
.epilogue .phone-open{visibility:hidden}
.game.story .guide{visibility:hidden} /* the phone takes the guide's place in the same frame */
.game.story{z-index:20}
.game-fade{position:absolute;left:0;right:0;bottom:0;height:34%;z-index:8;pointer-events:none;background:linear-gradient(0deg,var(--paper) 0,var(--paper) 30%,#fcf8ee00 100%);opacity:0;transition:opacity 1s .5s}
.handoff-on .game-fade{opacity:1}

/* ---- the rig becomes the unit: fixed, above every section and band; it never clips ---- */
.game.story #phone-rig{position:fixed;inset:auto;left:calc(50% - var(--u-w) / 2);top:var(--u-top);right:auto;bottom:auto;width:var(--u-w);height:var(--u-h);z-index:30;overflow:visible;transform:translate3d(0,var(--ty,0px),0) scale(var(--sc,1));transform-origin:50% 0;transition:opacity .4s,visibility 0s}
.game.story .phone-assembly{position:absolute;inset:var(--hp-inset);transform:none;transition:none;z-index:1}
.game.story .hand-phone-art,.game.story .phone-open{display:none}
.game.story .phone{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;border-radius:var(--hp-rad);background:linear-gradient(155deg,#8069c8,#5d48a3 55%,#4f3c8f);box-shadow:0 calc(var(--u-h) * .012) calc(var(--u-h) * .03) #1d0f3a59,inset 0 0 0 1px #ffffff2e;transform:none;overflow:visible;pointer-events:none}
.game.story .phone-screen{position:absolute;inset:var(--hs-inset);width:auto;height:auto;border-radius:var(--hs-rad);overflow:hidden;background:#faf6ee;box-shadow:0 0 0 max(1.5px,calc(var(--u-w) * .006)) #2a1f45;container-type:inline-size;display:flex;flex-direction:column;pointer-events:auto;transition:background-color .35s ease}
.game.story .phone-screen>*{--u:calc(100cqw / 216)}
.game.story #phone-alarm,.game.story #phone-mission,.game.story .offline-entry{display:none!important}
.game.story .phone-status{flex-shrink:0;height:calc(var(--u) * 26);padding:calc(var(--u) * 10) calc(var(--u) * 20) 0;font-size:calc(var(--u) * 10)}
.game.story .phone-app{flex-shrink:0;margin:calc(var(--u) * 6) calc(var(--u) * 20) 0;font-size:calc(var(--u) * 18)}
.game.story .phone-app .camera-dot{font-size:calc(var(--u) * 9)}
.game.story .phone-story{display:block;flex:1;min-height:0;position:relative}
.game.phone-game-mode .phone-story{display:none}
.game.phone-small .phone-screen{pointer-events:none}

/* ---- headline: left of the unit on wide screens, under it on narrow ones (it scrolls away with the scene) ---- */
.ending-copy{position:absolute;z-index:10;opacity:0}
.story-ready .ending-copy{opacity:1;animation:copy-in .8s .25s cubic-bezier(.2,.8,.2,1) backwards}
@keyframes copy-in{from{opacity:0;translate:0 14px}}
.ending-copy-title{margin:0;font-weight:900;letter-spacing:-.035em;color:#422c67;text-wrap:balance}
.ending-copy-sub{margin:.3em 0 0;font-weight:800;letter-spacing:-.025em;color:#5b3f86;text-wrap:balance}
@media(min-width:1100px){
  .ending-copy{top:calc(var(--u-top) + var(--u-h) * .6);right:calc(50% + var(--u-w) / 2 + clamp(28px,3vw,56px));width:min(34rem,calc(50% - var(--u-w) / 2 - clamp(28px,3vw,56px) - 16px));padding:clamp(16px,1.6vw,30px) clamp(16px,1.8vw,36px);border-radius:28px;background:#fcf8eee6;color:var(--ink);box-shadow:0 12px 40px #2a1a4a2e;transform:translateY(-50%)}
  .story-ready .ending-copy{opacity:calc(1 - var(--leave,0))}
  .ending-copy-title{font-size:clamp(2rem,3.4vw,4.25rem);line-height:1.02}
  .ending-copy-sub{font-size:clamp(1.25rem,2.1vw,3rem);line-height:1.1}
}
@media(max-width:1099px){
  /* under the unit; it fades out within the first steps of scrolling */
  .ending-copy{left:20px;right:20px;top:calc(var(--u-top) + var(--u-h) + 12px);text-align:center;text-shadow:0 0 14px var(--paper),0 0 5px var(--paper),0 0 2px var(--paper)} /* legible over the balcony railing */
  .story-ready .ending-copy{opacity:calc(1 - var(--band,0) * 6)}
  .ending-copy-title{font-size:clamp(1.75rem,7.6vw,2.5rem);line-height:1.04}
  .ending-copy-sub{font-size:clamp(1.125rem,4.8vw,1.625rem);line-height:1.15}
}

/* ---- top right: home (icon) and replay; the left corner stays free ---- */
/* it arrives after the game's own corner tools have faded, never on top of them */
.story-nav{position:fixed;top:12px;right:12px;z-index:60;display:flex;gap:8px;animation:fade-in .45s .7s ease backwards}
@keyframes fade-in{from{opacity:0}}
.story-nav button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:0 15px;border:0;border-radius:14px;background:#fffaf1;color:#493458;font-size:14px;font-weight:800;box-shadow:0 4px 16px #2a1a4a2e;cursor:pointer}
.story-nav .nav-home{padding:0;width:44px}
.story-nav button:hover{background:#fff}
.story-nav button span{font-size:18px;line-height:1}
.story-nav button:focus-visible{outline:3px solid #5b3f86;outline-offset:2px}

/* ---- store badges: one component (.store-btn), used in the ending scene and in the download section ---- */
.store-row{display:flex;flex-wrap:wrap;gap:10px}
.store-btn{display:inline-flex;align-items:center;gap:10px;height:48px;padding:0 16px 0 12px;border-radius:11px;background:#000;color:#fff;text-decoration:none;box-shadow:0 6px 16px #1d0f3a40,inset 0 0 0 1.5px #a6a6a6;transition:background .2s}
.store-btn:hover{background:#1c1c1c}
.store-btn:focus-visible{outline:3px solid #5b3f86;outline-offset:3px}
.store-btn svg{width:21px;height:25px;flex-shrink:0}
.store-txt{display:flex;flex-direction:column;line-height:1.02;white-space:nowrap}
.store-txt small{font-size:12.5px;font-weight:700;letter-spacing:.01em;color:#fff;opacity:.9}
.store-txt strong{font-size:17px;font-weight:800;letter-spacing:-.01em}

/* ---- the scene's store card: right of the unit on wide screens (balancing the headline card), under the headline
   on narrow ones. It belongs to the balcony scene: it scrolls away with it and never follows into the story. ---- */
.scene-stores{position:absolute;z-index:10;opacity:0}
.story-ready .scene-stores{opacity:1;animation:copy-in .8s .4s cubic-bezier(.2,.8,.2,1) backwards}
.stores-note{margin:0 0 14px;font-size:15px;line-height:1.45;font-weight:700;color:#4a3a5e;text-wrap:pretty}
@media(min-width:1100px){
  .scene-stores{top:calc(var(--u-top) + var(--u-h) * .6);left:calc(50% + var(--u-w) / 2 + clamp(28px,3vw,56px));width:min(30rem,calc(50% - var(--u-w) / 2 - clamp(28px,3vw,56px) - 16px));padding:clamp(16px,1.6vw,26px) clamp(16px,1.8vw,30px);border-radius:28px;background:#fcf8eee6;box-shadow:0 12px 40px #2a1a4a2e;transform:translateY(-50%)}
  .scene-stores .store-row{flex-wrap:nowrap}
  .story-ready .scene-stores{opacity:calc(1 - var(--leave,0))}
}
@media(min-width:1100px) and (max-width:1439px){
  .scene-stores .store-btn{height:44px;padding:0 12px 0 10px;gap:7px}
  .scene-stores .store-txt strong{font-size:15px}
  .scene-stores .stores-note{font-size:14px}
}
@media(max-width:1099px){
  .scene-stores{left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));text-align:center}
  .story-ready .scene-stores{opacity:calc(1 - var(--band,0) * 6)}
  .scene-stores .stores-note{margin:0 auto 8px;max-width:30rem;font-size:13px;line-height:1.3;text-shadow:0 0 10px var(--paper),0 0 4px var(--paper)}
  .scene-stores .store-row{justify-content:center;flex-wrap:nowrap;gap:8px}
  .scene-stores .store-btn{height:44px;padding:0 12px 0 10px;gap:7px}
  .scene-stores .store-txt strong{font-size:15px}
}
@media(prefers-reduced-motion:reduce){.story-ready .ending-copy{animation:none}.story-nav{animation-duration:.2s}.story-ready .scene-stores{animation:none}}

/* dar telefon: iki mağaza düğmesi yan yana sığsın */
@media(max-width:400px){.store-btn{padding:0 11px 0 9px;gap:7px}.store-txt strong{font-size:15px}.store-txt small{font-size:11.5px}}
