:root {
  color-scheme: light;
  font-family: ui-rounded, "Avenir Next Rounded", system-ui, sans-serif;
  color: #2b2540;
  background: #fff4ce;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1rem; }
body { margin: 0; min-width: 0; min-height: 100svh; }
a { color: #49317c; }
button { font: inherit; cursor: pointer; }
a, button { touch-action: manipulation; }
a:focus-visible, button:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid #2b2540;
  outline-offset: 4px;
}
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 5; padding: 14px; background: white; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.background, .wash { position: fixed; inset: 0; pointer-events: none; z-index: -2; }
.background { background: #dff2ff url("assets/launcher-background.webp") 58% 56% / cover no-repeat; }
.wash { z-index: -1; background: rgb(255 248 224 / 35%); }
.picker { width: min(100%, 1240px); margin: auto; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.hero { max-width: 700px; padding: 22px; margin-bottom: 20px; border: 1px solid #ffffff9c; border-radius: 24px; background: #fff9eae8; box-shadow: 0 12px 34px #31264e14; backdrop-filter: blur(8px); }
.eyebrow { margin: 0; font-weight: 800; color: #754019; }
h1 { margin: 8px 0 12px; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 span { color: #b32954; }
.tagline { font-size: 1.25rem; font-weight: 800; margin: 0; }
.intro { font-size: 1rem; line-height: 1.6; margin: 10px 0 0; }
.app-panel { padding: 24px; border: 1px solid #ffffffa8; border-radius: 24px; background: #fffaf2f5; box-shadow: 0 12px 36px #31264e26; backdrop-filter: blur(8px); }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 0 0 16px; }
.app-tools { display: grid; gap: 14px; }
.app-search { display: grid; max-width: 620px; gap: 7px; color: #493b58; font-size: .875rem; font-weight: 800; }
.search-field { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 7px; min-height: 48px; padding: 0 14px; border: 1px solid #887799; border-radius: 14px; background: white; box-shadow: inset 0 1px 2px #31264e0d; }
.search-field:focus-within { outline: 3px solid #7b4ed8; outline-offset: 2px; }
.search-field > span { color: #6c5c7c; font-size: 1.3rem; }
.search-field input { width: 100%; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: transparent; color: #2b2540; font: inherit; font-weight: 600; }
.search-field input::placeholder { color: #71667d; opacity: 1; }
.app-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.app-filters button, .continue-heading button, .suggestion-heading button { min-height: 44px; padding: 10px 14px; border: 1px solid #776788; border-radius: 999px; background: #fff; color: #31264e; }
.app-filters button { transition: background 140ms ease, color 140ms ease, transform 140ms ease; }
.app-filters button:hover { transform: translateY(-1px); }
.app-filters button[aria-pressed="true"] { border-color: #49317c; background: #49317c; color: white; box-shadow: 0 4px 12px #49317c29; }
#app-count { font-size: .95rem; margin: 14px 0; }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; }
.app-entry { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #c8bdd3; border-radius: 18px; background: white; box-shadow: 0 4px 14px #31264e0d; transition: box-shadow 160ms ease, transform 160ms ease; }
.app-entry:hover { transform: translateY(-2px); box-shadow: 0 9px 22px #31264e1c; }
.app-card { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 12px; flex: 1; align-items: start; padding: 16px; min-height: 150px; border-radius: 17px 17px 0 0; color: #2b2540; text-decoration: none; transition: box-shadow 160ms ease; }
.app-card--math { background: #fff0bc; }
.app-card--language { background: #d9f3eb; }
.app-card--create { background: #eadef8; }
.app-card--reading { background: #ffe6df; }
.app-card:hover { box-shadow: inset 0 0 0 2px #49317c; }
.app-copy { display: grid; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
.app-copy strong { font-size: 1.125rem; line-height: 1.35; }
.app-category { color: #51415f; font-size: .8125rem; font-weight: 700; line-height: 1.4; }
.app-description { font-size: .9375rem; line-height: 1.5; color: #46394f; }
.app-icon, .continue-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: #ffffffc9; font-size: 2rem; line-height: 1; }
.app-icon img, .continue-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.app-guide-link { display: flex; align-items: center; padding: 10px 16px; min-height: 44px; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.game-suggestion { padding: 0 0 20px; margin: 0 0 20px; border-bottom: 1px solid #c8bdd3; }
.suggestion-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.suggestion-heading h3 { margin: 0; font-size: 1rem; }
.suggestion-heading button { flex: 0 0 auto; font-size: .875rem; white-space: nowrap; }
.suggestion-card { min-height: 0; max-width: 620px; border-radius: 16px; border: 1px solid #c8bdd3; }
.no-app-results { padding: 24px; border: 1px dashed #9e8cae; border-radius: 16px; background: #fff; color: #51415f; line-height: 1.5; text-align: center; }
.continue-playing { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid #c8bdd3; }
.continue-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.continue-heading > div { display: grid; gap: 5px; }
.continue-heading small { font-size: .875rem; line-height: 1.5; }
.continue-card { display: grid; grid-template-columns: 48px minmax(0,1fr) 16px; align-items: center; gap: 12px; padding: 12px; border: 1px solid #c8bdd3; border-radius: 14px; background: #f2ebff; color: #2b2540; text-decoration: none; }
.continue-card > span:nth-child(2) { display: grid; gap: 5px; }
.continue-card small { font-size: .875rem; }
.footer-note { padding: 16px; margin: 20px 0 0; border-radius: 16px; background: #fffaf2; font-size: .9375rem; line-height: 1.7; text-align: center; }
.footer-note a { display: inline-block; padding: 8px 4px; min-height: 44px; }
.noscript { margin: 20px; padding: 16px; background: #fffaf2; line-height: 1.5; }
.guide-page { background: #fff9eb; padding: 24px; }
.guide-page > header, .guide-content { max-width: 760px; margin: auto; }
.guide-page > header a { display: inline-block; padding: 12px 0; min-height: 44px; }
.guide-content { padding: 24px 0; font-size: 1.125rem; line-height: 1.7; }
.guide-content h1 { font-size: clamp(2rem, 5vw, 3rem); }
.guide-content h2 { margin-top: 28px; }
.guide-content a { overflow-wrap: anywhere; }
.launch-link { display: inline-block; padding: 12px 20px; border-radius: 12px; background: #49317c; color: white; font-weight: 700; }
@media (max-width: 1050px) {
  .app-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .background { background-image: url("assets/launcher-background-mobile.webp"); }
  .picker { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .hero, .app-panel { padding: 16px; border-radius: 18px; }
  .app-grid { grid-template-columns: minmax(0,1fr); }
  .app-card { min-height: 0; padding: 14px; }
  .app-filters button { flex: 1 1 auto; }
  .guide-page { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .app-card, .app-entry, .app-filters button { transition: none; } }
@media (forced-colors: active) {
  .app-entry, .app-card, .launch-link { border: 1px solid CanvasText; }
  .app-filters button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
