:root {
  --bg: #06100c;
  --card: #0e1a15;
  --card2: #13241d;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .12);
  --text: #eef6f1;
  --muted: #8aa597;
  --dim: #5d7568;
  --gold: #f7c948;
  --gold2: #ffe08a;
  --gold3: #e9a82a;
  --green: #3ee08f;
  --green2: #19b46b;
  --red: #ff7a7a;
  --r: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Be Vietnam Pro', -apple-system, system-ui, sans-serif;
  font-size: 15px; line-height: 1.45;
  min-height: 100vh; overscroll-behavior-y: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(247, 201, 72, .13), transparent 60%),
    radial-gradient(90% 50% at 100% 30%, rgba(62, 224, 143, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-user-select: none; user-select: none;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.green { color: var(--green); }

#app { max-width: 520px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 160px); }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.wallet {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 7px 12px 7px 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(247, 201, 72, .14), rgba(247, 201, 72, .04));
  border: 1px solid rgba(247, 201, 72, .22);
}
.wallet span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.wallet b { font-size: 16px; font-weight: 800; color: var(--gold2); }
.wallet.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: scale(1.12); box-shadow: 0 0 30px rgba(247, 201, 72, .45); } }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; margin-bottom: 12px; position: relative; overflow: hidden;
}
.card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 20px 4px 10px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Hero ---------- */
.hero { padding: 20px 20px 18px; border-color: rgba(247, 201, 72, .18);
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(247, 201, 72, .16), transparent 70%),
    linear-gradient(180deg, #142a20, #0d1914); }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .05) 45%, transparent 60%);
  background-size: 250% 100%; animation: sheen 6s linear infinite; }
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.pill.live { background: rgba(62, 224, 143, .12); color: var(--green); }
.pill.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(62, 224, 143, .6); animation: ping 1.6s infinite; }
.pill.done { background: rgba(247, 201, 72, .14); color: var(--gold); }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(62, 224, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 224, 143, 0); } }
.hero-lbl { margin-top: 16px; color: var(--muted); font-size: 14px; }
.hero-num { font-size: clamp(40px, 12.5vw, 58px); font-weight: 800; line-height: 1.05; margin: 4px 0 6px;
  background: linear-gradient(180deg, #fff3c4, var(--gold) 55%, var(--gold3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(247, 201, 72, .25)); white-space: nowrap; }
.hero-num small { font-size: .5em; margin-left: 2px; }
.hero-sub { font-size: 13.5px; color: var(--muted); }
.hero-sub b { color: var(--green); font-weight: 700; }
.daybar { height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .07); margin: 16px 0 8px; overflow: hidden; }
.daybar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--green2), var(--green)); box-shadow: 0 0 12px rgba(62, 224, 143, .5); transition: width .4s; }
.dayends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); }
.fun { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.fun b { color: var(--text); }
.hero-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Slider ---------- */
.harvest { padding: 16px; }
.harvest-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.harvest-head .t { font-weight: 700; }
.harvest-head .amt { font-weight: 800; color: var(--gold2); font-size: 18px; }
.harvest-list { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }
.slide {
  position: relative; height: 66px; border-radius: 99px; overflow: hidden; touch-action: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .2));
  border: 1px solid rgba(247, 201, 72, .3);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .4), 0 0 28px rgba(247, 201, 72, .12);
}
.slide-fill { position: absolute; inset: 0 auto 0 0; width: 66px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(247, 201, 72, .15), rgba(247, 201, 72, .55)); }
.slide-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 50px;
  font-weight: 700; font-size: 15.5px; pointer-events: none; }
