/* Play kit: labs and investigations as simple games. Big touch targets, one hint, a stage, stars. */
.pk-on > h2 { margin-bottom: 6px; }
.pk-game { --pk-ink: #172f40; --pk-green: #11665e; --pk-sun: #ffcf3a; display: grid; gap: 12px; margin: 4px 0 14px; }
.pk-hint { margin: 0; padding: 10px 14px; border-radius: 14px; background: #fff7d6; border: 2px solid #f1d27a; font-size: 1.08rem; font-weight: 600; color: var(--pk-ink); }
.pk-stage { position: relative; border-radius: 20px; background: linear-gradient(#f3faf7, #e6f1ec); border: 2px solid #cfe2da; padding: 14px; }
.pk-sub { margin: 0; font-weight: 700; color: var(--pk-ink); }
.pk-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-ask { font-weight: 700; color: var(--pk-ink); }

/* Pieces you can drag (or tap, then tap a spot) */
.pk-tray { display: flex; flex-wrap: wrap; gap: 10px; }
.pk-piece { display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 16px; border-radius: 16px; border: 2px solid #b9cfc6; background: #fff; font: inherit; font-weight: 700; font-size: 1.02rem; color: var(--pk-ink); cursor: grab; touch-action: none; user-select: none; box-shadow: 0 3px 0 #b9cfc6; transition: transform .12s, box-shadow .12s; }
.pk-piece:hover { transform: translateY(-2px); }
.pk-piece:active { cursor: grabbing; }
.pk-piece.pk-selected { border-color: var(--pk-green); box-shadow: 0 0 0 4px #9fd9c6; transform: translateY(-3px); }
.pk-piece.pk-lifted { opacity: .35; }
.pk-piece.used, .pk-piece.guess { border-color: var(--pk-green); background: #e9f6f1; }
.pk-tag { font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--pk-green); color: #fff; }
.pk-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; transform-origin: center; box-shadow: 0 12px 24px rgba(0,0,0,.22); opacity: .95; }
.pk-bar { display: inline-block; width: 46px; height: 14px; border-radius: 7px; border: 2px solid rgba(0,0,0,.25); }
.pk-swatch { display: inline-block; width: 26px; height: 26px; border-radius: 8px; border: 2px solid rgba(0,0,0,.2); }

/* Spots you drop onto */
.pk-slot { border: 3px dashed #7fb3a3; background: rgba(255,255,255,.75); transition: background .15s, transform .15s, border-color .15s; }
.pk-placing .pk-slot { animation: pk-pulse 1.1s ease-in-out infinite; }
.pk-slot.pk-over { border-color: var(--pk-green); background: #d9f3ea; transform: scale(1.04); }
@keyframes pk-pulse { 50% { border-color: var(--pk-green); background: #e8f8f2; } }
.pk-slot-name { font-weight: 800; color: var(--pk-ink); }

/* Big action button */
.pk-go { min-height: 58px; padding: 10px 26px; border: 0; border-radius: 999px; background: #b8431c; color: #fff; font: inherit; font-weight: 800; font-size: 1.15rem; box-shadow: 0 5px 0 #7f2a0f; cursor: pointer; }
.pk-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #7f2a0f; }
.pk-chip { min-height: 48px; min-width: 48px; padding: 6px 14px; border-radius: 999px; border: 2px solid #b9cfc6; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pk-chip.on { background: var(--pk-green); border-color: var(--pk-green); color: #fff; }
.pk-chip:disabled { opacity: .4; }

/* Stars */
.pk-stars { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-star { padding: 6px 12px; border-radius: 999px; background: #f1f3f2; color: #5a6b72; font-weight: 700; font-size: .95rem; }
.pk-star span { color: #b6bfc2; }
.pk-star.on { background: #fff1c2; color: #6b4b00; }
.pk-star.on span { color: #f0a500; display: inline-block; animation: pk-pop .4s ease-out; }
@keyframes pk-pop { 0% { transform: scale(.3); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* Notebook: the full investigation, folded under the game */
.pk-notebook { margin-top: 6px; border: 2px solid #d9e4df; border-radius: 16px; background: #fff; }
.pk-notebook > summary { cursor: pointer; padding: 12px 16px; font-weight: 800; color: var(--pk-ink, #172f40); }
.pk-notebook[open] > summary { border-bottom: 1px solid #e3ebe7; }
.pk-notebook > :not(summary) { margin-left: 14px; margin-right: 14px; }

/* Light the bulb */
.pk-circuit { aspect-ratio: 600 / 340; padding: 0; max-width: 720px; }
.pk-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.pk-wire { stroke: #8a9a92; }
.pk-circuit.lit .pk-wire { stroke: #f0b400; stroke-dasharray: 14 12; animation: pk-flow .7s linear infinite; }
.pk-circuit.dim .pk-wire { animation-duration: 2.2s; stroke: #d8b44a; }
@keyframes pk-flow { to { stroke-dashoffset: -26; } }
.pk-bulb { fill: #fff; stroke: #8b98a1; stroke-width: 4; transition: fill .3s; }
.pk-circuit.lit .pk-bulb { fill: var(--pk-sun); filter: drop-shadow(0 0 24px #ffd84d); }
.pk-circuit.dim .pk-bulb { fill: #fff0b3; filter: drop-shadow(0 0 8px #ffe27a); }
.pk-gap { position: absolute; left: 36%; top: 7%; width: 28%; height: 22%; border-radius: 14px; display: grid; place-items: center; gap: 2px; cursor: pointer; }
.pk-gap.filled { border-style: solid; }
.pk-gap .pk-bar { width: 80%; height: 18px; }
.pk-switch { position: absolute; left: 43%; top: 72%; width: 14%; height: 20%; border-radius: 14px; border: 3px solid #5d6f78; background: #fff; display: grid; place-items: center; cursor: pointer; font: inherit; }
.pk-switch:disabled { opacity: .45; cursor: not-allowed; }
.pk-lever { width: 70%; height: 8px; border-radius: 4px; background: #2f3b44; transform: rotate(-28deg); transform-origin: left center; transition: transform .25s; }
.pk-switch.closed .pk-lever { transform: rotate(0); }

/* Keep it warm */
.pk-warm { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 24px; padding-top: 44px; }
.pk-clock { position: absolute; top: 10px; left: 14px; font-size: 1.3rem; font-weight: 800; color: var(--pk-ink); }
.pk-clock::before { content: "⏱ "; }
.pk-cup-wrap { display: grid; justify-items: center; gap: 4px; }
.pk-cup { position: relative; display: grid; grid-template-columns: auto auto; align-items: end; gap: 8px; padding: 30px 14px 10px; min-width: 170px; border-radius: 18px; font: inherit; cursor: default; }
.pk-cup.pk-slot { cursor: pointer; }
.pk-cup:not(.pk-slot) { border: 2px solid transparent; background: transparent; }
.pk-steam { position: absolute; top: 2px; left: 38px; font-size: 1.6rem; color: #9db0b8; animation: pk-steam 1.6s ease-in-out infinite; }
@keyframes pk-steam { 50% { transform: translateY(-6px); } }
.pk-mug { display: grid; place-items: center; width: 92px; height: 96px; border-radius: 0 0 22px 22px; background: #f6d2a8; border: 4px solid #6b7d86; font-size: 2.4rem; }
.pk-mug.wrap-foil { background: repeating-linear-gradient(45deg, #dfe5ea 0 8px, #b9c3cc 8px 16px); }
.pk-mug.wrap-paper { background: #f8f6ef; }
.pk-mug.wrap-bubble { background: radial-gradient(circle at 30% 30%, #e9f7ff 0 8px, #cfeaf7 9px) 0 0 / 22px 22px; }
.pk-mug.wrap-wool { background: repeating-linear-gradient(0deg, #f2a6c0 0 7px, #e87ba4 7px 14px); }
.pk-thermo { position: relative; width: 18px; height: 110px; border-radius: 9px; background: #fff; border: 3px solid #6b7d86; overflow: hidden; }
.pk-mercury { position: absolute; left: 0; right: 0; bottom: 0; background: #e0582c; transition: height .2s; }
.pk-reading { grid-column: 1 / -1; font-size: 1.4rem; color: var(--pk-ink); }
.pk-cup-label { font-weight: 700; color: #465d68; }
.pk-warm .pk-go { align-self: center; }

/* Results board (warmest, paperclips) */
.pk-board { display: grid; gap: 6px; padding: 10px 14px; border-radius: 16px; background: #fff; border: 2px solid #e3ebe7; }
.pk-board-row { display: grid; grid-template-columns: 9em 1fr 4.5em; align-items: center; gap: 10px; font-weight: 700; }
.pk-board-bar { height: 16px; border-radius: 8px; background: #8fc7b6; }
.pk-board-row.best .pk-board-bar { background: #f0a500; }
.pk-board-row b { text-align: right; }

/* Ramp racer */
.pk-ramps { display: grid; gap: 14px; }
.pk-lane { display: grid; grid-template-columns: 30px 120px 1fr; align-items: end; gap: 0; }
.pk-lane-name { font-size: 1.4rem; color: var(--pk-ink); align-self: center; }
.pk-ramp { position: relative; height: 96px; border: 0; background: none; cursor: pointer; padding: 0; font: inherit; }
.pk-ramp-tri { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: #e8d3a8; border-bottom: 4px solid #7b6a3a; clip-path: polygon(0 0, 100% 100%, 0 100%); transition: height .3s; }
.pk-ramp.high .pk-ramp-tri { height: 92%; }
.pk-ramp .pk-slot-name { position: absolute; top: 2px; left: 6px; font-size: .85rem; background: #fff; border-radius: 8px; padding: 1px 6px; }
.pk-floor { position: relative; height: 64px; border-radius: 12px; border-style: solid; background: var(--floor); cursor: pointer; font: inherit; }
.pk-floor-name { position: absolute; right: 10px; top: 6px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pk-car { position: absolute; bottom: 6px; left: calc(var(--x, 0%) * .86); font-size: 2rem; transform: scaleX(-1); transition: none; }
.pk-flag { position: absolute; bottom: 44px; left: calc(var(--x, 0%) * .86); padding: 2px 8px; border-radius: 8px; background: #fff; font-weight: 800; font-size: .9rem; color: var(--pk-ink); white-space: nowrap; }
.pk-flag[data-pk-later] { visibility: hidden; }

/* Magnet lab */
.pk-magnet { display: grid; gap: 12px; }
.pk-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.pk-object { position: relative; display: grid; justify-items: center; gap: 4px; min-height: 96px; padding: 8px; border-radius: 16px; font: inherit; cursor: pointer; }
.pk-obj-icon { font-size: 2rem; }
.pk-obj-name { font-size: .85rem; font-weight: 700; color: var(--pk-ink); text-align: center; line-height: 1.2; }
.pk-object.stuck { border-style: solid; border-color: #2a78d6; background: #e6f0fb; }
.pk-object.nopull { border-style: solid; border-color: #c7cfd3; background: #f4f6f7; }
.pk-badge { position: absolute; top: -8px; right: -6px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: #2a78d6; color: #fff; }
.pk-object.nopull .pk-badge { background: #8a979d; }
.pk-object.pop.stuck { animation: pk-stick .5s ease-out; }
.pk-object.pop.nopull { animation: pk-shake .45s ease-in-out; }
@keyframes pk-stick { 30% { transform: translateY(-14px) scale(1.08); } 100% { transform: none; } }
@keyframes pk-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pk-magnet-piece { justify-self: start; font-size: 1.3rem; padding: 12px 22px; border: 2px solid #c44536; box-shadow: 0 4px 0 #c4453633; margin-bottom: 10px; }
.pk-layers { display: grid; gap: 10px; }
.pk-layer-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pk-stack { display: flex; align-items: center; gap: 3px; min-width: 120px; min-height: 56px; padding: 4px 10px; border-radius: 12px; background: #fff; }
.pk-mag-big { font-size: 2rem; }
.pk-card-sheet { width: 10px; height: 46px; border-radius: 3px; background: #c9a36b; border: 1px solid #8a6a3a; }
.pk-clips { font-size: 1.6rem; letter-spacing: -6px; }
.pk-clips b { letter-spacing: normal; font-size: 1rem; margin-left: 12px; }

@media (max-width: 600px) {
  .pk-lane { grid-template-columns: 24px 80px 1fr; }
  .pk-ramp { height: 72px; }
  .pk-cup { min-width: 130px; }
  .pk-board-row { grid-template-columns: 7em 1fr 4em; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-circuit.lit .pk-wire, .pk-steam, .pk-placing .pk-slot, .pk-object.pop { animation: none !important; }
}

/* Lab cards reorder their children; keep label, question, game, notebook in that order. */
.lab-card.pk-on > .pill { order: 0 !important; }
.lab-card.pk-on > h2 { order: 1 !important; margin-bottom: 12px; }
.lab-card.pk-on > .pk-game { order: 2 !important; }
.lab-card.pk-on > .pk-notebook { order: 3 !important; }

/* Separation station */
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pk-sep { display: grid; place-items: center; }
.pk-sep-bowl { width: min(100%, 520px); padding: 6px; border-radius: 20px; }
.pk-sep-bowl svg { display: block; width: 100%; height: auto; }
.pk-sep-bowl.done { border-style: solid; border-color: var(--pk-green); }
.pk-sep-bowl.nope { animation: pk-shake .35s; }
@keyframes pk-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Change sorter */
.pk-sorter { display: grid; justify-items: center; gap: 14px; }
.pk-sort-card { font-size: 1.25rem; padding: 16px 26px; border-radius: 14px; background: #fffbe8; border-color: #e2c86a; box-shadow: 0 4px 0 #e2c86a; }
.pk-sort-card.placed { display: block; margin-top: 8px; font-size: 1rem; padding: 8px 12px; border: 2px solid #e2c86a; font-weight: 700; }
.pk-bins { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.pk-bin { min-height: 150px; border-radius: 18px; padding: 14px; display: grid; justify-items: center; align-content: center; gap: 4px; font: inherit; color: var(--pk-ink); }
.pk-bin:disabled { opacity: 1; }
.pk-bin-icon { font-size: 2.2rem; }
.pk-bin small { color: #4d625b; }
.pk-bin.right { border-style: solid; border-color: var(--pk-green); background: #e3f6ee; }
.pk-bin.wrong { border-style: solid; border-color: #c44536; background: #fdeceb; }
.pk-sort-done { display: grid; place-items: center; padding: 20px; }
@media (prefers-reduced-motion: reduce) { .pk-sep-bowl.nope { animation: none; } }

/* Keep it warm: readings to copy into the lesson table */
.pk-readings { border-collapse: collapse; margin: 12px 0 4px; font-variant-numeric: tabular-nums; background: #fff; border-radius: 12px; overflow: hidden; }
.pk-readings caption { text-align: left; font-weight: 800; padding: 0 0 6px; color: var(--pk-ink); }
.pk-readings th, .pk-readings td { padding: 8px 12px; border: 1px solid #d5e2dc; text-align: center; }
.pk-readings th[scope="row"] { text-align: left; }
