/* ================= Themes ================= */
:root, [data-theme="blue"] {
  --bg-1: #e7f0ff;
  --bg-2: #f6f9ff;
  --blob-a: #b7d4ff;
  --blob-b: #d9d2ff;
  --blob-c: #c9f0ff;
  --c1: #4f95ff;
  --c2: #9cc4ff;
  --c3: #e2edff;
  --deep: #2a64d1;
  --mascot: #5ea9ff;
  --stage-1: #dcebff;
  --stage-2: #f7fbff;
  --m-body: #73b3ff;
  --m-shade: #4f92ec;
  --m-ear: #a9d1ff;
  --m-belly: #fff4e4;
  --m-belly-shade: #f3e2cc;
  --m-hat: #ff8fab;
  --m-hat-2: #e86a8c;
  --m-ink: #1d2340;
}
[data-theme="purple"] {
  --bg-1: #efe8ff;
  --bg-2: #fbf7ff;
  --blob-a: #d4c2ff;
  --blob-b: #ffd6e6;
  --blob-c: #e6dcff;
  --c1: #9473ff;
  --c2: #c9b6ff;
  --c3: #efe8ff;
  --deep: #6a46dc;
  --mascot: #a58bff;
  --stage-1: #ece3ff;
  --stage-2: #fdfbff;
  --m-body: #ab92ff;
  --m-shade: #8a6cf0;
  --m-ear: #d2c4ff;
  --m-belly: #fff3e8;
  --m-belly-shade: #f2e0d2;
  --m-hat: #7fd8b0;
  --m-hat-2: #4fbf8f;
  --m-ink: #231c3d;
}
:root {
  --ink: #14161f;
  --ink-2: #3a3f52;
  --muted: #7a8196;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --stroke: rgba(255, 255, 255, 0.85);
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 24px 48px -28px rgba(36, 48, 96, .35), 0 2px 6px -2px rgba(36, 48, 96, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", cursive;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background .5s;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button, .actions, .tabs, .mascot, .stage { -webkit-user-select: none; user-select: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }

/* ================= Background ================= */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .7; transition: background .6s; }
.blob.a { width: 340px; height: 340px; background: var(--blob-a); top: -120px; left: -100px; }
.blob.b { width: 300px; height: 300px; background: var(--blob-b); top: 280px; right: -140px; }
.blob.c { width: 360px; height: 360px; background: var(--blob-c); bottom: -160px; left: -80px; }
.grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
}

