body[data-learning] { --learning-accent: #55d6be; --learning-soft: rgba(85,214,190,.10); }
body[data-learning="series"] { --learning-accent: #ffd166; --learning-soft: rgba(255,209,102,.10); }
body[data-learning="word"] { --learning-accent: #c3a1ff; --learning-soft: rgba(195,161,255,.10); }
body[data-learning="math"] { --learning-accent: #ffca7d; --learning-soft: rgba(255,202,125,.10); }
body[data-learning="compare"] { --learning-accent: #9cc9ff; --learning-soft: rgba(156,201,255,.10); }
body[data-learning="path"] { --learning-accent: #b4e58b; --learning-soft: rgba(180,229,139,.10); }
body[data-learning="market"] { --learning-accent: #ffce89; --learning-soft: rgba(255,206,137,.10); }
[hidden] { display: none !important; }
body[data-learning="shadow"] { --learning-accent: #c3a1ff; --learning-soft: rgba(195,161,255,.10); }
body[data-learning="intruder"] { --learning-accent: #ffd166; --learning-soft: rgba(255,209,102,.10); }
body[data-learning="share"] { --learning-accent: #ffb4ca; --learning-soft: rgba(255,180,202,.10); }
body[data-learning="missing"] { --learning-accent: #89e3cc; --learning-soft: rgba(137,227,204,.10); }
body[data-learning="detective"] { --learning-accent: #ffd166; --learning-soft: rgba(255,209,102,.10); }
body[data-match-topic="words"] { --learning-accent: #dfb7ff; --learning-soft: #b585ed19; }
body[data-match-topic="jobs"] { --learning-accent: #a6dfaa; --learning-soft: #9bd6ab19; }
.match-word-copy { display: grid; justify-items: center; gap: 3px; width: 100%; overflow-wrap: anywhere; }
.match-word-copy strong { font-size: clamp(16px, 3vw, 23px); }
.match-word-copy small { font-size: clamp(11px, 1.7vw, 14px); font-weight: 500; line-height: 1.3; color: #d5e2f7; }
.match-word-icon { font-size: 23px; }
.match-jobs .match-image, .match-jobs .match-label:has(img) { display: grid; justify-items: center; align-content: center; gap: 3px; }
.match-jobs :is(.match-image, .match-label) img { width: 58px; height: 58px; object-fit: contain; border-radius: 8px; }
.match-job-title { overflow-wrap: anywhere; font-size: clamp(12px, 1.55vw, 16px); text-align: center; }
body:is([data-learning="share"], [data-learning="missing"], [data-learning="detective"]) .learning-header .header-brand { flex: 1; }
body:is([data-learning="share"], [data-learning="missing"], [data-learning="detective"]) .learning-header .header-brand > div { min-width: 0; }
body:is([data-learning="share"], [data-learning="missing"], [data-learning="detective"]) .learning-header .header-controls { flex: 0 0 auto; width: auto; }
.shadow-picture {
  width: 190px; height: 190px; padding: 24px;
  background: radial-gradient(circle at 50% 42%, #fff8dc 42%, #f8d991 100%);
  border: 3px solid #c6a063; border-radius: 50%;
  box-shadow: inset 0 0 0 4px #fff2c9, 0 3px 0 #4d383b;
  display: grid; place-items: center;
}
.shadow-picture img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0); }
.shadow-clue { max-width: 330px; padding: 6px 10px; border-radius: 10px; background: #292b44; color: #f8ecff; }
body[data-learning="shadow"] button { -webkit-tap-highlight-color: transparent; }
.picture-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 8px; font-size: 14px; }
.picture-choice img { width: 100%; height: 100px; object-fit: contain; background: #fff7ec; border-radius: 12px; }
.game-choices:is(.shadow-choices, .intruder-choices, .missing-choices, .detective-choices) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.intruder-rule {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 15px 6px 7px; border-radius: 16px;
  color: #52351d; background: #fff0ce; border: 1px solid #dca75a;
}
.intruder-rule-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #f5d68d; font-size: 23px; }
.intruder-rule-copy { display: grid; gap: 2px; }
.intruder-rule-copy span { font-size: 12px; }
.intruder-rule-copy strong { font-size: clamp(17px, 3vw, 22px); }
body[data-learning="intruder"] button { -webkit-tap-highlight-color: transparent; }
.intruder-choices .intruder-found:disabled { opacity: 1; border-color: #91d5a1; background: #254533; }
.missing-scene { width: 100%; max-width: 660px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.missing-tile { min-width: 0; background: #fff7ec; color: #263348; padding: 6px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 700; text-align: center; }
.missing-tile img { width: 100%; height: 110px; object-fit: contain; }
.missing-placeholder { border: 2px dashed var(--learning-accent); background: var(--learning-soft); color: var(--learning-accent); font-size: 48px; }
.detective-clues { width: 100%; max-width: 580px; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.detective-clue { padding: 10px 14px; background: #1c2a40; border: 1px solid #52637f; border-radius: 14px; font-size: 17px; line-height: 1.6; }
.detective-clue > span { color: var(--muted); }
.clue-habitat { font-size: 24px; color: var(--learning-accent); }
.challenge-value { display: inline-block; font-size: clamp(34px, 6vw, 44px); line-height: 1.1; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--learning-accent); vertical-align: baseline; }
.sharing-basket { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 10px; align-items: center; max-width: 680px; }
.sharing-basket > img { width: 56px; height: 56px; object-fit: contain; grid-row: span 2; }
.sharing-basket p { font-size: 16px; line-height: 1.5; }
.sharing-basket .sharing-instruction { font-size: clamp(15px, 3vw, 23px); line-height: 1.45; font-weight: 600; }
.sharing-instruction .challenge-value { padding: 0 5px; background: var(--learning-soft); border-radius: 8px; }
.sharing-remaining { justify-self: start; padding: 1px 8px; border-radius: 10px; background: #f8dce8; color: #512840; font-weight: 700; }
.sharing-remaining.is-empty { background: #d9edcf; color: #315636; }
.sharing-remaining .challenge-value { font-size: 28px; color: inherit; }
.sharing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.sharing-card { min-width: 0; border: 1px solid #52637f; border-radius: 16px; background: #1c2a40; padding: 7px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sharing-friend { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; }
.sharing-friend img { width: 44px; height: 44px; object-fit: contain; background: #fff7df; border-radius: 8px; }
.sharing-friend h4 { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.sharing-plate { width: 100%; height: 57px; display: flex; align-content: center; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1px; background: #fff7df; color: #24314c; border: 3px solid #dfc795; border-radius: 20px; padding: 2px; }
.sharing-plate img { width: 23px; height: 23px; object-fit: contain; }
.sharing-plate > span { font-weight: 800; font-size: 13px; }
.sharing-controls { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.sharing-controls .btn { min-width: 44px; padding: 4px; }
.sharing-controls .sharing-add:not(:disabled) { background: #eab5cf; border-color: #eab5cf; color: #47233a; }
.sharing-count { min-width: 35px; border-radius: 9px; background: #f8dce8; color: #512840; font-size: 26px; line-height: 1.25; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
body[data-learning="share"] #gameActions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.learning-header .header-brand { min-width: 0; flex-shrink: 1; }
.learning-header .header-controls { flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.learning-page { width: 100%; max-width: 900px; margin: 0 auto; padding: 22px 0 40px; display: block; }
.learning-hero { text-align: center; margin: 0 auto 22px; max-width: 630px; }
.learning-eyebrow { color: var(--learning-accent); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.learning-hero h2 { font-size: clamp(25px, 5vw, 38px); line-height: 1.15; margin-bottom: 10px; }
.learning-hero p:last-child { font-size: 15px; color: var(--muted); line-height: 1.65; }
.learning-controls { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.learning-controls label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.learning-page select, .learning-page .btn, .learning-header .sound-toggle { min-height: 44px; font-size: 14px; }
.learning-page .btn.accent { background: var(--learning-accent); }
.level-help { text-align: center; min-height: 40px; color: var(--muted); font-size: 13px; line-height: 1.5; margin: 12px auto 18px; padding: 0 8px; }
.game-progress { text-align: center; color: var(--learning-accent); font-size: 13px; font-weight: 700; margin-bottom: 12px; min-height: 18px; }
.challenge-panel, .game-intro { border: 1px solid #34415a; border-radius: 22px; padding: 24px; background: linear-gradient(145deg, var(--learning-soft), #141f32); }
.game-intro { text-align: center; padding: 40px 22px; }
.intro-icons { font-size: 42px; letter-spacing: 10px; margin-bottom: 18px; }
.game-intro h3 { font-size: 21px; margin-bottom: 10px; }
.game-intro p { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 440px; margin: auto; }
.game-prompt { font-size: clamp(20px, 4vw, 28px); text-align: center; line-height: 1.35; margin-bottom: 20px; }
.game-board { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.target-animal { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; }
.target-animal img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; }
.animal-grid { width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.animal-tile { min-width: 0; background: #fff; border-radius: 14px; padding: 4px; aspect-ratio: 1; }
.animal-tile img { width: 100%; height: 100%; object-fit: contain; }
.game-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.answer-button, .word-slot { font: inherit; font-weight: 700; cursor: pointer; border: 2px solid #52637f; border-radius: 14px; color: var(--text); background: #24314c; min-width: 52px; min-height: 52px; padding: 10px 15px; touch-action: manipulation; }
.answer-button:not(:disabled):hover, .word-slot:not(:disabled):hover { border-color: var(--learning-accent); background: #304260; }
.answer-button:disabled { cursor: default; opacity: .5; }
.answer-button.incorrect { border-color: #ff9292; background: #522f3d; }
.number-answer { font-size: 28px; min-width: 65px; }
body[data-learning="count"] :is(.challenge-panel, .game-intro) {
  background: linear-gradient(#fff5dd, #eaf2cf);
  border-color: #ccd5a8;
  color: #263d28;
}
.count-intro-art { display: flex; justify-content: center; gap: 10px; }
.count-intro-art img { width: min(24%, 72px); height: 72px; object-fit: contain; }
body[data-learning="count"] .game-intro p { color: #334c35; }
body.game-screen[data-learning="count"] .game-prompt { margin-bottom: 9px; }
body.game-screen[data-learning="count"] .game-board { gap: 8px; }
body[data-learning="count"] .target-animal {
  color: #334c35;
  gap: 6px;
  padding: 2px 12px 2px 6px;
  border-radius: 18px;
  background: #fff9eb;
  border: 1px solid #d8d3ae;
  text-align: left;
}
body.game-screen[data-learning="count"] .target-animal img { width: 44px; height: 44px; background: transparent; }
.count-guide { display: grid; gap: 2px; }
.count-tip { font-size: 12px; }
body[data-learning="count"] .animal-grid {
  padding: 6px;
  border: 1px solid #c9d4a0;
  border-radius: 19px;
  background: radial-gradient(ellipse at 50% 0%, #f4f7dd, #d9e9af);
}
body[data-learning="count"] .animal-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 2px;
  border: 2px solid transparent;
  background: transparent;
  touch-action: manipulation;
  cursor: pointer;
}
body[data-learning="count"] .animal-tile img { min-height: 0; border-radius: 8px; pointer-events: none; }
body[data-learning="count"] .animal-tile[aria-pressed="true"] {
  background: #f5fadf;
  border-color: #40734a;
}
.count-mark {
  display: none;
  position: absolute;
  inset: 0 0 auto auto;
  translate: 15% -15%;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #f5fadf;
  border-radius: 50%;
  background: #286240;
  color: white;
  font: 800 14px/1 system-ui, sans-serif;
  pointer-events: none;
}
.animal-tile[aria-pressed="true"] .count-mark { display: grid; }
body[data-learning="count"] :is(.animal-tile, .number-answer) { -webkit-tap-highlight-color: transparent; }
body[data-learning="count"] :is(.animal-tile, .number-answer):focus-visible { outline: 3px solid #234e76; outline-offset: 2px; }
body[data-learning="count"] .animal-tile:disabled { cursor: default; }
body[data-learning="count"] .number-answer {
  border-color: #92501f;
  border-bottom-width: 5px;
  background: repeating-linear-gradient(5deg, #94522412 0 1px, transparent 1px 9px), linear-gradient(#ffe1a2, #edb66c);
  box-shadow: inset 0 2px #fff5d5, 0 2px 0 #70442030;
  color: #4e2c16;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px #fff0c8;
}
body[data-learning="count"] .number-answer:not(:disabled):is(:hover, :active) { background: #ffd08b; border-color: #744017; }
body[data-learning="count"] .number-answer.incorrect { background: #efd5c0; border-color: #95543f; text-decoration: line-through; opacity: 1; }
body[data-learning="count"] .number-answer.count-correct { background: #e0efb3; border-color: #40734a; color: #234c34; opacity: 1; }
body[data-learning="count"] .game-feedback:is(.success, .victory) { color: #235b39; }
body[data-learning="count"] .game-feedback.error { color: #852f26; }
@media (max-width: 759px) {
  body.game-screen[data-learning="count"] .game-choices { margin-top: 12px; }
  body.game-screen[data-learning="count"] .number-answer { width: clamp(48px, 17vw, 72px); min-width: 0; padding: 6px 2px; }
  body[data-learning="count"] .animal-grid:has(> :nth-child(13)) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
}
.animal-answer { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 110px; font-size: 14px; padding: 8px; }
.animal-answer img { width: 70px; height: 70px; object-fit: contain; background: #fff; border-radius: 10px; }
.series-grid { width: 100%; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.series-tile { min-width: 0; padding: 6px; background: #fff; border-radius: 14px; border: 2px solid transparent; position: relative; display: flex; flex-direction: column; align-items: center; }
.position-label { color: #37465e; font-size: 11px; font-weight: 700; align-self: flex-start; }
.series-tile img { width: 100%; max-width: 84px; height: 72px; object-fit: contain; }
.series-tile.missing { background: var(--learning-soft); border: 2px dashed var(--learning-accent); }
.series-tile.missing .position-label { color: var(--learning-accent); }
.question-mark { font-size: 47px; line-height: 72px; color: var(--learning-accent); }
.word-picture { width: 142px; height: 106px; }
.word-picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.word-model { color: var(--learning-accent); font-size: 25px; font-weight: 800; letter-spacing: .12em; text-align: center; overflow-wrap: anywhere; }
.word-slots { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.word-slot { min-width: 48px; min-height: 52px; padding: 8px 12px; border-style: dashed; color: var(--learning-accent); }
.word-slot:disabled { cursor: default; }
.letter-tile { font-size: 22px; }
.word-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.game-feedback { min-height: 48px; text-align: center; font-size: 15px; line-height: 1.5; padding-top: 18px; color: var(--muted); }
.game-feedback.error { color: #ffabab; }
.game-feedback.success, .game-feedback.victory { color: var(--learning-accent); font-weight: 700; }
.game-next { display: block; margin: 16px auto 0; min-height: 48px; }
.learning-note { font-size: 12px; line-height: 1.7; color: var(--muted); text-align: center; margin: 18px 8px 0; }
.math-equation { font-size: clamp(25px, 6vw, 40px); font-weight: 800; color: var(--learning-accent); }
.math-support { display: flex; justify-content: center; align-items: center; gap: clamp(9px, 2vw, 24px); width: 100%; }
.math-notebook {
  flex: 0 0 clamp(96px, 27vw, 188px);
  padding: clamp(8px, 1.5vw, 16px);
  border: 1px solid #e2c18a;
  border-radius: 14px;
  background: #ffefd0;
  color: #3f2d21;
  box-shadow: 0 4px 0 #ae7c4d;
}
.math-notebook-label { margin-bottom: 5px; color: #684730; text-align: center; font-size: clamp(11px, 2.2vw, 14px); font-weight: 700; }
.math-paper {
  display: grid;
  grid-template-columns: 1ch minmax(2.6ch, auto);
  align-items: center;
  justify-content: center;
  padding: .1em .16em;
  border-radius: 7px;
  background: repeating-linear-gradient(#fffaf0 0 calc(1.18em - 1px), #ecdab9 calc(1.18em - 1px) 1.18em);
  font: 800 clamp(24px, 4.5vw, 48px)/1.18 ui-monospace, monospace;
  text-align: right;
}
.math-paper-first { grid-column: 2; }
.math-paper-sign { grid-column: 1; grid-row: 2; color: #884626; text-align: center; }
.math-paper-second { grid-column: 2; grid-row: 2; }
.math-paper-result { grid-column: 1 / -1; border-top: 2px solid #684730; color: #884626; }
.math-solved .math-paper-result { color: #1a6447; }
@media (prefers-reduced-motion: no-preference) {
  .math-solved .math-paper-result { animation: math-result-reveal .2s ease-out; }
  @keyframes math-result-reveal { from { opacity: .45; transform: translateY(3px); } }
}
.math-paper-division { grid-template-columns: max-content max-content; column-gap: .16em; }
.math-paper-division .math-paper-first { grid-column: 1; grid-row: 1; }
.math-paper-division .math-paper-second { grid-row: 1; padding-inline: .17em; border-bottom: 2px solid #684730; border-left: 2px solid #684730; }
.math-paper-division .math-paper-result { grid-column: 2; grid-row: 2; padding-inline: .17em; border: 0; }
.math-illustration { min-width: 0; max-width: 440px; }
.math-illustration .quantity-help { margin-top: 6px; }
.math-visual { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; width: 100%; }
.quantity-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 210px; width: 100%; }
.math-visual .quantity-group { width: min(100%, 180px); }
.math-visual-sum { display: grid; grid-template-columns: minmax(0, max-content) auto minmax(0, max-content); gap: clamp(5px, 1vw, 12px); }
.math-visual-sum .quantity-group { display: grid; grid-template-columns: repeat(var(--summand-columns), minmax(0, clamp(42px, 6vw, 64px))); width: auto; }
.math-visual-sum .quantity-group:first-child { justify-self: end; }
.math-visual.math-visual-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.math-visual-groups .quantity-group { padding: 4px; background: #ffca7d24; border: 1px solid #d9a565; border-radius: 9px; }
.math-plates { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.math-plate { width: clamp(25px, 5vw, 42px); aspect-ratio: 1.55; border: 2px dashed #e9c99c; border-radius: 50%; background: #ffca7d19; }
.quantity-tile { position: relative; aspect-ratio: 1; min-width: 0; }
.quantity-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.quantity-tile.removed img { opacity: .3; }
.remove-mark { position: absolute; inset: 0; color: #b31331; display: grid; place-items: center; font-size: 40px; font-weight: 900; }
.math-sign { font-size: 36px; }
.quantity-help { font-size: 14px; color: var(--muted); line-height: 1.6; text-align: center; }
.comparison-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 500px; }
.comparison-card { background: #1c2a40; border: 1px solid #52637f; padding: 10px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.quantity-number { font-size: 34px; font-weight: 800; color: var(--learning-accent); }
.relation-answer { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; min-width: 76px; padding: 8px; }
.relation-symbol { font-size: 36px; }
.path-grid { display: grid; width: min(100%, 280px); gap: 5px; }
.path-cell { position: relative; aspect-ratio: 1; min-width: 0; background: #21334a; border: 1px solid #576d88; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: clamp(22px, 6vw, 34px); }
.path-cell.wall { background: #3e4350; }
.path-cell.visited { background: #38523f; border-color: #b4e58b; }
.path-cell.current { outline: 3px solid #ffda6a; outline-offset: 0; background: #fff0bd; z-index: 1; }
.path-cell.goal { border: 2px dashed #ffda6a; }
.path-cell.blocked { outline: 3px solid #ff9292; }
.cell-coordinate { position: absolute; top: 2px; left: 3px; font-size: 9px; color: #bdd0e8; line-height: 1; }
.current .cell-coordinate { color: #5f4b23; }
.path-actor { font-size: clamp(27px, 7vw, 39px); line-height: 1; }
.trail-step { font-size: 20px; font-weight: 800; color: #b4e58b; }
.path-position { color: #ffda6a; font-size: 15px; font-weight: 700; text-align: center; }
.path-legend { margin-top: 12px; }
.direction-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 100px)); grid-template-rows: repeat(3, 44px); gap: 6px; margin-top: 12px; }
.direction-controls [data-command="up"] { grid-area: 1 / 2; }
.direction-controls [data-command="right"] { grid-area: 2 / 3; }
.direction-controls [data-command="down"] { grid-area: 3 / 2; }
.direction-controls [data-command="left"] { grid-area: 2 / 1; }
.direction-controls .direction-button { min-height: 44px; padding: 5px; font-size: 14px; }
.path-cell img { width: 92%; height: 92%; object-fit: contain; border-radius: 6px; background: white; }
.path-program { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; list-style: none; min-height: 32px; max-height: 100px; overflow: auto; margin-top: 16px; }
.path-program li { font-size: 13px; padding: 8px; border-radius: 8px; background: #25374d; }
.path-program .active-step { background: #38523f; outline: 1px solid #b4e58b; color: #dcffc3; }
.direction-button { font-size: 15px; padding: 12px; }
.market-list-title { font-size: 18px; }
body[data-learning="market"] .challenge-panel {
  border-color: #695743;
  background: linear-gradient(#382b24, #211f2d 250px);
}
body[data-learning="market"] button { -webkit-tap-highlight-color: transparent; }
.market-list-title { color: #ffe2ac; }
.market-list { list-style: none; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 480px; }
.market-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #52637f; border-radius: 12px; font-size: 15px; background: #1c2a40; }
.market-list img { width: 36px; height: 36px; object-fit: contain; background: #fff5e7; border-radius: 6px; }
.market-list li.ready { border-color: #9cddb3; }
.market-list-count { margin-left: auto; font-weight: 800; white-space: nowrap; color: #ffce89; }
.market-request { min-width: 0; line-height: 1.4; }
.market-request .challenge-value { font-size: 30px; }
.market-shelf { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.market-product { border: 1px solid #52637f; border-radius: 16px; padding: 12px; background: #1c2a40; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.market-product > img {
  width: 100%; height: 100px; object-fit: contain; border-radius: 10px; padding: 10px 6px 5px;
  background: repeating-linear-gradient(90deg, #d99559 0 14px, #ffcb8c 14px 28px) top / 100% 7px no-repeat, #fff5e7;
}
.market-product h4 { font-size: 16px; }
.market-price { font-size: 14px; color: #ffce89; }
.market-quantity-controls { display: flex; align-items: center; gap: 7px; }
.market-quantity-controls .btn { min-width: 44px; padding: 5px; font-size: 23px; }
.market-quantity { font-size: 22px; font-weight: 800; min-width: 20px; text-align: center; }
.market-basket { color: #ffce89; text-align: center; line-height: 1.7; font-size: 14px; }
.market-payment { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.market-totals { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.market-totals p {
  display: grid; gap: 3px; place-content: center; text-align: center;
  padding: 9px 6px; border-radius: 14px; background: #fff0d3; color: #4e341a;
  font-size: 14px; font-weight: 700;
}
.market-totals p + p { background: #dfefd5; color: #254b35; }
.market-totals strong { font-size: clamp(27px, 6vw, 37px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.market-payment .market-pay-actions { margin: 0; }
.coin-tray:empty { display: none; }
.market-receipt-tools { width: 100%; display: flex; align-items: start; justify-content: center; flex-wrap: wrap; gap: 8px; }
.market-receipt { background: #fff5e7; color: #392d1e; border-radius: 10px; font-size: 14px; }
.market-receipt summary { align-content: center; min-height: 44px; padding: 0 9px; cursor: pointer; }
.market-receipt p { padding: 0 10px 6px; line-height: 1.5; }
.coin-controls, .coin-tray { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.coin-button { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #e8b955; background: #ffe2a1; color: #493710; font: inherit; font-weight: 800; font-size: 25px; cursor: pointer; }
.coin-button:not(:disabled):active { background: #ffcc73; }
.coin-button:disabled { opacity: .45; cursor: default; }
.coin-small { border-radius: 50%; background: #ffde96; color: #493710; min-width: 36px; height: 36px; display: grid; place-items: center; font-size: 13px; }
@media (max-width: 600px) {
  .market-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .market-product { padding: 8px 4px; }
  .market-product > img { height: 88px; }
  .market-quantity-controls { gap: 4px; }
  .market-list li { padding: 6px; gap: 6px; font-size: 14px; }
  body.game-screen[data-learning="market"] .market-product > img { height: 74px; }
  .market-payment .coin-button { width: 62px; height: 62px; }
  .math-visual { flex-direction: column; gap: 5px; }
  .math-visual:not(.math-visual-sum) .quantity-group { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; width: min(100%, 210px); }
  .math-visual:not(.math-visual-sum) .quantity-tile { width: clamp(26px, 8.5vw, 40px); }
  .math-visual-groups .quantity-tile { width: clamp(15px, 5vw, 25px); }
  .math-visual .remove-mark { font-size: clamp(22px, 7vw, 34px); }
  .math-sign { font-size: 22px; line-height: 1; }
  .math-illustration .quantity-help { font-size: 12px; }
  body[data-learning="math"] .learning-controls { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr) auto; align-items: end; gap: 7px; }
  body[data-learning="math"] .learning-controls label { flex-direction: column; align-items: flex-start; gap: 3px; font-size: 12px; }
  body[data-learning="math"] .learning-controls select { width: 100%; min-width: 0; }
  body[data-learning="math"] #gameStart { padding: 5px 7px; font-size: 13px; }
  body[data-learning="math"] .game-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  body.game-screen[data-learning="math"] .number-answer { min-width: 0; min-height: 52px; padding-inline: 4px; font-size: clamp(23px, 6vw, 30px); }
  .learning-header .header-controls { justify-content: flex-end; }
  .learning-page { padding-top: 14px; }
  .challenge-panel { padding: 18px 12px; border-radius: 18px; }
  .series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .series-tile img { height: 58px; }
  .question-mark { line-height: 58px; }
  .animal-answer { width: calc(50% - 8px); max-width: 130px; }
  .number-answer { min-width: 52px; padding: 9px 13px; }
  .animal-grid { gap: 5px; }
  .animal-tile { border-radius: 9px; padding: 2px; }
  .word-slot { min-width: 44px; padding: 8px; }
  .word-picture { width: 120px; height: 90px; }
}
