@font-face {
  font-family: 'Playwrite RO';
  src: url('../fonts/playwrite-ro/PlaywriteRO.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --font-main: var(--font-reading);
  --font-reading: 'Segoe UI', Verdana, sans-serif;
  --bg: #f6f8ff;
  --bg-card: #fff;
  --bg-soft: #edf2fc;
  --text: #25304b;
  --text-soft: #4e5d78;
  --border: #bbc8df;
  --primary: #a63c25;
  --success: #17633c;
  --danger: #a61d37;
  --focus: #175bc4;
  --s-mat: #2967c8;
  --s-lim: #bf5235;
  --s-log: #8550c7;
  --s-inf: #168477;
  --s-sci: #27814b;
  --s-civ: #b44777;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px #25304b12;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141b2c;
  --bg-card: #202b42;
  --bg-soft: #2a3853;
  --text: #f0f4ff;
  --text-soft: #bccae2;
  --border: #677b9d;
  --primary: #f5aa86;
  --success: #91e6b1;
  --danger: #ffadbc;
  --focus: #a8caff;
  --shadow: 0 8px 24px #0004;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[data-font="handwriting"] { --font-main: 'Playwrite RO', 'Segoe UI', sans-serif; }
[data-font="serif"] { --font-main: Georgia, 'Times New Roman', serif; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.05rem/1.7 var(--font-main); font-synthesis: none; }
[data-font="handwriting"] body { line-height: 1.95; }
[data-motion="reduce"] { scroll-behavior: auto; }
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
[hidden] { display: none !important; }
a { color: var(--focus); text-underline-offset: 0.18em; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; }
button, .btn, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.65; }
button, input, select, textarea { max-width: 100%; }
button, p, h1, h2, h3, li, label { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 4px;
}
h1, h2, h3 { line-height: 1.8; margin: 0 0 0.8rem; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.18rem; margin-top: 1.6rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-inline-start: 1.5rem; }
li { margin-bottom: 0.55rem; }
main { width: min(1080px, 100%); margin: auto; padding: 1.5rem 1.2rem 3rem; min-height: 65vh; }
.site-header { background: var(--bg-card); border-bottom: 2px solid var(--border); }
.header-inner { max-width: 1080px; margin: auto; padding: 0.9rem 1.2rem; display: flex; gap: 0.7rem 1.3rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.logo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; text-decoration: none; font-size: 1.2rem; color: var(--text); }
.logo .mascot { font-size: 1.7rem; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.nav-link { font-size: 0.96rem; padding: 0.5rem 0.25rem; }
.nav-link.active { font-weight: 700; }
.btn-theme, .btn-sound { border: 1px solid var(--border); border-radius: 50%; background: var(--bg-soft); padding: 0.4rem 0.65rem; color: var(--text); }
.chip { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 100px; background: var(--bg-soft); color: var(--text); font-size: 0.88rem; }
.hero { text-align: center; max-width: 850px; margin: 0 auto 2rem; padding: 1.5rem 0; }
.hero p { color: var(--text-soft); }
.mascot-big { font-size: 4rem; }
.hero-motto { font-weight: bold; background: var(--bg-card); border: 1px solid var(--border); padding: 0.75rem; border-radius: var(--radius-sm); }
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1.25rem; margin-block: 1.5rem; }
.subject-card { color: var(--text); text-decoration: none; background: var(--bg-card); border: 2px solid var(--border); border-top: 7px solid var(--sc); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.subject-card:hover, .activity-card:hover { border-color: var(--focus); }
.sc-icon { font-size: 2.5rem; }
.sc-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-block: 0.8rem; }
progress { display: block; width: 100%; height: 1rem; accent-color: var(--focus); }
.subject-hero, .lesson-hero { background: var(--bg-card); border: 2px solid var(--border); border-inline-start: 7px solid var(--sc); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.sh-icon, .lh-icon { font-size: 2.6rem; }
.activities-list { display: grid; gap: 1rem; }
.activity-card { display: flex; align-items: start; gap: 1rem; color: var(--text); text-decoration: none; border: 2px solid var(--border); background: var(--bg-card); border-radius: var(--radius); padding: 1.2rem; }
.ac-num { border-radius: 50%; background: var(--bg-soft); padding: 0.3rem 0.7rem; }
.ac-icon { font-size: 1.8rem; }
.ac-body { min-width: 0; flex: 1; }
.ac-body h2 { font-size: 1.2rem; }
.ac-body p { color: var(--text-soft); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-block: 0.5rem 1rem; }
.tab { flex: 1 1 130px; padding: 0.7rem; color: var(--text); background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-sm); font-weight: bold; }
.tab.active { border-color: var(--focus); box-shadow: inset 0 -3px var(--focus); }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 4vw, 2rem); }
.lesson-goal { font-weight: bold; }
.hands-on, .callout { background: var(--bg-card); padding: 1.3rem; border: 2px solid var(--border); border-radius: var(--radius); margin-block: 1.5rem; }
.hands-on { background: var(--bg-soft); border-inline-start: 5px solid var(--s-sci); }
.hands-on h3 { margin-top: 0; }
.btn, .btn-reset-progress { display: inline-flex; justify-content: center; align-items: center; gap: 0.4rem; padding: 0.6rem 0.95rem; border: 2px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--bg-soft); text-decoration: none; text-align: center; line-height: 1.5; }
.btn:hover:not(:disabled), .btn-reset-progress:hover { border-color: var(--focus); }
.btn-primary { color: var(--bg-card); background: var(--primary); border-color: var(--primary); font-weight: bold; }
[data-theme="dark"] .btn-primary { color: #202b42; }
.game-controls { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin-block: 1rem; }
.game-controls h2 { margin: 0; flex: 1 1 220px; }
.level-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.level-button { text-align: start; background: var(--bg-soft); color: var(--text); padding: 1rem; border: 2px solid var(--border); border-radius: var(--radius-sm); }
.level-button strong, .level-button span { display: block; }
.level-button span { font-size: 0.92rem; margin-top: 0.4rem; }
.level-button.selected { border-color: var(--focus); box-shadow: inset 0 -4px var(--focus); }
.game-rules { color: var(--text-soft); font-size: 0.95rem; margin-top: 1rem; }
.game { min-width: 0; padding-top: 1rem; border-top: 2px dashed var(--border); }
.g-status { margin-bottom: 0.8rem; color: var(--text-soft); }
.game-prompt { font-size: 1.25rem; margin-block: 1.3rem; }
.quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0.8rem; margin-block: 1rem; }
.quiz-opt { background: var(--bg-soft); color: var(--text); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; min-height: 65px; }
.quiz-opt:hover:not(:disabled) { border-color: var(--focus); }
.game-feedback { border-inline-start: 4px solid transparent; padding: 0.8rem; min-height: 3rem; }
.game-feedback.good { border-color: var(--success); }
.game-feedback.needs-work { border-color: var(--danger); }
.reading-passage { white-space: pre-line; margin: 1rem 0; padding: 1.1rem; background: var(--bg-soft); border-inline-start: 4px solid var(--focus); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.token-row, .token-pool { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 1rem; margin-block: 0.8rem; border-radius: var(--radius-sm); }
.token-row { min-height: 5rem; border: 2px dashed var(--focus); }
.token-pool { background: var(--bg-soft); }
.token-pool .btn { background: var(--bg-card); }
.match-select { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.match-select select { width: min(100%, 500px); }
input:not([type="checkbox"]):not([type="radio"]), textarea, select { display: block; width: 100%; color: var(--text); background: var(--bg-card); border: 2px solid var(--border); border-radius: 8px; padding: 0.65rem; }
input[type="range"] { padding: 0; margin-block: 1.5rem; accent-color: var(--focus); }
textarea { resize: vertical; }
label { display: block; }
fieldset { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; }
legend { font-weight: bold; max-width: 100%; }
.radio-choice { display: flex; align-items: baseline; gap: 0.6rem; margin-block: 0.8rem; padding: 0.4rem; cursor: pointer; }
.radio-choice input { flex: 0 0 auto; width: 1.2rem; height: 1.2rem; accent-color: var(--focus); }
.axis-labels { text-align: center; }
.tens-model, .units-model { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.8rem 0; }
.ten-rod { padding: 0.5rem 0.8rem; border: 2px solid var(--focus); background: var(--bg-soft); border-radius: 5px; }
.unit-dot { display: inline-grid; place-items: center; min-width: 28px; min-height: 28px; border-radius: 50%; background: var(--focus); color: var(--bg-card); }
.learning-shape { display: block; width: 170px; height: 170px; margin: 1rem auto; color: var(--focus); }
.learning-clock { display: block; width: min(240px, 100%); height: auto; margin: 1rem auto; }
.learning-clock text { font: 16px var(--font-reading); fill: var(--text); }
.matrix-scroll { max-width: 100%; overflow-x: auto; margin-block: 1rem; }
.learning-matrix { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.9rem; }
.learning-matrix td, .learning-matrix th { border: 1px solid var(--border); padding: 0.5rem; overflow-wrap: anywhere; }
.learning-matrix caption { text-align: start; margin-bottom: 0.5rem; }
.learning-matrix th { background: var(--bg-soft); }
.memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; margin-block: 1rem; }
.memory-card { aspect-ratio: 1; display: grid; place-items: center; color: var(--text); background: var(--bg-soft); border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: clamp(1.2rem, 5vw, 2rem); padding: 0.3rem; }
.memory-card:disabled { opacity: 1; border-color: var(--success); }
.robot-board { width: min(360px, 100%); display: grid; gap: 4px; margin: 1rem auto; }
.robot-cell { display: grid; place-items: center; aspect-ratio: 1; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; font-size: 1.4rem; }
.robot-program { display: flex; flex-wrap: wrap; gap: 0.5rem 1.8rem; padding-inline-start: 1.5rem; }
.robot-program li { margin-bottom: 0; }
.count-scene { padding: 1rem; letter-spacing: 0.5rem; line-height: 2; }
.lesson-actions { text-align: center; padding-block: 1.5rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.lesson-nav a { flex: 1 1 180px; background: var(--bg-card); padding: 1rem; border-radius: var(--radius-sm); }
.level-result { border-bottom: 1px solid var(--border); padding-bottom: 0.6rem; }
.level-result h3 { margin-top: 1rem; }
.dece-banner { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); padding: 1.2rem; border: 2px solid var(--s-sci); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.dece-banner strong { display: block; }
.dece-banner > span:first-child { font-size: 2rem; }
.journey-grid { display: grid; gap: 0.3rem; }
.journey-choice { display: flex; width: 100%; margin-block: 0.65rem; }
.journey-feedback { margin-top: 1rem; color: var(--text); font-weight: bold; }
.profile-panel { margin-block: 2rem; background: var(--bg-card); padding: 1.4rem; border: 2px solid var(--border); border-radius: var(--radius); }
.profile-panel form { margin-top: 1rem; }
.profile-panel .game-controls input { flex: 1 1 200px; width: auto; min-width: 0; }
.profile-panel p { color: var(--text-soft); font-size: 0.95rem; margin-top: 1rem; }
.settings-panel { margin-block: 1.5rem; padding: 1.3rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg-card); font-family: var(--font-reading); }
.settings-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.2rem; margin-block: 1rem; }
.settings-fields label { display: grid; align-content: start; gap: 0.5rem; min-width: 0; }
.settings-fields select { width: 100%; min-width: 0; }
.settings-preview { margin-block: 1.5rem; padding: 1rem; background: var(--bg-soft); border: 2px dashed var(--border); border-radius: var(--radius-sm); font-family: var(--font-main); }
.import-label { cursor: pointer; }
#import-progress { font-size: 0.9rem; }
.notification { position: fixed; inset-inline: 1rem; bottom: 1rem; max-width: 750px; margin-inline: auto; padding: 1rem 1.2rem; border: 3px solid var(--focus); border-radius: var(--radius-sm); box-shadow: var(--shadow); color: var(--text); background: var(--bg-card); z-index: 120; }
.notification-error { position: static; max-width: 1080px; margin: 1rem auto; border-color: var(--danger); }
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: #101729bb; display: grid; place-items: center; padding: 1rem; }
.modal-card { width: min(480px, 100%); max-height: 90vh; overflow-y: auto; padding: 1.5rem; border-radius: var(--radius); background: var(--bg-card); color: var(--text); border: 2px solid var(--border); }
.modal-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.site-footer { text-align: center; border-top: 1px solid var(--border); padding: 1.5rem 1rem 3rem; color: var(--text-soft); }
.bg-bubbles { display: none; }
.invalid-screen { padding: 2rem 0; text-align: center; }
.confetti-piece { position: fixed; top: -20px; pointer-events: none; z-index: 150; animation: confetti-fall 3s linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(360deg); opacity: 0; } }
.skip-link { position: absolute; top: -100px; left: 1rem; z-index: 300; background: var(--bg-card); padding: 0.7rem; }
.skip-link:focus { top: 0.5rem; }
@media (max-width: 640px) {
  main { padding: 1rem 0.75rem 2rem; }
  .header-inner { padding: 0.75rem; }
  .nav { gap: 0.4rem; }
  .hero { padding-block: 0.7rem; }
  .level-picker { grid-template-columns: 1fr; }
  .level-button { padding: 0.8rem; }
  .level-button span { margin-top: 0.15rem; }
  .activity-card { gap: 0.6rem; padding: 0.8rem; }
  .ac-icon { display: none; }
  .subject-hero, .lesson-hero { padding: 1rem; }
  .tabs { gap: 0.4rem; }
  .tab { flex-basis: 130px; font-size: 1rem; padding: 0.65rem 0.5rem; }
  .game-controls > .btn { flex: 1 1 120px; }
  .learning-matrix { font-size: 0.78rem; }
  .learning-matrix td, .learning-matrix th { padding: 0.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti-piece { display: none; }
}

#panel-parinte, .profile-panel, .safety-note { font-family: var(--font-reading); font-size: 1rem; line-height: 1.7; }
.discovery-spread { --paper: #faf0db; }
.discovery-cover { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.5rem; align-items: center; padding-bottom: 1.5rem; border-bottom: 2px dashed var(--border); }
.eyebrow { font: 700 0.76rem/1.5 var(--font-reading); text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-soft); margin-bottom: 0.65rem; }
.discovery-cover h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.discovery-picture { margin: 0; transform: rotate(1.5deg); padding: 0.7rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 22px 6px 22px 6px; }
.discovery-picture svg { width: 100%; height: auto; max-height: 250px; display: block; margin: auto; }
.discovery-picture figcaption { font-size: 1.1rem; text-align: center; padding: 0.4rem; }
.discovery-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; padding-top: 1.5rem; align-items: start; }
.discovery-column { display: grid; gap: 1rem; min-width: 0; }
.lesson-words dt { font-weight: bold; margin-top: 0.8rem; }
.lesson-words dd { margin: 0.25rem 0 0; }
.reflection-prompts { display: grid; gap: 1rem; }
.game-menu { display: grid; gap: 0.5rem; margin-block: 1rem; }
.game-menu label { font-weight: bold; }
.game-menu select { width: 100%; min-width: 0; min-height: 48px; }
.lesson-game-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1rem 1.5rem; }
.lesson-game-card { display: grid; align-content: start; gap: 0.6rem; text-align: start; min-width: 0; padding: 1rem; color: var(--text); background: var(--bg-card); border: 2px solid var(--border); border-radius: 16px; }
.lesson-game-card[aria-pressed="true"] { border-color: var(--focus); box-shadow: inset 0 0 0 2px var(--focus); background: var(--bg-soft); }
.lesson-game-card strong { font-size: 1.2rem; }
.game-card-icon { font-size: 1.8rem; }
.lesson-game-card .eyebrow { margin: 0; }
.mission-instructions { padding: 1rem; border-inline-start: 4px solid var(--focus); background: var(--bg-soft); }
.mission-fact { display: flex; gap: 0.6rem; align-items: start; padding: 0.8rem; margin-block: 0.5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.mission-fact input { flex-shrink: 0; width: 24px; height: 24px; margin-top: 0.25rem; }
.mission-step { width: 100%; text-align: start; padding: 0.8rem; border: 2px solid var(--border); border-radius: 10px; color: var(--text); background: var(--bg-card); }
.mission-step[aria-pressed="true"] { border-color: var(--focus); background: var(--bg-soft); }
.mission-plan-pool { display: grid; gap: 0.6rem; margin-block: 1rem; }
.mission-plan-selected { padding: 0.7rem 0.7rem 0.7rem 2rem; min-height: 4rem; border: 2px dashed var(--border); border-radius: 12px; }
.mission-plan-selected button { width: 100%; text-align: start; }
#round-content fieldset { min-width: 0; max-width: 100%; margin-block: 1rem; border: 1px solid var(--border); border-radius: 12px; }
#round-content legend { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 760px) { .lesson-game-cards { grid-template-columns: 1fr; } }
.active-profile { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.discovery-card { padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--border); border-radius: 18px; min-width: 0; background: var(--bg); }
.discovery-card h3 { font-size: 1.5rem; margin-top: 0; }
.discovery-card p:last-child { margin-bottom: 0; }
.idea-card { border-top: 6px solid #75ae9f; }
.discovery-workbench { border: 2px solid var(--border); background: var(--bg-soft); }
.example-card { border-top: 6px solid #9badd7; }
.detective-note { border-inline-start: 6px solid #d9a24e; background: repeating-linear-gradient(transparent 0 31px, var(--border) 32px, transparent 33px); }
.discovery-layout .hands-on { margin: 0; background: var(--bg-soft); border: 2px dashed var(--border); border-top: 6px solid #75ae9f; }
.reflection-card { border-top: 6px solid #c89cad; }
.discovery-card summary { cursor: pointer; min-height: 44px; padding-block: 0.4rem; color: var(--focus); }
.self-check { padding: 0.8rem; border-radius: 10px; background: var(--bg-card); }
.discovery-steps li::marker { color: var(--focus); font-weight: bold; }
.lab-preview { padding: 0.6rem; background: var(--bg-card); border-radius: 14px; margin-block: 0.7rem; min-height: 130px; display: grid; place-items: center; }
.lab-preview .learning-shape, .lab-preview .learning-clock { width: min(100%, 180px); height: auto; }
.lab-controls { display: grid; gap: 0.5rem; }
.lab-controls label { display: block; }
.range-control { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 0.4rem; margin-block: 0.6rem; width: 100%; }
.range-step { min-width: 48px; min-height: 48px; padding: 0; border: 2px solid var(--border); border-radius: 12px; color: var(--text); background: var(--bg-card); font: 1.8rem/1 var(--font-reading); }
.range-control input[type="range"] { grid-column: 1 / -1; min-height: 36px; margin: 0; }
.range-value { text-align: center; font: 1.6rem/1.5 var(--font-reading); color: var(--focus); }
.lab-observation { margin-block: 1rem 0; padding: 0.8rem; border-inline-start: 4px solid var(--focus); background: var(--bg-card); border-radius: 0 10px 10px 0; }
.base-ten-art { display: flex; gap: 7px; align-items: flex-start; flex-wrap: wrap; padding: 0.5rem; }
.base-ten-art .ten-rod { display: block; padding: 0; width: 13px; height: 120px; border: 1px solid #276b60; background: repeating-linear-gradient(#75ae9f 0 10px, #276b60 10px 12px); }
.tens-model .ten-rod { display: grid; gap: 0.3rem; width: 40px; padding: 0.3rem; text-align: center; font: 1rem/1.5 var(--font-reading); }
.rod-segments { display: grid; gap: 1px; padding: 1px; background: #276b60; }
.rod-segments i { display: block; height: 7px; background: #75ae9f; }
.unit-bunch { display: grid; grid-template-columns: repeat(5, 12px); gap: 5px; }
.unit-bunch i { width: 12px; height: 12px; border: 1px solid #a66a25; background: #efbd75; }
.arithmetic-objects { display: flex; flex-wrap: wrap; gap: 0.4rem; color: var(--focus); font-size: 1.6rem; }
.arithmetic-objects .added { color: var(--success); outline: 1px dashed var(--success); border-radius: 50%; }
.arithmetic-objects .removed { color: var(--text-soft); text-decoration: line-through; }
.discovery-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-art { display: block; width: 100%; max-width: 120px; margin: auto; }
.exploration-path { display: grid; gap: 0.7rem; }
.exploration-stop { border: 2px solid var(--border); background: var(--bg-card); color: var(--text); border-radius: 12px; padding: 0.65rem; text-align: start; }
.exploration-stop[aria-pressed="true"] { border-color: var(--focus); background: var(--bg-soft); }
.math-illustration { width: min(100%, 420px); height: auto; display: block; margin: 1rem auto; background: #faf0db; border-radius: 14px; }
.ruler-illustration { width: 100%; max-width: 640px; border-radius: 12px; background: #faf0db; }
.math-illustration text, .discovery-art text, .drawing-guide text { font-family: var(--font-reading); font-weight: 400; }
.balance-model { width: 100%; }
.balance-illustration { max-width: 520px; margin-bottom: 0; }
.balance-readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin: 0 auto 1rem; max-width: 520px; }
.balance-readings p { padding: 0.5rem; margin: 0; border: 2px solid var(--border); border-radius: 12px; text-align: center; background: var(--bg-card); }
.balance-readings span, .balance-readings strong { display: block; }
.balance-readings strong { font: 1.25rem/1.6 var(--font-reading); color: var(--text); }
.ruler-model { width: 100%; }
.measurement-readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 1rem; text-align: center; }
.measurement-readings p { margin: 0; padding: 0.5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
.measurement-readings strong { display: block; font: 1.3rem/1.6 var(--font-reading); }
.calculation-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem; margin-block: 1.2rem; align-items: end; }
.calculation-form input { margin-top: 0.4rem; }
.calculation-form input, .learning-matrix, .math-postcard, .part-whole, .paint-cell, .mosaic-cell { font-family: var(--font-reading); }
.calculation-form .btn { min-height: 55px; }
.math-postcard { padding: 1rem; font-size: clamp(1.5rem, 4vw, 2rem); text-align: center; background: var(--bg-soft); border: 2px dashed var(--border); border-radius: 15px; }
.part-whole { display: flex; gap: 4px; max-width: 560px; margin: 1rem auto; }
.part-whole span { min-width: 2ch; text-align: center; padding: 1rem 0.4rem; background: #c8e4dc; color: #25304b; border: 2px solid #276b60; border-radius: 10px; }
.part-whole span:nth-child(2) { background: #f7d8aa; border-color: #956027; }
.market-products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 0.7rem; }
.market-products article { text-align: center; border: 2px solid var(--border); border-radius: 14px; padding: 0.6rem; background: var(--bg-soft); }
.market-products h4, .market-products p { margin: 0.2rem 0; }
.shape-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-block: 1rem; }
.shape-card { min-width: 0; border: 3px solid var(--border); border-radius: 14px; color: var(--text); background: var(--bg-soft); padding: 0.5rem; }
.shape-card .learning-shape { width: min(100%, 130px); height: auto; margin: 0.2rem auto; }
.shape-card:nth-child(3n + 1) .learning-shape { color: var(--focus); }
.shape-card:nth-child(3n + 2) .learning-shape { color: #a35b37; }
.shape-card:nth-child(3n) .learning-shape { color: #657e41; }
[data-theme="dark"] .shape-card:nth-child(3n + 2) .learning-shape { color: #efbd75; }
[data-theme="dark"] .shape-card:nth-child(3n) .learning-shape { color: #aac67b; }
.shape-card.chosen { border-color: var(--focus); box-shadow: inset 0 0 0 2px var(--focus); }
.geoboard { display: grid; grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr)); position: relative; aspect-ratio: 1; max-width: 360px; margin: 1rem auto; border: 2px solid var(--border); border-radius: 16px; background: #faf0db; }
.geoboard svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.peg { position: relative; z-index: 1; border: 0; background: transparent; color: #53647c; padding: 0; min-width: 0; min-height: 40px; font: 1rem/1 sans-serif; }
.peg[aria-pressed="true"] { color: #fff; background: radial-gradient(circle, #276b60 0 14px, transparent 15px); font-size: 1.1rem; }
.peg.first-peg { background: radial-gradient(circle, #174f48 0 13px, #faf0db 14px 15px, #276b60 16px 17px, transparent 18px); }
.drawing-guide { padding: 1rem; background: var(--bg-soft); border: 2px solid var(--border); border-radius: 14px; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 0.5rem 1rem; align-items: center; }
.drawing-guide h4 { grid-column: 1 / -1; margin: 0; }
.drawing-guide svg { width: 100%; max-width: 180px; }
.drawing-guide ol { margin: 0; }
.symmetry-grid, .mosaic-grid, .fraction-grid { display: grid; margin: 1rem auto; max-width: 480px; border: 2px solid var(--border); background: var(--bg-card); gap: 2px; padding: 3px; border-radius: 10px; }
.symmetry-grid { max-width: 400px; }
.paint-cell, .mosaic-cell { border: 1px solid var(--border); border-radius: 3px; min-width: 0; padding: 0.1rem; background: var(--bg-card); color: var(--text); aspect-ratio: 1; }
.symmetry-grid .paint-cell { min-height: 32px; }
.paint-cell.painted, .fraction-preview .painted { background: #75ae9f; color: #1c3a33; border-color: #276b60; }
.paint-cell:disabled { opacity: 1; background-image: repeating-linear-gradient(45deg, transparent 0 5px, #53647c20 5px 7px); }
.mirror-edge { border-inline-start: 4px solid var(--primary); }
.mosaic-cell.covered { background: var(--tile-color); color: #25304b; font-weight: bold; border: 2px solid #53647c; }
.mosaic-cell:disabled { background: var(--bg-soft); color: var(--text-soft); opacity: 1; }
.fraction-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 300px; border: 2px solid #53647c; }
.fraction-preview span { aspect-ratio: 1; border: 1px solid #53647c; background: #fff5dd; }
.garden-grid { display: grid; gap: 1px; border: 3px solid #276b60; width: min(100%, 330px); margin: 1rem auto; background: #276b60; }
.garden-grid span { min-width: 0; aspect-ratio: 1; background: #c8e4dc; color: #345443; display: grid; place-items: center; font: clamp(0.6rem, 4vw, 1rem)/1 var(--font-reading); }
@media (max-width: 760px) {
  .discovery-cover { grid-template-columns: 1fr; }
  .discovery-picture { max-width: 420px; margin-inline: auto; transform: none; }
  .discovery-layout { grid-template-columns: 1fr; }
  .drawing-guide { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  #panel-explicatie { padding: 0.8rem; }
  .shape-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .symmetry-grid .paint-cell { min-height: 26px; }
  .geoboard .peg { min-height: 30px; }
}
