/* Number Puzzles (assets/play/numpuzzle.js). Band colors = the printable number order puzzles (generator/activities.py). */
.np-loading { padding: 40px; text-align: center; }
.np { --bh: clamp(28px, 5.2vh, 46px); --fw: min(100%, 680px, calc(40vh * var(--pw))); display: flex; flex-direction: column;
  align-items: center; gap: 16px; padding: 4px 0 8px; }
.game:fullscreen .np { --fw: min(100%, 900px, calc(48vh * var(--pw))); }

/* the frame: one slot per strip, the picture faint inside, cut lines dashed like the sheet */
.np-frame { position: relative; display: flex; width: var(--fw); background: #fff; box-shadow: 0 0 0 3px var(--navy, #16264a);
  border-radius: 4px; transition: box-shadow .6s; }
.np-slot { position: relative; flex: 1 1 0; min-width: 0; container-type: inline-size; }
.np-ghost { aspect-ratio: var(--sar); background-repeat: no-repeat; opacity: .16; }
.np-sband { height: var(--bh); display: flex; align-items: center; justify-content: center; background: #f3f6fb;
  border-top: 2px solid rgba(22, 38, 74, .5); color: #aab4c4; font: 800 1rem/1 var(--display, sans-serif); font-size: min(1.9rem, 34cqw); }
.np-slot + .np-slot::after { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; z-index: 2; pointer-events: none;
  border-left: 2px dashed rgba(22, 38, 74, .6); transition: opacity .8s; }
.np-slot.np-next::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  box-shadow: inset 0 0 0 3px #ffd23f, inset 0 0 14px rgba(255, 210, 63, .7); animation: np-next 1.2s ease-in-out infinite; }
.np-slot.np-next .np-sband { background: #fff3c4; color: var(--navy, #16264a); }
@keyframes np-next { 50% { box-shadow: inset 0 0 0 5px #ffd23f, inset 0 0 22px rgba(255, 210, 63, .9); } }
.np-whole { box-shadow: 0 0 0 3px var(--navy, #16264a), 0 0 0 9px #ffd23f; }
.np-whole .np-slot::after { opacity: 0; }

/* a strip: its part of the picture with the number band at the bottom, like the cut-out paper strip */
.np-strip { display: flex; flex-direction: column; padding: 0; border: 0; margin: 0; background: #fff; cursor: pointer;
  container-type: inline-size; transition: transform .45s cubic-bezier(.3, .7, .3, 1), box-shadow .2s; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.np-spic { display: block; aspect-ratio: var(--sar); background-repeat: no-repeat; }
.np-band { display: flex; align-items: center; justify-content: center; height: var(--bh); border-top: 2px solid rgba(22, 38, 74, .5); }
.np-band b { font: 800 1rem/1 var(--display, sans-serif); font-size: min(1.9rem, 34cqw); }
.np-slot > .np-strip { position: absolute; inset: 0; width: 100%; z-index: 1; cursor: default; }

/* the tray under the frame: every strip on one row, a little smaller than its place */
.np-tray { display: flex; justify-content: center; align-items: flex-end; gap: 5px; width: var(--fw); min-height: 40px; }
.np-tray .np-strip, .np-gap { flex: none; width: calc((100% - (var(--n) - 1) * 5px) / var(--n) * var(--tf)); }
.np-tray .np-band { height: calc(var(--bh) * .85); }
.np-tray .np-strip { border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 2px var(--navy, #16264a), 0 4px 0 2px rgba(22, 38, 74, .25); }
.np-gap { visibility: hidden; height: 1px; }
.np-tray.np-empty { visibility: hidden; height: 0; min-height: 0; overflow: hidden; }
.np-strip.np-no { animation: np-no .45s ease-in-out; }
@keyframes np-no { 20% { transform: translateX(-7px) rotate(-5deg); } 45% { transform: translateX(6px) rotate(4deg); }
  70% { transform: translateX(-4px) rotate(-2deg); } 100% { transform: none; } }
.np-strip.np-glow { box-shadow: 0 0 0 3px #ffd23f, 0 0 16px 6px rgba(255, 210, 63, .85); animation: np-glow 1s ease-in-out infinite; }
@keyframes np-glow { 50% { transform: translateY(-8px); } }
.np-strip.np-lift { z-index: 6; position: relative; transition: box-shadow .2s; cursor: grabbing;
  box-shadow: 0 0 0 2px var(--navy, #16264a), 0 12px 22px rgba(22, 38, 74, .35); }
.np-tapsay { cursor: pointer; }
@media (max-width: 480px) { .np { gap: 12px; } .np-tray { gap: 4px; } .np-tray .np-strip, .np-gap { width: calc((100% - (var(--n) - 1) * 4px) / var(--n) * var(--tf)); }
  /* 2026-11-26: 10 strips are ~29 px wide on a phone; bigger numbers so a child can read them (3 digits still fit) */
  .np-tray .np-band { height: max(calc(var(--bh) * .85), 24px); }
  .np-tray .np-band b { font-size: max(14px, min(1.9rem, 46cqw)); letter-spacing: -.5px; } }
@media (hover: hover) {
  .np-tray .np-strip:not(:disabled):hover { transform: translateY(-5px); }
}
