/* Two-frame lessons use the same dots, with a bounded responsive layout. */
.ten-frame-stage.is-ten-and-more{display:grid;grid-template-rows:60px minmax(0,1fr) 56px;gap:8px;padding:12px;overflow:hidden}
.is-ten-and-more[hidden],.is-ten-and-more [hidden]{display:none!important}
.is-ten-and-more .ten-frame-list{grid-row:2;gap:clamp(10px,3cqw,38px);width:auto;align-self:center}
.is-ten-and-more .ten-frame-unit{gap:6px}
.is-ten-and-more .ten-frame-grid{padding:5px;gap:3px;border-width:2px;border-radius:14px}
.is-ten-and-more .ten-frame-cell{width:var(--ten-more-cell,40px);height:var(--ten-more-cell,40px);transition:none}
.is-ten-and-more .ten-frame-dot,.is-ten-and-more .ten-frame-empty-dot{width:88%;border-width:3px}
.is-ten-and-more .ten-frame-dot{background:linear-gradient(110deg,#ff7979,#ff2020);border-color:transparent}
.ten-more-heading{grid-row:1;display:flex;align-items:center;justify-content:center;gap:20px;min-height:48px}
.ten-more-target{font-size:clamp(20px,4cqw,32px);font-weight:600;padding:6px 16px;border:1px solid #dcdce9;border-radius:12px}
.ten-more-total{font-size:clamp(24px,5cqw,42px);min-width:2ch;text-align:center;font-variant-numeric:tabular-nums}
.ten-more-label{height:28px;font-size:24px;line-height:28px;text-align:center;font-variant-numeric:tabular-nums}
.ten-more-controls{grid-row:3;display:flex;align-items:center;justify-content:center;gap:12px}
.ten-more-controls button{font:inherit;font-weight:600;font-size:18px;min-width:48px;height:48px;padding:0 18px;border:1px solid #d8d9eb;border-radius:14px;background:#f0f1ff;color:#292856;cursor:pointer;transition:background .18s ease}
.ten-more-controls button:hover{background:#e0e4ff;transform:none}
.ten-more-controls button:disabled{opacity:.35;cursor:default}
.ten-more-controls button:focus-visible{outline:3px solid #647aff;outline-offset:3px}
.is-ten-and-more .is-cued,.is-ten-and-more .is-ten-more-cued{outline:3px solid #ffcf00;outline-offset:3px;border-radius:12px}
.is-ten-and-more .is-ten-more-cued .ten-frame-dot{border-color:#ffcf00}
.ten-more-digits{grid-row:2;font-size:clamp(70px,20cqw,200px);font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:.03em}
.ten-more-digits .is-tens{color:#ff4a4a}.ten-more-digits .is-ones{color:#037bfc}
.ten-more-celebration{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.ten-more-celebration span{position:absolute;left:50%;top:50%;width:12px;height:12px;border-radius:3px;background:var(--particle-color)}
/* Final Ten Frame presentation: faithful to the supplied flat reference. */
.ten-frame-stage.has-side-score{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:clamp(12px,3cqw,40px)}
.ten-frame-stage.has-side-score>.ten-frame-score{order:2;flex:none;min-width:2ch}
.ten-frame-stage.has-side-score>.ten-frame-list{flex:0 1 auto;min-width:0}
.ten-frame-stage.has-side-score>.ten-frame-score{align-self:center}
.ten-frame-stage.has-side-machine>.ten-frame-machine{position:static;order:1;flex:none;width:clamp(40px,7cqw,98px);height:clamp(40px,7cqw,98px);border:0!important;border-radius:0;background:transparent!important;box-shadow:none!important;padding:0}
.ten-frame-stage.has-side-machine>.ten-frame-machine:disabled{opacity:.35;cursor:default}
.ten-frame-cell.is-empty-cued .ten-frame-empty-dot,.ten-frame-cell.is-empty-cued .ten-frame-add{animation:ten-frame-tutor-cue 1.25s ease-in-out infinite;outline:3px solid #7857e6;outline-offset:3px}
.ten-frame-stage.is-full-cued .ten-frame-grid{outline:3px solid #7857e6;outline-offset:4px}
.guide-text-form{display:flex;flex-wrap:wrap;gap:10px;max-width:100%}
.guide-text-form input{min-width:0;width:10ch;flex:1 1 120px;font:inherit;padding:12px;border-radius:12px;border:1px solid #ffffff50;background:#ffffff20;color:#fff}
.guide-text-form input::placeholder{color:#ffffffa0}
@media(prefers-reduced-motion:reduce){.ten-frame-cell.is-empty-cued .ten-frame-empty-dot,.ten-frame-cell.is-empty-cued .ten-frame-add{animation:none}}
.ten-frame-stage.is-paint-activity{position:relative}
.ten-frame-stage.is-paint-activity .ten-frame-dot.is-unpainted:not(.is-highlighted){border-color:#dedee4!important;background:transparent}
.ten-frame-stage.is-paint-activity .ten-frame-dot{transition:background-color .28s ease,border-color .2s ease,transform .4s ease,opacity .4s ease}
.ten-frame-stage.is-paint-activity .ten-frame-dot.is-paint-hidden{opacity:0;transform:translateX(-35px) scale(.7);pointer-events:none}
.ten-frame-paint-tool{position:absolute;bottom:max(8px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid #dddde6;border-radius:14px;background:#fff;color:#252348;font:600 14px/1.2 system-ui,sans-serif;white-space:nowrap}
.ten-frame-paint-tool[hidden]{display:none}
.ten-frame-paint-swatch{width:22px;height:22px;border-radius:50%;background:var(--paint-color);border:1px solid #00000012}
.ten-frame-paint-tool.is-cued .ten-frame-paint-swatch{animation:ten-frame-tutor-cue 1.25s ease-in-out infinite}
.ten-frame-dot.is-kept{border-color:#7857e6!important}
@media(max-height:600px) and (orientation:landscape){.ten-frame-paint-tool{left:auto;right:8px;bottom:8px;transform:none;font-size:12px;padding:5px 7px}}
.ten-frame-dot.is-tutor-cue{animation:ten-frame-tutor-cue 1.25s ease-in-out infinite}
@keyframes ten-frame-tutor-cue{50%{transform:scale(1.045);filter:brightness(1.12)}}
@media(prefers-reduced-motion:reduce){.ten-frame-dot.is-tutor-cue{animation:none}}
/* Lesson-only scattered arrangement: safe inset, same cell size, no empty outlines. */
.ten-frame-stage.is-scattered .ten-frame-grid{grid-template-columns:repeat(3,var(--ten-frame-cell-size,125px));grid-template-rows:repeat(3,var(--ten-frame-cell-size,125px));gap:clamp(8px,2vmin,20px)}
.ten-frame-stage.is-scattered .ten-frame-cell:nth-child(1){grid-column:1;grid-row:3;transform:translateY(-8%)}
.ten-frame-stage.is-scattered .ten-frame-cell:nth-child(2){grid-column:3;grid-row:3;transform:translateY(-25%)}
.ten-frame-stage.is-scattered .ten-frame-cell:nth-child(3){grid-column:3;grid-row:1;transform:translateX(-12%)}
.ten-frame-stage.is-scattered .ten-frame-cell:nth-child(4){grid-column:1;grid-row:1;transform:translate(12%,15%)}
.ten-frame-stage.is-scattered .ten-frame-cell:nth-child(5){grid-column:2;grid-row:2}
.ten-frame-cell{transition:transform .65s cubic-bezier(.22,.7,.2,1)}
.ten-frame-cell.is-count-replay .ten-frame-dot{animation:ten-frame-count-replay .55s ease-out}
@keyframes ten-frame-count-replay{50%{filter:brightness(1.25);transform:scale(1.08)}}
@media(prefers-reduced-motion:reduce){.ten-frame-cell{transition:none}.ten-frame-cell.is-count-replay .ten-frame-dot{animation:none}}
.ten-frame-grid {
  gap: clamp(5px, .9vmin, 9px);
  border-color: #ebebeb;
  border-radius: 18px;
  background: #fff;
}

.ten-frame-grid.has-frame-border {
  border-width: 3px;
}

.ten-frame-dot,
.ten-frame-empty-dot {
  border: clamp(5px, .78vmin, 10px) solid #ebebeb;
  background: var(--ten-frame-dot-color, transparent);
  box-shadow: none !important;
  filter: none;
}

.ten-frame-dot::before,
.ten-frame-dot::after {
  display: none !important;
}

.ten-frame-dot {
  animation: none;
  transition: border-color .24s ease, transform .2s ease;
}

.ten-frame-stage.is-initial-render .ten-frame-dot {
  animation: ten-frame-reference-arrive .5s cubic-bezier(.2, .9, .28, 1.16)
    calc(var(--ten-frame-order, 0) * 38ms) backwards;
}

.ten-frame-dot.is-new,
.ten-frame-dot.is-new.is-highlighted {
  animation: ten-frame-reference-add .58s cubic-bezier(.16, 1.28, .3, 1) both;
}

.ten-frame-dot.is-highlighted {
  border-color: var(--ten-frame-highlight-color, #ffef22);
  animation: ten-frame-reference-highlight .52s cubic-bezier(.2, .9, .3, 1);
}

.ten-frame-stage.is-highlight-border-only .ten-frame-dot:not(.is-highlighted) {
  border-color: transparent;
}

.ten-frame-add {
  animation: none;
  color: #080808;
}

.ten-frame-add:hover:not(:disabled) {
  transform: rotate(2deg);
}

.ten-frame-add:active:not(:disabled) {
  transform: scale(.9);
}

.ten-frame-stage.has-capacity-5.is-five-stack .ten-frame-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.ten-frame-stage.has-capacity-5.is-five-stack .ten-frame-cell:nth-child(1) { grid-column: 1; grid-row: 3; }
.ten-frame-stage.has-capacity-5.is-five-stack .ten-frame-cell:nth-child(2) { grid-column: 2; grid-row: 3; }
.ten-frame-stage.has-capacity-5.is-five-stack .ten-frame-cell:nth-child(3) { grid-column: 2; grid-row: 2; }
.ten-frame-stage.has-capacity-5.is-five-stack .ten-frame-cell:nth-child(4) { grid-column: 1; grid-row: 2; }
.ten-frame-stage.has-capacity-5.is-five-stack .ten-frame-cell:nth-child(5) { grid-column: 2; grid-row: 1; }

.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(1) { grid-column: 1; grid-row: 5; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(2) { grid-column: 2; grid-row: 5; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(3) { grid-column: 2; grid-row: 4; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(4) { grid-column: 1; grid-row: 4; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(5) { grid-column: 2; grid-row: 3; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(6) { grid-column: 1; grid-row: 3; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(7) { grid-column: 2; grid-row: 2; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(8) { grid-column: 1; grid-row: 2; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(9) { grid-column: 2; grid-row: 1; }
.ten-frame-stage.has-capacity-10.is-vertical .ten-frame-cell:nth-child(10) { grid-column: 1; grid-row: 1; }

.ten-frame-empty-dot.is-paintable {
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}

.ten-frame-empty-dot.is-paintable:hover,
.ten-frame-empty-dot.is-paintable:focus-visible {
  border-color: #d6d6d6;
  background: rgba(120, 87, 230, .08);
  outline: none;
}

.ten-frame-empty-dot.is-paintable:focus-visible {
  box-shadow: 0 0 0 4px rgba(120, 87, 230, .22) !important;
}

.ten-frame-score.is-word {
  font-family: var(--math-tutor-font-family, system-ui, sans-serif);
}

.ten-frame-stage > .ten-frame-score {
  box-sizing: border-box;
  min-height: clamp(3.08rem, 9.68vmin, 7.04rem);
}

.ten-frame-score.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}

@keyframes ten-frame-reference-arrive {
  0% { opacity: 0; transform: translateY(16px) scale(.72); }
  72% { opacity: 1; transform: translateY(-2px) scale(1.035); }
  100% { opacity: 1; transform: none; }
}

@keyframes ten-frame-reference-add {
  0% { opacity: 0; transform: scale(.18); }
  58% { opacity: 1; transform: scale(1.12); }
  78% { transform: scale(.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes ten-frame-reference-highlight {
  0% { transform: scale(1); border-color: #ebebeb; }
  52% { transform: scale(1.07); border-color: var(--ten-frame-highlight-color, #ffef22); }
  100% { transform: scale(1); border-color: var(--ten-frame-highlight-color, #ffef22); }
}

@media (max-width: 1200px) and (max-height: 600px) and (orientation: landscape),
  (max-width: 620px) and (orientation: portrait) {
  .ten-frame-stage,
  .ten-frame-stage.has-two-frames {
    --ten-frame-cell-size: 55px;
    --ten-frame-dot-size: 55px;
    grid-template-rows: auto auto;
    align-content: center;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .ten-frame-stage > .ten-frame-score {
    align-self: start;
    min-height: clamp(2rem, 9svh, 3rem);
    font-size: clamp(2rem, 9svh, 3rem);
    line-height: 1;
  }

  .ten-frame-list {
    min-height: max-content;
    flex: none;
  }

  .ten-frame-grid {
    gap: 4px;
    padding: 6px;
    flex: none;
  }

  .ten-frame-dot,
  .ten-frame-empty-dot {
    width: var(--ten-frame-dot-size);
    height: var(--ten-frame-dot-size);
    border-width: 5px;
  }
}

@media (max-width: 1200px) and (max-height: 600px) and (orientation: landscape) {
  .ten-frame-stage,
  .ten-frame-stage.has-two-frames {
    --ten-frame-cell-size: min(55px, 10svh);
    --ten-frame-dot-size: min(55px, 10svh);
    gap: 4px;
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }

  .ten-frame-stage > .ten-frame-score {
    min-height: min(2.5rem, 8svh);
    font-size: min(2.5rem, 8svh);
  }

  .ten-frame-grid {
    gap: min(4px, .8svh);
    padding: min(6px, 1svh);
  }

  .ten-frame-dot,
  .ten-frame-empty-dot {
    border-width: min(5px, 1svh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ten-frame-stage.is-initial-render .ten-frame-dot,
  .ten-frame-dot.is-new,
  .ten-frame-dot.is-new.is-highlighted,
  .ten-frame-dot.is-highlighted {
    animation: none !important;
  }
}
/* Lesson 6 guided recognition: only ten can be selected after support. */
.guide-choices.is-nine-more-guided .guide-choice.is-nine-more-guided-answer{outline:3px solid #3658e8;outline-offset:4px;box-shadow:0 0 0 8px #3658e826}
.guide-choices.is-nine-more-guided .guide-choice:disabled{opacity:.35;cursor:default}
