/* Capy Dates - soft lavender, rounded, thumb-friendly. */
:root {
  --lav-50: #FBF8FF; --lav-100: #F3EDFF; --lav-200: #E6DAFD; --lav-300: #D2BEF8;
  --lav-400: #B79CF2; --lav-500: #9C7BE8; --lav-600: #7F5BD0; --lav-700: #5F3FA8;
  --ink: #3A2A5C; --muted: #7E6EA0; --cream: #FFF7EA; --peach: #FFE3D2; --pink: #FFC9DE;
  --mint: #CDEFE0; --mint-d: #2C8A64; --danger: #D6456B; --white: #fff;
  --r: 24px; --r-s: 16px;
  --shadow: 0 10px 28px rgba(111, 77, 190, .16);
  --shadow-s: 0 4px 14px rgba(111, 77, 190, .12);
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-d: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 68px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 600 16px/1.45 var(--font); color: var(--ink);
  background: radial-gradient(120% 60% at 50% -10%, #EADFFF 0%, rgba(234, 223, 255, 0) 60%), linear-gradient(180deg, #F7F1FF 0%, #FFF8F0 100%);
  background-attachment: fixed; background-color: #F7F1FF;
  touch-action: manipulation; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--lav-500); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: rgba(247, 241, 255, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.brand-mark { width: 38px; height: 38px; border-radius: 14px; background: linear-gradient(160deg, #E4D7FC, #FFE9F2); box-shadow: var(--shadow-s); display: block; overflow: hidden; padding: 2px 0 0; }
.brand-name { font: 600 21px var(--font-d); letter-spacing: .2px; color: var(--lav-700); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px; background: #fff; box-shadow: var(--shadow-s); font: 600 17px var(--font-d); color: var(--lav-700); }
.chip.pulse { animation: pulse .7s ease; }
@keyframes pulse { 40% { transform: scale(1.18); } }

#view { padding: 6px 16px calc(var(--nav-h) + 110px + var(--safe-b)); }  /* room for the tab bar and the + button */
#view.enter > * { animation: rise .38s cubic-bezier(.2, .8, .25, 1) both; }
#view.enter > *:nth-child(2) { animation-delay: .05s; } #view.enter > *:nth-child(3) { animation-delay: .1s; } #view.enter > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- tab bar + fab ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b));
  width: min(calc(100% - 24px), 496px); height: var(--nav-h); padding: 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 28px; box-shadow: 0 8px 30px rgba(95, 63, 168, .22);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 22px; color: var(--muted); font: 700 11.5px var(--font); transition: background .2s, color .2s, transform .15s; }
.tabbar button svg { width: 24px; height: 24px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tabbar button:active { transform: scale(.94); }
.tabbar button.on { background: var(--lav-100); color: var(--lav-600); }
.tabbar button.on svg { transform: translateY(-1px) scale(1.12); }
.fab {
  position: fixed; z-index: 29; right: max(16px, calc(50vw - 244px)); bottom: calc(var(--nav-h) + 26px + var(--safe-b));
  width: 60px; height: 60px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  background: linear-gradient(145deg, #B79CF2, #8A63E0); box-shadow: 0 10px 24px rgba(127, 91, 208, .45);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.fab:active { transform: scale(.9) rotate(90deg); }
.fab.gone { display: none; }

/* ---------- generic ---------- */
.card { background: rgba(255, 255, 255, .88); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-s); margin-top: 14px; }
.card h3 { font: 600 19px var(--font-d); color: var(--lav-700); }
.sub { color: var(--muted); font-size: 14px; font-weight: 600; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 4px 8px; }
.section-title h3 { font: 600 19px var(--font-d); color: var(--lav-700); }
.link { color: var(--lav-600); font-weight: 800; font-size: 14px; padding: 8px 4px; min-height: 40px; }
.btn { min-height: 48px; padding: 0 20px; border-radius: 16px; font: 800 16px var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, filter .15s; }
.btn:active { transform: scale(.96); }
.btn.primary { color: #fff; background: linear-gradient(145deg, #B79CF2, #8A63E0); box-shadow: 0 6px 16px rgba(127, 91, 208, .35); }
.btn.mint { color: #1F6B4B; background: var(--mint); }
.btn.ghost { color: var(--lav-700); background: var(--lav-100); }
.btn.danger { color: #fff; background: var(--danger); }
.btn.danger-ghost { color: var(--danger); background: #FFEAF0; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 14px; }
.btn[disabled] { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--lav-700); background: var(--lav-100); font-size: 18px; font-weight: 800; flex: none; }
.icon-btn:active { transform: scale(.9); }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty .big { font-size: 38px; display: block; margin-bottom: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.row + .row { border-top: 2px dashed var(--lav-200); }
.row .l b { display: block; font-weight: 800; } .row .l small { color: var(--muted); font-weight: 600; font-size: 13px; }

/* ---------- pet card (home) ---------- */
.pet-card { position: relative; overflow: hidden; border-radius: 34px; padding: 16px 16px 18px; margin-top: 6px; box-shadow: var(--shadow); background: linear-gradient(172deg, #EBDFFF 0%, #F8E7F6 55%, #FFF0E2 100%); }
.pet-card::before, .pet-card::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .55); filter: blur(1px); }
.pet-card::before { width: 90px; height: 34px; left: -14px; top: 92px; animation: drift 14s ease-in-out infinite alternate; }
.pet-card::after { width: 70px; height: 26px; right: -10px; top: 150px; animation: drift 11s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translateX(22px); } }
.pet-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.pet-name { font: 600 24px var(--font-d); color: var(--lav-700); }
.lvl-pill { padding: 6px 12px; border-radius: 99px; background: #fff; font: 600 14px var(--font-d); color: var(--lav-600); box-shadow: var(--shadow-s); }
.bubble { position: relative; z-index: 1; margin: 12px 6px 0; padding: 10px 14px; border-radius: 18px; background: #fff; text-align: center; font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow-s); min-height: 22px; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.stage { position: relative; z-index: 1; width: min(80%, 300px); margin: 14px auto 0; cursor: pointer; user-select: none; -webkit-user-select: none; }
.stage::after { content: ''; position: absolute; left: -22%; right: -22%; bottom: -6px; height: 38px; border-radius: 50%; background: radial-gradient(closest-side, rgba(175, 215, 190, .7), rgba(175, 215, 190, 0)); z-index: -1; }
.progress { position: relative; z-index: 1; margin-top: 12px; }
.bar { height: 18px; border-radius: 99px; background: rgba(127, 91, 208, .16); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #B79CF2, #FF9DC4); position: relative; transition: width 1s cubic-bezier(.2, .8, .2, 1); min-width: 18px; }
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 3s ease-in-out infinite; }
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }
.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; font-weight: 800; font-size: 13.5px; color: var(--lav-700); }

/* week / streak */
.week-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.streak { text-align: center; min-width: 78px; padding: 6px 10px; border-radius: 18px; background: var(--lav-100); color: var(--muted); line-height: 1.1; }
.streak b { display: block; font: 600 26px var(--font-d); }
.streak span { font-size: 11.5px; font-weight: 800; }
.streak.on { background: linear-gradient(160deg, #FFE3C7, #FFD0E2); color: #B4492B; }
.hearts { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 28px; }
.hearts .h { transition: transform .3s cubic-bezier(.3, 1.8, .5, 1), opacity .3s; } .hearts .h.on { transform: scale(1.12); }
.hearts .h:not(.on) { opacity: .3; filter: grayscale(1); }
.hearts small { margin-left: auto; font: 700 13px var(--font); color: var(--muted); text-align: right; max-width: 55%; }

/* notification + install prompts */
.ask { display: flex; gap: 12px; align-items: center; background: linear-gradient(160deg, #FFF0E4, #FFE4F0); }
.ask .em { font-size: 32px; } .ask p { font-size: 14.5px; flex: 1; } .ask .acts { display: flex; flex-direction: column; gap: 6px; }

/* ---------- date cards ---------- */
.dlist { display: grid; gap: 10px; }
.dcard { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 8px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-s); animation: rise .35s cubic-bezier(.2, .8, .25, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.dmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 56px; border-radius: 16px; }
.dcard .em { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--lav-100); flex: none; }
.dcard .meta { min-width: 0; display: flex; flex-direction: column; }
.dcard .t { font-weight: 800; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .s { color: var(--muted); font-size: 13px; font-weight: 700; }
.dcard .n { color: var(--muted); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.dcard.done .t { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .55; }
.dcard.done .em { background: var(--mint); }
.check { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2.5px solid var(--lav-300); color: transparent; background: #fff; font-size: 22px; font-weight: 800; transition: transform .2s cubic-bezier(.3, 1.8, .5, 1), background .2s; }
.check:not([disabled]):active { transform: scale(.88); }
.check.ready { color: var(--lav-400); }
.check.on { background: linear-gradient(145deg, #7EDDB0, #4FBF8E); border-color: transparent; color: #fff; }
.rel { font-size: 12.5px; font-weight: 800; color: var(--lav-600); background: var(--lav-100); padding: 6px 10px; border-radius: 99px; white-space: nowrap; flex: none; }
.group-title { margin: 18px 6px 8px; font: 600 15px var(--font-d); color: var(--muted); letter-spacing: .3px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: rgba(255, 255, 255, .85); border-radius: 20px; box-shadow: var(--shadow-s); }
.seg button { min-height: 44px; border-radius: 16px; font: 800 14px var(--font); color: var(--muted); }
.seg button.on { background: var(--lav-500); color: #fff; box-shadow: 0 4px 12px rgba(127, 91, 208, .35); }
.seg button small { opacity: .75; margin-left: 3px; }

/* ---------- calendar ---------- */
.cal { padding: 12px 10px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 8px; }
.cal-head h2 { font: 600 21px var(--font-d); color: var(--lav-700); text-transform: capitalize; flex: 1; text-align: center; }
.dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow span { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 2px 0 6px; }
.cal-grid { gap: 2px; touch-action: pan-y; }
.day { position: relative; min-height: 52px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; font-size: 15px; transition: background .15s; }
.day:active { background: var(--lav-100); }
.day.dim { color: #B9ABD6; font-weight: 700; }
.day .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; transition: background .2s, color .2s, transform .25s cubic-bezier(.3, 1.8, .5, 1); }
.day.today .num { box-shadow: inset 0 0 0 2.5px var(--lav-400); }
.day.sel .num { background: var(--lav-600); color: #fff; transform: scale(1.1); box-shadow: 0 4px 10px rgba(127, 91, 208, .4); }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--lav-500); }
.dots i.d { background: #4FBF8E; } .dots i.more { background: var(--pink); }
.day-panel { margin-top: 14px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.day-head h3 { font: 600 19px var(--font-d); color: var(--lav-700); }
.day-head .sub { font-size: 13px; }

/* ---------- stats ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.tile { border-radius: 22px; padding: 14px; background: #fff; box-shadow: var(--shadow-s); }
.tile b { display: block; font: 600 32px/1.1 var(--font-d); color: var(--lav-600); }
.tile span { font-size: 13px; color: var(--muted); font-weight: 800; }
.tile.t1 { background: linear-gradient(160deg, #F1E8FF, #fff); } .tile.t2 { background: linear-gradient(160deg, #FFE9D9, #fff); }
.tile.t3 { background: linear-gradient(160deg, #FFE0EE, #fff); } .tile.t4 { background: linear-gradient(160deg, #D8F3E6, #fff); }
.road { display: grid; gap: 8px; margin-top: 10px; }
.lv { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 20px; background: var(--lav-50); }
.lv .capy { width: 74px; flex: none; }
.lv .nm { font-weight: 800; } .lv .nm small { display: block; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.lv .st { margin-left: auto; font-size: 12.5px; font-weight: 800; color: var(--lav-600); white-space: nowrap; }
.lv.here { background: linear-gradient(160deg, #EADFFF, #FFE9F2); box-shadow: inset 0 0 0 2px var(--lav-400); }
.lv.locked .capy { filter: brightness(0) opacity(.12); } .lv.locked .nm { color: var(--muted); }
.log { margin-top: 14px; padding-top: 4px; border-top: 2px solid var(--lav-100); } .log .row { min-height: 42px; font-size: 14.5px; } .log .p { font: 600 16px var(--font-d); color: var(--lav-600); }
.rules { margin: 8px 0 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 8px; font-size: 14.5px; }
.rules li::before { content: '💜'; margin-right: 8px; }
details { margin-top: 10px; } summary { cursor: pointer; font-weight: 800; color: var(--lav-600); min-height: 40px; display: flex; align-items: center; }
details p, details li { font-size: 14px; color: var(--ink); margin-top: 8px; font-weight: 600; } details ul { padding-left: 20px; margin: 6px 0 0; }
.status { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: var(--lav-100); color: var(--lav-700); }
.status.ok { background: var(--mint); color: #1F6B4B; } .status.no { background: #FFE3EA; color: #B02A50; }
.switch { position: relative; width: 56px; height: 34px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--lav-200); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.switch input:checked + span { background: var(--lav-500); } .switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--lav-500); outline-offset: 2px; }
.inline-in { min-height: 44px; border-radius: 14px; border: 2px solid var(--lav-200); background: #fff; padding: 0 10px; font-weight: 700; max-width: 150px; }
.txt-in { width: 100%; min-height: 48px; border-radius: 14px; border: 2px solid var(--lav-200); background: #fff; padding: 0 12px; font-weight: 700; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- together ---------- */
.pet-name .with { display: block; font: 700 12.5px var(--font); color: var(--muted); margin-top: -2px; }
.code-box { text-align: center; font: 600 34px/1.2 var(--font-d); letter-spacing: 4px; color: var(--lav-700); background: var(--lav-100); border-radius: 20px; padding: 18px 10px; user-select: all; -webkit-user-select: all; }
.code-in { text-transform: uppercase; letter-spacing: 3px; font: 600 20px var(--font-d); text-align: center; }

/* ---------- sheets (dialogs) ---------- */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 520px; margin: auto auto 0; max-height: 92dvh; color: var(--ink); background: #FFFCFF; border-radius: 30px 30px 0 0; box-shadow: 0 -10px 40px rgba(60, 30, 120, .25); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetUp .38s cubic-bezier(.2, .9, .25, 1); }
dialog.sheet.small { border-radius: 28px; margin: auto; width: min(92%, 380px); }
dialog.sheet.small[open] { animation: pop .3s cubic-bezier(.3, 1.4, .5, 1); }
dialog.sheet::backdrop { background: rgba(58, 42, 92, .42); backdrop-filter: blur(3px); animation: fade .25s; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
#dateForm { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--lav-200); margin: 10px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 4px 20px; }
.sheet-head h2 { font: 600 23px var(--font-d); color: var(--lav-700); }
.sheet-body { padding: 8px 20px 12px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.sheet-body > p { font-size: 15px; }
dialog.small .sheet-body { padding-top: 22px; } dialog.small h2 { font: 600 22px var(--font-d); color: var(--lav-700); }
.big-emoji { font-size: 54px; text-align: center; animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
.hint { font-size: 13.5px !important; color: var(--muted); font-weight: 600; }
.sheet-foot { display: flex; gap: 10px; padding: 10px 20px calc(16px + var(--safe-b)); background: #FFFCFF; border-top: 2px solid var(--lav-100); }
.sheet-foot .btn { flex: 1; } .sheet-foot .btn.primary { flex: 2; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 800; font-size: 14px; color: var(--lav-700); }
.field > span em { font-style: normal; font-weight: 700; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; border-radius: 16px; border: 2.5px solid var(--lav-200); background: #fff; padding: 10px 14px; font-weight: 700; font-size: 16px; appearance: none; -webkit-appearance: none; }
.field textarea { resize: none; min-height: 68px; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--lav-500) 50%), linear-gradient(135deg, var(--lav-500) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--lav-500); outline: none; box-shadow: 0 0 0 4px rgba(156, 123, 232, .2); }
.field.bad input { border-color: var(--danger); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.row2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.emoji-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -4px; scrollbar-width: none; }
.emoji-row::-webkit-scrollbar { display: none; }
.emoji-row button, .emoji-row input { flex: none; width: 48px; height: 48px; min-height: 0; border-radius: 16px; background: var(--lav-100); font-size: 24px; display: grid; place-items: center; border: 2.5px solid transparent; padding: 0; text-align: center; }
.emoji-row button.on { border-color: var(--lav-500); background: #fff; transform: scale(1.08); box-shadow: var(--shadow-s); }
.emoji-row button.none { font-size: 14px; font-weight: 800; color: var(--muted); }
.emoji-row input { width: 64px; font-size: 22px; background: #fff; border-color: var(--lav-200); }
.form-msg { min-height: 20px; color: var(--danger); font-weight: 800; font-size: 14px; }
.form-msg.info { color: var(--mint-d); }

/* ---------- toasts, fx, level up ---------- */
#toasts { position: fixed; z-index: 120; left: 0; right: 0; bottom: calc(var(--nav-h) + 40px + var(--safe-b)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 460px; padding: 10px 12px 10px 16px; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(95, 63, 168, .3); font-weight: 800; font-size: 14.5px; animation: toastIn .4s cubic-bezier(.3, 1.4, .5, 1); }
.toast.out { animation: toastOut .3s ease forwards; }
.toast .tx small { display: block; font-weight: 700; color: var(--muted); font-size: 12.5px; }
.toast button { min-height: 40px; padding: 0 14px; border-radius: 14px; background: var(--lav-100); color: var(--lav-600); font-weight: 800; flex: none; }
.toast.reward { padding-left: 8px; background: linear-gradient(160deg, #fff, #F6EEFF); }
.toast.reward .capy { width: 58px; flex: none; margin-top: -10px; }
.toast .pts { font: 600 22px var(--font-d); color: var(--lav-600); }
@keyframes toastIn { from { transform: translateY(24px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

#fx { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.fx-heart { position: absolute; font-size: 22px; animation: heartUp 1.5s ease-out forwards; }
@keyframes heartUp { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), -120px) scale(1.2) rotate(var(--rot)); opacity: 0; } }
.confetti { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall var(--d) cubic-bezier(.3, .2, .5, 1) forwards; }
.confetti.heart { width: auto; height: auto; background: none !important; font-size: 18px; }
@keyframes fall { 0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: 0; } }

.levelup { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(58, 42, 92, .55); backdrop-filter: blur(5px); animation: fade .3s; }
.levelup .card { position: relative; width: min(100%, 340px); margin: 0; text-align: center; padding: 22px 20px 20px; border-radius: 34px; background: linear-gradient(172deg, #F2E9FF, #FFEAF4 60%, #FFF3E6); animation: pop .5s cubic-bezier(.3, 1.5, .5, 1); overflow: hidden; }
.levelup .glow { position: absolute; left: 50%; top: 38%; width: 340px; height: 340px; margin: -170px 0 0 -170px; background: conic-gradient(from 0deg, rgba(255, 214, 107, 0), rgba(255, 214, 107, .5), rgba(255, 214, 107, 0), rgba(183, 156, 242, .5), rgba(255, 214, 107, 0), rgba(255, 157, 196, .5), rgba(255, 214, 107, 0)); border-radius: 50%; animation: spin 9s linear infinite; mask-image: radial-gradient(circle, #000 20%, transparent 68%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%); }
@keyframes spin { to { transform: rotate(360deg); } }
.levelup .capy { position: relative; width: 70%; margin: 4px auto 0; }
.levelup h2 { position: relative; font: 600 32px var(--font-d); color: var(--lav-600); margin-top: 6px; }
.levelup p { position: relative; margin: 4px 0 16px; font-weight: 700; }
.levelup .btn { position: relative; width: 100%; }

@media (min-width: 560px) { body { background-attachment: scroll; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti, .fx-heart { display: none; }
}
