:root{
  --purple:#7A3CE6; --purple-deep:#5B22C9; --lav:#C2A9F5; --lav-dk:#8A5AE6;
  --bg:#F4F3F7; --panel:#fff; --well:#E3E2E8; --track:#E4E2EA;
  --ink:#1E1C24; --gray:#8D8B95; --hair:#CFCDD6; --sheet-gray:#E7E6EA;
  --font: -apple-system, "SF Pro Text", "Inter", system-ui, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;background:var(--bg);overscroll-behavior:none}
body{font-family:var(--font);color:var(--ink);-webkit-font-smoothing:antialiased;
  -webkit-user-select:none;user-select:none;overflow:hidden}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;text-align:inherit}
.ico{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- shared purple surfaces ---------- */
.pattern{position:absolute;inset:0;background:url(img/pattern.png) 0 0/72px 72px repeat;opacity:.09;pointer-events:none}
.shine{position:absolute;inset:0;pointer-events:none;mix-blend-mode:screen;
  background:
    linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,0) 50%),
    linear-gradient(135deg,rgba(255,255,255,0) 25%,rgba(255,255,255,.16) 42%,rgba(255,255,255,0) 58%),
    radial-gradient(circle at 50% 50%,rgba(196,140,255,.45),rgba(196,140,255,0) 60%)}
.shine.soft{opacity:.8}

