@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700&family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #174b8a;
  --navy-2: #103665;
  --blue: #3f82e6;
  --sky: #e9f7ff;
  --yellow: #ffd84a;
  --coral: #ff7067;
  --teal: #2fc6a2;
  --ink: #183b64;
  --muted: #637a94;
  --paper: #fffdf9;
  --line: #d9e9f6;
  --shadow: 0 18px 42px rgba(38, 90, 151, .14);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: "Noto Sans TC", system-ui, sans-serif; color: var(--ink); background-color: #f4fbff; background-image: radial-gradient(circle at 8% 12%, rgba(255,216,74,.23) 0 74px, transparent 75px), radial-gradient(circle at 92% 24%, rgba(255,112,103,.14) 0 95px, transparent 96px), radial-gradient(circle at 82% 82%, rgba(47,198,162,.12) 0 120px, transparent 121px), linear-gradient(180deg, #eef9ff 0, #fbfdff 44%, #fffaf2 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, .choice-btn:focus-visible { outline: 4px solid rgba(45,112,199,.25); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; padding: .75rem 1rem; border-radius: 10px; background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }

.topbar { height: 78px; padding: 0 clamp(18px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.9); border-bottom: 3px solid rgba(255,216,74,.7); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { border: 0; background: transparent; display: flex; align-items: center; gap: 11px; color: var(--navy); text-align: left; padding: 0; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 3px solid #fff; border-radius: 16px; color: var(--navy); background: var(--yellow); font-size: 1.75rem; font-weight: 900; transform: rotate(-4deg); box-shadow: 0 5px 0 rgba(34,94,155,.14); }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: .08em; }
.brand small { display: block; font-family: "Baloo 2", sans-serif; font-size: .74rem; letter-spacing: .06em; color: var(--muted); line-height: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.star-pill { height: 40px; padding: 0 14px; border-radius: 999px; display: flex; align-items: center; gap: 7px; color: #7d5a00; background: #fff7cf; border: 1px solid #ffe881; }
.star-pill span { color: #f3b700; }
.icon-btn { min-height: 40px; padding: 0 14px; border: 2px solid #cfe6f7; border-radius: 14px; color: var(--navy); background: #fff; font-weight: 800; box-shadow: 0 4px 0 #dcecf7; }

main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 72px; }
.screen { display: none; }
.screen.active { display: block; animation: screenIn .35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }

.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .82fr); gap: 24px; }
.hero-card, .progress-card, .stage-card, .game-shell { border: 1px solid rgba(21,59,103,.09); box-shadow: var(--shadow); }
.hero-card { position: relative; overflow: hidden; min-height: 430px; padding: clamp(30px, 5vw, 58px); padding-right: clamp(280px, 39%, 390px); border: 4px solid #fff; border-radius: 34px; color: var(--ink); background: linear-gradient(145deg, #fffef8 0%, #fff8cf 52%, #ffe9b2 100%); box-shadow: 0 22px 0 rgba(255,216,74,.25), var(--shadow); }
.hero-card::before { content: ""; position: absolute; width: 420px; height: 420px; right: -80px; bottom: -120px; border-radius: 50%; background: radial-gradient(circle at 40% 34%, #d9f3ff 0 48%, #bde7ff 49% 70%, transparent 71%); opacity: .95; }
.hero-card::after { content: "ABC"; position: absolute; left: 34px; bottom: -23px; font: 800 6rem/1 "Baloo 2", sans-serif; letter-spacing: .08em; color: rgba(63,130,230,.055); transform: rotate(-4deg); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-card .eyebrow { color: var(--blue); padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,.76); box-shadow: 0 4px 0 rgba(63,130,230,.08); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5be4b7; box-shadow: 0 0 0 4px rgba(91,228,183,.12); }
.hero-card h1 { position: relative; z-index: 2; margin: 18px 0 14px; max-width: 590px; font-size: clamp(2.25rem, 5vw, 4.15rem); line-height: 1.08; letter-spacing: -.04em; }
.hero-card h1 span { color: var(--coral); text-shadow: 0 3px 0 #fff; }
.hero-card p { position: relative; z-index: 2; max-width: 570px; margin: 0; font-size: clamp(1rem, 1.8vw, 1.12rem); line-height: 1.8; color: #536f8c; }
.hero-mascot { position: absolute; z-index: 2; width: clamp(295px, 39%, 390px); height: auto; right: -6px; bottom: -26px; filter: drop-shadow(0 18px 12px rgba(32,75,126,.18)); animation: floatMascot 3.4s ease-in-out infinite; }
.hero-sticker { position: absolute; z-index: 3; display: grid; place-items: center; width: 42px; height: 42px; border: 3px solid #fff; border-radius: 14px; color: #fff; font: 800 1.25rem "Baloo 2", sans-serif; box-shadow: 0 6px 0 rgba(24,59,100,.12); transform: rotate(-10deg); }
.sticker-star { right: 34%; top: 28px; background: var(--coral); }
.sticker-a { right: 27%; top: 82px; background: var(--blue); transform: rotate(8deg); }
.sticker-b { right: 35%; bottom: 45px; background: var(--teal); transform: rotate(9deg); }
@keyframes floatMascot { 0%,100% { transform: translateY(0) rotate(1deg); } 50% { transform: translateY(-9px) rotate(-1deg); } }
.hero-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-btn, .secondary-btn { min-height: 54px; border-radius: 16px; padding: 0 22px; font-weight: 800; border: 0; }
.primary-btn { color: #fff; background: linear-gradient(180deg, #4f92ef, #3476d3); border: 3px solid #fff; box-shadow: 0 7px 0 #245ba9, 0 14px 24px rgba(54,118,211,.2); }
.primary-btn:hover { transform: translateY(-2px); }
.primary-btn span { margin-left: 16px; }
.secondary-btn { color: var(--navy); background: #fff; border: 2px solid #cbe3f7; box-shadow: 0 5px 0 #d8eaf6; }
.daily-mix { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; color: #61758b; font-size: .8rem; }
.daily-mix span { padding: 7px 11px; border-radius: 99px; background: rgba(255,255,255,.76); border: 1px solid rgba(63,130,230,.1); }
.daily-mix b { color: var(--coral); }

.progress-card { padding: 27px; border: 4px solid #fff; border-radius: 30px; background: linear-gradient(180deg, #f1fbff, #e7f7ff); box-shadow: 0 15px 0 rgba(63,130,230,.09), var(--shadow); }
.progress-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .87rem; font-weight: 700; }
.progress-head b { color: var(--navy); }
.ring { --p: calc(var(--progress) * 3.6deg); width: 174px; aspect-ratio: 1; margin: 25px auto 30px; border: 8px solid rgba(255,255,255,.8); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--coral) var(--p), #dceef8 0); position: relative; box-shadow: 0 10px 0 rgba(63,130,230,.08); }
.ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #fff; }
.ring div { position: relative; text-align: center; }
.ring strong { display: block; font: 800 2rem/1 "Baloo 2", sans-serif; color: var(--navy); }
.ring span { display: block; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.level-path { display: flex; align-items: flex-start; justify-content: center; }
.level-node { min-width: 36px; padding: 0; border: 0; background: transparent; text-align: center; font-family: inherit; cursor: pointer; }
.level-node b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #edf2f7; color: #8494a6; font: 800 1rem "Baloo 2", sans-serif; }
.level-node span { display: block; margin-top: 5px; color: #91a0af; font-size: .68rem; }
.level-node.current b { background: var(--coral); color: #fff; box-shadow: 0 6px 0 #d94f49; transform: rotate(-5deg); }
.level-node.current span { color: var(--teal); font-weight: 800; }
.level-node:hover b { transform: translateY(-2px); }
.level-node.current:hover b { transform: translateY(-2px) rotate(-5deg); }
.path-line { flex: 1; max-width: 35px; height: 2px; margin-top: 17px; background: #dfe8f0; }
.title-chip { margin: 25px 0 0; padding: 12px; border: 2px dashed #9fd4f3; border-radius: 16px; text-align: center; background: #fff; color: var(--muted); font-size: .83rem; }
.title-chip b { color: var(--navy); }
.level-progress { margin-top: 18px; padding: 15px 14px 12px; border: 1px solid #c9e1ea; border-radius: 18px; background: rgba(255,255,255,.76); }
.level-progress-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; color: #587687; font-size: .9rem; font-weight: 800; }
.level-progress-title small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.level-progress-row { --level-progress-color: #ef9eb4; display: grid; grid-template-columns: 30px minmax(54px,1fr) 66px 43px; align-items: center; gap: 7px; min-height: 28px; padding: 3px 4px; border-radius: 9px; color: var(--muted); }
.level-progress-row.current { background: #f5fafc; }
.level-progress-row[data-level="D"] { --level-progress-color: #e0b85d; }
.level-progress-row[data-level="C"] { --level-progress-color: #84c9b1; }
.level-progress-row[data-level="B"] { --level-progress-color: #87bcd5; }
.level-progress-row[data-level="A"] { --level-progress-color: #a99bce; }
.level-progress-name { color: #607b89; font-size: .875rem; font-weight: 800; }
.level-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e6eef1; }
.level-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--level-progress-color); transition: width .35s ease; }
.level-progress-row b { color: #637985; font-size: .78rem; text-align: right; white-space: nowrap; }
.level-progress-percent { color: #84939a; font-size: .73rem; text-align: right; }

.map-section { margin-top: 46px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.section-note { color: var(--muted); font-size: .88rem; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.stage-card { width: 100%; min-height: 124px; padding: 18px; border: 3px solid #fff; border-radius: 24px; background: #fff; display: grid; grid-template-columns: 38px 62px minmax(0, 1fr) auto; align-items: center; gap: 15px; text-align: left; color: var(--ink); box-shadow: 0 9px 0 #dcebf5; }
.stage-card.available:hover { transform: translateY(-3px); box-shadow: 0 20px 38px rgba(21,59,103,.17); }
.stage-number { align-self: start; color: #8ca0b3; font: 700 .78rem "Baloo 2", sans-serif; }
.stage-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: #e4f5ff; color: var(--blue); font: 800 1.3rem "Baloo 2", sans-serif; }
.stage-grid .stage-icon { font-size: 1.05rem; }
.stage-card.available { background: linear-gradient(135deg, #ffffff, #fff9d9); border-color: #fff; box-shadow: 0 10px 0 #f3d968, var(--shadow); }
.stage-card.available .stage-icon { background: var(--yellow); color: var(--navy); transform: rotate(-6deg); border: 3px solid #fff; box-shadow: 0 5px 0 #e2bd28; }
.stage-card:nth-child(4n+2) .stage-icon { background: #dff8f1; color: #16947b; }
.stage-card:nth-child(4n+3) .stage-icon { background: #ffe4e1; color: #d95750; }
.stage-card:nth-child(4n+4) .stage-icon { background: #e8e5ff; color: #6f5bd6; }
.stage-content { min-width: 0; }
.stage-content small, .stage-content strong, .stage-content em { display: block; }
.stage-content small { color: var(--teal); font-weight: 800; font-size: .75rem; }
.stage-content strong { margin: 3px 0 5px; font-size: 1.05rem; }
.stage-content em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78rem; font-style: normal; }
.stage-status { min-width: 76px; text-align: right; }
.stage-status b, .stage-status small { display: block; }
.stage-status b { color: #f0b400; letter-spacing: .04em; }
.stage-status small { margin-top: 4px; color: #8a9aaa; font-size: .68rem; }
.stage-card.locked { box-shadow: none; opacity: .66; cursor: not-allowed; }

.game-shell { border: 4px solid #fff; border-radius: 32px; background: linear-gradient(180deg, #fff 0, #f7fcff 100%); overflow: hidden; min-height: 670px; box-shadow: 0 16px 0 rgba(63,130,230,.09), var(--shadow); }
.game-topline { min-height: 76px; padding: 13px 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.back-btn { justify-self: start; border: 0; background: transparent; color: var(--muted); font-weight: 700; }
.mode-tabs { display: flex; padding: 5px; border: 2px solid #d9eaf6; border-radius: 16px; background: #eef8ff; }
.mode-tabs button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 10px; color: #6d7e8f; background: transparent; font-weight: 700; }
.mode-tabs button.active { color: #fff; background: var(--blue); box-shadow: 0 4px 0 #275fae; }
.game-score { justify-self: end; display: flex; align-items: center; gap: 5px; color: #bd8500; }
.game-score span { color: #f3b700; }
.question-progress { padding: 17px 30px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; color: var(--muted); font-size: .82rem; }
.question-progress > span { min-width: 72px; font-weight: 800; color: var(--navy); }
.bar { height: 8px; border-radius: 99px; background: #e9eff4; overflow: hidden; }
.bar i { display: block; height: 100%; width: 5%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #55ceb8); transition: width .35s ease; }
.game-area { min-height: 560px; padding: 25px clamp(20px, 6vw, 72px) 48px; display: grid; place-items: center; }

.word-card { width: min(600px, 100%); text-align: center; }
.word-visual { width: 138px; height: 138px; margin: 0 auto 25px; border: 5px solid #fff; border-radius: 38px; display: grid; place-items: center; background: linear-gradient(145deg, #ffe97c, #ffd245); color: var(--navy); font: 800 3rem "Baloo 2", sans-serif; box-shadow: 0 10px 0 #e6b92b, 0 16px 30px rgba(219,178,38,.2); transform: rotate(-4deg); }
.word-card .word-en { margin: 0; color: var(--navy); font: 800 clamp(3rem, 8vw, 5.6rem)/1 "Baloo 2", sans-serif; letter-spacing: -.02em; }
.word-pronunciation { margin: 10px 0 -2px; color: var(--blue); font: 700 1rem/1.5 "Noto Sans TC", system-ui, sans-serif; }
.word-related { margin: 8px 0 -2px; color: #7792a0; font-size: .9rem; }
.word-card .word-zh { margin: 8px 0 0; color: var(--muted); font-size: 1.3rem; }
.word-actions { margin-top: 34px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.round-btn { min-height: 50px; padding: 0 20px; border: 2px solid var(--line); border-radius: 17px; color: var(--navy); background: #fff; font-weight: 800; box-shadow: 0 5px 0 #dceaf4; }
.round-btn.speak { background: #e7f7ff; border-color: #bfe4fb; box-shadow: 0 5px 0 #b7dff5; }
.round-btn.next { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 5px 0 #245ea9; }
.tip { margin-top: 26px; color: #8190a0; font-size: .82rem; }

.quiz-card { width: min(720px, 100%); text-align: center; }
.quiz-kicker { color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.quiz-prompt { margin: 11px 0 27px; font-size: clamp(1.8rem, 5vw, 3.4rem); line-height: 1.3; color: var(--navy); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.choice-btn { min-height: 74px; padding: 12px 18px; border: 2px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; font-weight: 800; font-size: 1.1rem; }
.choice-btn:nth-child(1) { background: #fff8d7; border-color: #f4dda0; }
.choice-btn:nth-child(2) { background: #eaf8ff; border-color: #c7e7fa; }
.choice-btn:nth-child(3) { background: #effcf7; border-color: #ccefe2; }
.choice-btn:nth-child(4) { background: #fff0ee; border-color: #f7d0cb; }
.choice-btn:hover { border-color: #a7c9ed; background: #f6fbff; }
.choice-btn.correct { border-color: var(--teal); background: #e8fbf5; color: #107b68; animation: pop .28s ease; }
.choice-btn.wrong { border-color: var(--coral); background: #fff0ed; color: #bd3f2d; animation: shake .3s ease; }
@keyframes pop { 50% { transform: scale(1.03); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.feedback { min-height: 55px; margin-top: 18px; font-weight: 700; color: var(--muted); }
.feedback.good { color: var(--teal); }
.feedback.bad { color: var(--coral); }

.spell-box { width: min(600px, 100%); text-align: center; }
.sound-or-meaning { width: 100px; height: 100px; margin: 0 auto 18px; border: 0; border-radius: 30px; color: #fff; background: var(--blue); font-size: 2rem; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.spell-box h2 { margin: 0 0 5px; font-size: 2rem; }
.spell-box p { margin: 0 0 24px; color: var(--muted); }
.spell-answer { min-height: 78px; padding: 12px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; border: 2px dashed #b7d2dc; border-radius: 20px; background: #fbfefe; transition: .2s ease; }
.answer-slot { width: 48px; height: 52px; border-radius: 13px; display: grid; place-items: center; font: 800 2rem/1 "Baloo 2", sans-serif; text-transform: lowercase; }
.answer-slot.empty { color: #b5c7cc; border: 2px dashed #cadcdf; background: #f5f9f9; }
.answer-slot.filled { color: #506f7e; border: 2px solid #8fc4d8; background: #eaf7fb; box-shadow: 0 4px 0 #c8e2ea; cursor: pointer; }
.spell-answer.correct { border-color: var(--teal); background: #effbf6; }
.spell-answer.correct .answer-slot.filled { color: #477b69; border-color: #8bcbb5; background: #ddf3ea; box-shadow: 0 4px 0 #b9dfd1; }
.spell-answer.wrong { border-color: var(--coral); background: #fff2f5; animation: shake .3s ease; }
.letter-bank { margin: 24px auto 10px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.letter-tile { width: 54px; height: 58px; border: 2px solid #d4ba67; border-radius: 15px; color: #665b45; background: #fff0b8; font: 800 2rem/1 "Baloo 2", sans-serif; text-transform: lowercase; box-shadow: 0 5px 0 #e6d497; transition: transform .16s ease, opacity .16s ease; }
.letter-tile:hover:not(:disabled) { transform: translateY(-3px); }
.letter-tile.used { opacity: .2; box-shadow: none; transform: translateY(4px); }
.spell-tools { margin-top: 18px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.spell-tools .round-btn { min-height: 44px; font-size: .9rem; }
.spell-tools button:disabled, .spell-actions button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.spell-actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }

.result-card { width: min(660px, 100%); text-align: center; }
.result-crown { display: grid; place-items: center; width: 110px; height: 110px; margin: 0 auto 22px; border-radius: 30px; color: var(--navy); background: var(--yellow); font-size: 3.7rem; transform: rotate(-3deg); }
.result-card h2 { margin: 0; color: var(--navy); font-size: 2.5rem; }
.result-stars { margin: 10px 0; color: #f0b400; font-size: 2.1rem; letter-spacing: .15em; }
.result-summary { color: var(--muted); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.result-stats div { padding: 16px; border-radius: 16px; background: #f4f8fb; }
.result-stats b { display: block; color: var(--navy); font-size: 1.35rem; }
.result-stats span { color: var(--muted); font-size: .75rem; }
.wrong-list { margin: 0 0 22px; color: var(--coral); font-weight: 700; }

.proof-dialog { width: min(930px, calc(100% - 24px)); max-height: 88vh; padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 30px 80px rgba(4,31,60,.35); }
.proof-dialog::backdrop { background: rgba(8,35,63,.58); backdrop-filter: blur(4px); }
.proof-dialog > p, .proof-table { margin-left: 28px; margin-right: 28px; }
.dialog-head { position: sticky; top: 0; z-index: 2; padding: 24px 28px 18px; display: flex; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 4px 0 0; }
.close-btn { width: 42px; height: 42px; border: 0; border-radius: 13px; color: var(--navy); background: #edf3f7; font-size: 1.5rem; }
.proof-summary { margin: 18px 28px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.proof-summary span { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f8fcfd; font-size: .88rem; }
.proof-summary b { color: var(--teal); }
.proof-table { margin-top: 20px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.proof-row { display: grid; grid-template-columns: 95px 1fr 1.6fr; }
.proof-row > * { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.proof-row > * + * { border-left: 1px solid var(--line); }
.proof-group-title { padding: 10px 15px; border-bottom: 1px solid var(--line); color: #597887; background: #eef8fb; font-weight: 800; letter-spacing: .03em; }
.proof-row:last-child > *, .proof-table > :last-child { border-bottom: 0; }
.proof-head { background: var(--navy); color: #fff; }
.proof-row span { color: var(--muted); line-height: 1.65; }
.proof-row span strong { color: var(--teal); }
.proof-note { padding-bottom: 26px; color: var(--muted); font-size: .82rem; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 12px; color: #fff; background: var(--navy-2); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .progress-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .progress-head { grid-column: 1 / -1; }
  .ring { width: 135px; margin: 20px; }
  .level-path { padding: 0 12px; }
  .title-chip { grid-column: 1 / -1; }
  .stage-grid { grid-template-columns: 1fr; }
  .game-topline { grid-template-columns: auto 1fr auto; }
  .mode-tabs { overflow-x: auto; justify-self: center; max-width: calc(100vw - 170px); }
  .mode-tabs button { padding: 0 12px; }
}

@media (max-width: 590px) {
  .topbar { height: 68px; padding: 0 14px; }
  .brand small, .star-pill { display: none; }
  .icon-btn { padding: 0 10px; font-size: .78rem; }
  main { width: min(100% - 24px, 1180px); padding-top: 22px; }
  .hero-card { min-height: 0; padding: 30px 24px; border-radius: 24px; }
  .hero-card h1 { font-size: 2.45rem; }
  .hero-card { padding-bottom: 255px; }
  .hero-mascot { width: 255px; right: -10px; bottom: -20px; }
  .hero-sticker { width: 36px; height: 36px; font-size: 1rem; }
  .sticker-star { right: auto; left: 24px; top: auto; bottom: 185px; }
  .sticker-a { right: 28px; top: auto; bottom: 205px; }
  .sticker-b { right: auto; left: 37px; bottom: 78px; }
  .hero-actions > button { width: 100%; }
  .daily-mix { gap: 11px; font-size: .76rem; }
  .progress-card { display: block; border-radius: 24px; }
  .ring { margin: 22px auto; }
  .section-heading { align-items: start; }
  .section-note { display: none; }
  .stage-card { grid-template-columns: 28px 54px minmax(0,1fr); gap: 10px; padding: 15px 12px; }
  .stage-icon { width: 50px; height: 50px; }
  .stage-status { display: none; }
  .game-shell { min-height: calc(100vh - 100px); border-radius: 22px; }
  .game-topline { min-height: 68px; padding: 10px 12px; }
  .back-btn { font-size: 0; }
  .back-btn::before { content: "←"; font-size: 1.2rem; }
  .mode-tabs { max-width: calc(100vw - 110px); }
  .mode-tabs button { min-width: 58px; padding: 0 8px; font-size: .78rem; }
  .question-progress { padding: 13px 17px; grid-template-columns: 1fr auto; }
  .question-progress > span { display: none; }
  .game-area { min-height: 490px; padding: 20px 16px 35px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-btn { min-height: 61px; }
  .word-visual { width: 110px; height: 110px; border-radius: 28px; }
  .proof-row { grid-template-columns: 70px 1fr; }
  .proof-row > *:nth-child(3) { grid-column: 1 / -1; border-left: 0; background: #f7fbfe; }
  .proof-head > *:nth-child(3) { display: none; }
  .result-stats { gap: 7px; }
  .result-stats div { padding: 12px 5px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* Japanese kawaii stationery refresh */
:root {
  --navy: #52738a;
  --navy-2: #456378;
  --blue: #7dbfdf;
  --sky: #edf8fc;
  --yellow: #f7e39b;
  --coral: #e993ab;
  --teal: #8ccdb8;
  --ink: #584d49;
  --muted: #7f7470;
  --paper: #fffdf8;
  --line: #d9e9ed;
  --shadow: 0 12px 30px rgba(92, 121, 130, .11);
}

body {
  color: var(--ink);
  background-color: #fffaf3;
  background-image:
    linear-gradient(rgba(147, 196, 218, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 196, 218, .08) 1px, transparent 1px),
    radial-gradient(circle at 12% 11%, rgba(247, 182, 200, .2), transparent 24%),
    radial-gradient(circle at 88% 78%, rgba(173, 222, 207, .2), transparent 25%);
  background-size: 26px 26px, 26px 26px, auto, auto;
}

button:focus-visible,
input:focus-visible,
.choice-btn:focus-visible { outline-color: rgba(111, 176, 207, .38); }

.topbar {
  background: rgba(255, 253, 248, .94);
  border-bottom: 1px solid #d8e9ef;
  box-shadow: 0 5px 20px rgba(102, 135, 144, .07);
}

.brand-mark {
  border: 2px dashed #8cbdd2;
  border-radius: 14px;
  color: #57798d;
  background: #fff0b9;
  box-shadow: 3px 4px 0 #dceef4;
}

.brand strong { color: #566f7e; }
.star-pill { color: #8b7043; background: #fff8dc; border-color: #eddda0; }
.star-pill span { color: #e4b956; }
.icon-btn { color: #5f7b89; border: 1px solid #bcdce8; border-radius: 13px; box-shadow: 2px 3px 0 #e3eef1; }

.hero-card,
.progress-card,
.stage-card,
.game-shell { border-color: #b8d8e4; box-shadow: var(--shadow); }

.hero-card {
  border: 2px solid #9ecddd;
  border-radius: 30px;
  background: linear-gradient(145deg, #fffdf8 0%, #fff9ea 56%, #eff9fc 100%);
  box-shadow: 5px 7px 0 #dceef3, var(--shadow);
}

.hero-card::before {
  width: 390px;
  height: 390px;
  right: -62px;
  bottom: -112px;
  background: radial-gradient(circle at 42% 38%, #f3fbfd 0 50%, #dff1f6 51% 70%, transparent 71%);
  opacity: .9;
}

.hero-card::after {
  content: "ABC  abc";
  left: 38px;
  bottom: -12px;
  color: rgba(125, 191, 223, .08);
  font-size: 4.8rem;
  letter-spacing: .04em;
}

.hero-card .eyebrow {
  color: #678da0;
  border: 1px dashed #acd1df;
  background: rgba(255, 255, 255, .82);
  box-shadow: none;
}

.status-dot { background: #a7d7c5; box-shadow: 0 0 0 4px rgba(167, 215, 197, .18); }
.hero-card h1 { color: #526d7a; }
.hero-card h1 span { color: #dd86a0; text-shadow: none; }
.hero-card p { color: #756d69; }
.hero-mascot { right: 4px; bottom: -12px; filter: drop-shadow(0 9px 4px rgba(92, 111, 118, .13)); animation-duration: 4.4s; }

.hero-sticker {
  border: 1px solid #796a64;
  border-radius: 12px;
  color: #625955;
  box-shadow: 2px 3px 0 rgba(105, 91, 84, .14);
}

.sticker-star { background: #f7c5d3; }
.sticker-a { background: #b7def0; }
.sticker-b { background: #bee6d8; }

.primary-btn,
.secondary-btn { border-radius: 15px; }
.primary-btn {
  color: #425f71;
  background: #a9d9ee;
  border: 2px solid #6eacc9;
  box-shadow: 0 4px 0 #6eacc9;
}
.secondary-btn { color: #755f66; background: #fff9fb; border: 1px solid #e8bcca; box-shadow: 0 4px 0 #f0dce2; }
.daily-mix { color: #7a716e; }
.daily-mix span { border: 1px dashed #b8d7df; background: rgba(255, 255, 255, .82); }
.daily-mix b { color: #db88a0; }

.progress-card {
  border: 2px solid #acd3e1;
  border-radius: 28px;
  background: linear-gradient(180deg, #f6fcfe, #edf8fb);
  box-shadow: 5px 7px 0 #dbeef3, var(--shadow);
}

.progress-head b,
.ring strong,
.title-chip b { color: #56798b; }
.ring { border: 5px solid #fff; background: conic-gradient(#ef9eb4 var(--p), #dceef2 0); box-shadow: 3px 5px 0 #d8eaee; }
.level-node b { border: 1px solid #d7e1e2; border-radius: 11px; background: #f2f1ec; color: #968d88; }
.level-node.current b { color: #66565c; background: #f5bbcc; box-shadow: 2px 4px 0 #d993a8; }
.level-node.current span { color: #69a991; }
.title-chip { border-color: #9bcbdc; background: #fffdf9; }

.eyebrow { color: #6ca48f; }
.section-heading h2 { color: #536d79; }
.stage-card {
  border: 1px solid #b8d5df;
  border-radius: 21px;
  background: #fffdf9;
  box-shadow: 3px 5px 0 #dfecef;
}
.stage-card.available { border: 2px solid #e1c97c; background: linear-gradient(135deg, #fffdf8, #fff8df); box-shadow: 4px 6px 0 #efe1af, var(--shadow); }
.stage-card.available:hover { box-shadow: 4px 7px 0 #efe1af, 0 15px 28px rgba(99, 121, 128, .12); }
.stage-icon { border-radius: 16px; color: #5e879a; background: #e4f5fa; }
.stage-card.available .stage-icon { color: #77643b; background: #f5dfa0; border: 1px solid #d9bd67; box-shadow: 2px 4px 0 #e4ca77; }
.stage-card:nth-child(4n+2) .stage-icon { color: #5e9985; background: #ddf3ea; }
.stage-card:nth-child(4n+3) .stage-icon { color: #b86f83; background: #f8e1e8; }
.stage-card:nth-child(4n+4) .stage-icon { color: #7d76a0; background: #eae6f4; }
.stage-content small { color: #6ba990; }
.stage-status b { color: #d6a94e; }

.game-shell { border: 2px solid #a9d1df; border-radius: 28px; background: #fffdf9; box-shadow: 5px 7px 0 #dbecef, var(--shadow); }
.game-topline { border-bottom-color: #d9e8eb; background: #fbfefe; }
.mode-tabs { border: 1px solid #c5dfe8; background: #edf7fa; }
.mode-tabs button.active { color: #466677; background: #a9d8eb; box-shadow: 0 3px 0 #7eb9d0; }
.bar i { background: #8ecdb8; }
.word-visual { border: 2px dashed #c6a94f; border-radius: 30px; color: #655a42; background: #fff0b8; box-shadow: 3px 5px 0 #ead89d; }
.word-card .word-en,
.quiz-prompt,
.result-card h2 { color: #547587; }
.word-pronunciation { color: #6da9c4; }
.round-btn { color: #547181; border: 1px solid #bedae3; box-shadow: 2px 4px 0 #dce9ec; }
.round-btn.speak { background: #eaf7fb; border-color: #acd4e3; box-shadow: 2px 4px 0 #d2e8ef; }
.round-btn.next { color: #466473; background: #addbed; border-color: #79b4cd; box-shadow: 0 4px 0 #79b4cd; }
.choice-btn { color: #655b57; border-width: 1px; border-radius: 15px; }
.choice-btn:nth-child(1) { background: #fff8dc; border-color: #eadca1; }
.choice-btn:nth-child(2) { background: #eef8fc; border-color: #c5e0e9; }
.choice-btn:nth-child(3) { background: #eef9f4; border-color: #c6e4d9; }
.choice-btn:nth-child(4) { background: #fff2f5; border-color: #ebccd5; }
.sound-or-meaning { background: #91cbe2; box-shadow: 0 5px 0 #6daac2; }
.result-crown { color: #6c5d40; background: #f5dfa1; }
.proof-dialog { border: 2px solid #aed1dd; background: #fffdf9; }
.dialog-head { background: #f7fcfd; }
.proof-head { background: #759aad; }
.proof-note a { color: #4f8eaa; font-weight: 700; }
.toast { background: #587484; }

@media (max-width: 590px) {
  .hero-card { border-radius: 23px; padding-bottom: 250px; }
  .hero-card::before { width: 310px; height: 310px; right: -70px; bottom: -85px; }
  .hero-mascot { width: 248px; right: 0; bottom: -8px; }
  .game-shell { border-radius: 21px; }
  .spell-answer { gap: 6px; padding: 10px 8px; }
  .answer-slot { width: 39px; height: 44px; border-radius: 11px; font-size: 1.65rem; }
  .letter-bank { gap: 8px; }
  .letter-tile { width: 47px; height: 51px; border-radius: 13px; font-size: 1.7rem; }
}
