/* Scoped overrides preserve each game's input and board geometry. */
section.yt-game[id]{background:radial-gradient(ellipse at 0 0,#d9eadc 0,transparent 50%),#f5f3e8;color:#17362f;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overflow:auto;overscroll-behavior:contain}
section.yt-game[id]>div[class$=-shell]{max-width:920px;width:100%;margin:auto}
section.yt-game[id] header{position:relative;top:0;background:transparent;display:flex;flex-wrap:wrap;padding:3px 0 9px;gap:7px;border-bottom:1px solid #becbbc;z-index:8}
section.yt-game[id] header h1{font-size:clamp(18px,4vw,26px);color:#17362f;flex:1 1 auto}
.gt-header-actions{display:flex;align-items:center;gap:5px;flex-shrink:0}
section.yt-game[id] button{border-radius:11px;font-family:inherit;min-height:44px;touch-action:manipulation}
section.yt-game[id] header button{font-size:12px;padding:7px 10px;background:#fffaf0;color:#17362f;border:1px solid #94ab9b}
section.yt-game[id] [class$=-companion]{display:none!important}
section.yt-game[id] .ms-play,section.yt-game[id] .ec-play,section.yt-game[id] .so-play,section.yt-game[id] .tc-play,section.yt-game[id] .mc-play,section.yt-game[id] .ac-play{grid-template-columns:1fr}
section.yt-game[id] .mi-layout,section.yt-game[id] .kd-main{grid-template-columns:1fr}
.gt-hud{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px 12px;align-items:center;padding:10px 0;font-size:12px}.gt-friend-name{font-weight:800;overflow-wrap:anywhere}.gt-hud strong{font-size:19px;white-space:nowrap}.gt-hud .gt-skill{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:12px;padding:5px 10px!important;min-height:44px!important;font-size:13px!important;background:#fff2c7!important;color:#644007!important;border:1px solid #bba46f!important;opacity:1!important}.gt-skill:disabled{background:#e8ede2!important;color:#4a6153!important}.gt-skill meter{width:72px;height:15px;accent-color:#db980b}.gt-skill:not(:disabled){box-shadow:0 0 0 2px #f2c952;animation:gt-ready 1s ease-in-out infinite alternate}
.gt-sound{display:flex;flex-wrap:wrap;gap:15px;background:#fffaf0;border:1px solid #b6c7b6;padding:10px;border-radius:12px}.gt-sound label{display:flex;align-items:center;gap:8px;font-size:13px}.gt-sound input[type=range]{width:130px!important;height:44px!important;padding:0!important}.gt-help{font-size:13px;color:#506457;margin:8px 0 10px;line-height:1.6}
.gt-scene{position:relative;isolation:isolate;height:142px;border:2px solid #91b6a3;border-radius:16px;overflow:hidden;background:linear-gradient(#d6eef0 60%,#b9dca2 61%,#619263 78%,#b89765 79%)}
.gt-scene::before{content:'';position:absolute;width:60px;height:60px;border-radius:50%;background:#fff3b2;right:10%;top:8px;box-shadow:0 0 30px #fff4bd}
.gt-scene-label{position:absolute;bottom:0;left:0;right:0;padding:5px 8px;background:#193e35ed;color:#fff8de;text-align:center;font-size:12px;z-index:3;line-height:1.4}
.gt-world-objects{position:absolute;inset:20px 9% 30px;display:flex;align-items:flex-end;justify-content:space-between;gap:7px}.gt-world-piece{font-size:27px;color:#846443;transition:transform .3s,color .3s}.gt-collected{color:#a86d0b!important;text-shadow:0 0 12px #fff18a;transform:translateY(-5px)}
.gt-actor{position:absolute;left:8%;bottom:28px;width:78px;height:75px;z-index:2;transform:translateX(-50%);transition:left .55s ease-out;pointer-events:none;filter:drop-shadow(0 4px 0 #17332e30)}
.gt-actor[data-reaction=correct]{animation:gt-hop .7s ease-out}.gt-actor[data-reaction=incorrect]{animation:gt-stumble .5s ease-out}.gt-actor[data-reaction=boost]{animation:gt-dash .85s ease-out;filter:drop-shadow(-15px 0 2px #ffe285aa)}
.gt-race .gt-world-objects{border-bottom:3px dashed #fffbe2}.gt-race .gt-world-piece{font-size:17px;color:#fff8ce}.gt-race .gt-world-piece:last-child{font-size:42px}.gt-treasure{background:linear-gradient(#342f53,#6d5c76 65%,#b39463 66%)}.gt-treasure .gt-world-piece{width:40px;height:33px;border:3px solid #8d5d25;background:#dab069;border-radius:8px 8px 3px 3px;text-align:center;font-size:20px}.gt-treasure .gt-collected{background:#fff4aa;transform:translateY(-8px) rotate(-8deg)}
.gt-bridge{background:linear-gradient(#d9eae5 40%,#9ac5d2 41%,#4e94af 78%,#377388 79%)}.gt-bridge .gt-world-objects{inset:55px 5% 36px;align-items:center;gap:3px}.gt-bridge .gt-world-piece{background:#d7bc85;border:1px solid #705d35;min-width:0;font-size:11px;flex:1;text-align:center;padding:4px 2px;transform:rotate(-4deg)}.gt-bridge .gt-built{transform:rotate(0);background:#ffdf89;box-shadow:0 0 10px #ffffce}
.gt-lantern{background:linear-gradient(#28395a,#466776)}.gt-lantern .gt-world-objects{align-items:flex-start;opacity:var(--light,1)}.gt-lantern .gt-world-piece{color:#fff2a0;text-shadow:0 0 10px #ffd778;font-size:32px}.gt-craft{background:radial-gradient(ellipse at 50% 120%,#39707e,#203e53)}.gt-craft .gt-world-objects{align-items:center;border-bottom:1px dashed #e9e1b888}.gt-craft .gt-world-piece{color:#c7dcd8}.gt-craft .gt-preview{color:#fff4b9;transform:scale(1.3)}
.gt-explore .gt-world-objects{inset:12px 6% 44px;align-items:flex-start;z-index:4}.yt-game .gt-explore .gt-map-node{padding:6px 12px;background:#fff9e8;font-size:13px;border:2px solid #839c79}.gt-map-node[aria-pressed=true]{outline:3px solid #dfaa42}.gt-explore .gt-actor{bottom:24px;width:55px;height:50px}.gt-board-caption{height:30px;border:none;border-radius:7px;background:transparent}.gt-board-caption .gt-world-objects,.gt-board-caption::before{display:none}.gt-board-actor{width:62px;height:56px;bottom:0;left:50%;z-index:4}.gt-firing::before{content:'';position:absolute;bottom:70%;width:6px;height:110px;left:50%;background:linear-gradient(transparent,#fff9a4,#ffb923);box-shadow:0 0 10px #ffe574;transform-origin:bottom;animation:gt-shot .4s ease-out infinite}
.yt-game .gt-result{text-align:center;background:#fffaf0;border:2px solid #c1b47f;border-radius:20px;padding:22px;max-width:680px;margin:18px auto;color:#17362f;box-shadow:0 8px 0 #203d2010}.gt-result h2{font-size:23px;margin:0}.gt-result>.gt-portrait{width:160px;height:145px;margin:8px auto 0}.gt-result h3{font-size:18px;margin:4px}.gt-final-score{display:block;font-size:38px;color:#236850;margin:12px 0}.gt-result p{font-size:14px;line-height:1.7}.gt-reward{padding:12px;background:#e1efdb;border-radius:10px}.gt-record{font-size:20px!important;font-weight:800}.gt-result[data-new-best=true]{border-color:#d4a328;background:radial-gradient(ellipse at top,#fff0b3,#fffaf0 65%)}.gt-result-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin:18px 0}.gt-result>.gt-button{font-size:12px}.gt-result-details{margin-top:18px;border-top:1px solid #c9d2bc;padding-top:10px}.gt-result-details summary{cursor:pointer;min-height:44px;padding:12px;font-size:14px}.yt-game .gt-learning-result [data-action=replay]{display:none!important}.yt-game[data-completed=true] .ms-play,.yt-game[data-completed=true] .mi-layout,.yt-game[data-completed=true] .kd-main{display:none!important}
section.yt-game[id] .kd-hud .kd-stat{color:#f8fbff}section.yt-game[id] .kd-target{color:#71520c}section.yt-game[id] .kd-feedback{color:#f8fbff}section.yt-game[id] .kd-silent{color:#456455}
section.yt-game[id] .ec-choice{min-height:72px;border:2px solid #ae9bc1;background:linear-gradient(#fff5de,#f0e6d7);box-shadow:inset 0 0 0 5px #fff8e9}.yt-game .ec-choice::before{content:'◇ ';color:#9a7c35}.yt-game .tc-choices button{border-radius:30px!important}.yt-game .mc-choices button[aria-pressed=true]{box-shadow:0 0 0 3px #e3c476}
@media(min-width:700px){.gt-hud{grid-template-columns:minmax(0,1fr) auto auto minmax(230px,auto)}.gt-hud .gt-skill{grid-column:auto}.gt-scene{height:165px}.gt-board-caption{height:30px}.yt-game .ms-pad{max-width:540px;margin-inline:auto!important}.yt-game .ms-question{text-align:center}}
@media(max-width:580px){.gt-scene{height:125px}.gt-board-caption{height:30px}.gt-hud{gap:5px 8px;padding:7px 0}.gt-help{font-size:12px;margin:5px 0}.gt-scene-label{font-size:10px}.gt-actor{width:63px;height:64px}.gt-board-actor{width:54px;height:48px}.yt-game .gt-result{padding:16px}.gt-result>.gt-portrait{width:140px;height:125px}section.yt-game[id] .mi-board{height:195px}section.yt-game[id] .mi-pad{grid-template-columns:repeat(6,1fr)}section.yt-game[id] .mi-pad button{padding:4px;font-size:18px}section.yt-game[id] .kd-board{height:245px}.gt-header-actions{gap:4px}section.yt-game[id] header button{padding:5px 8px}.yt-game .ms-question{font-size:30px!important}.yt-game .ms-pad{gap:5px!important;margin:8px 0!important}.yt-game .ms-pad button{min-height:44px!important;padding:5px!important}}
@media(max-height:650px){.gt-scene{height:95px}.gt-board-caption{height:28px}.gt-actor{width:50px;height:48px}.gt-help{display:none}.gt-hud{padding:4px 0}.gt-result>.gt-portrait{height:90px}section.yt-game[id] .kd-board{height:180px}.yt-game .gt-result{padding:12px}}
@keyframes gt-hop{40%{transform:translate(-50%,-15px) rotate(5deg)}70%{transform:translate(-50%,2px) scale(1.08,.92)}}
@keyframes gt-stumble{30%{transform:translate(-60%,0) rotate(-10deg)}60%{transform:translate(-45%,0)}}
@keyframes gt-dash{40%{transform:translate(-25%,-10px) rotate(7deg)}80%{transform:translate(-50%,0)}}
@keyframes gt-shot{from{opacity:1;transform:scaleY(.3)}to{opacity:0;transform:scaleY(1)}}
@keyframes gt-ready{to{box-shadow:0 0 0 3px #f2c952,0 0 12px #f2c95288}}
#kanjiDefenseScreen.yt-game .gt-help,#kanjiDefenseScreen.yt-game .kd-silent{color:#d9e8db}
#kanjiDefenseScreen.yt-game .kd-target{color:#fff3a6}
.gt-result>.gt-portrait{animation:gt-victory .9s ease-out}
@keyframes gt-victory{35%{transform:translateY(-12px) rotate(5deg)}65%{transform:translateY(0) rotate(-3deg)}}
.gt-skill{position:relative!important;overflow:visible!important}.gt-move-burst{position:absolute;left:50%;top:50%;z-index:8;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;font-size:31px;pointer-events:none;opacity:0;transform:translate(-50%,-50%) scale(.2);filter:drop-shadow(0 2px 5px #44351d88)}.gt-move-burst.is-active{animation:gt-move-burst .78s cubic-bezier(.2,.8,.25,1) both}.gt-move-burst[data-type=food]{background:#fff0ce}.gt-move-burst[data-type=nature]{background:#d9f5dc}.gt-move-burst[data-type=legend]{background:#fff0ba}.gt-move-burst[data-type=fest]{background:#ffe0e8}.gt-move-burst[data-type=history]{background:#e9e1ff}.gt-move-burst[data-type=craft]{background:#dceeff}.gt-move-burst[data-type=odd]{background:#f1e5ff}@keyframes gt-move-burst{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(-24deg)}25%{opacity:1;transform:translate(-50%,-70%) scale(1.18) rotate(8deg)}65%{opacity:1;transform:translate(-50%,-95%) scale(1) rotate(0)}100%{opacity:0;transform:translate(-50%,-130%) scale(.82) rotate(8deg)}}
