/* Adaptive Play Lab discovery, setup, and shared-shell upgrades. */

.sr-only {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

.hub.screen.active { display: block; }
.hub-view { height: 100%; min-height: 0; }
.home-view {
    display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: clamp(8px, 1.2vh, 14px); min-height: 0;
}
.home-topline, .home-section-head, .library-head {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.home-topline h2, .library-head h2 {
    font-family: 'Fredoka', sans-serif; font-size: clamp(22px, 2.7vw, 34px); line-height: 1.05;
}
.home-section { min-height: 0; }
.home-section-head { margin-bottom: 7px; }
.home-section-head h3 { font-family: 'Fredoka', sans-serif; font-size: clamp(17px, 2vw, 22px); }
.home-section-head > span, .library-head p { color: var(--ink-dim); font-size: 13px; font-weight: 700; }

.player-setup-card, .home-path-card, .browse-all-card, .tool-action-card, .continue-card, .goal-card {
    appearance: none; font-family: 'Nunito', sans-serif; color: var(--ink); cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.player-setup-card:hover, .home-path-card:hover, .browse-all-card:hover, .tool-action-card:hover, .continue-card:hover, .goal-card:hover {
    transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 60%, var(--line)); background: var(--surface-2);
}
.player-setup-card {
    display: flex; align-items: center; gap: 10px; min-height: 58px; min-width: min(310px, 42vw);
    padding: 9px 13px; border-radius: 16px;
}
.player-setup-card > .ico:first-child { width: 25px; color: var(--primary-ink); }
.player-setup-card > .ico:last-child { width: 17px; margin-left: auto; }
.player-setup-card span { display: flex; flex-direction: column; min-width: 0; }
.player-setup-card small { color: var(--ink-dim); font-weight: 800; }
.player-setup-card b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.continue-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.continue-card { min-width: 0; min-height: 72px; border-radius: 15px; overflow: hidden; }
.path-continue-card { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; padding-right: 12px; }
.continue-art { align-self: stretch; min-height: 72px; overflow: hidden; }
.continue-art .art { width: 100%; height: 100%; display: block; }
.path-continue-card > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; min-width: 0; }
.path-continue-card small { color: var(--primary-ink); font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.path-continue-card b, .path-continue-card span span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-continue-card span span { color: var(--ink-dim); font-size: 12px; font-weight: 700; }
.continue-card.card-compact .card-meta { display: none; }

.home-path-card, .browse-all-card, .tool-action-card {
    width: 100%; display: flex; align-items: center; gap: 13px; min-height: 66px; padding: 10px 14px; border-radius: 16px;
}
.home-path-card { border-color: color-mix(in srgb, var(--primary) 42%, var(--line)); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.home-path-icon, .goal-icon {
    width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px;
    color: var(--primary-ink); background: color-mix(in srgb, var(--primary) 18%, var(--surface-2));
}
.home-path-card > span:nth-child(2), .browse-all-card > span, .tool-action-card > span { display: flex; flex-direction: column; min-width: 0; }
.home-path-card small, .browse-all-card small, .tool-action-card small { color: var(--ink-dim); font-size: 11.5px; font-weight: 750; }
.home-path-card b, .browse-all-card b, .tool-action-card b { font-family: 'Fredoka', sans-serif; font-size: 17px; }
.home-path-card span span { color: var(--ink-dim); font-size: 12px; font-weight: 650; }
.home-path-card > .ico:last-child, .browse-all-card > .ico:last-child, .tool-action-card > .ico:last-child { margin-left: auto; width: 17px; }
.browse-all-card { min-height: 54px; }
.browse-all-card > .ico:first-child, .tool-action-card > .ico:first-child { width: 25px; color: var(--primary-ink); }

.goals-section { display: flex; min-height: 0; flex-direction: column; }
.goal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(62px, 1fr)); gap: 8px; }
.goal-card { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 9px 11px; border-radius: 15px; }
.goal-card[data-tone="coral"] { --goal-tone: var(--coral); }
.goal-card[data-tone="mint"] { --goal-tone: var(--mint); }
.goal-card[data-tone="sun"] { --goal-tone: var(--sun); }
.goal-card[data-tone="sky"] { --goal-tone: var(--sky); }
.goal-card .goal-icon { color: var(--goal-tone); background: color-mix(in srgb, var(--goal-tone) 16%, var(--surface-2)); }
.goal-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.goal-card b { font-family: 'Fredoka', sans-serif; font-size: clamp(14px, 1.5vw, 18px); line-height: 1.1; }
.goal-card small { color: var(--ink-dim); font-size: 11.5px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goal-card > .ico:last-child { width: 15px; margin-left: auto; flex-shrink: 0; }

.library-view, .favorites-view, .tools-view { display: flex; flex-direction: column; gap: 12px; }
.library-head { flex: 0 0 auto; }
.library-head > div { min-width: 0; }
.library-head .btn-soft { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; }
.library-goals { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.goal-chip {
    appearance: none; min-height: 42px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-dim); font-family: 'Nunito', sans-serif; font-weight: 850;
}
.goal-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--primary-ink); background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.library-grid { flex: 1; min-height: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.library-grid .game-card { min-height: min(185px, 100cqh); }
.card-meta { color: var(--primary-ink); font-size: 11px; font-weight: 850; }

.empty-library { flex: 1; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; color: var(--ink-dim); }
.empty-library > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; background: var(--surface-2); color: var(--sun); }
.empty-library h3 { color: var(--ink); font-family: 'Fredoka', sans-serif; font-size: 24px; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tools-game-grid { grid-template-columns: repeat(2, minmax(0, 280px)); }

.game-load-error {
    position: absolute; z-index: 80; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    width: min(560px, calc(100% - 32px)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
    padding: 18px; border: 2px solid var(--coral); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.game-load-error > span { color: var(--coral); }
.game-load-error h3 { font-family: 'Fredoka', sans-serif; }
.game-load-error p { color: var(--ink-dim); font-size: 13px; font-weight: 700; }
body.is-game-loading .hub::after {
    content: 'Opening game…'; position: absolute; z-index: 90; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    padding: 14px 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 900; box-shadow: var(--shadow-md);
}

/* Guided path artwork and responsive card geometry live together in hub.css. */

@media (max-width: 900px) {
    .continue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .continue-grid > :nth-child(n+3) { display: none; }
    .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .home-view { gap: 7px; }
    .home-topline h2 { font-size: 21px; }
    .player-setup-card { min-width: 0; padding: 7px 9px; }
    .player-setup-card > .ico:first-child { display: none; }
    .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(56px, 1fr)); }
    .goal-card { min-height: 56px; padding: 7px 8px; }
    .goal-icon { width: 34px; height: 34px; flex-basis: 34px; }
    .goal-card small { -webkit-line-clamp: 1; }
    .library-goals { flex-wrap: nowrap; overflow: hidden; }
    .goal-chip { min-width: 44px; flex: 1 1 0; padding-inline: 7px; font-size: 0; }
    .goal-chip::first-letter { font-size: 14px; }
    .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .home-topline { align-items: stretch; }
    .home-topline .path-eyebrow { display: none; }
    .player-setup-card { max-width: 48%; }
    .player-setup-card small { display: none; }
    .home-section-head > span { display: none; }
    .continue-grid { grid-template-columns: minmax(0, 1fr); }
    .continue-grid > :nth-child(n+2) { display: none; }
    .home-path-card { min-height: 58px; }
    .home-path-card span span { display: none; }
    .browse-all-card { min-height: 48px; }
    .library-head p { display: none; }
    .library-grid .card-meta { display: none; }
    .tools-grid { grid-template-columns: minmax(0, 1fr); }
    .tools-game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .game-load-error { grid-template-columns: auto minmax(0, 1fr); }
    .game-load-error button { grid-column: span 1; }
}

/* ============ Beginner home ============
 *
 * Home is a launch surface, not a dashboard.  Three large first choices are
 * enough for an early gaze learner; history, goals, favourites and clinician
 * utilities remain available after More games or Player setup. */
body.on-hub.starter-home .app { grid-template-columns: minmax(0, 1fr); }
body.on-hub.starter-home .rail { display: none; }
body.on-hub.starter-home .access-bar { flex-wrap: nowrap; min-height: 62px; }
body.on-hub.starter-home .access-bar .access-group,
body.on-hub.starter-home .access-bar .bar-tools,
body.on-hub.starter-home .access-hint { display: none !important; }
body.on-hub.starter-home .brand-logo { height: clamp(62px, min(8vw, calc(10 * var(--vh))), 88px); }

body.on-hub.starter-home .home-view {
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: clamp(9px, 1.5vh, 16px); min-height: 0;
}
.starter-home-head {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.starter-home-head h2 {
    margin: 0; color: var(--ink); font-size: clamp(28px, 4vw, 46px); line-height: 1;
}
.starter-home-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.starter-mode-status {
    min-height: 54px; padding: 9px 17px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    border: 2px solid color-mix(in srgb, var(--gaze) 58%, var(--line-strong)); border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--gaze) 10%, var(--surface)); color: #79DFF2;
    font: 600 clamp(15px, 1.55vw, 19px) 'Fredoka', sans-serif; white-space: nowrap;
}
.starter-mode-status .ico { width: 23px; height: 23px; }
.starter-setup {
    appearance: none; min-height: 58px; padding: 9px 16px;
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    border: 2px solid var(--line-strong); border-radius: var(--radius-pill);
    background: var(--surface); color: var(--ink); font-family: 'Nunito', sans-serif; text-align: left;
}
.starter-setup > .ico { width: 24px; height: 24px; color: var(--mint); }
.starter-setup > span { display: flex; flex-direction: column; }
.starter-setup b { font-size: 16px; }
.starter-setup small { color: var(--ink-dim); font-size: 11px; font-weight: 800; }
.starter-setup:hover { border-color: var(--accent); }

.starter-games {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(152px, 1.2fr) minmax(130px, 1fr);
    gap: clamp(10px, 1.2vw, 16px); min-height: 0;
}
.starter-game {
    appearance: none; position: relative; min-width: 0; min-height: 0; overflow: hidden;
    display: grid; grid-template-columns: minmax(130px, .9fr) minmax(0, 1.2fr) auto; align-items: center;
    gap: clamp(10px, 1.4vw, 20px); padding: 0 clamp(14px, 2vw, 26px) 0 0;
    border: 3px solid var(--line-strong); border-radius: 24px;
    background: var(--surface); color: var(--ink); cursor: pointer; text-align: left;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.starter-fireworks { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--gaze) 78%, var(--line-strong)); }
