.bp-player-tools .bp-player-continuous{display:inline-flex;align-items:center;min-height:44px;border:1px solid #ffffff80;border-radius:11px;padding:10px 14px;background:#ffffff1c;color:#fff;text-decoration:none;font:700 15px/1.3 Arial,sans-serif}
.bp-host-page{padding:clamp(30px,5vw,64px) max(20px,calc((100% - 1380px)/2));min-height:100vh}
.bp-player-host{background:#eef2fc;border:1px solid #d5ddf3;border-radius:24px;overflow:hidden;scroll-margin-top:20px;box-shadow:0 16px 50px #33487318}
.bp-player-host [hidden]{display:none!important}
.bp-host-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;background:#34265f;color:#fff}
.bp-host-bar strong{font:800 20px/1.3 Changa,Arial,sans-serif}.bp-host-bar>div{display:flex;flex-wrap:wrap;gap:10px}
.bp-host-bar button,.bp-host-bar a,.bp-host-error button{min-height:44px;border:1px solid #b9a4dd;border-radius:10px;padding:10px 16px;background:#fff;color:#422d6e;font:700 15px/1.4 Arial,sans-serif;text-decoration:none;cursor:pointer}
.bp-host-bar button:focus-visible,.bp-host-bar a:focus-visible,.bp-host-error button:focus-visible{outline:3px solid #20a5ff;outline-offset:3px}
.bp-host-status{margin:0;padding:10px 18px;color:#42506c;background:#f3effc;font:400 14px/1.5 Arial,sans-serif}
.bp-host-error{padding:32px;text-align:center;color:#3b3155}.bp-host-activity-shell{position:relative;width:100%;height:clamp(620px,70vw,1080px);overflow:hidden;background:#f1f5ff}.bp-host-activity{display:block;width:100%;height:100%;border:0;background:#f1f5ff}
.bp-host-activity.is-loading{visibility:hidden;pointer-events:none}
.bp-host-leaderboard{position:absolute;top:0;right:0;bottom:0;left:auto;z-index:5;width:360px;max-width:88%;max-height:100%;padding:22px 18px;border-left:1px solid #d5ddf3;overflow-y:auto;background:linear-gradient(180deg,#f8f5fff5,#fffefaf5);box-shadow:-18px 0 42px #19294a32;transform:translateX(102%);opacity:0;visibility:hidden;pointer-events:none;transition:transform .28s ease,opacity .2s ease,visibility .2s ease}.bp-host-activity-shell:not(.is-board-hidden) .bp-host-leaderboard{transform:translateX(0);opacity:1;visibility:visible;pointer-events:auto}.bp-host-activity-shell.is-board-hidden .bp-host-leaderboard{transform:translateX(102%);opacity:0;visibility:hidden;pointer-events:none}.bp-host-leaderboard .bp-player-leaderboard{padding:0;border:0;border-radius:0;background:transparent}
.bp-host-help{font:400 16px/1.6 Arial,sans-serif;color:#465572;margin:18px 0}
.bp-player-host:fullscreen,.bp-player-host.is-expanded{width:100%;height:100%;max-width:none;margin:0;border:0;border-radius:0;display:flex;flex-direction:column;background:#eef2fc}
.bp-player-host.is-expanded{position:fixed;inset:0;z-index:2147483000;height:100dvh}
.bp-player-host:fullscreen .bp-host-activity,.bp-player-host.is-expanded .bp-host-activity{flex:1;min-height:0;height:0}
.bp-player-host:fullscreen .bp-host-activity-shell,.bp-player-host.is-expanded .bp-host-activity-shell{flex:1;min-height:0;height:auto}
.bp-player-host:fullscreen .bp-host-activity,.bp-player-host.is-expanded .bp-host-activity{height:100%}
.bp-player-host:fullscreen .bp-host-bar,.bp-player-host.is-expanded .bp-host-bar{flex-shrink:0}
html.bp-host-expanded{overflow:hidden}
/* These rules activate only after the embedded page verifies it has a host. */
/* The host sizes this verified embedded document to its content. An inner
   viewport scrollbar would change the content width and retrigger that sizing
   forever near responsive wrap boundaries. The outer page/fullscreen shell
   owns page scrolling; dialogs and activity-local scrollers remain unchanged. */
html.bp-hosted{scroll-behavior:auto;overflow:hidden}html.bp-hosted body{margin:0;background:#f1f5ff}
html.bp-hosted .brainopia-game-page{padding:0!important;min-height:0!important;margin:0!important;width:100%!important}
html.bp-hosted .bp-game-hero,html.bp-hosted [data-player-dashboard],html.bp-hosted [data-personal-results]{display:none!important}
html.bp-hosted .bp-player{margin:0;width:100%;max-width:none;border:0;border-radius:0;min-height:0!important;height:auto!important;overflow:hidden;display:flex;flex-direction:column}
html.bp-hosted .bp-player-layout{flex:1;min-height:0;align-items:start}
html.bp-hosted .bp-player-stage{max-height:calc(100vh - 190px);min-height:250px}
html.bp-hosted .bp-player-toolbar{padding:12px 18px}html.bp-hosted .bp-player-navigation{padding:12px 18px}
html.bp-hosted .bp-player-message{padding-bottom:10px}
@media(max-width:650px){.bp-host-page{padding:24px 14px}.bp-host-activity-shell{height:760px}.bp-host-leaderboard{width:min(340px,92%);padding:16px 14px}.bp-host-bar{padding:12px}.bp-host-bar strong{font-size:18px}html.bp-hosted .bp-player-stage{max-height:75vh}.bp-player-tools .bp-player-continuous{font-size:14px}}
@media(prefers-reduced-motion:reduce){.bp-player-host,.bp-player-host *{scroll-behavior:auto!important}}
/* Shared mobile contract: the hosted child frame owns a true 16:9 stage. */
html.bp-hosted .bp-player[data-player-frame] .bp-player-stage{aspect-ratio:16/9;min-height:0;height:auto;max-height:none}
html.bp-hosted .bp-player[data-player-frame]:fullscreen .bp-player-stage,html.bp-hosted .bp-player[data-player-frame].is-expanded .bp-player-stage{max-height:100%;height:auto}
/* Continuous-player chrome: title, live status, and navigation share one compact row. */
.bp-host-bar .bp-host-heading{display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0}.bp-host-bar .bp-host-heading strong{min-width:0}.bp-host-bar .bp-host-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.bp-host-bar .bp-host-status{display:inline-flex;align-items:center;min-height:28px;margin:0;padding:3px 9px;border:1px solid #b9a4dd;border-radius:999px;background:#ffffff1c;color:#f4eaff;font:700 12px/1.25 Arial,sans-serif}.bp-host-bar .bp-host-status.is-ready{border-color:#9bd7b0;background:#dff5e7;color:#173e37;font-size:11px}.bp-host-bar .bp-host-status[hidden]{display:none!important}
/* The outer continuous-player host owns fullscreen. Keep the embedded toolbar
   focused on timer, restart, and Top 10 controls instead of showing a second
   fullscreen button. */
html.bp-hosted .bp-player-tools [data-player-fullscreen]{display:none!important}
/* The host fits the child document; only the outer page/fullscreen shell scrolls.
   The Top 10 rail is measured against the activity, not the coaching content. */
.bp-player-host:fullscreen,.bp-player-host.is-expanded { overflow-y:auto; }
.bp-player-host:fullscreen .bp-host-activity-shell,
.bp-player-host.is-expanded .bp-host-activity-shell { flex:none; }
html.bp-hosted :is(.bp-badge-dialog,.bp-player-confirm,.memory-reference-dialog) {
 top:calc(var(--bp-host-visible-top,0px) + 12px); bottom:auto; margin:0 auto;
 max-height:calc(var(--bp-host-visible-height,100dvh) - 24px);
}
@media(prefers-reduced-motion:reduce) { .bp-host-leaderboard { transition:none; } }
/* Safari's native content-fit room must not pan when a completion action gains
   focus. Clip the off-canvas leaderboard without making a scroll container.
   The iframe selector releases this rule immediately on another game's load. */
.bp-host-activity-shell:has(> .bp-host-activity[src*="game=first-sound-safari&"]) {
  overflow: clip;
}
/* Ten-Frame's saved score must remain readable after a narrow completion.
   Stack the record cards instead of shrinking or clipping their score text. */
@media (max-width:400px) {
  [data-personal-results][data-game="ten-frame-garden"] .game-personal-metrics {
    grid-template-columns: minmax(0,1fr);
  }
}
/* Treasure Tray's full saved scores need the same narrow-screen breathing room.
   Keep this scoped to its record cards; the native lesson layout is unchanged. */
@media (max-width:400px) {
  [data-personal-results][data-game="treasure-tray-recall"] .game-personal-metrics {
    grid-template-columns: minmax(0,1fr);
  }
}
/* Color Dash's full saved scores must remain readable on the narrow host. */
@media (max-width:400px) {
  [data-personal-results][data-game="color-dash"] .game-personal-metrics {
    grid-template-columns: minmax(0,1fr);
  }
}
/* Quiet Target Hunt's full saved scores must remain readable on narrow hosts. */
@media (max-width:400px) {
  [data-personal-results][data-game="quiet-target-hunt"] .game-personal-metrics {
    grid-template-columns: minmax(0,1fr);
  }
}
/* Shape Builder's scores keep their full text size at every host width.
   Let the available card space choose columns, including breakpoint neighbors. */
[data-personal-results][data-game="shape-builder"] .game-personal-metrics {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr));
}
/* Letter Sound Garden keeps full saved scores readable at every host width.
   Fit record-card columns to their space without reducing the score text. */
[data-personal-results][data-game="letter-sound-garden"] .game-personal-metrics {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr));
}
