:root {
  --bg: #fff8e7;
  --ink: #3b2a4a;
  --yellow: #ffd84d;
  --blue: #7cc6ff;
  --pink: #ff9cc8;
  --green: #6fdc8c;
  --card: #ffffff;
  --shadow: 0 4px 0 rgba(59, 42, 74, 0.18);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button, label, input { font: inherit; color: inherit; } /* (plain `label` so .big-btn sizes win) */
button { cursor: pointer; }

#app { position: fixed; inset: 0; }

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.screen.active { display: flex; }

/* the making screens: a calm, soft paper colour, so the drawing is the star */
.screen:not(.room) { background: linear-gradient(175deg, #fff8e7 0%, #fff3e6 60%, #f8f0ff 100%); }
.screen:not(.room) > * { position: relative; }

.title-bar, .top { width: 100%; max-width: 640px; display: flex; align-items: center; gap: 10px; }
.title-bar { justify-content: space-between; }
h1 { margin: 6px 0; font-size: clamp(22px, 6.4vw, 40px); white-space: nowrap; letter-spacing: 0.5px; transform: rotate(-2deg); }
h1::after { content: ""; display: inline-block; width: 0.85em; height: 0.85em; vertical-align: -0.1em; background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Cellipse%20cx%3D%2232%22%20cy%3D%2242%22%20rx%3D%2213%22%20ry%3D%2211%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Cellipse%20cx%3D%2214%22%20cy%3D%2226%22%20rx%3D%226%22%20ry%3D%228%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%20transform%3D%22rotate(-20%2014%2026)%22%2F%3E%3Cellipse%20cx%3D%2226%22%20cy%3D%2216%22%20rx%3D%226%22%20ry%3D%228%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%20transform%3D%22rotate(-5%2026%2016)%22%2F%3E%3Cellipse%20cx%3D%2240%22%20cy%3D%2216%22%20rx%3D%226%22%20ry%3D%228%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%20transform%3D%22rotate(5%2040%2016)%22%2F%3E%3Cellipse%20cx%3D%2252%22%20cy%3D%2226%22%20rx%3D%226%22%20ry%3D%228%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%20transform%3D%22rotate(20%2052%2026)%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; margin-left: 0.3em; }
h2 { margin: 0; font-size: clamp(20px, 5.5vw, 28px); }
.hint { margin: 0; max-width: 520px; text-align: center; font-size: 17px; opacity: 0.8; }

.icon-btn {
  width: 48px; height: 48px; flex: none;
  border: none; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font-size: 24px; display: grid; place-items: center;
}
.icon-btn:active, .big-btn:active, .tool-btn:active, .pet-card:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.18); }

.big-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 420px; min-height: 64px; padding: 12px 20px;
  border: none; border-radius: 22px; box-shadow: var(--shadow);
  font-size: 22px; font-weight: 700; cursor: pointer;
}
.big-btn.small { width: auto; min-height: 52px; font-size: 19px; flex: 1; max-width: 220px; }
.yellow { background: var(--yellow); }
.blue { background: var(--blue); }
.pink { background: var(--pink); }
.green { background: var(--green); }

.choice-list { display: flex; flex-direction: column; gap: 14px; width: 100%; align-items: center; margin-top: 8px; }

.row { display: flex; gap: 10px; align-items: center; justify-content: center; width: 100%; max-width: 560px; flex-wrap: wrap; }
.tool-btn {
  min-width: 52px; height: 52px; padding: 0 12px;
  border: none; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font-size: 22px; font-weight: 600;
}
.tool-btn.wide { font-size: 17px; }
.tool-btn.on { background: var(--yellow); }
.slider-row span { font-size: 15px; opacity: 0.7; }
.slider-row input { flex: 1; accent-color: #9b5de5; height: 32px; }

.row-end { display: flex; gap: 8px; }

/* pet collection */
.pet-grid {
  width: 100%; max-width: 640px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px;
  padding-bottom: 24px;
}
.pet-card {
  position: relative; aspect-ratio: 1 / 1.1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 24px; background: var(--card); box-shadow: var(--shadow);
  padding: 10px; cursor: pointer;
}
.pet-card img { width: 100%; height: 72%; object-fit: contain; }
.pet-card.new { background: var(--yellow); }
.pet-card .plus { font-size: 64px; line-height: 1; font-weight: 800; }
.pet-name { font-weight: 700; font-size: 18px; }
.pet-card .mood { position: absolute; top: 8px; left: 10px; font-size: 22px; }
.pet-card .del {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px;
  border: none; border-radius: 50%; background: #f1e9f5; font-size: 14px; opacity: 0.7;
}

/* creation stages */
.stage {
  flex: 1; min-height: 0; width: 100%; max-width: 560px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 24px; background: #fff; box-shadow: var(--shadow); padding: 10px;
}
.stage canvas { max-width: 100%; max-height: 100%; touch-action: none; }
.checker {
  background-color: #fff;
  background-image: linear-gradient(45deg, #f1ecf6 25%, transparent 25%), linear-gradient(-45deg, #f1ecf6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1ecf6 75%), linear-gradient(-45deg, transparent 75%, #f1ecf6 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.pad-wrap { width: 100%; max-width: 520px; aspect-ratio: 1; flex: none; }
#pad {
  width: 100%; height: 100%; touch-action: none;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow);
}
.swatches { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 520px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #d9cfe0; }
.swatch.on { box-shadow: 0 0 0 4px var(--ink); }

#name-input {
  flex: 1; max-width: 320px; height: 56px; padding: 0 16px;
  border: 3px solid #e6dcef; border-radius: 18px; background: #fff;
  font-size: 24px; font-weight: 700; text-align: center;
}

/* pet room */
.room { padding: 0; overflow: hidden; touch-action: none; }
.room > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#room-front { touch-action: none; }
/* the paw that shows how: over the food tray and the buttons it reaches into, under a sheet or a card */
#room-hint { z-index: 3; pointer-events: none; }
.room-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: max(10px, env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}
.room-top > * { pointer-events: auto; }
.room-name {
  flex: 1; min-width: 0; text-align: center;
  font-size: 24px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.9); padding: 8px 14px; border-radius: 18px; box-shadow: var(--shadow);
}
/* small buttons with a word under the picture, so nobody has to guess */
.lbl-btn {
  width: 56px; height: 56px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: none; border-radius: 18px; background: #fff; box-shadow: var(--shadow); padding: 0;
}
.lbl-btn .ic { font-size: 24px; line-height: 1; }
.lbl-btn small { font-size: 11px; font-weight: 800; letter-spacing: 0.2px; }
.lbl-btn.help { background: #fff3b0; }
.lbl-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.18); }

