/* cu-app (14 Oct 2026): home-screen app. html.cu-app = opened from the home screen (standalone / fullscreen, or iOS navigator.standalone).
   The phone mock fills the screen and sits inside the safe area (notch / Dynamic Island / home bar never cover the game). */
html.cu-app, html.cu-app body { background: var(--bg, #05070b); }
html.cu-app body { display: block; padding: 0; min-height: 100vh; min-height: 100dvh; overflow: hidden; }
html.cu-app .stage { display: block; gap: 0; }
html.cu-app .stage > .hint { display: none; }
html.cu-app .phone { position: fixed; top: env(safe-area-inset-top, 0px); bottom: 0; left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px);
  width: auto; height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
html.cu-app .notch { display: none; }   /* the fake 9:41 status bar: the real one is on screen now */
/* cu-bottomfix (16 Oct 2026): the game used to stop at the home-bar line (phone bottom = safe-area inset -> black strip with a hard edge).
   Now it runs to the screen bottom; the scroll padding keeps the last item above the home bar. */
html.cu-app .screen { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
html.cu-app .screen.jk-screen { padding-bottom: 0; }
/* cu-bottomfix: iOS home-screen apps (black-translucent status bar) can report a layout viewport that is the status-bar height
   SHORTER than the screen, so a fixed bottom:0 box still ends ~50 pt above the real bottom. --app-h (set in index.html from the
   screen size) gives the true height; without the script it falls back to the large viewport. */
html.cu-app .phone { bottom: auto; height: calc(var(--app-h, 100lvh) - env(safe-area-inset-top, 0px)); }
html.cu-app.rc-play .viewport { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); box-sizing: border-box; }   /* Night Run landscape: clear of the notch */
/* install tip (Safari / Chrome tab only, once) */
.app-tip { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 9800; max-width: 420px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 16px; background: rgba(13,20,34,.97); border: 1px solid rgba(0,163,255,.45);
  box-shadow: 0 12px 40px rgba(0,0,0,.55); color: #e6eef8; font: 500 13.5px/1.35 Inter, system-ui, sans-serif; transform: translateY(16px); opacity: 0; transition: opacity .25s ease, transform .25s ease; }
.app-tip.on { transform: none; opacity: 1; }
.app-tip img { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px; }
.app-tip .tx { flex: 1; }
.app-tip b { color: #fff; }
.app-tip .sh { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; }
.app-tip .go { border: 0; border-radius: 999px; padding: 8px 12px; background: #ffd25e; color: #1a1300; font: 800 13px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.app-tip .x { border: 0; background: transparent; color: #8fa6bd; font-size: 18px; width: 32px; height: 32px; cursor: pointer; flex: 0 0 32px; }
@media (prefers-reduced-motion: reduce) { .app-tip { transition: none; } }
/* cu-home-m: Mission 00 card (index.html #ih-home) */
.ih-home { display: flex; flex-direction: column; gap: 6px; }
.ih-home[hidden] { display: none; }
.ih-hs-how { display: flex; align-items: center; gap: 10px; margin: 0 4px 2px; padding: 8px 10px; border-radius: 12px; background: rgba(0,163,255,.08); border: 1px solid rgba(0,163,255,.25);
  color: #c9d6e6; font: 500 12.5px/1.4 Inter, system-ui, sans-serif; }
.ih-hs-how[hidden] { display: none; }
.ih-hs-how .hs-tx { flex: 1; } .ih-hs-how b { color: #fff; }
.ih-hs-how .sh { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.ih-hs-how .hs-go { border: 0; border-radius: 999px; padding: 4px 10px; background: #ffd25e; color: #1a1300; font: 800 12px Inter, system-ui, sans-serif; cursor: pointer; }
.ih-hs-how .hs-skip { border: 0; background: transparent; color: #8fa6bd; font: 600 12px Inter, system-ui, sans-serif; text-decoration: underline; cursor: pointer; padding: 4px; flex: 0 0 auto; }
.ih-hs-how.hs-pulse { animation: hsPulse .6s ease; }
@keyframes hsPulse { 40% { border-color: rgba(255,206,92,.9); background: rgba(255,190,60,.16); } }
/* cu-ver: new deployed version bar */
.ver-bar { position: fixed; left: 50%; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 9900; transform: translate(-50%, -12px); opacity: 0;
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(255,206,92,.6); border-radius: 999px; background: rgba(13,20,34,.97);
  color: #e6eef8; font: 600 13px Inter, system-ui, sans-serif; box-shadow: 0 8px 28px rgba(0,0,0,.5); cursor: pointer; white-space: nowrap; transition: opacity .25s ease, transform .25s ease; }
.ver-bar.on { opacity: 1; transform: translate(-50%, 0); }
.ver-bar b { color: #ffd25e; }
.ver-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #ffd25e; }
@media (prefers-reduced-motion: reduce) { .ver-bar, .ih-hs-how.hs-pulse { transition: none; animation: none; } }
/* cu-noframe (14 Oct 2026): phones / tablets in a normal browser tab (touch, no mouse) get the same full-screen layout as the installed app:
   no mock phone, no fake 9:41 bar, no "Flow:" design note. Desktop (mouse / hover) keeps the framed preview. */
@media (hover: none) and (pointer: coarse) {
  html, html body { background: var(--bg, #05070b); }
  html body { display: block; padding: 0; min-height: 100vh; min-height: 100dvh; overflow: hidden; }
  html, html body { overscroll-behavior-x: none; }   /* cu-swipeback: no browser history swipe on Chrome/Android (iOS Safari keeps its own edge gesture) */
  html .stage { display: block; gap: 0; }
  html .stage > .hint { display: none; }
  html body .phone { position: fixed; top: env(safe-area-inset-top, 0px); bottom: 0; left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px);
    width: auto; height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  html body .notch { display: none; }
  html body .screen { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  html body .screen.jk-screen { padding-bottom: 0; }
  html.rc-play body .viewport { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); box-sizing: border-box; }
}
/* cu-noframe: short screens (phone sideways): pop-ups scroll inside the screen so every button can be reached; centred when they fit */
@media (max-height: 500px) {
  html body .cc-modal, html body #pv-cf, html body #pv-ach, html body #kg-ov, html body .age-ov, html body .ul-ov, html body #en-pop { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  html body .cc-modal > *, html body #pv-cf > *, html body #pv-ach > *, html body #kg-ov > *, html body .age-ov > *, html body .ul-ov > *, html body #en-pop > * { margin-top: auto; margin-bottom: auto; flex-shrink: 0; max-height: none; }
  html body .ul-ov { padding-top: 12px; padding-bottom: 12px; }
}
/* cu-scrollfix (14 Oct 2026): the Wardrobe sheet is taller than a phone screen; it sat at the bottom of a non-scrolling overlay, so its top
   (title, first looks) was cut off and could not be reached. The overlay scrolls now; a short sheet still sits at the bottom. */
html body .ms-wd { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
html body .ms-wd > .ms-wd-card { margin-top: auto; flex-shrink: 0; }

/* cu-cutoff19 (19 Oct 2026): iOS home-screen app on newer iOS: the layout viewport (innerHeight) is the status-bar height SHORTER than the
   screen and WebKit no longer paints or scrolls the strip below it. cu-bottomfix stretches .phone to the full screen, so the last ~50 pt of
   every scroller sat in that dead strip (last trophy row cut off behind black). --app-gap (index.html fit) = how far the box runs past
   innerHeight; every main scroller gets that much extra end room, so its last item stops above the dead strip. 0 everywhere else. */
html.cu-app .screen:not(.jk-screen) { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--app-gap, 0px)); }
html.cu-app .pv-scr { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px) + var(--app-gap, 0px)); }
html.cu-app .m1-flow { bottom: var(--app-gap, 0px); }   /* bottom-anchored mission card: lift the whole box */
html.cu-app .st-view { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px) + var(--app-gap, 0px)); }
html.cu-app .jk-page, html.cu-app .cm-page { padding-bottom: calc(14px + var(--app-gap, 0px)); }
html.cu-app body .cc-modal, html.cu-app body #pv-cf, html.cu-app body #pv-ach, html.cu-app body #kg-ov, html.cu-app body .age-ov, html.cu-app body .ul-ov,
html.cu-app body #en-pop, html.cu-app body .ms-wd, html.cu-app .m57-ov, html.cu-app #cu-lb, html.cu-app #cu-pf { padding-bottom: var(--app-gap, 0px); box-sizing: border-box; }


/* landfix2-phone-land: no GPU blurs on short landscape phones */
@media (orientation: landscape) and (max-height: 500px) {
  *, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; filter: none !important; }
}