.starter-bubbles { border-color: color-mix(in srgb, var(--sky) 72%, var(--line-strong)); }
.starter-acorn { border-color: color-mix(in srgb, var(--mint) 72%, var(--line-strong)); }
.starter-game:hover,
.starter-game:focus-visible {
    transform: translateY(-2px); border-color: var(--accent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow-md);
}
.starter-art { align-self: stretch; min-width: 0; overflow: hidden; }
.starter-art .art { display: block; width: 100%; height: 100%; }
.starter-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.starter-copy b { font: 600 clamp(23px, 3.1vw, 42px)/1.02 'Fredoka', sans-serif; }
.starter-copy span { color: var(--ink); font-size: clamp(16px, 1.75vw, 23px); font-weight: 750; line-height: 1.25; }
.starter-play {
    width: clamp(58px, 7vw, 84px); height: clamp(58px, 7vw, 84px); border-radius: 50%;
    display: grid; place-items: center; color: #fff; background: var(--coral);
    border: 4px solid var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.3); flex-shrink: 0;
}
.starter-play .ico { width: 52%; height: 52%; }

.starter-more { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.starter-more button {
    appearance: none; min-height: 62px; padding: 10px 18px;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
    border: 2px solid color-mix(in srgb, var(--gaze) 70%, var(--line-strong)); border-radius: 18px;
    background: var(--surface); color: var(--ink); cursor: pointer;
    font: 600 clamp(18px, 2vw, 24px) 'Fredoka', sans-serif; text-align: left;
}
.starter-more button:last-child { border-color: color-mix(in srgb, var(--mint) 70%, var(--line-strong)); }
.starter-more button:hover { border-color: var(--accent); background: var(--surface-2); }
.starter-more .ico { width: 27px; height: 27px; color: var(--sky); }
.starter-more button:last-child .ico { color: var(--mint); }
.starter-more .ico:last-child { width: 20px; height: 20px; justify-self: end; color: var(--ink); }
.starter-reassurance { margin: 0; color: var(--ink-dim); font-size: 14px; font-weight: 750; text-align: center; }

body.big-targets .starter-game { border-width: 4px; }
body.big-targets .starter-more button { min-height: 72px; }
body.is-tight .starter-home-head h2 { font-size: 27px; }
body.is-tight .starter-game { border-radius: 19px; }
body.is-tight .starter-copy b { font-size: clamp(21px, 2.7vw, 32px); }
body.is-tight .starter-copy span { font-size: clamp(14px, 1.55vw, 19px); }
body.is-tighter .starter-reassurance { display: none; }

@media (max-width: 760px) {
    body.on-hub.starter-home .access-bar { min-height: 48px; }
    body.on-hub.starter-home .brand-logo { height: 52px; }
    .starter-home-head { align-items: flex-start; }
    .starter-home-tools { gap: 6px; }
    .starter-mode-status { min-height: 48px; padding: 7px 11px; }
    .starter-mode-status span { display: none; }
    .starter-setup { min-height: 48px; padding: 7px 11px; }
    .starter-setup small { display: none; }
    .starter-games { grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(104px, 1fr)); gap: 9px; }
    .starter-fireworks { grid-column: auto; }
    .starter-game { grid-template-columns: minmax(90px, .7fr) minmax(0, 1.4fr) 54px; border-radius: 18px; padding-right: 12px; }
    .starter-play { width: 52px; height: 52px; border-width: 3px; }
    .starter-copy b { font-size: clamp(20px, 5.2vw, 29px); }
    .starter-copy span { font-size: clamp(13px, 3.5vw, 17px); }
    .starter-more { gap: 8px; }
    .starter-more button { min-height: 54px; padding: 8px 11px; gap: 8px; font-size: 16px; }
    .starter-more .ico { width: 22px; height: 22px; }
}

