/* K-5 hands-on questions (k5drag.js). */
.kd { position: relative; text-align: center; }
.kd-say { font-size: .95rem; color: var(--muted); min-height: 1.3em; margin: 0 0 6px; line-height: 1.35; }
.kd-ok { color: var(--good); }
.kd-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 4px; }
.kd-ten { display: grid; grid-template-columns: repeat(5, 34px); grid-template-rows: repeat(2, 34px); border: 3px solid var(--k5b); border-radius: 6px; background: rgba(200, 54, 106, .06); }
.kd-cell { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.kd-tray { display: flex; gap: 8px; min-height: 30px; flex-wrap: wrap; justify-content: center; }
.kd-dot { width: 24px; height: 24px; border-radius: 50%; display: inline-block; touch-action: none; user-select: none; -webkit-user-select: none; }
.kd-dot.red { background: var(--k5b); }
.kd-dot.yel { background: var(--k5a); cursor: grab; }
.kd-dot.yel.fixed { cursor: default; }
.kd-dot.dragging { position: relative; z-index: 5; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.kd-stage.small { transform: scale(.8); margin: -10px 0 -14px; }
.kd-eq { margin-top: 6px; }
.kd-eq-row { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.5rem; font-weight: 700; }
.kd-eq-mark { font-size: .9rem; color: var(--muted); font-weight: 600; }
.kd-eq p { color: var(--muted); margin: 8px 0; }
.kd-next { margin-top: 6px; }
.kd-off { font-size: .9rem; }
.kd-grid { display: inline-grid; gap: 7px; padding: 6px; touch-action: none; user-select: none; -webkit-user-select: none; }
.kd-grid .kd-dot { width: 26px; height: 26px; cursor: pointer; transition: background-color .15s; }
.kd-grid .kd-dot.sel { outline: 3px solid var(--ink); outline-offset: 1px; }
.kd-dot.g0 { background: #e4572e; } .kd-dot.g1 { background: #2e86de; } .kd-dot.g2 { background: #10ac84; } .kd-dot.g3 { background: #8e44ad; }
.kd-dot.g4 { background: #f39c12; } .kd-dot.g5 { background: #e84393; } .kd-dot.g6 { background: #00a8b5; } .kd-dot.g7 { background: #7f8c8d; }
.kd-tools .btn { width: auto; display: inline-block; min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.kd-padbox table.eqs small { font-size: .7rem; color: var(--muted); font-weight: 600; }
/* Place value blocks */
.kb-tray { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.kb-src { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding: 6px 8px; border: 2px dashed var(--line); border-radius: 10px; min-width: 52px; }
.kb-src small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.kb-src .kb { cursor: grab; }
.kb-chart { display: flex; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.kb-col { flex: 1; min-width: 0; border-left: 2px solid var(--line); display: flex; flex-direction: column; }
.kb-col:first-child { border-left: 0; }
.kb-head { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 2px; border-bottom: 2px solid var(--line); }
.kb-zone { min-height: 96px; padding: 6px 4px; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 5px; }
.kb-col.kb-no { animation: kb-shake .35s; background: rgba(255, 90, 90, .12); }
@keyframes kb-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.kb { display: inline-block; box-sizing: border-box; touch-action: none; }
.kb-o { width: 13px; height: 13px; background: var(--k5b); border: 1.5px solid var(--ink); border-radius: 2px; }
.kb-t { width: 13px; height: 62px; background-color: var(--k5a); background-image: linear-gradient(to bottom, transparent calc(100% - 1px), rgba(0, 0, 0, .35) calc(100% - 1px)); background-size: 100% 10%; /* always 10 units, whatever the height */ border: 1.5px solid var(--ink); border-radius: 2px; }
.kb-h { width: 36px; height: 36px; background-color: #7fb4e6; background-image: linear-gradient(to right, transparent calc(100% - 1px), rgba(0, 0, 0, .3) calc(100% - 1px)), linear-gradient(to bottom, transparent calc(100% - 1px), rgba(0, 0, 0, .3) calc(100% - 1px)); background-size: 10% 10%; /* a 10 by 10 grid at any size */ border: 1.5px solid var(--ink); border-radius: 2px; }
.kb-th { width: 36px; height: 36px; background: #10ac84; border: 1.5px solid var(--ink); border-radius: 2px; box-shadow: 4px -4px 0 -1.5px #0b7d61, 4px -4px 0 0 var(--ink); margin: 4px 4px 0 0; }
.kb.b.kb-o { background: #f2b84b; } .kb.b.kb-t { background-color: #ffd98a; } .kb.b.kb-h { background-color: #a9d0f5; }
.kb.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.kb.ghost { position: absolute; z-index: 10; pointer-events: none; margin: 0; }
.kb.pop { animation: kb-pop .3s ease-out; }
@keyframes kb-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.kd.locked .kb-src { opacity: .5; }
/* Phones: smaller blocks so the chart and the Check button fit on one screen. */
@media (max-width: 480px) {
  .kb-chart:not(.pic) .kb-col:nth-last-child(2) { flex: 1.5; }
  .kb-zone { min-height: 70px; gap: 4px; }
  .kb-h, .kb-th { width: 24px; height: 24px; }
  .kb-th { box-shadow: 3px -3px 0 -1.5px #0b7d61, 3px -3px 0 0 var(--ink); margin: 3px 3px 0 0; }
  .kb-zone { padding: 5px 3px; }
  .kb-src { padding: 4px 6px; }
  .kd-say { font-size: .88rem; }
  .kb-t { height: 38px; width: 11px; }
  .kb-o { width: 11px; height: 11px; }
}

.kb-tray { margin-top: 8px; }
/* The picture chart (read the blocks): every column shares the card's width equally, at any screen size, so the
   ones column never gets pushed out of view. Blocks are small enough for 9 of each in a quarter of a phone width. */
.kb-chart.pic { display: flex; width: 100%; max-width: 440px; margin: 8px auto 0; }
.kb-chart.pic .kb-col { flex: 1 1 0; min-width: 0; }
.kb-chart.pic .kb-head { font-size: .6rem; letter-spacing: 0; }
.kb-chart.pic .kb-zone { min-height: 0; gap: 3px; padding: 5px 2px; }
.kb-chart.pic .kb-h, .kb-chart.pic .kb-th { width: 21px; height: 21px; }
.kb-chart.pic .kb-th { box-shadow: 3px -3px 0 -1.5px #0b7d61, 3px -3px 0 0 var(--ink); margin: 3px 3px 0 0; }
.kb-chart.pic .kb-t { height: 42px; width: 9px; }
.kb-chart.pic .kb-o { width: 11px; height: 11px; }
