/* neuroplay.css — system LAYOUT + activity-stage classes. The np-* game classes
 * style the bespoke child-game renderers (the documented imperative-DOM exception);
 * the chrome (metricbar/statusbar/fill) mirrors the EthiKit/RiverHealth pattern. */
body[data-system="neuroplay"] .np-metricbar { padding: 6px 12px; border-bottom: 1px solid var(--ui-gray-200, #e5e7eb); min-height: 34px; }
/* Carer weekly summary — plain-language headline at the top of Progress. */
body[data-system="neuroplay"] .np-weekcard { background: var(--ui-primary-50); border: 1px solid var(--ui-primary-100); border-radius: var(--ui-radius-lg, 14px); padding: clamp(12px, 2vw, 18px); }
body[data-system="neuroplay"] .np-weekcard-h { font-size: clamp(16px, 2.8vw, 20px); color: var(--ui-primary-700); margin-bottom: 8px; }
body[data-system="neuroplay"] .np-weekline { font-size: clamp(14px, 2.2vw, 16px); line-height: 1.5; margin: 2px 0; }
body[data-system="neuroplay"] .ui-pageframe-body  { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
body[data-system="neuroplay"] .ui-pageframe-stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
body[data-system="neuroplay"] .ui-pageframe-stage > * { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* Control-pane activity picker */
body[data-system="neuroplay"] .np-childbar { padding: 8px; }
/* Progress: per-child filter strip + response-time control chart host. */
body[data-system="neuroplay"] .np-filterbar { padding: 6px 12px; border-top: 1px solid var(--ui-gray-200, #e5e7eb); border-bottom: 1px solid var(--ui-gray-200, #e5e7eb); }
body[data-system="neuroplay"] .np-rtchart { height: 300px; min-height: 300px; width: 100%; }
/* Session: finish-&-save bar below the activity stage. */
body[data-system="neuroplay"] .np-finishbar { flex: 0 0 auto; padding: 8px 12px; border-top: 1px solid var(--ui-gray-200, #e5e7eb); }
body[data-system="neuroplay"] .np-finishbar:empty { display: none; }
body[data-system="neuroplay"] .np-level-head { padding: 8px 8px 2px; }
body[data-system="neuroplay"] .np-act-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 8px 8px; }
body[data-system="neuroplay"] .np-act-card { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; padding: 10px 6px;
    border: 1px solid var(--ui-gray-200, #e5e7eb); border-radius: 12px; background: #fff; cursor: pointer; }
body[data-system="neuroplay"] .np-act-card:hover { border-color: var(--ui-primary, #7c5cff); }
body[data-system="neuroplay"] .np-act-icon { font-size: 28px; }
body[data-system="neuroplay"] .np-act-name { font-size: 12px; text-align: center; }

/* The activity stage — the central element */
body[data-system="neuroplay"] .np-stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
    background: linear-gradient(160deg, #faf7ff 0%, #fff7ed 100%); }
body[data-system="neuroplay"] .np-stage-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--ui-text-muted, #6b7280); }
body[data-system="neuroplay"] .np-stage-game { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
body[data-system="neuroplay"] .np-stage-prompt { font-size: 22px; font-weight: 700; text-align: center; padding: 14px; color: var(--ui-primary-700, #5b3fcc); }
body[data-system="neuroplay"] .np-stage-field { position: relative; flex: 1 1 auto; min-height: 0; }
body[data-system="neuroplay"] .np-stage-score { text-align: center; font-size: 20px; padding: 10px; }
body[data-system="neuroplay"] .np-target { position: absolute; display: flex; align-items: center; justify-content: center; border: none; background: transparent; font-size: clamp(46px, 11vw, 68px); line-height: 1; cursor: pointer; animation: np-target-pulse 1.8s ease-in-out infinite; }
body[data-system="neuroplay"] .np-target:active { transform: scale(1.15); }
body[data-system="neuroplay"] .np-pop, body[data-system="neuroplay"] .np-target.np-pop { animation: none; transform: scale(1.6); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
@keyframes np-target-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
/* Drawn targets — bold coloured discs (with a glyph) or soft soap-bubbles. */
body[data-system="neuroplay"] .np-target-disc { border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff, var(--np-t-color, #a78bfa) 80%); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); box-shadow: 0 6px 16px rgba(0,0,0,.18), inset 0 -8px 14px rgba(0,0,0,.12); }
body[data-system="neuroplay"] .np-target-bubble { border-radius: 50%; background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95), rgba(168,200,255,.45) 55%, rgba(140,170,255,.22) 100%); box-shadow: inset 0 0 14px rgba(255,255,255,.7), inset -6px -8px 14px rgba(120,150,220,.35), 0 4px 12px rgba(120,140,200,.3); }
body[data-system="neuroplay"] .np-target-bubble::before { content: ''; position: absolute; top: 18%; left: 22%; width: 26%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.85); }
body[data-system="neuroplay"] .np-choice-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 20px; }
body[data-system="neuroplay"] .np-choice { font-size: 56px; background: #fff; border: 2px solid var(--ui-gray-200, #e5e7eb); border-radius: 18px; width: 96px; height: 96px; cursor: pointer; }
body[data-system="neuroplay"] .np-choice.np-chosen { border-color: var(--ui-accent, #f59e0b); background: #fff7ed; }
/* Wide variant for text-bearing choices (L5–L9 speech/comprehension/social). */
body[data-system="neuroplay"] .np-choice.np-choice-wide { width: auto; min-width: 120px; height: auto; min-height: 80px; font-size: 22px; line-height: 1.2; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
body[data-system="neuroplay"] .np-choice.np-wrong { border-color: var(--ui-danger, #dc2626); animation: np-shake 0.4s; }
@keyframes np-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
body[data-system="neuroplay"] .np-sparkle { position: absolute; left: 50%; top: 40%; font-size: 64px; animation: np-fade .9s ease-out forwards; }
@keyframes np-fade { from { opacity: 1; transform: scale(.5); } to { opacity: 0; transform: scale(1.6); } }

/* Rhythm + breathing activity renderers */
body[data-system="neuroplay"] .np-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
body[data-system="neuroplay"] .np-beat { font-size: 72px; transition: transform .15s ease; }
body[data-system="neuroplay"] .np-beat-on { transform: scale(1.4); }
body[data-system="neuroplay"] .np-tap-btn { font-size: 28px; font-weight: 700; padding: 18px 48px; border-radius: 999px; border: none;
    background: var(--ui-primary, #7c5cff); color: #fff; cursor: pointer; }
body[data-system="neuroplay"] .np-tap-btn:active { transform: scale(1.08); }
body[data-system="neuroplay"] .np-breathe { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #a78bfa, #7c5cff);
    transition: transform 2.6s ease-in-out; }
body[data-system="neuroplay"] .np-breathe-big { transform: scale(2.0); }
body[data-system="neuroplay"] .np-breathe-label { font-size: 22px; color: var(--ui-primary-700, #5b3fcc); }

/* ── Child PLAY surface ─────────────────────────────────────────────────────
 * Launcher (np-play-launch) is short + centred so the document-flow page never
 * overflows the window. The game runs in np-fullplay: a fixed, 100dvh overlay
 * that fits ANY device (phone / iPad / desktop) with no page scroll. All sizes
 * use clamp() so targets stay large and tappable on a phone yet contained. */
body[data-system="neuroplay"] .np-play-launch { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2vh, 30px); padding: clamp(10px, 2vh, 44px); text-align: center; }
body[data-system="neuroplay"] .np-play-title { font-size: clamp(18px, 3.2vw, 30px); color: var(--ui-primary-700); }
body[data-system="neuroplay"] .np-child-pick { display: flex; flex-wrap: wrap; gap: clamp(8px, 2vw, 20px); justify-content: center; }
body[data-system="neuroplay"] .np-child-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: clamp(8px, 1.5vw, 16px); border: 2px solid var(--ui-gray-200); border-radius: 18px; background: #fff; cursor: pointer; min-width: clamp(78px, 17vw, 124px); }
body[data-system="neuroplay"] .np-child-btn.np-child-on { border-color: var(--ui-primary); background: var(--ui-primary-50); }
body[data-system="neuroplay"] .np-child-av { display: flex; align-items: center; justify-content: center; width: clamp(40px, 8vw, 68px); height: clamp(40px, 8vw, 68px); border-radius: 50%; background: var(--ui-primary); color: #fff; font-size: clamp(20px, 3.6vw, 32px); font-weight: 700; }
body[data-system="neuroplay"] .np-child-nm { font-size: clamp(14px, 2.2vw, 18px); }
body[data-system="neuroplay"] .np-play-go { font-size: clamp(22px, 4vw, 32px); font-weight: 800; padding: clamp(14px, 2.5vh, 22px) clamp(36px, 8vw, 72px); border: none; border-radius: 999px; background: var(--ui-primary); color: #fff; cursor: pointer; box-shadow: var(--ui-shadow-md, 0 4px 14px rgba(0,0,0,.18)); }
body[data-system="neuroplay"] .np-play-go:active { transform: scale(1.04); }
body[data-system="neuroplay"] .np-play-hint { font-size: 12px; color: var(--ui-fg-muted); max-width: 28rem; }

body[data-system="neuroplay"] .np-fullplay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; height: 100dvh; background: linear-gradient(160deg, #faf7ff 0%, #fff7ed 100%); }
body[data-system="neuroplay"] .np-fullplay-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: clamp(8px, 1.5vh, 16px) clamp(12px, 3vw, 24px); background: #fff; border-bottom: 1px solid var(--ui-gray-200); }
body[data-system="neuroplay"] .np-fullplay-who { font-size: clamp(16px, 3vw, 24px); font-weight: 700; color: var(--ui-primary-700); }
body[data-system="neuroplay"] .np-fullplay-exit { flex: 0 0 auto; font-size: clamp(20px, 4vw, 28px); width: clamp(44px, 9vw, 56px); height: clamp(44px, 9vw, 56px); border: none; border-radius: 50%; background: var(--ui-gray-100); cursor: pointer; }
body[data-system="neuroplay"] .np-fullplay-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body[data-system="neuroplay"] .np-fullplay-choose { overflow: auto; display: flex; flex-direction: column; padding: clamp(12px, 3vw, 24px); }
body[data-system="neuroplay"] .np-choose-head { font-size: clamp(14px, 2.4vw, 18px); font-weight: 700; color: var(--ui-primary-700); margin: clamp(6px, 1.4vh, 14px) 0 8px; }
body[data-system="neuroplay"] .np-choose-locked-head { color: var(--ui-fg-muted); margin-top: clamp(14px, 2.4vh, 22px); }
body[data-system="neuroplay"] .np-choose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 28vw, 160px), 1fr)); gap: clamp(10px, 2vw, 18px); }
body[data-system="neuroplay"] .np-fullplay-tile.np-locked { opacity: .45; cursor: not-allowed; position: relative; }
body[data-system="neuroplay"] .np-fullplay-tile .np-lock { position: absolute; top: 6px; right: 8px; font-size: clamp(14px, 2.6vw, 18px); }
body[data-system="neuroplay"] .np-unlock-toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--ui-primary); color: #fff; padding: 14px 26px; border-radius: 16px; font-size: clamp(16px, 3vw, 22px); font-weight: 800; box-shadow: var(--ui-shadow-lg, 0 10px 40px rgba(0,0,0,.3)); z-index: 6; animation: np-fade-in .3s ease; }
body[data-system="neuroplay"] .np-unlock-sub { font-size: clamp(12px, 2.2vw, 15px); font-weight: 600; opacity: .9; }
body[data-system="neuroplay"] .np-unlock-big { font-size: 1.8em; }
/* Reward shelf — the child's sticker collection at the top of the chooser. */
body[data-system="neuroplay"] .np-sticker-shelf { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: clamp(4px, 1vh, 10px) 0 clamp(10px, 2vh, 16px); border-bottom: 1px solid var(--ui-gray-200); margin-bottom: clamp(6px, 1.5vh, 12px); }
body[data-system="neuroplay"] .np-shelf-head { font-size: clamp(13px, 2.4vw, 16px); font-weight: 700; color: var(--ui-primary-700); }
body[data-system="neuroplay"] .np-shelf-grid { display: flex; flex-wrap: wrap; gap: clamp(5px, 1.4vw, 9px); justify-content: center; }
body[data-system="neuroplay"] .np-shelf-slot { width: clamp(30px, 7vw, 42px); height: clamp(30px, 7vw, 42px); display: flex; align-items: center; justify-content: center; font-size: clamp(16px, 4vw, 24px); border-radius: 50%; background: var(--ui-gray-100); color: var(--ui-gray-400); }
body[data-system="neuroplay"] .np-shelf-slot.np-shelf-on { background: var(--ui-primary-50); color: inherit; }
@keyframes np-fade-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translateX(-50%); } }
body[data-system="neuroplay"] .np-fullplay-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: clamp(12px, 2.5vw, 20px); border: 2px solid var(--ui-gray-200); border-radius: 20px; background: #fff; cursor: pointer; aspect-ratio: 1 / 1; }
body[data-system="neuroplay"] .np-fullplay-tile:active { transform: scale(1.03); border-color: var(--ui-primary); }
body[data-system="neuroplay"] .np-fullplay-tile-icon { font-size: clamp(34px, 7vw, 56px); }
body[data-system="neuroplay"] .np-fullplay-tile-name { font-size: clamp(13px, 2.2vw, 17px); text-align: center; }
body[data-system="neuroplay"] .np-fullplay-bar { flex: 0 0 auto; display: flex; gap: 10px; padding: clamp(6px, 1.2vh, 12px) clamp(12px, 3vw, 24px); }
body[data-system="neuroplay"] .np-fullplay-back, body[data-system="neuroplay"] .np-fullplay-done { font-size: clamp(14px, 2.5vw, 18px); padding: 10px 18px; border: none; border-radius: 999px; cursor: pointer; }
body[data-system="neuroplay"] .np-fullplay-back { background: var(--ui-gray-100); }
body[data-system="neuroplay"] .np-fullplay-done { background: var(--ui-accent); color: #3a2a00; font-weight: 700; margin-left: auto; }
body[data-system="neuroplay"] .np-fullplay-game { flex: 1 1 auto; min-height: 0; }

/* Facilitator guidance — ℹ️ Guide button (top bar) + the readable panel. */
body[data-system="neuroplay"] .np-fullplay-actions { margin-left: auto; display: flex; align-items: center; gap: clamp(6px, 1.5vw, 10px); }
body[data-system="neuroplay"] .np-fullplay-guide { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-size: clamp(13px, 2.4vw, 17px); font-weight: 600; padding: clamp(7px, 1.3vh, 11px) clamp(12px, 2.5vw, 18px); border: none; border-radius: 999px; background: var(--ui-primary-50); color: var(--ui-primary-700); cursor: pointer; }
body[data-system="neuroplay"] .np-fullplay-sound { flex: 0 0 auto; font-size: clamp(18px, 3.5vw, 24px); width: clamp(40px, 8vw, 52px); height: clamp(40px, 8vw, 52px); border: none; border-radius: 50%; background: var(--ui-gray-100); cursor: pointer; }
body[data-system="neuroplay"] .np-guide { position: absolute; inset: 0; z-index: 5; background: rgba(40, 20, 60, .45); display: flex; align-items: flex-start; justify-content: center; padding: clamp(8px, 3vh, 40px); overflow: auto; }
body[data-system="neuroplay"] .np-guide-card { background: #fff; border-radius: 20px; max-width: 40rem; width: 100%; padding: clamp(16px, 3vw, 28px); box-shadow: var(--ui-shadow-lg, 0 10px 40px rgba(0,0,0,.3)); }
body[data-system="neuroplay"] .np-guide-h { font-size: clamp(18px, 3.2vw, 26px); font-weight: 800; color: var(--ui-primary-700); margin-bottom: 14px; }
body[data-system="neuroplay"] .np-guide-sec { font-size: clamp(14px, 2.4vw, 17px); line-height: 1.5; margin-bottom: 12px; }
body[data-system="neuroplay"] .np-guide-sec ul, body[data-system="neuroplay"] .np-guide-for ul { margin: 6px 0 0; padding-left: 22px; }
body[data-system="neuroplay"] .np-guide-sec li, body[data-system="neuroplay"] .np-guide-for li { margin: 4px 0; }
body[data-system="neuroplay"] .np-guide-for { background: var(--ui-primary-50); border: 1px solid var(--ui-primary-100); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-size: clamp(14px, 2.4vw, 17px); }
body[data-system="neuroplay"] .np-guide-close { font-size: clamp(15px, 2.6vw, 18px); font-weight: 700; padding: 12px 28px; border: none; border-radius: 999px; background: var(--ui-primary); color: #fff; cursor: pointer; }
