:root{--bg: #ffffff;--surface: #ffffff;--text: #1f1d1a;--muted: #6b665e;--line: #ece6dc;--accent: #b7282e;--accent-deep: #8e1c21;--accent-ink: #ffffff;--accent-soft: #fbefee;--pattern: #ecc6c7;--ok: #1e7f4f;--ok-soft: #eef7f1;--ng: #b3261e;--ng-soft: #fbe9e8;--warn-soft: #fff4d6;--info-soft: #eef3fa;--radius: 14px;--shadow: none;--font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;color-scheme:light dark}@media(prefers-color-scheme:dark){:root{--bg: #161514;--surface: #1f1d1b;--text: #f0ece6;--muted: #a39d93;--line: #3a3531;--accent: #e8706a;--accent-deep: #f3a19c;--accent-ink: #1a1110;--accent-soft: #3a211f;--pattern: #7a3c39;--ok: #57c48a;--ok-soft: #1c3428;--ng: #f08a80;--ng-soft: #3d2120;--warn-soft: #3a3118;--info-soft: #1d2a3a}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;font-size:112.5%}body{margin:0;background:var(--bg);color:var(--text);font:1rem/1.65 var(--font-body)}[lang=ja],.ja{font-family:var(--font-ja)}button,select,input{font:inherit;color:inherit}a{color:var(--accent)}h2{font-size:1.35rem;margin:.5rem 0 .75rem}h3{font-size:1.05rem;margin:1.25rem 0 .5rem}.app{position:relative;max-width:560px;margin:0 auto;padding:max(12px,env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom))}.app-header{display:flex;align-items:center;justify-content:space-between;margin:4px 0 8px}.app-title{background:none;border:0;padding:6px 0;cursor:pointer;text-align:left;display:flex;align-items:center;gap:12px}.app-seal{width:38px;height:38px;border-radius:6px;background:var(--accent);color:var(--accent-ink);display:flex;align-items:center;justify-content:center;font-size:1.3rem;font-weight:700;transform:rotate(-4deg);flex:none}.app-title-text{display:flex;flex-direction:column;line-height:1.25}.app-name{font-weight:700;font-size:1.2rem}.app-sub{font-size:.8rem;color:var(--muted);letter-spacing:.2em}.seigaiha{display:block;margin:calc(-1*max(12px,env(safe-area-inset-top))) -16px 6px;width:calc(100% + 32px)}.seigaiha circle{fill:var(--bg);stroke:var(--pattern);stroke-width:1}.view{display:flex;flex-direction:column;gap:14px}.muted{color:var(--muted);font-size:.92rem}.hint{color:var(--muted);font-size:.85rem;margin:-4px 0 0;text-align:center}.btn{min-height:48px;padding:10px 16px;border-radius:12px;border:1px solid var(--line);background:var(--surface);cursor:pointer;text-align:center;touch-action:manipulation}.btn:disabled{opacity:.45;cursor:default}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:700}.btn-lg{min-height:56px;font-size:1.05rem;width:100%}.btn-danger{color:var(--ng)}.btn.is-on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-deep)}.link{background:none;border:0;color:var(--accent);padding:10px 4px;cursor:pointer;min-height:44px}.hero{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;display:flex;flex-direction:column;gap:10px}.hero-level{margin:0;color:var(--accent-deep);font-size:.85rem;font-weight:700}.hero-unit{margin:0;font-size:1.55rem;font-weight:700;line-height:1.35}.unit-meter{height:6px;background:var(--accent-soft);border-radius:3px;overflow:hidden}.unit-meter-fill{height:100%;background:var(--accent);transition:width .3s}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stat{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 6px;text-align:center;display:flex;flex-direction:column}.stat-num{font-size:1.5rem;font-weight:700}.stat-label{font-size:.8rem;color:var(--muted)}.card{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px}.card h3{margin-top:0}.card .btn{width:100%;margin-top:8px}.section-title{margin:0 0 8px;font-size:.95rem;display:flex;align-items:center;gap:10px;letter-spacing:.04em}.section-title:before{content:"";width:18px;height:1px;background:var(--accent)}.section-title-ja{font-size:.85rem;color:var(--muted);font-weight:400}.weak .muted{margin:6px 0 0;font-size:.82rem}.weak-topics{margin:0 0 6px;padding-left:1.1rem}.chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px}.chip{padding:4px 12px;border-radius:999px;background:var(--accent-soft);color:var(--accent-deep);font-size:.95rem}.menu{display:grid;grid-template-columns:1fr 1fr;gap:8px}.levels{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}.level-chip{border:1px solid var(--line);border-radius:999px;padding:4px 12px;font-size:.85rem;display:flex;flex-direction:column;align-items:center;line-height:1.2}.level-chip.is-current{border-color:var(--accent);color:var(--accent);font-weight:700}.level-chip.is-soon{opacity:.5}.level-chip small{font-size:.8rem}.session-bar{display:flex;align-items:center;justify-content:space-between;gap:8px}.session-title{font-weight:600;font-size:.95rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-score{color:var(--muted);font-size:.85rem;white-space:nowrap}.progress-track{height:6px;background:var(--line);border-radius:3px;overflow:hidden}.progress-fill{height:100%;background:var(--accent);transition:width .25s}.qcard{background:var(--bg);border:1px solid var(--line);border-radius:18px;padding:18px 16px;display:flex;flex-direction:column;gap:14px}.qcard-head{display:flex;justify-content:space-between;font-size:.8rem;color:var(--muted)}.qcard-kind{background:var(--accent-soft);color:var(--accent);border-radius:999px;padding:1px 10px;font-weight:600}.qcard-instruction{margin:0;font-weight:600}.qcard-big{font-size:4.5rem;text-align:center;line-height:1.2;padding:18px 0}.qcard-big,.qcard-ja{position:relative;isolation:isolate}.qcard-big:before,.qcard-ja:before,.qcard-big:after,.qcard-ja:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:50%;z-index:-1;pointer-events:none}.qcard-big:before,.qcard-ja:before{width:150px;height:150px;border:1px solid var(--pattern)}.qcard-big:after,.qcard-ja:after{width:134px;height:134px;border:1px dashed var(--pattern)}.qcard-ja{display:flex;align-items:center;justify-content:center;gap:10px;min-height:160px;text-align:center}.qcard-target{font-size:1.3rem;text-align:center;margin:4px 0;font-weight:600}.qcard-stem{text-align:center;padding:8px 0}.qcard-stem-tr{margin:6px 0 0;color:var(--muted);font-size:.9rem}.listen-prompt{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 0}.choices{list-style:none;margin:0;padding:0;display:grid;gap:8px}.choice{width:100%;min-height:56px;padding:10px 16px;border-radius:14px;border:1.5px solid var(--line);background:var(--bg);text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:2px;touch-action:manipulation}.choice:not(:disabled):active{transform:scale(.99)}.choice-text{font-size:1.05rem}.choice-sub{font-size:.82rem;color:var(--muted)}.choice.is-correct{border-color:var(--ok);background:var(--ok-soft)}.choice.is-wrong{border-color:var(--ng);background:var(--ng-soft)}.choice.is-dim{opacity:.5}.choice:disabled{cursor:default;color:inherit}.feedback{border-radius:16px;padding:12px 14px;display:flex;flex-direction:column;gap:10px}.feedback.ok{background:var(--ok-soft)}.feedback.ng{background:var(--ng-soft)}.feedback-head{margin:0;font-weight:700;font-size:1.1rem;display:flex;align-items:center;gap:12px}.stamp{width:42px;height:42px;flex:none;border:2px solid var(--accent);border-radius:50%;color:var(--accent);display:inline-flex;align-items:center;justify-content:center;font-size:1.2rem;font-weight:700;font-family:var(--font-ja);transform:rotate(-8deg)}.feedback.ok .feedback-head{color:var(--ok)}.feedback.ng .feedback-head{color:var(--ng)}.feedback-note{margin:0}.detail{background:var(--bg);border-radius:14px;padding:10px 12px;display:flex;flex-direction:column;gap:6px}.detail-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.detail-gloss{margin:0;font-weight:600}.detail-row{margin:0;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;font-size:.92rem}.detail-label{color:var(--muted);font-size:.8rem}.detail-note{margin:0;font-size:.9rem;color:var(--muted)}.detail-example{border-top:1px dashed var(--line);padding-top:6px}.kana-big{font-size:2.2rem;font-family:var(--font-ja)}.kana-romaji{font-size:1.2rem}.ja{display:inline-flex;flex-direction:column;align-items:inherit}.ja-text{line-height:1.9}.ja-romaji{font-size:.78em;color:var(--muted);font-family:system-ui,sans-serif;letter-spacing:.01em}.ja-sm{font-size:.95rem}.ja-md{font-size:1.1rem}.ja-lg{font-size:1.4rem}.ja-xl{font-size:2.2rem}.ja-gap{display:inline-block;width:.25em}ruby{ruby-position:over}rt{font-size:.55em;color:var(--muted)}.qcard-ja .ja,.qcard-stem .ja{align-items:center}.wo{display:flex;flex-direction:column;gap:12px}.wo-line{min-height:64px;border-bottom:2px solid var(--line);padding:8px 0;display:flex;flex-wrap:wrap;gap:6px;align-items:flex-end}.wo-placeholder{color:var(--muted);font-size:.9rem}.wo-pool{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.wo-token{min-height:48px;padding:6px 12px;border-radius:10px;border:1px solid var(--line);background:var(--bg);font-size:1.15rem;cursor:pointer;touch-action:manipulation}.wo-placed{background:var(--accent-soft);border-color:var(--accent)}.wo-token.is-ok{background:var(--ok-soft);border-color:var(--ok)}.wo-token.is-ng{background:var(--ng-soft);border-color:var(--ng)}.play{border:1px solid var(--line);background:var(--surface);border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;color:var(--accent);flex:none}.play svg{width:55%;height:55%}.play-sm{width:36px;height:36px}.play-md{width:44px;height:44px}.play-lg{width:88px;height:88px}.play.is-playing{background:var(--accent);color:var(--accent-ink)}.result-score{font-size:2.4rem;font-weight:700;margin:0;text-align:center}.result-rate{font-size:1rem;color:var(--muted);font-weight:400}.result-message{text-align:center;font-size:1.05rem}.review-list{margin:0;padding-left:1.1rem;display:flex;flex-direction:column;gap:6px}.topic-list,.word-list,.example-list,.sources{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.topic-item,.word-row{width:100%;min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 14px;border-radius:12px;border:1px solid var(--line);background:var(--surface);cursor:pointer;text-align:left}.badge{font-size:.8rem;border-radius:999px;padding:2px 10px;white-space:nowrap;border:1px solid var(--line)}.badge-mastered{background:var(--ok-soft);color:var(--ok);border-color:transparent}.badge-remedial{background:var(--ng-soft);color:var(--ng);border-color:transparent}.badge-unlocked{background:var(--info-soft);border-color:transparent}.badge-locked{opacity:.6}.pattern{font-size:1.15rem;background:var(--accent-soft);border-radius:10px;padding:8px 12px;margin:0}.summary{font-weight:600}.example-list li{background:var(--surface);border-radius:10px;padding:8px 12px}.sources{font-size:.85rem}.word-gloss{flex:1;font-size:.9rem;color:var(--muted);text-align:right}.word-detail{padding:10px 14px;display:flex;flex-direction:column;gap:8px}.dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex:none;background:var(--line)}.dot.status-learning{background:#e0a526}.dot.status-review{background:var(--ng)}.dot.status-known{background:var(--ok)}.legend{font-size:.8rem;color:var(--muted);display:flex;gap:6px;align-items:center;flex-wrap:wrap}.kana-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.kana-cell{background:var(--surface);border-radius:10px;padding:6px 2px;display:flex;flex-direction:column;align-items:center;border:2px solid transparent}.kana-cell-char{font-size:1.6rem;line-height:1.2}.kana-cell-romaji{font-size:.8rem;color:var(--muted)}.kana-cell.status-known{border-color:var(--ok)}.kana-cell.status-review{border-color:var(--ng)}.kana-cell .play{margin-top:2px}.kanji-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.kanji-cell{background:var(--surface);border-radius:10px;padding:6px 2px;display:flex;flex-direction:column;align-items:center;border:2px solid transparent;color:inherit;font:inherit;cursor:pointer;min-width:0}.kanji-cell.is-open{border-color:var(--accent)}.kanji-cell.status-known{border-color:var(--ok)}.kanji-cell.status-review{border-color:var(--ng)}.kanji-cell-char{font-size:1.9rem;line-height:1.2;font-family:var(--font-ja)}.kanji-cell-meaning{font-size:.8rem;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kanji-detail{display:flex;flex-direction:column;gap:6px}.kanji-head{display:flex;align-items:center;gap:14px}.kanji-big{font-size:3.4rem;line-height:1;font-family:var(--font-ja)}.kanji-meaning{font-size:1.1rem;font-weight:600;margin:0}.kanji-head .muted{margin:0}.kanji-words{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.kanji-similar{font-size:1.3rem;letter-spacing:.3em}.choice-kanji .ja-text{font-size:2rem}.choice-spell .ja-text{font-size:1.5rem}.select{width:100%;min-height:48px;border-radius:12px;border:1px solid var(--line);background:var(--surface);padding:0 12px}.toggle{display:flex;align-items:center;gap:12px;min-height:48px;cursor:pointer}.toggle input{width:22px;height:22px;accent-color:var(--accent);flex:none}.field{display:flex;align-items:center;gap:10px;min-height:48px;flex-wrap:wrap}.field .select{width:auto;flex:1}.field input[type=range]{flex:1;accent-color:var(--accent)}.notice{border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:8px;font-size:.92rem}.notice p{margin:0}.notice-info{background:var(--info-soft)}.notice-warn{background:var(--warn-soft)}.site-links{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 14px;margin:8px 0 0;padding:0;list-style:none;font-size:.85rem}.site-links a{color:var(--muted);display:inline-flex;align-items:center;min-height:44px}.ad{margin-top:16px;border-top:1px solid var(--line);padding-top:8px;min-height:100px}.ad-label{display:block;font-size:.8rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}@media(prefers-reduced-motion:reduce){*{transition:none!important}}.load-error{max-width:480px;margin:20vh auto 0;padding:0 16px;text-align:center}.load-error button{margin-top:12px;min-height:44px;padding:0 20px;border-radius:999px;border:1px solid var(--line);background:var(--bg);color:var(--text)}.stroke-wrap{display:flex;align-items:flex-end;gap:12px;margin:8px 0}.stroke-order{width:150px;height:150px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.stroke-loading{display:block}.stroke-guide{stroke:var(--line);stroke-width:.6;stroke-dasharray:2 2}.stroke-bg{fill:none;stroke:var(--line);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.stroke-ink{fill:none;stroke:var(--accent);stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;animation:stroke-draw .6s ease-out both}.stroke-num{font-size:8px;fill:var(--muted);opacity:0;animation:stroke-num .2s forwards;font-family:system-ui,sans-serif}@keyframes stroke-draw{0%{stroke-dashoffset:1;opacity:0}1%{opacity:1}to{stroke-dashoffset:0;opacity:1}}@keyframes stroke-num{to{opacity:1}}@media(prefers-reduced-motion:reduce){.stroke-ink{animation:none;stroke-dashoffset:0;opacity:1}.stroke-num{animation:none;opacity:1}}
