/* Balaca Ada: a shared, readable palette for the library and every game. */
:root {
  color-scheme: light;
  --purple: #6749ce;
  --ink: #29233f;
  --muted: #716984;
  --surface: #fffdfb;
  --night: #282344;
  --soft-border: #e8e2f0;
}

[hidden] { display: none !important; }
html { scroll-padding-top: 104px; }
body {
  color: #453054;
  background-color: #fff9ed;
  background-image: linear-gradient(#fffaf17a, #fffaf18f), url("images/kids-wallpaper.webp");
  background-size: auto, 860px auto;
  background-position: center top;
  background-repeat: repeat;
  background-attachment: fixed;
  padding-bottom: 0;
  line-height: 1.5;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, [role="button"] { -webkit-tap-highlight-color: transparent; }
button, input, select { touch-action: manipulation; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #c2a4ff;
  outline-offset: 4px;
}
.modal :where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline-color: #6846c7;
}
button:disabled { cursor: default; }
.skip-link { position: fixed; top: 10px; left: 12px; z-index: 30000; transform: translateY(-180%); padding: 12px 18px; background: #fff; color: #33264f; border-radius: 12px; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }
.sky-decor { display: block; position: fixed; inset: 90px 0 auto; height: calc(100vh - 90px); z-index: 0; pointer-events: none; background: transparent; opacity: .6; overflow: hidden; }
.sky-decor:before { content: "☁️"; inset: 14px auto auto 2%; font-size: 43px; letter-spacing: 0; filter: none; animation: ambientCloud 9s ease-in-out infinite alternate; }
.sky-decor:after { content: "☁️"; position: absolute; inset: 38% 2% auto auto; width: auto; height: auto; background: none; font-size: 36px; animation: ambientCloud 12s ease-in-out infinite alternate-reverse; }
.sky-decor i { position: absolute; display: block; font-style: normal; font-size: 20px; animation: ambientFloat 7s ease-in-out infinite; }
.sky-decor i:before { content: "✦"; }
.sky-decor i:nth-child(1) { left: 5%; top: 28%; color: #c18ab5; }
.sky-decor i:nth-child(2) { right: 5%; top: 12%; color: #e2b853; animation-delay: -2s; }
.sky-decor i:nth-child(3) { left: 3%; top: 76%; color: #71a9bc; animation-delay: -4s; }
@keyframes ambientCloud { to { transform: translateX(16px); } }
@keyframes ambientFloat { 50% { transform: translateY(-9px) rotate(12deg); } }

.topbar {
  height: 88px;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  background: #282344eb;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid #ffffff12;
  box-shadow: 0 4px 24px #15102612;
}
.brand { color: #fff; font-size: 25px; gap: 11px; text-shadow: none; white-space: nowrap; }
.brand > span:last-child { display: block; line-height: 1.15; }
.brand small { display: block; margin-top: 5px; font: 800 8px Nunito, sans-serif; letter-spacing: 1.45px; color: #c8bddb; }
.brand-mascot { width: 52px; height: 52px; border: 1px solid #fff3; background: #fff4d7; border-radius: 17px; font-size: 32px; box-shadow: 0 4px 0 #13102044; animation: none; }
.console-mode-tabs { top: 23px; gap: 6px; padding: 4px; background: #ffffff09; border: 1px solid #ffffff0c; border-radius: 16px; }
.console-mode-tabs button { min-width: 100px; padding: 7px 13px; border: 0; border-radius: 12px; background: transparent; color: #d9cfea; box-shadow: none; font-size: 12px; }
.console-mode-tabs button span { font-size: 16px; margin-right: 3px; }
.console-mode-tabs button.active { background: #fff3d5; color: #4f395f; box-shadow: 0 3px 10px #100b2326; transform: none; }
.top-actions { gap: 8px; }
.pill, .avatar-btn, .music-toggle, .orientation-toggle { height: 44px; border: 1px solid #ffffff21; border-radius: 14px; background: #ffffff0e; color: #fff; box-shadow: none; }
.avatar-btn { width: 44px; background: #f0e6fc; }
.music-toggle { width: 44px; }
.music-toggle span { color: #e8dbff; }
.orientation-toggle { padding: 4px 8px; gap: 4px; }
.orientation-toggle small { color: #d5c9e5; }
.coin-pill { padding: 8px 13px; background: #fff2c615; border-color: #ffe19830; color: #ffe39a; }
.top-actions button:hover { border-color: #ffffff73; }

main { position: relative; z-index: 1; max-width: 1288px; padding: 28px 24px 0; }
.hero {
  width: 100%; max-width: none; height: auto; min-height: 312px;
  margin: 0 0 34px; padding: 36px 42px;
  grid-template-columns: 1.2fr 1fr;
  background: #b6d995 url("video/cartoon-garden-poster.jpg") center / cover no-repeat;
  color: #372946; border: 1px solid #ffffff96; border-radius: 30px;
  box-shadow: 0 14px 40px #150f2726;
}
.hero:before { background-image: radial-gradient(#ffffff8c 1px, transparent 2px); background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 70%); opacity: .35; }
.hero-video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; pointer-events: none; }
.hero-video-shade { display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #fff7eefc 0%, #fff7eef5 39%, #fff7eed1 55%, #fff7ee38 73%, #fff7ee00 100%); }
.hero.video-fallback .hero-video { display: none; }
.hero .hero-copy { position: static; display: block; width: 100%; max-width: 600px; }
.hero .eyebrow { color: #745273; opacity: 1; font-size: 10px; letter-spacing: 1.55px; }
.hero .eyebrow > span { margin-right: 6px; color: #a35553; }
.hero h1 { font-size: clamp(30px, 3.2vw, 44px); margin: 13px 0 10px; line-height: 1.12; letter-spacing: -.6px; overflow-wrap: anywhere; }
.hero p { color: #72566e; margin: 0 0 20px; font-size: 15px; line-height: 1.65; }
.welcome-wave { display: inline-block; font-size: .76em; transform: rotate(-8deg); }
.hero-actions { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.hero-play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 23px; border: 0; border-radius: 14px; background: #51406d; color: #fff; font-size: 13px; font-weight: 900; box-shadow: 0 4px 0 #332345, 0 9px 18px #61436020; transition: transform .16s, background .16s; }
.hero-play:hover { background: #644c85; transform: translateY(-2px); }
.hero-play:active { transform: translateY(2px); }
.hero-play > span { font-size: 12px; }
.hero-actions small { font-size: 11px; color: #735971; max-width: 185px; }
.daily-card { position: absolute; grid-area: auto; right: 27px; bottom: 22px; z-index: 3; width: 270px; margin: 0; background: #fffdf2ed; border: 1px solid #ffffffe0; color: #5a4668; box-shadow: 0 8px 28px #7a548816; padding: 11px 13px; gap: 12px; border-radius: 18px; }
.daily-icon { width: 39px; height: 39px; font-size: 22px; border-radius: 13px; background: #fff4d9; }
.daily-card small { font-size: 8px; letter-spacing: 1px; color: #7d687d; }
.daily-card strong { font-size: 13px; color: #5a4668; }
.progress-ring { width: 40px; height: 40px; border-width: 4px; border-color: #d6c6e0; border-top-color: #8a67ad; color: #5b4770; background: #fff7; font-size: 10px; }
.hero-world { display: block; position: absolute; inset: 0 10px 0 auto; width: 42%; height: 100%; opacity: 1; pointer-events: none; }
.hero-world:before { content: none; }
.hero-world .island { width: 130px; height: 27px; right: 22px; bottom: 103px; background: #91cb70; box-shadow: inset 0 -7px #6ba45a, 0 8px 0 -3px #a48457; transform: rotate(-3deg); }
.hero-world .character { font-size: 66px !important; left: 39px; top: -68px; filter: drop-shadow(0 6px 4px #3451262b); transform: rotate(7deg); }
.hero-world .tree { font-size: 37px; left: 0; top: -40px; }
.hero-world .house { font-size: 30px; right: -3px; top: -30px; transform: rotate(8deg); }
.hero-world .sun { display: block; right: 16px; top: 13px; font-size: 30px; color: #ffe75d; filter: drop-shadow(0 0 12px #fffa8c); }
.hero-world .cloud { display: block; width: 66px; height: 20px; background: #ffffffa6; }
.hero-world .cloud-a { top: 17%; left: 40%; transform: scale(.45); }
.hero-world .cloud-b { top: 38%; right: 3%; transform: scale(.35); }
.world-orbit { position: absolute; z-index: 1; display: grid; place-items: center; width: 47px; height: 47px; border: 1px solid #ffffffa1; border-radius: 16px; font: 800 23px "Baloo 2", sans-serif; box-shadow: 0 8px 20px #8f638918; }
.orbit-one { left: 14%; top: 34px; background: #eff2dd; color: #708253; transform: rotate(-12deg); }
.orbit-two { right: 13%; top: 55px; background: #ffeed1; color: #a27644; transform: rotate(12deg); font-size: 19px; }
.orbit-three { right: 20%; top: 7px; width: 28px; height: 28px; color: #9e74ad; border: 0; background: transparent; box-shadow: none; }
.world-caption { position: absolute; bottom: 86px; left: auto; right: 20px; padding: 3px 8px; border-radius: 10px; background: #fffdf2eb; text-align: center; font-size: 9px; font-weight: 800; color: #5d4b56; letter-spacing: .25px; }

.learning-section { max-width: none; padding: 0; scroll-margin-top: 112px; }
.library-intro { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 2px; }
.library-intro .eyebrow { font-size: 9px; letter-spacing: 1.9px; color: #785b82; opacity: 1; }
.library-intro h2 { margin: 5px 0 0; font: 700 29px/1.2 "Baloo 2", sans-serif; letter-spacing: -.25px; }
.library-count { padding-bottom: 3px; color: #755b7e; font-size: 11px; white-space: nowrap; }
.library-count span { color: #986c18; margin-left: 5px; }
.library-nav { position: relative; top: auto; margin: 19px 0 24px; padding: 1px 2px 5px; gap: 9px; background: transparent; }
.library-nav button { min-height: 42px; padding: 9px 17px; border: 1px solid #d8c8e1; border-radius: 13px; background: #fffdfaeb; color: #654973; box-shadow: 0 3px 10px #806d7110; font-size: 12px; transition: color .16s, background .16s, border-color .16s; }
.library-nav button:hover { background: #fff; border-color: #a98dbb; }
.library-nav button.active { background: #eee4ff; color: #553e75; border-color: #eee4ff; box-shadow: 0 4px 13px #140d2726; }
.console-library { gap: 26px; }
.library-row { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; scroll-margin-top: 112px; }
.library-heading { height: auto; padding: 0 2px 14px; gap: 11px; }
.library-heading > span { display: grid; place-items: center; width: 36px; height: 36px; font-size: 19px; background: #fffdf5e8; border: 1px solid #fff; border-radius: 12px; }
.library-heading h3 { margin: 0; color: #493454; font: 700 19px/1.2 "Baloo 2", sans-serif; }
.library-heading p { margin: 3px 0 0; color: #755c7c; font-size: 10px; }
.library-heading i { margin-left: 10px; height: 1px; background: linear-gradient(90deg, #8c729733, #8c729700); }
.library-intro > div, .library-heading > div { border-radius: 12px; background: #fffaf0df; box-shadow: 0 0 0 7px #fffaf0df; }
.library-row .game-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; overflow: visible; padding: 0; scroll-snap-type: none; }
.game-card-wrap { position: relative; min-width: 0; }
.library-row .game-card {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%;
  min-height: 246px; height: 100%; padding: 24px 18px 18px; gap: 0;
  border: 1px solid #ffffffca; border-radius: 23px;
  color: var(--ink); background: var(--surface);
  box-shadow: 0 5px 0 #ffffff0c, 0 10px 25px #130e2724;
  text-align: left; transform: none; overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.library-row .game-card:before { width: 180px; height: 180px; right: -80px; bottom: auto; top: -70px; opacity: .65; background: color-mix(in srgb, var(--accent), white 88%); }
.library-row .game-card:after { content: none; }
.library-row .game-card:hover { transform: translateY(-5px); border-color: #fff; box-shadow: 0 7px 0 #ffffff12, 0 15px 30px #130e2738; }
.library-row .game-card:active { transform: translateY(1px); }
.library-row .game-icon { align-self: flex-start; flex-shrink: 0; width: 68px; height: 68px; margin: 7px 0 17px; border-radius: 21px; font-size: 31px; background: color-mix(in srgb, var(--accent), white 88%); color: color-mix(in srgb, var(--accent), #29233f 30%); box-shadow: inset 0 -4px 0 #00000006; transform: rotate(-4deg); }
.library-row .game-info { display: flex; align-items: flex-start; width: 100%; margin-bottom: 16px; }
.library-row .game-info strong { color: #32283f; font-size: 19px; line-height: 1.16; text-shadow: none; }
.library-row .game-info small { display: block; margin-top: 6px; min-height: 32px; font-size: 10px; line-height: 1.5; color: #786c83; opacity: 1; overflow: visible; }
.library-row .card-stars { margin-top: auto; padding: 4px 7px; background: #f3efe8; color: #926410; font-size: 14px; letter-spacing: 2px; }
.library-row .play-arrow { right: 13px; bottom: 14px; width: 29px; height: 29px; font-size: 20px; font-family: Nunito, sans-serif; background: color-mix(in srgb, var(--accent), white 88%); color: color-mix(in srgb, var(--accent), #29233f 40%); box-shadow: none; }
.library-row .level-number { top: 13px; left: 19px; right: auto; font-size: 8px; letter-spacing: 1px; color: #94869f; }
.library-row .age-badge { left: 93px; top: 61px; padding: 3px 7px; border: 0; box-shadow: none; background: #f4eee6; color: #70573f; font-size: 9px; }
.favorite-btn { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #ffffffbb; color: #897695; font-size: 26px; line-height: 1; transition: color .16s, background .16s; }
.favorite-btn:hover { color: #b94472; background: #ffe5ee; }
.favorite-btn[aria-pressed="true"] { color: #af3562; background: #ffe8ef; }
.library-empty { padding: 35px 20px; margin-bottom: 20px; border: 1px dashed #c8afd3; border-radius: 25px; text-align: center; background: #fffdf7ed; }
.library-empty > span { font-size: 35px; }
.library-empty h3 { font: 700 23px "Baloo 2", sans-serif; margin: 9px 0 4px; }
.library-empty p { margin: 0; font-size: 12px; color: #755c7c; }

.reward-banner { max-width: none; margin: 34px 0 0; padding: 24px 29px; grid-template-columns: 80px minmax(0, 1fr) 225px; gap: 20px; border: 1px solid #fff3; border-radius: 25px; background: linear-gradient(120deg, #443452, #453659 50%, #513e5d); color: #fff1d7; box-shadow: none; }
.reward-banner:before { opacity: .1; }
.reward-art { font-size: 57px; }
.reward-banner .eyebrow { color: #e4c68d; font-size: 9px; opacity: 1; }
.reward-banner h2 { margin-top: 6px; color: #fff0d8; font-size: 25px; line-height: 1.2; }
.reward-banner p { color: #d3bed4; font-size: 11px; }
.reward-progress strong { color: #f4dfb8; font-size: 14px; }
.reward-progress div { background: #ffffff14; height: 8px; }
.reward-progress small, .reward-mini-shelf small { color: #d5c1d4; }
.reward-mini-shelf span { background: #ffffff16; border-color: #ead09934; }
.reward-banner:hover { box-shadow: 0 12px 28px #100a2425; transform: translateY(-3px); }
.site-footer { position: relative; z-index: 1; max-width: 1288px; margin: 0 auto; padding: 25px 27px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; color: #725b7c; }
.footer-links { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 3px 22px; border-top: 1px solid #d9ccdf; padding-top: 12px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: #634b73; font-size: 12px; font-weight: 800; text-decoration: none; }
.footer-links a:hover, .parent-info-links a:hover { color: #442b7c; text-decoration: underline; text-underline-offset: 4px; }
.parent-info-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border-top: 1px solid #e2d8eb; margin-top: 24px; padding-top: 18px; }
.parent-info-links a { display: flex; align-items: center; min-height: 48px; border-radius: 12px; padding: 12px; background: #f4eff9; color: #634b73; font-size: 12px; font-weight: 800; text-decoration: none; }
.footer-brand { display: flex; align-items: center; gap: 7px; text-decoration: none; color: #573764; font: 700 15px "Baloo 2", sans-serif; white-space: nowrap; }
.footer-brand > span { font-size: 21px; }
.site-footer p { margin: 0; font-size: 10px; }
.creator-credit { margin-left: auto; font-size: 10px; white-space: nowrap; }
.creator-credit a { color: #673a7b; font-weight: 900; text-decoration: none; border-bottom: 1px solid #96709b66; padding-bottom: 2px; }
.creator-credit a:hover { border-color: #673a7b; color: #45245d; }
.millinet-verification { position: relative; z-index: 1; max-width: 1288px; margin: 0 auto; padding: 0 24px 24px; text-align: center; }
.millinet-verification a { display: inline-block; max-width: 100%; }
.millinet-verification img { max-width: 100%; height: auto; }
.millinet-verification iframe { max-width: 100%; border: 0; }
.mobile-nav { background: #282344f5; border-color: #ffffff18; backdrop-filter: blur(16px); box-shadow: 0 -5px 24px #15102630; }
.mobile-nav button { color: #c3b5d4; min-width: 58px; }
.mobile-nav .active { color: #f8dfaa; }

/* Dark page text must never bleed into light game, profile or reward surfaces. */
.modal { background: #171227bf; backdrop-filter: blur(9px); }
.modal-card, .install-prompt, .rotate-card { color: var(--ink); color-scheme: light; }
.modal-card { max-height: min(92vh, calc(100dvh - 30px)); background: var(--surface); border: 1px solid #ffffff; padding: 32px; border-radius: 28px; box-shadow: 0 30px 90px #100a2b66; }
.modal h2 { line-height: 1.2; letter-spacing: -.25px; }
.modal-card > .eyebrow { color: #866b9e; opacity: 1; font-size: 10px; }
.modal-card input, .modal-card select { color: var(--ink); background-color: #fff; }
.modal-card input::placeholder { color: #746780; opacity: 1; }
.modal-card .close-btn { color: #675778; border: 1px solid #e2d9eb; background: #f6f1fa; box-shadow: 0 3px 10px #3d2a5714; }
.modal-card .close-btn:hover { background: #ece2f8; }
.game-modal-card { width: min(96vw, 1080px); min-height: min(500px, calc(100dvh - 30px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #b09acb #f0eaf7; background: linear-gradient(150deg, #f9f6ff, #fffdfb 60%, #f1faf5); border: 1px solid #ffffff; box-shadow: 0 30px 90px #100a2b66; }
.game-modal-card::-webkit-scrollbar { display: block; width: 8px; }
.game-modal-card::-webkit-scrollbar-track { background: #f0eaf7; border-radius: 8px; }
.game-modal-card::-webkit-scrollbar-thumb { background: #b09acb; border: 2px solid #f0eaf7; border-radius: 8px; }
/* Keep one vertical scroll area: the entire game, including its last row and progress. */
.game-modal-card:has(.tap-explore-layout) { display: block; height: auto; max-height: min(92vh, calc(100dvh - 30px)); overflow-x: hidden; overflow-y: auto; }
.game-modal-card #gameStage, .game-modal-card:has(.tap-explore-layout) #gameStage { overflow: visible; }
.game-modal-card .tap-explore-layout { height: auto; grid-template-rows: auto auto auto auto; overflow: visible; }
.game-modal-card .tap-board { max-height: none; overflow: visible; }
.game-modal-card > .close-btn { position: sticky; top: max(0px, env(safe-area-inset-top)); }
.game-modal-card:before { opacity: .4; }
.gate-card { max-width: 450px; padding: 30px 32px 26px; }
.gate-card .big-icon { margin: 9px auto 14px; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 24px; background: #f0e9fb; font-size: 37px; }
.gate-card p { font-size: 13px; }
.gate-question { margin: 24px 0 20px; padding: 17px 10px; border: 1px solid #e9e0f4; border-radius: 20px; background: #f6f1fd; gap: 18px; }
.gate-question strong { color: #392751; font-size: 30px; font-weight: 900; line-height: 1.3; }
.gate-question input { width: 86px; height: 59px; border: 2px solid #c9b8e3; background: #fff; border-radius: 13px; color: #392751; font-size: 24px; }
.gate-question input:focus { border-color: #7954b6; outline: 3px solid #7954b624; }
.gate-card .primary-btn { width: 100%; min-height: 48px; }
.primary-btn { background: #684bba; min-height: 44px; border-radius: 13px; box-shadow: 0 3px 0 #493081; transition: background .15s, transform .15s; }
.primary-btn:hover { background: #7758ca; }
.primary-btn:active { transform: translateY(2px); }
.error { min-height: 18px; height: auto; color: #ae2c46; font-size: 12px; }
.parent-card { width: min(95vw, 760px); }
.parent-card h3 { font-size: 20px; line-height: 1.3; color: #44324f; }
.profile-tabs button { color: var(--ink); border-color: #e8e0ef; font-size: 22px; }
.profile-tabs button.active { background: #f0e8ff; border-color: #8a68c0; }
.profile-row { background: #f3edf9; }
.profile-row strong { color: #3d2d50; }
.stat-grid { gap: 10px; }
.stat-grid article { background: #fff; border-color: #e9e0ef; padding: 17px 8px; border-radius: 19px; }
.stat-grid strong { color: #49315c; }
.stat-grid small { font-size: 10px; }
.skill-row { color: #5f5070; }
.preferences-panel { margin-top: 26px; padding: 3px 18px 4px; background: #f8f4fb; border: 1px solid #e9e0ef; border-radius: 20px; }
.preferences-panel h3 { margin: 15px 0 5px; }
.preference-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 75px; padding: 13px 0; border-bottom: 1px solid #e9e0ef; }
.preference-row:last-child { border: 0; }
.preference-row label { cursor: pointer; }
.preference-row label strong, .preference-row label small { display: block; }
.preference-row strong { font-size: 13px; color: #4c395d; }
.preference-row small { margin-top: 3px; font-size: 10px; color: #73627f; }
.preference-row select { max-width: 140px; padding: 9px 10px; min-height: 42px; border: 1px solid #d6c7e4; border-radius: 11px; font-size: 12px; }
.preference-switch { appearance: none; -webkit-appearance: none; position: relative; width: 47px; min-width: 47px; height: 28px; margin: 0; border: 1px solid #c9bbd7; border-radius: 20px; background: #dcd3e6 !important; cursor: pointer; transition: background .18s; }
.preference-switch:before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px #3828431c; transition: transform .18s; }
.preference-switch:checked { background: #7553ad !important; border-color: #7553ad; }
.preference-switch:checked:before { transform: translateX(19px); }
.backup-note { color: #71617d; font-size: 12px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.backup-btn { min-height: 44px; padding: 11px 14px; border: 1px solid #dbcfe6; border-radius: 12px; background: #f5effa; color: #67487c; font-size: 12px; font-weight: 800; cursor: pointer; }
.import-control { position: relative; overflow: hidden; }
.import-control input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.import-control:focus-within { outline: 3px solid #6846c7; outline-offset: 3px; }
.danger-link { min-height: 44px; color: #aa3951; font-weight: 800; font-size: 12px; }
.badge-summary strong, .badge-card strong, .new-badge-awards strong { color: #493453; }
.badge-card em { color: #74607e; font-size: 9px; }
.badge-card small { font-size: 10px; }
.badge-filters button { min-height: 38px; }
.question-box { border: 1px solid #e6ddee; color: var(--ink); background: #f6f2fb; box-shadow: 0 5px 0 #e9e0f1; }
.question-main { color: #38284d; }
.game-meta { color: #79668a; gap: 12px; flex-wrap: wrap; }
.game-header .narration-status { max-width: 540px; margin: 10px auto 0; padding: 9px 12px; border: 1px solid #e2d6ef; border-radius: 12px; background: #f4eefb; color: #634b78; font-size: 11px; line-height: 1.5; }
.answer-btn, .picture-btn, .tap-sound-card, .sort-bin, .sort-item, .match-card { color: var(--ink); }
.game-modal-card .match-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-modal-card .match-card { min-width: 0; }
.game-modal-card .match-card strong { max-width: 100%; overflow-wrap: anywhere; }
.answer-btn { min-height: 60px; }
.speak-btn { animation: none; box-shadow: 0 4px 0 #4e36bd; }
.session-progress { display: flex; align-items: center; gap: 12px; margin: 10px auto 14px; max-width: 450px; }
.session-progress > span { color: #786386; font-size: 11px; font-weight: 800; white-space: nowrap; }
.session-progress > div { height: 7px; flex: 1; border-radius: 10px; background: #e5daef; overflow: hidden; }
.session-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a384cb, #7653a9); transition: width .22s; }
.result-summary { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 20px auto; color: #675077; }
.result-summary > * { padding: 12px 18px; border: 1px solid #e7dcee; border-radius: 16px; background: #fff; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.drawing-tool { min-height: 42px; padding: 9px 14px; border: 1px solid #d8cbe7; border-radius: 12px; background: #f4eefb; color: #5d4179; font-size: 12px; font-weight: 800; }
.drawing-tool:disabled { opacity: .5; }
.install-prompt { border-color: #e4d7f3; }
.toast { max-width: min(90vw, 480px); text-align: center; border: 1px solid #ffffff28; font-size: 13px; line-height: 1.5; }

@media (max-width: 1120px) {
  .brand small { letter-spacing: .8px; font-size: 7px; }
  .console-mode-tabs { position: static; transform: none; margin-inline: 16px; }
  .console-mode-tabs button { min-width: 85px; }
  .topbar { padding-inline: 24px; }
  .library-row .game-grid { gap: 12px; }
  .library-row .game-card { padding: 23px 13px 15px; min-height: 251px; }
  .library-row .game-info strong { font-size: 17px; }
  .library-row .age-badge { left: 88px; }
}
@media (max-width: 900px) {
  .brand small { display: none; }
  .console-mode-tabs { display: none; }
  .hero { min-height: 306px; padding: 32px; grid-template-columns: 1.2fr 1fr; }
  .hero-world { width: 41%; right: 2px; }
  .hero-world .island { transform: scale(.86) rotate(-3deg); bottom: 113px; }
  .hero-world:before { width: 170px; height: 170px; top: 32px; }
  .world-orbit { width: 39px; height: 39px; }
  .orbit-one { left: 3%; }
  .orbit-two { right: 3%; }
  .daily-card { width: 245px; right: 19px; bottom: 22px; }
  .world-caption { font-size: 9px; }
  .library-row .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .library-row .game-card { min-height: 239px; padding: 24px 18px 18px; }
  .library-row .game-info strong { font-size: 20px; }
  .reward-banner { grid-template-columns: 65px 1fr; }
  .reward-progress { grid-column: 2; max-width: 330px; }
  .reward-progress strong, .reward-progress small { text-align: left; }
  .site-footer { flex-wrap: wrap; gap: 9px 18px; }
  .site-footer p { display: none; }
}
@media (max-width: 600px) {
  body { padding-bottom: calc(77px + env(safe-area-inset-bottom)); }
  .sky-decor { inset-block-start: 73px; opacity: .45; }
  html { scroll-padding-top: 90px; }
  main { padding: 17px 16px 0; }
  .topbar { height: 73px; padding: 8px 16px; }
  .brand { gap: 8px; font-size: 20px; }
  .brand > span:last-child { display: block; }
  .brand-mascot { width: 43px; height: 43px; border-radius: 14px; font-size: 27px; }
  .top-actions { gap: 5px; }
  .orientation-toggle { display: none; }
  .top-actions .pill, .avatar-btn, .music-toggle { height: 39px; border-radius: 13px; }
  .top-actions .pill { padding: 7px 9px; font-size: 12px; }
  .avatar-btn, .music-toggle { width: 38px; }
  .hero { min-height: 300px; padding: 25px 23px 94px; grid-template-columns: 1fr; border-radius: 25px; margin-bottom: 28px; }
  .hero-video { object-position: 70% center; }
  .hero { background-position: 70% center; }
  .hero-video-shade { background: linear-gradient(90deg, #fff7eefc 0%, #fff7eef4 44%, #fff7eecc 66%, #fff7ee8c 80%, #fff7ee26 100%); }
  .hero .hero-copy { max-width: 100%; }
  .hero .eyebrow { font-size: 8px; letter-spacing: 1.4px; max-width: 90%; }
  .hero h1 { margin: 13px 0 8px; font-size: 32px; max-width: 93%; }
  .welcome-wave { display: none; }
  .hero p { font-size: 13px; line-height: 1.55; margin-bottom: 17px; max-width: 77%; }
  .hero-actions { gap: 11px; }
  .hero-play { min-height: 44px; padding: 10px 19px; font-size: 12px; }
  .hero-actions small { font-size: 9px; max-width: 115px; }
  .hero-world { display: block; width: 95px; height: 130px; right: 7px; top: 94px; opacity: .85; }
  .hero-world:before { width: 83px; height: 83px; top: 32px; box-shadow: 0 0 0 11px #ffffff17; }
  .hero-world .island { width: 78px; height: 21px; right: 10px; bottom: 11px; transform: rotate(-3deg); box-shadow: inset 0 -5px #6ba45a, 0 7px 0 -3px #a48457; }
  .hero-world .character { font-size: 68px !important; top: -63px; left: 2px; }
  .hero-world .tree, .hero-world .house, .world-caption, .world-orbit { display: none; }
  .daily-card { bottom: 18px; left: 20px; right: 20px; width: auto; max-width: none; padding: 9px 11px; border-radius: 15px; }
  .daily-card strong { font-size: 12px; }
  .daily-card small { font-size: 7px; }
  .daily-icon { width: 33px; height: 33px; font-size: 19px; border-radius: 11px; }
  .progress-ring { width: 36px; height: 36px; font-size: 9px; }
  .library-intro h2 { font-size: 25px; }
  .library-intro .eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .library-count { font-size: 9px; }
  .library-nav { margin: 15px -1px 21px; gap: 7px; padding-bottom: 5px; }
  .library-nav button { font-size: 11px; min-height: 40px; padding: 9px 13px; border-radius: 12px; }
  .console-library { gap: 26px; }
  .library-heading { padding: 0 0 12px; gap: 9px; }
  .library-heading > span { width: 32px; height: 32px; font-size: 17px; }
  .library-heading h3 { font-size: 18px; }
  .library-heading p { font-size: 9px; }
  .library-heading i { display: none; }
  .library-row .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
  .library-row .game-card { min-height: 229px; padding: 22px 13px 15px; border-radius: 21px; }
  .library-row .game-icon { width: 59px; height: 59px; margin: 9px 0 15px; border-radius: 18px; font-size: 27px; align-self: flex-start; }
  .library-row .game-info { align-items: flex-start; margin-bottom: 13px; }
  .library-row .game-info strong { font-size: 18px; line-height: 1.13; }
  .library-row .game-info small { display: block; font-size: 9px; line-height: 1.4; min-height: 26px; }
  .library-row .age-badge { top: 65px; left: 79px; font-size: 8px; padding: 2px 6px; }
  .library-row .card-stars { font-size: 12px; }
  .library-row .level-number { left: 14px; top: 12px; }
  .favorite-btn { width: 36px; height: 36px; top: 7px; right: 7px; font-size: 24px; }
  .reward-banner { margin: 28px 0 0; grid-template-columns: 49px 1fr; padding: 20px 17px; gap: 12px; border-radius: 22px; }
  .reward-art { font-size: 43px; align-self: start; }
  .reward-banner h2 { font-size: 22px; }
  .reward-banner p { font-size: 10px; }
  .reward-banner .eyebrow { font-size: 8px; }
  .reward-progress { grid-column: 2; }
  .reward-mini-shelf { gap: 4px; }
  .reward-mini-shelf span { width: 26px; height: 26px; font-size: 15px; }
  .site-footer { padding: 23px 18px 24px; gap: 8px; }
  .footer-brand { font-size: 13px; }
  .creator-credit { font-size: 9px; }
  .mobile-nav { display: flex; height: calc(70px + env(safe-area-inset-bottom)); }
  .mobile-nav span { font-size: 10px; }
  .modal { padding: 10px; }
  .modal-card { padding: 26px 19px; border-radius: 24px; width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .gate-card { padding: 27px 24px 23px; }
  .gate-question { gap: 15px; }
  .gate-question strong { font-size: 28px; }
  .game-modal-card, .game-modal-card:has(.tap-explore-layout) { min-height: min(500px, calc(100dvh - 20px)); max-height: calc(100dvh - 20px); }
  .game-header h2 { font-size: 27px; }
  .game-header p { font-size: 12px; }
  .question-box { padding: 21px 12px; }
  .answer-btn { min-height: 56px; }
  .visual-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .visual-answer { min-width: 0; padding-inline: 4px; }
  .color-swatch { width: min(54px, 100%); height: auto; aspect-ratio: 1; }
  .shape-answer > span:first-child { font-size: 48px; }
  .profile-row button { width: auto; }
  .profile-row { gap: 10px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preferences-panel { padding-inline: 12px; }
  .preference-row { gap: 10px; }
  .preference-row strong { font-size: 12px; }
  .preference-row small { font-size: 9px; }
  .preference-row select { font-size: 11px; padding-inline: 7px; }
  .badge-cabinet-card { padding-inline: 14px; }
  .badge-summary { gap: 8px; }
  .badge-summary div { padding: 11px 8px; }
  .install-prompt { bottom: calc(83px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(87px + env(safe-area-inset-bottom)); width: max-content; border-radius: 20px; }
}
@media (max-width: 580px) and (orientation: portrait) {
  .game-modal-card .sort-bin .sort-slot i { font-size: clamp(28px, 9vw, 34px); line-height: 1; }
}
@media (max-width: 360px) {
  main { padding-inline: 12px; }
  .topbar { padding-inline: 12px; }
  .brand { font-size: 17px; gap: 6px; }
  .brand-mascot { width: 35px; height: 37px; font-size: 24px; }
  .top-actions { gap: 4px; }
  .music-toggle { width: 33px; }
  .avatar-btn { width: 35px; }
  .hero { padding-inline: 19px; }
  .hero h1 { font-size: 29px; }
  .hero-actions small { max-width: 104px; }
  .hero-world { right: -3px; opacity: .65; }
  .library-count { display: none; }
  .library-row .game-info strong { font-size: 16px; }
  .library-row .age-badge { left: 75px; padding-inline: 4px; }
  .favorite-btn { right: 4px; }
  .creator-credit { font-size: 8px; }
}
@media (orientation: landscape) and (max-height: 650px) {
  body { padding-bottom: 0; }
  .topbar { height: 66px; padding: 7px 22px; }
  .brand-mascot { width: 41px; height: 41px; font-size: 26px; }
  .brand { font-size: 21px; }
  .brand small { display: none; }
  main { padding-top: 20px; }
  .hero { min-height: 260px; height: auto; padding: 25px 32px; grid-template-columns: 1.2fr 1fr; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 13px; margin-bottom: 15px; }
  .hero-world:before { width: 165px; height: 165px; top: 15px; }
  .hero-world .island { bottom: 104px; transform: scale(.76) rotate(-3deg); }
  .orbit-one { top: 17px; }
  .orbit-two { top: 31px; }
  .daily-card { bottom: 16px; padding: 8px 12px; }
  .world-caption { bottom: 76px; }
  .mobile-nav { display: none; }
  .modal { padding: 8px; }
  #gameModal { padding: 0; }
  .modal-card { max-height: calc(100dvh - 16px); padding: 20px 24px; }
  .game-modal-card { width: 100vw; height: 100dvh; max-height: 100dvh !important; border-radius: 0; min-height: 0; padding: 10px 24px; }
  .game-modal-card .close-btn { margin: 0; right: 12px; top: 10px; }
  .game-header h2 { font-size: 23px; }
  .game-header p { font-size: 10px; }
  .question-box { margin-block: 8px; padding: 12px 18px; }
  .answer-btn { min-height: 52px; }
  .session-progress { margin-block: 6px; }
}

/* The OS preference and the parent's gentle mode share the same contract. */
body.ambient-paused .sky-decor:before, body.ambient-paused .sky-decor:after,
body.ambient-paused .sky-decor i { animation-play-state: paused; }
body.reduced-motion *, body.reduced-motion *:before, body.reduced-motion *:after,
body[data-reduced-motion="true"] *, body[data-reduced-motion="true"] *:before, body[data-reduced-motion="true"] *:after {
  animation: none !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
body.reduced-motion .hero-video, body.reduced-motion .loader-video,
body[data-reduced-motion="true"] .hero-video, body[data-reduced-motion="true"] .loader-video { display: none; }
@media (prefers-reduced-motion: reduce) {
  html, html:focus-within { scroll-behavior: auto; }
  *, *:before, *:after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-video, .loader-video { display: none; }
}
