/* A quiet library around a high-contrast play arena. Game signal colours
   remain in the game engines, separate from this navigation palette. */
:root {
  --focus-ink: #203d43;
  --focus-muted: #526d6e;
  --focus-green: #286754;
  --focus-paper: #fffef9;
  --focus-line: #d5e1d7;
  --focus-arena: #152b3e;
}
body {
  color: var(--focus-ink);
  background: radial-gradient(ellipse at 0 0, #e3eee3, transparent 45%),
    radial-gradient(ellipse at 100% 30%, #f5e8d6, transparent 40%), #f5f5ec;
  padding: clamp(12px, 2.5vw, 28px);
}
body > header {
  background: #fffef9ee;
  border: 1px solid var(--focus-line);
  padding: 14px 20px;
  box-shadow: 0 6px 24px #27473e08;
  margin-bottom: 24px;
}
.focus-brand { display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-height: 56px; }
.focus-brand img { object-fit: contain; }
.focus-brand h1 { color: var(--focus-ink); background: none; -webkit-text-fill-color: currentColor; letter-spacing: -.02em; }
.focus-age { color: var(--focus-muted); }
#levelBadge, .focus-streak { display: none; }
.focus-header-controls { flex-wrap: wrap; gap: 8px; }
.focus-header-controls > div:not(.focus-streak) { background: #eff4e9; border-color: var(--focus-line); }
.focus-header-controls > div span { color: var(--focus-green); }
.focus-home-link { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; font-size: 14px; color: var(--focus-green); text-decoration: underline; text-underline-offset: 4px; }
.focus-home-link span { background: #e6eee3; padding: 3px 6px; border-radius: 8px; font-size: 12px; }
#audioToggleBtn, #settingsBtn, #arenaHud button, #closeSettingsBtn {
  width: 48px; height: 48px; min-width: 48px; min-height: 48px;
  background: #e7efe5; border: 1px solid #c5d8ca; color: var(--focus-green); box-shadow: none;
}
button, a, input { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #246b87; outline-offset: 4px; }
.focus-welcome {
  display: grid; grid-template-columns: 1fr 270px; align-items: center; gap: 24px;
  padding: 28px 36px; margin-bottom: 28px; border-radius: 28px;
  background: linear-gradient(115deg, #e7efe2, #f5f0df); border: 1px solid #dce5d2;
}
.focus-kicker { color: var(--focus-green); font-size: 12px; font-weight: 600; letter-spacing: .13em; }
.focus-welcome h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; margin: 12px 0; }
.focus-welcome p { max-width: 550px; color: var(--focus-muted); font-size: 17px; line-height: 1.6; }
.focus-promise { display: block; margin-top: 14px; font-size: 13px; color: #426756; }
.focus-welcome-art { position: relative; height: 240px; }
.focus-welcome-art img:first-child { position: absolute; left: 0; top: 15px; transform: rotate(-12deg); }
.focus-welcome-art img:last-child { position: absolute; right: 0; bottom: 5px; }
.focus-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.focus-library-heading h2 { font-size: clamp(23px, 2.5vw, 30px); font-weight: 600; letter-spacing: -.02em; }
.focus-search-label { font-size: 12px; color: var(--focus-muted); display: flex; flex-direction: column; gap: 5px; width: 280px; }
#focusSearch { height: 52px; width: 100%; border: 1px solid #becfbe; border-radius: 14px; padding: 0 16px; background: var(--focus-paper); color: var(--focus-ink); font-size: 16px; user-select: text; -webkit-user-select: text; }
#focusSearch::placeholder { color: #62766d; }
#catPillBar { overflow: visible; mask-image: none; -webkit-mask-image: none; margin: 0; padding: 0; }
#catPillBar > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
#catPillBar .cat-pill { min-height: 48px; border-radius: 14px; padding: 10px 16px; background: var(--focus-paper); color: var(--focus-muted); border: 1px solid var(--focus-line); box-shadow: none; font-size: 14px; font-weight: 500; cursor: pointer; }
#catPillBar .cat-pill[aria-pressed="true"] { background: var(--focus-green); border-color: var(--focus-green); color: white; }
.focus-library-status { color: var(--focus-muted); font-size: 13px; margin: 16px 0 12px; }
#gamesGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; overflow: visible; padding: 0 0 24px; }
.focus-card { position: relative; display: flex; flex-direction: column; background: var(--focus-paper); border: 1px solid var(--focus-line); border-radius: 24px; padding: 12px; box-shadow: 0 4px 12px #324e3506; transition: border-color .2s; min-width: 0; }
.focus-card:hover, .focus-card:active { transform: none; border-color: #84a895; }
.focus-card:focus-within { outline: 3px solid #246b87; outline-offset: 3px; }
.focus-card-art { height: 172px; display: grid; place-items: center; border-radius: 16px; background: radial-gradient(ellipse at 50% 100%, #cbdcc5aa, transparent 60%), #edf3e7; overflow: hidden; position: relative; }
.focus-card[data-category="memory"] .focus-card-art, .focus-card[data-category="dyslexia"] .focus-card-art { background: #e9f0f4; }
.focus-card[data-category="flex"] .focus-card-art, .focus-card[data-category="dyscalculia"] .focus-card-art { background: #f5eddf; }
.focus-card[data-category="calm"] .focus-card-art, .focus-card[data-category="dysgraphia"] .focus-card-art { background: #e6efec; }
.focus-card[data-category="focus"] .focus-card-art, .focus-card[data-category="asd"] .focus-card-art { background: #f2e9e6; }
.focus-art { position: relative; z-index: 1; object-fit: contain; max-width: 100%; pointer-events: none; }
.focus-card-orbit { position: absolute; width: 120px; height: 120px; border: 1px solid #ffffffb0; border-radius: 50%; transform: rotate(-25deg) scaleX(1.5); }
.focus-card-copy { padding: 14px 6px 12px; flex: 1; }
.focus-card-skill { color: var(--focus-green); font-size: 11px; letter-spacing: .06em; font-weight: 500; }
.focus-card h3 { font-size: 19px; line-height: 1.2; font-weight: 600; margin: 6px 0; }
.focus-card p { color: var(--focus-muted); font-size: 14px; line-height: 1.5; }
.focus-card-play { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; padding: 10px 16px; border-radius: 12px; background: #edf3e7; color: #245a49; font-size: 15px; font-weight: 500; cursor: pointer; }
.focus-card-play::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.focus-card-play:focus-visible { outline: none; }
.focus-empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; border: 1px solid var(--focus-line); border-radius: 24px; background: var(--focus-paper); }
.focus-empty h3 { font-size: 24px; margin-bottom: 12px; }
.focus-empty p { color: var(--focus-muted); }
.focus-empty button { min-height: 52px; margin-top: 20px; padding: 10px 20px; border-radius: 14px; background: var(--focus-green); color: white; }
.focus-caregiver-guide { border: 1px solid var(--focus-line); border-radius: 24px; padding: clamp(16px, 3vw, 28px); background: var(--focus-paper); margin-top: 16px; }
.focus-caregiver-guide h2 { font-size: clamp(22px, 3vw, 28px); margin: 8px 0 20px; line-height: 1.3; }
.focus-caregiver-guide details { border-top: 1px solid var(--focus-line); }
.focus-caregiver-guide summary { min-height: 56px; padding: 16px 0; cursor: pointer; font-weight: 600; line-height: 1.5; }
.focus-caregiver-guide p { font-size: 15px; line-height: 1.7; color: var(--focus-muted); padding-bottom: 18px; max-width: 78ch; }
.focus-guide-links { display: flex; flex-wrap: wrap; column-gap: 24px; margin-top: 12px; }
.focus-guide-links a { display: inline-flex; align-items: center; min-height: 48px; color: var(--focus-green); text-decoration: underline; text-underline-offset: 3px; }
#arenaHud { background: var(--focus-paper); border-color: var(--focus-line); box-shadow: none; }
#activeGameTitle { color: var(--focus-ink); }
#activeGameDesc { color: var(--focus-muted); font-size: 13px; line-height: 1.45; }
#therapistInsight { background: #edf3e7; border-color: var(--focus-line); color: var(--focus-green); }
#currentGameLevelBadge { background: var(--focus-green); box-shadow: none; }
#levelGoalRatio { color: var(--focus-muted); }
#levelProgressTrack { background: #dee9de; }
#levelProgressBar { background: #659a78; }
#canvasContainerArena { background: var(--focus-arena); border-color: #b9ccce; box-shadow: inset 0 0 65px #101f3033; }
#introCard { background: #f8f8f0f7; color: var(--focus-ink); }
#introText { color: var(--focus-ink); line-height: 1.5; }
#introLevel { color: var(--focus-green); }
#introHearBtn { background: #e5eee4; border-color: #c5d8ca; color: var(--focus-green); }
#introPlayBtn, #saveSettingsBtn, #nextLevelModalBtn { background: var(--focus-green); color: white; box-shadow: none; min-height: 56px; }
#cheerText { background: #e8f2dc; color: #28523c; box-shadow: 0 4px 16px #0002; letter-spacing: 0; }
#settingsModal > div, #levelUpModal > div { background: var(--focus-paper); color: var(--focus-ink); border-color: var(--focus-line); }
#settingsModal h3, #levelUpModal h2 { color: var(--focus-ink); }
#levelUpTitle { color: var(--focus-ink); }
#levelUpDesc { color: var(--focus-muted); }
#levelUpModal > div > div { color: var(--focus-green); }
#levelUpModal > div > div span { color: var(--focus-green); }
#settingsRows > * { background: #edf2e8; border-color: var(--focus-line); }
#settingsRows .text-xs, #speedLabel { color: var(--focus-muted); }
#settingsRows input { accent-color: var(--focus-green); }
#resetProgressBtn { min-height: 48px; color: #994b40; border-color: #d3b0a3; }
body > footer[class] { color: var(--focus-muted); font-size: 12px; line-height: 1.6; padding-top: 20px; gap: 12px; }
body > footer a { display: inline-flex; align-items: center; min-height: 48px; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1000px) {
  #gamesGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .focus-welcome { grid-template-columns: 1fr 210px; padding: 28px; }
  .focus-home-link { font-size: 12px; padding-inline: 4px; }
}
@media (max-width: 760px) {
  #gamesGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body > header { padding: 12px; gap: 8px; }
  .focus-brand { min-height: 48px; }
  .focus-brand img { width: 44px; height: 44px; }
  .focus-header-controls > div:not(.focus-streak) { display: none; }
  .focus-header-controls { width: 100%; justify-content: flex-end; }
  .focus-home-link { margin-right: auto; font-size: 14px; }
  .focus-welcome { grid-template-columns: 1fr; position: relative; padding: 18px; margin-bottom: 20px; }
  .focus-welcome h2 { font-size: 26px; margin-block: 8px; }
  .focus-welcome p { font-size: 14px; line-height: 1.45; }
  .focus-promise { font-size: 12px; line-height: 1.4; margin-top: 8px; }
  .focus-welcome-art { display: none; }
  .focus-library-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .focus-search-label { width: 100%; }
  .focus-card { padding: 8px; border-radius: 20px; }
  .focus-card-art { height: 148px; }
  .focus-card-art .focus-art { width: 124px; height: 124px; }
  .focus-card h3 { font-size: 17px; }
  .focus-card p { font-size: 13px; }
  .focus-card-copy { padding-inline: 4px; }
  #catPillBar .cat-pill { padding-inline: 12px; font-size: 13px; }
}
@media (max-width: 359px) {
  #gamesGrid { grid-template-columns: 1fr; }
  .focus-header-controls > div:not(.focus-streak) { display: none; }
  .focus-welcome { padding: 20px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  body.in-game { padding: 8px; }
  #arenaHud { padding: 8px; }
  #activeGameDesc { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
body[data-gentle="true"] *, body[data-gentle="true"] *::before, body[data-gentle="true"] *::after { animation: none !important; transition: none !important; }