@media (max-width: 470px) {
    .starter-home-head h2 { font-size: 24px; }
    .starter-mode-status { display: none; }
    .starter-setup b { font-size: 14px; }
    .starter-game { grid-template-columns: 84px minmax(0, 1fr) 46px; }
    .starter-play { width: 46px; height: 46px; }
    .starter-more button > .ico:first-child { display: none; }
    .starter-more button { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Shared game header: direct controls on roomy screens, one predictable menu on phones. */
.game-more-wrap { position: relative; display: none; flex: 0 0 auto; }
.more-btn {
    appearance: none; min-height: 48px; display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); font: 800 14px 'Nunito', sans-serif;
}
.game-more-menu {
    position: absolute; z-index: 95; top: calc(100% + 6px); right: 0; width: min(230px, 74vw);
    padding: 7px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.game-more-menu button {
    appearance: none; width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 800 14px 'Nunito', sans-serif; text-align: left;
}
.game-more-menu button:hover { background: var(--surface-2); }
.game-more-menu .ico { width: 19px; color: var(--primary-ink); }
.shared-completion {
    position: absolute; z-index: 70; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(620px, calc(100% - 32px));
    padding: clamp(20px, 4vw, 34px); border: 2px solid var(--mint); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); text-align: center;
}
.shared-completion h3 { font-family: 'Fredoka', sans-serif; font-size: clamp(23px, 3vw, 32px); }
.shared-completion > div { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.shared-completion button { min-height: 52px; }
.partner-game-options {
    display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; flex: 0 0 auto;
    color: var(--ink-dim); font-size: 12px; font-weight: 850;
}
.partner-game-options button {
    appearance: none; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px;
    background: var(--surface); color: var(--ink-dim); font: 800 12px 'Nunito', sans-serif; cursor: pointer;
}
.partner-game-options button[aria-pressed="true"] { color: var(--ink); border-color: var(--primary-ink); background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.ce-show-scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; color: var(--sun); }
.ce-show-scene > span { position: absolute; opacity: 0; transition: opacity .35s ease, transform .35s ease; }
.ce-show-scene .show-stars { left: 12%; top: 12%; font-size: clamp(32px, 8vw, 76px); }
.ce-show-scene .show-moon { right: 15%; top: 8%; font-size: clamp(48px, 11vw, 100px); }
.ce-show-scene .show-hill { left: -5%; right: -5%; bottom: -16%; height: 48%; border-radius: 50% 50% 0 0; background: color-mix(in srgb, var(--mint) 48%, #081d28); }
.ce-show-scene .show-trees { left: 22%; bottom: 14%; color: var(--mint); font-size: clamp(34px, 8vw, 78px); letter-spacing: .2em; }
.ce-show-scene .show-finale { left: 50%; top: 20%; transform: translateX(-50%) scale(.5); font-size: clamp(70px, 18vw, 160px); }
.ce-show-scene[data-step="1"] .show-stars,
.ce-show-scene[data-step="2"] .show-stars, .ce-show-scene[data-step="2"] .show-moon,
.ce-show-scene[data-step="3"] .show-stars, .ce-show-scene[data-step="3"] .show-moon, .ce-show-scene[data-step="3"] .show-hill,
.ce-show-scene[data-step="4"] .show-stars, .ce-show-scene[data-step="4"] .show-moon, .ce-show-scene[data-step="4"] .show-hill, .ce-show-scene[data-step="4"] .show-trees,
.ce-show-scene[data-step="5"] > span { opacity: 1; }
.ce-show-scene[data-step="5"] .show-finale { transform: translateX(-50%) scale(1); }
.choice-card-picture { display: block; width: min(48%, 190px); max-height: 52%; object-fit: contain; margin: 0 auto 8px; border-radius: 16px; }
.choice-card-emoji { font-size: clamp(48px, 10vw, 96px); line-height: 1; text-align: center; }
.ah-resume-card {
    position: absolute; z-index: 25; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 28px)); padding: clamp(17px, 3vw, 26px); border: 2px solid var(--sun); border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-lg);
}
.ah-resume-card h3 { font-family: 'Fredoka', sans-serif; font-size: clamp(21px, 3vw, 29px); }
.ah-resume-card > p:not(.path-eyebrow) { margin-top: 6px; color: var(--ink-dim); font-size: 13px; font-weight: 700; line-height: 1.45; }
.ah-resume-card > div { display: flex; gap: 8px; margin-top: 14px; }
.ah-aac-panel { display: flex; gap: 5px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px; border: 1px dashed color-mix(in srgb, var(--mint) 48%, var(--line)); border-radius: 13px; }
.ah-aac-panel > span { width: 100%; color: var(--ink-dim); font-size: 10px; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.ah-aac-panel button { appearance: none; min-height: 36px; min-width: 52px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--mint); font: 900 13px 'Nunito', sans-serif; }
body.mode-switch .ah-aac-panel, body.mode-dwell .ah-aac-panel { opacity: .78; }

@media (max-width: 620px) {
    .game-more-wrap { display: block; }
    .game-head > .fav-btn, .game-head > #gaze-session-open, .game-head > #fullscreen-toggle { display: none !important; }
    .game-title .em { display: none; }
    .game-title > [id^="head-title-"] { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.05; }
    .game-title { flex: 1; font-size: clamp(18px, 5.5vw, 24px); }
    .more-btn span { display: none; }
    .more-btn { width: 48px; justify-content: center; padding-inline: 8px; }
}
@media (max-height: 620px) {
    .partner-game-options > span { display: none; }
    .partner-game-options button { min-height: 34px; padding-block: 4px; }
}

@media (max-height: 760px) {
    .home-topline h2 { font-size: 24px; }
    .player-setup-card { min-height: 48px; }
    .continue-card, .continue-art { min-height: 58px; }
    .home-path-card { min-height: 52px; padding-block: 6px; }
    .goal-grid { grid-template-rows: repeat(2, minmax(48px, 1fr)); }
    .goal-card { min-height: 48px; padding-block: 5px; }
    .goal-card small { display: none; }
    .browse-all-card { min-height: 46px; padding-block: 5px; }
}
@media (max-height: 560px) {
    .continue-section { display: none; }
}

/* Quick Setup sits in the existing modal so it inherits focus, scanning, and preview behavior. */
.quick-setup { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 12px; }
.quick-setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quick-setup-head h3 { font-family: 'Fredoka', sans-serif; font-size: clamp(22px, 3vw, 30px); }
.quick-dirty { padding: 7px 10px; border-radius: 999px; color: var(--sun); background: color-mix(in srgb, var(--sun) 12%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--sun) 44%, var(--line)); font-size: 12px; font-weight: 850; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1; min-height: 0; }
.quick-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.quick-card legend { padding: 0 7px; color: var(--ink); font-family: 'Fredoka', sans-serif; font-size: 16px; font-weight: 650; }
.quick-card legend span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 5px; border-radius: 8px; background: color-mix(in srgb, var(--primary) 20%, var(--surface)); color: var(--primary-ink); }
.quick-card > small { display: block; margin-top: 7px; color: var(--ink-dim); font-size: 11.5px; font-weight: 650; }
.quick-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
#quick-mode { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-options button {
    appearance: none; min-height: 48px; padding: 7px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); color: var(--ink-dim); font-family: 'Nunito', sans-serif; font-weight: 850; cursor: pointer;
}
.quick-options button[aria-pressed="true"] { color: var(--ink); border-color: var(--primary-ink); background: color-mix(in srgb, var(--primary) 19%, var(--surface)); }
.quick-options button .ico { width: 18px; vertical-align: middle; margin-right: 4px; }
.quick-feedback { display: flex; gap: 8px; margin-bottom: 8px; }
.quick-feedback label { flex: 1; display: flex; align-items: center; gap: 7px; min-height: 46px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 800; }
.quick-effects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; flex: 0 0 auto; }
#settings.is-quick .sheet-foot { display: none; }

