/* Hallmark · Learning Kingdom · v2.0.0 · shape: app screen · genre: playful
 Sunlit picture-book cottage. Cream paper, orange tokens, forest-jade actions.
 A big room, a large pet and one obvious path into the lesson.
*/
:root {
  color-scheme: light;
  --ink: #33251c;
  --muted: #71583e;
  --paper: #fff5e1;
  --paper-light: #fffcf4;
  --card: #fff9ed;
  --line: #e7d2ad;
  --jade: #265e46;
  --jade-shadow: #194433;
  --jade-light: #e1edcf;
  --orange: #e78938;
  --peach: #f5ddbe;
  --rose: #cb705f;
  --shadow: 0 4px 0 #e5c89f;
  --font: 'Nunito', ui-rounded, system-ui, -apple-system, sans-serif;
  --coin-paper: #ffebbc;
  --coin-edge: #ecc27a;
  --button-shadow: #dec29a;
  --button-hover: #fbead0;
  --menu-shadow: #58381730;
  --meter-track: #ebdcc3;
  --mood-fill: #508051;
  --home-trim: #d69e64;
  --home-wall: #ead0a3;
  --bath-trim: #90aa85;
  --bath-wall: #bad2aa;
  --room-label-shadow: #6b3a1b33;
  --room-dot: #4f8055;
  --speech-edge: #e6ceaa;
  --speech-shadow: #67461b32;
  --care-edge: #e8cda4;
  --care-paper: #fff8e9ef;
  --care-shadow: #805a3155;
  --care-hover: #f7e2c3;
  --action-ink: #fffaf0;
  --action-hover: #2e7053;
  --dock-active-edge: #cae0b6;
  --chip-active-edge: #a8bf8d;
  --adopt-paper: #f5deba;
  --adopt-edge: #e6c595;
  --study-paper: #f6ddac;
  --study-edge: #e8c28e;
  --study-track: #ead7b4;
  --answer-paper: #fff7e6;
  --answer-hover: #f7e8cc;
  --answer-active-edge: #90af77;
  --translation-ink: #634e3a;
  --result-paper: #f5ddb4;
  --shop-hover: #fff0d6;
  --shop-active-edge: #63926a;
  --outfit-paper: #f4ddba;
  --outer-paper: #f1deb9;
  --outer-shadow: #251d1829;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { min-width: 280px; background: var(--paper); }
body { margin: 0; color: var(--ink); font: 600 16px/1.45 var(--font); }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .54; cursor: not-allowed; }
button:focus-visible { outline: 3px solid var(--jade); outline-offset: 3px; }
button:not(:disabled):active { transform: translateY(2px); }
button, .merch { transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
img { display: block; max-width: 100%; }
h1,h2,p { margin: 0; }
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 900; }
h2 { font-size: 1.2rem; line-height: 1.25; font-weight: 850; }
.app-shell {
  width: min(100%, 492px);
  min-height: 100svh;
  margin-inline: auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.app-shell main { padding: 0 clamp(12px, 3.8vw, 20px) 16px; flex: 1; }
.icon { width: 21px; height: 21px; object-fit: contain; flex: none; }
.topbar {
  position: relative; z-index: 4; min-height: 69px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) clamp(12px, 3.8vw, 20px) 8px;
}
.brand {
  display: inline-flex; gap: 8px; align-items: center; padding: 0; text-align: left;
  background: transparent; border: 0; color: var(--jade);
  font-size: 17px; line-height: .98; font-weight: 950; letter-spacing: -.055em;
}
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--jade); box-shadow: 0 3px 0 var(--jade-shadow); }
.brand-mark img { width: 23px; height: 23px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.wallet {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 63px;
  min-height: 40px; padding-inline: 12px; background: var(--coin-paper); border: 1px solid var(--coin-edge);
  border-radius: 99px; font-variant-numeric: tabular-nums;
}
.icon-button {
  min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line);
  border-radius: 15px; display: grid; place-items: center; background: var(--paper-light);
  color: var(--ink); font-size: 32px; line-height: 1; box-shadow: 0 2px 0 var(--button-shadow);
}
.icon-button:hover, .chip:hover, .secondary:hover { background: var(--button-hover); }
.menu-button .icon { filter: brightness(.52); }
.game-menu {
  position: absolute; right: 14px; top: calc(100% - 4px);
  padding: 4px; display: grid; gap: 2px; min-width: 174px;
  background: var(--paper-light); box-shadow: 0 6px 18px var(--menu-shadow); border-radius: 14px;
}
.game-menu button { text-align: left; background: transparent; border: 0; padding: 8px 12px; border-radius: 9px; min-height: 44px; }
.game-menu button:hover { background: var(--peach); }
.pet-profile { display: grid; grid-template-columns: minmax(108px, .82fr) minmax(0, 1.18fr); align-items: center; gap: 12px; padding: 8px 0 12px; }
.profile-name {
  min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 17px;
  padding: 4px 8px 4px 2px; display: flex; align-items: center; gap: 4px; text-align: left;
}
.profile-name img { width: 42px; height: 42px; object-fit: contain; }
.profile-name span { min-width: 0; flex: 1; }
.profile-name strong { display: block; font-size: clamp(.85rem, 4vw, 1.05rem); font-weight: 900; overflow-wrap: anywhere; line-height: 1.13; }
.profile-name small { display: block; font-size: .73rem; color: var(--muted); }
.profile-name i { font: normal 20px/1 var(--font); color: var(--jade); }
.meters { display: grid; gap: 4px; }
.meter > div:first-child { display: flex; justify-content: space-between; gap: 4px; font-size: .74rem; font-weight: 850; }
.meter [role="meter"] { height: 7px; overflow: hidden; border-radius: 12px; background: var(--meter-track); }
.meter [role="meter"] > span { display: block; height: 100%; background: var(--rose); border-radius: 12px; transform-origin: left; transition: transform 240ms ease; }
.meter.mood [role="meter"] > span { background: var(--mood-fill); }
.room {
  position: relative; isolation: isolate; width: 100%; height: clamp(328px, calc(100svh - 285px), 488px);
  overflow: hidden; border: 2px solid var(--home-trim); border-radius: 25px; background: var(--home-wall); box-shadow: var(--shadow);
  touch-action: pan-y;
}
.room-bath { border-color: var(--bath-trim); background: var(--bath-wall); }
.stage, .stage-fallback, .stage canvas, .background-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage canvas { opacity: 0; pointer-events: none; }
.stage canvas.painted { opacity: 1; }
.stage-fallback { pointer-events: none; }
.background-art { object-fit: cover; }
.pet-art {
  position: absolute; width: min(56%, 255px); height: 54%; object-fit: contain; object-position: 50% 100%;
  left: 50%; bottom: 24%; translate: -50% 0; transform-origin: center bottom;
}
.pet-art.sleeping { transform: scaleY(.75) rotate(7deg); }
.pet-bounce { animation: bounce 760ms ease-in-out 1; }
@keyframes bounce {
  30% { transform: scale(1.045,.94) translateY(1px); }
  57% { transform: scale(.965,1.035) translateY(-6%); }
}
.room-label {
  position: absolute; top: 10px; left: 10px; display: flex; gap: 8px; align-items: center;
  padding: 8px 12px; border-radius: 99px; font-size: .75rem; background: var(--paper-light);
  border: 1px solid var(--line); box-shadow: 0 2px 5px var(--room-label-shadow);
}
.room-label span { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--room-dot); }
.room-arrow {
  position: absolute; top: 9px; right: 10px; z-index: 2; font-size: 31px;
}
.room-bath .room-arrow { left: auto; }
.speech {
  position: absolute; bottom: 65%; left: 50%; translate: -50% 0; z-index: 2;
  width: max-content; max-width: min(79%, 300px); border: 1px solid var(--speech-edge); border-radius: 15px;
  padding: 8px 12px; color: var(--ink); background: var(--paper-light); font-size: .86rem; font-weight: 850;
  box-shadow: 0 3px 0 var(--speech-shadow); text-align: center; pointer-events: none;
}
.speech::after {
  content: ''; position: absolute; width: 8px; height: 8px; left: 50%; bottom: -5px;
  background: var(--paper-light); transform: rotate(45deg); border-right: 1px solid var(--speech-edge); border-bottom: 1px solid var(--speech-edge);
}
.pet-touch {
  position: absolute; z-index: 1; left: 28%; right: 28%; bottom: 24%; top: 37%;
  border: 0; background: transparent; border-radius: 38%;
}
.room-actions {
  position: absolute; z-index: 2; bottom: 10px; left: 50%; translate: -50% 0;
  display: grid; grid-auto-columns: minmax(65px, 1fr); grid-auto-flow: column; gap: 8px;
  padding: 4px; border: 1px solid var(--care-edge); border-radius: 17px; background: var(--care-paper);
  box-shadow: 0 3px 0 var(--care-shadow);
}
.room-actions button {
  display: grid; gap: 0; justify-items: center; align-content: center;
  border: 0; min-height: 51px; border-radius: 10px; padding: 1px 4px 4px;
  background: transparent; font-size: .74rem; font-weight: 900; white-space: nowrap;
}
.room-actions button:hover { background: var(--care-hover); }
.room-actions .item-art { width: 38px; height: 30px; }
.item-art { object-fit: contain; }
.primary,.secondary {
  min-height: 52px; border: 1px solid transparent; border-radius: 15px;
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px; font-weight: 900; font-size: 1.01rem;
}
.primary { color: var(--action-ink); background: var(--jade); box-shadow: 0 4px 0 var(--jade-shadow); }
.primary:hover:not(:disabled) { background: var(--action-hover); }
.primary:disabled { box-shadow: none; }
.secondary { color: var(--jade); background: var(--card); border-color: var(--line); }
.study-button { margin-top: 12px; position: relative; }
.study-button > span:last-child { position: absolute; right: 14px; font-size: 1.7rem; line-height: 1; }
.feed-options { display: flex; gap: 8px; margin-top: 12px; }
.food-card {
  width: 50%; display: grid; grid-template-columns: 38px 1fr; align-items: center;
  gap: 1px 4px; padding: 8px; text-align: left; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); font-size: .8rem;
}
.food-card .item-art { grid-row: span 2; width: 38px; height: 40px; }
.food-card strong { color: var(--jade); }
.dock {
  position: sticky; z-index: 3; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 4px; background: var(--paper-light); border-top: 1px solid var(--line);
  padding: 4px 8px max(4px, env(safe-area-inset-bottom));
}
.dock button {
  min-height: 51px; display: grid; gap: 1px; justify-items: center; align-content: center;
  background: transparent; border: 1px solid transparent; padding: 4px; border-radius: 13px;
  color: var(--muted); font-weight: 820; font-size: .75rem;
}
.dock button[aria-current], .dock button:hover { color: var(--jade-shadow); background: var(--jade-light); border-color: var(--dock-active-edge); }
.dock .icon { width: 20px; height: 20px; }
.panel { display: grid; gap: 16px; padding: 4px 0 12px; }
.panel-head { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.panel-head .back { flex: none; }
.species,.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  min-height: 44px; padding-inline: 12px; font-weight: 820; font-size: .83rem;
}
.chip[aria-pressed="true"] { background: var(--jade-light); color: var(--jade-shadow); border-color: var(--chip-active-edge); }
.adopt-stage {
  min-height: 220px; height: clamp(220px,43svh,358px); padding: 16px 8px;
  display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 2px;
  background: var(--adopt-paper); border: 1px solid var(--adopt-edge); border-radius: 22px;
  touch-action: pan-y;
}
.adopt-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.adopt-name { display:flex; justify-content: space-between; align-items:center; }
.adopt-name span { color: var(--muted); font-size: .82rem; }
.signature {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 55px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.signature .item-art { width: 48px; height: 40px; }
.study-hero {
  display: grid; grid-template-columns: 35% 1fr; align-items: center; gap: 8px;
  padding: 16px 12px 16px; border-radius: 22px;
  background: var(--study-paper); border: 1px solid var(--study-edge);
}
.study-hero img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.study-hero p { font-size: 1rem; font-weight: 900; margin-bottom: 8px; }
.resume,.subject {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 13px; min-height: 51px;
  padding: 4px 8px; width: 100%; background: var(--card); text-align: left;
}
.resume { color: var(--jade); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subject-list { display: grid; gap: 8px; }
.subject-row { display: flex; align-items: stretch; gap: 8px; }
.subject-row .chip { flex: none; }
.subject { justify-content: flex-start; font-weight: 880; }
.subject-symbol { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: var(--jade-light); color: var(--jade); font-weight: 900; }
.progress-head { display: flex; justify-content: space-between; gap: 4px; font-size: .88rem; color: var(--muted); }
.progress-head > span:last-child { display: flex; gap: 4px; align-items: center; }
.progress-head .icon { width: 17px; height: 17px; }
.question-progress { display: flex; gap: 4px; margin-top: -12px; }
.question-progress span { background: var(--study-track); border-radius: 6px; height: 7px; flex: 1; }
.question-progress .filled { background: var(--jade); }
.question-paper { background: var(--paper-light); border: 1px solid var(--line); padding: 12px; border-radius: 16px; display: grid; gap: 12px; }
.prompt { font-size: clamp(1.03rem,4.8vw,1.3rem); line-height: 1.36; }
.prompt span, .answer span span, .help span { display: block; overflow-wrap: anywhere; }
.prompt span + span { margin-top: 4px; font-weight: 700; font-size: .89em; }
.answer-list, .match > div { display: grid; gap: 8px; }
.answer {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; min-height: 48px;
  padding: 8px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--answer-paper);
  font-size: .87rem; line-height: 1.25; overflow-wrap: anywhere;
}
.answer:hover { background: var(--answer-hover); }
.answer[aria-pressed=true] { background: var(--jade-light); color: var(--jade-shadow); border-color: var(--answer-active-edge); }
.answer b { display: grid; place-items: center; width: 23px; height: 25px; flex: none; border-radius: 7px; background: var(--peach); }
.answer span span + span { margin-top: 2px; font-size: .94em; color: var(--translation-ink); }
.tile-list,.match { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.tile-list .answer { justify-content: center; font-size: 1.18rem; font-weight: 900; }
.match .answer { padding: 8px; width: 100%; }
.question-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.help {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--jade-light);
  border-radius: 13px; color: var(--jade-shadow); font-size: .86rem;
}
.help img { width: 43px; height: 43px; }
.help p + p { margin-top: 4px; }
.result-art { display: grid; place-items: center; min-height: 195px; background: var(--result-paper); border-radius: 20px; border: 1px solid var(--line); }
.result-art img { width: min(72%,230px); }
.earned { display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 1.8rem; font-weight: 900; color: var(--jade); }
.result-message { text-align: center; font-weight: 850; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
.merch {
  display: grid; justify-items: center; align-content: center; text-align: center; gap: 4px;
  min-height: 138px; padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
}
.merch:hover { background: var(--shop-hover); }
.merch[aria-pressed=true] { border: 2px solid var(--shop-active-edge); background: var(--jade-light); }
.merch .item-art { width: min(100%,106px); height: 85px; }
.merch strong { font-size: .93rem; }
.merch span,.notice { color: var(--muted); font-size: .86rem; }
.shop-selection { display: grid; gap: 12px; }
.wear-preview {
  display: grid; place-items: center; min-height: 155px; position: relative;
  background: var(--outfit-paper); border-radius: 18px; border: 1px solid var(--line);
}
.wear-preview > img:first-child { width: min(54%,205px); }
.wear-preview .item-art { position: absolute; width: min(19%,70px); left: 34%; top: 50%; }
.wardrobe-pet { min-height: 212px; }
.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.report-grid div { display: grid; padding: 12px; background: var(--jade-light); border-radius: 15px; }
.report-grid strong { font-size: 1.75rem; color: var(--jade); font-weight: 900; }
.report-grid span { font-size: .84rem; }
.report-xp { padding: 0 12px; border: 1px solid var(--line); background: var(--paper-light); border-radius: 14px; }
.report-xp div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; }
.report-xp div + div { border-top: 1px solid var(--line); }
@media (min-width: 650px) {
  html { background: var(--outer-paper); }
  .app-shell { box-shadow: 0 9px 44px var(--outer-shadow); }
}
@media (max-width: 359px) {
  .app-shell main { padding-inline: 8px; }
  .species .chip,.question-tools .chip { padding-inline: 8px; }
  .pet-profile { gap: 8px; }
  .answer { font-size: .81rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


.icon-button.back::after, .chevron-left::after { content: '‹'; }
.chevron-right::after { content: '›'; }
