:root{color-scheme:dark;--bg:#0a1834;--surface:#152a4b;--ink:#f4f8ff;--muted:#afc8e9;--gold:#b8dbff;--light:#e0edfa;--dark:#628bc3;--line:#34527b;font:16px/1.5 system-ui,sans-serif}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100svh;color:var(--ink);background:radial-gradient(ellipse at 14% 0%,#264d88 0,transparent 48%),radial-gradient(ellipse at 96% 100%,#152f56 0,transparent 44%),var(--bg)}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid var(--gold);outline-offset:3px}main{width:min(1030px,100% - 3rem);margin:auto;padding:2.3rem 0 1rem}header{margin-bottom:1.35rem}.eyebrow{color:var(--gold);font-size:.77rem;font-weight:760;letter-spacing:.17em;display:flex;align-items:center;gap:.65rem}.spark{width:.54rem;height:.54rem;background:var(--gold);transform:rotate(45deg);display:inline-block;box-shadow:0 0 .95rem #9bd0ff7d}h1,h2,p{margin:0}h1{font:700 clamp(3rem,6vw,5.25rem)/1.08 Georgia,'Times New Roman',serif;letter-spacing:-.05em;margin:.38rem 0 .35rem}h1 em{font-weight:400;color:var(--gold)}.tag,.footnote,.board-note{color:var(--muted)}.studio{display:grid;grid-template-columns:minmax(0,1.28fr) minmax(0,.87fr);grid-template-rows:auto 1fr;gap:.85rem 1.5rem;align-items:start}.play{grid-area:1/1/3/2;min-width:0}.mission,.feedback,.finish{border:1px solid var(--line);background:var(--surface);border-radius:1rem;padding:1.18rem}.overline,.goal,.board-note{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.progress-label{font-size:.88rem;font-weight:800}.rating{border:1px solid #5680b5;border-radius:99px;background:#21375b;color:var(--gold);font-size:.83rem;font-weight:720;padding:.15rem .6rem;white-space:nowrap}.progress{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:4px;margin:.67rem 0 .9rem}.progress span{height:4px;border-radius:3px;background:#3d5b83}.progress .done{background:#87c6f8}.progress .current{background:var(--gold)}.turn{font-weight:760;font-size:.88rem;color:var(--muted)}.goal h2{font:700 clamp(1.25rem,2.35vw,1.8rem)/1.15 Georgia,'Times New Roman',serif;margin-top:.18rem}.score{text-align:center;background:#102442;border:1px solid #3c628b;border-radius:.75rem;min-width:3.9rem;padding:.18rem .55rem .31rem;color:var(--gold);flex:none}.score output{font-size:1.8rem;line-height:1.1;font-weight:740;font-variant-numeric:tabular-nums;display:block}.score span{font-size:.66rem;font-weight:800;letter-spacing:.1em}.score.flash{animation:flash .55s ease-out}@keyframes flash{40%{box-shadow:0 0 1.4rem #b8dbff83}}
.board{width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));border:2px solid #7b9dcb;border-radius:9px;overflow:hidden;box-shadow:0 10px 36px #07142fc0;container-type:inline-size}.square{position:relative;border:0;padding:0;display:grid;place-items:center;background:var(--light);color:#34527c;isolation:isolate}.square.dark{background:var(--dark);color:#edf5ff}.square.last{box-shadow:inset 0 0 0 3px #f1cc829e}.square.selected,.square:focus-visible{outline:3px solid #f1d290;outline-offset:-3px;z-index:1}.square.target::after{content:"";border-radius:50%;background:#12274c82;width:25%;aspect-ratio:1;position:absolute}.square.capture::after{content:"";position:absolute;inset:4%;border:3px solid #132a54bd;border-radius:50%}.piece{display:block;width:87%;height:87%;overflow:visible;pointer-events:none;filter:drop-shadow(0 2px 1px #14231e50)}.moving{z-index:3}.coord{position:absolute;z-index:2;font-size:clamp(.54rem,2.65cqw,.9rem);font-weight:800;line-height:1;pointer-events:none}.rank{top:3px;left:3px}.file{bottom:3px;right:3px}.board-note{font-size:.8rem;margin-top:.47rem;min-height:1.3em}.board-note span:last-child{color:var(--gold);text-align:right}.feedback{display:grid;gap:.68rem}.result{background:#0e2242;color:var(--muted);border:1px solid #355881;border-radius:.72rem;min-height:3.25rem;padding:.58rem .82rem;font-weight:650;display:flex;align-items:center}.result.wrong{background:#3d2d37;border-color:#75515f;color:#ffd4de;white-space:pre-wrap}.result.good{color:#e2f3ff;background:#1b3f66;border-color:#5995c6}.actions{display:flex}.next{display:block;width:100%;border:1px solid transparent;border-radius:.7rem;background:var(--gold);color:#0c2546;min-height:44px;padding:.6rem 1rem;font-weight:800}.next:not(:disabled):hover{background:#d7ebff}.next:disabled{opacity:1;background:#203653;border-color:#466487;color:#b7ccea;cursor:default}.footnote{font-size:.77rem}.finish{max-width:30rem;padding:2rem}.finish h2{font:700 2.5rem/1.1 Georgia,serif;margin:.5rem 0}.finish p{margin:0 0 1.2rem;color:var(--muted)}dialog{width:min(25rem,100% - 1.5rem);border:1px solid var(--line);border-radius:1rem;background:var(--surface);padding:1rem;color:var(--ink)}dialog::backdrop{background:#07152ed6}.promote{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.7rem}.promote button{border:1px solid var(--line);border-radius:.5rem;min-height:44px;background:#294774;padding:.4rem .65rem}
@media(max-width:740px){main{width:min(530px,100% - 1.25rem);padding:.85rem 0 1rem}header{margin:0 .18rem .63rem}h1{font-size:clamp(2.45rem,10cqw,3.6rem);margin:.22rem 0 .25rem}main{container-type:inline-size}.tag{display:none}.studio{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;gap:.52rem}.play{grid-area:auto}.mission,.feedback{padding:.65rem .7rem;border-radius:.8rem}.progress{margin:.42rem 0 .5rem}.score output{font-size:1.52rem}.result{font-size:.9rem;min-height:3.15rem}.feedback{gap:.45rem}.board-note{margin-top:.3rem;font-size:.76rem}.footnote{font-size:.72rem}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.square{--piece-fill:#f2f7ff;--piece-line:#152a4f;--piece-detail:#51729d}.square.black-piece{--piece-fill:#202f56;--piece-line:#e2eafe;--piece-detail:#a4b9e4}.piece .detail{fill:none;stroke:var(--piece-detail);stroke-width:1.8}.piece .eye{fill:var(--piece-detail);stroke:none}

.intro{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}.intro button,.music-buttons button{border:1px solid #466c9a;background:#172e52;border-radius:999px;font-size:.82rem;font-weight:680;padding:.4rem .7rem;min-height:39px}.intro button:hover,.music-buttons button:hover{background:#24456f}
.finish{position:relative;isolation:isolate;margin:0 auto;text-align:center;background:radial-gradient(ellipse at top,#2d568b 0,#182e55 54%,#142745 100%);padding:1.35rem 1.25rem 1.6rem;max-width:34rem;overflow:hidden;box-shadow:0 18px 40px #08152b86}.finish>.eyebrow{justify-content:center}.finish h2{font-size:clamp(2rem,7vw,3rem)}.finish p{margin:0 0 .65rem}.envelope{width:min(230px,82%);display:grid;justify-items:center;gap:.1rem;margin:.6rem auto 0;background:transparent;border:0;font-weight:760;color:var(--ink);padding:0 0 .5rem}.envelope svg{width:100%;filter:drop-shadow(0 7px 10px #0a183766);transition:transform .2s}.envelope:hover svg{transform:translateY(-4px) rotate(-2deg)}.gift{animation:reveal .6s ease both}.bloom{width:min(185px,78%);display:block;margin:0 auto;filter:drop-shadow(0 0 18px #91c1ff50)}.gift h3{font:700 clamp(1.3rem,5vw,1.75rem)/1.3 Georgia,serif;margin:.05rem 0 1.2rem;color:#eaf4ff}.gift .next{max-width:14rem;margin:auto}@keyframes reveal{from{opacity:0;transform:translateY(10px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
.music{margin:1rem 0 0;border:1px solid #3a5984;border-radius:.8rem;background:#142749;color:#dbeaff;padding:.1rem .75rem;width:min(100%,540px)}.music summary{cursor:pointer;font-weight:700;padding:.48rem .15rem;min-height:42px}.music p,.music label{display:block;font-size:.85rem;color:var(--muted);margin:0 0 .45rem}.music-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem}.music a{color:#c2e0ff;font-size:.86rem}.music iframe{display:block;width:100%;aspect-ratio:16/9;min-height:200px;border:0;border-radius:.5rem;margin:.55rem 0}.local-music{margin-top:.45rem;font-size:.83rem}.local-music audio{width:100%;margin:.35rem 0}.local-music input{width:100%;font:inherit}.local-music summary{font-weight:500}
@media(max-width:740px){h1{font-size:clamp(2.1rem,8.5cqw,3.1rem)}.intro{margin-top:.35rem}.intro button{min-height:36px;padding:.24rem .58rem}.music{margin-top:.55rem}}

/* A soft, blue stationery look for Nga. */
:root{color-scheme:light;--bg:#eff6ff;--surface:#fffdfc;--ink:#22375d;--muted:#526888;--gold:#3769b1;--light:#eaf3ff;--dark:#89acdb;--line:#cddff6}
body{background:radial-gradient(ellipse at 10% 4%,#fff7fc 0,transparent 42%),radial-gradient(ellipse at 92% 11%,#cfebff 0,transparent 46%),radial-gradient(ellipse at 74% 94%,#dadfff 0,transparent 40%),var(--bg);color:var(--ink)}
main{max-width:980px}
header{position:relative;text-align:center;margin-bottom:1.13rem}
header::before,header::after{content:"✦";position:absolute;color:#8bb8ea;pointer-events:none;font-size:clamp(1.5rem,4vw,2.65rem);line-height:1}
header::before{top:1.1rem;left:clamp(.15rem,10vw,8rem);transform:rotate(-12deg)}
header::after{content:"✧";top:2.65rem;right:clamp(.25rem,9vw,7.5rem);color:#af93da}
.eyebrow{justify-content:center;letter-spacing:.13em;font-size:.73rem}
.spark{background:#77aaf1;border-radius:2px;box-shadow:none}
h1{position:relative;z-index:1;color:#274375;font-size:clamp(2.65rem,5.25vw,4.7rem);letter-spacing:-.035em}
h1 em{color:#4776c6;text-decoration:underline;text-decoration-color:#b7d4fa;text-underline-offset:.1em;text-decoration-thickness:.055em}
.intro{justify-content:center;gap:.42rem .7rem}
.intro button,.music-buttons button{background:#f5f9ff;border-color:#bed5f0;color:#30578c;box-shadow:0 2px 0 #dce9fa}
.intro button:hover,.music-buttons button:hover{background:#e5effe}
.mission,.feedback{background:#ffffffdc;border-color:#d5e3f6;border-radius:1.3rem;box-shadow:0 5px 18px #789ac31c}
.progress span{background:#dfebf9}.progress .done{background:#7da8de}.progress .current{background:#457cc3}
.progress-label{color:#365b8c}.rating{background:#f1edff;border-color:#e1d7f9;color:#664c9f}
.score{background:#eaf3ff;border-color:#c0d8f8;color:#2c60a5;border-radius:1rem}.score.flash{animation:blue-glow .65s ease-out}
@keyframes blue-glow{40%{box-shadow:0 0 0 6px #afd6ff88}}
.board{border:3px solid #f9fbff;border-radius:1rem;box-shadow:0 0 0 1px #bfd6f1,0 12px 23px #5a8ac541}
.square.dark{color:#132f58}.square{color:#46648d}.square.last{box-shadow:inset 0 0 0 3px #ffdf96}.square.selected,.square:focus-visible{outline-color:#f2b900}
.result{background:#f1f6fd;border-color:#e0eafb;color:#435d85;border-radius:.95rem}
.result.wrong{background:#fff1f6;border-color:#f5d2e2;color:#7e3c64}.result.good{background:#eaf4ff;border-color:#c6def9;color:#214d8c}
.next{background:#386dc1;border-color:#386dc1;color:#fff;border-radius:999px;box-shadow:0 3px 0 #255396}
.next:not(:disabled):hover{background:#2d62b7}
.next:disabled{background:#edf4fd;border-color:#d3e3f7;color:#57739a;box-shadow:none}
.finish{background:radial-gradient(ellipse at top,#fff5fb,#eaf4ff 85%);box-shadow:0 9px 34px #80a3d43d}.gift h3{color:#2d5187}.envelope{color:#31578b}
.music{margin:1rem auto 0;background:#ffffffe0;color:#274f84;border:1px solid #d2e2f6;border-radius:1.15rem;box-shadow:0 4px 18px #7398c41b}.music-header{display:flex;align-items:center;justify-content:space-between;gap:.6rem;padding:.45rem 0}.track-name{display:block;font-size:1.02rem;color:#294d83}.music p{margin:0 0 .55rem}.music a{color:#2f63ab}.music iframe{background:#d9e8fa}.music .now{font-size:.79rem;color:#566e93;min-height:1.2rem}
dialog{background:#fbfdff;color:#233f68;border-color:#bed6f0}.promote button{background:#eef5ff;color:#274f84}
.game-toast{position:fixed;z-index:30;inset:0;display:grid;place-items:center;pointer-events:none;padding:1rem;background:#2644701f}
.game-toast-card{position:relative;isolation:isolate;display:grid;justify-items:center;gap:.3rem;width:min(310px,99%);text-align:center;padding:1.12rem 1rem 1.3rem;border:2px solid #a3c9ff;border-radius:1.6rem;color:#214b8c;background:linear-gradient(155deg,#fff 15%,#e9f4ff 77%,#dedfff);box-shadow:0 18px 52px #25427553,inset 0 0 0 4px #ffffff8a;animation:toast-bounce .28s cubic-bezier(.25,.85,.45,1.25) both}
.game-toast.wrong .game-toast-card{background:linear-gradient(150deg,#fff8fd,#ffe7f3 77%,#eee8ff);color:#822c64;border-color:#e8abd1}

.toast-title{font-size:clamp(1.8rem,8vw,2.5rem);line-height:1.08;font-weight:850;letter-spacing:-.035em}
.toast-note{color:#365d98;font-size:.9rem;font-weight:740}.game-toast.wrong .toast-note{color:#844a70}
.toast-spark{position:absolute;top:.85rem;font-size:1.65rem;color:#5c91dc}.toast-spark.left{left:1.15rem}.toast-spark.right{right:1.25rem;top:2.05rem;color:#ac7acf}.game-toast.wrong .toast-spark.left{color:#c15f9d}
@keyframes toast-bounce{from{opacity:0;transform:translateY(14px) scale(.86)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:740px){main{width:min(520px,100% - 1.15rem)}header{margin:0 0 .72rem}header::before{top:1.25rem;left:.35rem}header::after{top:2.5rem;right:.3rem}h1{font-size:clamp(1.85rem,7.1cqw,3.05rem);padding-inline:.55rem;margin:.31rem 0}.intro{margin-top:.34rem}.intro button{min-height:38px;font-size:.8rem}.mission,.feedback{border-radius:1rem}.board{border-radius:.75rem}.music{margin-top:.65rem}}

.study-source{font-size:.85rem;font-weight:650;color:#305b99;text-underline-offset:.17em}
@media(max-width:740px){.goal h2{font-size:1.23rem}.result{min-height:3.6rem}}
.gift .study-source{display:inline-block;margin-top:.65rem}

.answer-sticker{height:clamp(105px,30vw,133px);width:auto;max-width:100%;object-fit:contain;border-radius:.85rem;filter:drop-shadow(0 3px 0 #31508d19)}
.game-toast .sticker-wrong,.game-toast.wrong .sticker-right{display:none}
.game-toast.wrong .sticker-wrong{display:block;clip-path:inset(0 0 3% round .85rem)}

.goal h2.turn{margin:0;color:var(--ink)}
.result:empty{visibility:hidden;min-height:0;height:0;border:0;padding:0;margin:0}
.result:empty+.actions{margin-top:-.68rem}
.toast-note:empty{display:none}
@media(max-width:740px){.result:empty+.actions{margin-top:-.45rem}}

.question-credit{margin:.22rem 0 0;color:#49668f;font-size:.85rem;font-weight:650}
.actions{display:grid;gap:.43rem}
#reveal{background:#fff0f6;color:#783d65;border-color:#e7bed6;box-shadow:none}
#reveal:not(:disabled):hover{background:#fce3f1}
.solution{background:#eef6ff;border:1px solid #c7ddfa;border-radius:.9rem;padding:.65rem .8rem;color:#264775}
.solution h3{margin:0;font-size:1rem}.solution ol{margin:.3rem 0 0;padding-left:1.4rem}
.solution li{padding:.12rem 0;font-size:.9rem;line-height:1.55}

.toast-close{position:absolute;z-index:1;top:.48rem;right:.52rem;display:grid;place-items:center;pointer-events:auto;width:44px;height:44px;padding:0;line-height:1;border:1px solid #a4c6f0;border-radius:50%;background:#f8fbff;color:#264d84;font-size:1.58rem;font-weight:700;box-shadow:0 2px 5px #16427516}
.toast-close:hover{background:#dbeaff}
.game-toast.wrong .toast-close{background:#fff6fc;border-color:#e8b7d2;color:#793c63}
.game-toast.wrong .toast-close:hover{background:#f8dced}
.toast-spark.right{top:3.55rem}

.track-artist{font-size:.78rem;color:var(--muted)}
.track-links{display:flex;flex-wrap:wrap;gap:.2rem .62rem;justify-content:flex-end}
.track-links a{white-space:nowrap}

#music>summary{font-size:.9rem;padding:.52rem .25rem;cursor:pointer;color:#284d82}
#music[open]>summary{border-bottom:1px solid #dbe9fa}
#music[open]{padding-bottom:.55rem}

.music{width:min(100%,420px)}