@media (max-width: 720px) {
    .quick-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(4, auto); }
    .quick-card { padding: 8px; }
    .quick-options button { min-height: 44px; font-size: 12px; }
    .quick-card > small { display: none; }
}
@media (max-width: 480px) {
    .quick-setup { gap: 7px; }
    .quick-grid { gap: 6px; }
    .quick-card legend { font-size: 14px; }
    .quick-feedback label { min-height: 40px; padding: 5px 7px; font-size: 12px; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .quick-actions > span { display: none; }
    #quick-advanced { grid-column: 1 / -1; }
}

/* ============ Beginner shell beyond Home ============
 *
 * More games, paths, favorites, and tools keep the same quiet full-width
 * frame as the starter screen. The old rail and dense access toolbar remain
 * in the document for backward-compatible integrations, but are not competing
 * gaze targets while a beginner is choosing what to do next. */
body.on-hub.beginner-shell .app { grid-template-columns: minmax(0, 1fr); }
body.on-hub.beginner-shell .rail { display: none; }
body.on-hub.beginner-shell .access-bar { flex-wrap: nowrap; min-height: 62px; }
body.on-hub.beginner-shell .access-bar .access-group,
body.on-hub.beginner-shell .access-bar .bar-tools,
body.on-hub.beginner-shell .access-hint { display: none !important; }
body.on-hub.beginner-shell .brand-logo { height: clamp(62px, min(8vw, calc(10 * var(--vh))), 88px); }

.beginner-view-head {
    display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center;
    gap: clamp(12px, 1.8vw, 24px); flex: 0 0 auto;
}
.beginner-back {
    appearance: none; min-width: 126px; min-height: 58px; padding: 10px 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    border: 2px solid var(--line-strong); border-radius: var(--radius-pill);
    background: var(--surface); color: var(--ink); cursor: pointer;
    font: 800 17px 'Nunito', sans-serif;
}
.beginner-back:hover, .beginner-back:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.beginner-back .ico { width: 24px; height: 24px; }
.beginner-view-copy { min-width: 0; }
.beginner-view-copy h2 { margin: 0; font-size: clamp(28px, 3.5vw, 42px); line-height: 1; }
.beginner-view-copy p { margin: 5px 0 0; color: var(--ink-dim); font-size: 15px; font-weight: 750; }
.beginner-view-tools { justify-self: end; }

.library-view { position: relative; overflow: hidden; }
.library-main {
    height: 100%; min-height: 0; display: flex; flex-direction: column;
    gap: clamp(8px, 1.2vh, 13px);
}
.beginner-library-actions, .beginner-subnav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex: 0 0 auto;
}
.beginner-library-actions button, .beginner-subnav button {
    appearance: none; min-width: 0; min-height: 68px; padding: 10px 14px;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
    border: 2px solid color-mix(in srgb, var(--sky) 60%, var(--line-strong)); border-radius: 18px;
    background: var(--surface); color: var(--ink); cursor: pointer; text-align: left;
    font: 600 clamp(16px, 1.6vw, 21px) 'Fredoka', sans-serif;
}
.beginner-library-actions button:nth-child(2), .beginner-subnav button:nth-child(2) { border-color: color-mix(in srgb, var(--mint) 60%, var(--line-strong)); }
.beginner-library-actions button:nth-child(3), .beginner-subnav button:nth-child(3) { border-color: color-mix(in srgb, var(--sun) 60%, var(--line-strong)); }
.beginner-library-actions button:nth-child(4) { border-color: color-mix(in srgb, var(--coral) 60%, var(--line-strong)); }
.beginner-library-actions button:hover, .beginner-library-actions button:focus-visible,
.beginner-subnav button:hover, .beginner-subnav button:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.beginner-library-actions button > .ico:first-child, .beginner-subnav button > .ico:first-child { width: 27px; height: 27px; color: var(--sky); }
.beginner-library-actions button > .ico:last-child, .beginner-subnav button > .ico:last-child { width: 20px; height: 20px; justify-self: end; }
.beginner-library-actions button > span:first-of-type { min-width: 0; }
.beginner-library-actions button > span:first-of-type b,
.beginner-library-actions button > span:first-of-type small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beginner-library-actions button > span:first-of-type small { margin-top: 2px; color: var(--ink-dim); font: 800 11px 'Nunito', sans-serif; }
.beginner-library-summary { margin: 0; color: var(--ink-dim); font-size: 14px; font-weight: 800; }

