:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #a7b0bd;
  --line: rgba(255,255,255,.12);
  --panel: rgba(16,20,27,.78);
  --gold: #ffd36f;
  --green: #6ee7b7;
  --red: #ff7b7b;
  --blue: #86c5ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif; background: #11151d; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,211,111,.22), transparent 26%),
    radial-gradient(circle at 78% 16%, rgba(110,231,183,.16), transparent 24%),
    linear-gradient(145deg, #161b24, #07090d 60%, #15100b);
}

.phone {
  position: relative;
  width: min(430px, 100%);
  height: min(900px, calc(100svh - 28px));
  min-height: 690px;
  border: 10px solid #050608;
  border-radius: 38px;
  overflow: hidden;
  background: #050608;
  box-shadow: 0 26px 80px rgba(0,0,0,.58), inset 0 0 0 1px rgba(255,255,255,.08);
}

.sensor {
  position: absolute;
  z-index: 20;
  top: 10px;
  left: 50%;
  width: 118px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: #050608;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .35s ease;
}
.screen.active { opacity: 1; pointer-events: auto; }
.screen.unlocking { transform: translateY(-22px) scale(1.03); opacity: 0; }

.boot-screen {
  z-index: 12;
  display: grid;
  place-content: center;
  gap: 14px;
  justify-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at center 32%, rgba(255,211,111,.18), transparent 32%),
    linear-gradient(160deg, #050608, #121820 55%, #0b0d10);
}
.boot-logo {
  width: 82px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #191006;
  background: linear-gradient(135deg, #fff0b8, #c99327);
  font-size: 46px;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(255,211,111,.22);
}
.boot-title { font-size: 21px; font-weight: 800; }
.boot-copy { color: var(--muted); font-size: 14px; }
.boot-bar {
  width: 180px;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.12);
}
.boot-bar span {
  display: block;
  height: 100%;
  width: 48%;
  border-radius: inherit;
  background: var(--gold);
  animation: booting 1.8s ease forwards;
}
@keyframes booting { to { width: 100%; } }

.lock-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 54px 24px 30px;
  background:
    linear-gradient(rgba(5,6,8,.22), rgba(5,6,8,.46)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='1400' viewBox='0 0 900 1400'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%230b141d'/%3E%3Cstop offset='.45' stop-color='%23203136'/%3E%3Cstop offset='1' stop-color='%2371541b'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='900' height='1400' fill='url(%23g)'/%3E%3Cpath d='M0 870 C180 740 290 810 450 675 C612 538 750 560 900 420 L900 1400 L0 1400Z' fill='%23080a0f' opacity='.72'/%3E%3Ccircle cx='665' cy='285' r='115' fill='%23ffd36f' opacity='.23'/%3E%3Cpath d='M145 1030 L268 830 L385 1030Z M335 1030 L485 755 L638 1030Z M575 1030 L705 805 L838 1030Z' fill='%23f4d48b' opacity='.12'/%3E%3C/svg%3E") center/cover;
}

.lock-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.12) 48%, transparent 68%);
  transform: translateX(-80%);
  animation: shine 5s infinite;
}
@keyframes shine { 45%,100% { transform: translateX(80%); } }

.lock-top { width: 100%; display: flex; justify-content: space-between; color: rgba(255,255,255,.88); font-size: 15px; }
.lock-time { margin-top: 70px; font-size: 78px; font-weight: 700; letter-spacing: 0; line-height: 1; }
.lock-date { margin-top: 10px; color: rgba(255,255,255,.76); }
.lock-balance {
  margin-top: auto;
  width: 100%;
  padding: 20px;
  border: 1px solid rgba(255,211,111,.35);
  border-radius: 26px;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}
