/* Rekenpret 3.2 · vrolijke maar rustige vormgeving voor scherm en A4.
   Visuele laag bovenop de bestaande applicatie: geen wijzigingen aan de rekenmotor. */
:root {
  --ink:#253354; --muted:#5d6982; --blue:#4351c8; --blue-dark:#303ca0;
  --pink:#ec5288; --soft:#f5f6ff; --line:#e0e5f4;
  --shadow:0 13px 35px rgba(62,70,130,.105);
  --sun:#ffcb50; --violet:#8865dd; --aqua:#47c4bf; --coral:#ff916b;
}
/* Scherm: zachte speelse achtergrond, afgeronde knoppen, duidelijke hiërarchie */
@media screen {
  body {
    background:
      radial-gradient(circle at 6% 14%,rgba(255,197,113,.27) 0 9%,transparent 25%),
      radial-gradient(circle at 95% 31%,rgba(165,137,239,.19) 0 8%,transparent 26%),
      radial-gradient(circle at 20% 87%,rgba(104,218,203,.14) 0 12%,transparent 32%),
      #fafaff;
  }
  .site-header {padding:18px 0 21px;position:relative;}
  .brand {display:inline-flex;align-items:center;gap:10px;font-weight:900;color:#333ba1;letter-spacing:-1px;}
  .brand span {width:50px;height:50px;display:grid;place-items:center;background:#fff2c7;border:2px solid #ffe5a7;border-radius:17px;box-shadow:0 4px 0 #f6d684;transform:rotate(-7deg);}
  .header-tagline {background:white;border:1px solid #e4e8f6;border-radius:99px;padding:7px 13px;font-weight:700;}
  .header-home {border-radius:999px;box-shadow:0 3px 0 #dfe5f5;}
  .home-view {padding-top:3px;}
  .hero {position:relative;max-width:none;margin:8px auto 28px;padding:45px 60px 40px;border:2px solid #e6e2fc;border-radius:39px;background:linear-gradient(122deg,#f2eeff 0%,#fff6e7 57%,#e6f9f4 100%);isolation:isolate;overflow:hidden;}
  .hero::before,.hero::after {position:absolute;z-index:-1;pointer-events:none;}
  .hero::before {content:'✳';font-size:106px;line-height:1;left:25px;top:22px;color:#f6b659;transform:rotate(-15deg);opacity:.55;}
  .hero::after {content:'✦';font-size:120px;line-height:1;right:32px;bottom:5px;color:#ab96f2;transform:rotate(11deg);opacity:.48;}
  .hero .eyebrow {display:inline-block;background:#fff;border:1px solid #f2dba9;color:#976524;padding:8px 16px;border-radius:999px;box-shadow:0 3px 0 #f5e6c4;letter-spacing:.8px;}
  .hero h1 {color:#25345c;font-size:clamp(37px,5vw,63px);margin:20px 0 18px;letter-spacing:-2.3px;}
  .hero h1 em {color:#df467c;position:relative;white-space:nowrap;}
  .hero h1 em::after {content:'';position:absolute;left:4%;right:0;bottom:-7px;height:8px;border-radius:100%;border-top:5px solid #ffca59;transform:rotate(-3deg);}
  .hero p {color:#51617e;font-size:18px;line-height:1.6;}
  .home-grid {gap:19px;}
  .choice-card {position:relative;isolation:isolate;overflow:hidden;padding:26px 28px 24px;min-height:207px;border:2px solid #e8eafa;border-radius:27px;gap:11px;box-shadow:0 6px 0 rgba(85,97,164,.055),var(--shadow);}
  .choice-card::after {content:'';position:absolute;z-index:-1;pointer-events:none;right:-47px;top:-68px;width:170px;height:170px;border-radius:50%;background:#e4f6ef;}
  .choice-card:nth-child(1) {background:linear-gradient(135deg,#fff,#f0fcf6);border-color:#ccede1;}
  .choice-card:nth-child(1)::after {background:#d3f6e7;}
  .choice-card:nth-child(2) {background:linear-gradient(135deg,#fff,#eef5ff);border-color:#d4e4fa;}
  .choice-card:nth-child(2)::after {background:#dae9ff;}
  .choice-card:nth-child(3) {background:linear-gradient(135deg,#fff,#f7f1ff);border-color:#e7d6fa;}
  .choice-card:nth-child(3)::after {background:#eee0ff;}
  .choice-card:nth-child(4) {background:linear-gradient(135deg,#fff,#fff2e7);border-color:#f7dbc3;}
  .choice-card:nth-child(4)::after {background:#ffe3cf;}
  .choice-card:hover {transform:translateY(-5px) rotate(-.4deg);box-shadow:0 11px 0 rgba(89,91,172,.065),0 20px 38px rgba(64,75,138,.16);}
  .featured-details {align-items:center;gap:17px;width:100%;}
  .featured-details>div {min-width:0;}
  .featured-details h2 {color:#2a3155;font-size:clamp(21px,2.5vw,25px);letter-spacing:-.6px;}
  .featured-details p {font-size:15px;color:#596681;}
  .choice-icon {width:77px;height:77px;border:2px solid rgba(255,255,255,.85);border-radius:23px;font-size:38px;box-shadow:0 6px 0 rgba(58,69,119,.11);transform:rotate(-7deg);margin:0;}
  .choice-card:nth-child(2) .choice-icon {background:#c9e1ff;transform:rotate(7deg);}
  .choice-card:nth-child(3) .choice-icon {background:#e7d5fb;transform:rotate(-6deg);}
  .choice-card:nth-child(4) .choice-icon {background:#ffddb8;transform:rotate(6deg);}
  .module-actions {width:100%;margin-top:auto;padding-top:16px;gap:10px;}
  .btn {border-radius:15px;min-height:47px;box-shadow:0 4px 0 rgba(52,62,139,.1);}
  .btn.primary {background:#4659c6;box-shadow:0 4px 0 #303f99;}
  .btn.primary:hover {background:#3247b2;}
  .btn.outline {border-color:#cbd5ee;background:#fff;color:#414caa;}
  .btn.outline:hover {background:#f2f4ff;}
  .btn:active {transform:translateY(2px);box-shadow:none;}
  .choice-card.pirate-home-card {grid-column:1/-1;min-height:150px;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto;align-content:center;column-gap:25px;row-gap:8px;background:linear-gradient(110deg,#fff5d8,#fff3e0,#f9ebff);border-color:#f3d6aa;padding:23px 34px;}
  .pirate-home-card .choice-icon {grid-row:1/3;align-self:center;background:#ffdf98;}
  .pirate-home-card strong {font-size:25px;align-self:end;}
  .pirate-home-card>span:nth-of-type(2) {grid-column:2;grid-row:2;align-self:start;}
  .pirate-home-card .choice-link {grid-column:3;grid-row:1/3;align-self:center;justify-self:end;display:inline-block;background:#fff;border:2px solid #f2d3a2;border-radius:17px;padding:14px 18px;color:#89562d;}
  .pirate-home-card::after {background:#ffe2ad;}
  .dashboard {margin-top:30px;border:2px solid #e1e8fc;border-radius:25px;padding:27px 30px;background:linear-gradient(120deg,#fff,#f7f8ff);}
  .dashboard h2 {color:#333c95;}
  .badge {background:#faf2ff;border-color:#dcc7f3;}
  .badge:nth-child(3n+1) {background:#fff7dd;border-color:#f4dea4;}
  .badge:nth-child(3n+2) {background:#e9f9f3;border-color:#b7e6d4;}
  .section-heading {padding-top:25px;}
  .section-heading h1 {color:#293a85;}
  .settings-form,.game-card,.results-card {border:2px solid #e3e4f6;border-radius:29px;box-shadow:0 9px 0 rgba(85,97,164,.055),var(--shadow);}
  .settings-form {background:linear-gradient(175deg,#fff,#fff 75%,#f9faff);}
  .setting-panel {border:2px dashed #d6d7f6;background:#fafaff;border-radius:22px;}
  .setting-panel legend {color:#4c4da6;}
  .choice-pill span,.table-chip span {transition:transform .16s ease,background .16s ease;}
  .choice-pill input:checked+span,.table-chip input:checked+span {background:#e6e9ff;border-color:#6265d1;color:#34349a;box-shadow:0 3px 0 #c3c8f9;}
  .choice-pill:hover span,.table-chip:hover span {transform:translateY(-2px);}
  .info-panel,.tip {background:#fff6df;border:1px solid #f5e1a9;color:#685330;}
  .game-stats {background:#f0f3ff;border:1px solid #e0e7fe;border-radius:18px;}
  .stat:nth-child(2) {color:#138459;}.stat:nth-child(3) {color:#cf4365;}
  .progress-track {height:15px;background:#e8e8ff;}
  .progress-track>div {background:linear-gradient(90deg,#49c7bd,#6375ed);}
  .question-area {position:relative;min-height:175px;margin:10px 0 17px;border:2px dashed #ddd4fd;border-radius:27px;background:radial-gradient(circle at 10% 12%,#fff2d9,transparent 30%),radial-gradient(circle at 90% 89%,#e5f7fb,transparent 37%),#fdfbff;}
  .math-question {color:#333d9c;}
  .answer-value {background:#fffef8;border-color:#b8bef5;border-radius:19px;box-shadow:0 4px 0 #e3e5fa;}
  .keypad button {background:#f9f9ff;border-radius:17px;border-color:#dfe3f8;box-shadow:0 3px 0 #e1e6f5;}
  .keypad .key-submit {background:#4556c7;border-color:#4556c7;box-shadow:0 3px 0 #293c99;}
  .answer-option {border-radius:22px;box-shadow:0 5px 0 #d9dbf8;}
  .result-number {border-radius:18px;background:#f1f3ff;}
  .result-number:nth-child(2n) {background:#f0fbf5;}
  .result-number:nth-child(3n) {background:#fff3e2;}
  .results-card .trophy {display:inline-grid;place-items:center;width:84px;height:84px;border-radius:50%;background:#fff2cb;box-shadow:0 6px 0 #f5dfa5;}
  .pirate-shell {border-radius:32px;}
  #print .section-heading .tip {margin-top:15px;}
  .print-pages {display:grid;gap:0;justify-items:center;}
  .sheet {border:1px solid #e4e4f1;box-shadow:0 10px 0 #e9e8f7,0 20px 35px rgba(60,58,111,.12);}
}
/* Printervriendelijke A4-layout (ook zichtbaar in schermvoorbeelden). */
.sheet {--page-accent:#5969d4;--page-pale:#f0f1ff;--page-ink:#3342a1;isolation:isolate;}
.sheet-visual {--page-accent:#19a889;--page-pale:#edfcf5;--page-ink:#176852;}
.sheet-fraction {--page-accent:#ed9061;--page-pale:#fff2e9;--page-ink:#a1542e;}
.sheet-split {--page-accent:#9263c5;--page-pale:#f6efff;--page-ink:#7447a8;}
.sheet.sheet-math {--page-accent:#5667d6;--page-pale:#eef1ff;--page-ink:#37479e;}
.sheet.sheet-answers {--page-accent:#289d83;--page-pale:#edf9f3;--page-ink:#217760;}
.sheet::before {content:'';position:absolute;left:0;right:0;top:0;height:4mm;background:repeating-linear-gradient(110deg,var(--page-accent) 0,var(--page-accent) 16mm,#ffcf67 16mm,#ffcf67 21mm,#eb8da5 21mm,#eb8da5 26mm,#93d8d1 26mm,#93d8d1 31mm);}
.sheet-head {position:relative;min-height:33mm;margin-bottom:5mm;border:0;border-radius:12px;background:linear-gradient(115deg,var(--page-pale),#fff);padding:6mm 6mm 3mm;overflow:hidden;}
.sheet-head::before {content:'✦';position:absolute;right:12mm;top:2mm;color:var(--page-accent);opacity:.16;font-size:58px;line-height:1;transform:rotate(-10deg);pointer-events:none;}
.sheet-head::after {content:'✳';position:absolute;right:3mm;top:13mm;color:#eea54a;opacity:.5;font-size:23px;pointer-events:none;}
.sheet-kicker {display:block;color:var(--page-ink);text-transform:uppercase;letter-spacing:1.5px;font-weight:900;font-size:9px;margin-bottom:2px;}
.sheet-title {color:var(--page-ink);font-family:'Trebuchet MS',Arial,Helvetica,sans-serif;font-weight:900;letter-spacing:-.8px;font-size:27px;line-height:1.15;}
.sheet-subtitle {margin:4px 0 8px;color:#64708a;font-weight:700;font-size:12px;}
.sheet-meta {display:flex;gap:12px;font-size:12px;color:#3d4762;}
.sheet-meta span {min-width:0;flex:1;background:rgba(255,255,255,.82);border:1px dashed #bfc5e5;padding:6px 10px;border-radius:9px;overflow-wrap:anywhere;}
.sheet-meta span:last-child {flex:0 0 39%;}
.sheet-foot {display:flex;justify-content:center;align-items:center;gap:10px;padding-top:3mm;border-top:1px dashed #dcdfee;color:#69718e;font-weight:700;}
.sheet-foot::before,.sheet-foot::after {content:'✦';color:var(--page-accent);font-size:14px;}
.exercise-number {flex:none;display:grid;place-items:center;width:22px;height:22px;min-width:22px;border-radius:50%;background:var(--page-pale);color:var(--page-ink);font-size:11px;font-weight:900;}
.math-sheet-grid {gap:2.2mm 3.4mm;}
.math-sheet-item {height:14mm;min-height:0;padding:2mm 1.8mm;gap:6px;border:1px solid #e8eaf5;border-radius:9px;background:#fff;font-size:16px;}
.math-sheet-item:nth-child(2n) {background:var(--page-pale);}
.math-sheet-item .exercise-formula {font-weight:900;}
.math-sheet-item .exercise-blank {border-bottom:2px dashed #a6abc4;min-width:14px;height:12px;}
.math-sheet-item .exercise-answer {color:#218668;}
.split-sheet-grid {gap:1.5mm 3mm;}
.split-sheet-item {border:1px solid #e9e3f5;border-radius:11px;background:#fff;padding:2mm;}
.split-sheet-item:nth-child(2n) {background:var(--page-pale);}
.split-sheet-item .exercise-number {align-self:flex-start;margin-top:1mm;}
.split-sheet-item .split-box {background:#f5f0ff;border-color:#b4a1dd;}
.split-sheet-item .split-box.blank {background:white;border-color:#7f65bd;}
.visual-sheet-grid,.fraction-sheet-grid {gap:2mm 4mm;}
.visual-sheet-item,.fraction-sheet-item {background:#fff;border:1px solid #e5eaf3;border-radius:11px;padding:2.3mm;gap:4px;}
.visual-sheet-item:nth-child(2n),.fraction-sheet-item:nth-child(2n) {background:var(--page-pale);}
.visual-sheet-item .exercise-number,.fraction-sheet-item .exercise-number {align-self:start;margin-top:2px;}
.print-question-label {color:var(--page-ink);}
/* Bij vergelijken hebben kinderen ruimte om Links/Rechts/Evenveel aan te kruisen. */
.visual-compare-item {grid-template-columns:17px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;align-items:center;}
.visual-compare-item .exercise-number {grid-column:1;grid-row:1;}
.visual-compare-item .print-problem {grid-column:2;grid-row:1;max-height:100%;}
.visual-compare-item .print-answer-blank {grid-column:2;grid-row:2;align-self:end;justify-self:start;min-height:0;padding:2px 0 3px;border:0;text-align:left;font-size:9px;color:var(--page-ink);font-weight:900;white-space:nowrap;}

.print-answer-blank {border-bottom:2px dashed #afb3c7;color:#5e6476;}
.print-solution {color:#178466;}
/* Extra inhoudsruimte voor grotere aantallen oefeningen, zonder afsnijden. */
.sheet-count-10 .math-sheet-item {height:19mm;}
.sheet-count-20 .math-sheet-item {height:17mm;}
.sheet-count-30 .math-sheet-item {height:16mm;}
.sheet-count-40 .math-sheet-item {height:13mm;}
.sheet-count-50 .math-sheet-item {height:11mm;}
.sheet.monochrome {--page-accent:#444;--page-pale:#fff;--page-ink:#222;}
.sheet.monochrome::before {background:repeating-linear-gradient(90deg,#404040 0 18mm,#aaa 18mm 24mm,#fff 24mm 27mm);}
.sheet.monochrome .sheet-head {background:#fff;border:1.5px solid #555;}
.sheet.monochrome .sheet-meta span,.sheet.monochrome .math-sheet-item,.sheet.monochrome .split-sheet-item,.sheet.monochrome .visual-sheet-item,.sheet.monochrome .fraction-sheet-item {background:#fff;border-color:#888;}
.sheet.monochrome .exercise-number {background:#fff;border:1px solid #777;color:#222;}
.sheet.monochrome .print-solution,.sheet.monochrome .exercise-answer {color:#111;}
@media screen and (max-width:850px) {
  .hero {padding:36px 45px;}
  .hero::before {left:4px;opacity:.3;}.hero::after {right:0;opacity:.3;}
  .choice-card {padding:22px;}
  .choice-icon {width:67px;height:67px;}
}
@media screen and (max-width:650px) {
  .site-header {padding:13px 0 17px;}
  .brand span {height:43px;width:43px;font-size:25px;}
  .hero {border-radius:26px;padding:31px 21px 30px;margin:0 auto 19px;}
  .hero::before {font-size:45px;left:9px;top:14px;opacity:.23;}
  .hero::after {font-size:52px;right:7px;bottom:4px;opacity:.22;}
  .hero h1 {font-size:clamp(32px,8vw,44px);letter-spacing:-1.4px;margin:17px 0 15px;}
  .hero p {font-size:15px;line-height:1.55;}
  .hero .eyebrow {font-size:10px;letter-spacing:.4px;}
  .choice-card {padding:21px 19px;min-height:0;}
  .featured-details {gap:14px;}
  .featured-details h2 {font-size:22px;}
  .featured-details p {font-size:14px;}
  .choice-icon {width:60px;height:60px;font-size:31px;border-radius:19px;}
  .module-actions .btn {flex:1 1 125px;padding:11px 10px;font-size:14px;}
  .choice-card.pirate-home-card {grid-template-columns:auto 1fr;grid-template-rows:auto auto auto;column-gap:15px;min-height:0;padding:23px 20px;}
  .pirate-home-card .choice-icon {grid-row:1/3;}
  .pirate-home-card strong {grid-column:2;font-size:21px;}
  .pirate-home-card>span:nth-of-type(2) {grid-column:2;grid-row:2;font-size:14px;}
  .pirate-home-card .choice-link {grid-column:1/-1;grid-row:3;justify-self:stretch;text-align:center;margin-top:8px;}
  .dashboard {padding:23px 20px;}
  .settings-form {padding:22px 17px;}
  .game-card {padding:18px 14px;}
  .question-area {min-height:150px;}
  .print-pages {display:block;}
  .sheet {width:100%;max-width:100%;height:auto;min-height:0;overflow:visible;padding:17px 13px;}
  .sheet::before {height:5px;}
  .sheet-head {padding:17px 13px 13px;min-height:0;}
  .sheet-title {font-size:22px;}
  .sheet-kicker {font-size:8px;}
  .sheet-meta {flex-wrap:wrap;gap:6px;}
  .sheet-meta span,.sheet-meta span:last-child {flex:1 1 100%;}
  .math-sheet-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .math-sheet-item,.sheet-count-10 .math-sheet-item,.sheet-count-20 .math-sheet-item,.sheet-count-30 .math-sheet-item,.sheet-count-40 .math-sheet-item,.sheet-count-50 .math-sheet-item {height:45px;font-size:13px;padding:6px 5px;gap:3px;}
  .exercise-number {width:20px;height:20px;min-width:20px;font-size:10px;}
  .split-sheet-grid {grid-template-columns:1fr;grid-auto-rows:77px;}
  .visual-sheet-grid,.fraction-sheet-grid {grid-template-columns:1fr;}
  .visual-sheet-item {min-height:138px;}.fraction-sheet-item {min-height:110px;}
  .sheet-foot {margin-top:20px;}
}
@media print {
  html,body {background:white!important;print-color-adjust:exact;-webkit-print-color-adjust:exact;}
  .sheet {width:190mm;height:277mm;min-height:0;max-width:none;margin:0;padding:5.5mm 4.5mm 4mm;border:0;border-radius:0;overflow:hidden;box-shadow:none;}
  .sheet::before {height:2.8mm;}
  .sheet-head {min-height:35mm;margin-bottom:4.5mm;padding:5mm 5mm 3mm;border-radius:8px;}
  .sheet-head::before {font-size:47px;}
  .sheet-title {font-size:22pt;}
  .sheet-subtitle {font-size:9pt;margin:1mm 0 2mm;}
  .sheet-meta {font-size:9pt;}
  .sheet-meta span {padding:1.6mm 2.5mm;}
  .sheet-kicker {font-size:8pt;}
  .sheet-foot {font-size:8pt;padding:2mm 0 0;}
  .exercise-number {min-width:6.2mm;width:6.2mm;height:6.2mm;font-size:8pt;}
  .math-sheet-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:1.8mm 3mm;}
  .math-sheet-item {font-size:12.6pt;border-radius:7px;padding:1mm;}
  .sheet-count-10 .math-sheet-item {height:19mm;}
  .sheet-count-20 .math-sheet-item {height:17mm;}
  .sheet-count-30 .math-sheet-item {height:15mm;}
  .sheet-count-40 .math-sheet-item {height:12.5mm;}
  .sheet-count-50 .math-sheet-item {height:10.5mm;font-size:11.7pt;}
  .split-sheet-grid {grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:20.4mm;gap:1mm 3mm;}
  .split-sheet-item {gap:1mm;padding:1mm 1mm;}
  .split-sheet-item .split-diagram {transform:scale(.84);transform-origin:left center;}
  .sheet-visual .sheet-head,.sheet-fraction .sheet-head {min-height:35mm;margin-bottom:4.5mm;}
  .sheet-visual .visual-sheet-grid {grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:39mm;gap:1.8mm 3.5mm;}
  .sheet-fraction .fraction-sheet-grid {grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:24.5mm;gap:1.6mm 3.5mm;}
  .sheet-visual .visual-sheet-item {grid-template-columns:6mm minmax(0,1fr) 19mm;}
  .sheet-visual .visual-compare-item {grid-template-columns:6mm minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;}
  .sheet-visual .visual-compare-item .print-answer-blank {font-size:8pt;padding-bottom:.5mm;}

  .sheet-fraction .fraction-sheet-item {grid-template-columns:6mm minmax(0,1fr) 17mm;}
  .visual-sheet-item,.fraction-sheet-item {padding:1.6mm;}
  .sheet-visual .sheet-title,.sheet-fraction .sheet-title {font-size:22pt;}
  .sheet.monochrome .sheet-head::before,.sheet.monochrome .sheet-head::after {color:#555;}
}
@media (prefers-reduced-motion:reduce) {
  .choice-card:hover,.choice-pill:hover span,.table-chip:hover span {transform:none;}
}
