/* Keep the familiar rabbit and pastel playground; make each learning action clear. */
:root { --ink: #3f4e59; --blue-ink: #275d7e; --green-ink: #245c36; --focus: #265fa0; }
button { font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, [role="button"]:focus-visible { outline: 4px solid var(--focus); outline-offset: 5px; }
button:disabled { cursor: default; }
#app { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 1060px; }
.home-hero { align-items: center; gap: 18px; padding: 12px 0 4px; flex-wrap: nowrap; }
.bunny.home { width: 110px; border: 0; background: transparent; padding: 0; }
.home-title { font-size: clamp(1.7rem, 4.2vw, 2.7rem); color: #a8442a; letter-spacing: .03em; text-align: left; }
.home-intro { color: #636046; line-height: 1.7; margin-top: 8px; font-size: 1.05rem; }
.home-top { justify-content: space-between; padding: 6px 0 12px; }
.trophy { margin: 0; font-size: 1rem; padding: 8px 14px; }
.chip-btn { min-height: 48px; min-width: 48px; font-size: 1rem; font-weight: 750; color: var(--ink); white-space: nowrap; }
.subject-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.subject-card { padding: 24px 12px 20px; transition: transform .18s ease, box-shadow .18s ease; }
.subject-card .ic { animation: none; font-size: 3rem; }
.subject-card .nm { font-size: 1.3rem; }
.subject-card .pg { color: #70551d; margin-top: 10px; }
.continue-btn { width: 100%; min-height: 64px; padding: 14px 20px; text-align: left; background: #fffaf0; border: 2px solid #ddbb68; border-radius: 20px; color: #5a461d; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.nav-back-row { justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 18px; }
#subject-title { color: var(--blue-ink); font-size: 1.3rem; }
#unit-list { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.unit { padding: 16px; }
.unit-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.lesson { min-height: 122px; padding: 24px 8px 14px; }
.lesson .nm { font-size: 1rem; }
.lesson .no { font-size: .75rem; }
.lesson .st { color: #72541b; font-size: .8rem; min-height: 18px; margin-top: 7px; letter-spacing: 0; }
.parent-tip { color: #6d644e; line-height: 1.7; padding: 18px 4px 0; }
.float-deco { animation: none; opacity: .3; }
body.playing .float-deco { display: none; }
body.playing .grass, body.playing .grass2 { opacity: .35; }
.game-progress { flex: 1; display: grid; justify-items: center; gap: 6px; color: #635845; font-size: .9rem; font-weight: 750; }
.dot { width: 13px; height: 13px; }
.dot.cur { animation: none; background: #fff5df; border-color: #b66b13; }
.game-lesson { font-size: .95rem; color: #636046; text-align: center; }
.round-stars { color: #765616; font-variant-numeric: tabular-nums; }
.prompt-bar { flex-wrap: wrap; background: #fffefb; }
.prompt-bar .txt { order: 1; flex-basis: calc(100% - 160px); font-size: clamp(1.2rem, 3.7vw, 1.8rem); overflow-wrap: anywhere; }
.prompt-bar .bunny { order: 0; }
#btn-replay { order: 2; }
#btn-retry { order: 3; margin-left: auto; }
.retry-btn { animation: none; font-size: 1rem; min-height: 44px; background: #ffe6b8; color: #794807; box-shadow: none; }
#question-area { flex: 1; min-height: 210px; padding: 20px 0 8px; }
.game-hint { color: #5d6356; text-align: center; font-size: 1rem; line-height: 1.6; }
.speech-caption { color: #65491d; background: #fff4d9; padding: 12px 16px; border-radius: 14px; line-height: 1.6; }
#options-area { gap: 14px; min-height: 0; padding: 6px 0 8px; }
#options-area.grid-options { display: grid; grid-template-columns: repeat(var(--option-columns, 3), minmax(0, 1fr)); width: min(100%, 620px); align-self: center; }
#options-area.grid-options > button { min-width: 0; width: 100%; min-height: 76px; overflow-wrap: anywhere; }
#options-area .b-pos { font-size: clamp(1.05rem, 3.8vw, 1.4rem); padding: 12px 8px; }
.shp-btn { justify-self: center; max-width: 150px; }
.shp-btn .shape { flex: none; max-width: 85%; }
.shape.sh-square { border-radius: 0; }
.shape.sh-rect { width: 82%; height: 50%; border-radius: 0; }
.shape.sh-heart { width: 72px; height: 66px; }
button.dead { opacity: .48; filter: grayscale(.6); }
button.answer-correct { border-color: #3a8a50; background: #e3f6e4; box-shadow: 0 5px 0 #90c79c; }
.answer-feedback { min-height: 30px; line-height: 1.6; padding: 4px 10px; color: #75500c; font-size: 1.1rem; font-weight: 800; text-align: center; }
.answer-feedback.success { color: var(--green-ink); }
.question-next { background: #30794a; align-self: center; min-width: 220px; font-size: 1.4rem; }
.obj { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: clamp(2rem, 6vw, 3.2rem); }
.count-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 12px; width: min(100%, 440px); }
.obj .badge { right: -3px; top: -5px; }
.cmp-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.cmp-panel { min-width: 0; max-width: none; gap: 8px; padding: 12px 8px; cursor: default; flex-direction: column; justify-content: space-between; }
.cmp-panel .obj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cmp-panel .obj { font-size: clamp(1.6rem, 5vw, 2.5rem); }
.cmp-panel:active { transform: none; }
.compare-choice { width: 100%; margin-top: 14px; }
.plus-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; width: min(100%, 600px); }
.plus-row .grp { gap: 6px; }
.size-wrap { width: 100%; }
.size-wrap.length { flex-direction: column; align-items: flex-start; width: min(100%, 420px); gap: 18px; }
.long-panel { justify-content: flex-start; }
.pattern-row { display: flex; flex-wrap: nowrap; width: min(100%, 600px); gap: 8px; }
.pattern-row .cell { flex: 1; min-width: 0; height: auto; aspect-ratio: 1; font-size: clamp(1.25rem, 5.7vw, 2.5rem); }
.mem-card { min-width: 0; }
.res-msg { color: #a13b60; max-width: 28ch; line-height: 1.5; }
.res-stars span { opacity: 1; }
.res-total { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; max-width: 100%; border-radius: 20px; font-size: 1rem; }
.res-total span { white-space: nowrap; }
.next-card, .next-card .nc-arrow, .next-card .nc-icon { animation: none; }
.next-card { background: #d9f1d5; box-shadow: 0 6px 0 #a4c59c; }
.next-card .nc-go { color: #285333; text-shadow: none; font-size: 1.2rem; }
.next-card .nc-go small { display: block; font-size: 1rem; margin-top: 6px; }
.b-again { background: #326e45; }
.b-home { background: #326d98; }
@media (hover: hover) {
  .subject-card:hover, .lesson:hover { transform: translateY(-3px); box-shadow: 0 8px 16px #624e3926; }
  .chip-btn:hover, .continue-btn:hover { background: #fff4d4; }
}
@media (min-width: 601px) {
  .prompt-bar .txt { flex: 1 1 0; min-width: 160px; }
}
@media (max-width: 600px) {
  #app { padding: max(12px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom)); }
  .home-hero { gap: 8px; padding-top: 0; }
  .bunny.home { width: 76px; }
  .home-title { font-size: clamp(1.35rem, 5.5vw, 2rem); }
  .home-intro { font-size: .9rem; max-width: 22ch; }
  .home-top { gap: 8px; }
  .trophy { font-size: .88rem; padding: 8px 10px; }
  .subject-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .subject-card { padding: 18px 8px 14px; }
  .subject-card .ic { font-size: 2.5rem; }
  .subject-card .nm { font-size: 1.15rem; }
  .unit { padding: 12px; }
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 7px; }
  .topbar .chip-btn { padding: 7px 9px; }
  .round-stars { font-size: 1rem; padding: 6px 9px; }
  .prompt-bar { padding: 10px; gap: 8px; }
  .prompt-bar .bunny { width: 42px; }
  .prompt-bar .txt { flex-basis: calc(100% - 60px); }
  #btn-replay { margin-left: 50px; }
  #question-area { min-height: 170px; padding-top: 10px; }
  #options-area { gap: 10px; }
  #options-area.grid-options > button { padding: 10px 6px; min-height: 70px; }
  #options-area .b-num, #options-area .b-char { font-size: 2.1rem; }
  .count-grid { gap: 12px 6px; max-width: 330px; }
  .cmp-wrap { gap: 10px; }
  .cmp-panel .obj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cmp-panel .obj { font-size: 1.8rem; }
  .compare-choice { font-size: 1rem; padding: 10px 6px; }
  .pattern-row { gap: 5px; }
  .pattern-row .cell { border-radius: 10px; }
  .bunny.big { width: 120px; }
  #result-screen { gap: 18px; padding: 20px 0; }
  .res-btns { width: 100%; }
  .res-btns .b-act { font-size: 1.1rem; padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Theme lessons keep a single goal visible while the task changes. */
.lesson-goal { font-size: .85rem; line-height: 1.55; margin: 8px auto 0; max-width: 24ch; color: #63523e; }
.unit-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.lesson { padding-left: 14px; padding-right: 14px; }
.mem-grid.two-column { grid-template-columns: repeat(2, 1fr); }
.question-next:disabled { opacity: .75; }
@media (max-width: 600px) {
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson { padding-left: 8px; padding-right: 8px; }
  .lesson-goal { font-size: .8rem; }
}
