/* Cutie Quest app layout. Component looks live in ui.css. */

#app { max-width: 480px; margin: 0 auto; padding: 0 12px calc(96px + env(safe-area-inset-bottom)); min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--cq-ink-soft); font-size: .88rem; }
.center { text-align: center; }
.stack { display: grid; gap: 14px; }
.outlined {
  color: #fff8ea;
  text-shadow: 0 2px 0 var(--cq-ink), 2px 0 0 var(--cq-ink), -2px 0 0 var(--cq-ink), 0 -2px 0 var(--cq-ink), 1.5px 1.5px 0 var(--cq-ink), -1.5px 1.5px 0 var(--cq-ink), 1.5px -1.5px 0 var(--cq-ink), -1.5px -1.5px 0 var(--cq-ink);
}

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  margin: 0 -12px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: linear-gradient(180deg, #7f88adf2 70%, #7f88ad00);
}
.hud .me { position: relative; width: 52px; height: 52px; flex: none; padding: 0; background: var(--cq-paper); border: 3px solid var(--cq-ink); border-radius: 50%; overflow: hidden; box-shadow: 0 3px 0 #5b3a3166; }
.hud .me cq-chibi { width: 100%; height: 100%; }
.hud .who { flex: 1; min-width: 0; line-height: 1.1; }
.hud .who b { display: block; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .who small { font-weight: 600; font-size: .8rem; display: inline-flex; align-items: center; gap: 2px; }
.hud .who small svg { width: 16px; height: 16px; }
.hud cq-pill { min-width: 64px; }
.hud .snd { width: 36px; height: 36px; padding: 5px; border: 0; background: none; flex: none; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 10px;
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, #e9c9bdf5 60%, #e9c9bd00);
  pointer-events: none;
}
.nav button {
  pointer-events: auto;
  position: relative;
  width: 62px; height: 62px; padding: 0;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, #ffe8c4, var(--cq-peach) 60%, var(--cq-peach-deep));
  border: 3px solid var(--cq-ink); border-radius: 50%;
  box-shadow: 0 5px 0 var(--cq-ink);
  transition: transform .15s var(--cq-bounce), box-shadow .15s;
}
.nav button svg { width: 30px; height: 30px; margin-top: -9px; }
.nav button span { position: absolute; bottom: 1px; left: -8px; right: -8px; font-weight: 700; font-size: .8rem; }
.nav button[aria-current="page"] { transform: translateY(-8px) scale(1.08); background: radial-gradient(circle at 35% 28%, #fff6d8, var(--cq-gold) 60%, var(--cq-gold-deep)); }
.nav button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--cq-ink); }
.nav .new { background: radial-gradient(circle at 35% 28%, #dffbf0, var(--cq-mint) 60%, var(--cq-mint-deep)); }

/* ---------- the two of us on stage ---------- */
.duo { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 30px; }
.duo .seat { position: relative; padding: 0; border: 0; background: none; text-align: center; }
.duo cq-chibi { aspect-ratio: 4 / 4.4; }
.duo .name { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap; }
.duo .vs {
  position: absolute; left: 50%; top: 44%; z-index: 2; transform: translate(-50%, -50%) rotate(-6deg);
  width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--cq-rose); border: 3px solid var(--cq-ink); border-radius: 50%;
  font-weight: 700; box-shadow: 0 3px 0 var(--cq-ink);
}
.duo .empty { aspect-ratio: 4 / 4.4; display: grid; place-items: center; padding: 12px; border: 3px dashed var(--cq-ink); border-radius: 16px; background: #fff3e080; font-weight: 600; }

/* ---------- goal cards ---------- */
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; }
.goal { margin-bottom: 14px; }
.goal .top { display: flex; align-items: flex-start; gap: 8px; }
.goal .emoji { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.7rem; background: var(--cq-paper); border: 3px solid var(--cq-ink); border-radius: 14px; transform: rotate(-4deg); }
.goal .top h3 { font-size: 1.12rem; line-height: 1.15; }
.goal .top .grow { flex: 1; min-width: 0; }
.goal .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.goal .lane { margin-top: 8px; }
.goal .lane-head { display: flex; align-items: baseline; gap: 6px; font-weight: 700; padding: 0 4px; }
.goal .lane-head .amt { margin-left: auto; font-weight: 600; font-size: .88rem; }
.goal .lane-head svg { width: 20px; height: 20px; align-self: center; }
.goal .say { margin: 8px 0 0; padding: 6px 10px; background: var(--cq-paper); border-radius: 12px; font-weight: 600; font-size: .92rem; }
.goal .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.goal .acts .sp { flex: 1; }
.goal cq-stamp { position: absolute; right: 10px; top: 8px; z-index: 3; }
.goal.done-me { background: #e9f7e6; }
.prize { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: .82rem; font-weight: 600; color: var(--cq-ink-soft); align-items: center; }
.prize span { display: inline-flex; align-items: center; gap: 2px; }
.prize svg { width: 16px; height: 16px; }
.empty-note { text-align: center; padding: 18px 10px; font-weight: 600; }

/* ---------- reward modal ---------- */
.loot { display: grid; gap: 8px; margin: 12px 0 16px; }
.loot > div { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--cq-paper-2); border: 3px solid var(--cq-ink); border-radius: 14px; font-weight: 700; animation: cq-pop .45s var(--cq-bounce) both; }
.loot > div:nth-child(2) { animation-delay: .12s; } .loot > div:nth-child(3) { animation-delay: .24s; } .loot > div:nth-child(4) { animation-delay: .36s; }
.loot svg { width: 30px; height: 30px; flex: none; }
.loot .gain { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.loot .gain span { display: inline-flex; align-items: center; gap: 2px; }
.loot .gain svg { width: 22px; height: 22px; }
.big-emoji { font-size: 3.2rem; text-align: center; animation: cq-pop .5s var(--cq-bounce) both; }

/* ---------- forms in modals ---------- */
.emoji-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.emoji-row::-webkit-scrollbar { display: none; }
.emoji-row button { flex: none; width: 42px; height: 42px; font-size: 1.35rem; background: var(--cq-paper-2); border: 3px solid transparent; border-radius: 12px; padding: 0; }
.emoji-row button[aria-pressed="true"] { border-color: var(--cq-ink); background: var(--cq-gold); transform: rotate(-5deg) scale(1.08); }
.ratio { display: grid; gap: 6px; padding: 10px; background: var(--cq-paper-2); border-radius: 14px; margin-bottom: 12px; }
.ratio .cq-row .num { width: 84px; flex: none; }
.ratio .eq { text-align: center; font-weight: 700; font-size: 1.3rem; line-height: .8; }
.ratio small { font-weight: 700; padding-left: 4px; }
.preview-line { padding: 8px 10px; background: #fff; border: 2px dashed var(--cq-peach-deep); border-radius: 12px; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
.type-pick { display: grid; gap: 12px; }
.type-pick button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; background: var(--cq-paper-2); border: 3px solid var(--cq-ink); border-radius: 16px; box-shadow: 0 4px 0 var(--cq-ink); }
.type-pick button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cq-ink); }
.type-pick svg { width: 46px; height: 46px; flex: none; }
.type-pick b { display: block; font-size: 1.1rem; }

/* ---------- closet ---------- */
.closet-stage { display: grid; place-items: center; margin: 4px 0 12px; }
.closet-stage cq-chibi { width: min(62%, 230px); aspect-ratio: 4 / 5; box-shadow: 0 5px 0 #5b3a3155; }
.items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.item { position: relative; padding: 3px 3px 2px; background: var(--cq-paper-2); border: 3px solid #5b3a3140; border-radius: 14px; text-align: center; min-width: 0; }
.item .pic { aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #fffaf1; }
.item .pic svg { width: 100%; height: 100%; display: block; }
.item small { display: block; font-weight: 600; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item .cost { display: inline-flex; align-items: center; gap: 1px; font-weight: 700; font-size: .78rem; }
.item .cost svg { width: 16px; height: 16px; }
.item .lock { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; }
.item .on { position: absolute; top: -8px; left: -6px; width: 26px; height: 26px; }
.item[aria-pressed="true"] { border-color: var(--cq-ink); background: var(--cq-gold); box-shadow: 0 3px 0 var(--cq-ink); transform: translateY(-2px); }
.buybar { position: sticky; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; background: var(--cq-paper); border: 3px solid var(--cq-ink); border-radius: 16px; box-shadow: 0 4px 0 var(--cq-ink); animation: cq-pop .3s var(--cq-bounce) both; }
.buybar .grow { flex: 1; min-width: 0; font-weight: 700; line-height: 1.15; }
.buybar .cq-btn svg { width: 20px; height: 20px; }

/* ---------- us / feed ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats > div { padding: 10px; background: var(--cq-paper-2); border-radius: 14px; text-align: center; font-weight: 700; }
.stats .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; margin-top: 4px; font-size: .9rem; }
.stats .row span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.stats svg { width: 20px; height: 20px; }
.feed { display: grid; gap: 8px; }
.feed > div { display: flex; gap: 8px; align-items: flex-start; font-size: .93rem; }
.feed .fi { flex: none; width: 30px; height: 30px; display: grid; place-items: center; background: var(--cq-paper-2); border-radius: 50%; }
.feed time { display: block; font-size: .75rem; color: var(--cq-ink-soft); }

/* ---------- auth ---------- */
.auth { padding-top: calc(28px + env(safe-area-inset-top)); }
.logo { text-align: center; margin-bottom: 26px; }
.logo h1 { font-size: 2.6rem; font-weight: 700; line-height: 1; transform: rotate(-3deg); }
.logo p { font-weight: 600; margin-top: 6px; color: #fff8ea; }
.logo .pair { display: flex; justify-content: center; margin-bottom: -4px; }
.logo .pair cq-chibi { width: 110px; height: 138px; }
.logo .pair cq-chibi + cq-chibi { margin-left: -24px; }
.style-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.style-pick button { padding: 4px 4px 6px; background: var(--cq-paper-2); border: 3px solid #5b3a3140; border-radius: 16px; font-weight: 700; }
.style-pick button[aria-pressed="true"] { border-color: var(--cq-ink); background: var(--cq-gold); box-shadow: 0 4px 0 var(--cq-ink); transform: translateY(-2px); }
.style-pick cq-chibi { height: 110px; }

/* ---------- cheers ---------- */
.cheers { display: grid; gap: 8px; }
.cheers .cq-btn { justify-content: flex-start; white-space: normal; text-align: left; }
.cheer-in { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.cheer-in cq-chibi { width: 112px; height: 140px; flex: none; }
.cheer-in .bubbles { display: grid; gap: 8px; flex: 1; }
.cheer-in .bubbles p { position: relative; padding: 10px 12px; background: #fff; border: 3px solid var(--cq-ink); border-radius: 16px; font-weight: 700; font-size: 1.1rem; animation: cq-pop .5s var(--cq-bounce) both; }
.cheer-in .bubbles p:first-child::before { content: ''; position: absolute; left: -11px; top: 16px; width: 16px; height: 16px; background: #fff; border-left: 3px solid var(--cq-ink); border-bottom: 3px solid var(--cq-ink); transform: rotate(45deg); }
.duo + .cq-btn { margin-top: -12px; }

/* ---------- house ---------- */
.house { margin-top: 4px; }
.h-stage { position: relative; border: 3px solid var(--cq-ink); border-radius: 18px; overflow: hidden; box-shadow: 0 5px 0 #5b3a3155;
  background: radial-gradient(ellipse 120px 34px at 22% 16%, #ffffff66 0 60%, transparent 62%), radial-gradient(ellipse 150px 40px at 80% 30%, #ffffff4d 0 60%, transparent 62%), linear-gradient(180deg, #a9b6dc, #d8c6dc 60%, #f5d6c6); }
.h-stage canvas { display: block; width: 100%; touch-action: none; cursor: grab; }
.h-tl, .h-tr { position: absolute; top: 8px; display: flex; gap: 6px; }
.h-tl { left: 8px; } .h-tr { right: 8px; flex-direction: column; }
.h-tl button, .h-tr button { min-width: 38px; height: 38px; padding: 0 8px; font-weight: 700; background: var(--cq-paper); border: 2.5px solid var(--cq-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--cq-ink); }
.h-tl button[aria-pressed="true"] { background: var(--cq-gold); transform: translateY(2px); box-shadow: 0 1px 0 var(--cq-ink); }
.h-tl button:active, .h-tr button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cq-ink); }
.h-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 8px; align-items: center; min-height: 48px; padding: 6px 8px 8px 12px; background: #fff3e0f2; border: 2.5px solid var(--cq-ink); border-radius: 14px; font-weight: 700; font-size: .9rem; line-height: 1.15; }
.h-bar[hidden] { display: none; }
.h-bar .grow { flex: 1; min-width: 0; }
.h-acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0; }
.h-acts button { padding: 6px 2px; font-weight: 700; font-size: .74rem; background: var(--cq-paper-2); border: 3px solid var(--cq-ink); border-radius: 14px; box-shadow: 0 4px 0 var(--cq-ink); transition: transform .12s var(--cq-bounce); }
.h-acts button span { display: block; font-size: 1.5rem; line-height: 1.2; }
.h-acts button[aria-pressed="true"] { background: var(--cq-gold); transform: translateY(3px); box-shadow: 0 1px 0 var(--cq-ink); }
.house cq-tabs { margin-top: 12px; }
.h-panel { padding: 16px 12px 12px; }
.h-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.h-cats::-webkit-scrollbar, .h-grid::-webkit-scrollbar { display: none; }
.h-cats button { flex: none; padding: 3px 11px; font-weight: 700; font-size: .82rem; background: var(--cq-paper-2); border: 2.5px solid #5b3a3140; border-radius: 999px; }
.h-cats button[aria-pressed="true"] { background: var(--cq-gold); border-color: var(--cq-ink); }
.h-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 76px; gap: 8px; overflow-x: auto; padding: 8px 4px 4px; scrollbar-width: none; }
.h-cell { position: relative; padding: 3px 3px 2px; background: var(--cq-paper-2); border: 3px solid #5b3a3140; border-radius: 14px; text-align: center; min-width: 0; min-height: 92px; }
.h-cell img, .h-cell > .cq-ic:not(.lock):first-child { display: block; width: 100%; aspect-ratio: 1; height: auto; padding: 0; }
.h-cell > .cq-ic:not(.lock):first-child { padding: 14px; }
.h-cell small { display: block; font-weight: 600; font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-cell .cost { display: inline-flex; align-items: center; gap: 1px; font-weight: 700; font-size: .74rem; }
.h-cell .cost svg { width: 15px; height: 15px; }
.h-cell .lock { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; }
.h-cell[aria-pressed="true"] { border-color: var(--cq-ink); background: var(--cq-gold); box-shadow: 0 3px 0 var(--cq-ink); transform: translateY(-2px); }
.h-catlist { display: grid; gap: 6px; }
.h-catlist > div { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--cq-paper-2); border-radius: 12px; }
.h-catlist small { margin-left: auto; }
.h-cat { width: 44px; height: 44px; flex: none; }
.h-cat svg, .h-coats svg { width: 100%; height: 100%; display: block; }
.h-coats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.h-coats button { flex: none; width: 56px; height: 56px; padding: 2px; background: var(--cq-paper-2); border: 3px solid transparent; border-radius: 14px; }
.h-coats button[aria-pressed="true"] { border-color: var(--cq-ink); background: var(--cq-gold); transform: rotate(-4deg) scale(1.06); }

/* ---------- live presence ---------- */
.duo .presence { position: absolute; top: 8px; right: 8px; z-index: 2; border: 2px solid var(--cq-ink); background: var(--cq-paper); }
.duo .presence[tone="mint"] { background: #b9efdc; }
.h-chip { position: absolute; left: 8px; top: 54px; max-width: 70%; padding: 2px 10px; font-weight: 700; font-size: .78rem; background: #fff3e0e6; border: 2px solid var(--cq-ink); border-radius: 999px; pointer-events: none; }
.h-chip[hidden] { display: none; }
.h-chip::before { content: '○ '; }
.h-chip.on { background: #b9efdce6; }
.h-chip.on::before { content: '● '; color: #2f9f78; }

/* ---------- garden & cat boutique ---------- */
.h-main .cq-btn { padding: 6px 8px; font-size: .92rem; min-width: 0; }
.g-seeds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.g-seeds button { position: relative; padding: 6px 4px; background: var(--cq-paper-2); border: 3px solid var(--cq-ink); border-radius: 14px; box-shadow: 0 3px 0 var(--cq-ink); text-align: center; min-width: 0; }
.g-seeds button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cq-ink); }
.g-seeds .em, .g-plant .em, .g-basket .em { display: block; font-size: 1.8rem; line-height: 1.15; }
.g-seeds b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-seeds small { display: flex; justify-content: center; align-items: center; gap: 1px; font-size: .7rem; font-weight: 600; color: var(--cq-ink-soft); }
.g-seeds small svg { width: 13px; height: 13px; }
.g-seeds .cost, .h-coats .cost { display: inline-flex; align-items: center; gap: 1px; margin-top: 2px; padding: 0 6px; font-weight: 700; font-size: .72rem; background: var(--cq-gold); border-radius: 999px; }
.g-seeds .cost svg, .h-coats .cost svg { width: 14px; height: 14px; }
.g-seeds .lock, .h-coats .lock { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; }
.g-plant { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--cq-paper-2); border-radius: 14px; }
.g-plant .em { font-size: 2.4rem; }
.g-plant .grow, .g-basket .grow { flex: 1; min-width: 0; }
.g-basket { display: grid; gap: 6px; }
.g-basket > div { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--cq-paper-2); border-radius: 12px; }
.g-basket small { display: flex; align-items: center; gap: 1px; }
.g-basket small svg { width: 14px; height: 14px; }
.h-cat.big { width: 76px; height: 76px; }
.h-coats.tall button { position: relative; width: 68px; height: auto; padding: 2px 2px 4px; text-align: center; }
.h-coats.tall { padding-top: 8px; }
.h-coats.tall { align-items: flex-start; }
.h-coats.tall > button > svg:not(.lock) { height: 52px; }
.h-coats.tall .cost { white-space: nowrap; }
.h-coats.tall .cost svg { width: 14px; height: 14px; }
.h-coats.tall small { display: block; font-size: .62rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
