:root {
  --bg: #050508;
  --text: #f5f5f7;
  --sub: rgba(235, 235, 245, .62);
  --card: rgba(36, 36, 44, .82);
  --card-solid: #24242c;
  --btn: rgba(255, 255, 255, .13);
  --btn-press: rgba(255, 255, 255, .24);
  --line: rgba(255, 255, 255, .14);
  --red: #ff453a;
  --yellow: #ffd60a;
  --green: #30d158;
  --blue: #0a84ff;
  --accent: #64d2ff;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", Meiryo, sans-serif;
}
/* The game is a night lock screen, so the look is dark in both schemes. */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --bg: #e9e9ef; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overscroll-behavior: none; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, a { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }

#stage { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.phone {
  position: relative; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden;
}
.screen { position: absolute; inset: 0; overflow: hidden; background: #0b0c1a; isolation: isolate; }
@media (min-width: 560px) and (min-height: 600px) {
  #stage { padding: 2vh 0; }
  .phone {
    height: min(844px, 96vh); width: auto; aspect-ratio: 390 / 844;
    border-radius: 56px; padding: 12px; background: #1b1b1f;
    box-shadow: 0 0 0 2px #3a3a40, 0 30px 80px rgba(0, 0, 0, .55);
  }
  .screen { inset: 12px; border-radius: 44px; }
  .island { display: block !important; }
}

.wall {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 60% at 80% 105%, rgba(255, 140, 60, .32), transparent 60%),
    radial-gradient(90% 50% at 10% 95%, rgba(255, 70, 120, .22), transparent 60%),
    radial-gradient(70% 40% at 50% 0%, rgba(80, 90, 255, .35), transparent 70%),
    linear-gradient(180deg, #0b1030 0%, #131035 45%, #1c0f2a 100%);
}
.wall::after { /* window lights */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 220, 140, .06) 14px 18px),
    linear-gradient(0deg, rgba(0, 0, 0, .55), transparent);
  -webkit-mask-image: linear-gradient(0deg, #000 30%, transparent);
  mask-image: linear-gradient(0deg, #000 30%, transparent);
}
.island { display: none; position: absolute; top: 11px; left: 50%; width: 120px; height: 34px; margin-left: -60px; background: #000; border-radius: 20px; z-index: 30; }

/* status bar */
.status {
  position: absolute; top: 0; left: 0; right: 0; height: 50px; z-index: 31;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 26px 0 34px; font-size: 16px; font-weight: 600; letter-spacing: .01em;
}
.sb-right { display: flex; align-items: center; gap: 6px; }
.sig { width: 17px; height: 11px; fill: #fff; }
.sb-pct { display: inline-block; font-variant-numeric: tabular-nums; font-size: 15px; color: #fff; transition: color .3s; }
.sb-pct.flash { animation: pctFlash .55s ease-out; }
.bat.flash { animation: batFlash .55s ease-out; }
@keyframes pctFlash { 0% { transform: scale(1.45); color: #fff; text-shadow: 0 0 12px #fff; } 100% { transform: scale(1); } }
@keyframes batFlash { 0% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.bat { position: relative; width: 26px; height: 12.5px; border: 1.3px solid rgba(255, 255, 255, .45); border-radius: 4px; padding: 1.5px; }
.bat::after { content: ""; position: absolute; right: -4px; top: 3.5px; width: 2px; height: 4px; border-radius: 0 2px 2px 0; background: rgba(255, 255, 255, .45); }
.bat i { display: block; height: 100%; width: 12%; min-width: 2px; border-radius: 1.5px; background: #fff; transition: background .3s, width .45s cubic-bezier(.3, .8, .3, 1); }
.bat .bolt { display: none; position: absolute; inset: 0; font-size: 10px; line-height: 10px; text-align: center; color: #fff; }
.screen.low .sb-pct { color: var(--yellow); }
.screen.low .bat i { background: var(--yellow); }
.screen.red .sb-pct { color: var(--red); }
.screen.red .bat i, .screen.red .thin i { background: var(--red); }
.screen.charging .bat i { background: var(--green); }
.screen.charging .bat .bolt { display: block; }
.screen.critical .sb-pct { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: .35; } }
.thin { position: absolute; top: 50px; left: 26px; right: 26px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .12); z-index: 31; overflow: hidden; }
.thin i { display: block; height: 100%; width: 100%; background: rgba(255, 255, 255, .8); transform-origin: left; border-radius: 2px; transition: background .3s; }
.screen.low .thin i { background: var(--yellow); }
.screen.charging .thin i { background: var(--green); }
.drain {
  position: absolute; top: 58px; right: 24px; z-index: 32; font-size: 13px; font-weight: 700; color: var(--red);
  font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none;
}
.drain.show { animation: drainUp 1.1s ease-out forwards; }
.drain.plus { color: var(--green); }
@keyframes drainUp { 0% { opacity: 0; transform: translateY(-4px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* layout */
.view { position: absolute; inset: 64px 0 0; display: flex; flex-direction: column; }
.start, .game, .result { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 16px; }
.lock-date { text-align: center; font-size: 17px; font-weight: 600; color: rgba(255, 255, 255, .85); margin-top: 6px; }
.lock-clock { text-align: center; font-size: 88px; line-height: 1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .94); }
.start .lock-clock { font-size: 96px; margin-top: 2px; }
.start-notifs { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; }
.start-notifs .card { animation-delay: .25s; }
.start-notifs .card + .card { animation-delay: .45s; }
.start-body { margin-top: auto; text-align: center; padding: 0 8px; }
.game-title span { display: block; }
.lead { text-wrap: balance; }
.game-title { font-size: 30px; line-height: 1.35; margin: 0 0 12px; font-weight: 800; }
.lead { margin: 0 0 26px; color: var(--sub); font-size: 15px; line-height: 1.6; }
.start .btn.big { margin: 0 8px 4px; }
.linkbtn { display: block; margin: 0 auto calc(96px + env(safe-area-inset-bottom)); min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--sub); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.game .lock-clock { font-size: 64px; }
.where { text-align: center; margin-top: 6px; font-size: 14px; color: var(--sub); min-height: 20px; }

/* route */
.route { list-style: none; margin: 12px 4px 4px; padding: 0; display: flex; justify-content: space-between; position: relative; height: 14px; }
.route::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: rgba(255, 255, 255, .18); }
.route .prog { position: absolute; left: 6px; top: 6px; height: 2px; background: var(--accent); width: 0; transition: width .9s ease; }
.route li { position: relative; width: 14px; height: 14px; border-radius: 50%; background: #2a2a38; border: 2px solid rgba(255, 255, 255, .3); z-index: 1; transition: background .3s, border-color .3s; }
.route li.done { background: var(--accent); border-color: var(--accent); }
.route li.cur { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(100, 210, 255, .25); }

/* event stack */
.stack { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px 0 8px; overflow: hidden; }
.card {
  background: var(--card); border-radius: 22px; padding: 14px 16px 15px;
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  animation: slideIn .42s cubic-bezier(.2, .9, .25, 1.1) both; will-change: transform;
}
@keyframes slideIn { from { transform: translateY(-46px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.card.leave { animation: leave .25s ease-in forwards; }
@keyframes leave { to { transform: translateY(-24px); opacity: 0; } }
.c-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.c-app { flex: 1; text-transform: none; }
.ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; line-height: 1; color: #fff; flex: none; }
.c-title { font-weight: 700; font-size: 16px; margin: 8px 0 2px; }
.c-body { font-size: 15.5px; line-height: 1.55; }
.c-note { font-size: 13px; color: var(--yellow); margin-top: 6px; }
.c-out { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: #fff; animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } }
.c-step { font-size: 12px; font-weight: 700; color: #0b0c1a; background: var(--accent); border-radius: 10px; padding: 2px 8px; }
.c-steps { display: flex; gap: 4px; margin-top: 10px; }
.c-steps i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.c-steps i.on { background: var(--accent); }
.terms { margin-top: 8px; max-height: 92px; overflow-y: auto; font-size: 12px; line-height: 1.5; color: var(--sub); background: rgba(0, 0, 0, .25); border-radius: 10px; padding: 8px 10px; -webkit-overflow-scrolling: touch; }
.terms p { margin: 0 0 4px; }

.card.call { background: rgba(28, 28, 34, .9); text-align: center; padding: 20px 16px; }
.card.call .c-head { justify-content: center; }
.card.call .c-title { font-size: 28px; margin: 8px 0 2px; }
.card.call .c-body { color: var(--sub); animation: blink 1.2s steps(2, start) infinite; }
.card.call .c-out { animation: fade .3s ease both; color: #fff; }
.card.alert { background: rgba(44, 44, 52, .92); text-align: center; border-radius: 16px; margin: 0 18px; }
.card.alert .c-head { justify-content: center; }
.card.travel { background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: none; backdrop-filter: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 14px; color: var(--sub); }
.walk { display: inline-flex; gap: 4px; }
.walk i { width: 6px; height: 6px; border-radius: 50%; background: var(--sub); animation: dot 1s infinite ease-in-out; }
.walk i:nth-child(2) { animation-delay: .15s; } .walk i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* choices */
.choices { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 12px; min-height: 0; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; width: 100%; padding: 12px 16px; border: 0; border-radius: 16px;
  background: var(--btn); color: #fff; font-size: 16px; font-weight: 600; line-height: 1.35; text-align: center; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s; animation: fade .3s ease both;
}
.btn:active { transform: scale(.97); background: var(--btn-press); }
.btn.primary { background: #fff; color: #0b0c1a; }
.btn.primary:active { background: #dcdce2; }
.btn.blue { background: var(--blue); }
.btn.green { background: var(--green); color: #04210d; }
.btn.redb { background: var(--red); }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 18px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.choices .btn:nth-child(2) { animation-delay: .05s; } .choices .btn:nth-child(3) { animation-delay: .1s; }
.call-row { display: flex; gap: 10px; }
.call-row .btn { flex: 1; flex-direction: column; min-height: 64px; gap: 2px; font-size: 14px; }

/* dock */
.dock {
  position: absolute; left: 12px; right: 12px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; gap: 8px; align-items: stretch;
}
.bright, .lpm {
  background: rgba(30, 30, 40, .72); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: 18px; min-height: 52px;
}
.bright { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.sun { color: rgba(255, 255, 255, .7); }
.sun.s { font-size: 12px; } .sun.l { font-size: 19px; }
.bright input { flex: 1; -webkit-appearance: none; appearance: none; height: 44px; background: transparent; margin: 0; touch-action: none; }
.bright input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #fff var(--v, 60%), rgba(255, 255, 255, .22) var(--v, 60%)); }
.bright input::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.bright input::-moz-range-progress { height: 6px; border-radius: 3px; background: #fff; }
.bright input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.bright input::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; }
.lpm { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lpm-ic { width: 24px; height: 12px; border: 1.3px solid rgba(255, 255, 255, .6); border-radius: 3.5px; padding: 1.5px; }
.lpm-ic i { display: block; height: 100%; width: 35%; background: rgba(255, 255, 255, .6); border-radius: 1px; }
.lpm[aria-pressed="true"] { background: var(--yellow); color: #231c00; }
.lpm[aria-pressed="true"] .lpm-ic { border-color: #231c00; }
.lpm[aria-pressed="true"] .lpm-ic i { background: #231c00; }
.game { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.screen.no-dock .dock { display: none; }
.screen.no-dim .dim { opacity: 0 !important; }

/* brightness dim: covers everything except itself */
.dim { position: absolute; inset: 0; background: #000; opacity: .22; pointer-events: none; z-index: 60; transition: opacity .15s; }

/* modal */
.modal-wrap { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 0, 0, .35); animation: fade .2s ease both; }
.modal { width: 270px; border-radius: 14px; background: rgba(50, 50, 58, .94); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); text-align: center; overflow: hidden; animation: pop .28s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pop { from { transform: scale(1.15); opacity: 0; } }
.m-text { padding: 20px 16px 16px; }
.m-title { font-weight: 700; font-size: 16px; line-height: 1.35; }
.m-body { font-size: 14px; margin-top: 4px; color: rgba(255, 255, 255, .85); }
.m-btns { display: flex; border-top: 1px solid rgba(255, 255, 255, .16); }
.m-btns button { flex: 1; min-height: 46px; border: 0; background: none; color: var(--blue); font-size: 16px; cursor: pointer; }
.m-btns button + button { border-left: 1px solid rgba(255, 255, 255, .16); }
.m-btns button.b { font-weight: 700; }
.m-btns button:active { background: rgba(255, 255, 255, .1); }

/* black (dead) screen */
.black { position: absolute; inset: 0; z-index: 55; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; animation: fade .5s ease both; }
.dead-bat { position: relative; width: 120px; height: 56px; border: 4px solid #555; border-radius: 12px; padding: 6px; }
.dead-bat::after { content: ""; position: absolute; right: -12px; top: 16px; width: 6px; height: 16px; background: #555; border-radius: 0 4px 4px 0; }
.dead-bat i { display: block; height: 100%; width: 7px; border-radius: 3px; background: var(--red); animation: blink 1s steps(2, start) infinite; }
.cable { width: 4px; height: 60px; background: linear-gradient(#444, #222); border-radius: 2px; }
.black-msg { color: #8e8e93; font-size: 15px; padding: 0 24px; text-align: center; line-height: 1.6; }

/* result */
.result { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: 4px; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
#card { width: 100%; height: auto; border-radius: 18px; display: block; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: slideIn .5s cubic-bezier(.2, .9, .25, 1.05) both; flex: none; }
.result-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; flex: none; }
.btn.x { background: #000; border: 1px solid rgba(255, 255, 255, .25); }
.btn.x svg { width: 18px; height: 18px; fill: #fff; }

.homebar { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: rgba(255, 255, 255, .55); z-index: 61; pointer-events: none; }
@media (max-width: 559px), (max-height: 599px) { .homebar { display: none; } }
@media (max-height: 700px) {
  .game .lock-clock { font-size: 48px; }
  .start .lock-clock { font-size: 72px; }
  .lock-date { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* start toast (custom low-battery notice) */
.toast {
  position: absolute; top: 60px; left: 10px; right: 10px; z-index: 45; padding: 12px 14px; border-radius: 22px;
  background: rgba(40, 40, 48, .9); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: toastIn .45s cubic-bezier(.2, .9, .25, 1.1) both;
}
.toast.out { animation: toastOut .26s ease-in forwards; }
@keyframes toastIn { from { transform: translateY(-120%); } }
@keyframes toastOut { to { transform: translateY(-120%); opacity: 0; } }
.toast-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.toast-row .c-body { flex: 1; font-size: 14.5px; }
.toast-btn { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--yellow); color: #231c00; font-size: 14px; font-weight: 700; cursor: pointer; }
.toast-btn:active { transform: scale(.97); }
/* chat bubbles */
.bubbles { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
.bub { background: rgba(255, 255, 255, .14); border-radius: 16px 16px 16px 4px; padding: 8px 12px; font-size: 15.5px; animation: bubIn .3s ease both; }
@keyframes bubIn { from { opacity: 0; transform: translateY(6px) scale(.96); } }

/* forgotten-item tag map */
.tagmap { position: relative; height: 62px; margin-top: 10px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #1f2a24, #1a2230); }
.tagmap .rail { position: absolute; left: 0; right: 0; top: 30px; height: 4px; background: repeating-linear-gradient(90deg, #8e8e93 0 10px, #3a3a40 10px 20px); }
.tagmap .me { position: absolute; left: 14px; top: 22px; color: var(--blue); font-size: 16px; line-height: 20px; }
.tagmap .pin { position: absolute; left: 40px; top: 12px; font-size: 22px; animation: pinGo 4s linear infinite; }
@keyframes pinGo { from { transform: translateX(0); } to { transform: translateX(230px); } }
/* endings collection */
.found { text-align: center; margin-top: 14px; font-size: 15px; font-weight: 700; color: var(--accent); }
.found .new { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px; background: var(--yellow); color: #231c00; font-size: 12px; }
.end-h { font-size: 15px; margin: 26px 2px 8px; color: var(--sub); font-weight: 700; }
.endings { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.endings li { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .07); font-size: 12.5px; line-height: 1.35; }
.endings li.lock { color: rgba(235, 235, 245, .35); }
.endings li.cur { outline: 2px solid var(--accent); }
.endings .no { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); font-size: 11px; font-weight: 700; }
.endings li.got .no { background: var(--accent); color: #0b0c1a; }
.sheet-wrap { position: absolute; inset: 0; z-index: 52; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; animation: fade .2s ease both; }
.sheet { width: 100%; max-height: 82%; overflow-y: auto; background: #1c1c22; border-radius: 22px 22px 0 0; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { font-size: 17px; margin: 0; }
.sheet-x { min-height: 44px; min-width: 44px; border: 0; background: none; color: var(--blue); font-size: 16px; cursor: pointer; }
.black.off .dead-bat, .black.off .cable { display: none; }

/* ===== live phone UI ===== */
.walkbar { margin: auto 0 0; align-self: center; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 20px; background: rgba(255, 255, 255, .08); font-size: 14px; color: var(--sub); }
.game { justify-content: flex-start; }
.game .walkbar { margin-bottom: 12px; }
.banners { position: absolute; top: 58px; left: 8px; right: 8px; z-index: 40; }
.banner {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer; padding: 12px 14px; border-radius: 22px; color: #fff;
  background: rgba(40, 40, 48, .92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); animation: toastIn .42s cubic-bezier(.2, .9, .25, 1.1) both; touch-action: pan-x;
}
.banner.out { animation: toastOut .25s ease-in forwards; }
.bn-t { font-weight: 700; font-size: 15px; margin-top: 6px; }
.bn-b { font-size: 14.5px; line-height: 1.45; color: rgba(255, 255, 255, .88); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.otoast {
  position: absolute; left: 14px; right: 14px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 41; padding: 11px 14px; border-radius: 16px;
  background: rgba(20, 20, 26, .9); border: 1px solid rgba(255, 255, 255, .12); font-size: 14px; line-height: 1.5; animation: fade .25s ease both; pointer-events: none;
}
.otoast.out { animation: leave .3s ease-in forwards; }

/* app sheet */
.apps {
  position: absolute; left: 0; right: 0; top: 56px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 35;
  background: #101015; border-radius: 22px 22px 0 0; overflow: hidden; display: flex; flex-direction: column;
  animation: sheetUp .32s cubic-bezier(.2, .9, .3, 1) both; box-shadow: 0 -10px 30px rgba(0, 0, 0, .4);
}
.apps.call { background: linear-gradient(180deg, #2c3440, #12161c); }
.apps.alert { background: rgba(0, 0, 0, .45); box-shadow: none; animation: fade .2s ease both; }
.apps.camera { background: #000; }
.apps.scene { background: #15151c; }
.ap-head { flex: none; display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 4px 8px; border-bottom: 1px solid var(--line); background: rgba(28, 28, 34, .96); }
.ap-head.work { background: #2a1c3a; }
.ap-head.dark { background: #000; border-color: #222; }
.ap-back, .ap-ic { min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; background: none; color: var(--blue); font-size: 16px; cursor: pointer; }
.ap-ic { font-size: 20px; }
.ap-title { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; min-width: 0; }
.ap-right { min-width: 60px; display: flex; justify-content: flex-end; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #5e5ce6; font-size: 13px; }
.ab { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 15.5px; font-weight: 600; cursor: pointer; }
.ab:active { transform: scale(.97); }
.ab.primary { background: var(--blue); }
.ab.green { background: var(--green); color: #04210d; }
.ab.scene { background: transparent; border: 1.5px solid rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .9); }
.ab[disabled] { opacity: .4; }

/* messages */
.th-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
.bub { max-width: 78%; padding: 9px 13px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; animation: bubIn .3s ease both; }
.bub.in { align-self: flex-start; background: #26262e; border-bottom-left-radius: 5px; }
.bub.out { align-self: flex-end; background: var(--blue); border-bottom-right-radius: 5px; }
.bub.small { font-size: 13.5px; padding: 6px 11px; }
.stk-big { font-size: 44px; line-height: 1; }
.bub.out:has(.stk-big) { background: none; }
.th-note { align-self: center; font-size: 12px; color: var(--yellow); padding: 4px 8px; }
.bub.links { display: flex; flex-direction: column; gap: 6px; max-width: 88%; }
.lnk { border: 0; background: rgba(10, 132, 255, .15); color: #6cb6ff; text-decoration: underline; text-align: left; padding: 10px 12px; min-height: 44px; border-radius: 12px; font-size: 14px; cursor: pointer; word-break: break-all; }
.lnk2 { display: block; margin: 10px auto 0; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--sub); font-size: 14px; text-decoration: underline; cursor: pointer; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.vplay { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: #111; font-size: 16px; cursor: pointer; }
.vbar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; background: #fff; transition: width .35s linear; }
.vlen { font-size: 12px; color: var(--sub); }
.vspeed { min-height: 44px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; background: none; color: #fff; font-size: 12px; cursor: pointer; }
.vspeed.on { background: #fff; color: #111; }
.unread { align-self: center; position: sticky; top: 0; z-index: 1; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--blue); color: #fff; font-weight: 700; cursor: pointer; }
.th-compose { flex: none; border-top: 1px solid var(--line); background: #17171d; padding: 6px 8px 8px; }
.th-suggest { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; min-height: 50px; }
.chip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .2); background: #23232b; color: #fff; font-size: 14.5px; cursor: pointer; animation: fade .2s ease both; }
.th-row { display: flex; align-items: center; gap: 6px; }
.th-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #23232b; font-size: 20px; cursor: pointer; }
.th-input { flex: 1; min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .18); font-size: 15px; overflow: hidden; }
.th-input .ph { color: rgba(255, 255, 255, .35); }
.th-clear { margin-left: auto; border: 0; background: none; color: var(--sub); min-width: 32px; min-height: 32px; cursor: pointer; }
.th-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--blue); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; }
.th-send[disabled] { background: #2c2c34; color: #666; }
.th-palette { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 8px 0 2px; }
.stk { width: 64px; height: 64px; font-size: 38px; border: 0; border-radius: 16px; background: #23232b; cursor: pointer; }
.locmap { width: 100%; height: 70px; border-radius: 12px; background: repeating-linear-gradient(45deg, #1f2a24 0 12px, #23302a 12px 24px); display: grid; place-items: center; color: var(--blue); font-size: 20px; }
.paybox { width: 100%; text-align: center; font-size: 28px; font-weight: 800; padding: 8px; }

/* work chat */
.wk-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; background: #1a1622; }
.wk-msg { display: flex; gap: 10px; animation: bubIn .3s ease both; }
.wk-av { flex: none; width: 36px; height: 36px; border-radius: 8px; background: #ff9f0a; color: #231c00; display: grid; place-items: center; font-weight: 800; }
.wk-msg b { font-size: 14px; } .wk-msg small { color: var(--sub); font-size: 11px; }
.wk-msg p { margin: 2px 0 0; font-size: 15px; line-height: 1.45; }
.wk-react { display: flex; gap: 6px; padding-left: 46px; }
.rx { min-width: 48px; min-height: 40px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .2); background: #2a2433; font-size: 18px; cursor: pointer; }
.rx.on { border-color: var(--blue); background: rgba(10, 132, 255, .25); }
.wk-huddle { display: flex; flex-direction: column; gap: 8px; margin-left: 46px; padding: 12px; border-radius: 12px; border: 1px solid rgba(48, 209, 88, .4); background: rgba(48, 209, 88, .08); font-size: 14px; }

/* calls */
.call-scr { flex: 1; display: flex; flex-direction: column; padding: 28px 20px 18px; }
.cl-top { text-align: center; }
.cl-sub { color: var(--sub); font-size: 14px; }
.cl-name { font-size: 34px; font-weight: 600; margin-top: 6px; }
.cl-state { color: var(--sub); font-size: 16px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cl-state.ring { animation: blink 1.2s steps(2, start) infinite; }
.cl-extra { margin-top: auto; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.cl-small { min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .15); color: #fff; font-size: 14px; cursor: pointer; }
.cl-round { display: flex; justify-content: space-around; margin-top: 26px; }
.cl-round > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.cl-round.one { justify-content: center; margin-top: auto; }
.rb { width: 72px; height: 72px; border-radius: 50%; border: 0; font-size: 30px; color: #fff; cursor: pointer; }
.rb.red { background: var(--red); transform: rotate(135deg); }
.rb.green { background: var(--green); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.cl-lines { margin: 22px 0 0; min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.cl-lines p { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 15px; animation: bubIn .3s ease both; }
.cl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.cg { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 20px; cursor: pointer; }
.cg span { font-size: 11px; color: var(--sub); }
.cg[disabled] { opacity: .5; }
.cl-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pk { min-height: 48px; border: 0; border-radius: 24px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; cursor: pointer; }
.cl-memo { margin-top: 10px; padding: 10px; border-radius: 10px; background: #fff8c4; color: #333; font-size: 14px; }

/* forms */
.fm-body { flex: 1; overflow-y: auto; padding: 12px 14px 30px; -webkit-overflow-scrolling: touch; background: #f2f2f7; color: #1c1c1e; }
.apps.form .ap-head { background: #fff; color: #111; border-color: #ddd; }
.fm-lead { font-size: 13px; color: #666; margin: 0 0 10px; }
.fm-sec { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 14px; transition: opacity .3s; }
.fm-sec h3 { margin: 0 0 8px; font-size: 15px; }
.fm-sec.locked { opacity: .4; pointer-events: none; }
.fm-sec.done { opacity: .7; }
.fm-field { padding: 8px 0; border-bottom: 1px solid #eee; cursor: pointer; min-height: 52px; }
.fm-field label { display: block; font-size: 12px; color: #666; }
.fm-field em { color: var(--red); font-style: normal; margin-left: 2px; }
.fm-val { min-height: 26px; padding: 4px 8px; margin-top: 3px; border-radius: 8px; background: #f2f2f7; font-size: 15px; }
.fm-val .ph { color: #aaa; }
.fm-field.ok .fm-val { background: #eaf6ee; }
.fm-field.bad .fm-val { background: #ffecec; }
.fm-err { color: var(--red); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.fm-next { margin-top: 12px; }
.fm-out { margin-top: 8px; font-size: 13px; color: #333; }
.fm-terms { height: 140px; overflow-y: auto; font-size: 12px; line-height: 1.6; color: #444; background: #f7f7f9; border-radius: 8px; padding: 8px 10px; }
.fm-terms p { margin: 0 0 6px; }
.fm-hint { font-size: 12px; color: #888; margin-top: 4px; }
.fm-sec .lnk2 { color: #0a6cff; margin: 4px 0 0; }
.fm-check { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 0; background: none; color: #111; font-size: 15px; cursor: pointer; padding: 0; }
.fm-check .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #999; display: grid; place-items: center; }
.fm-check.on .box { background: var(--blue); border-color: var(--blue); }
.fm-check.on .box::after { content: "✓"; color: #fff; font-size: 14px; }
.fm-check[disabled] { opacity: .4; }

/* app store, camera, tag map */
.apps.store { background: #fff; color: #111; }
.apps.store .ap-head { background: #fff; border-color: #eee; }
.st-page { display: flex; gap: 14px; padding: 18px; }
.st-ic { width: 96px; height: 96px; border-radius: 22px; background: linear-gradient(135deg, #64d2ff, #0a84ff); display: grid; place-items: center; font-size: 46px; }
.st-name { font-weight: 800; font-size: 20px; } .st-sub { color: #888; font-size: 13px; margin: 2px 0 10px; }
.st-get { min-height: 36px; min-width: 88px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--blue); color: #fff; font-weight: 800; cursor: pointer; }
.st-desc { padding: 0 18px; color: #444; font-size: 14px; line-height: 1.6; }
.st-prog { margin: 18px; height: 6px; border-radius: 3px; background: #eee; overflow: hidden; }
.st-prog i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s linear; }
.cam { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #ccc; font-size: 14px; padding: 0 20px; text-align: center; }
.cam-frame { width: 200px; height: 200px; border: 3px solid #fff; border-radius: 22px; display: grid; place-items: center; font-size: 80px; color: #444; }
.cam-frame.scanning { border-color: var(--green); animation: pulse .5s ease-in-out infinite; }
.cam-bar { padding: 14px; }
.tg-map { position: relative; flex: 1; min-height: 170px; overflow: hidden; background: #1e2a22; }
.tg-rail { position: absolute; left: -10%; right: -10%; top: 45%; height: 6px; background: repeating-linear-gradient(90deg, #9a9aa0 0 14px, #3a3a40 14px 28px); transform: rotate(-12deg); }
.tg-road { position: absolute; left: 30%; top: 0; bottom: 0; width: 18px; background: #2c3a30; }
.tg-me { position: absolute; left: 22%; top: 50%; color: var(--blue); font-size: 22px; filter: drop-shadow(0 0 8px var(--blue)); }
.tg-pin { position: absolute; left: 30%; top: 30%; font-size: 30px; transition: transform .12s linear; }
.tg-map.chase { animation: chase 3s ease-in-out forwards; }
@keyframes chase { to { transform: scale(1.6) translateX(-20%); } }
.tg-sheet { flex: none; padding: 14px; background: #17171d; border-top: 1px solid var(--line); }
.tg-item { font-size: 18px; } .tg-sub { color: var(--sub); font-size: 13px; margin: 2px 0 10px; }
.tg-btns { display: flex; flex-direction: column; gap: 8px; }

/* alerts */
.al-wrap { flex: 1; display: grid; place-items: center; }
.al { width: 280px; border-radius: 14px; background: rgba(50, 50, 58, .97); text-align: center; overflow: hidden; animation: pop .28s cubic-bezier(.2, .9, .3, 1.2) both; }
.al-t { font-weight: 700; font-size: 16px; padding: 18px 16px 4px; } .al-b { font-size: 13.5px; padding: 0 16px 14px; color: rgba(255, 255, 255, .85); line-height: 1.45; }
.al-btn { display: block; width: 100%; min-height: 46px; border: 0; border-top: 1px solid rgba(255, 255, 255, .16); background: none; color: var(--blue); font-size: 16px; cursor: pointer; }
.al-btn.b { font-weight: 700; }
.quake .al { background: #3a0d0d; border: 2px solid var(--red); }
.quake .al-t { color: #ff6b61; }

/* generic app & scene */
.ap-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 18px 16px; text-align: center; }
.ap-t { font-weight: 800; font-size: 19px; } .ap-b { color: var(--sub); font-size: 14.5px; line-height: 1.55; margin-bottom: 4px; }
.ap-scene { flex: none; padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed rgba(255, 255, 255, .15); }
.ap-scene-h { font-size: 12px; color: var(--sub); }
.hero-emoji { font-size: 64px; line-height: 1.1; margin-top: 4px; }
.hero-qr { align-self: center; width: 150px; height: 150px; padding: 12px; border-radius: 12px; background: #fff; }
.hero-qr i { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(90deg, #000 0 6px, #fff 6px 9px, #000 9px 11px, #fff 11px 16px); }
.hero-route { position: relative; height: 110px; border-radius: 14px; background: #1e2a22; overflow: hidden; }
.hero-route i { position: absolute; left: 12%; right: 20%; top: 60%; height: 5px; background: var(--blue); border-radius: 3px; transform: rotate(-8deg); }
.hero-route b { position: absolute; right: 12%; top: 30%; font-size: 28px; }
.hero-quiz { display: flex; gap: 8px; justify-content: center; }
.hero-quiz span { width: 70px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: #ff9f0a; color: #231c00; }
.hero-count { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--yellow); }
.hero-radar { position: relative; height: 110px; border-radius: 14px; background: #10202e; overflow: hidden; }
.hero-radar i { position: absolute; width: 90px; height: 60px; border-radius: 50%; background: rgba(64, 156, 255, .5); filter: blur(6px); animation: drift 3s linear infinite; }
.hero-radar i:nth-child(2) { left: 40%; top: 30%; background: rgba(255, 214, 10, .45); animation-delay: -1s; }
.hero-radar i:nth-child(3) { left: 10%; top: 50%; animation-delay: -2s; }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
.hero-cam { height: 150px; border-radius: 14px; background: #000; display: grid; place-items: center; font-size: 70px; border: 2px solid #333; }

/* tabs in collection */
.tabs { display: flex; gap: 6px; margin: 24px 0 10px; }
.sheet-head .tabs { margin: 0; }
.tab { min-height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .08); color: var(--sub); font-weight: 700; font-size: 14px; cursor: pointer; }
.tab.on { background: #fff; color: #111; }
