/* A bright, readable game surface. Decorative art is loaded only for the active world. */
:root { --adventure-blue: #1266b9; --adventure-ink: #183b54; --adventure-accent: #ffbf35; }
body { background: #f4f9fc; color: var(--adventure-ink); }
.site-header { background: #fff; border-bottom: 1px solid #dfebf3; }
.brand span { color: #194a78; font-weight: 850; letter-spacing: -.04em; }
.adventure-main { max-width: 1880px; margin: auto; padding: 22px 24px 0; }
.adventure-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto 18px; }
.adventure-heading h1 { font-size: clamp(1.2rem, 2vw, 1.65rem); line-height: 1.5; margin: 4px 0 0; letter-spacing: .01em; }
.adventure-heading .eyebrow { color: #47718e; }
.adventure-frame .play-workbench { grid-template-columns: minmax(0,1080px); gap: 32px; }
.adventure-frame { --ad-gap: 150px; }
/* Empty ad areas have no label, border, fill, watermark or interactive surface. */
.ad-reservation, .ad-mount:empty { background: transparent; outline: none; border: 0; box-shadow: none; }
.ad-label { display: none; }
.adventure-frame .ad-header { margin-bottom: 22px; }
.adventure-frame .ad-side { display: none; }
.adventure-frame .ad-side .ad-mount { width: 120px; }
.adventure-frame .ad-results { margin: 26px auto 0; }
.adventure-frame .ad-results .ad-mount { width: 320px; height: 50px; max-width: 100%; }
/* Actual ad integration must set data-ads-active=true after mounting a visible unit. */
.adventure-frame[data-ads-active="true"] .ad-header { margin-bottom: var(--ad-gap); }
.adventure-frame[data-ads-active="true"] .play-workbench { column-gap: var(--ad-gap); }
.adventure-frame[data-ads-active="true"] .ad-results { margin-top: var(--ad-gap); }
.learning-game { background: #fff; min-width: 0; width: 100%; border: 1px solid #d5e5ed; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 38px #234c6b10; }
.adventure-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 22px; }
.adventure-toolbar h2 { margin: 4px 0 0; font-size: 1.15rem; }
.adventure-toolbar .eyebrow { font-size: .75rem; letter-spacing: .08em; color: #486b85; }
.adventure-toolbar .game-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.adventure-toolbar button { padding: 8px 12px; border: 1px solid #dce7ee; border-radius: 9px; background: #fff; color: #38576a; font-size: .875rem; font-weight: 650; min-height: 38px; }
.adventure-toolbar button:hover:not(:disabled) { background: #eff8ff; border-color: #63a7df; }
.adventure-toolbar button:disabled { opacity: .45; }
.learning-modes { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 0 22px 12px; }
.learning-modes button { border: 0; padding: 8px 16px; border-radius: 30px; background: #f0f5f8; color: #416378; font-size: .875rem; font-weight: 700; }
.learning-modes button[aria-pressed="true"] { background: #145ba0; color: #fff; }
.learning-modes #modeHelp { margin-left: auto; color: #587183; font-size: .8125rem; }
.learning-stats { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: #f5fafe; border-block: 1px solid #e1edf4; padding: 10px 12px; }
.learning-stats > div { text-align: center; border-right: 1px solid #dce8f1; }
.learning-stats > div:last-child { border: 0; }
.learning-stats span { display: block; color: #506b7d; font-size: .8125rem; line-height: 1.6; }
.learning-stats strong { display: block; font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #1d527e; line-height: 1.35; }
.learning-stats #wrongCount { color: #af454f; }
.learning-stats small { font-size: .75rem; }
.adventure-scene { position: relative; isolation: isolate; padding: 14px 22px 8px; min-height: 410px; background: #d8f2ff; }
.world-backdrop { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.world-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.adventure-scene::before { content: ''; position: absolute; inset: 0; background: #eaf7ff18; z-index: -1; pointer-events: none; }
.scene-topline,.scene-bottomline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; position: relative; font-size: .8125rem; font-weight: 700; color: #23475a; }
.scene-topline > span,.scene-bottomline > span { background: #ffffffeb; padding: 5px 10px; border-radius: 20px; }
.prompt-card { position: relative; text-align: center; max-width: 830px; margin: 16px auto 0; padding: 22px 26px; border: 2px solid #ffffff; border-radius: 24px; background: #ffffffed; box-shadow: 0 4px 0 #316c871b,0 12px 35px #12485b14; min-height: 225px; }
.prompt-card h3 { color: #214d69; font-size: clamp(1.35rem,2.7vw,2rem); line-height: 1.45; margin: 12px 0; }
.prompt-card p { font-size: 1rem; line-height: 1.7; max-width: 560px; margin: 10px auto; }
.lesson-tag { display: block; font-size: .8125rem; color: #53758a; font-weight: 700; }
.ready-keys { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 12px 0; font-size: .875rem; }
.ready-keys kbd { width: 35px; height: 36px; line-height: 32px; font-size: 1.1rem; border: 1px solid #ccdbe6; border-bottom: 3px solid #aec8db; background: #f4faff; border-radius: 7px; }
.adventure-cta { border: 0; border-bottom: 4px solid #09609c; border-radius: 14px; background: #1684cd; color: #fff; padding: 12px 28px; font-size: 1.0625rem; line-height: 1.4; font-weight: 800; min-height: 48px; box-shadow: 0 4px 14px #197bbe1c; }
.adventure-cta:hover { background: #076fb6; }
.adventure-cta:active { border-bottom-width: 2px; transform: translateY(2px); }
.prompt-card .text-button { display: block; margin: 10px auto 0; }
.prompt-card .small-note { font-size: .8125rem; }
#learningGame #wordJapanese { display: block; color: #225b7e; font-size: clamp(2.625rem,5.3vw,4.4rem); font-weight: 850; line-height: 1.35; overflow-wrap: anywhere; margin: 10px 0 4px; letter-spacing: .045em; white-space: pre-wrap; }
#learningGame #wordReading { display: block; font-size: 1.125rem; font-weight: 600; line-height: 1.5; color: #617c8d; min-height: 0; }
#learningGame #wordReading:empty { display: none; }
#learningGame #romajiLine { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: clamp(1.875rem,3.8vw,2.8rem) !important; font-weight: 750; line-height: 1.65; letter-spacing: .035em; color: #486a7f; word-break: break-all; white-space: pre-wrap; }
#learningGame .sentence-prompt #wordJapanese { font-size: clamp(1.8rem,3.8vw,2.7rem); }
#learningGame .sentence-prompt #romajiLine { font-size: clamp(1.5rem,2.8vw,2.15rem) !important; }
.learning-romaji .typed { color: #839998; }
.learning-romaji .current { color: #a65100; background: #fff0c4; border-bottom: 3px solid #efa820; border-radius: 4px 4px 0 0; padding-inline: 1px; }
.learning-feedback { min-height: 24px; color: #a0374b; font-weight: 650; }
.prompt-card .input-rule { font-size: .8125rem; color: #586e7b; margin-block: 4px; }
.prompt-card.mistake { outline: 3px solid #e9818c; outline-offset: -3px; }
.word-choices { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.word-choices button { font-size: 1.125rem; padding: 8px 14px; border: 2px solid #b2d3dd; background: white; color: #315d71; border-radius: 12px; }
.word-choices button[aria-pressed="true"] { border-color: #257dba; background: #eaf5ff; }
.adventure-track { position: relative; height: 105px; margin: 0 5%; overflow: hidden; --actor-progress: 0; }
.travel-line { position: absolute; inset: auto 3% 18px; height: 3px; border-radius: 4px; background: #ffffffa6; }
.game-actor { position: absolute; width: 100px; height: 100px; left: calc(2% + var(--actor-progress)*73%); bottom: 2px; transition: left .4s ease-out, bottom .4s ease-out; transform-origin: center 85%; }
.game-actor img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px #213c3b1d); }
.game-actor.celebrate { animation: actor-bounce calc(.5s / var(--motion-pace,1)) ease-out; }
.actor-target { position: absolute; right: 2%; top: 20px; padding: 6px 12px; font-size: 1rem; line-height: 1.5; font-weight: 700; color: #315270; background: #fffdf5ed; border-radius: 12px; max-width: 42%; overflow-wrap: anywhere; transition: opacity .25s,transform .25s; }
.world-objects { position: absolute; left: 10%; right: 8%; bottom: 14px; display: flex; justify-content: space-between; }
.world-object { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #ffffffd9; background: #6489783b; color: transparent; transition: background .2s,transform .2s; }
.world-object.collected { background: #ffc744; transform: scale(1.15); }
.word-reward { position: absolute; left: 50%; top: 3px; font-size: 1.125rem; font-weight: 800; color: #174f50; background: #ffffffde; border-radius: 20px; padding: 4px 12px; opacity: 0; }
.word-reward.show { animation: reward-rise .8s ease-out; }
[data-world="2"] .game-actor { left: 3%; }
[data-world="2"] .actor-target.eaten { animation: word-catch .5s ease-in forwards; }
[data-world="1"] .game-actor { bottom: calc(2px + var(--word-arc,0px)*.55); }
[data-world="3"] .game-actor { bottom: calc(2px + var(--word-arc,0px)*.75); }
[data-world="3"] .world-object { border-color: #fff; background: #bdebfba8; }
[data-world="3"] .world-object.collected { background: #ffd3c2; }
[data-world="4"] .game-actor { left: 42%; bottom: calc(-15px + var(--word-progress,0)*50px); }
[data-world="4"] .game-actor img { transform: rotate(-12deg); }
[data-world="4"] .world-object,[data-world="10"] .world-object { border-radius: 3px; transform: rotate(45deg); }
[data-world="6"] .travel-line { height: 6px; background: repeating-linear-gradient(90deg,#425766 0 5px,#c4d2d7 5px 14px); }
[data-world="5"] .game-actor { bottom: calc(1px + var(--word-arc,0px)*.45); transform: rotate(calc(-8deg + var(--word-progress,0)*16deg)); }
[data-world="6"] .world-object { width: 24px; height: 17px; border-radius: 3px; }
[data-world="7"] .game-actor img { transform: scaleX(calc(.8 + var(--word-progress,0)*.2)); }
[data-world="7"] .world-object { border-radius: 2px; }
[data-world="8"] .game-actor { bottom: calc(6px + var(--word-arc,0px)); }
[data-world="8"] .world-object.collected { border-width: 5px; width: 23px; height: 23px; background: #ffe4a3; border-color: #f4a2bc; }
[data-world="9"] .travel-line { height: 8px; background: #e8faff; border: 1px solid #a2daed; }
[data-world="10"] .game-actor img { image-rendering: pixelated; }
[data-world="9"] .game-actor { bottom: calc(18px - var(--actor-progress,0)*16px); transform: rotate(calc(var(--word-progress,0)*9deg)); }
[data-world="10"] .game-actor { bottom: calc(2px + var(--word-arc,0px)); }
.learning-guide { padding: 16px 24px 10px; background: #fff; }
.next-instruction { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .875rem; margin-bottom: 12px; }
.next-instruction > span { color: #527085; }
.next-instruction > strong { font-size: 1rem; color: #3e677c; }
.next-instruction > kbd { color: #a55300; background: #fff0c0; border: 1px solid #f3cd70; border-bottom: 3px solid #e7ac32; border-radius: 9px; font-size: 1.5rem; min-width: 45px; text-align: center; line-height: 1.25; padding: 4px 10px; }
.learning-keyboard { max-width: 740px; margin: auto; width: 100%; }
.learning-keyboard .key-row { display: flex; justify-content: center; gap: 5px; margin-bottom: 5px; }
.learning-keyboard .keyboard-key { display: flex; align-items: center; justify-content: center; padding: 0; flex: 1; max-width: 50px; min-width: 0; height: 34px; font-size: .9rem; line-height: 1; border: 1px solid #c7d8e5; border-bottom: 3px solid #a7c4d8; border-radius: 6px; background: #fafdff; color: #36566c; box-shadow: none; }
.learning-keyboard .keyboard-key.wide { flex: 1.5; max-width: 72px; font-size: .75rem; }
.learning-keyboard .keyboard-key.space { flex: 6; max-width: 340px; }
.learning-keyboard .keyboard-key.next { background: #ffc841; color: #613907; border-color: #d79c1f; box-shadow: 0 0 0 2px #ffe99d; }
.learning-keyboard .keyboard-key.alternative { border-color: #6cadda; }
.learning-keyboard .keyboard-key.home { text-decoration: underline; text-underline-offset: 4px; }
.learning-hands { max-width: 640px; margin: 3px auto 0; }
.learning-hands .hands-diagram { width: 100%; height: 100px; }
.learning-hands .hand-palm { fill: #ffdab4; stroke: #b77e53; stroke-width: 2; }
.learning-hands .finger { fill: #ffdab4; stroke: #b77e53; stroke-width: 2; transition: fill .1s; opacity: 1; }
.learning-hands .finger.active { fill: #ffbc36; stroke: #ab6b00; filter: drop-shadow(0 0 5px #ffc847); }
.learning-hands text { fill: #5b6e77; font-size: 16px; font-family: inherit; }
.finger-instruction { margin: 2px 0 8px; text-align: center; color: #506f83; font-size: .875rem; line-height: 1.5; }
.touch-entry { display: none; margin: 8px auto; max-width: 540px; }
.touch-entry label { display: block; font-size: .8125rem; margin-bottom: 5px; }
.touch-entry textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px; background: #f4f9fd; border: 1px solid #b7cfdf; border-radius: 8px; font-size: 16px; padding: 10px; color: #1b4f72; }
.session-strip { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .75rem; color: #607788; }
.session-strip .text-button { font-size: .8125rem; }
.world-stage-bar { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid #e2edf3; background: #f8fbfd; }
.world-stage-bar button { flex: 1; min-width: 0; min-height: 43px; border: 1px solid #cedee9; border-radius: 8px; background: #fff; color: #557081; font-size: .875rem; font-weight: 750; }
.world-stage-bar button[aria-current="step"] { border: 2px solid #3189c8; color: #125f97; background: #edf8ff; }
.world-stage-bar button:disabled { opacity: .5; cursor: default; }
.world-stage-bar small { display: block; font-size: .75rem; color: #916311; }
.result-stars { color: #c1850b; font-size: 2rem; letter-spacing: .15em; }
.result-details { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; max-width: 540px; margin: 12px auto; font-size: .875rem; }
.result-details strong { display: block; color: #1c618f; font-size: 1.35rem; }
.result-actions { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-actions .text-button { margin: 4px 0; }
.world-picker,.learning-seo { max-width: 1080px; margin: 38px auto; }
.world-picker h2 { font-size: 1.25rem; }
.world-cards { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.world-card { position: relative; text-align: left; border: 1px solid #d6e3eb; border-radius: 14px; padding: 14px; background: #fff; min-width: 0; color: #284f69; }
.world-card.selected { border: 2px solid #2e8fcf; padding: 13px; box-shadow: 0 0 0 3px #d8eefc; }
.world-card:disabled { opacity: .65; cursor: default; }
.world-card img { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 4px; }
.world-card b,.world-card span,.world-card small { display: block; }
.world-card b { font-size: .875rem; margin-block: 5px; }
.world-card span,.world-card small { font-size: .75rem; line-height: 1.6; color: #617d8e; }
.world-card progress { width: 100%; height: 5px; margin-top: 7px; accent-color: #298dbe; }
.long-practice-link { display: inline-block; margin-top: 20px; font-size: .875rem; }
.learning-seo { border-top: 1px solid #dae6ef; padding-top: 30px; }
.learning-seo h2 { font-size: 1.35rem; margin-bottom: 14px; }
.learning-seo p { color: #4c687a; font-size: 1rem; line-height: 1.9; }
.learning-tips { display: grid; grid-template-columns: repeat(3,1fr); gap: 26px; margin: 24px 0 32px; }
.learning-tips h3 { font-size: 1rem; }
.learning-seo details { border-bottom: 1px solid #dbe7ee; padding: 15px 0; }
.learning-seo summary { font-size: 1rem; cursor: pointer; font-weight: 650; }
.learning-seo details p { margin-bottom: 4px; }
.adventure-frame dialog { max-width: min(92vw,600px); color: #284a63; }
.adventure-frame select { max-width: 55%; font: inherit; padding: 7px; border: 1px solid #bed3e1; border-radius: 6px; background: #fff; }
.adventure-frame:fullscreen,.adventure-frame.is-expanded { background: #eef6fb; }
.adventure-frame:fullscreen .play-workbench,.adventure-frame.is-expanded .play-workbench { max-width: 1832px; }
.adventure-frame:fullscreen .adventure-toolbar,.adventure-frame.is-expanded .adventure-toolbar { padding-block: 10px; }
.adventure-frame:fullscreen .learning-guide,.adventure-frame.is-expanded .learning-guide { padding-block: 10px; }
.adventure-frame:fullscreen .adventure-heading,.adventure-frame.is-expanded .adventure-heading { display: none; }
.adventure-frame:fullscreen .learning-hands .hands-diagram,.adventure-frame.is-expanded .learning-hands .hands-diagram { height: 85px; }
@keyframes actor-bounce { 40% { transform: translateY(-14px) rotate(-4deg); } }
@keyframes word-catch { 0% { opacity: 1; } 100% { opacity: 0; right: 84%; top: 52px; transform: scale(.15); } }
@keyframes reward-rise { 15%,65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-25px); } }
@media (min-width: 800px) { .adventure-frame .ad-results .ad-mount { width: 728px; height: 90px; } }
@media (min-width: 1280px) and (pointer: fine) { .adventure-frame .play-workbench { grid-template-columns: 120px minmax(0,1080px) 120px; } .adventure-frame .ad-side { display: block; } }
@media (min-width: 1600px) and (pointer: fine) { .adventure-frame .play-workbench { grid-template-columns: 160px minmax(0,1080px) 160px; gap: 40px; } .adventure-frame .ad-side .ad-mount { width: 160px; } }
@media (max-width: 850px) { .adventure-main { padding-inline: 16px; } .adventure-toolbar { padding: 13px 16px; } .adventure-toolbar h2 { font-size: 1rem; } .learning-modes { padding-inline: 16px; } .learning-modes #modeHelp { width: 100%; margin: 5px 0 0; } .world-cards { grid-template-columns: repeat(3,minmax(0,1fr)); } .learning-guide { padding-inline: 16px; } }
@media (max-width: 700px) { .adventure-heading .eyebrow { display: none; } .adventure-heading h1 { font-size: 1.0625rem; } .adventure-heading .outline-button { padding: 7px 9px; font-size: .8125rem; flex-shrink: 0; } .adventure-frame .ad-header { margin-bottom: 14px; } .learning-stats { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 0; } .learning-stats > div:nth-child(3) { border: 0; } .learning-stats strong { font-size: 1.25rem; } .adventure-scene { padding-inline: 12px; } .prompt-card { padding: 18px 12px; margin-top: 12px; border-radius: 20px; } .learning-tips { grid-template-columns: 1fr; gap: 10px; } .touch-entry { display: block; } .learning-keyboard .keyboard-key { height: 29px; font-size: .8125rem; } .learning-keyboard .key-row { gap: 3px; margin-bottom: 4px; } .learning-keyboard .keyboard-key.wide { font-size: .65rem; } .learning-hands .hands-diagram { height: 90px; } .adventure-track { margin-inline: 0; } .scene-topline,.scene-bottomline { font-size: .75rem; } .game-actor { width: 90px; height: 90px; } .world-stage-bar { padding-inline: 12px; gap: 5px; } .learning-seo h2 { font-size: 1.2rem; } }
@media (pointer: coarse) { .touch-entry { display: block; } }
@media (max-width: 450px) { .adventure-main { padding-inline: 8px; padding-top: 14px; } .adventure-toolbar { padding: 12px; } .adventure-toolbar .game-tools { gap: 5px; width: 100%; } .adventure-toolbar button { flex: 1; padding: 7px 5px; font-size: .8125rem; } .learning-modes { padding-inline: 12px; } .learning-modes button { padding: 8px 12px; font-size: .8125rem; } .learning-game { border-radius: 16px; } .learning-guide { padding-inline: 10px; } .world-cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .scene-topline span:first-child { max-width: 100%; } .scene-topline span:last-child { display: none; } .next-instruction { gap: 8px; } .next-instruction strong { font-size: .875rem; } .learning-hands .hands-diagram { height: 84px; } .learning-keyboard .keyboard-key { height: 27px; font-size: .75rem; border-radius: 4px; } .learning-keyboard .keyboard-key.wide { font-size: .6rem; } .result-details { gap: 6px; } .result-details strong { font-size: 1.15rem; } .session-strip { justify-content: center; } .adventure-frame .ad-results .ad-mount { width: 300px; } }
@media (max-width: 343px) { .adventure-frame .ad-results { display: none; } .adventure-toolbar button { min-width: 40%; } .learning-modes button { font-size: .75rem; } .next-instruction > span { display: none; } }
@media (max-width: 1279px), (pointer: coarse) {
 .adventure-frame .learning-game { grid-row: 1; }
 .adventure-frame .ad-side[data-side="left"] { grid-row: 2; }
 .adventure-frame .ad-side[data-side="right"] { grid-row: 3; }
 .adventure-frame .ad-side[data-ad-present="true"] { display: block; margin-top: 118px; }
 .adventure-frame .ad-side .ad-mount { width: 320px; height: 50px; margin: auto; }
}
@media (min-width: 344px) and (max-width: 363px) { .adventure-frame .ad-side .ad-mount { width: 300px; } }
@media (max-width: 343px) { .adventure-frame .ad-side[data-ad-present="true"] { display: none; } }
@media (prefers-reduced-motion: reduce) { .game-actor,.actor-target,.world-object,.actor-action { transition: none !important; animation: none !important; } .word-reward.show { opacity: 1; animation: none; } }
.reduce-motion .game-actor,.reduce-motion .actor-target,.reduce-motion .world-object,.reduce-motion .actor-action { transition: none !important; animation: none !important; }
.learning-keyboard .keyboard-key.wide { font-size: .75rem; }
.reduce-motion .word-reward.show { opacity: 1; animation: none; }
[hidden] { display: none !important; }