body.beginner-shell .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(148px, 1fr); gap: 13px;
}
body.beginner-shell .library-grid .game-card,
body.beginner-shell .tools-game-grid .game-card {
    container-type: normal; min-height: 148px; max-height: none;
    display: grid; grid-template-columns: minmax(126px, .72fr) minmax(0, 1.3fr) 62px; align-items: stretch;
    border: 2px solid color-mix(in srgb, var(--tone, var(--sky)) 62%, var(--line-strong)); border-radius: 22px;
}
body.beginner-shell .library-grid .card-art,
body.beginner-shell .tools-game-grid .card-art { min-height: 100%; }
body.beginner-shell .library-grid .card-art::after,
body.beginner-shell .tools-game-grid .card-art::after { display: none; }
body.beginner-shell .library-grid .card-body,
body.beginner-shell .tools-game-grid .card-body { align-self: center; padding: 14px 16px; gap: 6px; }
body.beginner-shell .library-grid .card-title,
body.beginner-shell .tools-game-grid .card-title { font-size: clamp(22px, 2.2vw, 30px); }
body.beginner-shell .library-grid .card-desc,
body.beginner-shell .tools-game-grid .card-desc { min-height: 0; color: var(--ink); font-size: clamp(14px, 1.3vw, 17px); font-weight: 720; }
body.beginner-shell .library-grid .card-meta,
body.beginner-shell .library-grid .card-modes,
body.beginner-shell .tools-game-grid .card-meta,
body.beginner-shell .tools-game-grid .card-modes { display: none; }
.card-play { display: none; }
body.beginner-shell .library-grid .card-play,
body.beginner-shell .tools-game-grid .card-play {
    display: grid; place-self: center; place-items: center; width: 52px; height: 52px;
    border: 3px solid var(--accent); border-radius: 50%; background: var(--coral); color: #fff;
}
body.beginner-shell .library-grid .card-play .ico,
body.beginner-shell .tools-game-grid .card-play .ico { width: 27px; height: 27px; }
body.beginner-shell .library-grid + .fit-pager .fit-page-btn { min-height: 62px; max-width: 340px; border-width: 2px; }

