/* Layout: one phone column, airy white surfaces, floating pill tab bar; energy comes from the flame accent and motion. */
:root {
  --bg: #ffffff;
  --ground: #f4f5fa;
  --ink: #12142a;
  --muted: #7d8199;
  --line: #eceef6;
  --flame: #ff5a2c;
  --flame-soft: #fff1ec;
  --gold: #ffb320;
  --gold-soft: #fff7e3;
  --mint: #10bf86;
  --mint-soft: #e7f9f2;
  --shadow: 0 10px 30px rgba(28, 30, 70, .08), 0 2px 6px rgba(28, 30, 70, .04);
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 15px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 12px; }
.app { max-width: 440px; margin: 0 auto; min-height: 100%; background: var(--bg); position: relative; overflow-x: hidden; }
.screen { padding-inline: 18px; padding-block: 18px 120px; display: grid; gap: 18px; }
[hidden] { display: none !important; }
.screen[hidden] { display: none !important; }
.screen > * { min-width: 0; }
.enter > * { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.enter > *:nth-child(2) { animation-delay: .05s } .enter > *:nth-child(3) { animation-delay: .1s }
.enter > *:nth-child(4) { animation-delay: .15s } .enter > *:nth-child(5) { animation-delay: .2s }
.enter > *:nth-child(6) { animation-delay: .25s } .enter > *:nth-child(7) { animation-delay: .3s }
@keyframes rise { from { opacity: .001; transform: translateY(14px) } to { opacity: 1; transform: none } }

h1, h2, .num { font-family: var(--display); letter-spacing: -.01em; text-wrap: balance; margin: 0; }
h2 { font-size: 17px; font-weight: 700; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.between { justify-content: space-between; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--ground); white-space: nowrap; }
.chip.gold { background: var(--gold-soft); color: #a86b00; }
.chip.flame { background: var(--flame-soft); color: var(--flame); }
.chip.mint { background: var(--mint-soft); color: #0a8a60; }

/* header */
.ava { width: 52px; height: 52px; border-radius: 50%; background: #fff; flex: none; padding: 3px;
  background-image: conic-gradient(from 200deg, var(--gold), var(--flame), var(--gold)); }
.ava img { width: 100%; height: 100%; border-radius: 50%; display: block; background: #fff; border: 2px solid #fff; }
.hello { min-width: 0; }
.hello b { display: block; font-size: 17px; font-family: var(--display); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xpbar { height: 8px; border-radius: 99px; background: var(--ground); overflow: hidden; margin-top: 8px; }
.xpbar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--flame)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }

/* streak hero */
.streak { position: relative; overflow: hidden; border-radius: 28px; padding: 20px; background: linear-gradient(160deg, #fff 0%, var(--flame-soft) 100%); border: 1px solid #ffe2d8; }
.streak .flame { width: 86px; height: 86px; position: absolute; right: 14px; top: 10px; filter: drop-shadow(0 12px 18px rgba(255, 90, 44, .35)); animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg) } 50% { transform: scale(1.06) rotate(2deg) } }
.streak .num { font-size: 56px; font-weight: 800; line-height: 1; color: var(--flame); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.day { display: grid; place-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: var(--muted); }
.dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px dashed #ffd3c6; display: grid; place-items: center; font-size: 13px; }
.dot.on { background: var(--flame); border: 0; color: #fff; box-shadow: 0 6px 14px rgba(255, 90, 44, .35); }
.dot.today { border: 2px solid var(--flame); }

/* challenges */
.list { display: grid; gap: 12px; }
.ch { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; }
.ring { width: 52px; height: 52px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ico { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; }
.ch b { display: block; font-weight: 800; font-size: 15px; }
.ch small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.check { width: 46px; height: 46px; border-radius: 16px; background: var(--ground); display: grid; place-items: center; font-size: 20px; transition: transform .15s, background .3s; }
.check:active { transform: scale(.92); }
.check.done { background: var(--mint); color: #fff; box-shadow: 0 8px 16px rgba(16, 191, 134, .35); animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.6) } 100% { transform: scale(1) } }
.perfect { display: grid; gap: 10px; }
.pbar { height: 10px; border-radius: 99px; background: var(--ground); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), #52e0ad); border-radius: inherit; transition: width .7s cubic-bezier(.2, .8, .2, 1); }

/* duel */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.duel img { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--line); }
.duel .score { font-family: var(--display); font-weight: 800; font-size: 30px; }
.duel .vs { width: 44px; height: 44px; margin: 0 auto; }
.tease { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ground); font-weight: 700; font-size: 13.5px; }

/* chest */
.chest { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: linear-gradient(135deg, var(--gold-soft), #fff); border-color: #ffe8b3; }
.chest img { width: 64px; animation: wobble 3s ease-in-out infinite; }
@keyframes wobble { 0%, 86%, 100% { transform: rotate(0) } 90% { transform: rotate(-8deg) } 94% { transform: rotate(8deg) } }
.btn { padding: 12px 16px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; min-width: 0; transition: transform .15s; }
.btn:active { transform: scale(.96); }
.btn.flame { background: var(--flame); box-shadow: 0 10px 20px rgba(255, 90, 44, .3); }
.btn.ghost { background: var(--ground); color: var(--ink); }

/* ranking */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--ground); border-radius: 16px; padding: 4px; position: relative; }
.seg button { padding: 10px; border-radius: 12px; font-weight: 800; font-size: 13px; position: relative; z-index: 1; color: var(--muted); transition: color .3s; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .knob { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--bg); border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; padding-top: 8px; }
.pod { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.pod img { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; box-shadow: var(--shadow); }
.pod.first img { width: 84px; height: 84px; border-color: var(--gold); }
.pod b { font-size: 13px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step { width: 100%; border-radius: 18px 18px 6px 6px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; color: #fff; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleY(.2) } to { transform: none } }
.prizes { display: flex; gap: 8px; flex-wrap: wrap; }
.rank { display: grid; grid-template-columns: 28px 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank img { width: 40px; height: 40px; border-radius: 50%; }
.rank .pos { font-family: var(--display); font-weight: 700; color: var(--muted); text-align: center; }
.rank.me { background: var(--flame-soft); border-radius: 16px; border-bottom-color: transparent; }
.rank .xp { font-weight: 800; font-variant-numeric: tabular-nums; }

/* shop */
.wallet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wallet .card { padding: 12px; text-align: center; border-radius: 20px; }
.wallet .num { font-size: 20px; font-weight: 800; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.item { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 16px 12px; }
.item .pv { width: 84px; height: 84px; display: grid; place-items: center; position: relative; }
.item .pv img { width: 66px; height: 66px; border-radius: 50%; }
.frame { position: absolute; inset: 0; border-radius: 50%; padding: 6px; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.f-gold { background: conic-gradient(#fff0a8, #d9a22a, #fff6cf, #b77e12, #fff0a8); }
.f-neon { background: conic-gradient(#00fff0, #b43cff, #ff3cc8, #00fff0); filter: drop-shadow(0 0 6px rgba(180, 60, 255, .6)); }
.f-fire { background: conic-gradient(#ffe65a, #ff781e, #e61e3c, #ff781e, #ffe65a); animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(1turn) } }
.theme-sw { width: 66px; height: 84px; border-radius: 14px; box-shadow: var(--shadow); }
.item b { font-size: 13.5px; font-weight: 800; }
.prices { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.price { padding: 7px 10px; border-radius: 12px; font-weight: 800; font-size: 12.5px; background: var(--ground); transition: transform .15s; }
.price:active { transform: scale(.94); }
.price.owned { background: var(--mint-soft); color: #0a8a60; }
.shelf { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.souv { flex: none; width: 64px; display: grid; justify-items: center; gap: 2px; padding: 10px 0; border-radius: 18px; background: var(--ground); font-weight: 800; font-size: 12px; }
.souv span { font-size: 28px; line-height: 1.1; }
.souv.locked { opacity: .35; filter: grayscale(1); }

/* profile */
.hero-p { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 6px; }
.hero-p .pv { width: 128px; height: 128px; position: relative; display: grid; place-items: center; }
.hero-p .pv img { width: 104px; height: 104px; border-radius: 50%; }
.hero-p .pv .frame { padding: 8px; }
.hero-p h1 { font-size: 22px; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: 20px; background: var(--ground); display: grid; gap: 2px; }
.stat .num { font-size: 24px; font-weight: 800; }
.stat small { color: var(--muted); font-weight: 700; font-size: 12px; }
.totals { display: flex; gap: 8px; flex-wrap: wrap; }
.tl { display: grid; gap: 0; }
.tl-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.tl-row:last-child { border-bottom: 0; }
.tl-row b { font-weight: 800; display: block; }
.tl-row small { color: var(--muted); font-weight: 600; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mint); justify-self: center; box-shadow: 0 0 0 4px var(--mint-soft); }
.tl-dot.live { background: var(--flame); box-shadow: 0 0 0 4px var(--flame-soft); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px var(--flame-soft) } }

/* tab bar */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: min(408px, calc(100% - 32px)); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 26px; padding: 6px; box-shadow: 0 16px 40px rgba(28, 30, 70, .14); z-index: 20; }
.tabs button { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 20px; font-size: 11px; font-weight: 800; color: var(--muted); position: relative; z-index: 1; transition: color .3s; }
.tabs button span { font-size: 20px; transition: transform .35s cubic-bezier(.2, 1.6, .4, 1); }
.tabs button[aria-current="page"] { color: var(--flame); }
.tabs button[aria-current="page"] span { transform: translateY(-2px) scale(1.12); }
.tabs .pill { position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); border-radius: 20px; background: var(--flame-soft); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }

/* overlays */
.splash { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 50; transition: opacity .5s, visibility .5s; }
.splash.gone { opacity: 0; visibility: hidden; }
.splash .logo { display: grid; justify-items: center; gap: 14px; }
.splash img { width: 110px; animation: ignite 1s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 16px 26px rgba(255, 90, 44, .4)); }
@keyframes ignite { from { transform: scale(.2) translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
.splash .word { font-family: var(--display); font-weight: 800; font-size: 26px; display: flex; gap: 1px; }
.splash .word i { font-style: normal; display: inline-block; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.splash .tag { color: var(--muted); font-weight: 700; animation: rise .6s .7s both; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center; background: rgba(18, 20, 42, .32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .3s both; }
.modal[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0 } }
.sheet { width: min(440px, 100%); background: var(--bg); border-radius: 30px 30px 0 0; padding: 26px 22px calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 12px; text-align: center; animation: up .5s cubic-bezier(.2, .8, .2, 1) both; position: relative; overflow: hidden; overflow: clip; max-height: 92vh; }
@keyframes up { from { transform: translateY(100%) } }
.sheet .big { width: 130px; position: relative; z-index: 1; }
.sheet .big.shake { animation: shake .6s ease-in-out 2; }
@keyframes shake { 25% { transform: rotate(-10deg) scale(1.05) } 75% { transform: rotate(10deg) scale(1.05) } }
.rays { position: absolute; top: -40px; left: 50%; width: 520px; height: 520px; margin-left: -260px; background: repeating-conic-gradient(var(--gold-soft) 0 10deg, transparent 10deg 20deg); border-radius: 50%; opacity: 0; transition: opacity .5s; animation: spin 18s linear infinite; }
.rays.on { opacity: 1; }
.sheet h2 { font-size: 22px; position: relative; z-index: 1; }
.sheet p { margin: 0; color: var(--muted); font-weight: 600; position: relative; z-index: 1; max-width: 32ch; }
.sheet .btn { width: 100%; position: relative; z-index: 1; padding: 15px; }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translate(-50%, calc(-100% - 60px)); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 18px; font-weight: 800; font-size: 14px; z-index: 60; transition: transform .45s cubic-bezier(.2, .8, .2, 1); max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.float { position: fixed; z-index: 45; font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 18px; pointer-events: none; animation: floatUp 1.1s ease-out both; text-shadow: 0 2px 8px rgba(255, 179, 32, .35); }
@keyframes floatUp { to { transform: translateY(-70px); opacity: 0 } }
canvas.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 55; }
.demo-note { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* live app additions */
.state { display: grid; place-items: center; text-align: center; gap: 14px; padding: 80px 24px; color: var(--muted); font-weight: 700; }
.state img { width: 84px; }
.empty { text-align: center; color: var(--muted); font-weight: 700; padding: 18px 8px; display: grid; gap: 12px; justify-items: center; }
.ch-main { min-width: 0; text-align: left; display: grid; gap: 2px; }
.ch-actions { display: flex; gap: 8px; align-items: center; }
.check.miss { background: #ffe9e4; color: var(--flame); font-size: 16px; }
.icebtn { height: 46px; padding: 0 12px; border-radius: 16px; background: #e8f4ff; color: #2a7ad8; font-weight: 800; font-size: 13px; }
.sheet .field { width: 100%; display: grid; gap: 8px; text-align: left; position: relative; z-index: 1; }
.sheet input[type="number"], .sheet input[type="text"] { width: 100%; font: 700 22px var(--display); padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--ground); color: var(--ink); text-align: center; }
.sheet input:focus { outline: none; border-color: var(--flame); background: var(--bg); }
.sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; position: relative; z-index: 1; }
.photo-pick { width: 100%; padding: 16px; border-radius: 18px; border: 2px dashed #ffc9b8; background: var(--flame-soft); color: var(--flame); font-weight: 800; position: relative; z-index: 1; }
.photo-prev { width: 100%; max-height: 180px; object-fit: contain; border-radius: 16px; background: var(--ground); position: relative; z-index: 1; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--flame); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn { text-align: center; }
.pledge-card { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; position: relative; z-index: 1; }
.chipbtn { padding: 10px 14px; border-radius: 14px; background: var(--ground); font-weight: 800; font-size: 14px; transition: background .2s, color .2s, transform .15s; }
.chipbtn:active { transform: scale(.95); }
.chipbtn[aria-pressed="true"] { background: var(--flame); color: #fff; box-shadow: 0 6px 14px rgba(255, 90, 44, .3); }
.habit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; position: relative; z-index: 1; }
.habit-grid button { padding: 14px 10px; border-radius: 16px; background: var(--ground); font-weight: 800; font-size: 14px; text-align: center; }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; position: relative; z-index: 1; }
.kind-grid button { padding: 22px 10px; border-radius: 20px; background: var(--ground); font-weight: 800; font-size: 16px; display: grid; gap: 6px; justify-items: center; }
.kind-grid button span { font-size: 34px; }
.sheet select { width: 100%; font: 700 16px var(--body); padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--ground); color: var(--ink); }
.sheet .stack { display: grid; gap: 10px; width: 100%; position: relative; z-index: 1; }
.sheet .label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; }
.sheet input.txt { font: 700 17px var(--body); text-align: left; }
.btn.danger { background: #ffe9e4; color: var(--flame); }
.newbtn { width: 100%; padding: 14px; border-radius: 18px; border: 2px dashed #ffc9b8; background: var(--flame-soft); color: var(--flame); font-weight: 800; }
.notif { display: grid; gap: 12px; border-color: #cfe3ff; background: linear-gradient(160deg, #fff, #eef5ff); }
.notif .bell { font-size: 30px; animation: ring 2.6s ease-in-out infinite; transform-origin: 50% 10%; display: inline-block; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0) } 75% { transform: rotate(14deg) } 80% { transform: rotate(-12deg) } 85% { transform: rotate(8deg) } 90% { transform: rotate(-4deg) } }
.notif .steps, .sheet .steps { text-align: left; white-space: pre-line; font-weight: 600; font-size: 13.5px; line-height: 1.55; background: var(--bg); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); }
.notif .seg { margin: 0; }
.notif .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet input[type="time"] { width: 100%; font: 700 20px var(--display); padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--ground); color: var(--ink); text-align: center; }
/* Sign-up inside the app: one question per step, big tap targets. */
.setup { display: grid; align-content: start; gap: 16px; padding: 28px 18px 40px; min-height: 100vh; }
.setup[hidden] { display: none !important; }
.setup .dots { display: flex; gap: 6px; justify-content: center; }
.setup .dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .25s, background .25s; }
.setup .dots i.on { width: 22px; background: var(--flame); }
.setup .hero { display: grid; gap: 8px; justify-items: center; text-align: center; }
.setup .hero img { width: 72px; }
.setup h1 { font-size: 24px; font-weight: 800; }
.setup .lead { margin: 0; color: var(--muted); font-weight: 600; line-height: 1.45; text-align: center; }
.setup .hint { margin: -6px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.setup .err { color: var(--flame); font-weight: 700; font-size: 13.5px; min-height: 18px; margin: -6px 0 0; }
.setup input { width: 100%; font: 700 18px var(--body); padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.setup input:focus { outline: none; border-color: var(--flame); }
.setup input[type="number"], .setup input[type="time"] { font: 700 24px var(--display); text-align: center; }
.setup .big2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup .big2 button { padding: 24px 10px; border-radius: 20px; background: var(--bg); border: 2px solid var(--line); font-weight: 800; font-size: 16px; }
.setup .big2 button[aria-pressed="true"] { border-color: var(--flame); background: var(--flame-soft); }
.setup .chips { justify-content: flex-start; }
.setup .chipbtn { background: var(--bg); border: 2px solid var(--line); }
.setup .chipbtn[aria-pressed="true"] { border-color: var(--flame); background: var(--flame-soft); color: var(--ink); box-shadow: none; }
.setup .avs, .sheet .avs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.setup .avs button, .sheet .avs button { aspect-ratio: 1; border-radius: 18px; background: var(--bg); border: 3px solid var(--line); display: grid; place-items: center; font-size: 30px; overflow: hidden; }
.setup .avs button[aria-pressed="true"], .sheet .avs button[aria-pressed="true"] { border-color: var(--flame); background: var(--flame-soft); }
.setup .avs img, .sheet .avs img { width: 86%; height: 86%; object-fit: contain; }
.setup .nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 4px; }
.setup .nav .btn { padding: 15px 18px; font-size: 15px; }
.setup .nav .btn[disabled] { opacity: .45; box-shadow: none; }
.duel-inv { display: grid; gap: 12px; border-color: #ffd2c4; background: linear-gradient(160deg, #fff, #fff3ee); }
.duel-inv .row { gap: 12px; align-items: center; }
.duel-inv img { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.duel-inv p { margin: 0; font-weight: 700; line-height: 1.4; }
.duel-inv .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Rankings: scope chips scroll sideways on narrow phones */
.scopes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.scopes::-webkit-scrollbar { display: none; }
.scopes .chipbtn { flex: none; white-space: nowrap; font-size: 13px; padding: 9px 13px; }
.rank .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .nm small { font-weight: 700; }
.rank .flag { font-size: 26px; text-align: center; }
.where { margin: 0 0 4px; text-align: center; font-weight: 800; color: var(--muted); }
/* Month in review */
.wr-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; background: linear-gradient(135deg, #6b5cff, #ff5a2c); color: #fff; border: 0; }
.wr-card .wr-ico { font-size: 30px; }
.wr-card b { font-weight: 800; }
.wr-card .chip { background: #fff; color: var(--flame); }
.wr { position: fixed; inset: 0; z-index: 60; background: linear-gradient(160deg, #ff8a4c, #ff5a2c 40%, #6b5cff); color: #fff; display: grid; grid-template-rows: auto 1fr auto; padding: max(14px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); user-select: none; animation: wrIn .35s ease; }
@keyframes wrIn { from { opacity: 0; transform: scale(1.04) } to { opacity: 1; transform: none } }
.wr-bars { display: flex; gap: 4px; padding-right: 44px; }
.wr-bars i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.wr-bars i b { display: block; height: 100%; width: 0; background: #fff; transition: width .3s; }
.wr-bars i.done b { width: 100%; }
.wr-x { position: absolute; top: max(6px, env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; color: #fff; font-size: 20px; font-weight: 800; }
.wr-stage { display: grid; place-items: center; text-align: center; }
.wr-slide { display: grid; gap: 14px; justify-items: center; width: 100%; animation: wrIn .35s ease; }
.wr-eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: 13px; opacity: .85; }
.wr-big { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.15; font-weight: 800; overflow-wrap: anywhere; }
.wr-huge { font-family: var(--display); font-size: 76px; font-weight: 800; line-height: 1; }
.wr-sub { margin: 0; font-weight: 700; opacity: .9; }
.wr-cal { display: grid; grid-template-columns: repeat(7, 34px); gap: 7px; justify-content: center; margin-top: 6px; }
.wr-cal i { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 15px; font-style: normal; }
.wr-cal i.on { background: #fff; }
.wr-cal i.pad { background: none; }
.wr-places { display: grid; gap: 10px; width: 100%; max-width: 340px; }
.wr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(255, 255, 255, .16); border-radius: 18px; padding: 14px 16px; font-weight: 700; }
.wr-row b { font-family: var(--display); font-size: 24px; }
.wr-row small { font-size: 13px; opacity: .8; }
.wr-actions { display: grid; gap: 10px; width: 100%; max-width: 340px; margin-top: 10px; }
.wr-actions .btn.flame { background: #fff; color: var(--flame); box-shadow: none; }
.wr-ghost { background: rgba(255, 255, 255, .18); color: #fff; }
.wr-tap { margin: 0; text-align: center; font-weight: 700; font-size: 13px; opacity: .8; }
.seg[hidden], .steps[hidden], .two[hidden] { display: none !important; }
/* Long words (kk, tg, hy, ka, uz) on 320px phones: let text wrap instead of pushing cards off the screen */
.two > *, .actions > *, .row > div, .row > b, .chest > *, .card > * { min-width: 0; }
.row > span, .row > img, .notif .bell { flex: none; }
.prizes .chip, .hero-p .chip { white-space: normal; text-align: center; line-height: 1.35; }
h1, h2, .notif small, .duel-inv p, .empty { overflow-wrap: anywhere; }
.row > .chip { min-width: max-content; flex: none; }
.chest b, .wr-card b { overflow-wrap: anywhere; }
/* Pet: grows with every day something was done; its mood shows how long ago that was */
.pet { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; overflow: hidden; }
.pet-ava { position: relative; width: 84px; height: 84px; border-radius: 26px; background: linear-gradient(160deg, #fff4d6, #ffe0cc); display: grid; place-items: center; }
.pet-em { font-size: 52px; line-height: 1; display: block; transform-origin: 50% 90%; }
.pet-crown { position: absolute; top: -6px; right: 4px; font-size: 24px; transform: rotate(14deg); }
.pet-fx { position: absolute; top: 2px; left: 6px; font-size: 18px; opacity: 0; }
.pet-info { display: grid; gap: 6px; min-width: 0; }
.pet-head { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.pet-head b { font-family: var(--display); font-size: 17px; overflow-wrap: anywhere; }
.pet-edit { font-size: 14px; opacity: .6; padding: 2px 4px; }
.pet-head .chip { margin-left: auto; }
.pet-mood { font-weight: 700; line-height: 1.35; }
.pet .pbar { margin: 2px 0 0; }
.pet-next { font-weight: 700; font-size: 12px; }
.lvl-5 .pet-ava { background: linear-gradient(160deg, #ffe28c, #ff9d5c); box-shadow: 0 0 0 3px #ffd36b, 0 10px 24px rgba(255, 140, 40, .35); }
.mood-happy .pet-em { animation: petBounce 1.6s ease-in-out infinite; }
.mood-happy .pet-fx { animation: petFloat 2.4s ease-in-out infinite; }
.mood-hungry .pet-em { animation: petWobble 2.2s ease-in-out infinite; }
.mood-hungry .pet-fx { opacity: 1; }
.mood-sad .pet-em { filter: saturate(.45); transform: translateY(4px) rotate(-6deg); }
.mood-sad .pet-fx { animation: petFloat 3s ease-in infinite; }
.mood-sleep .pet-em { filter: grayscale(.7) brightness(.95); transform: rotate(-90deg) scale(.9); }
.mood-sleep .pet-fx { animation: petFloat 2.6s ease-in-out infinite; left: auto; right: 6px; }
.mood-sad .pet-mood, .mood-sleep .pet-mood { color: var(--muted); }
.mood-hungry .pet-mood { color: var(--flame); }
.pet.poked .pet-em { animation: petJump .5s ease; }
.pet.fed .pet-em { animation: petJump .6s ease 2; }
.pet.fed .pet-fx { animation: petFloat 1.2s ease 2; }
@keyframes petBounce { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-6px) scale(1.04) } }
@keyframes petWobble { 0%, 100% { transform: rotate(0) } 25% { transform: rotate(-7deg) } 75% { transform: rotate(7deg) } }
@keyframes petJump { 0%, 100% { transform: translateY(0) scale(1) } 40% { transform: translateY(-16px) scale(1.12) } }
@keyframes petFloat { 0% { opacity: 0; transform: translateY(8px) } 30% { opacity: 1 } 100% { opacity: 0; transform: translateY(-18px) } }
@media (prefers-reduced-motion: reduce) { .pet-em, .pet-fx { animation: none !important; } }
/* Tip of the day */
.tip { display: grid; gap: 8px; background: linear-gradient(160deg, #fff, #f3f1ff); border-color: #e3defc; }
.tip p { margin: 0; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
/* Friends' feed */
.feed { display: grid; gap: 4px; }
.feed h2 { margin-bottom: 6px; }
.fd { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.fd:first-of-type { border-top: 0; }
.fd img, .fd-em { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; }
.fd-main { display: grid; gap: 4px; min-width: 0; }
.fd-top { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.fd-top b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-top small { font-weight: 700; font-size: 12px; flex: none; }
.fd-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.fd-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.kd { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: var(--ground); font-size: 15px; transition: transform .15s, background .2s; }
.kd b { font-size: 12px; font-weight: 800; color: var(--muted); min-width: 0; }
.kd.on { background: var(--flame-soft); box-shadow: inset 0 0 0 2px #ffc9b8; }
.kd.on b { color: var(--flame); }
.kd:active { transform: scale(.9); }
.kd[disabled] { cursor: default; }
.cm { margin-left: auto; }
.cmts { display: grid; gap: 10px; width: 100%; max-height: 46vh; overflow-y: auto; text-align: left; }
.cmt { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.cmt img, .cmt > span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.cmt b { font-size: 13px; font-weight: 800; }
.cmt p { margin: 2px 0 0; background: var(--ground); border-radius: 4px 16px 16px 16px; padding: 8px 12px; font-weight: 600; overflow-wrap: anywhere; }
.cmt.me p { background: var(--flame-soft); }
.cmt-new { display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; }
.cmt-new input { min-width: 0; }
@media (max-width: 360px) {
  .fd-acts { gap: 4px; flex-wrap: nowrap; }
  .kd { padding: 5px 7px; font-size: 14px; gap: 3px; }
  .cm { margin-left: 0; }
}
