/* Base styles: stage, device, screen layers, app windows/pages (core.js). Shell: css/phone.css. Apps: css/apps.css. */
:root {
  --font: "Helvetica Neue", system-ui, sans-serif;
  --ts: 1;
  --navy: #1d2550;
  --magenta: #ff3d8b;
  --cyan: #19c3e6;
  --yellow: #ffd23f;
  --cream: #fffaf2;
  --ink: #1d2550;
  --sub: #7a7f9e;
  --line: rgba(29, 37, 80, 0.1);
  --accent: #ff3d8b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1330; font-family: var(--font); color: var(--ink); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#stage { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 80% at 50% 30%, #2a2f63 0%, #0f1330 70%); }
#device { position: absolute; left: 50%; top: 50%; width: 390px; height: 693px; transform-origin: 50% 50%; }
#case { position: absolute; inset: 0; border-radius: 52px; }
#screen { position: absolute; left: 12px; top: 12px; width: 366px; height: 669px; border-radius: 40px; overflow: hidden; clip-path: inset(0 round 40px); -webkit-clip-path: inset(0 round 40px); -webkit-mask-image: -webkit-radial-gradient(white, black); background: #000; isolation: isolate; font-size: calc(15px * var(--ts)); }
#wall { position: absolute; inset: 0; background: #1d2550 center/cover no-repeat; }
.layer { position: absolute; inset: 0; pointer-events: none; }
.layer > * { pointer-events: auto; }
#layer-home.covered { visibility: hidden; }
#layer-lock.under > * { visibility: hidden; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
#stickers { position: absolute; inset: 0; pointer-events: none; z-index: 60; }
#stickers > * { pointer-events: auto; }
#stickers.zooming > * { pointer-events: none; }
#title, #ending { position: absolute; inset: 0; display: none; z-index: 100; }

/* subtitles for voice lines */
#subtitle { position: absolute; left: 18px; right: 18px; bottom: 74px; z-index: 50; text-align: center; color: #fff; font-size: calc(16px * var(--ts)); font-weight: 700; line-height: 1.4; padding: 10px 14px; border-radius: 16px; background: rgba(15, 19, 48, 0.78); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none; text-shadow: 0 1px 2px #000; }
#subtitle.on { opacity: 1; transform: none; }

/* home indicator */
#homebar { position: absolute; left: 50%; bottom: 0; width: 160px; height: 22px; margin-left: -80px; z-index: 45; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#homebar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; }
#homebar i { display: block; width: 124px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.light-ui #homebar i { background: rgba(29,37,80,.75); }

/* ---- app windows ---- */
.win { position: absolute; inset: 0; background: var(--cream); overflow: hidden; z-index: 1; }
.win.dark { background: #0d0f1c; color: #f1f2fa; }
.win-open { animation: winOpen .32s cubic-bezier(.2,.9,.25,1.08) both; }
.win-close { animation: winClose .24s ease-in both; pointer-events: none; }
@keyframes winOpen { from { transform: scale(.12); opacity: 0; border-radius: 40px; } to { transform: none; opacity: 1; } }
@keyframes winClose { to { transform: scale(.15); opacity: 0; } }
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: inherit; transition: transform .26s ease, filter .26s; }
.page-in { animation: pageIn .28s cubic-bezier(.2,.9,.3,1) both; }
.page-out { animation: pageOut .24s ease-in both; pointer-events: none; }
.page-under { transform: translateX(-28%); filter: brightness(.92); }
@keyframes pageIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pageOut { to { transform: translateX(100%); } }
.navbar { position: relative; flex: none; height: 46px; margin-top: 40px; display: flex; align-items: center; padding: 0 6px; }
.nav-back { display: flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 8px; color: var(--accent); font-size: calc(16px * var(--ts)); cursor: pointer; z-index: 2; border-radius: 10px; max-width: 46%; }
.nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-back:active { opacity: .5; }
.nav-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 50%; font-weight: 700; font-size: calc(16px * var(--ts)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 4px; z-index: 2; }
.page-body { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 30px; touch-action: pan-y; }
.page-body::-webkit-scrollbar { display: none; }
.large-title { font-size: calc(30px * var(--ts)); font-weight: 800; letter-spacing: -.5px; padding: 2px 18px 10px; }

/* keyboard / gamepad focus ring */
body.kbd [data-focus] { outline: 3px solid var(--yellow) !important; outline-offset: 2px; border-radius: 12px; box-shadow: 0 0 0 6px rgba(255,61,139,.35); }

/* overlays fade out */
.ov-out { animation: ovOut .2s ease-in both; pointer-events: none !important; }
@keyframes ovOut { to { opacity: 0; transform: scale(.98); } }