.library-filter-panel {
    position: absolute; z-index: 75; inset: 0; min-height: 0;
    display: flex; flex-direction: column; gap: clamp(12px, 2vh, 20px);
    padding: clamp(16px, 2.5vw, 30px); border: 2px solid color-mix(in srgb, var(--gaze) 70%, var(--line-strong));
    border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.library-filter-panel[hidden] { display: none !important; }
.library-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: 0 0 auto; }
.library-filter-head h3 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.library-filter-head p { margin: 5px 0 0; color: var(--ink-dim); font-size: 15px; font-weight: 750; }
.beginner-filter-close {
    appearance: none; min-width: 126px; min-height: 58px; padding: 10px 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    border: 2px solid var(--line-strong); border-radius: var(--radius-pill);
    background: var(--surface); color: var(--ink); cursor: pointer; font: 800 17px 'Nunito', sans-serif;
}
.library-filter-panel .library-goals {
    flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(88px, 1fr)); gap: 12px; overflow: visible;
}
.beginner-goal-option {
    --goal-tone: var(--sky); appearance: none; min-width: 0; min-height: 82px; padding: 12px 16px;
    display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 13px;
    border: 2px solid color-mix(in srgb, var(--goal-tone) 55%, var(--line-strong)); border-radius: 20px;
    background: var(--surface); color: var(--ink); cursor: pointer; text-align: left;
}
.beginner-goal-option[data-tone="coral"] { --goal-tone: var(--coral); }
.beginner-goal-option[data-tone="mint"] { --goal-tone: var(--mint); }
.beginner-goal-option[data-tone="sun"] { --goal-tone: var(--sun); }
.beginner-goal-option[data-tone="sky"] { --goal-tone: var(--sky); }
.beginner-goal-option[aria-pressed="true"] { border-width: 4px; background: color-mix(in srgb, var(--goal-tone) 14%, var(--surface)); }
.beginner-goal-option:hover, .beginner-goal-option:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.beginner-goal-option .goal-icon { width: 52px; height: 52px; color: var(--goal-tone); }
.beginner-goal-option > span:nth-child(2) { min-width: 0; }
.beginner-goal-option b, .beginner-goal-option small { display: block; }
.beginner-goal-option b { font: 600 clamp(18px, 1.8vw, 22px)/1.08 'Fredoka', sans-serif; }
.beginner-goal-option small { display: none; margin-top: 3px; color: var(--ink-dim); font-size: 13px; font-weight: 700; line-height: 1.25; }
.beginner-goal-option > .ico:last-child { width: 22px; height: 22px; }