/* the four needs: picture, name, bar. Low ones turn red, say why, and wiggle */
.stats { display: flex; gap: 6px; flex: 1 1 100%; }
.stat {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, 0.92); padding: 5px 7px 5px 5px; border-radius: 16px;
  box-shadow: 0 2px 0 rgba(59, 42, 74, 0.12); border: 2px solid transparent;
}
.s-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #f4ecf7; display: grid; place-items: center; font-size: 17px; }
.s-body { flex: 1; min-width: 0; }
.s-body small { display: block; font-size: 12px; font-weight: 800; line-height: 1.1; margin-bottom: 3px; white-space: nowrap; }
.stat i { display: block; height: 10px; border-radius: 6px; background: #eadfe9; overflow: hidden; }
.stat.low { border-color: #ff5b5b; background: #fff0f0; }
.stat.low small { color: #e03a3a; }
@media (min-width: 700px) {
  .stats { flex: 0 1 auto; margin-left: auto; gap: 8px; }
  .stat { flex: none; width: 116px; }
}
.stat b { display: block; height: 100%; border-radius: 6px; transition: width 0.3s; }
.stat.low { animation: wiggle 0.8s infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

/* the four big care buttons: each has its own colour, says its name, and when it's
   switched on it fills with colour and says how to switch it off (Close, Stop, Done…) */
.t-feed { --tc: #ff6f6f; --tl: #ffe3e3; }
.t-play { --tc: #3fa7ff; --tl: #dff0ff; }
.t-wash { --tc: #22c3b5; --tl: #d9f7f3; }
.t-sleep { --tc: #8b6cff; --tl: #ece6ff; }
.room-bar {
  position: absolute; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 2;
  transform: translateX(-50%);
  display: flex; gap: 8px;
}
.room-bar button {
  position: relative;
  width: 80px; height: 82px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 3px solid #fff; border-radius: 24px; background: #fff;
  box-shadow: 0 5px 0 var(--tc), 0 8px 16px rgba(59, 42, 74, 0.18);
}
.room-bar .ic {
  width: 44px; height: 44px; border-radius: 50%; background: var(--tl);
  display: grid; place-items: center; font-size: 26px; line-height: 1;
}
.room-bar button b { font-size: 15px; font-weight: 900; color: var(--tc); line-height: 1; white-space: nowrap; }
.room-bar button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--tc); }
.room-bar button.on { background: var(--tc); }
.room-bar button.on b { color: #fff; }
.room-bar button.on .ic { background: rgba(255, 255, 255, 0.9); }
.room-bar .need {
  position: absolute; top: -8px; right: -6px; width: 26px; height: 26px; border-radius: 50%;
  background: #ff3b3b; color: #fff; font-style: normal; font-weight: 900; font-size: 17px;
  display: none; place-items: center; border: 3px solid #fff;
}
.room-bar button.needed:not(.on) { animation: need-glow 1.2s ease-in-out infinite; }
.room-bar button.needed:not(.on) .need { display: grid; animation: need-bounce 1.2s ease-in-out infinite; }
@keyframes need-glow {
  0%, 100% { box-shadow: 0 5px 0 var(--tc), 0 0 0 0 rgba(255, 216, 77, 0); }
  50% { box-shadow: 0 5px 0 var(--tc), 0 0 0 7px rgba(255, 216, 77, 0.9); }
}
@keyframes need-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* the guide line: always says, in words, what you can do right now */
.room-guide {
  position: absolute; left: 50%; z-index: 2;
  top: calc(max(10px, env(safe-area-inset-top)) + 128px);
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 0 rgba(59, 42, 74, 0.15);
  pointer-events: none;
}
.room-guide.hidden { display: none; }
.room-guide.pop { animation: guide-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.room-guide .g-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff3b0; display: grid; place-items: center; font-size: 24px; }
.room-guide p { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.room-guide b { color: #d63d7a; }
@media (min-width: 700px) { .room-guide { top: calc(max(10px, env(safe-area-inset-top)) + 76px); } }
@keyframes guide-pop { from { transform: translateX(-50%) scale(0.85); opacity: 0; } }

/* what the pet says, in a bubble that follows its head */
.pet-say {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  translate: -50% -100%;
  max-width: min(220px, calc(100vw - 24px)); padding: 10px 16px; border-radius: 22px;
  background: #fff; font-size: 18px; font-weight: 800; text-align: center; line-height: 1.2;
  box-shadow: 0 4px 14px rgba(59, 42, 74, 0.2);
}
.pet-say::after {
  content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -10px;
  border: 10px solid transparent; border-bottom: 0; border-top-color: #fff;
}
.pet-say.hidden { display: none; }
.pet-say.pop { animation: say-pop 0.4s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes say-pop { from { scale: 0.3; opacity: 0; } }
.room.birthing .pet-say, .room.birthing .room-guide, .room.birthing .help-wrap { display: none; }

/* help: everything you can do, in big pictures and short words */
.help-wrap {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(40, 20, 60, 0.45);
}
.help-wrap.hidden { display: none; }
.help-card {
  width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto;
  background: #fffaf0; border-radius: 28px; padding: 18px 18px 16px;
  box-shadow: 0 10px 40px rgba(40, 20, 60, 0.35);
  animation: say-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.help-card h3 { margin: 0 0 6px; font-size: 24px; text-align: center; }
.help-card h4 { margin: 14px 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.6; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.help-list li { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 8px 12px 8px 8px; }
.help-list .hi {
  flex: none; min-width: 48px; height: 48px; padding: 0 4px; border-radius: 14px;
  background: var(--tl, #f4ecf7); display: grid; place-items: center; font-size: 24px; letter-spacing: -6px;
}
.help-list b { display: block; font-size: 17px; }
.help-list div { font-size: 15px; line-height: 1.3; }
.help-bars { margin: 0 0 14px; font-size: 16px; line-height: 1.4; background: #fff; border-radius: 16px; padding: 10px 12px; }
.help-bars .good { color: #2e9c55; font-weight: 900; }
.help-bars .bad { color: #e03a3a; font-weight: 900; }
.help-card .big-btn { max-width: none; }

/* coming alive: the buttons wait off-screen, then bounce in once the pet says hello */
.room-top, .room-bar { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s; }
.room-bar { transition-delay: 0.15s; }
.room.birthing .room-top { transform: translateY(-120%); opacity: 0; pointer-events: none; }
.room.birthing .room-bar { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
.room.birthing .room-top, .room.birthing .room-bar { transition-delay: 0s; }
.room.birthing .food-tray { display: none; }

.birth-hint {
  position: absolute; left: 0; right: 0; top: max(7%, env(safe-area-inset-top)); z-index: 3;
  text-align: center; color: #fff; pointer-events: none;
  animation: hint-in 0.7s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: opacity 0.3s, transform 0.3s;
}
.birth-hint p { margin: 0 24px; font-size: 24px; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 10px rgba(30, 10, 60, 0.6); }
.birth-hint b { color: var(--yellow); }
.birth-hint .dots { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.birth-hint .dots i {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85); background: transparent;
}
.birth-hint .dots i.on { background: var(--yellow); border-color: #fff; animation: dot-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 0 14px #ffd84d; }
.birth-hint.go { opacity: 0; transform: scale(1.2); }
.birth-hint.hidden { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-20px) scale(0.9); } }
@keyframes dot-pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }

.birth-banner {
  position: absolute; left: 0; right: 0; top: 12%; z-index: 3;
  text-align: center; pointer-events: none;
  transition: opacity 0.45s, transform 0.45s;
}
.birth-banner small {
  display: block; font-size: 20px; font-weight: 800; color: #6b4b8a;
  animation: hint-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.birth-banner b { display: block; font-size: clamp(44px, 14vw, 76px); font-weight: 900; line-height: 1.1; }
.birth-banner b span {
  display: inline-block; color: #ff5d8f;
  -webkit-text-stroke: 2px #fff; paint-order: stroke fill;
  text-shadow: 0 4px 0 #c23a6b, 0 8px 18px rgba(80, 20, 60, 0.35);
  animation: letter-pop 0.6s cubic-bezier(0.34, 1.8, 0.64, 1) both, letter-bob 1.6s 0.8s ease-in-out infinite;
}
.birth-banner b span:nth-child(3n+2) { color: #ffb020; text-shadow: 0 4px 0 #c47a00, 0 8px 18px rgba(80, 40, 0, 0.3); }
.birth-banner b span:nth-child(3n) { color: #3fb4ff; text-shadow: 0 4px 0 #1f7cc0, 0 8px 18px rgba(0, 40, 80, 0.3); }
.birth-banner.out { opacity: 0; transform: translateY(-30px) scale(0.9); }
.birth-banner.hidden { display: none; }
@keyframes letter-pop { 0% { opacity: 0; transform: translateY(40px) scale(0.2) rotate(-20deg); } 100% { opacity: 1; transform: none; } }
@keyframes letter-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

.food-tray {
  position: absolute; left: 50%; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 100px); z-index: 2;
  transform: translateX(-50%);
  display: flex; gap: 6px; padding: 8px; max-width: calc(100% - 24px); overflow-x: auto;
  background: rgba(255, 255, 255, 0.92); border-radius: 22px; box-shadow: var(--shadow);
  touch-action: none;
}
.food-tray.hidden { display: none; }
.food { width: 52px; height: 52px; flex: none; border: none; background: none; font-size: 36px; touch-action: none; }

/* step bar: where you are in making a pet */
.steps { display: flex; gap: 6px; width: 100%; max-width: 560px; }
.steps:empty { display: none; }
.steps .st {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 13px; font-weight: 700; opacity: 0.45;
}
.steps .st i { display: block; width: 100%; height: 7px; border-radius: 4px; background: #e6d9ee; }
.steps .st.done { opacity: 0.8; }
.steps .st.done i { background: var(--green); }
.steps .st.now { opacity: 1; }
.steps .st.now i { background: var(--yellow); box-shadow: 0 0 0 2px #3b2a4a22; }

/* big tool buttons in a row */
.tool-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; width: 100%; max-width: 560px; }
.tool-big.small-tool { flex: none; width: 92px; height: 56px; font-size: 22px; }
.tool-big.small-tool span { font-size: 12px; }
.fixbar { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 560px; align-items: center; }
.fixbar .big-btn, #cut-ok, #color-ok { max-width: 560px; }

/* colour choices */

/* colour step: big words, and a big "keep it as I drew it" choice (the default) */
.explain { margin: 0; max-width: 460px; text-align: center; font-size: 18px; line-height: 1.35; }
.choice-now { margin: 0; max-width: 440px; text-align: center; font-size: 18px; font-weight: 800; line-height: 1.35; }
.choice-now i { display: inline-block; vertical-align: -4px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px #3b2a4a; }
.choice-now.flash { color: #d63d7a; }
/* the paint pots: big circles with their name under them. The chosen one gets a tick
   and a dark name tag, and nothing moves or overlaps. */
.colour-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 2px; width: 100%; max-width: 440px; }
/* the picture to colour keeps a good size; the page scrolls a little on small phones instead */
.colour-stage { flex: 1 1 auto; min-height: 260px; }
#screen-color { gap: 8px; }
.colour-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  border: none; background: none; padding: 4px 0 0; color: inherit;
}
.colour-grid i {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px #e0d4e8, 0 3px 0 rgba(59, 42, 74, 0.15);
  font-style: normal; font-size: 22px; font-weight: 900; color: #fff;
}
.colour-grid span { font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 3px; border-radius: 8px; white-space: nowrap; }
.colour-grid button.on i { box-shadow: 0 0 0 3px #3b2a4a, 0 3px 0 rgba(59, 42, 74, 0.15); }
.colour-grid button.on i::after { content: "✓"; color: #fff; font-size: 22px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }
.colour-grid button.on span { background: #3b2a4a; color: #fff; }
.colour-grid i.rainbow {
  background: conic-gradient(#ff5c5c, #ffd054, #6bd26f, #4fc3ff, #7d6bff, #ff6fd2, #ff5c5c);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* colouring tools: a picture, a name, and what it does in a few words */
.col-tools .tool-big { height: auto; min-height: 70px; padding: 6px 4px; gap: 2px; }
.col-tools .tool-big i { font-style: normal; font-size: 26px; line-height: 1; }
.col-tools .tool-big b { font-size: 16px; line-height: 1.1; }
.col-tools .tool-big small { font-size: 11px; font-weight: 600; line-height: 1.15; opacity: 0.75; text-align: center; }
.col-tools .tool-big.on { box-shadow: 0 0 0 3px #3b2a4a, var(--shadow); }

/* make your own colour */
.picker-wrap {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(40, 20, 60, 0.45); padding: 12px;
}
.picker-wrap.hidden { display: none; }
.screen:not(.room) > .picker-wrap { position: fixed; } /* (on top of the page, not in it) */
.picker {
  width: 100%; max-width: 440px; background: #fffaf0; border-radius: 28px; padding: 18px;
  box-shadow: 0 10px 40px rgba(40, 20, 60, 0.35); animation: say-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.picker h3 { margin: 0 0 10px; text-align: center; font-size: 22px; }
.pk-preview { display: flex; justify-content: center; margin-bottom: 4px; }
.pk-preview i { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 2px #e0d4e8, var(--shadow); }
.pk-label { margin: 12px 0 6px; font-size: 16px; font-weight: 800; }
.pk-bar { position: relative; height: 44px; border-radius: 22px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08); touch-action: none; }
.pk-bar.hue { background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); }
.pk-knob {
  position: absolute; top: 50%; width: 38px; height: 38px; border-radius: 50%; translate: -50% -50%;
  border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); pointer-events: none;
}
.pk-buttons { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.pk-buttons .big-btn { flex: 1; min-height: 56px; font-size: 19px; }

/* face: found / fix */
.face-hint { font-size: 18px; font-weight: 600; opacity: 0.9; min-height: 1.4em; }
.face-hint.flash { color: #2e9c55; }
/* colour key on the face check: matches the rings in the picture */
.chip { display: inline-block; margin: 0 4px; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 17px; border: 3px solid; background: #fff; }
.chip.eyes { border-color: #ffb000; }
.chip.mouth { border-color: #ff3d8b; }
.check-bar { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.soft-btn { border: none; background: rgba(255, 255, 255, 0.8); border-radius: 999px; padding: 10px 18px; font-size: 17px; font-weight: 700; box-shadow: 0 2px 0 rgba(59, 42, 74, 0.15); }
.soft-btn:active { transform: translateY(2px); }
.stage.paper { background: #fffdf6; }
.seg {
  display: flex; gap: 6px; width: 100%; max-width: 420px; padding: 6px;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
}
.seg button {
  flex: 1; height: 50px; border: none; border-radius: 15px; background: transparent;
  font-size: 19px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button.on { background: var(--yellow); }
.seg b { min-width: 26px; padding: 1px 8px; border-radius: 10px; background: #3b2a4a; color: #fff; font-size: 14px; }

/* how the eyes look: as drawn, or googly stickers */
.eye-mode { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.eye-mode-q { margin: 0; font-weight: 800; font-size: 17px; }
.eye-seg button { height: auto; min-height: 58px; padding: 6px 8px; gap: 8px; text-align: left; }
.eye-seg button span { display: flex; flex-direction: column; line-height: 1.15; }
.eye-seg button b { background: none; color: inherit; padding: 0; min-width: 0; font-size: 17px; border-radius: 0; }
.eye-seg button small { font-size: 13px; font-weight: 700; opacity: 0.7; }
.eye-seg button.on { box-shadow: inset 0 0 0 3px var(--ink); }
.em-ic { font-style: normal; font-size: 24px; flex: none; }
.em-ic.goo {
  width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); position: relative;
}
.em-ic.goo::after {
  content: ''; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #151515; left: 7px; top: 10px;
  animation: goo-roll 2.4s ease-in-out infinite;
}
@keyframes goo-roll { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-5px, 2px); } 60% { transform: translate(5px, -1px); } }
.eye-mode-note { margin: 0; min-height: 0; font-size: 14px; font-weight: 700; color: #2e9c55; text-align: center; }
.eye-mode-note:empty { display: none; }

/* draw on your pet */
.hidden { display: none !important; }
.edit { gap: 8px; }
.hint.warn { color: #d6336c; opacity: 1; font-weight: 700; }
.edit-stage {
  position: relative; flex: 1; min-height: 0; width: 100%; max-width: 560px;
  overflow: hidden; border-radius: 24px; background: #fff6e0; box-shadow: var(--shadow); touch-action: none;
}
#edit-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; touch-action: none; }
.fit-btn {
  position: absolute; right: 10px; top: 10px;
  border: none; border-radius: 14px; padding: 8px 12px; background: #fff; box-shadow: var(--shadow);
  font-size: 15px; font-weight: 700;
}
.zoom-tip { position: absolute; left: 12px; top: 10px; font-size: 13px; opacity: 0.55; pointer-events: none; white-space: nowrap; }
.edit-tools { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.tool-big {
  flex: 1; height: 64px; border: none; border-radius: 18px; background: #fff; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
}
.tool-big span { font-size: 13px; font-weight: 700; margin-top: 4px; }
.tool-big.on { background: var(--yellow); }
.tool-big.nudge { animation: nudge 0.5s ease-in-out 2; }
@keyframes nudge { 0%, 100% { transform: rotate(0) scale(1); } 30% { transform: rotate(-6deg) scale(1.08); } 70% { transform: rotate(6deg) scale(1.08); } }
#cut-hint.flash { color: #2e9c55; font-weight: 800; }
.tool-big:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.18); }
.edit-palette { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 560px; overflow-x: auto; padding: 4px 2px; flex: none; }
.edit-palette .swatches { flex-wrap: nowrap; }
.edit-palette .swatch { flex: none; }
.sizes { display: flex; gap: 4px; flex: none; padding-right: 6px; border-right: 2px solid #eadfe9; }
.size-dot { width: 40px; height: 40px; border: none; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.size-dot i { display: block; border-radius: 50%; background: var(--ink); }
.size-dot.on { background: var(--yellow); }
.swatch.mine { position: relative; }
.swatch.mine::after {
  content: "★"; position: absolute; right: -6px; top: -8px;
  font-size: 15px; color: #ffb300; text-shadow: 0 0 2px #fff;
}
.link-btn { border: none; background: none; font-size: 15px; opacity: 0.7; text-decoration: underline; padding: 2px 8px; }

.busy {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 248, 231, 0.85); font-size: 22px; font-weight: 700;
}
.busy.hidden { display: none; }
.spinner { font-size: 56px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- making a new pet ---------- */
.fun-title { font-weight: 900; letter-spacing: 0.5px; transform: rotate(-1.5deg); text-shadow: 2px 2px 0 #ffd84d; }
.make-wrap { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }

/* sticker look: thick friendly outline, chunky drop shadow */
.hero-card, .mini-card, .premade {
  border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  cursor: pointer; transition: transform 0.12s;
}
.hero-card:active, .mini-card:active, .premade:active { transform: translateY(4px) !important; box-shadow: 0 1px 0 var(--ink); }

.hero-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border-radius: 28px; background: linear-gradient(135deg, #ffe066, #ffc94d);
}
.hero-art { position: relative; flex: none; width: 128px; height: 108px; }
.hero-art canvas {
  width: 100%; height: 100%; border-radius: 8px; transform: rotate(-6deg);
  box-shadow: 0 3px 0 rgba(59, 42, 74, 0.25), 0 0 0 2px rgba(59, 42, 74, 0.15);
}
.hero-cam {
  position: absolute; right: -10px; bottom: -12px; font-size: 46px; line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(59, 42, 74, 0.3)); animation: snap 2.4s ease-in-out infinite;
}
@keyframes snap { 0%, 70%, 100% { transform: rotate(0) scale(1); } 78% { transform: rotate(-10deg) scale(1.15); } 86% { transform: rotate(6deg) scale(1.05); } }
.hero-text { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.hero-text b { font-size: 24px; font-weight: 900; line-height: 1.1; }
.hero-text small { font-size: 15px; font-weight: 600; opacity: 0.75; line-height: 1.25; }

.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 104px; padding: 12px 8px; border-radius: 24px; font-size: 17px; text-align: center;
}
.mini-card b { font-weight: 800; line-height: 1.15; }
.mini-ico { font-size: 36px; line-height: 1; }
.mini-card.sky { background: #bfe6ff; }
.mini-card.rose { background: #ffc6e2; }

.adopt-title { margin: 8px 0 0; text-align: center; font-size: 22px; font-weight: 900; }
.adopt-sub { margin: 2px 0 0; text-align: center; font-size: 15px; font-weight: 700; opacity: 0.75; }
.adopt-title span { position: relative; display: inline-block; padding: 0 6px; }
.adopt-title span::after { /* a crayon squiggle under it */
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='10'%3E%3Cpath d='M0 5q10-6 20 0t20 0' stroke='%23ff9cc8' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x center / 40px 10px;
}

.premade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 12px; padding: 10px 2px 4px; }
.premade {
  --card: #fff; --tilt: 0deg; --delay: 0s;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 8px;
  border-radius: 22px; background: var(--card); transform: rotate(var(--tilt));
}
.pm-art {
  width: 100%; aspect-ratio: 1; display: grid; place-items: center;
  animation: bob 2.6s ease-in-out infinite; animation-delay: var(--delay);
}
.pm-art canvas, .pm-art .pm-pic { width: 100%; height: 100%; }
.pm-art .pm-pic { display: block; background-repeat: no-repeat; }
.pm-wait { font-style: normal; font-size: 26px; opacity: 0.6; animation: spin 1.2s linear infinite; }
.pm-name {
  font-size: 15px; font-weight: 900; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(1.5deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pm-art, .hero-cam, .pm-wait { animation: none; } }

/* ---------- buttons that need a push: a gentle pulse after a few quiet seconds ---------- */
.big-btn.red { background: #ff6b6b; color: #fff; }
.pulse.go { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); box-shadow: 0 4px 0 rgba(59, 42, 74, 0.18), 0 0 0 8px rgba(111, 220, 140, 0.35); } }
.fix-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- stars ---------- */
.star-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 14px 0 10px;
  border: 3px solid #fff; border-radius: 999px; background: linear-gradient(180deg, #ffe680, #ffc93c);
  box-shadow: 0 3px 0 #d99a00; font-size: 20px; font-weight: 900; color: #6b4300;
}
.star-pill span { font-size: 22px; }
.star-pill.bump { animation: bump 0.45s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.fly-star {
  position: fixed; z-index: 30; font-size: 26px; pointer-events: none;
  animation: fly-star 0.9s cubic-bezier(0.5, 0, 0.75, 0) both;
}
@keyframes fly-star {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  15% { transform: translate(0, -30px) scale(1.3); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.6); opacity: 0.9; }
}

/* ---------- home ---------- */
.pet-card .lvl-badge {
  position: absolute; bottom: 38px; right: 10px; padding: 2px 8px; border-radius: 999px;
  background: #e9f9e7; color: #2e7d3a; font-size: 13px; font-weight: 900;
}
.pet-card .del { width: 26px; height: 26px; font-size: 12px; opacity: 0.45; }
.gift-card { background: linear-gradient(160deg, #ffd6ec, #c9b6ff); }
.gift-card .gift-ic { font-size: 64px; line-height: 1; animation: gift-wiggle 1.8s ease-in-out infinite; }
.gift-card small { font-size: 13px; font-weight: 800; opacity: 0.7; }
@keyframes gift-wiggle { 0%, 60%, 100% { transform: rotate(0) scale(1); } 70% { transform: rotate(-12deg) scale(1.1); } 80% { transform: rotate(10deg) scale(1.1); } 90% { transform: rotate(-6deg); } }

/* ---------- room: name with its level ---------- */
.room-name { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 12px 6px; }
.rn-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.rn-lvl { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; color: #2e7d3a; }
.rn-lvl > i { font-style: normal; font-size: 13px; }
.rn-bar { display: block; width: 64px; height: 7px; border-radius: 4px; background: #e3efe0; overflow: hidden; }
.rn-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6fdc8c, #3fb950); border-radius: 4px; transition: width 0.6s; }
.birth-banner .lv-name { margin-top: 6px; color: #2e7d3a; }

/* ---------- room: the column of extras on the left ---------- */
.room-side {
  position: absolute; left: 10px; z-index: 2; top: calc(max(10px, env(safe-area-inset-top)) + 196px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform 0.6s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s;
}
@media (min-width: 700px) { .room-side { top: calc(max(10px, env(safe-area-inset-top)) + 84px); } }
@media (max-height: 640px) { .room-side { top: calc(max(10px, env(safe-area-inset-top)) + 128px); gap: 5px; } .side-btn { height: 50px; } }
.room-side .star-pill { height: 40px; font-size: 17px; padding: 0 10px 0 8px; }
.side-btn {
  width: 58px; height: 56px; padding: 0; border: 3px solid #fff; border-radius: 18px;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 3px 0 rgba(59, 42, 74, 0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.side-btn .ic { font-size: 23px; line-height: 1; }
.side-btn small { font-size: 10.5px; font-weight: 900; white-space: nowrap; }
.side-btn:active, .star-pill:active { transform: translateY(3px); }
.room.birthing .room-side { transform: translateX(-140%); opacity: 0; pointer-events: none; transition-delay: 0s; }

.friend-pill {
  position: absolute; left: 50%; z-index: 2; transform: translateX(-50%);
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 104px);
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow); font-weight: 800; white-space: nowrap;
}
.friend-pill button { border: none; border-radius: 999px; padding: 8px 14px; background: #ffe3e3; font-weight: 900; flex: none; }
.friend-pill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.friend-pill { max-width: calc(100% - 24px); }
/* "play!": the bigger, brighter one (bye stays the quiet one, so it isn't tapped by mistake) */
.friend-pill .fp-play { background: #ffd84d; padding: 10px 16px; font-size: 1.05em; box-shadow: 0 3px 0 #e0a800; }
.friend-pill .fp-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #e0a800; }
.friend-pill .fp-race { background: #9be7c4; padding: 10px 14px; font-size: 1.05em; box-shadow: 0 3px 0 #3fb27f; }
.friend-pill .fp-race:active { transform: translateY(2px); box-shadow: 0 1px 0 #3fb27f; }
/* (on a phone the three buttons need the whole pill: the "is here" words step aside) */
@media (max-width: 460px) { .friend-pill > span { display: none; } .friend-pill { padding-left: 6px; } }
.room.feeding .friend-pill { display: none; }

/* a game is on: the room's own buttons step aside */
.room.gaming .room-top, .room.gaming .room-bar, .room.gaming .room-side, .room.gaming .room-guide,
.room.gaming .friend-pill, .room.gaming .food-tray { display: none !important; }

/* ---------- the camera flash ---------- */
.flash { position: absolute; inset: 0; z-index: 8; background: #fff; pointer-events: none; opacity: 0; }
.flash.go { animation: flash 0.55s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

/* ---------- sheets that slide up from the bottom ---------- */
.sheet-wrap {
  position: absolute; inset: 0; z-index: 6; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(40, 20, 60, 0) 30%, rgba(40, 20, 60, 0.35));
}
.sheet {
  width: 100%; max-width: 560px; max-height: 62%; overflow-y: auto; overscroll-behavior: contain;
  background: #fffaf0; border-radius: 30px 30px 0 0; box-shadow: 0 -8px 30px rgba(40, 20, 60, 0.25);
  padding: 14px 14px max(16px, env(safe-area-inset-bottom)); animation: sheet-up 0.38s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.sheet-wrap.play .sheet, .sheet-wrap.dress .sheet { max-height: 66%; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet-head h3 { margin: 0; flex: 1; font-size: 24px; font-weight: 900; }
.sheet-x { width: 44px; height: 44px; border: none; border-radius: 50%; background: #f1e9f5; font-size: 18px; font-weight: 900; }
.sheet-stars { font-size: 18px; font-weight: 900; padding: 6px 12px; border-radius: 999px; background: #fff3b0; }
.sheet-sub { margin: 12px 4px 8px; font-size: 16px; font-weight: 800; opacity: 0.75; }
.sheet-empty { margin: 8px 0 14px; font-size: 18px; font-weight: 700; text-align: center; line-height: 1.4; }

.ball-tile {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left;
  border: 3px solid var(--ink); border-radius: 22px; background: #dff0ff; box-shadow: 0 4px 0 var(--ink);
}
.ball-tile b { display: block; font-size: 20px; }
.ball-tile small { font-size: 14px; font-weight: 700; opacity: 0.75; }
.ball-tile:active, .game-tile:active, .it-tile:active, .friend-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.gt-ic { font-size: 38px; line-height: 1; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 380px) { .game-grid { grid-template-columns: 1fr 1fr; } }
.game-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px;
  border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 var(--ink);
  background: linear-gradient(170deg, #fff 0%, color-mix(in srgb, var(--gc) 28%, #fff) 100%);
}
.game-tile .gt-ic { font-size: 44px; filter: drop-shadow(0 3px 0 rgba(59, 42, 74, 0.2)); }
.game-tile b { font-size: 17px; font-weight: 900; }
.game-tile small { font-size: 12.5px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: #fff3b0; }
.game-tile small.new { background: var(--gc); color: #fff; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 5px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.tabs button { border: none; border-radius: 15px; background: transparent; padding: 6px 2px; font-size: 13px; font-weight: 900; display: flex; flex-direction: column; align-items: center; }
.tabs button span { font-size: 24px; line-height: 1.1; }
.tabs button.on { background: var(--yellow); }
.it-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.it-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 8px;
  border: 3px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--ink);
}
.it-tile b { font-size: 13px; font-weight: 900; line-height: 1.1; text-align: center; }
.it-tile.on { background: #e9fbe9; border-color: #2e9c55; box-shadow: 0 4px 0 #2e9c55; }
.it-tile.draw-own { background: linear-gradient(160deg, #fff3b0, #ffc6e2); }
.it-tile.nudge { animation: nudge 0.5s ease-in-out 1; }
.it-emo { font-size: 42px; line-height: 1.1; height: 52px; display: grid; place-items: center; }
.it-img, .it-cv { width: 52px; height: 52px; object-fit: contain; }
.it-room { display: block; width: 58px; height: 54px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(59, 42, 74, 0.15); }
.it-tag { font-style: normal; font-size: 12px; font-weight: 900; padding: 2px 9px; border-radius: 999px; background: #f1e9f5; }
.it-tag.on { background: #2e9c55; color: #fff; }
.it-tag.price { background: #fff3b0; }
.it-tag.price.poor { background: #f1e9f5; opacity: 0.8; }

.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.friend-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 3px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.friend-tile img { width: 80px; height: 80px; object-fit: contain; }
.friend-tile b { font-size: 15px; }
.friend-tile em { font-style: normal; font-size: 12px; font-weight: 900; color: #2e9c55; }
.friend-tile.on { background: #e9fbe9; }

/* ---------- games: the bar at the top ---------- */
.game-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 0;
}
.game-hud .lbl-btn { background: rgba(255, 255, 255, 0.95); }
.gh-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 12px 8px; border-radius: 18px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); }
.gh-name { font-size: clamp(14px, 4.6vw, 18px); font-weight: 900; line-height: 1.1; text-align: center; max-width: 100%; overflow-wrap: anywhere; } /* (a long name gets a little smaller or takes two lines: never cut off) */
.gh-bar { width: 100%; height: 12px; border-radius: 6px; background: #eadfe9; overflow: hidden; }
.gh-bar i { display: block; height: 100%; border-radius: 6px; background: var(--gc, #3fa7ff); transition: width 0.25s linear; }
.gh-bar.low i { background: #ff6b6b; }
/* a game without a clock: the bar is the pet's energy (⚡ at its start), and the button ends it with the stars */
.gh-bar.energy { position: relative; height: 16px; border-radius: 8px; padding-left: 18px; background: #eadfe9 linear-gradient(90deg, #fff3b0 18px, transparent 18px); }
.gh-bar.energy::before { content: '⚡'; position: absolute; left: 2px; top: 50%; transform: translateY(-50%); font-size: 12px; line-height: 1; }
.gh-bar.energy i { background: linear-gradient(180deg, #ffe680, #ffc93c); border-radius: 0 8px 8px 0; }
.gh-bar.energy.low i { background: #ff9f6b; }
.game-hud #game-quit.done { background: #dff7e4; color: #1f6b38; }
.gh-dots { display: flex; gap: 6px; padding: 2px 0; }
.gh-dots i { width: 14px; height: 14px; border-radius: 50%; background: #eadfe9; }
.gh-dots i.done { background: #6fdc8c; }
.gh-dots i.now { background: var(--gc, #ffd84d); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gc, #ffd84d); }
.gh-score {
  display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 14px; border: 3px solid #fff; border-radius: 18px;
  background: linear-gradient(180deg, #ffe680, #ffc93c); box-shadow: 0 3px 0 #d99a00; font-size: 24px; font-weight: 900; color: #6b4300;
}
.gh-score.bump { animation: bump 0.35s cubic-bezier(0.34, 1.8, 0.64, 1); }

/* Pairs: the cards sit at the top, the pet watches from below */
.game-layer { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 82px); width: calc(100% - 24px); max-width: 460px; }
.game-layer.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mcard { aspect-ratio: 0.85; border: none; padding: 0; background: none; perspective: 600px; animation: deal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes deal { from { transform: translateY(-40px) scale(0.3) rotate(-20deg); opacity: 0; } }
.mc-in { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1); transform-style: preserve-3d; }
.mcard.up .mc-in { transform: rotateY(180deg); }
.mc-back, .mc-front {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.mc-back {
  background: repeating-linear-gradient(45deg, #22c3b5 0 10px, #4fd6c9 10px 20px); color: #fff; font-size: 34px; font-weight: 900;
  text-shadow: 0 2px 0 rgba(59, 42, 74, 0.5);
}
.mc-front { background: #fff; transform: rotateY(180deg); font-size: 40px; }
.mc-front img { width: 86%; height: 86%; object-fit: contain; }
.mcard.done .mc-front { background: #e9fbe9; border-color: #2e9c55; box-shadow: 0 4px 0 #2e9c55; }
.mcard.done { animation: matched 0.5s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes matched { 50% { transform: scale(1.15); } }

/* ---------- games: the card before and after ---------- */
.game-card-wrap { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(40, 20, 60, 0.45); }
.game-card {
  position: relative; width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 18px 16px;
  background: #fffaf0; border-radius: 30px; box-shadow: 0 10px 40px rgba(40, 20, 60, 0.35);
  animation: say-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: none; border-radius: 50%; background: #f1e9f5; font-size: 16px; font-weight: 900; }
.gc-title { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gc-title span { font-size: 56px; line-height: 1; animation: bob 2s ease-in-out infinite; }
.gc-title h3 { margin: 0; font-size: 30px; font-weight: 900; color: var(--gc); text-shadow: 0 2px 0 rgba(59, 42, 74, 0.25); }
.gc-how { margin: 0; font-size: 21px; font-weight: 800; text-align: center; line-height: 1.25; }
.gc-best { margin: 0; font-size: 15px; font-weight: 800; opacity: 0.7; }
.gc-long { margin: 0; padding: 4px 12px; border-radius: 999px; background: #fff3b0; font-size: 15px; font-weight: 800; text-align: center; }
.game-card .big-btn { max-width: none; }
.res-pet { width: 120px; height: 120px; object-fit: contain; animation: res-hop 0.9s ease-in-out infinite; }
@keyframes res-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-14px) scale(0.96, 1.05); } 80% { transform: translateY(0) scale(1.06, 0.94); } }
.res-line { margin: 0; font-size: 18px; font-weight: 800; }
.res-stars { display: flex; align-items: center; gap: 8px; padding: 8px 24px; border-radius: 999px; background: linear-gradient(180deg, #ffe680, #ffc93c); box-shadow: 0 4px 0 #d99a00; font-size: 40px; font-weight: 900; color: #6b4300; }
.res-stars.tick span { animation: bump 0.25s ease-out; display: inline-block; }
.modal-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: center; }
.modal-btns.row2 { flex-direction: row; }
.modal-btns.row2 .big-btn { flex: 1; font-size: 20px; }

/* the little moving picture of how to play */
.demo { position: relative; flex: none; width: 240px; height: 140px; border-radius: 20px; background: linear-gradient(180deg, #e9f6ff, #fff6e6); overflow: hidden; box-shadow: inset 0 0 0 3px rgba(59, 42, 74, 0.12); }
.demo i { position: absolute; font-style: normal; line-height: 1; }
.demo .dm-pet { position: absolute; width: 56px; height: 56px; object-fit: contain; }
.dm-hand { font-size: 34px; z-index: 3; filter: drop-shadow(0 2px 2px rgba(40, 20, 60, 0.3)); }
.d-catch .dm-food { font-size: 30px; left: 150px; top: -30px; animation: dm-fall 2.4s ease-in infinite; }
.d-catch .dm-pet { bottom: 6px; left: 40px; animation: dm-slide 2.4s ease-in-out infinite; }
.d-catch .dm-hand { bottom: -10px; left: 66px; animation: dm-slide 2.4s ease-in-out infinite; }
@keyframes dm-fall { 0%, 15% { top: -30px; opacity: 1; } 70% { top: 76px; opacity: 1; } 75%, 100% { top: 80px; opacity: 0; } }
@keyframes dm-slide { 0%, 10% { transform: translateX(0); } 55%, 80% { transform: translateX(92px); } 100% { transform: translateX(0); } }
.d-hop .dm-ground { left: 0; right: 0; bottom: 0; height: 22px; background: #5fc057; }
.d-hop .dm-pet { left: 30px; bottom: 20px; animation: dm-jump 2.4s ease-in-out infinite; }
.d-hop .dm-rock { font-size: 30px; bottom: 18px; left: 250px; animation: dm-rock 2.4s linear infinite; }
.d-hop .dm-hand { right: 22px; top: 30px; animation: dm-tap 2.4s ease-in-out infinite; }
@keyframes dm-rock { from { left: 250px; } to { left: -40px; } }
@keyframes dm-jump { 0%, 22% { transform: translateY(0); } 32% { transform: translateY(-58px); } 46%, 100% { transform: translateY(0); } }
@keyframes dm-tap { 0%, 16% { transform: scale(1) translateY(0); } 21% { transform: scale(0.85) translateY(6px); } 28%, 100% { transform: scale(1) translateY(0); } }
.d-hide .dm-box { font-size: 52px; bottom: 10px; }
.d-hide .b1 { left: 14px; }
.d-hide .b2 { left: 92px; animation: dm-lift 2.6s ease-in-out infinite; }
.d-hide .b3 { left: 170px; }
.d-hide .dm-pet { left: 96px; bottom: 14px; width: 48px; height: 48px; }
.d-hide .dm-hand { left: 110px; top: 150px; animation: dm-tobox 2.6s ease-in-out infinite; }
@keyframes dm-lift { 0%, 45% { transform: translateY(0) rotate(0); } 58%, 85% { transform: translateY(-70px) rotate(12deg); } 100% { transform: translateY(0); } }
@keyframes dm-tobox { 0% { top: 150px; } 30%, 42% { top: 70px; transform: scale(1); } 46% { transform: scale(0.85); } 52% { top: 72px; transform: scale(1); } 75%, 100% { top: 150px; } }
.d-bubbles .dm-bub { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(80, 160, 230, 0.8); background: radial-gradient(circle at 35% 35%, #fff 0 18%, rgba(170, 220, 255, 0.35) 40%, rgba(200, 160, 255, 0.4)); }
.d-bubbles .u1 { left: 30px; animation: dm-rise 3s linear infinite; }
.d-bubbles .u2 { left: 110px; animation: dm-rise2 2.4s linear infinite; }
.d-bubbles .u3 { left: 180px; animation: dm-rise 3.4s linear -1.2s infinite; }
.d-bubbles .dm-pop { left: 104px; top: 40px; font-size: 34px; opacity: 0; animation: dm-pop 2.4s linear infinite; }
.d-bubbles .dm-hand { left: 122px; top: 150px; animation: dm-tobub 2.4s ease-in-out infinite; }
@keyframes dm-rise { from { top: 150px; } to { top: -40px; } }
@keyframes dm-rise2 { 0% { top: 150px; opacity: 1; } 45% { top: 44px; opacity: 1; } 47%, 100% { top: 40px; opacity: 0; } }
@keyframes dm-pop { 0%, 45% { opacity: 0; transform: scale(0.4); } 48% { opacity: 1; transform: scale(1.2); } 62%, 100% { opacity: 0; transform: scale(1.4); } }
@keyframes dm-tobub { 0% { top: 150px; } 40% { top: 64px; transform: scale(1); } 46% { transform: scale(0.85); } 52% { transform: scale(1); top: 66px; } 100% { top: 150px; } }
.d-dance { background: linear-gradient(180deg, #ffe1f0, #e3d4ff); }
.d-dance .dm-pet { left: 50%; top: 20px; margin-left: -28px; animation: dm-dance 0.8s ease-in-out infinite; }
.d-dance .dm-fr { bottom: 10px; font-size: 40px; animation: dm-sing 2.4s ease-out infinite; }
.d-dance .fr1 { left: calc(50% - 110px); }
.d-dance .fr2 { left: calc(50% - 20px); animation-delay: 0.8s; }
.d-dance .fr3 { left: calc(50% + 70px); animation-delay: 1.6s; }
.d-dance .dm-note { bottom: 64px; left: calc(50% - 100px); font-size: 22px; opacity: 0; animation: dm-notes 2.4s linear infinite; }
.d-dance .dm-hand { bottom: -12px; left: calc(50% - 96px); animation: dm-frtap 2.4s ease-in-out infinite; }
@keyframes dm-sing { 0%, 30%, 100% { transform: translateY(0) scale(1); } 8% { transform: translateY(-16px) scale(1.12); } }
@keyframes dm-notes { 0% { opacity: 0; transform: translate(0, 0); } 4% { opacity: 1; } 28% { opacity: 0; transform: translate(6px, -30px); } 33% { opacity: 0; transform: translate(90px, 0); } 37% { opacity: 1; transform: translate(90px, 0); } 61% { opacity: 0; transform: translate(96px, -30px); } 66% { opacity: 0; transform: translate(180px, 0); } 70% { opacity: 1; transform: translate(180px, 0); } 94%, 100% { opacity: 0; transform: translate(186px, -30px); } }
@keyframes dm-frtap { 0% { transform: translate(0, 0); } 5% { transform: translate(0, -6px) scale(0.9); } 25% { transform: translate(0, 10px); } 33% { transform: translate(90px, 10px); } 38% { transform: translate(90px, -6px) scale(0.9); } 58% { transform: translate(90px, 10px); } 66% { transform: translate(180px, 10px); } 71% { transform: translate(180px, -6px) scale(0.9); } 92% { transform: translate(180px, 10px); } 100% { transform: translate(0, 10px); } }
@keyframes dm-dance { 0%, 100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(10deg) translateY(-10px); } }
.d-memory .dm-card { width: 44px; height: 54px; top: 42px; }
.d-memory .dm-card span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 9px; border: 2px solid var(--ink); font-size: 24px; font-weight: 900; }
.d-memory .dm-card span:first-child { background: #22c3b5; color: #fff; }
.d-memory .dm-card span:last-child { background: #fff; opacity: 0; }
.d-memory .c1 { left: 16px; }
.d-memory .c2 { left: 70px; }
.d-memory .c3 { left: 124px; }
.d-memory .c4 { left: 178px; }
.d-memory .c1 span:last-child { animation: dm-show 3s infinite; }
.d-memory .c3 span:last-child { animation: dm-show 3s 0.5s infinite; }
.d-memory .dm-hand { top: 150px; left: 26px; animation: dm-cards 3s ease-in-out infinite; }
@keyframes dm-show { 0%, 18% { opacity: 0; transform: scaleX(0.2); } 25%, 85% { opacity: 1; transform: scaleX(1); background: #e9fbe9; } 92%, 100% { opacity: 0; } }
@keyframes dm-cards { 0% { top: 150px; left: 26px; } 15% { top: 80px; left: 26px; } 30% { top: 80px; left: 134px; } 45% { top: 80px; left: 134px; } 60%, 100% { top: 150px; left: 134px; } }
/* ---- Puzzle: the pet's own picture in pieces ---- */
.game-layer.puz { bottom: 16px; touch-action: none; }
.game-layer.puz.fade { transition: opacity 0.6s; opacity: 0; pointer-events: none; }
.pz-frame { position: absolute; border-radius: 10px; background-size: 100% 100%; box-shadow: 0 0 0 4px #fff, 0 0 0 7px rgba(59, 42, 74, 0.25), 0 8px 20px rgba(59, 42, 74, 0.2); }
.pz-frame::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(255, 250, 240, 0.72); } /* (the picture shows faintly: where things go) */
.pz-frame.glow { animation: pz-glow 0.7s ease-out; }
@keyframes pz-glow { 50% { box-shadow: 0 0 0 4px #fff, 0 0 0 10px #ffd84d, 0 0 40px 10px rgba(255, 216, 77, 0.8); } }
.pz-piece { position: absolute; z-index: 1; border-radius: 6px; background-repeat: no-repeat; touch-action: none; cursor: grab; transform: rotate(var(--r)); box-shadow: 0 0 0 2px #fff, 0 4px 0 rgba(59, 42, 74, 0.25), 0 6px 12px rgba(59, 42, 74, 0.2); animation: deal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.pz-piece.held { z-index: 3; transform: scale(1.08); box-shadow: 0 0 0 3px #ffd84d, 0 12px 24px rgba(59, 42, 74, 0.3); cursor: grabbing; }
.pz-piece.back { transition: left 0.3s, top 0.3s; }
.pz-piece.in { z-index: 0; transform: none; border-radius: 0; box-shadow: none; transition: left 0.15s, top 0.15s; animation: matched 0.4s cubic-bezier(0.34, 1.8, 0.64, 1); }
.pz-piece.hint { animation: pz-wiggle 0.5s ease-in-out 3; }
@keyframes pz-wiggle { 25% { transform: rotate(calc(var(--r) + 8deg)) scale(1.06); } 75% { transform: rotate(calc(var(--r) - 8deg)) scale(1.06); } }
.pz-hand { position: absolute; z-index: 4; font-style: normal; font-size: 44px; pointer-events: none; animation: pz-show 2.4s ease-in-out forwards; }
@keyframes pz-show { 0% { left: var(--fx); top: var(--fy); opacity: 0; } 15% { left: var(--fx); top: var(--fy); opacity: 1; } 75% { left: var(--tx); top: var(--ty); opacity: 1; } 100% { left: var(--tx); top: var(--ty); opacity: 0; } }
/* ---- Shadows ---- */
.game-layer.shd { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.shd-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 18px 8px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.15); animation: deal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.shd-top img { width: min(30vw, 130px); height: min(30vw, 130px); object-fit: contain; }
.shd-top b { font-size: 20px; font-weight: 900; }
.shd-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.shd.n4 .shd-row { grid-template-columns: repeat(2, 1fr); max-width: 330px; }
.shd-card { position: relative; aspect-ratio: 1; padding: 6px; border: none; border-radius: 22px; background: #eef0ff; box-shadow: 0 4px 0 #b9bdf0; animation: deal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.shd-card img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; transition: opacity 0.4s; }
.shd-card .col { opacity: 0; }
.shd-card.right { background: #e9fbe9; box-shadow: 0 4px 0 #2e9c55; animation: matched 0.5s cubic-bezier(0.34, 1.8, 0.64, 1); }
.shd-card.right .col { opacity: 1; }
.shd-card.right .sh { opacity: 0; }
.shd-card.wrong { background: #ece8f0; box-shadow: 0 4px 0 #d3ccdc; animation: pz-no 0.4s; }
.shd-card.wrong img { opacity: 0.22; }
@keyframes pz-no { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
/* ---- the start cards' little films for the new games ---- */
.d-puzzle .dm-frame { left: 60px; top: 14px; width: 120px; height: 110px; border-radius: 8px; background: #fffaf0; box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(59, 42, 74, 0.2); overflow: hidden; }
.d-puzzle .pz-full { left: 0; top: 0; width: 120px; height: 110px; }
.d-puzzle .pz-hole { left: 60px; top: 0; width: 60px; height: 110px; background: #fffaf0; border-left: 2px dashed #c9b8d8; animation: dm-hole 3s infinite; }
.d-puzzle .dm-piece { left: 160px; top: 60px; width: 60px; height: 110px; overflow: hidden; border-radius: 4px; box-shadow: 0 0 0 2px #fff, 0 4px 8px rgba(59, 42, 74, 0.25); background: #fffaf0; animation: dm-piece 3s ease-in-out infinite; }
.d-puzzle .dm-piece img { left: -60px; top: 0; width: 120px; height: 110px; }
.d-puzzle .dm-hand { left: 190px; top: 110px; animation: dm-piecehand 3s ease-in-out infinite; }
@keyframes dm-piece { 0%, 10% { left: 170px; top: 40px; transform: rotate(8deg); } 55%, 100% { left: 120px; top: 14px; transform: rotate(0); box-shadow: none; } }
@keyframes dm-hole { 0%, 54% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes dm-piecehand { 0%, 10% { left: 196px; top: 96px; opacity: 1; } 55% { left: 146px; top: 70px; opacity: 1; } 70%, 100% { left: 146px; top: 70px; opacity: 0; } }
.d-shadow .sd-top { left: 92px; top: 4px; width: 56px; height: 52px; }
.d-shadow .sd-card { top: 64px; width: 62px; height: 62px; border-radius: 14px; background: #eef0ff; box-shadow: 0 3px 0 #b9bdf0; display: grid; place-items: center; }
.d-shadow .sd-card b { font-size: 38px; filter: brightness(0) opacity(0.7); }
.d-shadow .sd-card img { position: static; width: 50px; height: 50px; animation: dm-fillin 2.8s infinite; }
.d-shadow .k1 { left: 14px; }
.d-shadow .k2 { left: 89px; }
.d-shadow .k3 { left: 164px; }
.d-shadow .dm-hand { left: 112px; top: 150px; animation: dm-toshadow 2.8s ease-in-out infinite; }
@keyframes dm-fillin { 0%, 45% { filter: brightness(0) opacity(0.7); } 55%, 100% { filter: none; } }
@keyframes dm-toshadow { 0% { top: 150px; } 38% { top: 96px; transform: scale(1); } 44% { transform: scale(0.85); } 50% { top: 98px; transform: scale(1); } 80%, 100% { top: 150px; } }
.d-path { background: #fffaf0; }
.d-path .dm-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.d-path .dm-line path { fill: none; stroke: #ff5d8f; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 260; animation: dm-draw 3.6s linear infinite; }
.d-path .dm-ledge { left: 14px; top: 52px; width: 40px; height: 6px; border-radius: 3px; background: #a0683c; }
.d-path .dm-goal { left: 196px; top: 70px; font-size: 30px; }
.d-path .dm-pet { left: 0; top: 0; width: 40px; height: 40px; offset-path: path("M34 32 C 90 130, 150 120, 206 84"); offset-rotate: 0deg; animation: dm-ride 3.6s ease-in infinite; }
.d-path .dm-hand { animation: dm-drawhand 3.6s linear infinite; }
@keyframes dm-draw { 0% { stroke-dashoffset: 260; } 40%, 100% { stroke-dashoffset: 0; } }
@keyframes dm-ride { 0%, 45% { offset-distance: 0%; } 85%, 100% { offset-distance: 100%; } }
@keyframes dm-drawhand { 0% { left: 30px; top: 60px; opacity: 1; } 20% { left: 100px; top: 118px; } 40% { left: 196px; top: 108px; opacity: 1; } 45%, 100% { left: 196px; top: 108px; opacity: 0; } }

/* ---------- pop-up cards, the grown-up check, the daily present ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(40, 20, 60, 0.5); }
.modal-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 18px 16px;
  background: #fffaf0; border-radius: 30px; box-shadow: 0 10px 40px rgba(40, 20, 60, 0.35); text-align: center;
  animation: say-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-card h3 { margin: 0; font-size: 24px; font-weight: 900; }
.gate-ic { font-size: 52px; line-height: 1; }
.gate-why { margin: 0; font-size: 16px; font-weight: 600; opacity: 0.8; }
.gate-q { margin: 4px 0 0; font-size: 22px; font-weight: 700; }
.gate-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.gate-opt { height: 58px; border: none; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 24px; font-weight: 900; }
.gate-opt.wrong { background: #ffe3e3; color: #e03a3a; animation: nudge 0.4s; }
.modal-card.gift h3 { font-size: 26px; }
.gift-box { position: relative; width: 150px; height: 150px; border: none; background: none; padding: 0; animation: gift-wiggle 1.8s ease-in-out infinite; }
.gift-box .gift-body { font-size: 120px; line-height: 1; }
.gift-box .gift-lid { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-size: 46px; }
.gift-box.shake { animation: gift-shake 0.45s ease-in-out; }
@keyframes gift-shake { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-14deg) scale(1.08); } 50% { transform: rotate(12deg) scale(1.12); } 75% { transform: rotate(-6deg) scale(1.05); } }
.gift-hint { margin: 0; font-size: 18px; font-weight: 800; }
.gift-dots { display: flex; gap: 10px; }
.gift-dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #d9cfe0; }
.gift-dots i.on { background: var(--yellow); border-color: #f0b400; animation: dot-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.gift-item { font-size: 84px; line-height: 1; animation: letter-pop 0.6s cubic-bezier(0.34, 1.8, 0.64, 1) both; }
.gift-got { margin: 0; font-size: 17px; font-weight: 700; }
.gift-stars { font-size: 46px; font-weight: 900; color: #6b4300; padding: 6px 26px; border-radius: 999px; background: linear-gradient(180deg, #ffe680, #ffc93c); box-shadow: 0 4px 0 #d99a00; animation: letter-pop 0.6s 0.15s cubic-bezier(0.34, 1.8, 0.64, 1) both; }

.toast {
  position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); z-index: 25; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 20px; background: #3b2a4a; color: #fff;
  font-size: 17px; font-weight: 800; text-align: center; line-height: 1.3; box-shadow: 0 8px 24px rgba(40, 20, 60, 0.35);
  transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.toast.pop { animation: toast-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.toast.out { opacity: 0; transform: translate(-50%, -20px); }
@keyframes toast-in { from { transform: translate(-50%, -40px) scale(0.8); opacity: 0; } }
.confetti-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.confetti-layer > i { position: absolute; width: 10px; height: 6px; border-radius: 2px; animation: confetto linear both; }
@keyframes confetto {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  30% { transform: translate(calc(var(--dx) * 0.8), calc(var(--dy) * 0.8)) rotate(calc(var(--r) * 0.3)); }
  100% { transform: translate(var(--dx), calc(var(--dy) + var(--fall))) rotate(var(--r)); opacity: 0; }
}

/* ---------- draw a hat ---------- */
.hat-wrap { position: relative; overflow: hidden; border-radius: 24px; box-shadow: var(--shadow); background: #fff; }
#hat-pad { position: relative; z-index: 1; width: 100%; height: 100%; touch-action: none; }
.hat-head {
  position: absolute; left: 25%; right: 25%; bottom: -26%; aspect-ratio: 1; border-radius: 50%; z-index: 0; pointer-events: none;
  border: 4px dashed rgba(59, 42, 74, 0.28); background: rgba(255, 216, 77, 0.15);
}

/* ---------- the album ---------- */
.album-grid { width: 100%; max-width: 640px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; padding: 14px 4px 24px; }
.polaroid {
  margin: 0; padding: 8px 8px 10px; background: #fff; border-radius: 6px; transform: rotate(var(--tilt, -1deg));
  box-shadow: 0 6px 16px rgba(59, 42, 74, 0.2); cursor: pointer; position: relative;
}
.polaroid::before { content: ""; position: absolute; top: -9px; left: 50%; width: 54px; height: 18px; transform: translateX(-50%) rotate(-3deg); background: rgba(255, 216, 77, 0.7); }
.polaroid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; background: #fff6e0; display: block; }
.polaroid.first img { object-fit: contain; background: #fffdf6; }
.polaroid figcaption { margin-top: 6px; font-size: 14px; font-weight: 700; line-height: 1.25; text-align: center; }
.polaroid figcaption b { display: inline-block; padding: 0 6px; border-radius: 6px; background: #fff3b0; }
.album-tip { grid-column: 1 / -1; text-align: center; font-size: 17px; font-weight: 700; opacity: 0.75; }
.lightbox { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(30, 15, 45, 0.85); }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; padding: 12px 12px 14px; background: #fff; border-radius: 10px; animation: say-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); display: flex; flex-direction: column; }
.lightbox img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.lightbox figcaption { margin-top: 8px; text-align: center; font-size: 18px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { .pulse.go, .gift-card .gift-ic, .gift-box, .res-pet, .gc-title span { animation: none; } }

/* dressing up: the room slides up so the pet is in view above the sheet */
.room > canvas { transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1); }
.room.pan > canvas { transform: translateY(-34%); }
.room.pan .room-top, .room.pan .room-side, .room.pan .room-guide, .room.pan .pet-say, .room.pan .friend-pill { opacity: 0; pointer-events: none; }
.sheet-wrap.dress .sheet { max-height: 56%; }

/* growing up: the banner sits below the top bar, on a light label so it reads over the room */
.birth-banner.lvl { top: calc(max(10px, env(safe-area-inset-top)) + 150px); }
.birth-banner.lvl small { display: table; margin: 0 auto; padding: 3px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); }

/* ================= room HUD, take two: fewer words, bigger pictures ================= */
.room-top { gap: 8px; padding-top: max(10px, env(safe-area-inset-top)); }
.round-btn {
  width: 52px; height: 52px; flex: none; padding: 0; border: 3px solid #fff; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 3px 0 rgba(59, 42, 74, 0.22), 0 6px 14px rgba(59, 42, 74, 0.12);
  display: grid; place-items: center;
}
.round-btn .ic { font-size: 25px; line-height: 1; }
.round-btn.help { background: #fff3b0; }
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.2); }
.room-top .star-pill { height: 52px; padding: 0 12px 0 9px; font-size: 19px; flex: none; }
.room-name {
  height: 52px; justify-content: center; padding: 3px 12px 5px; border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 3px 0 rgba(59, 42, 74, 0.22), 0 6px 14px rgba(59, 42, 74, 0.12);
  border-radius: 20px; font-size: 21px;
}
.rn-bar { width: 72px; }

/* the needs: four rings that empty as they go down */
.needs {
  flex: 1 1 100%; display: flex; justify-content: center; gap: 6px; margin: 2px auto 0; max-width: 340px;
  padding: 6px 10px 5px; border-radius: 26px; background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 4px 14px rgba(59, 42, 74, 0.12);
}
.need { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: none; background: none; }
.need .ring {
  --v: 100%; --c: #3fcf6e;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) var(--v), rgba(59, 42, 74, 0.12) 0);
  transition: --v 0.4s;
}
.need .ic { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 21px; line-height: 1; box-shadow: inset 0 -2px 0 rgba(59, 42, 74, 0.08); }
.need small { font-size: 11.5px; font-weight: 900; white-space: nowrap; color: #4b3a5c; }
.need.low small { color: #fff; background: #ff5b5b; padding: 1px 7px; border-radius: 999px; }
.need.low .ring { animation: need-bounce 1s ease-in-out infinite; }
.need:active .ring { transform: scale(0.92); }

.room-guide { top: calc(max(10px, env(safe-area-inset-top)) + 140px); }
@media (min-width: 700px) {
  .needs { flex: 0 1 auto; margin: 0 0 0 auto; }
  .room-guide { top: calc(max(10px, env(safe-area-inset-top)) + 80px); }
}

/* the extra tools: a slim frosted column on the right */
.room-side {
  left: auto; right: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 206px); gap: 6px; padding: 6px;
  border-radius: 24px; background: rgba(255, 255, 255, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(59, 42, 74, 0.12);
}
@media (min-width: 700px) { .room-side { top: calc(max(10px, env(safe-area-inset-top)) + 140px); } }
@media (max-height: 700px) { .room-side { top: calc(max(10px, env(safe-area-inset-top)) + 150px); } .side-btn { width: 52px; height: 48px; } .side-btn small { font-size: 9.5px; } }
.side-btn { width: 56px; height: 54px; border-width: 2px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 0 rgba(59, 42, 74, 0.18); }
.room.birthing .room-side { transform: translateX(140%); }

/* the four care buttons sit in a frosted dock */
.room-bar.dock {
  gap: 8px; padding: 8px; border-radius: 34px;
  background: rgba(255, 255, 255, 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(59, 42, 74, 0.18), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

@property --v { syntax: "<percentage>"; inherits: true; initial-value: 100%; }

.room-name .rn-name { font-size: 19px; line-height: 1.1; padding-top: 1px; }
.room-name { gap: 1px; }

/* ================= the other screens: friendlier, clearer, more fun ================= */
/* a paper backdrop with faint crayon doodles (stars, hearts, swirls) */
.screen:not(.room) {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='0.16'%3E%3Cpath d='M30 40l6 12 13 2-10 9 3 13-12-7-12 7 3-13-10-9 13-2z' stroke='%23ffb000'/%3E%3Cpath d='M160 50c-8-10-24 0-14 12l14 12 14-12c10-12-6-22-14-12z' stroke='%23ff5d8f'/%3E%3Cpath d='M50 160c10-14 30-14 30 0s-20 14-20 4 10-8 12-2' stroke='%233fa7ff'/%3E%3Cpath d='M150 150q10-14 20 0t20 0' stroke='%2322c3b5'/%3E%3Ccircle cx='110' cy='100' r='6' stroke='%23b07cff'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 220px 220px,
    linear-gradient(175deg, #fff8e7 0%, #fff3e6 55%, #f6eeff 100%);
}

/* home */
.home-sub { margin: -6px 0 0; width: 100%; max-width: 640px; font-size: 17px; font-weight: 800; opacity: 0.75; }
.pet-card:not(.new):not(.gift-card) {
  background: radial-gradient(120% 90% at 50% 100%, var(--tint, #fff) 0 55%, #fff 56%);
  border: 3px solid #fff; box-shadow: 0 5px 0 rgba(59, 42, 74, 0.16), 0 10px 22px rgba(59, 42, 74, 0.1);
}
.pet-card img { animation: card-bob 3s ease-in-out infinite; animation-delay: var(--delay, 0s); transform-origin: 50% 100%; filter: drop-shadow(0 6px 4px rgba(59, 42, 74, 0.15)); }
@keyframes card-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(0.98, 1.02); } }
.pet-card .pet-name { padding: 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); }
.pet-card.new {
  background: linear-gradient(160deg, #ffe066, #ffc94d); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
}
.pet-card.new .plus { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.25); font-size: 52px; animation: plus-pop 2.4s ease-in-out infinite; }
@keyframes plus-pop { 0%, 80%, 100% { transform: scale(1) rotate(0); } 88% { transform: scale(1.12) rotate(90deg); } }
.pet-card.new .pet-name { font-size: 19px; }

/* headers and step bars on the making screens */
.top { min-height: 52px; }
/* the header (back button and title) stays at the top while the screen scrolls */
.screen:not(.room) > header.top, .screen:not(.room) > header.title-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; flex: none;
  padding: 4px 0; background: #fff8e7;
  box-shadow: 0 -100vmax 0 100vmax #fff8e7; /* (fills the full width and up to the top edge, but not below) */
}
.screen.scrolled > header.top, .screen.scrolled > header.title-bar { filter: drop-shadow(0 3px 3px rgba(59, 42, 74, 0.12)); }
.top h2 { flex: 1; }
.top .icon-btn { border-radius: 50%; }
/* the back button: a chunky dark arrow on a bright round button, easy to spot on any screen */
.icon-btn.back {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--blue); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  font-size: 0; color: transparent; position: relative; padding: 0;
}
/* (the arrow sits exactly in the middle: placed on its own, so the hidden "←" text for screen
   readers can't push it up; a hair to the right, as the arrow's head makes it look left-heavy) */
.icon-btn.back::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; transform: translateX(1px);
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20d%3D%22M26%2016H8M15%207l-9%209%209%209%22%20fill%3D%22none%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%225%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}
.icon-btn.back:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.steps { padding: 6px 10px; border-radius: 18px; background: rgba(255, 255, 255, 0.75); box-shadow: 0 2px 0 rgba(59, 42, 74, 0.08); }
.steps .st { font-size: 14px; flex-direction: row; justify-content: center; gap: 6px; flex-wrap: wrap; }
.steps .st i { width: 100%; height: 8px; }
.steps .st.done::before { content: "✓"; color: #2e9c55; font-weight: 900; }
.steps .st.now::before { content: ""; display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.1em; background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Cg%20transform%3D%22translate(32%2032)%20rotate(40)%22%3E%3Crect%20x%3D%22-6%22%20y%3D%22-26%22%20width%3D%2212%22%20height%3D%2242%22%20rx%3D%222%22%20fill%3D%22%23ffd84d%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M-6%2016h12L0%2030z%22%20fill%3D%22%23fff3d6%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M-2%2026h4L0%2030z%22%20fill%3D%22%233b2a4a%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Crect%20x%3D%22-6%22%20y%3D%22-32%22%20width%3D%2212%22%20height%3D%228%22%20rx%3D%223%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Crect%20x%3D%22-6%22%20y%3D%22-25%22%20width%3D%2212%22%20height%3D%224%22%20rx%3D%220%22%20fill%3D%22%23dcd6ea%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat; }
.stage { border: 3px solid #fff; box-shadow: 0 5px 0 rgba(59, 42, 74, 0.12), 0 12px 26px rgba(59, 42, 74, 0.1); }
.big-btn { border: 3px solid rgba(255, 255, 255, 0.7); }
.big-btn.green { background: linear-gradient(180deg, #7fe69a, #4fcf76); color: #173d24; box-shadow: 0 5px 0 #2f9a52; }
.big-btn.yellow { background: linear-gradient(180deg, #ffe680, #ffcd3c); box-shadow: 0 5px 0 #d99a00; }
.big-btn.green:active, .big-btn.yellow:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.25); }
.tool-big { border: 2px solid #fff; }
.tool-big.on { box-shadow: 0 0 0 3px var(--ink), var(--shadow); }

/* "working magic": a card with a pencil that draws sparkles */
.busy { background: rgba(255, 248, 231, 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.busy-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 34px 18px; border-radius: 30px; background: #fff; box-shadow: 0 10px 30px rgba(59, 42, 74, 0.18); animation: say-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.busy-card p { margin: 0; font-size: 21px; font-weight: 900; }
.busy-art { position: relative; width: 110px; height: 80px; }
.b-pencil { position: absolute; left: 34px; top: 14px; font-size: 44px; animation: scribble 0.9s ease-in-out infinite; }
.b-spark { position: absolute; font-size: 22px; opacity: 0; animation: spark 1.5s ease-out infinite; }
.b-spark.s1 { left: 6px; top: 6px; } .b-spark.s2 { right: 4px; top: 0; animation-delay: 0.5s; } .b-spark.s3 { right: 14px; bottom: 0; animation-delay: 1s; }
@keyframes scribble { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(10px, 4px) rotate(10deg); } 50% { transform: translate(-6px, 8px) rotate(-6deg); } 75% { transform: translate(8px, -2px) rotate(6deg); } }
@keyframes spark { 0% { opacity: 0; transform: scale(0.3) rotate(0); } 30% { opacity: 1; transform: scale(1.2) rotate(40deg); } 100% { opacity: 0; transform: scale(0.8) rotate(90deg); } }
.busy-dots { display: flex; gap: 6px; }
.busy-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ffc93c; animation: need-bounce 0.9s ease-in-out infinite; }
.busy-dots i:nth-child(2) { animation-delay: 0.15s; background: #ff8fb8; } .busy-dots i:nth-child(3) { animation-delay: 0.3s; background: #7cc6ff; }
@media (prefers-reduced-motion: reduce) { .pet-card img, .pet-card.new .plus, .b-pencil, .b-spark { animation: none; } .b-spark { opacity: 1; } }

.steps .st { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.steps .st.done::before, .steps .st.now::before { content: none; }
.steps .st.done span::before { content: "✓ "; color: #2e9c55; font-weight: 900; }
.steps .st.now span::before { content: ""; display: inline-block; width: 1em; height: 1em; vertical-align: -0.1em; background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Cg%20transform%3D%22translate(32%2032)%20rotate(40)%22%3E%3Crect%20x%3D%22-6%22%20y%3D%22-26%22%20width%3D%2212%22%20height%3D%2242%22%20rx%3D%222%22%20fill%3D%22%23ffd84d%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M-6%2016h12L0%2030z%22%20fill%3D%22%23fff3d6%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M-2%2026h4L0%2030z%22%20fill%3D%22%233b2a4a%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Crect%20x%3D%22-6%22%20y%3D%22-32%22%20width%3D%2212%22%20height%3D%228%22%20rx%3D%223%22%20fill%3D%22%23ff8fbf%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Crect%20x%3D%22-6%22%20y%3D%22-25%22%20width%3D%2212%22%20height%3D%224%22%20rx%3D%220%22%20fill%3D%22%23dcd6ea%22%20stroke%3D%22%233b2a4a%22%20stroke-width%3D%223.4%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat; margin-right: 0.25em; }
.room-name { padding: 1px 12px 2px; }
.room-name .rn-name { font-size: 18px; }

/* ================= room, take three: the pet is the star, the screen stays calm ================= */
.room-top { flex-wrap: nowrap; }
.round-btn.more { background: #ffe9c7; }
.room-guide { top: calc(max(10px, env(safe-area-inset-top)) + 70px); padding: 8px 14px 8px 8px; }
.room-guide .g-ic { width: 34px; height: 34px; font-size: 20px; }
.room-guide p { font-size: 16px; }
@media (min-width: 700px) { .room-guide { top: calc(max(10px, env(safe-area-inset-top)) + 70px); } }

/* the care buttons: each icon wears the ring of its need */
.t-dress { --tc: #ff8a3d; --tl: #fff0e0; }
.room-bar.dock { gap: 6px; padding: 7px; }
/* (the dock grows and shrinks with the screen: five buttons always fit side by side,
   from the smallest phone up, and never get wider than a thumb needs) */
.room-bar.dock { width: min(calc(100% - 12px), 410px); justify-content: center; gap: clamp(3px, 1.4vw, 6px); padding: clamp(4px, 1.6vw, 7px); }
.room-bar.dock button { flex: 1 1 0; min-width: 0; max-width: 76px; height: 84px; border-radius: 22px; gap: 3px; }
.room-bar.dock .ic {
  --v: 100%; --c: #3fcf6e;
  width: clamp(40px, 12.4vw, 50px); height: clamp(40px, 12.4vw, 50px); position: relative;
  background: radial-gradient(circle closest-side, var(--tl) 0 75%, transparent 78%), conic-gradient(var(--c) var(--v), rgba(59, 42, 74, 0.13) 0);
  transition: --v 0.4s;
}
.room-bar.dock button[data-tool] .ic, .room-bar.dock button .ic { font-size: 25px; }
.room-bar.dock .t-dress .ic { background: var(--tl); box-shadow: inset 0 0 0 4px #ffd2ae; }
.room-bar.dock button.on .ic { background: rgba(255, 255, 255, 0.92); }
.room-bar.dock button b { font-size: clamp(11px, 3.7vw, 14px); max-width: 100%; }
/* how full each need is, like a battery: five blocks that empty and turn orange, then red */
.room-bar .lvl {
  display: block; width: 78%; height: 9px; border-radius: 5px; background: rgba(59, 42, 74, 0.13); overflow: hidden;
  position: relative; flex: none;
}
.room-bar .lvl u {
  position: absolute; inset: 0 auto 0 0; width: var(--v, 100%); background: var(--c, #3fcf6e); border-radius: 5px;
  transition: width 0.4s, background 0.4s;
}
.room-bar .lvl::after { /* the gaps between the five blocks */
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 2px), #fff calc(20% - 2px) 20%);
}
.room-bar.dock button[data-tool] { gap: 2px; }
.room-bar button.on .lvl { background: rgba(255, 255, 255, 0.4); }

/* 🎒 more: big picture tiles */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px;
  border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 var(--ink);
  background: linear-gradient(170deg, #fff 0%, color-mix(in srgb, var(--gc) 26%, #fff) 100%);
}
.more-grid button span { font-size: 40px; line-height: 1.1; }
.more-grid button b { font-size: 17px; font-weight: 900; }
.more-grid button small { font-size: 12px; font-weight: 700; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.more-grid button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- dress up: drag things onto the pet ---------- */
.dress-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; padding: 8px 10px 8px 14px;
  border-radius: 18px; background: #fff3b0; font-size: 15px; font-weight: 800; line-height: 1.25;
}
.size-row { display: flex; align-items: center; gap: 6px; flex: none; }
.size-row b { font-size: 12px; opacity: 0.7; }
.size-row button { width: 44px; height: 44px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.2); font-size: 20px; }
.size-row button:active { transform: translateY(2px); box-shadow: none; }
.it-tile.draggable { touch-action: none; cursor: grab; }
.it-tile.draggable .it-emo, .it-tile.draggable .it-cv, .it-tile.draggable .it-img { animation: wiggle-soft 2.6s ease-in-out infinite; }
@keyframes wiggle-soft { 0%, 85%, 100% { transform: rotate(0); } 90% { transform: rotate(-8deg) scale(1.06); } 95% { transform: rotate(8deg) scale(1.06); } }
.it-tile.lifted { opacity: 0.35; }
/* the item itself, true size: a white outline while carried, glowing green when letting go puts it on */
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 8px 10px rgba(40, 20, 60, 0.35));
  transition: filter 0.15s;
}
.drag-ghost.ok { filter: drop-shadow(0 0 3px #3fcf6e) drop-shadow(0 0 3px #3fcf6e) drop-shadow(0 0 12px rgba(63, 207, 110, 0.9)); }
.drag-ghost.back { transition: transform 0.35s ease-in, opacity 0.35s; opacity: 0; }
.drag-ghost.poof { animation: poof 0.35s ease-out forwards; }
@keyframes poof { to { opacity: 0; filter: blur(4px); } }
.drag-hint { position: fixed; left: 0; top: 0; z-index: 19; pointer-events: none; } /* (over the room and its sheets, under a card or a message) */
.drag-hint .dh-item { position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; display: grid; place-items: center; }
.drag-hint .dh-item .it-emo { font-size: 46px; height: auto; }
.drag-hint .dh-item .it-img, .drag-hint .dh-item .it-cv { width: 56px; height: 56px; }
.drag-hint .dh-hand { position: absolute; left: -22px; top: 8px; font-size: 40px; filter: drop-shadow(0 3px 3px rgba(40, 20, 60, 0.35)); } /* (the paw holds the thing from under it) */

.room.pan > canvas { transform: translateY(var(--cam-y, -34%)) scale(var(--cam-s, 1)); transform-origin: 50% 0; }

/* ================= the start screen ================= */
.screen.start {
  justify-content: space-between; gap: 6px; overflow: hidden;
  background: linear-gradient(180deg, #8fd3ff 0%, #c9ecff 45%, #fff3d6 100%);
}
.start-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.start-sky .cloud { position: absolute; width: 120px; height: 40px; border-radius: 40px; background: #fff; opacity: 0.9; animation: drift 38s linear infinite; }
.start-sky .cloud::before, .start-sky .cloud::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.start-sky .cloud::before { width: 56px; height: 56px; left: 18px; top: -26px; }
.start-sky .cloud::after { width: 44px; height: 44px; left: 60px; top: -18px; }
.start-sky .c1 { top: 16%; left: -20%; }
.start-sky .c2 { top: 30%; left: -60%; transform: scale(0.7); animation-duration: 52s; animation-delay: -20s; }
.start-sky .c3 { top: 8%; left: -40%; transform: scale(0.55); animation-duration: 64s; animation-delay: -40s; }
@keyframes drift { to { translate: 180vw 0; } }
.start-sky .hill { position: absolute; bottom: -22vh; width: 140vw; height: 44vh; border-radius: 50%; }
.start-sky .h1 { left: -50vw; background: #a8e08c; }
.start-sky .h2 { right: -60vw; bottom: -26vh; background: #8fd47a; }
.screen.start > * { position: relative; }
.start-top { width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; }
.start-top .row-end { gap: 8px; }
.round-btn.off { opacity: 0.5; filter: grayscale(1); }

.logo { margin: 0; transform: rotate(-3deg); font-size: clamp(36px, 12vw, 72px); font-weight: 900; line-height: 1; white-space: nowrap; }
.logo::after { content: none; }
.logo span {
  display: inline-block; color: #ff5d8f; -webkit-text-stroke: 3px #fff; paint-order: stroke fill;
  text-shadow: 0 5px 0 #c23a6b, 0 10px 18px rgba(80, 20, 60, 0.25);
  animation: logo-bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.18s);
}
.logo span:nth-child(3n+2) { color: #ffb020; text-shadow: 0 5px 0 #c47a00, 0 10px 18px rgba(80, 40, 0, 0.25); }
.logo span:nth-child(3n) { color: #3fb4ff; text-shadow: 0 5px 0 #1f7cc0, 0 10px 18px rgba(0, 40, 80, 0.25); }
.logo .sp { display: inline-block; width: 0.3em; }
@keyframes logo-bob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -6px; rotate: 3deg; } }

.start-hero { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.hero-btn { border: none; background: none; padding: 0; flex: 0 1 auto; min-height: 0; display: flex; }
.hero-btn img { width: min(68vw, 300px); max-height: 38vh; object-fit: contain; transform-origin: 50% 100%; animation: hero-breathe 2.8s ease-in-out infinite; filter: drop-shadow(0 8px 6px rgba(59, 42, 74, 0.18)); }
.hero-btn.squish img { animation: hero-squish 0.6s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes hero-breathe { 0%, 100% { transform: scale(1, 1) translateY(0); } 50% { transform: scale(1.03, 0.97) translateY(2px); } }
@keyframes hero-squish { 0% { transform: scale(1.25, 0.7); } 40% { transform: scale(0.85, 1.2) translateY(-24px); } 100% { transform: scale(1, 1); } }
.hero-shadow { display: block; width: 46%; height: 18px; margin-top: -10px; border-radius: 50%; background: radial-gradient(rgba(59, 42, 74, 0.25), transparent 70%); }
.hero-say {
  position: relative; margin-bottom: 10px; padding: 10px 18px; border-radius: 22px; background: #fff;
  font-size: 19px; font-weight: 900; box-shadow: 0 4px 14px rgba(59, 42, 74, 0.15); max-width: 90%; text-align: center;
}
.hero-say::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -10px; border: 10px solid transparent; border-bottom: 0; border-top-color: #fff; }
.hero-say.pop { animation: say-pop 0.4s cubic-bezier(0.34, 1.8, 0.64, 1); }
.start-gift {
  position: absolute; right: 4px; top: 4px; z-index: 2; border: none; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; animation: gift-wiggle 1.8s ease-in-out infinite;
}
.start-gift span { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(59, 42, 74, 0.2)); }
.start-gift small { margin-top: -4px; padding: 2px 9px; border-radius: 999px; background: #ff5d8f; color: #fff; font-size: 12px; font-weight: 900; }

.play-btn { max-width: 420px; min-height: 76px; font-size: 26px; border-radius: 30px; animation: pulse 1.8s ease-in-out infinite; margin-bottom: 14px; } /* (room for its pulsing glow ring) */
.play-btn .pb-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #2f9a52; font-size: 22px; }
.start-nav { width: 100%; max-width: 420px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.start-nav button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px;
  border: 3px solid #fff; border-radius: 22px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 0 rgba(59, 42, 74, 0.18);
}
.start-nav button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.18); }
.sn-ic { font-size: 32px; line-height: 1.1; }
.start-nav b { font-size: 15px; font-weight: 900; }
.badge {
  position: absolute; top: -8px; right: -4px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: #ff3b3b; color: #fff; font-style: normal; font-weight: 900; font-size: 14px; display: grid; place-items: center; border: 3px solid #fff;
  animation: need-bounce 1.4s ease-in-out infinite;
}
.badge.soft { background: #7c5cff; animation: none; font-size: 11px; }
.more-grid button { position: relative; }
.more-help { display: block; margin: 12px auto 0; font-size: 16px; }

/* ================= welcome: one page that shows the whole idea ================= */
.screen.intro { gap: 10px; overflow-x: hidden; }
.intro-top { width: 100%; max-width: 640px; min-height: 44px; display: flex; align-items: center; }
.intro .lang-pick { display: flex; gap: 6px; }
.intro .lang-pick button { padding: 6px 10px; min-height: 44px; }
.intro .lang-pick button b { display: none; }
/* (the sound button keeps its corner; Skip, shown only when there are pets, takes the flag's place on the left) */
.intro-top .sound-btn { margin-left: auto; }
.skip-btn { margin-left: 0; min-height: 44px; border: none; background: rgba(255, 255, 255, 0.8); border-radius: 999px; padding: 8px 16px; font-size: 16px; font-weight: 800; }
.intro-logo { font-size: clamp(34px, 11vw, 64px); margin-top: -4px; }

/* the little film: 8 seconds, on a loop; every part keeps time with the others */
.story { width: 100%; height: clamp(130px, calc(100dvh - 510px), min(380px, (100vw - 32px) / 1.2)); display: grid; place-items: center; }
.story-box { position: relative; height: min(100%, calc((100vw - 32px) / 1.2)); aspect-ratio: 1.2; }
.story-box > * { position: absolute; }
/* The little film, 9 s: the paper; the crayon really draws the friend, stroke by stroke (startFilm
   in js/intropet.js moves the crayon and draws the lines, in step with these keyframes:
   drawing from 4% to 36%); the phone; the flash at 47%, where the drawing comes alive. */
.st-paper { left: 11%; top: 11%; width: 78%; border-radius: 10px; transform: rotate(-4deg);
  box-shadow: 0 6px 0 rgba(59, 42, 74, 0.15), 0 14px 30px rgba(59, 42, 74, 0.12); animation: st-paper 9s ease-in-out infinite; }
.st-ink { left: 20%; top: 14%; width: 60%; transform-origin: 50% 90%; transform: rotate(-4deg); animation: st-ink 9s ease-in-out infinite; }
.st-crayon { left: 46%; top: 34%; z-index: 1; font-size: 46px; line-height: 1; translate: -15% -85%; opacity: 0; pointer-events: none; animation: st-crayon 9s ease-in-out infinite; }
.st-phone { left: 24%; right: 24%; top: 1%; bottom: 1%; border: 8px solid #3b2a4a; border-radius: 22px; box-shadow: 0 10px 24px rgba(59, 42, 74, 0.3); animation: st-phone 9s ease-in-out infinite; }
.st-phone i { position: absolute; left: 50%; top: -5px; width: 28px; height: 4px; margin-left: -14px; border-radius: 2px; background: #6b5a7a; }
.st-flash { inset: 0; border-radius: 24px; background: #fff; opacity: 0; animation: st-flash 9s linear infinite; }
.st-shadow { left: 30%; width: 40%; bottom: 6%; height: 7%; border-radius: 50%; background: radial-gradient(rgba(59, 42, 74, 0.28), transparent 70%); animation: st-shadow 9s ease-in-out infinite; }
.st-heart { font-size: 30px; opacity: 0; animation: st-heart 9s ease-out infinite; }
/* (it opens with the paper already there and the crayon about to draw) */
.story-box > * { animation-delay: -0.35s; }
.st-heart.s1 { left: 6%; top: 34%; } .st-heart.s2 { right: 6%; top: 14%; animation-delay: 0.1s; } .st-heart.s3 { right: 14%; top: 50%; animation-delay: 0.55s; }
@keyframes st-paper {
  0% { opacity: 0; transform: rotate(-4deg) scale(0.88); }
  4%, 50% { opacity: 1; transform: rotate(-4deg) scale(1); }
  57%, 100% { opacity: 0; transform: rotate(-4deg) scale(0.8) translateY(8%); }
}
/* (after the flash, if the pet couldn't come alive here, the drawing hops about by itself) */
@keyframes st-ink {
  0%, 50% { opacity: 1; transform: rotate(-4deg); }
  55% { transform: translateY(-14%) rotate(4deg) scale(1.1); }
  60% { transform: translateY(0) scale(1.2, 1.0); }
  65% { transform: translateY(-14%) rotate(-4deg) scale(1.06, 1.16); }
  70% { transform: translateY(0) scale(1.2, 1.02); }
  75% { transform: translateY(-14%) rotate(4deg) scale(1.06, 1.16); }
  80% { transform: translateY(0) scale(1.18, 1.04); }
  86%, 92% { opacity: 1; transform: translateY(0) scale(1.12); }
  97%, 100% { opacity: 0; transform: translateY(0) scale(1.12); }
}
@keyframes st-crayon {
  0%, 2% { opacity: 0; rotate: 0deg; }
  5% { opacity: 1; }
  12% { rotate: -6deg; } 20% { rotate: 4deg; } 28% { rotate: -5deg; }
  36% { opacity: 1; rotate: 0deg; }
  41%, 100% { opacity: 0; }
}
@keyframes st-phone {
  0%, 38% { opacity: 0; transform: translateY(40%) rotate(8deg); }
  43%, 50% { opacity: 1; transform: translateY(0) rotate(0); }
  56%, 100% { opacity: 0; transform: translateY(40%) rotate(-8deg); }
}
@keyframes st-flash { 0%, 45% { opacity: 0; } 47% { opacity: 0.95; } 52%, 100% { opacity: 0; } }
@keyframes st-shadow { 0%, 55% { opacity: 0; } 60%, 88% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes st-heart {
  0%, 57% { opacity: 0; transform: translateY(20px) scale(0.5); }
  63% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  88%, 100% { opacity: 0; transform: translateY(-44px) scale(1.1); }
}
/* the moment it comes alive: a burst of little stars from the drawing */
.st-burst { left: 50%; top: 50%; width: 0; height: 0; z-index: 3; pointer-events: none; }
.st-burst i { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; opacity: 0; background: #ffd23f;
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%); --r: min(34vw, 170px); }
.st-burst i:nth-child(3n + 2) { background: #ff6fae; }
.st-burst i:nth-child(3n) { background: #4fb8ff; }
.st-burst i:nth-child(even) { --r: min(25vw, 125px); width: 20px; height: 20px; left: -10px; top: -10px; }
/* (and a ring of light, opening out) */
.st-burst::before { content: ""; position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%; border: 6px solid #fff; opacity: 0; box-shadow: 0 0 18px #fff8c4, inset 0 0 18px #fff8c4; }
.story-box.live .st-burst::before { animation: st-ring 0.8s ease-out both; }
@keyframes st-ring { 0% { opacity: 0.95; transform: scale(0.3); } 100% { opacity: 0; transform: scale(3.6); } }
.story-box.live .st-burst i { animation: st-burst 1.2s cubic-bezier(0.15, 0.7, 0.3, 1) 0.05s both; }
.story-box.live .st-burst i:nth-child(even) { animation-delay: 0.18s; }
@keyframes st-burst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.3); }
  65% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(1.1) rotate(120deg); }
}


.intro-go { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.intro-go .big-btn { max-width: none; font-size: clamp(20px, 6.4vw, 26px); }

/* short phones: the film gives way first, then the smaller extras */
@media (max-height: 640px) {
  .screen.intro { gap: 8px; }
  .intro-logo { font-size: clamp(28px, 9vw, 44px); }
  .story { height: clamp(110px, calc(100dvh - 420px), min(380px, (100vw - 32px) / 1.2)); }
}
@media (prefers-reduced-motion: reduce) {
  .st-paper, .st-crayon, .st-phone, .st-flash, .st-burst { animation: none; opacity: 0; }
  .st-ink { animation: none; transform: scale(1.1); }
  .st-shadow, .st-heart { animation: none; opacity: 1; }
}

/* ================= jobs ================= */
.jobs-list { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px; }
.job {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 10px; border-radius: 24px; background: #fff;
  border: 3px solid #fff; box-shadow: 0 5px 0 rgba(59, 42, 74, 0.14); animation: say-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d);
}
.job.done { background: #ecfbe9; border-color: #bfeec9; }
.job-ic { flex: none; width: 58px; height: 58px; border-radius: 50%; background: #fff3d6; display: grid; place-items: center; font-size: 32px; }
.job-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.job-body b { font-size: 18px; line-height: 1.2; }
.job-bar { height: 12px; border-radius: 6px; background: #eee5f2; overflow: hidden; }
.job-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6fdc8c, #3fb950); }
.job-body small { font-size: 13px; font-weight: 800; opacity: 0.7; }
.job-check { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #3fcf6e; color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 900; }
.job-go { flex: none; width: 50px; height: 50px; border: none; border-radius: 50%; background: linear-gradient(180deg, #7fe69a, #4fcf76); box-shadow: 0 4px 0 #2f9a52; color: #173d24; font-size: 20px; }
.job-go:active { transform: translateY(3px); box-shadow: none; }
.prize { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; text-align: center; }
.prize p { margin: 0; font-size: 17px; font-weight: 700; }
.chest { position: relative; border: none; background: none; padding: 0; font-size: 84px; line-height: 1; }
.chest.locked { filter: grayscale(0.7); opacity: 0.6; }
.chest.locked i { position: absolute; right: -6px; bottom: 0; font-size: 34px; font-style: normal; }
.chest.ready { animation: gift-wiggle 1.2s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255, 216, 77, 0.9)); }

/* ================= sticker book ================= */
.count-pill { padding: 6px 12px; border-radius: 999px; background: #fff3b0; font-weight: 900; font-size: 16px; white-space: nowrap; }
.sticker-book {
  width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; padding: 14px;
  border-radius: 26px; background: repeating-linear-gradient(0deg, #fffdf6 0 30px, #f3ecff 30px 31px); box-shadow: inset 0 0 0 3px #fff, 0 5px 0 rgba(59, 42, 74, 0.12);
}
.stk { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 3px dashed #d9cfe3; border-radius: 20px; background: rgba(255, 255, 255, 0.6); }
.stk span { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #cbbfd8; background: #f3eef7; }
.stk b { font-size: 11px; line-height: 1.2; text-align: center; opacity: 0.6; }
.stk.got { border: 3px solid #fff; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.15); transform: rotate(var(--r)); }
.stk.got span { color: inherit; font-size: 40px; background: radial-gradient(circle at 35% 30%, #fff 0 20%, #ffeaa3 60%, #ffd84d); box-shadow: 0 0 0 4px #fff, 0 3px 8px rgba(59, 42, 74, 0.2); }
.stk.got b { font-size: 12.5px; opacity: 1; font-weight: 900; }
.stk.wiggle { animation: nudge 0.5s ease-in-out; }
/* a new sticker: a small strip at the top that comes and goes by itself (never in the way) */
.sticker-pop {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 84px); z-index: 35; transform: translateX(-50%); max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 8px; border-radius: 999px; background: #fffaf0;
  box-shadow: 0 0 0 3px #ffd84d, 0 6px 16px rgba(40, 20, 60, 0.22); animation: sticker-in 0.45s cubic-bezier(0.34, 1.5, 0.64, 1); pointer-events: none;
}
.sticker-pop .sp-e { display: flex; flex: none; }
.sticker-pop .sp-e i { font-style: normal; font-size: 30px; line-height: 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 20%, #ffeaa3 60%, #ffd84d); box-shadow: 0 0 0 2px #fff; }
.sticker-pop .sp-e i + i { margin-left: -12px; }
.sticker-pop .sp-t { display: flex; flex-direction: column; min-width: 0; }
.sticker-pop small { font-size: 12px; font-weight: 900; color: #ff5d8f; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.sticker-pop b { font-size: 16px; font-weight: 900; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-pop.out { transition: opacity 0.35s, transform 0.35s; opacity: 0; transform: translateX(-50%) translateY(-16px); }
@keyframes sticker-in { from { transform: translateX(-50%) translateY(-24px); opacity: 0; } }

/* ================= for grown-ups ================= */
.parent-wrap { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.p-card { padding: 14px 16px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.1); }
.p-card h3 { margin: 0 0 8px; font-size: 18px; }
.p-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; opacity: 0.85; }
.p-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 17px; font-weight: 700; }
/* (each row is one big switch: a gap between them, so a finger can't flip the wrong one) */
.p-row + .p-row { margin-top: 8px; }
.p-sub { padding: 10px 0 4px; font-size: 17px; font-weight: 700; } /* (a heading over buttons, not a switch) */
.switch { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 16px; background: #d9cfe3; position: relative; transition: background 0.2s; cursor: pointer; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: left 0.2s; }
.switch:checked { background: #3fcf6e; }
.switch:checked::after { left: 25px; }
.p-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.p-btns .big-btn { flex: 1; min-width: 140px; max-width: none; font-size: 17px; }
.p-pets { display: flex; flex-direction: column; gap: 8px; }
.p-pet { display: flex; align-items: center; gap: 10px; }
.p-pet img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: #fff8e7; }
.p-pet b { flex: 1; font-size: 17px; }
.soft-btn.danger { background: #ffe3e3; color: #c62f2f; }

/* ================= the first-day guide ================= */
.coach { position: absolute; inset: 0; z-index: 9; pointer-events: none; }
.coach-spot {
  position: absolute; border-radius: 26px; box-shadow: 0 0 0 4px #ffd84d, 0 0 24px 6px rgba(255, 216, 77, 0.8); /* (a glowing ring; nothing else is dimmed) */
  transition: left 0.3s, top 0.3s, width 0.3s, height 0.3s; animation: spot-pulse 1.4s ease-in-out infinite;
}
@keyframes spot-pulse { 50% { outline: 6px solid rgba(255, 216, 77, 0.35); outline-offset: 6px; } }
.coach-bubble {
  position: absolute; display: flex; align-items: center; gap: 8px; max-width: min(340px, calc(100% - 24px)); padding: 6px 8px 6px 6px;
  border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(30, 15, 50, 0.22); transition: left 0.3s, top 0.3s;
}
.coach-bubble.pop { animation: say-pop 0.45s cubic-bezier(0.34, 1.8, 0.64, 1); }
.coach-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #fff3b0; display: grid; place-items: center; font-size: 22px; }
.coach-bubble p { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.2; }
.coach-bubble b { color: #d63d7a; }
/* the paw pats the button calmly: hovers, presses down, holds a moment, lifts (2.4 s each) */
.coach-hand { position: absolute; font-size: 44px; filter: drop-shadow(0 3px 3px rgba(40, 20, 60, 0.4)); animation: coach-tap 2.4s ease-in-out infinite; }
@keyframes coach-tap { 0%, 30%, 100% { transform: translateY(-14px) scale(1.05); } 48%, 66% { transform: translateY(0) scale(0.9); } }
.room.gaming .coach { display: none; }

@media (prefers-reduced-motion: reduce) {
  .logo span, .hero-btn img, .start-sky .cloud, .play-btn, .badge, .start-gift, .coach-hand, .coach-spot { animation: none; }
}
.screen.start > .start-sky { position: absolute; }
.start-hero { justify-content: center; }
.hero-btn img { width: min(76vw, 340px); max-height: 42vh; }

/* ---------- throw away a drawn hat ---------- */
.it-del {
  position: absolute; top: 5px; right: 5px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; background: #fff; border: 2.5px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink); cursor: pointer; touch-action: manipulation;
}
.it-del:active { transform: translateY(2px); box-shadow: none; }
.del-hat { width: 110px; height: 90px; object-fit: contain; display: block; margin: 0 auto; }
.modal-btns .soft-btn.danger { margin-top: 10px; min-height: 44px; }

/* ---------- language flags (welcome screen and grown-ups) ---------- */
.lang-pick { display: flex; gap: 6px; }
.lang-pick button { display: flex; align-items: center; gap: 6px; border: 2px solid transparent; background: rgba(255, 255, 255, 0.8); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 15px; font-weight: 800; color: var(--ink); box-shadow: 0 2px 0 rgba(59, 42, 74, 0.15); }
.lang-pick button span { font-size: 22px; line-height: 1; }
.lang-pick button.on { border-color: #4fcf76; background: #eafbef; }
.lang-pick button:active { transform: translateY(2px); }
.lang-pick.big { gap: 10px; }
.lang-pick.big button { flex: 1; justify-content: center; min-height: 52px; font-size: 18px; background: #f6f1fa; }
.vol-pick { margin: 2px 0 6px; }
.vol-pick.big button { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 15px; line-height: 1.1; min-width: 0; }
.lang-pick.big button.on { background: #eafbef; }

/* ---------- keeping pets safe (grown-ups) ---------- */
.priv-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.priv-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; background: #eef6ff; font-size: 14px; line-height: 1.35; }
.priv-list li > span { flex: none; width: 30px; font-size: 22px; line-height: 1.2; text-align: center; }
.priv-list b { display: block; font-size: 16px; margin-bottom: 2px; }
.p-card .priv-small { margin: 0; font-size: 13px; opacity: 0.7; }
.p-card .priv-more { display: flex; align-items: center; min-height: 44px; margin-top: 8px; color: #2b6cb0; font-size: 15px; font-weight: 800; }
/* writing to us (grown-ups only): the address as plain text, then two calm buttons */
.mail-card .mail-lead { margin: 0 0 10px; }
.mail-addr { margin: 0 0 10px; padding: 10px 12px; border-radius: 16px; background: #f6f2fb; font-size: 18px; font-weight: 800; text-align: center; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.mail-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; }
.mail-btn, .mail-copy { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 16px; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.mail-btn { border: 3px solid #9fd0ff; background: #eef6ff; color: var(--ink); box-shadow: 0 3px 0 rgba(59, 42, 74, 0.12); }
.mail-copy { border: 3px solid #d9cdf0; background: #fff; color: var(--ink); }
.mail-btn:active, .mail-copy:active { transform: translateY(2px); box-shadow: none; }
.p-card .mail-note { margin: 0 0 6px; font-size: 13px; opacity: 0.75; }
.p-card .mail-note:last-child { margin: 0; }
.safe-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.safe-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; background: #fff4e0; }
.safe-list li.ok { background: #eafbef; }
.safe-list .safe-ic { font-size: 22px; line-height: 1.2; }
.safe-list b { display: block; font-size: 16px; }
.safe-list small { display: block; font-size: 14px; line-height: 1.35; opacity: 0.8; margin-top: 2px; }
.big-btn.sky { background: linear-gradient(180deg, #a9dcff, #6fbdf7); color: #12324d; box-shadow: 0 5px 0 #3d8fd0; }
.big-btn.sky:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.25); }
.p-pet .p-send-one { padding: 8px 12px; font-size: 18px; background: #dff0ff; }
.send-steps { text-align: left; font-size: 16px; line-height: 1.4; }

/* ---------- putting the app on the home screen ---------- */
.p-card .install-btn { width: 100%; max-width: none; min-height: 56px; font-size: 19px; }
.intro-install { margin-top: 2px; font-size: 15px; opacity: 0.85; }
/* inside Facebook, Instagram, TikTok…: a strip at the top that opens the how-to */
.inapp-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 6px; border: none; padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: #ffe066; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.3; text-align: left; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.inapp-bar b { text-decoration: underline; }

/* ---------- "there's more below": a soft fade and a bouncing arrow (js/scrollhint.js) ---------- */
.modal-card { max-height: 100%; overflow-y: auto; }
.more-hint, .screen:not(.room) > .more-hint { position: sticky; bottom: 0; left: 0; z-index: 4; flex: none; align-self: stretch; height: 72px; display: none; justify-content: center; align-items: flex-end; padding-bottom: 6px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 248, 231, 0), rgba(255, 248, 231, 0.95) 70%); }
.more-hint.on, .screen:not(.room) > .more-hint.on { display: flex; }
/* on a screen it reaches over the screen's padding to the very edges, and fades into the page's own bottom colour */
.screen:not(.room) > .more-hint {
  --pad-b: max(16px, env(safe-area-inset-bottom)); bottom: calc(-1 * var(--pad-b)); margin: 0 -16px calc(-1 * var(--pad-b));
  padding-bottom: calc(var(--pad-b) + 4px); height: calc(72px + var(--pad-b));
  background: linear-gradient(to bottom, rgba(246, 238, 255, 0), rgba(246, 238, 255, 0.95) 60%);
}
.sheet > .more-hint, .modal-card > .more-hint, .help-card > .more-hint, .ig-card > .more-hint { background: linear-gradient(to bottom, rgba(255, 250, 240, 0), rgba(255, 250, 240, 0.95) 70%); }
.more-hint button { pointer-events: auto; width: 46px; height: 46px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(59, 42, 74, 0.25); display: grid; place-items: center; animation: more-bob 1.3s ease-in-out infinite; }
.more-hint i { width: 14px; height: 14px; border-right: 4px solid #3b2a4a; border-bottom: 4px solid #3b2a4a; transform: translateY(-3px) rotate(45deg); }
@keyframes more-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
/* the welcome: the same arrow under its buttons (the picture above is sized so there is room for
   it), saying there is more for the grown-ups below */
#screen-intro > .more-hint { --pad-b: max(4px, env(safe-area-inset-bottom)); bottom: 0; margin: 0; height: calc(50px + var(--pad-b)); padding-bottom: var(--pad-b);
  background: linear-gradient(to bottom, rgba(255, 250, 240, 0), rgba(255, 250, 240, 0.95) 55%); }
#screen-intro > .more-hint button { width: 42px; height: 42px; }
@media (prefers-reduced-motion: reduce) { .more-hint button { animation: none; } }

/* ---------- short phones: the working screens fit without scrolling ---------- */
@media (max-height: 800px) {
  #screen-color .explain { display: none; } /* the line under the picture says what to do */
  .colour-stage { min-height: 150px; }
  .col-tools .tool-big { min-height: 54px; }
  .col-tools .tool-big small { display: none; }
  .colour-grid { gap: 4px 2px; }
  .colour-grid i { width: 34px; height: 34px; }
  .choice-now { font-size: 16px; }
  .job { padding: 8px 10px 8px 8px; gap: 10px; border-radius: 20px; }
  .job-ic { width: 46px; height: 46px; font-size: 26px; }
  .job-body b { font-size: 16px; }
  .jobs-list { gap: 8px; }
  .chest { font-size: 64px; }
}
@media (max-height: 620px) {
  .screen .steps { display: none; }
  .colour-grid span { display: none; } /* the colour's name is shown in the line above when picked */
  #screen-jobs .hint { font-size: 15px; }
  .job-body small { font-size: 12px; }
  .chest { font-size: 52px; }
}

/* ---------- a phone turned sideways: everything is made for upright ---------- */
.rotate-tip { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-tip { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--bg); text-align: center; padding: 16px; }
  .rotate-tip span { font-size: 64px; animation: rotate-phone 2s ease-in-out infinite; }
  .rotate-tip b { font-size: 24px; }
}
@keyframes rotate-phone { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0); } }

/* ---------- settings: a cog with a little lock, so grown-ups recognise it ---------- */
#btn-parents { position: relative; }
#btn-parents .lock-badge { position: absolute; right: -2px; bottom: -2px; font-size: 15px; font-style: normal; line-height: 1; }
@media (max-height: 620px) { #screen-jobs { gap: 8px; } .prize { margin-top: 0; gap: 2px; } }

/* our own pictures in place of emoji (js/icons.js) */
.ico { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.24em; flex: none; overflow: visible; }
.ic > .ico, .gate-ic > .ico, .gift-item > .ico, .ig-big > .ico { width: 1.25em; height: 1.25em; vertical-align: middle; }
/* on the yellow star counters the star is a deeper gold, so it stands out */
.star-pill .ico > path:first-of-type, .gh-score .ico > path:first-of-type, .sheet-stars .ico > path:first-of-type { fill: #ffaa1d; }
/* (a picture fills the same box its emoji did, so labels under it keep their place) */
.it-emo > .ico, .dh-item .ico { width: 1em; height: 1em; vertical-align: middle; }

/* "Skip tips": on every tip, a big clear button on its own row (tips stay off until turned back on) */
.tips-skip {
  flex-basis: 100%; pointer-events: auto; margin-top: 2px; min-height: 40px; padding: 6px 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid #e4d8ee; border-radius: 999px; background: #f6f0fb; color: var(--ink);
  font-size: 16px; font-weight: 900; line-height: 1.1; box-shadow: 0 2px 0 rgba(59, 42, 74, 0.15);
}
.tips-skip:active { transform: translateY(2px); box-shadow: none; }
.tips-skip i { font-style: normal; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.tips-skip i .ico { width: 15px; height: 15px; }
.room-guide { flex-wrap: wrap; }
/* (the first-day helper is one small line: the words, then a small "Skip tips" beside them) */
.coach-bubble { flex-wrap: nowrap; }
.coach-bubble .tips-skip { flex: none; flex-basis: auto; margin: 0; min-height: 36px; padding: 4px 10px; font-size: 13px; gap: 5px; }
.coach-bubble .tips-skip i { width: 20px; height: 20px; }
.room-guide { pointer-events: none; }
.coach-bubble.only-skip { padding: 6px; }
.coach-bubble.only-skip > .coach-ic, .coach-bubble.only-skip > p { display: none; }
.coach-bubble.only-skip .tips-skip { margin: 0; }
.help-tips { display: block; width: 100%; margin: 14px 0 0; min-height: 48px; font-size: 17px; font-weight: 900; }
.coach-bubble > p, .room-guide > p { flex: 1 1 0; min-width: 0; } /* (the words stay beside the picture; only the button gets its own row) */

/* Breathing room between buttons a child might tap: the eye choice, the big "yes", the fixes
   (a finger aimed at one must never land on the next) */
.eye-seg { gap: 10px; }
.eye-mode { margin-bottom: 10px; }
.check-bar { gap: 16px; }
.fix-row { gap: 12px; }

/* Goodies: a short tray along the bottom with one row of big things you swipe sideways,
   so the room stays big above it (it slides up a little; it never shrinks) */
.sheet-wrap.dress .sheet { max-height: none; }
.sheet-wrap.dress .it-grid {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 104px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 4px 4px 10px; margin-left: -4px; margin-right: -4px;
}
.sheet-wrap.dress .it-tile { scroll-snap-align: start; }
.sheet-wrap.dress .it-tile.draggable { touch-action: none; } /* (the app scrolls the row itself on a sideways slide; up lifts the hat out) */
.room.pan > canvas { transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1); }
.sheet-wrap.dress .sheet { max-width: none; } /* (full width along the bottom: nothing of the slid-up room shows beside it) */

/* More room between things a child taps side by side (a finger must land on the one it aims at):
   the big room buttons, the foods, the friends to adopt, the stickers */
.room-bar.dock { gap: clamp(8px, 2.4vw, 10px); }
.food-tray { gap: 10px; }
.premade-grid { gap: 20px 16px; }
.sticker-book { gap: 16px 14px; }

/* ---------- the "magic is happening" screen: a doodle on paper comes alive ----------
   (only movement and fading, so it keeps going even while the phone is busy working) */
.busy-card { padding: 18px 26px 16px; gap: 8px; min-width: min(300px, calc(100vw - 32px)); }
.busy-art { position: relative; width: 190px; height: 150px; }
.ba-paper {
  position: absolute; left: 22px; top: 8px; width: 146px; height: 138px; border-radius: 12px; transform: rotate(-4deg);
  background: repeating-linear-gradient(180deg, #fffdf6 0 17px, #d8e8ff 17px 18.5px); border-left: 4px solid #ffb3c8;
  box-shadow: 0 6px 14px rgba(59, 42, 74, 0.16);
}
.ba-pet { position: absolute; left: 39px; top: 18px; width: 112px; height: 112px; overflow: visible; }
.ba-pet * { transform-box: fill-box; }
.ba-hop { animation: ba-hop 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.ba-squash { transform-origin: 50% 100%; animation: ba-squash 1.1s ease-in-out infinite; }
.ba-shadow { transform-origin: 50% 50%; animation: ba-shadow 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.ba-eyes { transform-origin: 50% 50%; animation: ba-blink 3.2s infinite; }
.ba-look { animation: ba-look 4.4s ease-in-out infinite; }
.ba-armL { transform-origin: 100% 100%; animation: ba-wave 0.55s ease-in-out infinite alternate; }
.ba-armR { transform-origin: 0% 100%; animation: ba-wave 0.55s ease-in-out infinite alternate-reverse; }
.ba-ant { transform-origin: 30% 100%; animation: ba-wave 0.8s ease-in-out infinite alternate; }
@keyframes ba-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes ba-squash { 0%, 100% { transform: scale(1.12, 0.88); } 18% { transform: scale(0.92, 1.1); } 50% { transform: scale(1, 1); } 82% { transform: scale(0.95, 1.06); } }
@keyframes ba-shadow { 0%, 100% { transform: scale(1.1); opacity: 1; } 50% { transform: scale(0.65); opacity: 0.5; } }
@keyframes ba-blink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(0.1); } 96% { transform: scaleY(1); } }
@keyframes ba-look { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, -1px); } 50% { transform: translate(3px, 0); } 75% { transform: translate(0, -2px); } }
@keyframes ba-wave { from { transform: rotate(-18deg); } to { transform: rotate(16deg); } }
.ba-pencil { position: absolute; right: 2px; bottom: 6px; font-size: 40px; animation: scribble 0.7s ease-in-out infinite; }
.ba-pencil .ico { width: 44px; height: 44px; }
.ba-spark { position: absolute; font-size: 24px; opacity: 0; animation: spark 1.6s ease-out infinite; }
.ba-spark.s1 { left: 4px; top: 10px; } .ba-spark.s2 { right: 6px; top: 0; animation-delay: 0.4s; }
.ba-spark.s3 { left: 10px; bottom: 14px; animation-delay: 0.8s; } .ba-spark.s4 { right: 38px; top: -6px; animation-delay: 1.2s; font-size: 20px; }
/* the words take turns: a new fun one every two seconds */
.busy-msgs { position: relative; height: 30px; width: 100%; display: none; }
.busy[data-kind="magic"] .busy-msgs.magic, .busy[data-kind="save"] .busy-msgs.save { display: block; }
.busy-msgs span { position: absolute; inset: 0; text-align: center; font-size: 20px; font-weight: 900; white-space: nowrap; opacity: 0; }
.busy-msgs.magic span { animation: ba-msg 8s infinite; }
.busy-msgs.magic span:nth-child(2) { animation-delay: 2s; } .busy-msgs.magic span:nth-child(3) { animation-delay: 4s; } .busy-msgs.magic span:nth-child(4) { animation-delay: 6s; }
.busy-msgs.save span { opacity: 1; }
@keyframes ba-msg { 0% { opacity: 0; transform: translateY(10px) scale(0.9); } 3% { opacity: 1; transform: translateY(0) scale(1.06); } 6% { transform: scale(1); } 22% { opacity: 1; transform: translateY(0); } 25%, 100% { opacity: 0; transform: translateY(-10px); } }
@media (max-width: 360px) { .busy-msgs span { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .ba-hop, .ba-squash, .ba-shadow, .ba-look, .ba-armL, .ba-armR, .ba-ant, .ba-pencil, .ba-spark { animation: none; }
  .ba-spark { opacity: 1; }
  .busy-msgs.magic span { animation: none; } .busy-msgs.magic span:first-child { opacity: 1; }
}
/* (a long line, in Hungarian say, takes two lines instead of running off the card) */
.busy-msgs { height: 2.5em; }
.busy-msgs span { display: flex; align-items: center; justify-content: center; white-space: normal; line-height: 1.15; }

/* "Is this your pet?": a big Yes, then a clearly separate box of picture buttons to change
   something (the face, drawing more on it, the edges) */
.change-box { width: 100%; padding: 10px 10px 12px; border-radius: 22px; background: rgba(255, 255, 255, 0.55); border: 2px dashed #e2d6ee; }
.change-q { margin: 0 0 8px; text-align: center; font-size: 16px; font-weight: 800; opacity: 0.8; }
.change-row { display: flex; gap: 12px; }
.change-btn {
  flex: 1 1 0; min-width: 0; min-height: 86px; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: none; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.16);
}
.change-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.16); }
.change-btn.hidden { display: none; }
.change-btn.draw { background: #fff6cf; box-shadow: 0 4px 0 #f2c94c; }
.cb-ic { font-size: 30px; line-height: 1; }
.change-btn b { font-size: 15px; font-weight: 900; line-height: 1.1; text-align: center; }
.change-btn small { font-size: 12px; font-weight: 700; line-height: 1.1; opacity: 0.65; text-align: center; }
/* the pet's picture on "Is this your pet?" never gets squashed: on a short phone the page scrolls instead */
#screen-face .stage { flex: 1 0 auto; min-height: min(40vh, 320px); }
.sizes { gap: 10px; } /* (the brush sizes: far enough apart for a small finger) */

/* ---------- a child never has to hunt for the next step ----------
   Text never gets squashed into the next thing when a screen is full (only the picture can
   shrink), and the main button of a step stays in sight at the bottom while the page scrolls. */
.screen > * { flex-shrink: 0; }
.screen > .stage, .screen > .edit-stage, .screen > .start-hero { flex-shrink: 1; } /* (the pictures are what give way) */
.screen > .sticky-go, .screen:not(.room) > .sticky-go { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5; }
.sticky-go.hidden { display: none; }
#face-ok, #face-done { width: 100%; max-width: 420px; }
/* (with the main button pinned at the bottom, no "more below" arrow covering the things above it:
   the next box already peeks out under the button) */
.screen:has(> .sticky-go:not(.hidden)) > .more-hint { display: none; }
/* the eye choice: one short row, two clear picture buttons */
.eye-mode { margin-bottom: 0; }
.eye-seg button { min-height: 52px; padding: 6px 10px; justify-content: center; }
.eye-seg button b { font-size: 16px; }
/* "New pet" on the start screen: four tiles that always fit */
.start-nav { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.start-nav b { font-size: clamp(12px, 3.6vw, 15px); line-height: 1.1; text-align: center; }
.sn-ic { font-size: clamp(26px, 8vw, 32px); }
.start-nav .sn-new { background: #fff3b0; border-color: #ffe27a; }

/* changing the face: the picture gives up room so the tools and Done all fit on the screen
   (Done only gets pinned over them on the very smallest phones) */
#screen-face.fixing .stage { flex: 1 1 0; min-height: min(26vh, 220px); }
/* (the tools and Done are one bar, pinned at the bottom together: Done can never cover the
   tools, however tall the page gets on a phone) */
#screen-face > #face-fixbar { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 5; padding: 8px; border-radius: 24px; background: rgba(255, 246, 234, 0.97); box-shadow: 0 -3px 14px rgba(59, 42, 74, 0.1); }
#face-fixbar #face-done { width: 100%; max-width: 420px; }

/* the start screen's big button: a long pet name stays on one line on a small phone */
.play-btn { font-size: clamp(19px, 6.4vw, 26px); }
/* (the tiles never grow past their share; on the narrowest phones they go two by two, with
   the picture beside the word, so long words like "Kedvenceim" still fit) */
.start-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 359px) {
  .start-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-nav button { flex-direction: row; justify-content: center; gap: 6px; padding: 8px 6px; }
  .start-nav .sn-ic { font-size: 24px; }
  .start-nav b { font-size: 14px; }
}

/* giving something back (grown-ups only) */
.give-lead { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.give-link { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border-radius: 18px; background: #fff3c4; color: inherit; text-decoration: none; text-align: left; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.12); }
.give-link:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.12); }
.give-link.tip { background: #eef6ff; }
.give-ic { flex: none; width: 34px; font-size: 28px; line-height: 1; text-align: center; }
.give-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.give-txt b { font-size: 17px; line-height: 1.2; }
.give-txt small { font-size: 14px; line-height: 1.35; opacity: 0.85; }
.give-out { flex: none; font-style: normal; font-weight: 900; opacity: 0.6; }
/* the charity, and one big button to its own donation page */
.give-who { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border-radius: 18px; background: #fff3c4; text-align: left; }
.give-who .give-ic { width: 44px; font-size: 32px; }
.give-donate { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; padding: 10px 18px; border-radius: 22px; background: linear-gradient(180deg, #ffb3cd, #ff7eaa); box-shadow: 0 5px 0 #d9567f; color: #5a1030; font-size: clamp(17px, 5vw, 20px); font-weight: 900; line-height: 1.2; text-align: center; text-decoration: none; }
.give-donate:active { transform: translateY(4px); box-shadow: 0 1px 0 #d9567f; }
.give-donate i { flex: none; font-style: normal; opacity: 0.7; }
.give-note { margin: 10px 0 12px; font-size: 13px; text-align: center; opacity: 0.75; }
/* in the settings: one warm button right under the pets block; it opens the card in place */
.give-fold { display: flex; flex-direction: column; }
.give-entry { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 10px 14px; border: 3px solid #ffd84d; border-radius: 22px; background: linear-gradient(180deg, #fffaf0, #fff3c4); color: var(--ink); font: inherit; text-align: left; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.1); cursor: pointer; }
.give-entry:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(59, 42, 74, 0.1); }
.ge-ic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 28px; box-shadow: 0 2px 0 rgba(59, 42, 74, 0.1); }
.ge-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ge-txt b { font-size: clamp(16px, 5vw, 18px); font-weight: 900; line-height: 1.15; }
.ge-txt small { font-size: 14px; line-height: 1.3; opacity: 0.8; }
.give-entry > i { flex: none; font-style: normal; font-size: 28px; font-weight: 900; line-height: 1; opacity: 0.55; transition: transform 0.2s; }
.give-entry[aria-expanded="true"] { border-radius: 22px 22px 0 0; box-shadow: none; }
.give-entry[aria-expanded="true"] > i { transform: rotate(90deg); }
.give-card { padding: 12px 16px 14px; border: 3px solid #ffd84d; border-top: none; border-radius: 0 0 22px 22px; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.1); }
.give-card[hidden] { display: none; }
.give-share { display: block; width: 100%; min-height: 48px; margin: 4px 0 10px; border: 3px solid #ffd84d; border-radius: 999px; background: #fff; color: inherit; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.give-small { margin: 0; font-size: 12px; opacity: 0.65; }
.share-box { margin: 4px 0 10px; }
.share-box .give-share { margin: 0; }
.share-panel { margin-top: 10px; padding: 12px; border-radius: 18px; background: #f6f2fb; }
.share-how { margin: 0 0 10px; font-size: 14px; line-height: 1.35; }
.share-native { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 999px; background: #4fcf76; color: #173d24; font: inherit; font-size: 17px; font-weight: 900; box-shadow: 0 4px 0 #2f9a52; cursor: pointer; }
.share-native:active { transform: translateY(3px); box-shadow: 0 1px 0 #2f9a52; }
.share-hint { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.35; opacity: 0.75; }
.share-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.share-app { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 10px; border: 0; border-radius: 14px; color: #fff; font: inherit; font-size: 15px; font-weight: 800; text-decoration: none; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.s-messenger { background: #0866ff; } .s-facebook { background: #1565d8; } .s-viber { background: #6a52d9; }
.s-whatsapp { background: #0f7a40; } .s-email { background: #6b5a80; } .s-sms { background: #2f7d45; }
.s-copy { background: #fff; color: #3b2a4a; box-shadow: inset 0 0 0 2px #d9cdf0; }

/* Goodies: the tray is the same size on every tab (one tip line, then one row of same-size
   tiles), so nothing jumps when a child switches between hats, glasses, rooms and toys */
.sheet-wrap.dress .dress-tip { height: 60px; box-sizing: border-box; padding-top: 6px; padding-bottom: 6px; font-size: 14px; line-height: 1.2; }
.sheet-wrap.dress .dress-tip > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.sheet-wrap.dress .it-tile {
  height: 128px; box-sizing: border-box; padding: 8px 8px; gap: 2px;
  display: grid; grid-template-rows: 54px 1fr auto; justify-items: center; align-items: center;
}
.sheet-wrap.dress .it-tile > b {
  max-width: 100%; font-size: 13px; line-height: 1.12; overflow-wrap: anywhere; hyphens: manual;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* 🎒 more: "change your pet" is the first, wide tile, with the pet's own picture and a pencil */
.edit-tile {
  width: 100%; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 10px 14px; text-align: left;
  border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 var(--ink);
  background: linear-gradient(160deg, #fff3b0, #ffc98f);
}
.edit-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.et-pic { position: relative; flex: none; width: 64px; height: 64px; border-radius: 16px; background: #fff; display: grid; place-items: center; }
.et-pic img { max-width: 56px; max-height: 56px; object-fit: contain; }
.et-pic i { position: absolute; right: -8px; bottom: -6px; font-style: normal; font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(59, 42, 74, 0.25)); }
.et-pic:not(:has(img)) i { position: static; font-size: 38px; }
.et-txt { min-width: 0; }
.et-txt b { display: block; font-size: 20px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.et-txt small { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; opacity: 0.75; }

/* the top bar (home, name, stars, 🎒) stays in view while a tray is open */
.room.sheet-on .room-top { z-index: 7; }
.room.pan .room-top { opacity: 1; pointer-events: none; }
.sheet-wrap.more .sheet { max-height: 74%; } /* (all of it fits without scrolling, even on a small phone) */

/* Goodies: "there's more this way". A big round arrow at each end of the row (only while
   there's more to see that way), over a soft fade, and page dots underneath. */
.it-pager { position: relative; }
.sheet-wrap.dress .it-grid { position: relative; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; } /* (no scrollbar: the arrows and dots show the way, and the row is the same height on every tab) */
.sheet-wrap.dress .it-grid::-webkit-scrollbar { display: none; }
.pg-side {
  position: absolute; top: 12px; bottom: 2px; z-index: 2; width: 74px; display: flex; align-items: center;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.pg-side.prev { left: -14px; justify-content: flex-start; padding-left: 6px; background: linear-gradient(to right, #fffaf0 35%, rgba(255, 250, 240, 0)); }
.pg-side.next { right: -14px; justify-content: flex-end; padding-right: 6px; background: linear-gradient(to left, #fffaf0 35%, rgba(255, 250, 240, 0)); }
.pg-side.on { opacity: 1; }
.pg-side.on .pg-btn { pointer-events: auto; }
.pg-btn {
  width: 52px; height: 52px; padding: 0; border: 3px solid var(--ink); border-radius: 50%;
  background: var(--yellow); box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; pointer-events: none;
}
.pg-btn i { width: 14px; height: 14px; border-top: 5px solid var(--ink); border-right: 5px solid var(--ink); border-radius: 2px; }
.pg-side.next .pg-btn i { transform: translateX(-3px) rotate(45deg); }
.pg-side.prev .pg-btn i { transform: translateX(3px) rotate(-135deg); }
.pg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.pg-side.next.on .pg-btn { animation: pg-bob 1.4s ease-in-out infinite; }
@keyframes pg-bob { 0%, 100% { translate: 0 0; } 50% { translate: 5px 0; } }
@media (prefers-reduced-motion: reduce) { .pg-side.next.on .pg-btn { animation: none; } }
.pg-dots { display: flex; justify-content: center; align-items: center; gap: 7px; height: 12px; margin-top: 4px; }
.pg-dots i { width: 9px; height: 9px; border-radius: 5px; background: rgba(59, 42, 74, 0.2); transition: width 0.2s, background 0.2s; }
.pg-dots i.on { width: 24px; background: var(--ink); }

/* Food: one row; on a narrow phone it runs past the edge, and the same big arrows as the
   Goodies show there's more (sideways swipes scroll it, pulling a food up carries it) */
.food-tray { width: max-content; overflow: hidden; padding: 0; touch-action: pan-x; }
.food-row { min-width: 0; display: flex; gap: 10px; padding: 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
.food-row::-webkit-scrollbar { display: none; }
.food-row .food { touch-action: none; } /* (see liftOrScroll: the app scrolls the row itself, so a carried food is never dropped) */
.food-tray .pg-side { top: 0; bottom: 0; width: 66px; }
.food-tray .pg-side.prev { left: 0; background: linear-gradient(to right, #fff 40%, rgba(255, 255, 255, 0)); }
.food-tray .pg-side.next { right: 0; background: linear-gradient(to left, #fff 40%, rgba(255, 255, 255, 0)); }
.food.nudge { animation: nudge 0.5s ease-in-out 1; }

/* 🎒 More sits in the dock with the others (six buttons side by side, even on a 320px phone:
   each stays at least 45px wide, with room between them and every word in full) */
.t-more { --tc: #2fa84f; --tl: #e4f8e8; }
.room-bar.dock .t-more .ic { background: var(--tl); box-shadow: inset 0 0 0 4px #bfe9c9; }
/* (at least 8px between buttons at every size, so a finger aimed at one never lands on the next) */
.room-bar.dock { width: min(calc(100% - 8px), 480px); gap: clamp(8px, 2.2vw, 10px); padding: clamp(3px, 1vw, 7px); }
.room-bar.dock button b { font-size: clamp(10.5px, 3.3vw, 14px); letter-spacing: -0.2px; }
.room-bar.dock .ic { width: clamp(36px, 11.5vw, 50px); height: clamp(36px, 11.5vw, 50px); }
@media (max-width: 380px) { .room-bar.dock button { border-width: 2px; } }

/* The dock, simpler: each button is just its picture on a soft coloured circle and one word
   (the red "!" and the glow still say when the pet needs something) */
.room-bar.dock .ic, .room-bar.dock .t-dress .ic, .room-bar.dock .t-more .ic { background: var(--tl); box-shadow: none; }
.room-bar.dock button.on .ic { background: rgba(255, 255, 255, 0.92); }
.room-bar.dock button b { overflow: hidden; text-overflow: clip; }

/* Let's play: the six games sit three to a row, so they all fit at once (no "more below") */
.sheet-wrap.play .game-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-wrap.play .game-tile { padding: 10px 4px 8px; gap: 3px; border-radius: 20px; }
.sheet-wrap.play .game-tile .gt-ic { font-size: 36px; }
.sheet-wrap.play .game-tile b { font-size: clamp(12.5px, 3.9vw, 16px); line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.sheet-wrap.play .game-tile small { font-size: 11.5px; padding: 2px 7px; }
.sheet-wrap.play .sheet-sub { margin: 10px 4px 6px; }

/* "There's more below": the same big yellow arrow as the sideways rows, over a shorter fade */
.more-hint, .screen:not(.room) > .more-hint { height: 58px; }
.sheet > .more-hint, .modal-card > .more-hint, .help-card > .more-hint, .ig-card > .more-hint { background: linear-gradient(to bottom, rgba(255, 250, 240, 0), rgba(255, 250, 240, 0.9) 75%); }
.more-hint button { width: 50px; height: 50px; border: 3px solid var(--ink); background: var(--yellow); box-shadow: 0 4px 0 var(--ink); }
.more-hint i { width: 14px; height: 14px; border-right: 5px solid var(--ink); border-bottom: 5px solid var(--ink); border-radius: 2px; }
.sheet-wrap.play .sheet { max-height: 74%; } /* (all six games in view, even on a small phone) */

/* ================= decorating, and the garden ================= */
.room.decorating .room-top, .room.decorating .room-bar, .room.decorating .room-guide, .room.decorating .friend-pill,
.room.decorating .pet-say, .room.decorating .food-tray, .room.decorating .coach { display: none !important; }

/* the sign at the side of the room: out to the garden (right), or back in (left) */
.go-btn {
  position: absolute; right: 6px; top: 37%; z-index: 2;
  display: flex; align-items: center; gap: 2px; height: 62px; padding: 0 6px 0 10px;
  border: 3px solid #fff; border-radius: 31px; background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 0 #2f9a52, 0 8px 16px rgba(59, 42, 74, 0.16);
}
.go-btn .ic { font-size: 34px; line-height: 1; }
.go-btn .go-arrow { width: 26px; height: 26px; border-radius: 50%; background: #3fb950; position: relative; animation: go-bob 1.3s ease-in-out infinite; }
.go-btn .go-arrow::after {
  content: ""; position: absolute; left: 7px; top: 7px; width: 9px; height: 9px;
  border-top: 4px solid #fff; border-right: 4px solid #fff; transform: rotate(45deg); border-radius: 2px;
}
.go-btn.left { right: auto; left: 6px; flex-direction: row-reverse; padding: 0 10px 0 6px; }
.go-btn.left .go-arrow::after { left: 10px; transform: rotate(-135deg); }
.go-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2f9a52; }
.go-btn.hint { animation: go-glow 1.6s ease-in-out infinite; }
@keyframes go-bob { 0%, 100% { translate: 0 0; } 50% { translate: 4px 0; } }
.go-btn.left .go-arrow { animation-name: go-bob-l; }
@keyframes go-bob-l { 0%, 100% { translate: 0 0; } 50% { translate: -4px 0; } }
@keyframes go-glow { 0%, 100% { box-shadow: 0 4px 0 #2f9a52, 0 0 0 0 rgba(255, 216, 77, 0); } 50% { box-shadow: 0 4px 0 #2f9a52, 0 0 0 8px rgba(255, 216, 77, 0.9); } }
.room.decorating .go-btn, .room.gaming .go-btn, .room.birthing .go-btn, .room.sheet-on .go-btn, .room.feeding .go-btn { display: none; }

/* the bar along the top while decorating: what's going on, your stars, and a big ✓ Done */
.deco-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 7;
  display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 10px 10px 14px;
  background: rgba(255, 250, 240, 0.96); border-radius: 0 0 26px 26px; box-shadow: 0 6px 20px rgba(40, 20, 60, 0.18);
  animation: deco-down 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.deco-bar.hidden { display: none; }
@keyframes deco-down { from { transform: translateY(-100%); } }
.db-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: clamp(18px, 5.4vw, 24px); font-weight: 900; }
.db-title span { font-size: 1.3em; line-height: 1; }
.db-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deco-bar .sheet-stars { flex: none; }
.deco-bar .big-btn { width: auto; flex: none; min-height: 56px; padding: 0 clamp(14px, 4vw, 24px); font-size: clamp(19px, 5.4vw, 23px); font-weight: 900; }

/* the tray of things along the bottom (the room above it stays touchable) */
.deco-tray {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  background: #fffaf0; border-radius: 30px 30px 0 0; box-shadow: 0 -8px 30px rgba(40, 20, 60, 0.25);
  padding: 12px 14px max(12px, env(safe-area-inset-bottom)); animation: sheet-up 0.38s cubic-bezier(0.34, 1.3, 0.64, 1);
  touch-action: pan-x;
}
.deco-tray.hidden { display: none; }
.deco-tray .tabs button { padding: 5px 2px; }
.deco-tray .dress-tip { height: 52px; box-sizing: border-box; padding-top: 6px; padding-bottom: 6px; font-size: 14px; line-height: 1.2; margin-top: 8px; }
.deco-tray .dress-tip > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.deco-tray .it-grid {
  display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 104px; gap: 10px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 4px 4px 8px; margin: 8px -4px 0; position: relative;
}
.deco-tray .it-grid::-webkit-scrollbar { display: none; }
.deco-tray .it-tile {
  height: 124px; box-sizing: border-box; padding: 8px; gap: 2px; scroll-snap-align: start;
  display: grid; grid-template-rows: 56px 1fr auto; justify-items: center; align-items: center;
}
.deco-tray .it-tile > b { max-width: 100%; font-size: 13px; line-height: 1.12; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.deco-tray .it-tile.draggable { touch-action: none; cursor: grab; }
.deco-tray .it-cv { width: 60px; height: 56px; }
.deco-tray .it-tile.paint .it-room { width: 72px; height: 56px; }
.deco-tray .pg-side { top: 8px; }
/* which part to paint: five buttons in a row */
.part-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; height: 52px; margin-top: 8px; }
.part-row button {
  border: none; border-radius: 16px; background: #f1e9f5; padding: 2px; font-size: 11.5px; font-weight: 900; line-height: 1.05;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; overflow: hidden;
}
.part-row button span { font-size: 20px; line-height: 1; }
.part-row button.on { background: var(--yellow); box-shadow: inset 0 0 0 3px #e0a800; }
/* carrying something that's in the room: let go on the tray to put it away */
.drop-here {
  display: none; position: absolute; inset: 0; z-index: 3; border-radius: 30px 30px 0 0;
  background: rgba(255, 236, 170, 0.94); border: 4px dashed #e0a800;
  align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 900; text-align: center; padding: 0 16px;
}
.drop-here span { font-size: 44px; }
.room.carrying .deco-tray .drop-here { display: flex; opacity: 0.55; }
.deco-tray.drop .drop-here { opacity: 1; animation: bump 0.4s; }

/* off to the garden (or back in): a leafy swoosh across the screen */
.wipe { position: absolute; inset: 0; z-index: 9; pointer-events: none; display: grid; place-items: center; transform: translateX(100%); }
.wipe.hidden { display: none; }
.wipe span { font-size: 96px; filter: drop-shadow(0 6px 0 rgba(40, 20, 60, 0.15)); }
.wipe.to-garden { background: radial-gradient(circle at 50% 45%, #c9f2b0, #6cc35a 70%); }
.wipe.to-room { background: radial-gradient(circle at 50% 45%, #fff3d6, #f6c98f 70%); }
.wipe.go.rtl { animation: wipe-rtl 1s cubic-bezier(0.6, 0, 0.4, 1) forwards; }
.wipe.go.ltr { animation: wipe-ltr 1s cubic-bezier(0.6, 0, 0.4, 1) forwards; }
@keyframes wipe-rtl { 0% { transform: translateX(100%); } 42%, 58% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
@keyframes wipe-ltr { 0% { transform: translateX(-100%); } 42%, 58% { transform: translateX(0); } 100% { transform: translateX(100%); } }

/* Goodies has three tabs now (hats, glasses, and the room) */
.sheet-wrap.dress .tabs { grid-template-columns: repeat(3, 1fr); }
/* drawing a toy or a picture: no dotted head to draw a hat on */
#screen-hat.deco-draw .hat-head { display: none; }
@media (max-width: 360px) { .room-top .star-pill { padding: 0 6px 0 5px; font-size: 17px; } .room-top { gap: 8px; } }
.deco-tray .deco-tabs button { flex-direction: column; justify-content: center; gap: 0; height: 50px; font-size: 12.5px; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.deco-tray .deco-tabs button span { font-size: 21px; }
.deco-tray .dress-tip { height: 46px; }
.deco-tray .part-row { height: 46px; }
@media (max-width: 360px) { .db-title span { display: none; } .deco-bar { gap: 6px; padding-left: 12px; } .deco-bar .sheet-stars { padding: 6px 9px; font-size: 16px; } }

/* ================= the name and level: tap it to see how the pet grows ================= */
.room-name[role="button"] { cursor: pointer; }
.room-name[role="button"]:active { transform: translateY(3px) scale(0.97); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.22); }
.room-name.bump { animation: bump 0.45s cubic-bezier(0.34, 1.8, 0.64, 1); }
/* (the card drops down from the bar; the pet showing off stays in view below it) */
.grow-wrap {
  position: absolute; inset: 0; z-index: 8; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(max(10px, env(safe-area-inset-top)) + 64px) 12px 12px; background: rgba(40, 20, 60, 0.28);
}
.grow-wrap.hidden { display: none; }
.grow-card {
  position: relative; width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto; box-sizing: border-box;
  background: #fffaf0; border-radius: 26px; padding: 14px 16px 14px; box-shadow: 0 10px 40px rgba(40, 20, 60, 0.35);
  animation: grow-drop 0.42s cubic-bezier(0.34, 1.5, 0.64, 1); transform-origin: 50% 0;
}
.grow-card::before { /* a little point up at the bar */
  content: ""; position: absolute; top: -10px; left: 50%; margin-left: -12px;
  border: 12px solid transparent; border-top: 0; border-bottom-color: #fffaf0;
}
@keyframes grow-drop { from { transform: translateY(-14px) scale(0.85); opacity: 0; } }
.gw-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gw-ic { font-size: 38px; line-height: 1; }
.gw-head b { display: block; font-size: 24px; font-weight: 900; line-height: 1.1; color: #2e7d3a; }
.gw-head small { display: block; font-size: 15px; font-weight: 800; opacity: 0.7; }
/* the steps up, smallest to biggest, with the pet's own picture standing on the one it's on */
.grow-path { display: flex; align-items: flex-end; justify-content: space-between; gap: 2px; height: 92px; margin: 6px 2px 4px; }
.grow-path .st {
  position: relative; flex: none; width: calc(30px * var(--k)); height: calc(30px * var(--k)); border-radius: 50%;
  display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: calc(14px * var(--k) + 2px);
  background: #ece6f2; color: #8a7a99;
}
.grow-path .st.done { background: #3fb950; color: #fff; }
.grow-path .st.now { background: #ffd84d; color: #6b4300; box-shadow: 0 0 0 4px #fff3b0, 0 0 14px rgba(255, 200, 40, 0.9); }
.grow-path .st img {
  position: absolute; left: 50%; bottom: calc(100% + 2px); width: 50px; height: 50px; margin-left: -25px; object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(40, 20, 60, 0.25)); animation: grow-hop 1.1s ease-in-out infinite;
}
@keyframes grow-hop { 0%, 100% { transform: translateY(0) scaleY(1); } 40% { transform: translateY(-8px) scaleY(1.04); } 70% { transform: translateY(0) scaleY(0.94); } }
.grow-bar { height: 16px; border-radius: 9px; background: #e3efe0; overflow: hidden; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.06); }
.grow-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #6fdc8c, #3fb950); animation: grow-fill 0.9s cubic-bezier(0.3, 1.2, 0.6, 1); }
@keyframes grow-fill { from { width: 0; } }
.grow-left { margin: 6px 0 0; text-align: center; font-size: 19px; font-weight: 900; }
.grow-how { margin: 10px 0 6px; text-align: center; font-size: 14px; font-weight: 800; opacity: 0.7; }
.grow-do { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.grow-do button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; min-width: 0;
  border: 3px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--ink);
  font-size: 13px; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere;
}
.grow-do button span { font-size: 30px; line-height: 1.1; }
.grow-do button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.grow-card .big-btn { max-width: none; min-height: 56px; }
.room.gaming .grow-wrap, .room.decorating .grow-wrap, .room.birthing .grow-wrap { display: none; }

/* ---------- zoom on a picture being fixed (its eyes and mouth, its edges) ----------
   Big 🔍 buttons in the corner; ✋ moves the zoomed picture with one finger. */
.zoomable { position: relative; overflow: hidden; }
.zoomable.zoom-on { touch-action: none; }
.zoom-pic { transform-origin: 0 0; }
.zoomable.moving .zoom-pic { cursor: grab; }
.zoom-ui { position: absolute; right: 8px; bottom: 8px; left: 8px; display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; z-index: 2; }
.zoom-pair { display: flex; gap: 8px; margin-left: auto; }
.zoom-btn {
  pointer-events: auto; width: 60px; height: 60px; border-radius: 50%; border: 3px solid #fff;
  background: #fff; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.18), 0 6px 14px rgba(59, 42, 74, 0.16);
  display: grid; place-items: center; position: relative; padding: 0; color: var(--ink);
}
.zoom-btn i { font-style: normal; font-size: 26px; line-height: 1; }
.zoom-btn b { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 20px; line-height: 24px; font-weight: 900; text-align: center; }
.zoom-btn:active { transform: translateY(2px); }
.zoom-btn:disabled { opacity: 0.4; }
.zoom-move { width: auto; border-radius: 30px; padding: 0 16px 0 12px; display: flex; gap: 6px; }
.zoom-move b { position: static; width: auto; height: auto; background: none; color: inherit; font-size: 15px; line-height: 1; }
.zoom-move.on { background: var(--yellow); box-shadow: 0 0 0 3px var(--ink), 0 3px 0 rgba(59, 42, 74, 0.18); }
.zoom-ui.hidden { display: none; }
@media (max-width: 360px) { .zoom-btn { width: 54px; height: 54px; } .zoom-btn i { font-size: 23px; } }

/* the daily surprise, opened: what was inside, what it's for, where it is */
.gift-why { margin: 0; font-size: 16px; font-weight: 700; opacity: 0.75; }
.gift-prizes { display: flex; align-items: center; justify-content: center; gap: 8px; }
.gift-prize {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 100px; max-width: 132px;
  padding: 10px 10px 8px; border-radius: 22px; background: #fff3fa; box-shadow: inset 0 0 0 3px #ffd6ec;
  text-align: center; animation: letter-pop 0.6s cubic-bezier(0.34, 1.8, 0.64, 1) both;
}
.gift-prize .gp-ic { font-size: 60px; line-height: 1.05; }
.gift-prize b { font-size: 18px; font-weight: 900; line-height: 1.15; }
.gift-prize small { font-size: 13px; font-weight: 800; opacity: 0.7; line-height: 1.15; }
.gift-prize.stars { background: linear-gradient(180deg, #fff3b8, #ffe07a); box-shadow: inset 0 0 0 3px #ffc93c; animation-delay: 0.15s; }
.gift-prize.stars b { font-size: 28px; color: #6b4300; }
.gift-plus { font-size: 26px; font-weight: 900; opacity: 0.45; }
.gift-bank { margin: 0; font-size: 15px; font-weight: 800; }
.gift-next { margin: 0; font-size: 15px; font-weight: 700; opacity: 0.75; }
.modal-card.gift .modal-btns { width: 100%; }


/* ---------- pets can be lost: where they are saved, and the way to a backup ---------- */
.save-strip {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 440px;
  border: 2px solid #d9e8d0; border-radius: 16px; padding: 8px 12px; background: rgba(255, 255, 255, 0.85);
  color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.3; text-align: left; flex: none;
}
.save-strip.warn { background: #fff4d6; border-color: #ffc93c; }
.save-strip b { text-decoration: underline; }
.save-strip.hidden { display: none; }
.safe-warn { margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: #fff4d6; border: 2px solid #ffc93c; font-size: 15px; line-height: 1.4; }
.modal-card.loss .loss-how { font-weight: 700; }
/* (short phones: the whole card, both buttons too, fits without scrolling) */
@media (max-height: 640px) {
  .modal-card.loss .gate-ic { font-size: 36px; line-height: 1.1; }
  .modal-card.loss h3 { font-size: 20px; }
  .modal-card.loss .gate-why { font-size: 14px; line-height: 1.35; }
}


/* ---------- colouring in the eyes and mouth ---------- */
.ft-n { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: rgba(59, 42, 74, 0.14); font-style: normal; font-size: 13px; font-weight: 900; }
[data-ft].on .ft-n { background: var(--ink); color: #fff; }
/* a finger rubbing over the picture, leaving yellow (pink for the mouth): this is how */
/* ---------- the face game: find the eyes, then the mouth ---------- */
/* a finger rubbing round and round right where the eyes (or the mouth) should be, leaving paint */
.paint-demo { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.paint-demo.hidden { display: none; }
/* (not sure where the eyes are: it only shows how to rub, low down at the side) */
.paint-demo.loose { left: 26%; top: 74%; }
.paint-demo.loose .pd-ring { display: none; }
.paint-demo .pd-blob { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 176, 0, 0.7); animation: pd-blob 2.4s ease-in-out infinite; }
.paint-demo .pd-ring { position: absolute; left: -38px; top: -38px; width: 76px; height: 76px; border-radius: 50%; border: 4px dashed rgba(255, 150, 0, 0.9); animation: pd-ring 2.4s linear infinite; }
.paint-demo.mouth .pd-blob { background: rgba(255, 61, 139, 0.65); border-radius: 40%; }
.paint-demo.mouth .pd-ring { border-color: rgba(255, 61, 139, 0.9); }
.paint-demo .pd-hand { position: absolute; left: -6px; top: -4px; font-size: 46px; line-height: 1; animation: pd-rub 2.4s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); }
@keyframes pd-blob { 0% { transform: scale(0); opacity: 1; } 55% { transform: scale(1); opacity: 1; } 85%, 100% { transform: scale(1); opacity: 0; } }
@keyframes pd-ring { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(1.08); } 100% { transform: rotate(180deg) scale(1); } }
@keyframes pd-rub { 0% { transform: translate(-14px, 0); } 15% { transform: translate(0, -12px); } 30% { transform: translate(14px, 0); } 45% { transform: translate(0, 12px); } 60% { transform: translate(-12px, 0); } 75% { transform: translate(0, -8px); } 100% { transform: translate(-14px, 0); } }
@media (prefers-reduced-motion: reduce) { .paint-demo .pd-blob, .paint-demo .pd-hand, .paint-demo .pd-ring { animation: none; } }

/* the mission card: a big picture of what to find, a few words, and a slot for each one */
.mission { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 460px; padding: 8px 12px; border-radius: 22px; background: #fff7d6; border: 3px solid #ffd54a; box-shadow: 0 4px 0 #f2c94c; }
.mission.hidden { display: none; }
.mission.mouth { background: #ffe6f0; border-color: #ff8fbf; box-shadow: 0 4px 0 #f06aa4; }
.mission.done { background: #e3f9e5; border-color: #6fd17f; box-shadow: 0 4px 0 #43b357; }
.ms-ic { font-size: 40px; line-height: 1; animation: ms-look 2.6s ease-in-out infinite; }
@keyframes ms-look { 0%, 70%, 100% { transform: rotate(0) scale(1); } 78% { transform: rotate(-10deg) scale(1.12); } 88% { transform: rotate(10deg) scale(1.12); } }
.ms-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ms-title { font-size: clamp(18px, 5.4vw, 22px); font-weight: 900; line-height: 1.1; }
.ms-sub { font-size: 14px; font-weight: 700; opacity: 0.75; line-height: 1.2; }
.ms-slots { display: flex; gap: 6px; flex-shrink: 0; }
.ms-slot { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 3px dashed rgba(59, 42, 74, 0.3); background: rgba(255, 255, 255, 0.7); font-size: 22px; }
.ms-slot.got { border: 3px solid #fff; background: #ffb000; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.2); animation: ms-got 0.5s cubic-bezier(0.3, 1.8, 0.5, 1); }
.mission.mouth .ms-slot.got { background: #ff3d8b; }
@keyframes ms-got { 0% { transform: scale(0.3); } 100% { transform: scale(1); } }
@media (max-width: 360px) { .ms-ic { font-size: 32px; } .ms-slot { width: 32px; height: 32px; font-size: 18px; } .ms-sub { font-size: 13px; } }
.ms-none:empty { display: none; }
/* a short screen: the picture gets the room (fewer words, slimmer step tabs) */
@media (max-height: 700px) {
  .ms-none { display: none; }
  .mission { padding: 5px 10px; }
  .ms-ic { font-size: 30px; }
  #screen-face.fixing #face-tabs button { min-height: 40px; padding-top: 2px; padding-bottom: 2px; }
}
@media (prefers-reduced-motion: reduce) { .ms-ic, .ms-slot.got { animation: none; } }

/* stars bursting out of an eye or a mouth the moment it's found */
.face-sparks { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.spark { position: absolute; font-size: 22px; line-height: 1; font-style: normal; transform: translate(-50%, -50%); animation: spark 0.9s ease-out forwards; }
.spark.big { font-size: 30px; font-weight: 900; color: #2e9c55; text-shadow: 0 2px 0 #fff, 0 0 6px #fff; animation: spark-up 1.1s ease-out forwards; }
@keyframes spark { 0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(160deg); opacity: 0; } }
@keyframes spark-up { 0% { transform: translate(-50%, -30%) scale(0.5); opacity: 0; } 25% { transform: translate(-50%, -80%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -170%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .spark { animation-duration: 0.01s; } }

/* a sleeping pet until it has eyes */
.face-zzz { position: absolute; font-size: 30px; pointer-events: none; z-index: 2; animation: zzz 2s ease-in-out infinite; }
.face-zzz.hidden { display: none; }
@keyframes zzz { 0%, 100% { transform: translate(0, 0) scale(0.9); opacity: 0.6; } 50% { transform: translate(6px, -10px) scale(1.1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .face-zzz { animation: none; } }
#face-done.ready { animation: pulse 1.4s ease-in-out infinite; }

/* (small phones: the strip stays one or two short lines, and the step tabs fit side by side) */
@media (max-height: 640px) { .save-strip { padding: 5px 10px; font-size: 13px; border-radius: 12px; } }
#face-tabs button { min-width: 0; }
@media (max-width: 360px) {
  #face-tabs button { font-size: 15px; gap: 3px; padding: 0 4px; }
  #face-tabs b { min-width: 20px; padding: 1px 5px; font-size: 12px; }
  .ft-n { width: 18px; height: 18px; margin-right: 2px; font-size: 11px; }
}
@media (max-height: 640px) { #start-play { margin-top: 4px; } } /* (the pet above it stays a finger away) */

/* ---------- tidy up: a big ✕ on each bit that looks extra; one tap takes it off ---------- */
.cut-bits { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.cut-bit { pointer-events: auto; position: absolute; width: 52px; height: 52px; margin: -26px 0 0 -26px; padding: 0; border-radius: 50%; border: 4px solid #fff; background: #e8364f; color: #fff; font: 900 26px/1 system-ui, sans-serif; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.25), 0 0 0 6px rgba(232, 54, 79, 0.25); animation: bit-pulse 1.6s ease-in-out infinite; touch-action: manipulation; }
.cut-bit:active { transform: scale(0.92); }
.cut-bit.poof { animation: bit-poof 0.25s ease-out forwards; background: #fff; }
@keyframes bit-pulse { 0%, 100% { box-shadow: 0 4px 0 rgba(59, 42, 74, 0.25), 0 0 0 4px rgba(232, 54, 79, 0.25); } 50% { box-shadow: 0 4px 0 rgba(59, 42, 74, 0.25), 0 0 0 12px rgba(232, 54, 79, 0.12); } }
@keyframes bit-poof { to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cut-bit { animation: none; } }
#cut-ok.ready { animation: pulse 1.4s ease-in-out infinite; }

/* ================= the first screen: a living drawing on a sunny hill, one sentence, one button ================= */
.screen.intro { --hero: max(240px, calc(100dvh - 320px)); gap: 0; padding: 0; background: linear-gradient(180deg, #8fd3ff 0%, #c9ecff 100%); }
.intro-hero { position: relative; flex: none; width: 100%; height: var(--hero); display: flex; flex-direction: column; align-items: center; overflow: hidden; padding-top: max(8px, env(safe-area-inset-top)); }
.intro-hill { position: absolute; left: -20%; right: -20%; bottom: -84px; height: 180px; border-radius: 50%; background: #a8e08c; }
.intro-top { position: absolute; z-index: 4; left: 8px; right: 8px; top: max(4px, env(safe-area-inset-top)); width: auto; max-width: none; gap: 8px; }
/* (just the other language's flag, small, in the corner) */
.intro .lang-pick button { min-width: 44px; min-height: 44px; padding: 4px; border: none; background: none; box-shadow: none; }
.intro .lang-pick button.on { display: none; }
.intro-logo { position: relative; z-index: 2; margin: 4px 0 0; font-size: clamp(30px, 9.6vw, 52px); }
.story { position: relative; z-index: 2; flex: none; width: 100%; height: calc(var(--hero) - clamp(44px, 12vw, 66px) - 34px); align-items: end; }
/* (welcome shown again from the settings: on a narrow phone Skip and the sound button sit above the name, not on it) */
@media (max-width: 520px) {
  .intro:has(#intro-skip:not(.hidden)) .intro-logo { margin-top: 52px; }
  .intro:has(#intro-skip:not(.hidden)) .story { height: calc(var(--hero) - clamp(44px, 12vw, 66px) - 34px - 48px); }
}
.story-box { max-height: 460px; }
.st-flash { pointer-events: none; } /* (it stays on top, invisible: a tap must reach the pet under it) */
.st-live { left: -12%; right: -12%; top: -32%; bottom: 0; pointer-events: none; } /* (room above the paper for a jump: never a cut-off head) */
.story-box.live .st-live { pointer-events: auto; }
.st-live canvas { width: 100%; height: 100%; display: block; opacity: 0; touch-action: none; }
.st-live canvas.on { opacity: 1; }
/* (until the pet is built the film holds its first picture, so the crayon never stutters) */
.story-box.wait > * { animation-play-state: paused; }
/* the camera's flash: a soft burst of light, not a white box */
.st-flash { background: radial-gradient(closest-side, #fff 35%, rgba(255, 255, 255, 0.6) 65%, rgba(255, 255, 255, 0) 100%); }
/* alive: the drawing has become the pet (in its very place), the paper drops away behind it */
.story-box.live .st-ink, .story-box.live .st-crayon { animation: none; opacity: 0; }
.story-box.live .st-paper { animation: live-paper 0.7s ease-in 0.4s both; }
@keyframes live-paper { 0% { opacity: 1; transform: rotate(-4deg); } 100% { opacity: 0; transform: translateY(12%) rotate(-9deg) scale(0.86); } }
.story-box.live .st-phone { animation: live-phone 0.45s ease-in both; }
@keyframes live-phone { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(40%) rotate(-8deg); } }
.story-box.live .st-flash { animation: live-flash 0.45s ease-out forwards; }
@keyframes live-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.story-box.live .st-shadow { animation: live-shadow 0.9s ease-out both; }
@keyframes live-shadow { 0%, 50% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: none; } }
.story-box.live .st-heart { animation-iteration-count: 1; animation-fill-mode: both; animation-name: live-heart; animation-duration: 2.4s; animation-delay: 1.1s; }
.story-box.live .st-heart.s2 { animation-delay: 1.25s; } .story-box.live .st-heart.s3 { animation-delay: 1.45s; }
@media (prefers-reduced-motion: reduce) { .story-box.live .st-paper, .story-box.live .st-phone, .story-box.live .st-flash { animation: none; opacity: 0; } .story-box.live .st-shadow { animation: none; opacity: 1; } }
@keyframes live-heart { 0% { opacity: 0; transform: translateY(20px) scale(0.5); } 20% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-44px) scale(1.1); } }
/* what the pet says */
.st-say { position: absolute; right: 10px; top: 3%; z-index: 3; max-width: 58%; padding: 8px 14px; border-radius: 20px 20px 20px 5px; background: #fff; font-size: clamp(15px, 4.4vw, 18px); font-weight: 900; line-height: 1.15; box-shadow: 0 4px 14px rgba(59, 42, 74, 0.2); pointer-events: none; }
.st-say.pop { animation: say-pop 0.4s cubic-bezier(0.34, 1.8, 0.64, 1); }
.st-say.hidden { display: none; }
@media (max-height: 640px) { .st-say { top: -4px; right: 6px; max-width: 46%; padding: 5px 9px; font-size: 13px; } }
/* the card under the picture: the words and the button */
.intro-card { position: relative; z-index: 3; flex: 1 0 auto; width: 100%; margin-top: -20px; padding: 20px 20px max(16px, env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: #fffaf0; box-shadow: 0 -6px 24px rgba(59, 42, 74, 0.12); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.intro-head { margin: 0; max-width: 460px; text-align: center; font-size: clamp(30px, 9.2vw, 44px); font-weight: 900; line-height: 1.06; text-wrap: balance; }
.intro-head em { font-style: normal; color: #ff4f8b; }
.intro-sub { margin: 0; max-width: 420px; text-align: center; font-size: clamp(16px, 4.6vw, 20px); font-weight: 700; line-height: 1.28; color: #6a5a78; text-wrap: balance; }
.intro-go { width: 100%; max-width: 420px; gap: 10px; margin-top: 8px; } /* (8px+ apart: a finger aimed at one never lands on the other) */
.intro-go .big-btn { min-height: 66px; font-size: clamp(20px, 6vw, 26px); }
.intro-soft { display: block; width: 100%; min-height: 48px; padding: 8px; border: none; background: none; font-size: clamp(16px, 4.8vw, 19px); font-weight: 800; text-decoration: underline; color: #6a4a8a; }
/* below the fold, for the grown-ups: what the app is, in pictures (scrolled to, never in the way) */
.intro-more { width: 100%; max-width: 560px; margin-top: 18px; padding-top: 16px; border-top: 2px solid #f1e8f6; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.im-for { margin: 6px 0 -2px; font-size: 14px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #8a7a99; text-align: center; }
.im-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.im-card { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 14px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.1); text-align: center; overflow-wrap: break-word; }
.im-card h4 { margin: 4px 0 0; font-size: 19px; font-weight: 900; line-height: 1.15; }
.im-card p { margin: 0; font-size: 15px; line-height: 1.35; color: #5d4d6c; }
.im-pic { height: 74px; display: flex; align-items: center; justify-content: center; }
.im-wide { grid-column: 1 / -1; flex-direction: row; gap: 14px; padding: 16px; text-align: left; }
.im-wide .im-pic { flex: none; width: 116px; height: 100px; }
.im-emoji { font-size: 44px; line-height: 1; }
.im-two { font-size: 34px; gap: 6px; }
.im-num { font-size: 48px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; color: #2b8fd6; }
.im-own { flex-direction: column; text-align: center; background: #fff6d6; }
.im-own .im-pic { width: auto; height: 116px; gap: 10px; }
.im-own h4 { font-size: 22px; }
.im-sheet { width: 96px; height: 106px; padding: 6px; border-radius: 4px; background: repeating-linear-gradient(#fff 0 12px, #cfe3ff 12px 13px); box-shadow: 0 2px 5px rgba(59, 42, 74, 0.18); transform: rotate(-5deg); }
.im-to { font-size: 30px; font-weight: 900; color: #c47a00; }
.im-live { width: 96px; height: 106px; transform-origin: 50% 100%; animation: im-wiggle 1.6s ease-in-out infinite; }
.im-art { width: 100%; height: 100%; object-fit: contain; display: block; }
.im-art:not([src]) { visibility: hidden; }
@keyframes im-wiggle { 0%, 100% { transform: none; } 25% { transform: scale(1.08, 0.92); } 50% { transform: translateY(-14%) scale(0.94, 1.06) rotate(-4deg); } 75% { transform: rotate(4deg); } }
.im-draw { background: #ffeede; }
.im-calm { background: #ffe7ef; }
.im-bubble { position: relative; padding: 6px 12px; border-radius: 16px; background: #fff; font-weight: 900; font-size: 15px; color: var(--ink, #3b2a4a); box-shadow: 0 2px 0 rgba(59, 42, 74, 0.1); }
.im-bubble::after { content: ""; position: absolute; left: 22px; bottom: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.im-counts { width: 100%; padding: 16px 10px 14px; border-radius: 24px; background: #e9f6ff; box-shadow: 0 4px 0 rgba(59, 42, 74, 0.1); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.im-counts ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.im-counts li { min-width: 0; display: flex; flex-direction: column; align-items: center; font-size: 14px; font-weight: 800; line-height: 1.2; }
.im-counts li span { font-size: 28px; line-height: 1.1; }
.im-counts li b { font-size: 34px; font-weight: 900; line-height: 1.05; color: #2b8fd6; }
.im-counts p { margin: 0; font-size: 15px; font-weight: 800; }
.im-home { background: #ffe7ef; }
.im-phone { flex: none; width: 58px; height: 92px; border: 6px solid #2b2140; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 30px; }
.im-cloud { flex: none; width: 48px; margin: -44px 0 0 6px; }
.im-cloud svg { width: 100%; display: block; }
.im-free { background: #fff3c4; }
.im-plane { background: #e9fbe9; }
.im-web { background: #f3eaff; }
.im-age { background: #e3f3ff; }
.im-switch { gap: 8px; font-size: 32px; }
.im-switch i { position: relative; width: 62px; height: 36px; border-radius: 18px; background: #c9c2d1; animation: im-sw-bg 4s ease-in-out infinite; }
.im-switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2); animation: im-sw-knob 4s ease-in-out infinite; }
@keyframes im-sw-bg { 0%, 25% { background: #c9c2d1; } 35%, 90% { background: #5fd27a; } 100% { background: #c9c2d1; } }
@keyframes im-sw-knob { 0%, 25% { transform: none; } 35%, 90% { transform: translateX(26px); } 100% { transform: none; } }
.im-win { width: 92px; height: 68px; border: 4px solid #2b2140; border-radius: 12px; background: #fff; overflow: hidden; }
.im-win::before { content: "• • •"; display: block; height: 16px; padding-left: 6px; background: #d9cdf0; font-size: 12px; line-height: 14px; text-align: left; color: #6b5a80; letter-spacing: 1px; }
.im-win img { display: block; width: 38px; height: 38px; margin: 3px auto 0; border-radius: 9px; }
.im-sum { display: table; margin: 6px auto 0; padding: 3px 10px; border-radius: 12px; background: #fff; font-weight: 900; font-size: 15px; }
.im-gran { background: #fff3c4; }
.im-gran .im-two { gap: 4px; }
.im-warn { align-items: center; background: #fff4e0; }
.im-warn .im-pic { width: 44px; height: auto; }
.im-warn p { font-weight: 800; color: inherit; }
/* (the smallest phones: a wide card's picture goes on top, so its words get the whole width) */
@media (max-width: 380px) {
  .im-wide:not(.im-warn) { flex-direction: column; text-align: center; }
  .im-wide:not(.im-warn) .im-pic { width: auto; height: 90px; }
  .im-card h4 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .im-live, .im-switch i, .im-switch i::after { animation: none; } }
.intro-grown { width: 100%; max-width: 440px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.intro-link { display: block; width: 100%; min-height: 44px; padding: 10px 6px; border: none; background: none; text-align: center; font-size: 15px; font-weight: 800; text-decoration: underline; color: #6a4a8a; cursor: pointer; }
.intro-link.hidden { display: none; }
/* (the smallest phones: the whole warning and its button fit without scrolling) */
@media (max-height: 640px) {
  .modal-card.loss { gap: 6px; padding: 12px 14px; }
  .modal-card.loss .stake-title { font-size: 18px !important; }
  .modal-card.loss .stake-where { margin-top: 0 !important; font-size: 15px !important; }
  .modal-card.loss .stake-ways { margin-top: 4px; gap: 2px; }
  .modal-card.loss .stake-ways li { padding: 1px 2px; }
  .modal-card.loss .stake-ways b { font-size: 14px; }
  .modal-card.loss .stake-ways small { font-size: 12.5px; margin-top: 1px; }
  .modal-card.loss .stake-ways span { font-size: 18px; width: 26px; }
  .modal-card.loss .stake-gone { margin-top: 4px !important; font-size: 14px !important; }
  .modal-card.loss .stake-fix { font-size: 14px; }
  .modal-card.loss .big-btn { min-height: 50px; font-size: 18px; }
}

/* ================= what is at stake: the same words on the card and in the settings ================= */
.stake-title { margin: 0; font-size: 22px !important; font-weight: 900; line-height: 1.18; text-align: center; }
.stake-where { margin: 4px 0 0 !important; font-size: 18px !important; font-weight: 800; text-align: center; opacity: 1 !important; }
.stake-ways { list-style: none; margin: 8px auto 0; max-width: 330px; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.stake-ways li { display: flex; align-items: center; gap: 10px; padding: 3px 2px; }
.stake-ways span { flex: none; width: 28px; font-size: 22px; line-height: 1; text-align: center; }
.stake-ways b { font-size: 16px; font-weight: 800; line-height: 1.2; }
/* one small line under a reason, saying why (the cookies) */
.stake-ways div b { display: block; }
.stake-ways small { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 700; line-height: 1.25; opacity: 0.78; }
.stake-gone { margin: 10px 0 0 !important; font-size: 17px !important; font-weight: 900; line-height: 1.28; text-align: center; color: #c2233c; opacity: 1 !important; }
.stake-fix { width: 100%; margin: 2px 0 0; font-size: 16px; font-weight: 800; line-height: 1.3; }
.modal-card.loss { max-height: calc(100dvh - 24px); overflow-y: auto; }
.modal-card.loss .gate-ic { font-size: 44px; }
.stake-card { border: 3px solid #ffb300; }
.safe-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 9px 12px; border-radius: 14px; background: #fff4d6; font-size: 16px; font-weight: 800; }
.safe-status.ok { background: #e6f9ec; }
.safe-status.hidden { display: none; }
.stake-btns { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.stake-btns .big-btn { max-width: none; min-height: 58px; font-size: clamp(17px, 5vw, 21px); }
/* (saving is the one big button; the others are quieter, so it's clear what matters most) */
.stake-btns #p-send, .stake-btns label.big-btn, .stake-card #p-install { min-height: 50px; border: none; background: #f3edf8; color: var(--ink); box-shadow: 0 3px 0 rgba(59, 42, 74, 0.12); font-size: clamp(16px, 4.6vw, 18px); }
.stake-btns #p-send:active, .stake-btns label.big-btn:active, .stake-card #p-install:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.12); }
.safe-tip { margin: 0 0 8px !important; font-size: 15px !important; font-weight: 700; line-height: 1.3; }
.safe-tip.hidden { display: none; }

/* ---------- saving, sending, bringing home ---------- */
.pet-faces { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.pet-faces img { width: 66px; height: 66px; object-fit: contain; padding: 4px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.12); animation: letter-pop 0.5s cubic-bezier(0.34, 1.8, 0.64, 1) both; }
.pet-faces img:only-child { width: 120px; height: 120px; }
.pet-faces b { min-width: 40px; font-size: 20px; font-weight: 900; }
.send-steps { width: 100%; margin: 0; padding-left: 26px; text-align: left; font-size: 16px; font-weight: 700; line-height: 1.32; display: flex; flex-direction: column; gap: 6px; }
.send-note { width: 100%; margin: 0; padding: 7px 10px; border-radius: 12px; background: #eef6ff; font-size: 14px; font-weight: 700; line-height: 1.3; text-align: left; }
.file-name { margin: 0; max-width: 100%; padding: 5px 10px; border-radius: 10px; background: #f3edf8; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.who-card { max-height: calc(100dvh - 24px); }
.who-grid { width: 100%; max-height: 56dvh; overflow-y: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 3px; }
.who { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 96px; padding: 6px 4px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.who:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.who.all { background: var(--yellow); }
.who span { font-size: 34px; line-height: 1.2; }
.who img { width: 58px; height: 58px; object-fit: contain; }
.who b { max-width: 100%; font-size: 14px; font-weight: 900; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.got-pet { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; margin-top: 2px; padding: 8px 14px; border: 3px dashed #c9b0dc; border-radius: 20px; background: rgba(255, 255, 255, 0.75); cursor: pointer; }
.got-pet span { font-size: 26px; line-height: 1; }
.got-pet b { font-size: clamp(15px, 4.6vw, 18px); font-weight: 900; line-height: 1.15; }
.busy[data-kind="home"] .busy-msgs.home { display: block; }
.busy-msgs.home span { opacity: 1; }

/* ---------- the face: what was found, and the two plain ways to fix it ---------- */
/* (a tall drawing can't push "Not right?" off the screen: picture, Yes and the fix buttons all fit) */
#screen-face:not(.fixing) .stage { flex: none; width: 100%; height: max(200px, calc(100dvh - 420px)); min-height: 0; }
.change-box { padding: 0; border: none; background: none; }
.change-row + .change-row { margin-top: 8px; }
.change-btn.low { flex-direction: row; min-height: 48px; gap: 7px; background: none; box-shadow: none; }
.change-btn.low.draw { background: none; box-shadow: none; }
.change-btn.low .cb-ic { font-size: 22px; }
.kept { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin: 0; }
.kept .chip { margin: 0 1px; padding: 1px 8px; font-size: 14px; white-space: nowrap; }
.kept small { margin-right: 2px; font-size: 14px; font-weight: 800; opacity: 0.75; }
.kept.hidden { display: none; }
#face-ok.nudge { animation: nudge 0.45s; }
/* the keyboard is open on the name screen: the picture gives up its place, the button stays in sight */
#screen-name.typing { gap: 6px; padding-bottom: 6px; }
#screen-name.typing .steps, #screen-name.typing .kept { display: none; }
#screen-name.typing .stage { flex: 1 1 0; min-height: 0; }
#screen-name.typing > .big-btn { position: sticky; bottom: 4px; }

/* ================= the daily surprise: a whole-screen party for one present ================= */
.modal-card.gift-stage {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: none; border-radius: 0; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0;
  overflow-x: hidden; overflow-y: auto; box-sizing: border-box;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 42%, #9a6bff 0%, #6a35e0 46%, #38188c 100%); color: #fff; animation: gs-in 0.3s ease-out;
}
@keyframes gs-in { from { opacity: 0; } to { opacity: 1; } }
/* (the spinning light and the twinkles are a layer of their own, so they can never cut into
   what's in front of them) */
.gs-back { position: fixed; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; }
.gs-rays { position: absolute; left: 50%; top: 44%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; border-radius: 50%; opacity: 0.22;
  background: repeating-conic-gradient(#fff 0 12deg, transparent 12deg 30deg); animation: gs-spin 26s linear infinite; }
@keyframes gs-spin { to { transform: rotate(360deg); } }
.gift-stage.open .gs-rays { opacity: 0.34; transition: opacity 0.3s; }
.gift-stage .big-btn { color: var(--ink); }
.gs-star { position: absolute; font-style: normal; font-size: 32px; animation: gs-twinkle 2.2s ease-in-out infinite; }
.gs-star.s1 { left: 12%; top: 18%; } .gs-star.s2 { right: 13%; top: 25%; animation-delay: 0.6s; } .gs-star.s3 { left: 16%; bottom: 25%; animation-delay: 1.1s; } .gs-star.s4 { right: 16%; bottom: 19%; animation-delay: 1.6s; }
@keyframes gs-twinkle { 0%, 100% { opacity: 0.35; transform: scale(0.75) rotate(-8deg); } 50% { opacity: 1; transform: scale(1.15) rotate(8deg); } }
.gs-x { position: fixed; right: 14px; top: max(14px, env(safe-area-inset-top)); z-index: 3; width: 46px; height: 46px; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.2); color: #fff; font-size: 22px; font-weight: 900; }
/* (margin auto: in the middle when there is room, and from the top, scrolling, when there isn't) */
.gs-now { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 380px; margin: auto; box-sizing: border-box; }
.gb { padding: 0; border: none; background: none; width: min(72vw, 46dvh, 320px); aspect-ratio: 1; animation: gb-wiggle 1.7s ease-in-out infinite; transform-origin: 50% 92%; -webkit-tap-highlight-color: transparent; }
.gb-svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes gb-wiggle { 0%, 55%, 100% { transform: rotate(0) scale(1, 1); } 65% { transform: rotate(-5deg) scale(1.03, 0.97); } 75% { transform: rotate(5deg) scale(0.98, 1.03); } 85% { transform: rotate(-3deg); } }
.gb-eyes { transform-box: fill-box; transform-origin: center; animation: gb-blink 3.4s infinite; }
@keyframes gb-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
.gb-lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.25s cubic-bezier(0.34, 1.7, 0.64, 1); }
.gb[data-t="1"] .gb-lid { transform: translateY(-9px) rotate(-5deg); }
.gb[data-t="2"] .gb-lid { transform: translateY(-20px) rotate(7deg); }
.gb.jump { animation: gb-jump 0.5s cubic-bezier(0.3, 1.2, 0.6, 1); }
.gb[data-t="2"].jump { animation-duration: 0.6s; }
@keyframes gb-jump { 0% { transform: scale(1, 1); } 22% { transform: scale(1.18, 0.78); } 55% { transform: translateY(-16%) scale(0.92, 1.12) rotate(5deg); } 80% { transform: scale(1.08, 0.92) rotate(-3deg); } 100% { transform: none; } }
.gift-stage.open .gb-lid { transition: transform 0.6s ease-out, opacity 0.6s; transform: translate(40px, -420px) rotate(70deg); opacity: 0; }
.gift-stage.open .gb { animation: gb-sink 0.6s ease-in forwards; }
@keyframes gb-sink { 0% { transform: scale(1.12, 0.9); opacity: 1; } 100% { transform: translateY(46%) scale(0.72); opacity: 0; } }
.gs-hint { margin: 0; font-size: clamp(26px, 8vw, 36px); font-weight: 900; text-shadow: 0 3px 0 rgba(40, 15, 90, 0.5); animation: need-bounce 1.2s ease-in-out infinite; }
.gift-stage.open .gs-hint { display: none; }

/* what was inside: the thing itself, huge, floating in a ring of light over a little stage */
.gs-now.prize { gap: 6px; }
.gs-show { --d: min(58vw, 30vh, 250px); position: relative; width: var(--d); height: var(--d); flex: none; display: grid; place-items: center; margin: 6% 0 10px; animation: gs-up 0.7s cubic-bezier(0.3, 1.6, 0.55, 1) both; }
@supports (height: 1dvh) { .gs-show { --d: min(58vw, 30dvh, 250px); } }
.gs-glow { position: absolute; left: -22%; top: -22%; right: -22%; bottom: -22%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 170, 0.95) 0%, rgba(255, 214, 92, 0.55) 34%, rgba(255, 170, 220, 0.22) 58%, rgba(255, 255, 255, 0) 72%); animation: gs-glow 2.4s ease-in-out infinite; }
@keyframes gs-glow { 0%, 100% { transform: scale(0.92); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }
/* six little stars going round it */
.gs-ring { position: absolute; left: -12%; top: -12%; right: -12%; bottom: -12%; animation: gs-spin 9s linear infinite; }
.gs-ring b { position: absolute; left: 50%; top: 50%; width: 11%; height: 11%; margin: -5.5% 0 0 -5.5%; background: #fff; opacity: 0.95; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.gs-ring b:nth-child(1) { transform: rotate(0deg) translateY(-440%); }
.gs-ring b:nth-child(2) { transform: rotate(60deg) translateY(-440%); background: #ffe45c; }
.gs-ring b:nth-child(3) { transform: rotate(120deg) translateY(-440%); }
.gs-ring b:nth-child(4) { transform: rotate(180deg) translateY(-440%); background: #ffb3d9; }
.gs-ring b:nth-child(5) { transform: rotate(240deg) translateY(-440%); }
.gs-ring b:nth-child(6) { transform: rotate(300deg) translateY(-440%); background: #9be7ff; }
.gs-thing { position: relative; display: grid; place-items: center; width: 100%; height: 100%; font-size: calc(var(--d) * 0.72); line-height: 1; filter: drop-shadow(0 10px 14px rgba(30, 10, 60, 0.45)); animation: gs-float 2.6s 0.7s ease-in-out infinite; }
.gs-thing > .ico { width: 86%; height: 86%; }
.gs-art { display: block; width: 92%; height: 92%; object-fit: contain; }
.gs-show.room .gs-art { width: 86%; height: auto; border-radius: 12%; border: 5px solid #fff; box-shadow: 0 0 0 4px var(--ink); box-sizing: border-box; }
@keyframes gs-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5%) rotate(2deg); } }
.gs-floor { position: absolute; left: 18%; right: 18%; bottom: -5%; height: 9%; border-radius: 50%; background: rgba(30, 10, 60, 0.38); animation: gs-shade 2.6s 0.7s ease-in-out infinite; }
@keyframes gs-shade { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.84); opacity: 0.7; } }
@keyframes gs-up { 0% { opacity: 0; transform: translateY(40%) scale(0.2); } 100% { opacity: 1; transform: none; } }
.gs-new { margin: 0; padding: 2px 14px; border-radius: 999px; background: #ff5d8f; color: #fff; font-size: 15px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; box-shadow: 0 3px 0 rgba(40, 15, 90, 0.45); animation: gs-rise 0.4s 0.2s ease-out both; }
.gs-name { margin: 0; max-width: 100%; font-size: clamp(30px, 9.5vw, 44px) !important; font-weight: 900; line-height: 1.08; text-align: center; overflow-wrap: anywhere; text-shadow: 0 3px 0 rgba(40, 15, 90, 0.55); animation: letter-pop 0.5s 0.25s cubic-bezier(0.34, 1.8, 0.64, 1) both; }
.gs-kind { margin: 0; font-size: 18px; font-weight: 800; opacity: 0.92; text-align: center; animation: gs-rise 0.4s 0.35s ease-out both; }
.gs-plus { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; padding: 3px 14px 3px 16px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 22px; font-weight: 900; box-shadow: 0 3px 0 rgba(40, 15, 90, 0.45); animation: gs-rise 0.4s 0.45s ease-out both; }
.gs-plus .ico { width: 1.05em; height: 1.05em; flex: none; }
/* the buttons: always whole, whatever the screen and however long the words */
.gs-btns { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; margin-top: 12px; box-sizing: border-box; animation: gs-rise 0.45s 0.55s ease-out both; }
@keyframes gs-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.gs-btns .big-btn { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 68px; padding: 10px 14px; gap: 10px; font-size: clamp(21px, 6.4vw, 27px); line-height: 1.1; text-align: center; white-space: normal; overflow: visible; }
.gs-btns .big-btn .ico { flex: none; width: 1.25em; height: 1.25em; }
.gs-later { min-height: 44px; padding: 8px 20px; border: none; background: none; color: #fff; font-size: 17px; font-weight: 800; text-decoration: underline; opacity: 0.9; }
.gs-next { margin: 6px 0 0; font-size: 14px; font-weight: 700; opacity: 0.85; text-align: center; }
@media (max-height: 600px) {
  .gs-show { --d: min(46vw, 25vh, 200px); margin-top: 4%; }
  .gs-name { font-size: clamp(26px, 8vw, 36px) !important; }
  .gs-kind { font-size: 16px; } .gs-plus { font-size: 19px; }
  .gs-btns { margin-top: 6px; } .gs-btns .big-btn { min-height: 58px; }
  .gs-next { display: none; }
}
@media (min-width: 700px) and (min-height: 800px) { /* a tablet: everything bigger */
  .gs-now { max-width: 480px; }
  .gs-show { --d: 340px; }
  .gs-new { font-size: 19px; } .gs-kind { font-size: 23px; } .gs-plus { font-size: 27px; } .gs-next { font-size: 17px; }
  .gs-name { font-size: 56px !important; }
  .gs-btns .big-btn { min-height: 80px; font-size: 31px; }
}
@media (prefers-reduced-motion: reduce) { .gs-rays, .gs-star, .gb, .gb-eyes, .gs-hint, .gs-glow, .gs-ring, .gs-thing, .gs-floor { animation: none; } }
/* on the start screen: the same chubby present, waiting */
.start-gift { right: 0; top: -6px; }
/* (on a big phone the pet is wide: the present moves a little further from it, out of a finger's way) */
@media (min-width: 400px) { .start-gift { right: -8px; top: -24px; } .start-gift .gb-mini { width: 76px; height: 76px; } }
/* (a tablet has room beside the pet: the present waits there, well clear of it) */
@media (min-width: 700px) { .start-gift { right: -96px; } }
.gb-mini { display: block; width: 84px; height: 84px; }
.start-gift small { margin-top: -6px; position: relative; font-size: 13px; }

/* ---------- the face check: one plain question, and everything on one screen ----------
   Top to bottom: the question, the picture with its rings, what the rings mean, the big Yes,
   the four ways to fix it, and how the eyes look. The picture takes the room that is left,
   so nothing ever needs scrolling to. */
#screen-face:not(.fixing) { gap: 8px; }
#screen-face:not(.fixing) .stage { flex: 1 1 0; height: auto; min-height: 110px; }
.face-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; }
.face-key.hidden { display: none; }
.face-key .chip { margin: 0; padding: 1px 10px; font-size: 15px; white-space: nowrap; }
.face-key .chip.none { border-style: dashed; border-color: #cfc3da; opacity: 0.75; }
#screen-face .check-bar { gap: 4px; max-width: 420px; }
#screen-face #face-more-btn { margin-top: 6px; } /* (a finger's room from the two fix buttons) */
#screen-face .change-q { margin: 0; font-size: 15px; }
#screen-face .change-row { width: 100%; gap: 8px; }
#screen-face .change-btn { min-height: 62px; padding: 5px 2px 6px; gap: 2px; border-radius: 16px; }
#screen-face .change-btn .cb-ic { font-size: 24px; }
#screen-face .change-btn b { font-size: clamp(11.5px, 3.3vw, 14px); line-height: 1.08; overflow-wrap: anywhere; }
#screen-face .change-btn.eyes { box-shadow: 0 4px 0 #ffb000; }
#screen-face .change-btn.mouth { box-shadow: 0 4px 0 #ff3d8b; }
#screen-face .change-btn:active { box-shadow: 0 1px 0 rgba(59, 42, 74, 0.16); }
#screen-face #face-ok { min-height: 60px; }
#screen-face .eye-seg { width: 100%; gap: 8px; }
#screen-face .eye-seg button { min-height: 46px; padding: 4px 8px; }
#screen-face .eye-seg button b { font-size: clamp(13px, 3.9vw, 16px); }
#screen-face .top h2 { font-size: clamp(19px, 5.8vw, 26px); line-height: 1.1; }
@media (max-height: 540px) {
  #screen-face:not(.fixing) { gap: 6px; }
  #screen-face:not(.fixing) .change-q { display: none; }
  #screen-face #face-ok { min-height: 54px; }
  #screen-face .change-btn { min-height: 56px; }
  #screen-face .change-btn .cb-ic { font-size: 21px; }
}

/* ---- Colouring in the eyes and the mouth: the pet, a hand that shows how, one big button ----
   Most real drawings come here (the app offers a face only when it is sure), and most of these
   kids can't read yet. So: the pet fills the screen, the hand shows what to do, the slots at the
   top fill up as eyes are found, and nothing else is on the screen. */
#screen-face:not(.fixing) #ms-slots, #screen-face:not(.fixing) .stage-undo, #screen-face:not(.fixing) #face-flash { display: none; }
#screen-face.fixing > .steps, #screen-face.fixing #face-mission, #screen-face.fixing #face-tabs,
#screen-face.fixing #face-hint, #screen-face.fixing .tool-row { display: none !important; }
#screen-face.fixing { gap: 8px; }
#screen-face.fixing .stage { flex: 1 1 0; min-height: min(52dvh, 460px); }
#screen-face.fixing .top h2 { font-size: clamp(18px, 5.4vw, 26px); }
#ms-slots .ms-slot { width: 36px; height: 36px; font-size: 20px; }
#ms-slots.mouth .ms-slot.got { background: #ff3d8b; }
@media (max-width: 360px) { #ms-slots { gap: 4px; } #ms-slots .ms-slot { width: 30px; height: 30px; font-size: 16px; } }
.stage-undo {
  position: absolute; left: 8px; top: 8px; z-index: 3; width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid #fff; background: #fff; color: var(--ink); font-size: 34px; font-weight: 800; line-height: 1; padding: 0 0 4px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(59, 42, 74, 0.18); display: grid; place-items: center; touch-action: manipulation;
}
.stage-undo:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 74, 0.18); }
.stage-undo.hidden { display: none; }
.face-flash {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 3; margin: 0; pointer-events: none;
  max-width: calc(100% - 150px); padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.94);
  color: #1f7a40; font-size: 16px; font-weight: 800; line-height: 1.15; text-align: center; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.12);
}
.face-flash.hidden { display: none; }
/* (the big button is quiet until an eye or the mouth is coloured in, then it wakes up) */
#screen-face.fixing #face-done { min-height: 60px; }
#screen-face.fixing #face-done:not(.wake) { background: #e9f3ea; color: #6f8a76; box-shadow: 0 5px 0 #c9dccd; animation: none; }
#screen-face.fixing #face-done.wake { animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { #screen-face.fixing #face-done.wake { animation: none; } }
@media (max-height: 560px) { #screen-face.fixing .stage { min-height: 44dvh; } #screen-face.fixing #face-done { min-height: 52px; } }

/* ---- A ring round the pet: the photo, a hand going round, then "is this your pet?" ---- */
#screen-ring { gap: 8px; }
#screen-ring .stage { flex: 1 1 0; min-height: min(52dvh, 460px); position: relative; }
#screen-ring .top h2 { font-size: clamp(18px, 5.4vw, 26px); line-height: 1.1; }
#ring-view { touch-action: none; cursor: crosshair; }
.ring-demo { position: absolute; left: 16%; right: 16%; top: 18%; bottom: 18%; pointer-events: none; z-index: 2; }
.ring-demo.hidden { display: none; }
.ring-demo .rd-loop { position: absolute; inset: 0; border: 5px dashed rgba(255, 138, 0, 0.85); border-radius: 50%; }
.ring-demo .rd-hand { position: absolute; left: 50%; top: 0; margin: -8px 0 0 -12px; font-size: 46px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); animation: rd-round 3.6s linear infinite; }
@keyframes rd-round {
  0% { left: 50%; top: 0; } 12.5% { left: 85%; top: 15%; } 25% { left: 100%; top: 50%; } 37.5% { left: 85%; top: 85%; }
  50% { left: 50%; top: 100%; } 62.5% { left: 15%; top: 85%; } 75% { left: 0; top: 50%; } 87.5% { left: 15%; top: 15%; } 100% { left: 50%; top: 0; }
}
@media (prefers-reduced-motion: reduce) { .ring-demo .rd-hand { animation: none; } }
.ring-bar { display: flex; gap: 10px; width: 100%; max-width: 560px; position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 5; }
.ring-bar.hidden { display: none; }
.ring-bar .big-btn { min-height: 60px; margin: 0; }
.ring-bar .ring-again { flex: 0 0 36%; background: #fff; color: var(--ink); box-shadow: 0 5px 0 rgba(59, 42, 74, 0.16); font-size: clamp(15px, 4.4vw, 19px); }
.ring-bar #ring-ok { flex: 1 1 0; min-width: 0; font-size: clamp(15px, 4.6vw, 20px); animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ring-bar #ring-ok { animation: none; } }
.big-btn.ring-open { width: 100%; max-width: 560px; min-height: 52px; background: #fff; color: var(--ink); box-shadow: 0 5px 0 rgba(59, 42, 74, 0.16); font-size: clamp(15px, 4.4vw, 19px); }

/* ---- Less to read and press: the face check, the tidy-up, the colour pots ---- */
/* The face check asks one thing. Draw more, edges and googly eyes are behind "More". */
.more-btn { align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 16px; border: none; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: var(--ink); font: inherit; font-size: 15px; font-weight: 800; box-shadow: 0 3px 0 rgba(59, 42, 74, 0.12); cursor: pointer; }
.more-btn i { font-style: normal; }
.more-btn.on { background: var(--yellow); }
.face-more { width: 100%; max-width: 420px; }
.face-more.hidden { display: none; }
.face-more .change-row { width: 100%; }
#screen-face:not(.fixing) .stage { min-height: min(34dvh, 300px); }
/* The quick tidy-up: the picture, a ✕ on each extra bit, and Done. */
#screen-cut.tidy .tool-row, #screen-cut.tidy .slider-row, #screen-cut.tidy > .steps { display: none; }
/* (the ring stays in reach: when the wrong thing was cut out, one press and the child shows where the pet is) */
#screen-cut.tidy #cut-ring { min-height: 48px; }
#screen-cut.tidy .stage { flex: 1 1 0; min-height: min(38dvh, 440px); }
#screen-cut.tidy .cut-bit:not(.poof) { animation: pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { #screen-cut.tidy .cut-bit { animation: none; } }
/* Colours say themselves: the name of the one picked is in the line above the pots. */
#color-swatches span { display: none; }
.col-tools .tool-big small { display: none; }

/* ---- Less to read and press, everywhere a child goes ---- */
/* The sticker book: a missing sticker is a "?"; a tap says how to get it. */
.sticker-book .stk:not(.got) b { display: none; }
/* Missions: the rows and the present say it; no extra line on top. */
#screen-jobs > .hint { display: none; }
/* New pet: the arrow at the bottom shows there is more to scroll to. */
#adopt-sub { display: none; }
/* The edges screen: rub out and undo; paint back and the slider behind "More". */
#screen-cut:not(.more-tools) #cut-restore, #screen-cut:not(.more-tools) .slider-row { display: none; }
#screen-cut.tidy #cut-more { display: none; }
/* Before the camera: what a good photo looks like. */
.modal-card.photo-tip { gap: 10px; }
.modal-card.photo-tip h3 { font-size: clamp(19px, 5.6vw, 24px); line-height: 1.15; text-align: center; }
.pt-row { display: flex; justify-content: center; gap: 12px; width: 100%; }
.pt-frame { position: relative; overflow: hidden; border-radius: 14px; background: #fffdf6; box-shadow: 0 0 0 4px #3b2a4a, 0 6px 0 rgba(59, 42, 74, 0.18); }
.pt-frame.good { width: min(46vw, 170px); aspect-ratio: 3 / 4; box-shadow: 0 0 0 5px #2f9a52, 0 6px 0 rgba(59, 42, 74, 0.18); }
.pt-frame.bad { width: min(26vw, 96px); aspect-ratio: 3 / 4; box-shadow: 0 0 0 4px #e8364f, 0 5px 0 rgba(59, 42, 74, 0.18); }
.pt-frame img { position: absolute; left: 50%; top: 50%; width: 92%; transform: translate(-50%, -50%); }
.pt-frame.far img { width: 30%; }
.pt-frame.cut img { width: 120%; left: 96%; top: 62%; }
.pt-mark { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: #2f9a52; color: #fff; font-style: normal; font-size: 20px; font-weight: 900; line-height: 1; }
.pt-frame.bad .pt-mark { width: 28px; height: 28px; font-size: 16px; background: #e8364f; }
.modal-card.photo-tip .pt-go { width: 100%; min-height: 60px; }
@media (max-height: 600px) { .pt-frame.good { width: min(36vw, 130px); } .pt-frame.bad { width: min(20vw, 72px); } .modal-card.photo-tip .pt-go { min-height: 52px; } }
/* The colour screen on a small phone: its big button is always on the screen. The picture
   gives way, and the "saved" chips (said already on the screen before) are left out. */
#screen-color .colour-stage { flex: 1 1 0; min-height: 110px; }
@media (max-height: 640px) { #screen-color #color-kept, #screen-color > .steps { display: none; } #screen-color { gap: 6px; } #screen-color .col-tools .tool-big { min-height: 50px; } }

/* the first-day helper is the only one pointing: no other glow while it shows the way */
.room.coaching .go-btn.hint { animation: none; }
/* (coming back into view, it goes straight to its place) */
.coach.snap .coach-spot, .coach.snap .coach-bubble { transition: none; }

/* ---- the album: films made by an older version, and saving to the phone ---- */
.polaroid { position: relative; }
.polaroid .film-mark { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(30, 15, 45, 0.6); color: #fff; display: grid; place-items: center; font-size: 26px; pointer-events: none; }
.polaroid video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; background: #fff6e0; display: block; }
.lightbox { flex-direction: column; gap: 14px; }
.lightbox video { max-width: 100%; max-height: 64vh; object-fit: contain; }
.lightbox img { max-height: 64vh; }
.lb-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lb-btns button { min-height: 48px; }
/* ---- the food row: the child's own drawn foods, the favourite and the yucky one, a pencil ---- */
.food.mine img { width: 46px; height: 46px; object-fit: contain; pointer-events: none; }
.food.fav, .food.yuck { position: relative; }
.food.fav::after, .food.yuck::after { position: absolute; right: -2px; top: -4px; font-size: 16px; line-height: 1; }
.food.fav::after { content: "❤️"; }
.food.yuck::after { content: "😝"; }
.food-draw { width: 52px; height: 52px; flex: none; border: 3px dashed #c9b8d8; border-radius: 16px; background: #fff; font-size: 26px; display: grid; place-items: center; }
.food-draw:active { transform: translateY(2px); }

/* ---- tricks on the grow card ---- */
.grow-tricks { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-bottom: 10px; }
.grow-tricks button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 6px 4px; border: none; border-radius: 16px; background: #fff3d6; box-shadow: 0 3px 0 #f0c36a; font: inherit; font-size: 13px; font-weight: 900; color: var(--ink); line-height: 1.1; overflow-wrap: anywhere; }
.grow-tricks button span { font-size: 26px; line-height: 1.1; }
.grow-tricks button:active { transform: translateY(2px); box-shadow: 0 1px 0 #f0c36a; }
.grow-tricks button.locked { background: #f1edf5; box-shadow: none; color: #8a7d99; }

/* (short screens: the tricks take less height, so the grow card mostly fits) */
@media (max-height: 700px) { .grow-tricks button { min-height: 52px; padding: 4px; font-size: 12px; } .grow-tricks button span { font-size: 22px; } }