.lock-balance span { display: block; color: var(--muted); margin-bottom: 8px; }
.lock-balance strong { display: block; font-size: clamp(26px, 8vw, 40px); color: var(--gold); overflow-wrap: anywhere; }
.unlock {
  width: 100%;
  margin-top: 18px;
  padding: 15px 18px;
  border: 0;
  border-radius: 18px;
  color: #171109;
  font-weight: 800;
  background: linear-gradient(135deg, #ffe9a8, #d6a742);
}

.os-screen {
  display: flex;
  flex-direction: column;
  transform: scale(.96);
  background:
    linear-gradient(rgba(9,12,18,.18), rgba(9,12,18,.42)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='1400' viewBox='0 0 900 1400'%3E%3Crect width='900' height='1400' fill='%230a0d12'/%3E%3Cpath d='M0 285 C175 215 230 365 410 288 C618 200 670 95 900 145 L900 0 L0 0Z' fill='%23314f55'/%3E%3Cpath d='M0 1185 C225 1060 312 1140 485 1012 C642 896 722 900 900 792 L900 1400 L0 1400Z' fill='%23725628' opacity='.68'/%3E%3Ccircle cx='715' cy='380' r='150' fill='%23d7b46a' opacity='.18'/%3E%3Cpath d='M120 1040 h660 v70 h-660z M185 915 h92 v125 h-92z M360 840 h110 v200 h-110z M562 890 h130 v150 h-130z' fill='%23ffffff' opacity='.08'/%3E%3C/svg%3E") center/cover;
}
.os-screen.active { transform: scale(1); }

.status-bar {
  height: 48px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 22px 8px;
  font-size: 13px;
  font-weight: 700;
}

.home { display: none; flex: 1; padding: 10px 18px 92px; overflow: auto; }
.home.active { display: block; }
.wealth-widget {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(10,13,18,.54);
  backdrop-filter: blur(16px);
}
.wealth-widget span, .wealth-widget small { display: block; color: var(--muted); }
.wealth-widget strong { display: block; margin: 8px 0; color: var(--gold); font-size: clamp(25px, 7vw, 34px); overflow-wrap: anywhere; }
.billionaire-os-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255,211,111,.28);
  background:
    linear-gradient(135deg, rgba(255,211,111,.16), rgba(134,197,255,.08)),
    rgba(9,12,18,.72);
}
.billionaire-os-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 10%, rgba(255,255,255,.1) 42%, transparent 62%);
  transform: translateX(-80%);
  animation: shine 7s infinite;
  pointer-events: none;
}
.os-kicker {
  position: relative;
  margin-bottom: 16px;
  color: #fff7d6 !important;
  font-size: 18px;
  font-weight: 900;
}
.os-metric, .os-dashboard { position: relative; }
.os-balance { margin-bottom: 14px; }
.os-balance small { margin-bottom: 5px; }
.os-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.os-dashboard div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}
.os-dashboard small { margin-bottom: 5px; font-size: 12px; }
.os-dashboard b {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.os-dashboard div:first-child b { color: var(--green); }

.mood-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 18px; }
.mood-strip div { min-width: 0; padding: 10px 6px; border-radius: 8px; background: rgba(255,255,255,.1); text-align: center; }
.mood-strip span { display: block; color: var(--muted); font-size: 12px; }
.mood-strip b { font-size: 19px; }