.favorites-view, .tools-view { gap: clamp(10px, 1.4vh, 16px); }
.beginner-subnav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tools-view .tools-grid { gap: 13px; }
.tools-view .tool-action-card { min-height: 78px; border-width: 2px; border-radius: 20px; }
.tools-view .tool-action-card b { font-size: 21px; }
.tools-game-grid { flex: 1; min-height: 0; max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }

body.on-hub.beginner-shell .paths-screen .game-head { flex-wrap: nowrap; }
body.on-hub.beginner-shell .paths-screen .game-title { min-width: 0; }
.starter-path-tools { margin-left: auto; }

@media (max-width: 760px) {
    body.on-hub.beginner-shell .access-bar { min-height: 48px; }
    body.on-hub.beginner-shell .brand-logo { height: 52px; }
    .beginner-view-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
    .beginner-back { min-width: 50px; min-height: 50px; padding: 7px 10px; }
    .beginner-back span { display: none; }
    .beginner-view-copy h2 { font-size: clamp(23px, 6.3vw, 31px); }
    .beginner-view-copy p { display: none; }
    .beginner-view-tools { gap: 5px; }
    .beginner-view-tools .starter-mode-status { min-height: 50px; padding: 7px 10px; }
    .beginner-view-tools .starter-mode-status span { display: none; }
    .beginner-view-tools .starter-setup { min-height: 50px; padding: 7px 10px; }
    .beginner-view-tools .starter-setup small { display: none; }
    .beginner-library-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .beginner-library-actions button { min-height: 58px; padding: 8px 10px; font-size: 16px; }
    .beginner-subnav { gap: 7px; }
    .beginner-subnav button { min-height: 54px; padding: 7px 9px; gap: 6px; font-size: 14px; }
    .beginner-subnav button > .ico:first-child { width: 21px; height: 21px; }
    .beginner-subnav button > .ico:last-child { display: none; }
    body.beginner-shell .library-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(108px, 1fr); gap: 9px; }
    body.beginner-shell .library-grid .game-card,
    body.beginner-shell .tools-game-grid .game-card { min-height: 108px; grid-template-columns: 96px minmax(0, 1fr) 50px; border-radius: 17px; }
    body.beginner-shell .library-grid .card-body,
    body.beginner-shell .tools-game-grid .card-body { padding: 9px 11px; gap: 3px; }
    body.beginner-shell .library-grid .card-title,
    body.beginner-shell .tools-game-grid .card-title { font-size: clamp(19px, 5vw, 24px); }
    body.beginner-shell .library-grid .card-desc,
    body.beginner-shell .tools-game-grid .card-desc { font-size: 13px; -webkit-line-clamp: 1; }
    body.beginner-shell .library-grid .card-play,
    body.beginner-shell .tools-game-grid .card-play { width: 44px; height: 44px; border-width: 2px; }
    .library-filter-panel { padding: 13px; border-radius: 18px; }
    .library-filter-head h3 { font-size: clamp(24px, 7vw, 32px); }
    .library-filter-head p { display: none; }
    .beginner-filter-close { min-width: 50px; min-height: 50px; padding: 7px 10px; }
    .beginner-filter-close span { display: none; }
    .library-filter-panel .library-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(72px, 1fr)); gap: 8px; }
    .beginner-goal-option { min-height: 72px; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 15px; }
    .beginner-goal-option .goal-icon { width: 40px; height: 40px; }
    .beginner-goal-option b { font-size: 15px; line-height: 1.05; }
    .beginner-goal-option small { display: none; }
    .beginner-goal-option > .ico:last-child { display: none; }
    .tools-view .tools-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .tools-view .tool-action-card { min-height: 60px; }
    .tools-game-grid { grid-template-columns: minmax(0, 1fr); }
    .starter-path-tools .starter-mode-status { display: none; }
    .starter-path-tools .starter-setup { min-height: 48px; padding: 7px 10px; }
    .starter-path-tools .starter-setup small { display: none; }
}

@media (max-width: 470px) {
    .beginner-view-tools .starter-mode-status { display: none; }
    .beginner-view-tools .starter-setup b { font-size: 13px; }
    .beginner-library-actions button > .ico:first-child { display: none; }
    .beginner-library-actions button { grid-template-columns: minmax(0, 1fr) auto; }
    .beginner-subnav button > .ico:first-child { display: none; }
    .beginner-subnav button { display: flex; justify-content: center; text-align: center; }
    .starter-path-tools { display: flex; }
    .starter-path-tools .starter-setup { width: 50px; justify-content: center; }
    .starter-path-tools .starter-setup > span { display: none; }
    body.on-hub.beginner-shell .paths-screen .game-title { font-size: clamp(18px, 5.2vw, 23px); }
    body.on-hub.beginner-shell .paths-screen .path-head-icon { display: none; }
}

@media (max-width: 360px) {
    .beginner-goal-option { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .beginner-goal-option .goal-icon { display: none; }
}