.shine { background: linear-gradient(90deg, rgba(255, 224, 138, .45) 0%, #fff6d6 50%, rgba(255, 224, 138, .45) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 2.2s linear infinite; }
@keyframes shine { from { background-position: 200% 0; } to { background-position: 0 0; } }
.slide-knob { position: absolute; top: 5px; left: 5px; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; cursor: grab;
  background: radial-gradient(circle at 35% 30%, #fff1b8, var(--gold) 45%, var(--gold3));
  box-shadow: 0 6px 18px rgba(233, 168, 42, .5), inset 0 -3px 6px rgba(0, 0, 0, .18), inset 0 2px 3px rgba(255, 255, 255, .6); }
.slide-knob svg { width: 26px; height: 26px; color: #5b3a02; }
.slide.idle .slide-knob { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: translateX(0); } 70% { transform: translateX(16px); } 80% { transform: translateX(0); } 88% { transform: translateX(8px); } }
.slide.locked { border-color: var(--line2); box-shadow: inset 0 2px 10px rgba(0, 0, 0, .4); }
.slide.locked .slide-knob { background: #23362d; box-shadow: none; cursor: default; }
.slide.locked .slide-knob svg { color: var(--muted); }
.slide.locked .slide-text { color: var(--muted); font-weight: 600; font-size: 14px; }
.slide.done .slide-fill { background: linear-gradient(90deg, var(--green2), var(--green)); }
.slide.done .slide-text { color: #06210f; }
.link-btn { display: block; margin: 12px auto 0; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.collected-badge { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px;
  background: rgba(62, 224, 143, .08); border: 1px solid rgba(62, 224, 143, .2); }
.collected-badge .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(62, 224, 143, .15); color: var(--green); flex: none; }
.collected-badge b { display: block; }
.collected-badge span { font-size: 13px; color: var(--muted); }

/* ---------- Month ---------- */
.big { font-size: 28px; font-weight: 800; margin: 8px 0 2px; }
.big small { font-size: 14px; color: var(--muted); font-weight: 600; }
.bar { position: relative; height: 12px; border-radius: 9px; background: rgba(255, 255, 255, .07); margin: 12px 0 10px; overflow: hidden; display: flex; }
.bar i { height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.bar .sal { background: linear-gradient(90deg, var(--gold3), var(--gold)); }
.bar .oth { background: linear-gradient(90deg, var(--green2), var(--green)); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend b { color: var(--text); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.dot.sal { background: var(--gold); } .dot.oth { background: var(--green); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats3 > div { background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.stats3 b { display: block; font-size: 16.5px; font-weight: 800; }
.stats3 span { font-size: 11.5px; color: var(--muted); }

/* ---------- Feed ---------- */
.feed { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:active { background: rgba(255, 255, 255, .03); }
.fic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.fic.sal { background: rgba(247, 201, 72, .12); color: var(--gold); }
.fic.oth { background: rgba(62, 224, 143, .12); color: var(--green); }
.fic svg { width: 20px; height: 20px; }
.fbody { flex: 1; min-width: 0; }
.fbody b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbody span { font-size: 12.5px; color: var(--muted); }
.famt { font-weight: 700; color: var(--green); white-space: nowrap; }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- FAB & tabs ---------- */
.fab { position: fixed; z-index: 20; right: max(16px, calc(50% - 244px)); bottom: calc(var(--safe-b) + 84px);
  display: flex; align-items: center; gap: 8px; padding: 14px 18px 14px 15px; border-radius: 99px; font-weight: 700;
  background: linear-gradient(135deg, var(--green), var(--green2)); color: #04210f;
  box-shadow: 0 10px 28px rgba(25, 180, 107, .45); }
.fab svg { width: 20px; height: 20px; }
.fab:active { transform: scale(.96); }
.tabs { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; padding: 8px 10px calc(var(--safe-b) + 8px);
  display: flex; justify-content: center; background: rgba(6, 16, 12, .85); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); }
.tabs-in { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 520px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--dim); }
.tab svg { width: 23px; height: 23px; }
.tab.on { color: var(--gold); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 14px;
  font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.btn:active { transform: scale(.97); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn.primary { background: linear-gradient(135deg, var(--gold2), var(--gold3)); color: #3d2700; border: 0; font-weight: 700; }
.btn.green { background: linear-gradient(135deg, var(--green), var(--green2)); color: #04210f; border: 0; font-weight: 700; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; padding: 15px; font-size: 15px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input { width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25);
  color: var(--text); font: inherit; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; min-height: 48px; }
.input:focus { border-color: rgba(247, 201, 72, .5); box-shadow: 0 0 0 3px rgba(247, 201, 72, .12); }
input[type=date].input, input[type=time].input { color-scheme: dark; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 13px; border-radius: 99px; font-size: 13.5px; font-weight: 600; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--muted); }
.chip.on { background: rgba(247, 201, 72, .16); border-color: rgba(247, 201, 72, .45); color: var(--gold2); }
.chip:active { transform: scale(.95); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.rate-box { padding: 12px 14px; border-radius: 14px; background: rgba(247, 201, 72, .08); border: 1px solid rgba(247, 201, 72, .2); font-size: 13.5px; margin: 4px 0 16px; }
.rate-box b { color: var(--gold2); }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, .12); transition: .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on { background: var(--green2); }
.toggle.on::after { left: 23px; }

/* ---------- Amount input ---------- */
.amt-wrap { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 10px 0 4px; }
.amt-input { width: 2ch; min-width: 1.2ch; max-width: 100%; text-align: right; font-size: 42px; font-weight: 800; color: var(--gold2); background: none; border: 0; outline: none;
  font-family: inherit; font-variant-numeric: tabular-nums; caret-color: var(--gold); padding: 0; }
.amt-input::placeholder { color: rgba(255, 255, 255, .15); }
.amt-cur { font-size: 22px; font-weight: 700; color: var(--gold3); }
.quick { justify-content: center; margin: 6px 0 18px; }

/* ---------- Sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s; }
.backdrop.show { opacity: 1; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; max-height: 92vh; overflow-y: auto;
  background: #0f1d17; border: 1px solid var(--line2); border-bottom: 0; border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(var(--safe-b) + 22px); transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1); }
.sheet.show { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .18); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.sheet .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 17px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); }
.icon-btn svg { width: 20px; height: 20px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--dim); font-weight: 600; padding-bottom: 4px; }
.cell { aspect-ratio: 1 / 1.18; border-radius: 12px; padding: 5px 2px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .03); border: 1px solid transparent; font-size: 13px; font-weight: 600; position: relative; }
.cell .a { font-size: 10px; font-weight: 700; letter-spacing: -.02em; }
.cell.collected { background: linear-gradient(180deg, rgba(247, 201, 72, .22), rgba(247, 201, 72, .08)); border-color: rgba(247, 201, 72, .3); }
.cell.collected .a { color: var(--gold2); }
.cell.pending { border: 1px dashed rgba(247, 201, 72, .5); }
.cell.pending .a { color: var(--gold); }
.cell.off { opacity: .35; }
.cell.future { color: var(--muted); }
.cell.today { box-shadow: 0 0 0 2px var(--green) inset; }
.cell.blank { background: none; }
.cell .oi { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Stats ---------- */
.chart { width: 100%; height: 190px; display: block; }
.src-row { margin-bottom: 12px; }
.src-row .row { font-size: 13.5px; margin-bottom: 6px; }
.src-bar { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.src-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--green2), var(--green)); }
.src-bar i.g { background: linear-gradient(90deg, var(--gold3), var(--gold)); }
.records { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.records > div { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.records span { font-size: 12px; color: var(--muted); display: block; }
.records b { font-size: 18px; font-weight: 800; display: block; margin-top: 4px; }
.records small { font-size: 12px; color: var(--muted); }

/* ---------- Login / onboarding ---------- */
.center { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.logo-big { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 18px; display: block; box-shadow: 0 16px 50px rgba(247, 201, 72, .25); }
.center h1 { text-align: center; margin: 0 0 6px; font-size: 26px; font-weight: 800; }
.center p.lead { text-align: center; color: var(--muted); margin: 0 0 26px; }
.err { color: var(--red); font-size: 13.5px; margin: -4px 0 12px; min-height: 1px; }

/* ---------- FX ---------- */
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.float-amt { position: fixed; z-index: 61; left: 50%; top: 40%; transform: translate(-50%, -50%); pointer-events: none;
  font-size: 44px; font-weight: 800; white-space: nowrap; color: var(--gold2);
  text-shadow: 0 0 30px rgba(247, 201, 72, .7), 0 4px 0 #8a5a00; animation: floatUp 1.9s cubic-bezier(.2, .8, .2, 1) forwards; }
.float-amt small { display: block; text-align: center; font-size: 15px; color: #fff; text-shadow: none; font-weight: 600; opacity: .85; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  30% { transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(.95); }
}
#toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--safe-b) + 150px); transform: translate(-50%, 20px); opacity: 0;
  background: #1d3329; border: 1px solid var(--line2); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  transition: .25s; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
