/* "Array sorting and mapping in JavaScript" (public/play/js-sortmap.js). Builds on pygames.css (pg-*) and jsintro.css (ji-*). */
.sm .pg-btn.small{padding:4px 12px;font-size:.9rem}
.sm-line{margin:10px 0;white-space:pre-wrap}
/* the shelf of items (names, scores, labels) */
.sm-shelf{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0;padding:12px;border:3px dashed #c5bdf0;border-radius:16px;background:#faf8ff;min-height:64px}
.sm-item{display:grid;place-items:center;min-width:70px;padding:10px 14px;border:3px solid #1b1340;border-radius:14px;background:#fff;box-shadow:3px 3px 0 #1b1340;font-weight:800;font-size:1.05rem;color:#1b1340}
.sm-item small{font-weight:600;font-size:.72rem;color:#6b6790}
.sm-item.num{background:#e7f5ff}.sm-item mark{background:#ffe066;border-radius:4px;padding:0 2px}
.sm-shelf.moved .sm-item,.sm-shelf.flip .sm-item{animation:sm-hop .45s calc(var(--i) * 70ms) both cubic-bezier(.34,1.56,.64,1)}
.sm-shelf.flip .sm-item{animation-name:sm-flip}
.sm-shelf.new{background:#ebfbee;border-color:#8ce99a}
.sm-item.stamped{background:#fff9db;animation:sm-stamp .35s both cubic-bezier(.34,1.56,.64,1)}
.sm-item.undef{background:#fff0f6;color:#c2255c;font-style:italic}
.sm-codes{font:600 .85rem ui-monospace,Consolas,monospace;color:#5c5f66}
.sm-label{margin:10px 0 0;font-size:.78rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#6b6790}
.sm-same{margin:0;color:#2b8a3e;font-weight:800}
.sm-why{margin:6px 0;padding:8px 12px;border-left:4px solid #7048e8;border-radius:8px;background:#f3f0ff}
.sm-choices .pg-btn{display:grid;gap:2px;text-align:left}.sm-choices .pg-btn small{font-weight:600;opacity:.8}
.sm-pickers label{display:flex;align-items:center;gap:6px;font-weight:800}
.sm-machine-out{margin:10px 0;padding:10px 12px;border:3px solid #1b1340;border-radius:14px;background:#fff;min-height:48px}
.sm-machine-out code{font-size:.85rem;color:#5f3dc4}.sm-machine-out p{margin:6px 0 0}
.sm-rules{margin:8px 0 0;padding-left:1.2rem}
.sm-table{width:100%;border-collapse:collapse;margin-top:6px;background:#fff;border-radius:12px;overflow:hidden}
.sm-table th,.sm-table td{padding:8px 10px;border:2px solid #1b1340;text-align:left}.sm-table th{background:#ffe066}
/* the student's page in the preview: their class="card" becomes u-card */
.sm-view .u-card{margin:10px 0;padding:12px 14px;border:2px solid #d0bfff;border-radius:14px;background:#fff;box-shadow:0 3px 10px rgba(80,60,160,.08)}
.sm-view .u-card h3{margin:0 0 8px;color:#5f3dc4}
.sm-view button{margin:0 6px 6px 0;padding:6px 12px;border:0;border-radius:8px;background:#4c6ef5;color:#fff;font-weight:700;cursor:pointer}
.sm-view button:hover{background:#3b5bdb}
.sm-view p{margin:6px 0}
/* wrap-up */
.sm-remember{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.sm-rcard{padding:12px;border:3px solid #1b1340;border-radius:14px;background:#fff;box-shadow:3px 3px 0 #1b1340}.sm-rcard p{margin:6px 0 0}
.sm-quiz{display:grid;gap:14px}.sm-q p{margin:0 0 6px}
.sm-qchoices{display:flex;flex-wrap:wrap;gap:8px}
.sm-sol{margin-top:10px}.sm-sol summary{cursor:pointer;font-weight:800}
@keyframes sm-hop{0%{transform:translateY(-14px) scale(.9);opacity:.3}100%{transform:none;opacity:1}}
@keyframes sm-flip{0%{transform:rotateY(90deg)}100%{transform:none}}
@keyframes sm-stamp{0%{transform:scale(1.6) rotate(-8deg);opacity:0}100%{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.sm-shelf .sm-item,.sm-item.stamped{animation:none}}