/* ================= Layout ================= */
.app { max-width: 430px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 18px 128px; }
.view { display: none; }
.view.active { display: block; animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}
.card { border-radius: 28px; padding: 18px; margin-top: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--stroke); font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.live { width: 8px; height: 8px; border-radius: 50%; background: #34c77b; box-shadow: 0 0 0 3px rgba(52,199,123,.18); }

/* ================= Header ================= */
.head { display: flex; justify-content: space-between; align-items: flex-start; padding: 4px 4px 0; }
.eyebrow { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.streak-num { margin: 0; font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.round-btn {
  width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; margin-top: 6px;
  background: var(--glass-strong); border: 1px solid var(--stroke); box-shadow: var(--shadow);
}
.tdot { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 45deg, #5ea9ff 0 50%, #a58bff 50% 100%); transition: transform .6s var(--spring); box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0,0,0,.15); }
[data-theme="purple"] .tdot { transform: rotate(180deg); }

/* ================= Stage ================= */
.stage { margin-top: 16px; border-radius: 34px; padding: 10px; }
.stage-in {
  position: relative; height: 372px; border-radius: 26px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--stage-2), transparent 60%),
    radial-gradient(90% 70% at 50% 100%, var(--stage-1), var(--stage-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
.stage-in .status { position: absolute; top: 14px; left: 14px; z-index: 3; }
.mascot { position: absolute; left: 50%; bottom: 8px; width: 238px; height: 238px; transform: translateX(-50%); z-index: 2; }
.mascot svg { width: 100%; height: 100%; display: block; overflow: visible; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#m-sweat, #m-sip, #m-happy, #m-sleep, #m-ooh, #m-open, #m-glasses { display: none; }

/* character palette */
.m-fill { fill: var(--m-body); }
.m-shade { fill: var(--m-shade); }
.m-belly { fill: var(--m-belly); }
.m-belly-shade { fill: var(--m-belly-shade); }
.m-spot { fill: var(--m-shade); opacity: .55; }
.m-ear { fill: var(--m-ear); }
.m-paw { fill: var(--m-shade); }
.m-claw ellipse { fill: var(--m-ink); }
.m-ink { fill: var(--m-ink); }
.m-line { fill: none; stroke: var(--m-ink); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.m-line.thin { stroke-width: 3; }
.m-cheek { fill: #ffa3bd; opacity: .85; }
.m-mouth { fill: #7a2840; stroke: var(--m-ink); stroke-width: 3; stroke-linejoin: round; }
.m-tongue { fill: #ff7f9e; }
.m-shades { fill: #17192a; }
.m-sweat { fill: #d6efff; stroke: var(--m-shade); stroke-width: 2; }
.m-shadow { fill: rgba(30, 40, 90, .1); }
.m-hat { fill: var(--m-hat); }
.m-hat-line { fill: none; stroke: var(--m-hat-2); stroke-width: 2.4; stroke-linecap: round; opacity: .6; }
.m-hat-2 { fill: var(--m-hat-2); }
.m-pom { fill: #fff8f0; }
.m-cup { fill: #fffaf4; stroke: var(--m-shade); stroke-width: 2; stroke-linejoin: round; }
.m-cup-band { fill: var(--m-hat); }
.m-lid { fill: var(--m-shade); }
.m-heart { fill: #ff8fab; }
.m-straw { fill: none; stroke: #ff8fab; stroke-width: 4.5; stroke-linecap: round; }
.m-sip { fill: none; stroke: #7cc6ff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 6 6; animation: sip .35s linear infinite; }
@keyframes sip { to { stroke-dashoffset: 12; } }

/* floating hearts / sparkles / zzz */
.fx { position: absolute; top: 30%; z-index: 5; pointer-events: none; font-weight: 800; animation: floatUp 1.8s var(--ease) forwards; }
.fx.heart { color: #ff7fa3; font-size: 22px; }
.fx.spark { color: var(--m-hat); font-size: 20px; }
.fx.splash { font-size: 16px; top: 20%; }
.fx.zzz { color: var(--deep); font-size: 20px; font-family: var(--hand); top: 22%; left: 62% !important; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(0, 10px) scale(.6); }
  15% { opacity: 1; transform: translate(calc(var(--dx) * .2), -6px) scale(1.1); }
  100% { opacity: 0; transform: translate(var(--dx), -80px) scale(.9); }
}

.bubble {
  position: absolute; top: 54px; left: 0; right: 0; margin: 0 auto; width: fit-content; z-index: 4; max-width: 72%;
  padding: 10px 16px; border-radius: 18px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.35;
  background: #fff; box-shadow: 0 10px 24px -12px rgba(36,48,96,.35);
  animation: bubble .5s var(--spring);
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes bubble { from { opacity: 0; transform: translateY(8px) scale(.9); } }

.float {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 16px;
  background: rgba(255,255,255,.72); border: 1px solid var(--stroke); box-shadow: 0 12px 24px -16px rgba(36,48,96,.4);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 12px; color: var(--ink-2);
}
.float b { display: block; font-size: 13px; color: var(--ink); font-weight: 700; line-height: 1.15; }
.float small { font-size: 11px; color: var(--muted); }
.float .ic { color: var(--deep); }
.f1 { left: 12px; top: 176px; transform: rotate(-4deg); animation: drift 6s ease-in-out infinite; }
.f2 { right: 12px; top: 146px; transform: rotate(4deg); animation: drift 7s ease-in-out infinite reverse; }
@keyframes drift { 50% { translate: 0 -6px; } }
.mini-drop { width: 14px; height: 14px; border-radius: 50% 0 50% 50%; transform: rotate(-45deg); background: radial-gradient(circle at 35% 35%, #fff 0 12%, transparent 40%), var(--c1); }
.note {
  position: absolute; right: 10px; bottom: 74px; z-index: 3; margin: 0; max-width: 92px; display: flex; flex-direction: column-reverse; align-items: flex-start;
  font-family: var(--hand); font-size: 20px; font-weight: 700; color: var(--deep); line-height: 1; transform: rotate(-6deg); text-align: right;
}
.note .arrow { width: 34px; height: 24px; stroke: var(--deep); stroke-width: 3; stroke-linecap: round; fill: none; margin: 4px 0 0 -4px; transform: scaleY(-1); }
.spark { position: absolute; z-index: 1; color: #fff; text-shadow: 0 0 10px var(--c2); animation: twinkle 2.4s ease-in-out infinite; }
.sp1 { left: 26%; top: 34%; font-size: 18px; }
.sp2 { right: 24%; top: 26%; font-size: 13px; animation-delay: .8s; }
.sp3 { left: 18%; bottom: 30%; font-size: 11px; animation-delay: 1.4s; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.7); } }

.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 8px 8px; }
.who h1 { font-size: 26px; font-weight: 800; }
.who p { margin: 3px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.rank { background: var(--c3); color: var(--deep); border-color: transparent; white-space: nowrap; }

.pill-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 999px;
  background: #15171f; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap;
  box-shadow: 0 12px 24px -12px rgba(20,22,31,.6); transition: transform .15s;
}
.pill-dark:active { transform: scale(.96); }
.pill-dark.wide { display: flex; width: 100%; margin-top: 16px; padding: 16px; }
.pill-dark:disabled { opacity: .5; }
#openCard { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-3deg) scale(1.04); } 92% { transform: rotate(3deg) scale(1.04); } }

/* ================= Progress ================= */
.prog-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.prog-top .lbl { font-size: 17px; font-weight: 800; }
.prog-top .val { font-size: 14px; color: var(--muted); font-weight: 600; }
.prog-top .val b { color: var(--ink); font-size: 17px; }
.sbar { position: relative; height: 26px; border-radius: 999px; background: rgba(255,255,255,.85); box-shadow: inset 0 1px 3px rgba(36,48,96,.1); padding: 3px; }
.sfill {
  position: relative; height: 100%; min-width: 0; width: 0; border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--c1) 0 9px, color-mix(in srgb, var(--c1) 72%, white) 9px 18px);
  background-size: 25.5px 100%;
  animation: stripes 1.2s linear infinite;
  transition: width 1s var(--spring);
  display: flex; align-items: center; justify-content: flex-end; overflow: hidden;
}
@keyframes stripes { to { background-position: 25.5px 0; } }
.sfill span { font-size: 12px; font-weight: 800; color: #fff; padding-right: 10px; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sbar.slim { height: 14px; padding: 2px; margin-top: 14px; }
.marks { display: flex; gap: 8px; margin-top: 12px; }
.mark { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 14px; font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.55); border: 1px dashed var(--c2); }
.mark.done { color: var(--deep); background: var(--c3); border: 1px solid transparent; }
.mark .ck { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: var(--c1); color: #fff; }
.next { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 12px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.next b { color: var(--ink); }
.next .ic { width: 14px; height: 14px; }

/* ================= Actions ================= */
.actions { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; margin-top: 30px; align-items: end; }
.act {
  position: relative; display: flex; flex-direction: column; align-items: center; padding: 30px 6px 14px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: transform .2s var(--spring);
}
.act.main { padding-top: 40px; background: rgba(255,255,255,.8); }
.actions:has(.solo) { grid-template-columns: 1fr; }
.act.solo { padding: 38px 16px 16px; }
.act.solo b { font-size: 18px; }
.act.solo small { font-size: 13px; }
.act b { font-size: 15px; font-weight: 800; }
.act small { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.act:active { transform: scale(.94); }
.drop3d {
  position: absolute; top: 0; left: 50%; translate: -50% -48%;
  border-radius: 50% 0 50% 50%; rotate: -45deg;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.95) 0 9%, rgba(255,255,255,0) 26%),
    radial-gradient(circle at 70% 75%, color-mix(in srgb, var(--c1) 70%, #000) 0%, transparent 60%),
    linear-gradient(135deg, var(--c2), var(--c1));
  box-shadow: inset -3px -5px 10px rgba(0,0,0,.12), inset 3px 3px 8px rgba(255,255,255,.55), 0 10px 16px -8px var(--c1);
  transition: transform .3s var(--spring);
}
.drop3d.s { width: 30px; height: 30px; }
.drop3d.m { width: 38px; height: 38px; }
.drop3d.l { width: 50px; height: 50px; }
.act:active .drop3d { transform: scale(1.15); }
.undo { display: flex; align-items: center; gap: 6px; margin: 14px auto 0; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ================= Week ================= */
.c-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.c-head h3 { font-size: 17px; font-weight: 800; }
.c-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.legend { display: flex; gap: 10px; font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.legend span { display: flex; align-items: center; gap: 5px; }
.lg { width: 8px; height: 8px; border-radius: 50%; }
.lg.met { background: var(--c1); } .lg.part { background: var(--c2); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar .col { position: relative; width: 100%; max-width: 30px; border-radius: 12px; min-height: 12px; transition: height .8s var(--spring); }
.bar .col.met { background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 70%, white), var(--c1)); box-shadow: 0 8px 16px -10px var(--c1); }
.bar .col.part { background: linear-gradient(180deg, var(--c3), var(--c2)); }
.bar .col.none { background: transparent; border: 1.5px dashed rgba(122,129,150,.35); height: 34px !important; }
.bar .col .tip { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.bar span { font-size: 11px; font-weight: 700; color: var(--muted); }
.bar.today span { color: var(--ink); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px; border-radius: 24px; }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat b small { font-size: 16px; font-weight: 700; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c3); color: var(--deep); }
.stat-ic .ic { width: 17px; height: 17px; }

/* ================= Page heads ================= */
.page-head { padding: 8px 4px 18px; }
.page-head h2 { font-size: 34px; font-weight: 800; }
.page-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); font-weight: 500; }

/* ================= Album ================= */
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px; border-radius: 24px; text-align: center; }
.badge {
  position: relative; width: 74%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,.9) 0 8%, rgba(255,255,255,0) 34%),
    radial-gradient(circle at 72% 80%, rgba(0,0,0,.1), transparent 55%),
    linear-gradient(140deg, var(--b0), var(--b1));
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.08), inset 0 5px 10px rgba(255,255,255,.6), 0 14px 22px -12px var(--b1);
}
.badge .e { font-size: clamp(28px, 8.5vw, 36px); line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.15)); }
.badge .n { position: absolute; top: -4px; right: -6px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: var(--ink); color: #fff; }
.pin .l { font-size: 11.5px; font-weight: 700; line-height: 1.25; min-height: 2.5em; display: flex; align-items: center; }
.pin .r { font-size: 10px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.pin .r::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c3c8d6; }
.pin.rare .r::before { background: var(--c1); }
.pin.shiny .r::before { background: linear-gradient(135deg, #ffd36e, #ff9ec4); }
.pin.shiny .badge::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.8) 46%, rgba(255,214,240,.5) 52%, transparent 66%);
  background-size: 260% 100%; animation: shine 2.8s ease-in-out infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -110% 0; } }
.pin.locked .badge { background: rgba(255,255,255,.6); box-shadow: inset 0 2px 8px rgba(36,48,96,.08); }
.pin.locked .badge .e { filter: blur(5px) grayscale(1); opacity: .35; }
.pin.locked .badge::before { content: "🔒"; position: absolute; font-size: 15px; filter: grayscale(1); opacity: .55; }
.pin.locked .l { color: var(--muted); }

/* ================= Letters ================= */
.letters { display: flex; flex-direction: column; gap: 12px; }
.letter { border-radius: 24px; padding: 18px; }
.letter header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.letter .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--deep); background: var(--c3); padding: 5px 10px; border-radius: 999px; }
.letter .tag .ic { width: 13px; height: 13px; }
.letter time { font-size: 11px; color: var(--muted); font-weight: 600; }
.letter p { margin: 0; font-size: 16px; line-height: 1.55; font-weight: 600; color: var(--ink-2); }
.letter .sig { display: block; text-align: right; font-family: var(--hand); font-size: 24px; font-weight: 700; color: var(--deep); margin-top: 4px; }
.empty { text-align: center; padding: 44px 20px; border-radius: 28px; color: var(--muted); font-weight: 600; font-size: 14px; }
.empty .e { display: block; font-size: 40px; margin-bottom: 10px; }

/* ================= Settings ================= */
.list { border-radius: 26px; padding: 4px 18px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(36,48,96,.07); font-size: 15px; font-weight: 600; }
.row:last-child { border-bottom: 0; }
.unit { display: flex; align-items: center; gap: 6px; }
.unit i { font-style: normal; font-size: 13px; color: var(--muted); }
input, select { font: inherit; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.8); border: 1px solid rgba(36,48,96,.08); border-radius: 12px; padding: 8px 10px; text-align: right; outline: none; width: 118px; }
.unit input { width: 78px; }
.swatches { display: flex; gap: 10px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(36,48,96,.12); transition: transform .3s var(--spring); }
.swatch.blue { background: linear-gradient(135deg, #9cc4ff, #4f95ff); }
.swatch.purple { background: linear-gradient(135deg, #c9b6ff, #9473ff); }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.08); }
.hint { margin: 12px 6px 0; font-size: 12px; color: var(--muted); line-height: 1.5; font-weight: 500; }

/* ================= Tabs ================= */
.tabs {
  position: fixed; z-index: 10; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 400px; margin: 0 auto; display: flex; justify-content: space-around; padding: 8px 6px; border-radius: 28px;
  background: rgba(255,255,255,.72);
}
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabs button i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: background .3s, color .3s, transform .3s var(--spring); }
.tabs button.active { color: var(--ink); font-weight: 800; }
.tabs button.active i { background: var(--ink); color: #fff; transform: scale(1.02); }

/* ================= Scratch modal ================= */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(230, 236, 250, .45); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 350px; border-radius: 34px; padding: 18px 14px 14px; background: rgba(255,255,255,.75); animation: sheet .55s var(--spring); }
@keyframes sheet { from { opacity: 0; transform: translateY(40px) scale(.92); } }
.sheet-head { text-align: center; margin-bottom: 14px; }
.sheet-head h3 { font-size: 24px; font-weight: 800; margin-top: 10px; }
.scratch { position: relative; width: 100%; aspect-ratio: 1 / 1.1; border-radius: 24px; overflow: hidden; touch-action: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 16px 30px -18px rgba(36,48,96,.45); }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reveal {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 22px; text-align: center;
  background: radial-gradient(90% 70% at 50% 30%, #fff, var(--c3));
}
.reveal .pin { background: none; padding: 0; width: 70%; gap: 10px; }
.reveal .pin .badge { width: 78%; }
.reveal .pin .l { font-size: 16px; min-height: 0; }
.reveal .pin .r { font-size: 12px; }
.reveal .tagline { font-size: 12px; font-weight: 800; color: var(--deep); background: #fff; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; box-shadow: 0 6px 14px -10px rgba(36,48,96,.5); }
.reveal .msg { font-size: 19px; line-height: 1.5; font-weight: 700; color: var(--ink); }
.reveal .sig { font-family: var(--hand); font-size: 28px; font-weight: 700; color: var(--deep); margin-top: 10px; }
.reveal.both .pin { width: 46%; margin-bottom: 10px; }
.reveal.both .msg { font-size: 15px; }
.card-hint { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: 14px 0 4px; }

/* ================= Toast & confetti ================= */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 60; pointer-events: none;
  transform: translate(-50%, -30px); opacity: 0; transition: .45s var(--spring);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: rgba(20,22,31,.92); color: #fff; box-shadow: 0 14px 30px -12px rgba(20,22,31,.5);
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100%; height: 100%; }

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

/* ================= Reminders card ================= */
.notif-card {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 22px; text-align: left;
}
.notif-card .bell { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: var(--c3); flex: none; animation: ring 3s ease-in-out infinite; }
@keyframes ring { 0%, 85%, 100% { transform: rotate(0); } 88% { transform: rotate(-14deg); } 92% { transform: rotate(12deg); } 96% { transform: rotate(-6deg); } }
.notif-card .nc-text { flex: 1; display: flex; flex-direction: column; }
.notif-card b { font-size: 15px; font-weight: 800; }
.notif-card small { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.notif-card .ic { color: var(--muted); }

/* ================= Glow-up countdown ================= */
.glow { position: relative; overflow: hidden; }
.glow::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 210, 120, .35), transparent); pointer-events: none;
}
.glow-head { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.glow-kicker { margin: 0; font-size: 12px; font-weight: 700; color: #b7791f; letter-spacing: .01em; }
.glow-head h3 { font-size: 18px; font-weight: 800; margin-top: 4px; line-height: 1.25; }
.glow-count { text-align: center; flex: none; padding: 8px 12px; border-radius: 18px; background: linear-gradient(160deg, #fff6df, #ffe7b0); box-shadow: 0 10px 20px -14px rgba(183,121,31,.6); }
.glow-count b { display: block; font-size: 28px; font-weight: 800; line-height: 1; color: #8a5a12; letter-spacing: -.03em; }
.glow-count span { font-size: 10px; font-weight: 700; color: #a8742a; white-space: nowrap; }
.glow-dots { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.glow-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(36,48,96,.08); }
.glow-dots i.lit { background: radial-gradient(circle at 35% 35%, #fff 0 12%, #ffd36e 40%, #f4a93b); box-shadow: 0 0 10px rgba(255,190,80,.8); }
.glow-dots i.today { outline: 2px solid var(--c1); outline-offset: 2px; }
.glow-dots i.future { background: transparent; border: 1.5px dashed rgba(36,48,96,.18); }
.glow-dots i.shaadi { background: none; border: 0; width: auto; height: 14px; font-style: normal; font-size: 13px; line-height: 14px; }
.glow-foot { position: relative; margin: 12px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.glow-foot b { color: var(--ink); }

/* ================= Floating fill button ================= */
.fab {
  position: fixed; z-index: 11; right: max(18px, calc(50% - 197px)); bottom: calc(104px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 999px;
  background: #15171f; color: #fff; box-shadow: 0 16px 30px -10px rgba(20,22,31,.55), 0 0 0 4px rgba(255,255,255,.6);
  transition: transform .2s var(--spring), opacity .25s;
  animation: fabIn .6s var(--spring);
}
@keyframes fabIn { from { transform: translateY(30px) scale(.6); opacity: 0; } }
.fab:active { transform: scale(.92); }
.fab .drop3d { position: static; translate: none; width: 28px; height: 28px; flex: none; }
.fab span { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.fab b { font-size: 15px; font-weight: 800; }
.fab small { font-size: 11px; opacity: .7; font-weight: 600; }
.fab.pop { animation: fabPop .45s var(--spring); }
@keyframes fabPop { 40% { transform: scale(1.12); } }
.prog .undo { margin-top: 10px; }

#view-home { padding-bottom: 80px; }
