/* Counting Drag (Math, counting piece 4). Number and grid on the left, 20 pictures on the right (stacked on a phone). Every tap target is 44 px or more. */
.cd-intro { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.cd-piko { width: 84px; height: auto; flex: none; }
.cd-screen h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 4px 0 6px; }
.cd-tip { margin: 0; color: var(--muted); font-weight: 700; }
.cd-screen .game-topbar .btn { min-height: 44px; min-width: 44px; }
.cd-prompt { margin: 0 0 12px; color: var(--muted); font-weight: 800; text-align: center; }
.cd-play { background: var(--paper); border: 2px solid var(--border); border-radius: 18px; padding: 16px; }
.cd-board { display: grid; grid-template-columns: minmax(300px, 5fr) 6fr; gap: 16px; align-items: stretch; }
.cd-left { position: relative; background: white; border: 4px solid var(--blue-action); border-radius: 18px; padding: 12px; }
.cd-number { margin: 0 0 8px; text-align: center; font-weight: 900; font-size: clamp(3rem, 6vw, 4.2rem); line-height: 1; color: var(--ink); }
.cd-grid { max-width: 340px; margin: 0 auto; display: grid; grid-template-columns: repeat(var(--rowspots, 5), minmax(0, 1fr)); gap: 6px; }
.cd-spot { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; min-height: 44px; border: 2px dashed var(--border); border-radius: 10px; background: var(--sky); }
.cd-rightzone { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 8px; padding: 12px; border: 4px dashed var(--border); border-radius: 18px; background: #fffdf3; min-height: 160px; }
.cd-pic { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; padding: 2px; border: 2px solid transparent; border-radius: 12px; background: transparent; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cd-spot .cd-pic { width: 100%; height: 100%; min-width: 44px; min-height: 44px; }
.cd-pic img { width: 100%; height: 100%; pointer-events: none; }
.cd-pic:hover, .cd-pic:focus-visible { border-color: var(--blue-action); background: var(--sky); }
.cd-pic.cd-lifted { opacity: .3; }
.cd-ghost { position: fixed; z-index: 9999; transform: translate(-50%, -50%); pointer-events: none; opacity: .9; background: white; border-color: var(--ink); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.cd-badge { position: absolute; top: -14px; right: 12px; padding: 4px 12px; border-radius: 999px; background: #c4001f; color: white; font-weight: 900; font-size: 1.05rem; }
.cd-badge-ok { background: var(--green-dark); }
/* A wrong count is loud: thick red border, red tint, a "Too many / Too few" tag with a cross (not colour alone), a short shake. It stays until the child's next tap. */
.cd-left.cd-wrong { border-color: #c4001f; background: #fff0f0; animation: cd-shake .4s; }
.cd-left.cd-right { border-color: var(--green-dark); background: #e6f6ec; }
.cd-left.cd-revealed { border-color: var(--ink); }
.cd-foot { position: sticky; bottom: 0; z-index: 5; margin-top: 12px; padding: 8px 0 6px; background: var(--paper); border-top: 2px solid var(--border); }  /* Check stays on screen while the child drags */
.cd-feedback { min-height: 2.6em; margin: 0 0 6px; text-align: center; font-weight: 800; font-size: 1.15rem; }
.cd-feedback:empty { min-height: 0; margin: 0; }
.cd-feedback-wrong { padding: 8px 14px; border: 3px solid #c4001f; border-radius: 14px; background: #fff0f0; color: #8a0018; }
.cd-earned { margin: 0 0 8px; text-align: center; font-weight: 900; color: var(--green-dark); font-size: 1.2rem; }
.cd-actions { display: flex; justify-content: center; }
.cd-action { min-width: 170px; min-height: 56px; font-size: 1.2rem; }
.cd-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cd-level { min-height: 56px; font-size: 1.1rem; }
.cd-end { text-align: center; }
.cd-end-piko { width: 140px; height: auto; }
.cd-total { font-size: 1.6rem; font-weight: 900; color: var(--green-dark); margin: 6px 0 14px; }
.cd-hint-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.cd-hint-used { margin: 0; font-size: 1.4rem; font-weight: 900; }
.cd-hint-text, .cd-help-text { font-size: 1.3rem; font-weight: 700; line-height: 1.5; max-width: 46em; }
.cd-hint-stars { display: flex; gap: 14px; flex-wrap: wrap; }
.cd-hint-star { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.cd-hint-star img { width: 64px; height: 64px; }
.cd-hint-star b { font-size: 1.6rem; }
@keyframes cd-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .cd-left.cd-wrong { animation: none; } }
@media (max-width: 800px) {
  .cd-board { grid-template-columns: 1fr; }
  .cd-piko { width: 56px; }
  .cd-play { padding: 10px; }
  .cd-number { font-size: 2.6rem; margin-bottom: 4px; }
  .cd-feedback { font-size: .98rem; min-height: 0; }
  .cd-foot { padding: 4px 0; margin-top: 8px; }
  .cd-action { min-height: 48px; }
  .cd-earned { margin: 0 0 4px; font-size: 1rem; }
  .cd-pic { width: 48px; height: 48px; }
  .cd-rightzone { gap: 6px; padding: 8px; min-height: 120px; }
}
