:root {
  --ink: #25324b; --muted: #71809d; --purple: #7057e8; --purple-2: #9584f3;
  --yellow: #ffd969; --coral: #ff7c72; --mint: #49cdb0; --sky: #61b7ef;
  --paper: #fffefa; --bg: #f7f5ff; --line: #e9e5f5; --shadow: 0 14px 36px rgba(58, 43, 112, .12);
  font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--bg); overscroll-behavior: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100dvh; padding-bottom: 86px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 5vw, 72px); background: rgba(255,254,250,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; text-align: left; padding: 0; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; background: var(--purple); color: white; border-radius: 14px; font-size: 25px; transform: rotate(-5deg); }
.brand b { display: block; font-size: 19px; }.brand small { color: var(--muted); font-weight: 700; }
.header-actions { display: flex; gap: 10px; }.icon-btn,.profile-pill { border: 1px solid var(--line); background: white; min-height: 45px; border-radius: 14px; box-shadow: 0 4px 12px rgba(50,40,90,.06); }
.icon-btn { width: 45px; font-size: 20px; }.profile-pill { padding: 0 14px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
main { max-width: 1180px; margin: auto; padding: clamp(24px,4vw,52px) clamp(17px,4vw,36px); }
.hero { position: relative; overflow: hidden; border-radius: 34px; min-height: 330px; padding: clamp(30px,6vw,68px); display: flex; align-items: center; background: linear-gradient(130deg,#6f56df,#8875ee); color: white; box-shadow: var(--shadow); }
.hero::before,.hero::after { content:""; position:absolute; border-radius:50%; background:rgba(255,255,255,.11); }.hero::before{width:280px;height:280px;right:-70px;top:-90px}.hero::after{width:190px;height:190px;right:210px;bottom:-110px}
.hero-copy { max-width: 610px; position: relative; z-index: 2; }.eyebrow { display:inline-flex; background: rgba(255,255,255,.17); border:1px solid rgba(255,255,255,.25); border-radius:999px; padding:7px 13px; font-weight:800; font-size:14px; }
h1 { margin: 16px 0 12px; font-size: clamp(38px,6vw,68px); line-height: .98; letter-spacing: -2px; } h1 em { color: var(--yellow); font-style: normal; }
.hero p { font-size: clamp(16px,2vw,20px); line-height:1.55; color:#f1edff; max-width:540px; }.hero-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:25px; }
.primary-btn,.secondary-btn { min-height:52px; border-radius:16px; padding:0 22px; border:0; font-weight:900; font-size:16px; }
.primary-btn { background: var(--yellow); color:#493f1f; box-shadow:0 8px 0 #e9bd3c; }.primary-btn:active{transform:translateY(4px);box-shadow:0 4px 0 #e9bd3c}.secondary-btn{background:white;color:var(--purple)}
.hero-art { position:absolute; right:clamp(22px,6vw,80px); font-size:clamp(100px,17vw,185px); filter:drop-shadow(0 16px 10px rgba(40,30,90,.25)); transform:rotate(7deg); }
.section-head { display:flex; justify-content:space-between; align-items:end; gap:20px; margin:42px 0 18px; }.section-head h2,.page-title h1 { color:var(--ink); font-size:clamp(25px,4vw,36px); letter-spacing:-.7px; margin:0 0 5px; }.section-head p,.page-title p { margin:0;color:var(--muted);font-weight:650 }.text-btn{border:0;background:none;color:var(--purple);font-weight:900}
.game-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:17px; }.game-card { position:relative; background:white; border:1px solid var(--line); border-radius:24px; padding:20px; min-height:230px; box-shadow:0 8px 22px rgba(50,40,90,.07); transition:.2s; overflow:hidden; }.game-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.game-card button { border:0;background:none;padding:0;text-align:left;width:100%;height:100% }.game-icon{width:78px;height:78px;display:grid;place-items:center;border-radius:23px;font-size:42px;margin-bottom:19px}.game-card h3{font-size:20px;margin:0 0 7px}.game-card p{margin:0;color:var(--muted);line-height:1.45;font-weight:650}.game-meta{display:flex;justify-content:space-between;margin-top:18px;color:var(--muted);font-size:13px;font-weight:800}.lock{position:absolute;right:15px;top:15px;background:#fff4cc;border-radius:99px;padding:7px 9px}.c-purple .game-icon{background:#eeeaff}.c-yellow .game-icon{background:#fff4c8}.c-coral .game-icon{background:#ffe7e4}.c-mint .game-icon{background:#def8f2}
.stats-row{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-top:24px}.stat{background:white;border:1px solid var(--line);border-radius:20px;padding:18px;display:flex;align-items:center;gap:13px}.stat span:first-child{font-size:30px}.stat b{display:block;font-size:20px}.stat small{color:var(--muted);font-weight:700}
.bottom-nav { display:none; }
.page-title{margin-bottom:26px}.back-btn{border:0;background:white;border-radius:14px;padding:11px 15px;font-weight:900;margin-bottom:22px;box-shadow:0 4px 14px rgba(30,20,70,.08)}
.play-shell{background:white;border:1px solid var(--line);border-radius:30px;padding:clamp(20px,4vw,42px);box-shadow:var(--shadow);text-align:center}.progress-track{height:10px;background:#eeeaf8;border-radius:99px;overflow:hidden;margin-bottom:28px}.progress-track i{display:block;height:100%;background:var(--mint);border-radius:99px;transition:.3s}.prompt{color:var(--muted);font-weight:800;font-size:17px}.big-letter{font-size:clamp(110px,23vw,210px);font-weight:1000;color:var(--purple);line-height:1;margin:20px}.sound-btn{width:78px;height:78px;border:0;border-radius:50%;background:var(--yellow);font-size:32px;box-shadow:0 7px 0 #e8bc3c}.answer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-width:570px;margin:32px auto 0}.answer{min-height:70px;border:3px solid var(--line);background:white;border-radius:18px;font-size:30px;font-weight:1000}.answer:hover{border-color:var(--purple)}.answer.correct{background:#dff8ef;border-color:var(--mint)}.answer.wrong{background:#ffe8e6;border-color:var(--coral)}
.word-card{display:inline-flex;align-items:center;gap:5px;font-size:clamp(48px,11vw,90px);font-weight:700;margin:35px 0}.syllable{padding:8px 13px;border-radius:16px;background:#eeeaff;color:var(--purple);font-family:"Segoe Print","Comic Sans MS",cursive;line-height:1.15}.syllable:last-child{background:#fff1be;color:#9a6800}.picture{font-size:100px;margin:10px}
.advanced-phrase{display:flex;justify-content:center;flex-wrap:wrap;gap:16px;margin:48px auto 38px;font-family:"Segoe Print","Comic Sans MS",cursive;font-size:clamp(42px,9vw,78px);font-weight:700;color:var(--purple)}.advanced-phrase span{padding:8px 18px;border-radius:18px;background:#eeeaff}.advanced-phrase span:nth-child(2){background:#fff1be;color:#8a6200}
.handwritten-letter{font-family:"Segoe Print","Comic Sans MS",cursive;font-size:clamp(105px,22vw,190px);font-weight:700;color:var(--purple);line-height:1.05;margin:18px 0 22px}.handwritten-answers .answer{font-family:"Segoe Print","Comic Sans MS",cursive;font-weight:700;text-transform:lowercase}
.mic-btn{width:92px;height:92px;border:0;border-radius:50%;background:var(--coral);color:white;font-size:42px;box-shadow:0 8px 0 #db5b52;margin-top:22px}.mic-btn.listening{animation:pulse 1s infinite}.listen-status{min-height:26px;color:var(--muted);font-weight:850;font-size:17px}@keyframes pulse{50%{transform:scale(1.08);box-shadow:0 0 0 18px rgba(255,124,114,.16)}}
.trace-wrap{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:28px;align-items:center}.canvas-box{position:relative;width:100%;max-width:560px;aspect-ratio:1;margin:auto;border:3px dashed #cdc4f2;border-radius:28px;background:#faf9ff;overflow:hidden;touch-action:none}.trace-guide{position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(250px,45vw,430px);font-weight:1000;color:#ece9f8;line-height:1;user-select:none}.canvas-box canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.trace-side{text-align:left}.trace-side h3{font-size:27px;margin:0 0 8px}.trace-actions{display:flex;gap:10px;margin-top:20px}.mini-btn{border:0;border-radius:14px;padding:13px 16px;background:#ede9ff;color:var(--purple);font-weight:900}
.trace-guide-img{position:absolute;inset:9%;width:82%;height:82%;object-fit:contain;opacity:.2;pointer-events:none;user-select:none}.shoot-field{position:relative;max-width:720px;height:380px;margin:20px auto;border-radius:28px;overflow:hidden;background:linear-gradient(#29205e,#6554bd);box-shadow:inset 0 0 0 3px rgba(255,255,255,.18)}.shoot-field:before{content:"✦  ·  ✧  ·  ✦  ·  ✧";position:absolute;inset:18px;color:rgba(255,255,255,.45);font-size:24px;letter-spacing:30px}.letter-target{position:absolute;z-index:3;width:92px;height:92px;border:5px solid #fff;background:#ffd966;color:#4b368d;border-radius:50%;font-family:"Segoe Print","Comic Sans MS",cursive;font-size:50px;font-weight:700;box-shadow:0 8px 0 #db9f25;transition:background .2s,opacity .25s;will-change:transform}.target-1{left:9%;top:18%;animation:target-float-one 4.8s ease-in-out infinite alternate}.target-2{left:calc(50% - 46px);top:8%;animation:target-float-two 5.6s ease-in-out -.8s infinite alternate}.target-3{right:9%;top:24%;animation:target-float-three 4.3s ease-in-out -1.6s infinite alternate}.shooter{position:absolute;z-index:4;bottom:18px;left:calc(50% - 35px);font-size:64px;transform:rotate(-45deg)}.laser-beam{position:absolute;z-index:2;height:7px;border-radius:99px;background:#75f8ff;box-shadow:0 0 7px #fff,0 0 17px #52eaff;transform-origin:left center;animation:laser-fire .36s ease-out forwards;pointer-events:none}.laser-burst{position:absolute;z-index:5;color:#fff76a;font-size:48px;line-height:1;transform:translate(-50%,-50%);text-shadow:0 0 12px #fff,0 0 25px #ff8a00;animation:laser-burst .4s ease-out forwards;pointer-events:none}.letter-target.hit{animation:none;background:#52dfa7;transform:scale(1.2);opacity:0}.letter-target.miss{background:#ff8a82;animation:target-shake .35s}.letter-target:focus-visible{outline:4px solid #75f8ff;outline-offset:4px}@keyframes target-float-one{0%{transform:translate(0,0) rotate(-4deg)}35%{transform:translate(85px,25px) rotate(5deg)}70%{transform:translate(35px,115px) rotate(-3deg)}100%{transform:translate(130px,75px) rotate(5deg)}}@keyframes target-float-two{0%{transform:translate(0,0) rotate(3deg)}30%{transform:translate(-110px,75px) rotate(-5deg)}65%{transform:translate(75px,120px) rotate(4deg)}100%{transform:translate(115px,35px) rotate(-4deg)}}@keyframes target-float-three{0%{transform:translate(0,0) rotate(-3deg)}35%{transform:translate(-90px,105px) rotate(5deg)}70%{transform:translate(-145px,35px) rotate(-4deg)}100%{transform:translate(-35px,85px) rotate(3deg)}}@keyframes target-shake{25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}@keyframes laser-fire{0%{opacity:0;clip-path:inset(0 100% 0 0)}20%{opacity:1}70%{clip-path:inset(0 0 0 0)}100%{opacity:0;clip-path:inset(0 0 0 0)}}@keyframes laser-burst{0%{opacity:0;transform:translate(-50%,-50%) scale(.2)}45%{opacity:1;transform:translate(-50%,-50%) scale(1.4)}100%{opacity:0;transform:translate(-50%,-50%) scale(2)}}
.profile-grid,.admin-grid{display:grid;grid-template-columns:1fr 2fr;gap:22px}.panel{background:white;border:1px solid var(--line);border-radius:24px;padding:24px;box-shadow:0 7px 20px rgba(50,40,90,.06)}.avatar-big{font-size:72px}.panel h2,.panel h3{margin-top:5px}.menu-list{display:grid;gap:10px}.menu-list button{border:1px solid var(--line);background:white;border-radius:15px;text-align:left;padding:15px;font-weight:850}.admin-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}.admin-tabs button{border:0;border-radius:12px;padding:11px 15px;font-weight:850}.admin-tabs .active{background:var(--purple);color:white}.admin-list{display:grid;gap:10px}.admin-row{display:flex;justify-content:space-between;align-items:center;padding:15px;border-radius:16px;background:#faf9ff;gap:16px}.toggle{width:52px;height:30px;border:0;background:#cdd2dc;border-radius:99px;padding:3px}.toggle i{display:block;width:24px;height:24px;background:white;border-radius:50%;transition:.2s}.toggle.on{background:var(--mint)}.toggle.on i{transform:translateX(22px)}
.modal{border:0;border-radius:27px;padding:32px;max-width:430px;width:calc(100% - 28px);text-align:center;box-shadow:0 20px 80px rgba(30,20,70,.3)}.modal::backdrop{background:rgba(31,24,60,.58);backdrop-filter:blur(4px)}.modal-close{position:absolute;right:14px;top:12px;border:0;background:#f1eef8;width:36px;height:36px;border-radius:50%;font-size:24px}.modal-icon{font-size:50px}.modal h2{margin:10px 0 5px}.modal p{color:var(--muted)}.modal form{text-align:left;margin-top:22px}.modal label{display:block;font-weight:850;margin-bottom:7px}.modal input{width:100%;border:2px solid var(--line);border-radius:14px;padding:14px;text-transform:uppercase;font-weight:900;font-size:18px;outline:none;margin-bottom:5px}.modal input:focus{border-color:var(--purple)}.modal .primary-btn{width:100%;margin-top:8px}.form-error{min-height:20px;color:#d94b43!important;font-size:14px;margin:3px 0!important}.toast{position:fixed;left:50%;bottom:100px;transform:translate(-50%,30px);background:var(--ink);color:white;padding:13px 20px;border-radius:14px;font-weight:800;opacity:0;pointer-events:none;transition:.25s;z-index:99}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:900px){.game-grid{grid-template-columns:repeat(2,1fr)}.hero-art{opacity:.25}.hero-copy{max-width:660px}.trace-wrap,.profile-grid,.admin-grid{grid-template-columns:1fr}.trace-side{text-align:center}}
@media(max-width:600px){.app-shell{padding-bottom:72px}.topbar{height:58px;padding:0 12px}.brand small,.profile-pill #profileName{display:none}.brand-mark{width:36px;height:36px}.profile-pill{width:42px;min-height:42px;padding:0;justify-content:center}.icon-btn{width:42px;min-height:42px}.hero{min-height:360px;border-radius:25px;padding:28px 23px;align-items:flex-end}.hero-art{top:10px;right:25px}.hero-actions>*{width:100%}.game-grid{grid-template-columns:1fr}.game-card{min-height:175px}.game-icon{width:62px;height:62px;font-size:34px}.stats-row{grid-template-columns:1fr}.bottom-nav{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;bottom:0;left:0;right:0;z-index:20;background:rgba(255,255,255,.96);border-top:1px solid var(--line);padding:5px 5px max(5px,env(safe-area-inset-bottom));box-shadow:0 -5px 20px rgba(40,30,80,.08)}.bottom-nav button{border:0;background:none;color:var(--muted);font-weight:800;font-size:10px}.bottom-nav span{display:block;font-size:19px;margin-bottom:1px}.bottom-nav .active{color:var(--purple)}main{padding:12px 10px 78px}.back-btn{display:none}.page-title{margin-bottom:10px}.page-title h1{font-size:25px;margin:0}.play-shell{border-radius:22px;padding:12px 10px}.play-shell .progress-track{height:7px;margin-bottom:13px}.prompt{font-size:14px}.handwritten-letter{font-size:clamp(78px,25vw,105px);margin:5px 0 10px}.sound-btn{width:62px;height:62px;font-size:26px;box-shadow:0 5px 0 #e8bc3c}.answer-grid{grid-template-columns:1fr;margin-top:18px}.handwritten-answers{grid-template-columns:repeat(3,1fr);gap:7px}.answer{min-height:56px;font-size:27px;border-width:2px;border-radius:14px}.canvas-box{width:100%;max-width:min(76vw,330px)}.trace-guide{font-size:70vw}.trace-wrap{gap:12px}.trace-side h3{font-size:22px}.trace-side p{margin:6px 0}.trace-actions{justify-content:center;margin-top:10px}.shoot-field{height:min(53vh,350px);margin:10px auto}.word-card{margin:18px 0}.advanced-phrase{margin:24px auto 20px}}
@media(max-width:600px){.letter-quiz .handwritten-answers{display:flex!important;flex-wrap:nowrap;width:100%;max-width:100%;gap:7px;margin:14px auto 0}.letter-quiz .handwritten-answers .answer{flex:1 1 0;min-width:0;min-height:52px;padding:4px}.letter-quiz .handwritten-letter{font-size:82px;margin:2px 0 6px}.letter-quiz .sound-btn{width:58px;height:58px}.letter-quiz .prompt{margin:0}.letter-quiz{padding-bottom:2px}}
@media(max-width:600px) and (max-height:700px){.topbar{height:52px}.brand-mark{width:32px;height:32px}main{padding-top:7px}.page-title{margin-bottom:6px}.page-title h1{font-size:22px}.play-shell{padding:9px 8px}.play-shell .progress-track{margin-bottom:8px}.letter-quiz .handwritten-letter{font-size:70px;margin:0 0 3px}.letter-quiz .sound-btn{width:52px;height:52px;font-size:23px}.letter-quiz .handwritten-answers{margin-top:10px}.letter-quiz .handwritten-answers .answer{min-height:48px}.bottom-nav span{font-size:17px}}
@media(max-width:600px){body:has(.play-shell){height:100dvh;overflow:hidden}body:has(.play-shell) .app-shell{height:100dvh;min-height:0;overflow:hidden;padding-bottom:0}body:has(.play-shell) main{height:calc(100dvh - 116px);min-height:0;padding:8px 10px 6px;display:flex;flex-direction:column;overflow:hidden}body:has(.play-shell) .page-title{flex:0 0 auto}body:has(.play-shell) .play-shell{flex:1 1 auto;min-height:0;overflow:hidden}body:has(.play-shell) .letter-quiz{height:calc(100% - 20px);display:flex;flex-direction:column;justify-content:space-evenly}body:has(.play-shell) .letter-quiz .handwritten-answers{flex:0 0 auto}body:has(.play-shell) .trace-wrap{height:calc(100% - 20px);grid-template-rows:minmax(0,1fr) auto}body:has(.play-shell) .canvas-box{max-height:100%;width:auto;max-width:min(72vw,310px);aspect-ratio:1}body:has(.play-shell) .shoot-field{height:calc(100% - 58px);min-height:260px}body:has(.play-shell) .advanced-phrase{margin:18px auto 14px}}
@media(max-width:600px) and (max-height:700px){body:has(.play-shell) main{height:calc(100dvh - 104px);padding-top:5px}body:has(.play-shell) .page-title h1{font-size:20px}body:has(.play-shell) .canvas-box{max-width:min(59vw,250px)}body:has(.play-shell) .trace-side .prompt{display:none}body:has(.play-shell) .trace-side h3{margin:0}body:has(.play-shell) .listen-status{font-size:13px;min-height:18px}body:has(.play-shell) .shoot-field{min-height:230px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