/* ---------- splash ---------- */
.splash{position:fixed;inset:0;z-index:50;display:grid;place-items:center;overflow:hidden;
  background:linear-gradient(180deg,#9A4BF2,#7A34E8 55%,#6A28DE);transition:opacity .35s ease-out}
.splash.hide{opacity:0;pointer-events:none}
.splash-brand{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;transform:translateY(-20px);
  animation:pop .6s cubic-bezier(.3,1.4,.5,1) both}
.splash-logo{width:140px;height:140px;filter:drop-shadow(0 5px 10px rgba(58,14,140,.35))}
.wordmark{font-family:var(--rounded);font-weight:600;font-size:44px;letter-spacing:-.5px;color:#fff}
@keyframes pop{from{opacity:0;transform:translateY(-20px) scale(.92)}}

/* ---------- screens / navigation ---------- */
#app{position:fixed;inset:0;overflow:hidden}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--bg);
  transition:transform .35s cubic-bezier(.32,.72,0,1);will-change:transform}
#dashboard{transform:translateX(0)}
#dashboard.behind{transform:translateX(-30%)}
#savings{transform:translateX(calc(100% + 32px));background:var(--sheet-gray);box-shadow:-8px 0 24px rgba(0,0,0,.08)}
#savings.active{transform:translateX(0)}

/* ---------- dashboard ---------- */
.topbar{display:flex;align-items:center;justify-content:space-between;background:var(--panel);
  padding:calc(env(safe-area-inset-top) + 10px) 18px 10px}
.mark{width:32px;height:32px;background:var(--purple);
  -webkit-mask:url(img/logo.png) center/contain no-repeat;mask:url(img/logo.png) center/contain no-repeat}
.avatars{display:flex}
.av{width:32px;height:32px;border-radius:50%;border:2px solid #fff;position:relative;overflow:hidden}
.av+.av{margin-left:-10px}
.av1{background:#9FB4C7}.av2{background:#F2B8C6}
.av::before{content:"";position:absolute;left:50%;top:7px;width:15px;height:15px;margin-left:-7.5px;border-radius:50%;
  background:#C99A7A;box-shadow:0 -5px 0 -1px #2A211C}
.av::after{content:"";position:absolute;left:50%;bottom:-6px;width:22px;height:14px;margin-left:-11px;border-radius:9px;background:#C99A7A}
.av2::before{background:#D8A486;box-shadow:0 -5px 0 -1px #3A2620}.av2::after{background:#D8A486}

.scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:8px 14px calc(24px + env(safe-area-inset-bottom));
  display:flex;flex-direction:column;gap:12px}

/* Balance card — sized like the in-game card (~1.6:1, big right-aligned balance, giant "b" watermark) */
.card{position:relative;overflow:hidden;aspect-ratio:1.62;min-height:200px;border-radius:22px;padding:18px 18px 16px;color:#fff;
  display:flex;flex-direction:column;
  background:linear-gradient(135deg,#B070F8,#8A45EE 50%,#6E2FE0);border:1.5px solid rgba(91,34,201,.45);
  box-shadow:0 6px 18px rgba(91,34,201,.22)}
.card>*{position:relative;z-index:1}
.card .pattern,.card .shine,.card .card-b{position:absolute;z-index:0}
.card-b{width:78%;aspect-ratio:1;left:-6%;top:12%;opacity:.17;background:#fff;
  -webkit-mask:url(img/logo.png) center/contain no-repeat;mask:url(img/logo.png) center/contain no-repeat}
.card-word{font-family:var(--rounded);font-weight:600;font-size:24px;letter-spacing:-.3px;opacity:.85}
.card-balance{margin-top:auto;text-align:right;font-weight:700;font-size:clamp(44px,15vw,60px);letter-spacing:-1.5px;line-height:1;
  margin-bottom:14px;text-shadow:0 2px 8px rgba(60,10,140,.25)}

.pill{display:flex;align-items:center;gap:8px;height:34px;padding:0 14px;border-radius:999px;font-size:15px;font-weight:500;width:100%}
.pill.light{border:1.5px solid rgba(255,255,255,.9);height:40px;font-size:17px;background:rgba(255,255,255,.06)}
.pill.light .ico{width:20px;height:20px}
.pill.dark{border:1.2px solid var(--hair);color:var(--ink)}
.ico.pig{width:20px}

.savings{display:flex;flex-direction:column;align-items:center;gap:10px;padding:10px 10px 14px;border-radius:18px;
  background:var(--panel);border:1.5px solid rgba(122,60,230,.55);transition:transform .25s cubic-bezier(.3,1.3,.5,1)}
.savings:active,.perks:active,.btn:active{transform:scale(.97)}
.well{width:100%;height:150px;border-radius:14px;background:var(--well);display:grid;place-items:center}
.sv-amount{font-size:26px;font-weight:700;color:var(--purple);margin-top:2px}
.bar{width:170px;height:5px;border-radius:9px;background:var(--track);overflow:hidden}
.bar span{display:block;height:100%;border-radius:9px;background:var(--purple);transition:width .4s}
.sv-next{font-size:14px;color:var(--gray)}
.savings .pill{margin-top:2px}

/* ATM Finder */
.atm{display:flex;flex-direction:column;gap:10px;padding:12px 10px 12px;border-radius:18px;background:var(--panel);
  border:2px solid #4A4458;transition:transform .25s}
.atm:active,.faq:active{transform:scale(.97)}
.atm-top{display:flex;align-items:flex-end;justify-content:space-between;padding:0 6px 0 8px}
.atm-ico{width:52px;height:52px;fill:none;stroke:var(--purple);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.atm-title{font-size:22px;font-weight:800;letter-spacing:-.3px;margin-bottom:2px}

/* FAQs */
.faqs{display:flex;flex-direction:column;gap:8px;margin-top:2px}
.faqs-label{font-size:14px;font-weight:600;color:#4A4752;padding-left:4px}
.faq{display:flex;align-items:center;justify-content:space-between;height:48px;padding:0 10px 0 14px;border-radius:10px;
  background:var(--panel);border:1px solid rgba(207,205,214,.7);font-size:15px;transition:transform .25s}
.faq-chev{width:28px;height:28px;display:grid;place-items:center;border-radius:6px;background:#F1F0F4}
.faq-chev svg{width:16px;height:16px;fill:none;stroke:#4A4752;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- family savings ---------- */
.fs-bar{position:relative;display:flex;align-items:center;justify-content:center;height:52px;
  margin-top:env(safe-area-inset-top)}
.fs-bar h1{font-size:17px;font-weight:600;color:var(--purple)}
.back{position:absolute;left:6px;top:4px;width:44px;height:44px;display:grid;place-items:center}
.back svg{width:22px;height:22px;fill:none;stroke:var(--purple);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.fs-body{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 22px 24px}
.fs-card{width:100%;margin-top:14px;padding:18px 0;border-radius:16px;background:rgba(255,255,255,.85);
  display:flex;flex-direction:column;align-items:center;gap:10px}
.fs-amount{font-size:26px;font-weight:700}
.fs-status{font-size:14px;font-weight:500;color:rgba(30,28,36,.75);height:26px;line-height:24px;padding:0 12px;
  border:1.2px solid var(--hair);border-radius:999px}
.dots{display:flex;gap:12px;margin-top:2px}
.dot{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;border:1.5px solid rgba(122,60,230,.6);color:rgba(122,60,230,.75)}
.dot.on{background:var(--purple);border-color:var(--purple);color:#fff}
.dot svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fs-note{font-size:14px;color:var(--gray)}

.sheet{background:#F7F6F9;border-radius:22px 22px 0 0;box-shadow:0 -2px 8px rgba(0,0,0,.06);
  padding:0 18px calc(12px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px}
.grabber{width:40px;height:4px;border-radius:4px;background:var(--hair);margin:8px auto 6px}
.btn{height:46px;border-radius:10px;font-size:16px;font-weight:600;text-align:center;transition:transform .25s}
.btn.primary{background:var(--purple);color:#fff;border:1.5px solid var(--purple-deep)}
.btn.secondary{background:#fff;color:var(--ink);border:1px solid var(--hair)}

/* ---------- mascot ---------- */
.mascot-slot[data-size=dash] svg{width:112px;height:112px}
.mascot-slot[data-size=big] svg{width:150px;height:150px}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
