:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: #251c52;
  background: #dff5ff;
  --ink: #251c52;
  --purple: #6750c9;
  --paper: #fffdf8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-width: 320px; min-height: 100%; background: #dff5ff; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 14% 4%, rgba(255,255,255,.94) 0 5%, transparent 5.2%), radial-gradient(circle at 89% 13%, rgba(255,255,255,.85) 0 7%, transparent 7.2%), linear-gradient(165deg, #b9eaff 0%, #eaf9ff 54%, #fff2bd 100%); }
button, input { font: inherit; }
button { color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }

.app-shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.hero { position: relative; padding: 20px 8px 30px; text-align: center; }
.hero-plane { display: inline-grid; width: 70px; height: 70px; place-items: center; border-radius: 24px; background: #fff; font-size: 2.25rem; box-shadow: 0 8px 24px rgba(65,76,145,.17); transform: rotate(-7deg); }
.eyebrow { margin: 15px 0 5px; color: #5c4fa0; font-size: .9rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; color: #513bb0; font-size: clamp(2.65rem, 10vw, 4.5rem); line-height: .96; letter-spacing: -.065em; }
.hero-clouds { display: flex; justify-content: center; gap: 33px; margin-top: 10px; font-size: 1.35rem; opacity: .8; }

.game-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.game-card { position: relative; min-height: 158px; overflow: hidden; border: 0; border-radius: 28px; padding: 18px 15px 15px; background: var(--card-color); text-align: left; cursor: pointer; box-shadow: 0 6px 0 rgba(44,33,91,.17), 0 12px 28px rgba(52,76,130,.11); animation: card-in .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--card-delay); }
.game-card::after { content: ""; position: absolute; width: 90px; height: 90px; top: -35px; right: -25px; border-radius: 50%; background: rgba(255,255,255,.25); }
.game-card:active { transform: translateY(5px) scale(.985); box-shadow: 0 1px 0 rgba(44,33,91,.17); }
.game-card:focus-visible, .icon-button:focus-visible, .kid-button:focus-visible { outline: 4px solid #261755; outline-offset: 3px; }
.game-card__icon { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 22px; background: rgba(255,255,255,.7); font-size: 2.5rem; box-shadow: inset 0 -4px 0 rgba(39,31,81,.08); }
.game-card__copy { display: block; margin-top: 13px; padding-right: 15px; }
.game-card__copy strong { display: block; font-size: 1.02rem; line-height: 1.05; }
.game-card__copy small { display: block; margin-top: 5px; font-size: .73rem; font-weight: 800; line-height: 1.15; opacity: .72; }
.game-card__arrow { position: absolute; right: 13px; bottom: 10px; font-size: 2rem; font-weight: 900; opacity: .45; }

.adult-area { padding: 27px 0 4px; text-align: center; }
.install-button, .adult-button, .pill-button { border: 0; border-radius: 999px; padding: 13px 19px; background: #5d45bd; color: #fff; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #38247e; }
.offline-status { margin: 16px 0 0; color: #514b75; font-size: .82rem; font-weight: 800; }

.game-screen { min-height: calc(100vh - 36px); }
.game-topbar { position: relative; z-index: 20; display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 8px; margin-bottom: 12px; }
.game-title { min-width: 0; overflow: hidden; text-align: center; font-size: 1rem; white-space: nowrap; }
.game-title span { margin-right: 5px; }
.game-title strong { display: inline-block; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.game-tools { display: flex; gap: 7px; }
.icon-button { display: grid; width: 50px; height: 50px; place-items: center; border: 0; border-radius: 18px; background: rgba(255,255,255,.92); font-size: 1.35rem; cursor: pointer; box-shadow: 0 4px 0 rgba(45,34,97,.15); }
.icon-button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(45,34,97,.15); }
.game-body { position: relative; min-height: calc(100vh - 116px); }
.kid-button { border: 0; cursor: pointer; box-shadow: 0 6px 0 rgba(45,34,97,.16), 0 12px 22px rgba(50,70,120,.1); }
.kid-button:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(45,34,97,.16); }
.progress-dots { display: flex; justify-content: center; gap: 8px; min-height: 16px; margin: 6px 0 12px; }
.progress-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(62,45,128,.16); }
.progress-dots span.done { background: #ffbe35; box-shadow: 0 0 0 3px rgba(255,190,53,.2); }

.celebration-layer { position: fixed; z-index: 100; inset: 0; overflow: hidden; pointer-events: none; }
.celebration-layer span { position: absolute; left: var(--x); top: -10vh; font-size: 2rem; animation: celebration-fall 1.55s var(--delay) cubic-bezier(.2,.65,.35,1) both; }
.empty-state { display: grid; min-height: 52vh; place-items: center; padding: 25px; border: 4px dashed rgba(78,58,150,.2); border-radius: 32px; background: rgba(255,255,255,.5); text-align: center; }
.empty-state__icon { display: block; font-size: 6rem; }
.empty-state p { max-width: 290px; margin: 10px auto 20px; font-weight: 800; line-height: 1.35; }
.adult-upload { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 17px; border-radius: 999px; background: #fff; color: #43377c; font-size: .85rem; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 rgba(44,33,91,.12); }
.adult-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }

@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes celebration-fall { to { transform: translateY(115vh) rotate(var(--spin)); opacity: .1; } }
@keyframes pop { 0%,100% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes wobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-8px); } 70% { transform: translateX(8px); } }

@media (min-width: 600px) { .game-list { grid-template-columns: repeat(3, minmax(0,1fr)); } .game-card { min-height: 180px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