.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 12px; }
.app-icon { position: relative; border: 0; background: transparent; color: #fff; display: grid; justify-items: center; gap: 7px; min-width: 0; }
.app-icon i {
  position: relative;
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-style: normal;
  font-size: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 24px rgba(0,0,0,.18);
}
.app-icon span { width: 100%; font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-badge {
  position: absolute;
  top: -5px;
  right: calc(50% - 34px);
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid rgba(8,10,14,.9);
  border-radius: 999px;
  color: #fff;
  background: #ff3b30;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.app-note {
  width: 100%;
  margin-top: -5px;
  color: rgba(255,255,255,.76);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 66px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(10,13,18,.62);
  backdrop-filter: blur(18px);
}
.dock button { border: 0; border-radius: 16px; color: #fff; background: rgba(255,255,255,.1); font-size: 13px; }

.app-view {
  display: none;
  flex: 1;
  padding-bottom: 82px;
  min-height: 0;
  animation: appIn .24s ease;
}
.app-view.active { display: flex; flex-direction: column; }
@keyframes appIn { from { transform: translateY(18px) scale(.98); opacity: .3; } }

.app-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 10px;
}
.app-header strong, .app-header span { display: block; }
.app-header span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.icon-btn {
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.1);
  font-size: 24px;
}

.app-content { flex: 1; min-height: 0; overflow: auto; padding: 0 16px 14px; }
.panel, .list-row, .message, .product, .post, .call-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12,16,23,.74);
  backdrop-filter: blur(14px);
}
.panel { padding: 14px; margin-bottom: 12px; }
.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  color: #fff;
  text-align: left;
}
.avatar { width: 44px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, #253245, #6d5630); }
.grow { flex: 1; min-width: 0; }
.grow strong, .grow span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow span, .meta { color: var(--muted); font-size: 12px; }

.search { width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; color: #fff; background: rgba(255,255,255,.09); outline: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: #fff; background: rgba(255,255,255,.08); }
.chip.active { color: #201709; background: var(--gold); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product { overflow: hidden; }
.product-art { height: 116px; display: grid; place-items: center; font-size: 46px; background: linear-gradient(135deg, rgba(134,197,255,.2), rgba(255,211,111,.2)); }
.product-art::after {
  content: "";
  width: 72%;
  height: 1px;
  align-self: end;
  margin-bottom: 18px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
}
.product-body { padding: 10px; }
.product h3 { margin: 0 0 5px; font-size: 15px; }
.product p { min-height: 34px; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.buy-btn, .primary-btn, .danger-btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  font-weight: 800;
}
.buy-btn, .primary-btn { color: #181008; background: linear-gradient(135deg, #ffe7a0, #d5a33d); }
.danger-btn { color: white; background: rgba(255,123,123,.28); border: 1px solid rgba(255,123,123,.45); }

.message-list { display: grid; gap: 8px; }
.message { padding: 10px 12px; max-width: 88%; }
.message.me { justify-self: end; background: rgba(110,231,183,.18); }
.message.system { max-width: 100%; color: var(--gold); text-align: center; background: rgba(255,211,111,.1); }
.reply-grid { display: grid; gap: 8px; margin-top: 12px; }
.reply-grid button { border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: #fff; background: rgba(255,255,255,.08); text-align: left; }

.stat-line { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.stat-line:last-child { border-bottom: 0; }
.money { color: var(--gold); font-weight: 800; overflow-wrap: anywhere; }
.good { color: var(--green); }
.bad { color: var(--red); }

.post { padding: 12px; margin-bottom: 10px; }
.post img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; background: #1d2633; }
.post p { margin: 8px 0 0; color: #e7edf5; }
.sms-item { align-items: flex-start; }
.sms-time { align-self: start; color: var(--muted); font-size: 11px; white-space: nowrap; }
.badge { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; color: #1c1206; background: var(--gold); font-size: 12px; font-weight: 900; }
.call-card { padding: 18px; text-align: center; }
.call-card .avatar { margin: 0 auto 10px; width: 74px; font-size: 28px; }

.news-card {
  padding: 13px;
  margin-bottom: 10px;
}
.news-card h3 { margin: 0 0 7px; font-size: 16px; }
.news-card p { margin: 0; color: #dce5ef; line-height: 1.45; }
.rank-hero {
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,211,111,.22), rgba(134,197,255,.14));
  border: 1px solid rgba(255,211,111,.28);
}
.rank-hero span { color: var(--muted); }
.rank-hero strong { display: block; margin-top: 5px; color: var(--gold); font-size: 42px; line-height: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  max-width: min(360px, calc(100% - 28px));
  padding: 12px 16px;
  border-radius: 999px;
  color: #171009;
  background: #ffe7a0;
  box-shadow: 0 16px 50px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: .24s ease;
  font-weight: 800;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.payment-layer, .intro-layer, .redeem-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3,5,8,.45);
  opacity: 0;
  pointer-events: none;
  transition: .24s ease;
  backdrop-filter: blur(8px);
}
.redeem-layer {
  z-index: 120;
  opacity: 1;
  pointer-events: auto;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,211,111,.18), transparent 28%),
    rgba(3,5,8,.84);
}
.redeem-layer.hidden { opacity: 0; pointer-events: none; }
.payment-layer.show, .intro-layer.show { opacity: 1; pointer-events: auto; }
.payment-card, .intro-card, .redeem-card {
  width: min(360px, 100%);
  border: 1px solid rgba(255,211,111,.35);
  border-radius: 8px;
  background: rgba(10,13,18,.92);
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  text-align: center;
}
.payment-card {
  padding: 28px 22px;
  transform: scale(.88);
  transition: .24s ease;
}
.payment-layer.show .payment-card { transform: scale(1); }
.payment-ring {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 999px;
  color: #161006;
  background: var(--gold);
  font-size: 36px;
  font-weight: 900;
  animation: payPulse .75s ease infinite alternate;
}
@keyframes payPulse { to { transform: scale(1.08); box-shadow: 0 0 34px rgba(255,211,111,.42); } }
.payment-card strong { display: block; font-size: 24px; }
.payment-card span { display: block; margin-top: 6px; color: var(--muted); }
.purchase-detail {
  display: none;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.12);
  text-align: left;
}
.payment-card.special .purchase-detail { display: block; }
.purchase-detail h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 18px;
}
.purchase-detail .stat-line { padding: 8px 0; }
.purchase-detail .secretary-preview {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  color: #eaf2fb;
  background: rgba(134,197,255,.1);
  line-height: 1.45;
}
.intro-card { padding: 24px 20px; text-align: left; }
.redeem-card { padding: 24px 20px; text-align: left; }
.intro-kicker { color: var(--gold); font-size: 13px; font-weight: 800; }
.intro-card h1, .redeem-card h1 { margin: 8px 0; font-size: 28px; line-height: 1.08; }
.intro-card p, .redeem-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.redeem-card small { display: block; margin-top: 10px; color: var(--muted); }
.redeem-card small.error { color: var(--red); }
.redeem-card small.good { color: var(--green); }
.name-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.08);
  outline: 0;
}
.name-input:focus { border-color: rgba(255,211,111,.7); box-shadow: 0 0 0 3px rgba(255,211,111,.12); }

@media (max-width: 390px) {
  .stage { padding: 0; }
  .phone { width: 100%; height: 100svh; min-height: 620px; border: 0; border-radius: 0; }
  .app-grid { gap: 16px 8px; }
  .app-icon i { width: 54px; border-radius: 15px; }
  .grid-two { grid-template-columns: 1fr; }
}
