@font-face {
  font-family: "Didact Gothic";
  src: url("fonts/didact-gothic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FBF7F2;
  --ink: #4A4458;
  --ink-soft: #7A7387;
  --card: #FFFFFF;
  --line: #E8E1D8;

  /* muted pastel rainbow */
  --rose: #F3CACA;   --rose-d: #C98585;
  --peach: #F7D9BF;  --peach-d: #C99366;
  --butter: #F5EAB8; --butter-d: #B3A04E;
  --mint: #CFE8D2;   --mint-d: #6FA27A;
  --sky: #CBDFEF;    --sky-d: #6F95B8;
  --lilac: #DFD3EC;  --lilac-d: #9583B3;

  --go: #7DBB86;
  --go-d: #5A9A64;

  /* Century Gothic when the device has it; otherwise a bundled look-alike */
  --word-font: "Century Gothic", "CenturyGothic", "Didact Gothic", "AppleGothic", sans-serif;
  --ui-font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 26px;
  --shadow: 0 5px 0 rgba(74, 68, 88, .07), 0 10px 24px rgba(74, 68, 88, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui-font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: calc(env(safe-area-inset-top) + 6px);
  background: linear-gradient(90deg, var(--rose), var(--peach), var(--butter), var(--mint), var(--sky), var(--lilac));
  z-index: 10;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 18px);
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 4px solid var(--sky-d);
  outline-offset: 3px;
}
.sprite { position: absolute; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.brand { flex: 1; margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; }
.icon-btn {
  width: 52px; height: 52px; border: 0; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.icon-btn svg { width: 26px; height: 26px; }
.treat-pill {
  display: flex; align-items: center; gap: 6px;
  height: 52px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  background: var(--peach); box-shadow: var(--shadow);
  font-size: 1.25rem; font-weight: 700;
}
.treat-pill .fish { width: 34px; height: 22px; }
.treat-pill.bump { animation: bump .5s ease; }
.gift-pill {
  display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 14px 0 10px;
  border: 0; border-radius: 999px; background: var(--lilac); box-shadow: var(--shadow);
  font-size: 1.2rem; font-weight: 700; animation: pulse 1.8s ease-in-out infinite;
}
.gift-pill svg { width: 28px; height: 28px; }

main { flex: 1; display: flex; flex-direction: column; }
.screen {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding-top: 10px;
  animation: fadeIn .25s ease;
}
.screen[hidden] { display: none; }
.prompt { margin: 2px 0 0; font-size: 1.15rem; color: var(--ink-soft); text-align: center; }

/* ---------- home ---------- */
.home-cat { width: min(300px, 78vw); }
.home-greet { margin: -6px 0 0; font-size: 1.15rem; text-align: center; }
.mode-grid { display: grid; gap: 14px; width: 100%; }
.mode-card {
  display: grid; grid-template-columns: 68px 1fr; grid-template-rows: auto auto;
  column-gap: 14px; align-items: center; text-align: left;
  border: 0; border-radius: var(--radius); padding: 14px 18px; min-height: 98px;
  box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.mode-card:active { transform: scale(.98); }
.mode-icon {
  grid-row: span 2; width: 68px; height: 68px; border-radius: 22px;
  background: rgba(255, 255, 255, .7); display: grid; place-items: center;
}
.mode-icon svg { width: 46px; height: 46px; }
.mode-name { font-size: 1.4rem; font-weight: 700; align-self: end; }
.mode-desc { font-size: 1rem; color: var(--ink-soft); align-self: start; }
.mode-listen { background: var(--sky); }
.mode-read { background: var(--lilac); }
.mode-kitty { background: var(--peach); }
.mode-challenge { background: var(--rose); }
.mode-room { background: var(--mint); }
.mode-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-card.small {
  grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: start;
  row-gap: 4px; position: relative; padding: 14px 16px;
}
.mode-card.small .mode-icon { grid-row: auto; width: 56px; height: 56px; border-radius: 18px; }
.mode-card.small .mode-icon svg { width: 38px; height: 38px; }
.mode-card.small .mode-name { font-size: 1.2rem; }
.mode-card.small .mode-desc { font-size: .92rem; }
.badge {
  position: absolute; top: 10px; right: 12px; min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 999px; background: var(--rose-d); color: #fff; font-weight: 700;
  display: grid; place-items: center;
}
.grownups {
  margin-top: auto; border: 0; background: transparent; color: var(--ink-soft);
  display: flex; gap: 8px; align-items: center; padding: 14px; font-size: 1rem;
}
.grownups svg { width: 22px; height: 22px; }

/* ---------- mode 1 ---------- */
.talk-btn {
  width: 156px; height: 156px; border-radius: 50%; border: 0;
  background: var(--butter);
  box-shadow: 0 8px 0 rgba(179, 160, 78, .45), 0 18px 34px rgba(74, 68, 88, .12);
  display: grid; place-items: center;
  transition: transform .1s ease, box-shadow .1s ease;
}
.talk-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 rgba(179, 160, 78, .45), 0 10px 20px rgba(74, 68, 88, .12); }
.talk-btn svg { width: 104px; height: 104px; }
.speaking .wave { animation: wave .9s ease-in-out infinite; }
.speaking .wave.w2 { animation-delay: .18s; }

.choices { display: grid; gap: 14px; width: 100%; }
.word-btn {
  border: 0; border-radius: var(--radius); min-height: 96px; padding: 8px 16px 14px;
  font-family: var(--word-font); font-size: clamp(2.7rem, 13vw, 3.7rem); line-height: 1;
  color: var(--ink); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}
.word-btn:nth-child(1) { background: var(--rose); }
.word-btn:nth-child(2) { background: var(--mint); }
.word-btn:nth-child(3) { background: var(--lilac); }
.word-btn:active { transform: scale(.97); }
.correct { box-shadow: 0 0 0 6px var(--go), var(--shadow) !important; }
.shake { animation: shake .45s ease; }

.feedback { min-height: 1.5em; margin: 0; font-size: 1.6rem; font-weight: 700; text-align: center; }
.feedback.good { color: var(--go-d); animation: pop .35s ease; }
.feedback.try { color: var(--rose-d); animation: pop .35s ease; }

/* ---------- mode 2 ---------- */
.word-card {
  width: 100%; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: var(--word-font); font-size: clamp(3.6rem, 19vw, 5.2rem); line-height: 1.05;
  text-align: center; padding: 26px 12px 34px;
  border: 3px solid var(--line);
}
.sounds { display: flex; gap: 16px; justify-content: center; width: 100%; }
.sound-btn {
  flex: 1; max-width: 124px; aspect-ratio: 1; border: 0; border-radius: 30px;
  display: grid; place-items: center; position: relative;
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.sound-btn svg { width: 60%; height: 60%; }
.sound-btn:nth-child(1) { background: var(--peach); }
.sound-btn:nth-child(2) { background: var(--sky); }
.sound-btn:nth-child(3) { background: var(--butter); }
.sound-btn .num {
  position: absolute; top: 8px; left: 12px; font-weight: 700; font-size: .95rem; color: var(--ink-soft);
}
.sound-btn[aria-checked="true"] {
  transform: translateY(-6px);
  box-shadow: 0 0 0 5px var(--ink), 0 14px 26px rgba(74, 68, 88, .18);
}
.check-btn {
  width: 124px; height: 124px; border-radius: 50%; border: 0;
  background: var(--go);
  box-shadow: 0 8px 0 var(--go-d), 0 18px 30px rgba(74, 68, 88, .14);
  display: grid; place-items: center;
  transition: transform .1s ease, background .2s ease, box-shadow .1s ease;
}
.check-btn svg { width: 70px; height: 70px; }
.check-btn:not(:disabled) { animation: pulse 1.6s ease-in-out infinite; }
.check-btn:not(:disabled):active { transform: translateY(5px); box-shadow: 0 3px 0 var(--go-d); animation: none; }
.check-btn:disabled { background: #DAD5CE; box-shadow: 0 8px 0 #C4BEB5; cursor: default; }

/* ---------- kitty ---------- */
.cat-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.cat-stage { position: relative; width: min(340px, 88vw); }
.fly-layer { position: absolute; inset: 0; pointer-events: none; }
.heart { position: absolute; width: 30px; height: 30px; animation: floatUp 1.3s ease-out forwards; }
.heart svg { width: 100%; height: 100%; }
.cat-mood { margin: 0; font-size: 1.35rem; font-weight: 700; text-align: center; }
.meter {
  width: min(320px, 84vw); height: 22px; border-radius: 999px; overflow: hidden;
  background: #EEE8E0;
}
.meter i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--rose), var(--peach), var(--butter), var(--mint), var(--sky), var(--lilac));
  transition: width .6s ease;
}
.feed-btn {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  min-height: 72px; padding: 14px 32px; border: 0; border-radius: 999px;
  background: var(--peach); box-shadow: 0 7px 0 rgba(201, 147, 102, .5);
  font-size: 1.45rem; font-weight: 700;
  transition: transform .1s ease;
}
.feed-btn .fish { width: 44px; height: 28px; }
.feed-btn:not(:disabled):active { transform: translateY(4px); }
.feed-btn:disabled { opacity: .5; cursor: default; }
.feed-all-btn { margin-top: -4px; }
.feed-all-btn[hidden] { display: none; }
.feed-all-btn svg { width: 36px; height: 22px; }
.feed-all-btn:disabled { opacity: .5; cursor: default; }
.meter-label { margin-top: 4px; font-size: .95rem; font-weight: 700; color: var(--ink-soft); }
.hint { margin: 0; color: var(--ink-soft); text-align: center; font-size: 1.05rem; }

/* cat drawing */
.cat-svg .tail { transform-box: fill-box; transform-origin: 0% 100%; animation: wag 2.6s ease-in-out infinite; }
.cat-wrap[data-happy="2"] .tail { animation-duration: 1.4s; }
.cat-wrap[data-happy="3"] .tail { animation-duration: .9s; }
.cat-svg .breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
.cat-svg .mouth-open { display: none; }
.cat-wrap.chomp .mouth-open { display: inline; }
.cat-wrap.chomp .mouth { display: none; }

.flying {
  position: fixed; left: 0; top: 0; width: 44px; height: 28px;
  pointer-events: none; z-index: 60;
}
.flying svg { width: 100%; height: 100%; }

/* ---------- grown-ups ---------- */
.settings { align-items: stretch; gap: 12px; }
.settings h2 { margin: 12px 0 0; font-size: 1.25rem; }
.help { margin: 0; color: var(--ink-soft); line-height: 1.4; }
.help.small { font-size: .95rem; margin-top: 8px; }
textarea, input:not([type="range"]), select {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--ink);
  border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--card);
  -webkit-user-select: text; user-select: text;
}
textarea { font-family: var(--word-font); font-size: 1.35rem; resize: vertical; line-height: 1.4; }
input[type="range"] { width: 100%; accent-color: var(--lilac-d); height: 32px; }
.field { display: grid; gap: 6px; font-weight: 600; }
.rate-val { font-weight: 400; color: var(--ink-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.primary, .ghost {
  min-height: 50px; padding: 12px 18px; border-radius: 16px; font-weight: 700;
}
.primary { border: 0; background: var(--mint); box-shadow: 0 4px 0 rgba(111, 162, 122, .45); }
.ghost { border: 2px solid var(--line); background: var(--card); }
.ghost.danger { color: var(--rose-d); }
.status { margin: 0; min-height: 1.3em; font-weight: 600; }
.status.ok { color: var(--go-d); }
.status.err { color: var(--rose-d); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--word-font); font-size: 1.4rem; line-height: 1;
  padding: 6px 14px 9px; border-radius: 999px; background: var(--sky);
}
.chip:nth-child(6n+1) { background: var(--rose); }
.chip:nth-child(6n+2) { background: var(--peach); }
.chip:nth-child(6n+3) { background: var(--butter); }
.chip:nth-child(6n+4) { background: var(--mint); }
.chip:nth-child(6n+5) { background: var(--sky); }
.chip:nth-child(6n+6) { background: var(--lilac); }

.note { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--butter); line-height: 1.4; }
.toggle { display: flex; align-items: center; gap: 12px; font-weight: 600; min-height: 48px; }
.toggle input { width: 28px; height: 28px; accent-color: var(--go-d); flex: none; }
.rec-list { display: grid; gap: 10px; }
.rec-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
}
.rec-row.recording { border-color: var(--rose-d); background: #FFF6F6; }
.rec-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rec-word { font-family: var(--word-font); font-size: 1.7rem; line-height: 1.1; overflow-wrap: anywhere; }
.rec-tag { font-size: .9rem; color: var(--ink-soft); }
.rec-tag.mine { color: var(--go-d); font-weight: 700; }
.rec-tag.natural { color: #6F5F96; font-weight: 600; }
.rec-actions { display: flex; gap: 8px; flex: none; }
.rec-btn {
  min-width: 48px; height: 48px; border: 0; border-radius: 14px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700;
}
.rec-btn svg { width: 22px; height: 22px; }
.rec-btn.record { background: var(--rose); }
.rec-btn.stop { background: var(--rose-d); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.rec-btn.play { background: var(--sky); }
.rec-btn.delete { background: #F1ECE6; color: var(--rose-d); }
.rec-btn:disabled { opacity: .4; cursor: default; }
@media (max-width: 380px) { .rec-btn span { display: none; } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------- small / large screens ---------- */
@media (max-height: 720px) {
  .talk-btn { width: 124px; height: 124px; }
  .talk-btn svg { width: 84px; height: 84px; }
  .word-btn { min-height: 80px; }
  .home-cat { width: min(190px, 55vw); }
  .check-btn { width: 104px; height: 104px; }
}
@media (min-width: 700px) {
  .brand { font-size: 1.5rem; }
}

/* ---------- motion ---------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes wave { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes wag { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(9deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.025); } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0) scale(.6); } to { opacity: 0; transform: translateY(-90px) scale(1.15); } }


/* ---------- streak paws ---------- */
.streak { display: grid; justify-items: center; gap: 6px; margin-top: auto; padding-top: 6px; }
.paws { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 360px; }
.paw { width: 26px; height: 26px; fill: #E6E0D8; transition: transform .2s ease; }
.paws.small .paw { width: 18px; height: 18px; }
.paw.on { transform: scale(1.12); }
.paw.c0 { fill: #E59A9A; } .paw.c1 { fill: #E8AE7C; } .paw.c2 { fill: #D4BE5E; }
.paw.c3 { fill: #86BC90; } .paw.c4 { fill: #86AED3; } .paw.c5 { fill: #A994CF; }
.streak-label { color: var(--ink-soft); font-size: .98rem; text-align: center; }

/* ---------- big buttons ---------- */
.big-btn {
  min-height: 68px; padding: 14px 34px; border: 0; border-radius: 999px;
  font-size: 1.45rem; font-weight: 700; background: var(--peach);
  box-shadow: 0 7px 0 rgba(201, 147, 102, .5);
}
.big-btn.go { background: var(--go); color: #fff; box-shadow: 0 7px 0 var(--go-d); }
.big-btn:active { transform: translateY(4px); }
.adopt-btn { background: var(--lilac); box-shadow: 0 7px 0 rgba(149, 131, 179, .5); animation: pulse 1.8s ease-in-out infinite; }
.pill-btn {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 10px 18px;
  border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  font-weight: 700; font-size: 1.05rem;
}
.pill-btn svg { width: 28px; height: 28px; }
.row.center { justify-content: center; }
.prompt.big { font-size: 1.35rem; color: var(--ink); }

/* ---------- challenge ---------- */
.ch-panel { width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ch-panel[hidden] { display: none; }
.ch-hero { width: 130px; height: 130px; margin-top: 10px; }
.ch-title { margin: 0; font-size: 1.45rem; text-align: center; line-height: 1.35; }
.ch-best { margin: 0; font-size: 1.15rem; color: var(--ink-soft); }
.ch-hud { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.pie { position: relative; width: 112px; height: 112px; justify-self: start; }
.pie svg { width: 100%; height: 100%; display: block; }
.pie-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.3rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.ch-score { display: grid; justify-items: center; }
.ch-score-num { font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ch-score-num.bump { animation: bump .4s ease; }
.ch-score-label { color: var(--ink-soft); }
.talk-btn.mini { width: 96px; height: 96px; justify-self: end; }
.talk-btn.mini svg { width: 64px; height: 64px; }
.ch-times-up { margin: 20px 0 0; font-size: 2.4rem; font-weight: 800; color: var(--rose-d); }
.ch-result { margin: 0; font-size: 2rem; font-weight: 700; text-align: center; }
.ch-new-best {
  margin: 0; padding: 10px 22px; border-radius: 999px; font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(90deg, var(--rose), var(--peach), var(--butter), var(--mint), var(--sky), var(--lilac));
  animation: pop .4s ease;
}
.ch-new-best[hidden] { display: none; }

/* ---------- kitty extras ---------- */
.cat-level { margin: -6px 0 0; color: var(--ink-soft); font-weight: 600; }
.meter-wrap { display: grid; justify-items: center; }

/* ---------- closet ---------- */
.closet-cat { width: min(280px, 74vw); }
.closet-banner {
  margin: 0; width: 100%; padding: 12px 16px; border-radius: 18px; background: var(--card);
  border: 2px solid var(--line); text-align: center; font-weight: 600; line-height: 1.4;
  display: grid; justify-items: center; gap: 12px;
}
.closet-banner.gift { background: #F6F0FB; border-color: var(--lilac-d); }
.closet { width: 100%; display: grid; gap: 14px; }
.closet-cat-row h3 { margin: 0 0 8px; font-size: 1.1rem; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.item-tile {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 10px;
  border: 3px solid transparent; border-radius: 20px; background: var(--card); box-shadow: var(--shadow);
  min-height: 112px;
}
.item-art { width: 64px; height: 56px; display: grid; place-items: center; }
.item-art svg { width: 100%; height: 100%; }
.item-name { font-size: .88rem; line-height: 1.2; text-align: center; }
.item-tile.locked .item-art { opacity: .3; filter: grayscale(1); }
.item-tile.locked .item-name { color: var(--ink-soft); }
.item-tile.locked:disabled { cursor: default; box-shadow: none; background: #F3EFEA; }
.item-tile.pickable { border: 3px dashed var(--lilac-d); background: #FBF8FE; animation: wiggle 2.4s ease-in-out infinite; }
.item-tile.pickable .item-art { opacity: .55; filter: grayscale(.4); }
.item-tile.worn { border-color: var(--go); background: #F3FAF4; }
.item-tile.worn::after {
  content: "✓"; position: absolute; top: 6px; left: 8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--go); color: #fff; font-weight: 800; font-size: .9rem; display: grid; place-items: center;
}
.item-lock { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; }

/* ---------- kitty room ---------- */
/* A little dollhouse: each row of two kittens is its own room with striped wallpaper and a wooden
   floor. Kittens are drawn in a fixed frame whose floor line is the same for every kitten. */
.room { position: relative; width: 100%; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); background: #E8CFB4; }
.room-window {
  position: absolute; top: 14px; left: 50%; z-index: 1; width: 112px; height: 64px; transform: translateX(-50%);
  border-radius: 14px; border: 5px solid #FFFFFF; background: linear-gradient(to bottom, #CBDFEF, #E6F0F8);
  box-shadow: 0 2px 0 rgba(74, 68, 88, .08);
}
.room-window::after { content: ""; position: absolute; inset: 0 auto 0 50%; width: 5px; background: #fff; transform: translateX(-50%); }
.room-kittens { display: grid; }
.room-row {
  display: flex; justify-content: center;
  background: repeating-linear-gradient(90deg, #F6EEF8 0 26px, #F1E6F5 26px 52px);
}
.room-row:first-child { padding-top: 64px; }
.room-row + .room-row { border-top: 8px solid #D9BC9C; } /* the ceiling of the room below */
.room-kitten, .room-empty {
  flex: 0 0 50%; min-width: 0; display: grid; justify-items: center; align-content: start;
  padding: 0; border: 0; border-radius: 0; background: transparent; font: inherit; color: inherit;
}
.room-kitten .cat-wrap, .room-empty .cat-wrap { width: 100%; }
.room-kitten .cat-wrap svg, .room-empty .cat-wrap svg { display: block; width: 100%; height: auto; }
.room-kitten > span, .room-empty > span { width: 100%; text-align: center; background: #E8CFB4; }
.room-name { font-weight: 700; font-size: 1.1rem; padding-top: 2px; }
.room-name.muted { color: #B9A9D6; }
.room-tag { font-size: .85rem; color: var(--ink-soft); padding: 0 4px 12px; }
.room-kitten:active .cat-wrap { transform: scale(.97); }
/* A kitten alone in the last row: the floor runs the full width and the kitten stays its usual size. */
.room-row > :only-child { flex-basis: 100%; }
.room-row > :only-child .cat-wrap {
  background: linear-gradient(to bottom, transparent 85.3%, #D9BC9C 85.3% 87.2%, #E8CFB4 87.2%);
}
.room-row > :only-child .cat-wrap svg { width: 50%; margin: 0 auto; }

/* ---------- adopt ---------- */
.adopt-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adopt-card {
  display: grid; justify-items: center; gap: 2px; border: 0; border-radius: 20px;
  background: var(--card); box-shadow: var(--shadow); padding: 10px 6px 14px;
}
.adopt-card .cat-wrap { width: 100%; }
.adopt-card .room-name, .adopt-card .room-tag { padding: 0; }

/* ---------- level-up dialog ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px;
  background: rgba(74, 68, 88, .35); animation: fadeIn .2s ease;
}
.dialog {
  width: min(420px, 100%); background: var(--bg); border-radius: 30px; padding: 26px 22px 20px;
  display: grid; justify-items: center; gap: 12px; text-align: center; box-shadow: 0 20px 50px rgba(74, 68, 88, .25);
}
.dialog h2 { margin: 0; font-size: 2rem; }
.dialog p { margin: 0; font-size: 1.2rem; line-height: 1.4; }
.dialog-gift { width: 90px; height: 90px; animation: bump 1s ease infinite; }

/* ---------- grown-ups extras ---------- */
.settings h3 { margin: 10px 0 0; font-size: 1.1rem; }
.summary { margin: 0; font-weight: 700; }
.summary.warn { color: var(--rose-d); }
.chips.bank { gap: 8px; }
.bank-chip {
  border: 2px dashed #D9D1C7; background: var(--card); color: var(--ink-soft);
  font-family: var(--word-font); font-size: 1.35rem; line-height: 1; padding: 7px 14px 10px; border-radius: 999px;
}
.bank-chip.on { border: 2px solid transparent; color: var(--ink); }
.chips .bank-chip:not(.on) { background: var(--card); }
.bank-chip.on:nth-child(6n+1) { background: var(--rose); } .bank-chip.on:nth-child(6n+2) { background: var(--peach); }
.bank-chip.on:nth-child(6n+3) { background: var(--butter); } .bank-chip.on:nth-child(6n+4) { background: var(--mint); }
.bank-chip.on:nth-child(6n+5) { background: var(--sky); } .bank-chip.on:nth-child(6n+6) { background: var(--lilac); }
.removing .bank-chip { border: 2px solid var(--rose-d); background: #FFF5F5; color: var(--rose-d); }
.removing .bank-chip::after { content: " ×"; font-family: var(--ui-font); font-weight: 700; }
.rec-phrase { font-size: 1.1rem; font-weight: 600; }

@keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-3deg); } 96% { transform: rotate(3deg); } }

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

/* Starter list picker on the home screen */
.list-pick { width: 100%; text-align: center; }
.list-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; }
.list-buttons button { min-height: 44px; border: 0; border-radius: 13px; background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.list-buttons button[data-list="one"][aria-pressed="true"] { background: var(--rose); }
.list-buttons button[data-list="two"][aria-pressed="true"] { background: var(--sky); }
.list-buttons button[data-list="both"][aria-pressed="true"] { background: var(--mint); }
.list-buttons button:focus-visible { outline: 3px solid var(--lilac-d); outline-offset: 2px; }
.list-note { margin: 6px 0 0; font-size: .9rem; opacity: .8; }
