/* 英文法 RPG「言葉の地図」 */
.km-page { padding-top: 18px; }
.km { --km-h: min(calc(100svh - var(--hd, 58px) - 20px - 40px), 860px); }
/* 音の切り替え（サイト共通の YNS.mountToggle をゲームの上に置く） */
.km-snd { max-width: 760px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 34px; }
.km-snd-l { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink2); }
.km-snd-l .kqi { width: 16px; height: 16px; }
.km-lvup { animation: km-fade .45s ease-out both; animation-delay: var(--ld, 0ms); }
.km-lvup .km-lvup-ring { animation-delay: calc(var(--ld, 0ms) + 200ms); }
.km-app { position: relative; max-width: 760px; margin: 0 auto; height: var(--km-h); min-height: 560px; display: flex; flex-direction: column; overflow: hidden; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r, 16px); box-shadow: var(--sh2); font-size: 15px; -webkit-tap-highlight-color: transparent; }
.km-app :is(h2, h3, h4) { border: 0; padding: 0; background: none; box-shadow: none; scroll-margin: 0; }
.km-app :is(h2, h3, h4)::before, .km-app :is(h2, h3, h4)::after { content: none; display: none; }
.km-boot, .km-err { padding: 40px 20px; text-align: center; color: var(--ink2); }
.km-view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.km-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.km-app .kqi { width: 20px; height: 20px; flex: none; }
.km-app .kqi-s { width: 15px; height: 15px; opacity: .7; }
.km-app kbd { font: 700 11px/1 var(--en); }
.km-small { font-size: 13px; color: var(--ink2); line-height: 1.7; margin: 6px 0; }
.km-k { font-size: 12px; font-weight: 800; color: var(--ink2); letter-spacing: .04em; display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }

/* ── ボタン ── */
.km-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: 14px; font: 800 16px/1.2 var(--jp); cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s, opacity .2s; }
.km-btn-main { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-d); }
.km-btn-main:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-d); }
.km-btn-sub { background: var(--bg2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line2); }
.km-btn-sub:hover { box-shadow: inset 0 0 0 1.5px var(--ink3); }
.km-btn-danger { background: var(--ng); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--ng) 65%, #000); }
.km-btn-s { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.km-btn:disabled { opacity: .42; cursor: default; }
.km-btn kbd { opacity: .7; font-size: 10px; border: 1px solid currentColor; border-radius: 5px; padding: 2px 4px; }
.km-ib { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink2); cursor: pointer; }
.km-ib:hover { background: var(--bg2); color: var(--ink); }
.km-app :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.km-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.km-row .km-btn { flex: 1 1 110px; }
.km-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--bg2); color: var(--ink2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.km-chip .kqi { width: 14px; height: 14px; }
.km-chip-tr { background: var(--violet-bg); color: var(--violet); }
.km-chip-ok { background: var(--gold-bg); color: var(--gold); }
.km-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

/* ── タイトル ── */

/* ── 上の帯（HUD）── */
.km-hud { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-bottom: 1px solid var(--line); background: var(--card); flex: none; }
.km-me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.km-face { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--blue) 14%, var(--card)); flex: none; position: relative; }
.km-meta { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; min-width: 0; flex: 1; }
.km-meta b { font: 900 15px var(--en); }
.km-meta small { font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-xp { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 3px; max-width: 160px; }
.km-xp i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); border-radius: inherit; transition: width .8s ease; }
.km-pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 99px; background: var(--bg2); font: 800 13px var(--en); }
.km-pill .kqi { width: 16px; height: 16px; color: var(--coral); }
.km-pill-shard .kqi { color: var(--violet); }

/* ── 地図 ── */
.km-mapwrap { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: color-mix(in srgb, var(--blue) 11%, var(--bg)); scrollbar-width: thin; }
.km-dock { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--card); flex: none; padding-bottom: env(safe-area-inset-bottom); }
.km-dock button { position: relative; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--ink2); font: 700 11px var(--jp); cursor: pointer; padding: 4px 2px; }
.km-dock button .kqi { width: 23px; height: 23px; }
.km-dock button:hover { color: var(--ink); background: var(--bg2); }
.km-dock button em { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--coral); color: #fff; font: 800 10px/18px var(--en); font-style: normal; }
.km-dock .is-new { color: var(--coral); }
.km-dock .is-new::after { content: ""; position: absolute; top: 8px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.km-dock .is-new em ~ ::after { display: none; }

/* ── シートとパネル ── */
.km-layer { position: absolute; inset: 0; z-index: 20; }
.km-scrim { position: absolute; inset: 0; background: rgba(10, 14, 22, .45); animation: km-fade .2s; }
.km-sheet, .km-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); animation: km-up .26s cubic-bezier(.2, .8, .3, 1); }
.km-sheet { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88%; overflow: auto; }
.km-panel { top: 6%; display: flex; flex-direction: column; }
.km-panel-hd { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.km-panel-hd h3 { margin: 0; font-size: 18px; }
.km-panel-bd { flex: 1; overflow: auto; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
.km-x { position: absolute; right: 8px; top: 8px; }
.km-sheet-hd small { color: var(--ink2); font-size: 12px; }
.km-sheet-hd h3 { margin: 2px 44px 10px 0; font-size: 20px; line-height: 1.4; }
.km-sheet-foe { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: var(--bg2); }
.km-sheet-fig { width: 96px; height: 96px; flex: none; }
.km-foe-name { margin: 0; font-weight: 900; font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.km-warn { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--coral-bg); color: var(--ink); font-size: 13px; line-height: 1.6; }
.km-warn .kqi { color: var(--coral); }
.km-sheet-btns { display: grid; gap: 10px; margin-top: 16px; }

/* ── 戦い ── */
.km-battle { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.km-bt-top { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-bottom: 1px solid var(--line); flex: none; }
.km-bt-top p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; line-height: 1.3; }
.km-bt-top b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-bt-top small { font-size: 11px; color: var(--ink2); }
.km-sp { display: flex; gap: 6px; padding-right: 4px; }
.km-sp i { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); background: var(--line2); }
.km-sp i.on { background: var(--violet); box-shadow: 0 0 6px color-mix(in srgb, var(--violet) 60%, transparent); }
.km-arena { position: relative; flex: none; height: clamp(168px, 28svh, 270px); overflow: hidden; --g: var(--green); background: linear-gradient(180deg, color-mix(in srgb, var(--g) 7%, var(--card)) 0%, color-mix(in srgb, var(--g) 16%, var(--card)) 62%, color-mix(in srgb, var(--g) 30%, var(--card)) 62.4%, color-mix(in srgb, var(--g) 22%, var(--card)) 100%); }
.km-r0 .km-arena { --g: var(--gold); }
.km-r2 .km-arena { --g: var(--teal); }
.km-r3 .km-arena { --g: var(--violet); }
.is-boss .km-arena { background: radial-gradient(120% 90% at 70% 30%, color-mix(in srgb, var(--violet) 26%, var(--card)), color-mix(in srgb, var(--ink) 22%, var(--card))); }
.is-rage .km-arena { box-shadow: inset 0 0 50px color-mix(in srgb, var(--ng) 45%, transparent); }
.km-foe { position: absolute; right: 3%; top: 8px; width: 58%; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.km-foe-info { width: 100%; max-width: 230px; }
.km-foe-info .km-foe-name { font-size: 13px; justify-content: center; text-align: center; margin-bottom: 4px; }
.km-foe-fig { width: min(142px, 36vw); aspect-ratio: 1; color: var(--ink); }
.is-boss .km-foe-fig { width: min(164px, 40vw); }
.km-hero { position: absolute; left: 3%; bottom: 6px; display: flex; align-items: flex-end; gap: 6px; }
.km-hero-fig { width: 74px; height: 90px; color: var(--ink); }
.km-hero-info { width: 112px; padding-bottom: 6px; }
.km-hero-info small { display: block; font: 700 11px var(--en); color: var(--ink2); margin-top: 3px; }
.km-bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 13%, transparent); overflow: hidden; }
.km-bar i { display: block; height: 100%; border-radius: inherit; transition: width .45s ease; }
.km-bar-foe i { background: linear-gradient(90deg, var(--coral), var(--gold)); }
.km-bar-me i { background: linear-gradient(90deg, var(--green), var(--teal)); }
.km-bar-me.is-low i { background: var(--ng); }
.km-combo { position: absolute; left: 4%; top: 10px; font: 900 21px var(--en); color: var(--gold); text-shadow: 0 2px 0 var(--card); opacity: 0; transform: scale(.7); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.km-combo.is-on { opacity: 1; transform: scale(1); }
.km-fx { position: absolute; inset: 0; pointer-events: none; }
.km-num { position: absolute; font: 900 26px var(--en); color: var(--ink); text-shadow: 0 2px 0 var(--card), 0 0 8px var(--card); animation: km-float 1s ease-out forwards; }
.km-num-foe { right: 24%; top: 28%; }
.km-num-hero { left: 12%; bottom: 46%; }
.km-num.is-crit { color: var(--gold); font-size: 34px; }
.km-num.is-dmg { color: var(--ng); }
.km-num.is-heal { color: var(--ok); }
.km-slash { position: absolute; right: 12%; top: 16%; width: 36%; max-width: 160px; aspect-ratio: 1; }
.km-slash svg { width: 100%; height: 100%; overflow: visible; }
.km-slash path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 120; stroke-dashoffset: 120; animation: km-slash .32s ease-out forwards; filter: drop-shadow(0 0 4px var(--gold)); }
.km-slash path.s2 { animation-delay: .06s; opacity: .7; stroke-width: 3; }
.km-slash.is-strong path { stroke: #ffe39a; stroke-width: 7; }
.km-hero-fig.is-atk { animation: km-lunge .42s ease-out; }
.km-hero-fig.is-hurt { animation: km-hurt .45s ease-out; }
.km-foe-fig.is-hit .km-foebody { animation: km-hit .38s ease-out; }
.km-foe-fig.is-atk { animation: km-foelunge .45s ease-in-out; }
.km-foe-fig.is-down { animation: km-down .7s ease-in forwards; }
.km-battle.is-shake .km-arena { animation: km-shake .32s; }
.km-timer { height: 6px; background: var(--bg2); flex: none; }
.km-timer i { display: block; height: 100%; width: 100%; background: var(--teal); }
.km-timer.is-low i { background: var(--ng); }
.km-qcard { flex: 1; min-height: 0; overflow: auto; padding: 14px 14px 18px; }
.km-qcard.is-in { animation: km-in .28s ease-out; }
.km-q { margin: 0 0 12px; font-size: 17px; line-height: 1.75; }
.km-q .en, .km-fb .en, .km-review .en, .km-dexcard .en, .km-dexwhy .en { font-family: var(--en); font-weight: 600; }
.km-tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; background: var(--blue-bg); color: var(--blue); font-size: 12px; font-weight: 800; vertical-align: 2px; }
.km-blank { color: var(--brand); font-weight: 800; }
.km-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.km-opts.is-col { grid-template-columns: 1fr; }
.km-opt { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: 600 17px/1.35 var(--en); text-align: left; cursor: pointer; box-shadow: 0 3px 0 var(--line); transition: transform .1s, border-color .15s, background .15s; }
.km-opt:hover:not(:disabled) { border-color: var(--brand); }
.km-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.km-opt kbd, .km-tile kbd { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: var(--bg2); color: var(--ink2); }
.km-opt.is-ok { border-color: var(--ok); background: var(--ok-bg); }
.km-opt.is-ng { border-color: var(--ng); background: var(--ng-bg); }
.km-opt.is-gone { opacity: .28; text-decoration: line-through; }
.km-opt:disabled { cursor: default; }
.km-line { min-height: 58px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 6px 4px 8px; border-bottom: 2px dashed var(--line2); }
.km-ph { color: var(--ink3); font-size: 13px; align-self: center; font-family: var(--jp); }
.km-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; min-height: 50px; }
.km-tile { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 14px; border: 2px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--ink); font: 600 17px var(--en); cursor: pointer; box-shadow: 0 3px 0 var(--line2); }
.km-tile kbd { width: 18px; height: 18px; font-size: 10px; }
.km-line .km-tile { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 50%, var(--card)); box-shadow: none; }
.km-line.is-ok .km-tile { background: var(--ok-bg); border-color: var(--ok); }
.km-line.is-ng .km-tile { background: var(--ng-bg); border-color: var(--ng); }
.km-fill { display: flex; gap: 8px; }
.km-fill input { flex: 1; min-width: 0; height: 54px; padding: 0 14px; border: 2px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--ink); font: 600 19px var(--en); }
.km-fill input:focus { outline: none; border-color: var(--blue); }
.km-fill.is-ok input { border-color: var(--ok); background: var(--ok-bg); }
.km-fill.is-ng input { border-color: var(--ng); background: var(--ng-bg); }
.km-fill .km-btn { flex: none; }
.km-skills { display: flex; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); overflow-x: auto; flex: none; background: var(--card); }
.km-skills button { position: relative; flex: 1 0 64px; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 8px; border: 0; border-radius: 12px; background: var(--bg2); color: var(--ink); font: 700 11px var(--jp); cursor: pointer; white-space: nowrap; }
.km-skills button .kqi { color: var(--violet); }
.km-skills button em { position: absolute; top: 3px; right: 5px; font: 800 10px var(--en); font-style: normal; color: var(--violet); }
.km-skills button:disabled { opacity: .4; cursor: default; }
.km-skills button.is-armed { box-shadow: inset 0 0 0 2px var(--gold); opacity: 1; }
.km-fb { position: absolute; z-index: 5; }
.km-fb.is-ok { left: 50%; top: 52px; transform: translateX(-50%); padding: 7px 14px; border-radius: 99px; background: var(--card); box-shadow: var(--sh2); animation: km-pop .25s ease-out; white-space: nowrap; }
.km-fb.is-ok .km-fb-h { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--ok); }
.km-fb.is-ok .km-fb-d { color: var(--ink2); font-size: 12px; font-weight: 700; }
.km-fb.is-ng { left: 0; right: 0; bottom: 0; max-height: 72%; overflow: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--card); border-top: 3px solid var(--ng); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(0, 0, 0, .2); animation: km-up .28s cubic-bezier(.2, .8, .3, 1); }
.km-fb.is-ng .km-fb-h { margin: 0 0 8px; display: flex; align-items: center; gap: 6px; color: var(--ng); flex-wrap: wrap; }
.km-fb-h b { font-size: 17px; }
.km-fb.is-ng .km-fb-d { color: var(--ink2); font-size: 12px; font-weight: 700; margin-left: auto; }
.km-fb-ans { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--ok-bg); font-size: 17px; line-height: 1.6; }
.km-fb-ans small { display: block; font-size: 11px; color: var(--ok); font-weight: 800; }
.km-fb-ans span[lang="en"], .km-ans { font-family: var(--en); font-weight: 700; }
.km-ans { color: var(--ok); text-decoration: underline; text-underline-offset: 3px; }
.km-fb-x { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink); }

/* ── 結果 ── */
.km-result { padding: 18px 16px 26px; }
.km-res-hd { text-align: center; margin-bottom: 14px; }
.km-res-hd h3 { margin: 4px 0; font-size: 24px; }
.km-res-hd p { margin: 0; color: var(--ink2); font-size: 14px; }
.is-lose .km-res-hd h3, .is-flee .km-res-hd h3 { color: var(--ink2); }
.km-res-stars { display: flex; justify-content: center; gap: 6px; }
.km-res-stars span .kqi { width: 44px; height: 44px; color: var(--line2); fill: var(--line2); }
.km-res-stars span.on .kqi { color: var(--gold); fill: var(--gold); animation: km-star .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--d); }
.km-res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.km-res-grid div { padding: 10px 12px; border-radius: 12px; background: var(--bg2); }
.km-res-grid small { display: block; font-size: 11px; color: var(--ink2); }
.km-res-grid b { font: 900 20px var(--en); }
.km-res-xp { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.km-res-xp span { font: 900 15px var(--en); }
.km-res-xp .km-xp { flex: 1; max-width: none; height: 8px; margin: 0; }
.km-res-xp small { font-size: 11px; color: var(--ink2); white-space: nowrap; }
.km-lvup { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 16px; margin: 10px 0; border-radius: 14px; background: var(--gold-bg); text-align: center; }
.km-lvup b { font-size: 18px; color: var(--gold); position: relative; }
.km-lvup small { font-size: 12px; color: var(--ink2); position: relative; }
.km-lvup-ring { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 50%; border: 3px solid var(--gold); animation: km-ring 1.2s ease-out .2s both; }
.km-dexnew, .km-dexwhy { margin: 12px 0; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); }
.km-dexcard { display: flex; gap: 12px; align-items: center; }
.km-dexcard.is-big { margin: 12px 0; }
.km-dexfig { width: 76px; height: 76px; flex: none; color: var(--ink); }
.km-dexcard.is-big .km-dexfig { width: 110px; height: 110px; }
.km-dexcard b { font-size: 16px; }
.km-ng, .km-okl { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0; font-size: 15px; line-height: 1.5; }
.km-ng .kqi { color: var(--ng); width: 18px; height: 18px; margin-top: 2px; }
.km-okl .kqi { color: var(--ok); width: 18px; height: 18px; margin-top: 2px; }
.km-ng span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ng) 60%, transparent); }
.km-ng strong, .km-okl strong { color: var(--ng); }
.km-okl strong { color: var(--ok); }
.km-newtitle { display: flex; gap: 8px; align-items: center; margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--violet-bg); font-size: 14px; }
.km-newtitle .kqi { color: var(--violet); }
.km-review { margin: 16px 0; }
.km-review h4, .km-h4 { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-size: 15px; }
.km-review ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.km-review li { padding: 12px; border-radius: 12px; background: var(--bg2); }
.km-rv-q { margin: 0 0 6px; font-size: 15px; line-height: 1.7; }
.km-rv-a { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 4px; font-size: 16px; }
.km-rv-a .kqi { color: var(--ok); margin-top: 3px; }
.km-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--blue); }
.km-res-btns { display: grid; gap: 10px; margin-top: 18px; }

/* ── 技・図鑑・称号・記録・設定 ── */
.km-have { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--violet-bg); font-size: 14px; }
.km-have .kqi { color: var(--violet); }
.km-skilllist, .km-titles, .km-weak, .km-dexgrid { list-style: none; margin: 12px 0 0; padding: 0; }
.km-skilllist li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.km-skilllist li > div { flex: 1; min-width: 0; }
.km-skilllist p { margin: 2px 0 0; font-size: 13px; color: var(--ink2); line-height: 1.6; }
.km-skilllist small { white-space: nowrap; margin-left: 8px; font-size: 11px; color: var(--violet); font-weight: 800; }
.km-sk-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--bg2); color: var(--ink3); }
.is-has .km-sk-ic { background: var(--violet-bg); color: var(--violet); }
.km-skilllist .km-btn-s { white-space: nowrap; }
.km-dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.km-dexgrid li > * { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: 700 11px/1.35 var(--jp); text-align: center; }
.km-dexgrid button { cursor: pointer; }
.km-dexgrid button:hover { border-color: var(--brand); }
.km-dexgrid .is-unknown > * { background: var(--bg2); color: var(--ink3); }
.km-weak li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.km-weak li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.km-weak small { font-size: 12px; color: var(--ink2); }
.km-set { display: grid; gap: 6px; }
.km-set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 4px; }
.km-set-row > span { display: flex; align-items: center; gap: 8px; }
.km-set-vol { display: flex; align-items: center; gap: 12px; padding: 0 0 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink2); }
.km-set-vol input { flex: 1; accent-color: var(--brand); height: 32px; }
.km-sw { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border: 0; background: none; color: var(--ink); font: 700 14px var(--jp); cursor: pointer; }
.km-sw i { position: relative; width: 48px; height: 28px; border-radius: 99px; background: var(--line2); transition: background .2s; }
.km-sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.km-sw[aria-pressed="true"] i { background: var(--ok); }
.km-sw[aria-pressed="true"] i::after { transform: translateX(20px); }
.km-sw-t { min-width: 2.2em; }
.km-daily { text-align: center; }
.km-daily p { text-align: left; font-size: 14px; line-height: 1.75; }
.km-daily-flame { display: inline-flex; align-items: baseline; gap: 4px; margin: 6px 0 4px; color: var(--coral); }
.km-daily-flame .kqi { width: 34px; height: 34px; align-self: center; }
.km-daily-flame b { font: 900 40px var(--en); }
.km-daily .km-btn { width: 100%; margin-top: 10px; }
.km-toast { position: absolute; left: 50%; top: 58px; z-index: 30; max-width: 90%; padding: 8px 16px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; text-align: center; opacity: 0; transform: translate(-50%, -8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.km-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.km-toast.is-boss { background: var(--violet); color: #fff; }

/* ── ページ下の説明 ── */
.km-about { max-width: 760px; margin: 32px auto 0; }
.km-about h3 { font-size: 15px; margin: 16px 0 6px; }
.km-note { font-size: 13px; color: var(--ink2); line-height: 1.8; }
.km-list { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.9; }
.km-list small { color: var(--ink3); }

/* ── 画面の幅 ── */
@media (hover: none) { .km-opt kbd, .km-tile kbd, .km-btn kbd { display: none; } }
@media (max-width: 400px) {
  .km-app { font-size: 14px; }
  .km-q { font-size: 16px; }
  .km-opt { font-size: 16px; min-height: 54px; padding: 8px 10px; }
  .km-pill { padding: 4px 7px; }
  .km-hero-info { width: 96px; }
}
@media (max-height: 720px) { .km-foe-fig { width: min(118px, 32vw); } .is-boss .km-foe-fig { width: min(134px, 36vw); } .km-hero-fig { width: 62px; height: 76px; } .km-qcard { padding-top: 10px; } }
@media (max-width: 560px) {
  .km-page { padding-left: 8px; padding-right: 8px; }
  .km-app { border-radius: 14px; }
}
@media (min-width: 700px) {
  .km-arena { height: clamp(220px, 32svh, 300px); }
  .km-foe-fig { width: 170px; }
  .is-boss .km-foe-fig { width: 196px; }
  .km-hero-fig { width: 90px; height: 110px; }
  .km-sheet, .km-panel { left: 50%; right: auto; width: 560px; margin-left: -280px; }
}


/* ══════════ 絵の版（Codex の絵を使った地図・タイトル・戦い）══════════ */
.km-app { --kq-navy: #141b2e; --kq-navy2: #1f2a47; --kq-gold: #e2a92a; --kq-gold2: #fff1b8; --kq-cream: #fff6dc; border: 0; box-shadow: 0 0 0 1px #0b1020, 0 0 0 3px #a87a1c, 0 0 0 4px #0b1020, 0 18px 40px rgba(10, 14, 30, .35); }
.km-heroimg { display: block; width: 100%; height: 100%; object-fit: contain; }
.km-foesvg { position: relative; display: block; width: 100%; height: 100%; }
.km-foebody { display: block; width: 100%; height: 100%; }
.km-foebody img { display: block; width: 100%; height: 100%; object-fit: contain; filter: hue-rotate(var(--hue, 0deg)) drop-shadow(0 6px 5px rgba(8, 12, 24, .4)); }
.km-foesvg.is-shadow .km-foebody img { filter: brightness(0) opacity(.3); }
.km-foesvg.is-shadow { filter: none; }
.km-aura { position: absolute; inset: -8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 196, 80, .55), rgba(226, 85, 47, .25) 55%, transparent 72%); animation: km-aura 2.4s ease-in-out infinite; }
.km-crown { position: absolute; left: 50%; top: -9%; width: 34%; transform: translateX(-50%); overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.km-crown path { fill: #f7c948; stroke: #7a4a00; stroke-width: 2; stroke-linejoin: round; }
.km-crown circle { fill: #e2552f; stroke: #7a4a00; stroke-width: 1.2; }
.is-shadow .km-crown, .is-shadow .km-aura { display: none; }
.km-sheet-fig .km-foesvg, .km-dexfig .km-foesvg { width: 100%; height: 100%; }
.km-dexgrid .km-foesvg { width: 68px; height: 68px; }
.km-sheet-foe { background: linear-gradient(135deg, #1f2a47, #141b2e); color: #fff6dc; box-shadow: inset 0 0 0 1.5px rgba(226, 169, 42, .55); }
.km-sheet-foe .km-small { color: #c9d0e2; }
.km-sheet-fig { width: 108px; height: 108px; }
.km-sheet-foe .km-foesvg.is-shadow .km-foebody img { filter: brightness(0) invert(1) opacity(.38); }
.km-sheet-foe .km-chip { background: rgba(255, 255, 255, .14); color: #fff6dc; }

/* ── タイトル ── */
.km-title { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #0d1626; color: #fff; isolation: isolate; }
.km-title-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 74% 50%; z-index: -2; animation: kq-ken 26s ease-in-out infinite alternate; }
.km-title-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 14, 28, .62) 0%, rgba(8, 14, 28, .18) 26%, rgba(8, 14, 28, 0) 44%, rgba(8, 14, 28, .78) 76%, rgba(8, 14, 28, .95) 100%); }
.km-title-motes { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.km-title-motes i { position: absolute; left: var(--x); bottom: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 8px 2px rgba(255, 220, 130, .7); opacity: 0; animation: kq-mote var(--t) linear var(--d) infinite; }
.km-title-in { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(22px, 7%, 54px) 20px 22px; }
.km-kicker { margin: 0; }
.km-kicker span { display: inline-block; padding: 4px 16px 4px 20px; border: 1px solid rgba(255, 233, 168, .7); border-radius: 99px; background: rgba(12, 18, 36, .55); color: #ffe9a8; font-size: 12px; font-weight: 800; letter-spacing: .34em; backdrop-filter: blur(3px); }
.km-app .km-title .km-logo { margin: 10px 0 0; font: 900 clamp(44px, 13vw, 76px)/1.15 "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif; letter-spacing: .1em; text-indent: .1em; background: none; color: #fff0bd; -webkit-text-fill-color: #fff0bd; text-shadow: 0 1px 0 #f7cf62, 0 2px 0 #e2a92a, 0 3px 0 #b9770e, 0 4px 0 #7a4a00, 0 5px 0 #4a2a05, 0 0 28px rgba(255, 200, 80, .55), 0 12px 24px rgba(0, 0, 0, .75); animation: kq-logo 1.1s cubic-bezier(.2, .9, .3, 1) both; }
.km-sub { margin: auto 0 16px; color: #f1ead6; font-size: 14px; font-weight: 700; line-height: 1.75; max-width: 26em; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.km-title .km-btn-start { min-width: 256px; min-height: 62px; font-size: 19px; border-radius: 99px; color: #3a2400; background: linear-gradient(180deg, #fff1b8, #f2c14e 45%, #d99a1b); box-shadow: 0 5px 0 #8a5a06, 0 0 0 2px #fff6dc inset, 0 0 26px rgba(255, 205, 90, .55); animation: kq-cta 2.2s ease-in-out infinite; }
.km-title .km-btn-start:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a06, 0 0 0 2px #fff6dc inset; }
.km-hint { margin: 14px 0 0; font-size: 12px; color: #c9d0e2; }
.km-title-gear { position: absolute; right: 8px; top: 8px; background: rgba(12, 18, 36, .55); color: #fff6dc; }

/* ── 上の帯と下のメニュー ── */
.km-hud, .km-bt-top { background: linear-gradient(180deg, var(--kq-navy2), var(--kq-navy)); color: var(--kq-cream); border-bottom: 2px solid #a87a1c; box-shadow: 0 2px 8px rgba(8, 12, 24, .35); position: relative; z-index: 2; }
.km-hud .km-ib, .km-bt-top .km-ib { color: var(--kq-cream); }
.km-hud .km-ib:hover, .km-bt-top .km-ib:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.km-bt-top small { color: #c9d0e2; }
.km-face { width: 46px; height: 46px; background: radial-gradient(circle at 50% 35%, #5b86c9, #22386b); box-shadow: 0 0 0 2px var(--kq-gold), 0 0 0 3px #0b1020; }
.km-face img { position: absolute; width: 170px; height: 170px; max-width: none; left: -62px; top: 0; }
.km-meta b { color: var(--kq-gold2); font-size: 16px; }
.km-meta small { color: #c9d0e2; }
.km-hud .km-xp { background: rgba(255, 255, 255, .16); height: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.km-hud .km-xp i { background: linear-gradient(90deg, #f2c14e, #fff1b8); }
.km-pill { background: rgba(8, 12, 24, .5); color: #fff; box-shadow: inset 0 0 0 1px rgba(226, 169, 42, .6); padding: 6px 11px; }
.km-pill .kqi { color: #ff8a6b; fill: #ff8a6b; }
.km-pill-shard .kqi { color: #c9a7ff; fill: rgba(201, 167, 255, .35); }
.km-sp i { background: rgba(255, 255, 255, .22); }
.km-sp i.on { background: #c9a7ff; box-shadow: 0 0 8px #c9a7ff; }
.km-dock { background: linear-gradient(180deg, var(--kq-navy2), var(--kq-navy)); border-top: 2px solid #a87a1c; position: relative; z-index: 2; }
.km-dock button { color: #c9d0e2; min-height: 62px; }
.km-dock button .kqi { width: 25px; height: 25px; color: var(--kq-gold); }
.km-dock button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.km-dock .is-new { color: #ffb199; }
.km-dock .is-new .kqi { color: #ff8a6b; filter: drop-shadow(0 0 6px rgba(255, 138, 107, .8)); }

/* ── 地図 ── */
.km-mapwrap { background: linear-gradient(rgba(10, 74, 106, .42), rgba(10, 74, 106, .42)), #0d4254 url(art/q-sea.webp) center top / 560px auto; position: relative; }
.kqm { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.kqm image { pointer-events: none; }
.kqsea-tint { fill: #0a4a6a; opacity: .42; }
.kqw { fill: none; stroke: #fff; stroke-opacity: .2; stroke-width: 1.3; stroke-linecap: round; }
.kqwaves { animation: kq-waves 9s linear infinite; }
.kql-foam { fill: none; stroke: #e9fbff; stroke-opacity: .5; stroke-width: 14; stroke-linejoin: round; animation: kq-foam 4.2s ease-in-out infinite; }
.kql-cliff { fill: #5a4630; stroke: #33271a; stroke-width: 3; stroke-linejoin: round; }
.kql-wash { fill: #fff0c8; opacity: .3; }
.kql-wash1 { fill: #f2ffc4; opacity: .26; }
.kql-wash2 { fill: #d9ffe9; opacity: .2; }
.kql-wash3 { fill: #f3ecff; opacity: .3; }
.kql-edge { fill: none; stroke: #f8e7b8; stroke-width: 3.5; stroke-opacity: .9; stroke-linejoin: round; }
.kqp-edge { fill: none; stroke: #4a3520; stroke-opacity: .6; stroke-width: 14; stroke-linecap: round; }
.kqp-all { fill: none; stroke: #ecd8a8; stroke-width: 9; stroke-linecap: round; }
.kqp-done { fill: none; stroke: #e2552f; stroke-width: 4.2; stroke-linecap: round; stroke-dasharray: 1 9.5; }
.kqb-sh { fill: none; stroke: #062431; stroke-opacity: .4; stroke-width: 22; }
.kqb-wood { fill: none; stroke: #6e4520; stroke-width: 20; }
.kqb-plank { fill: none; stroke: #c9955a; stroke-width: 15; stroke-dasharray: 3.2 3.2; }
.kqr-rib { fill: #1c2740; stroke: #e2a92a; stroke-width: 2; }
.kqr-rib2 { fill: #0f1730; stroke: #e2a92a; stroke-width: 1.5; stroke-linejoin: round; }
.kqr-n { font: 900 17px var(--jp); fill: #fff1b8; letter-spacing: .08em; }
.kqr-s { font: 800 12px var(--jp); fill: #fff; paint-order: stroke; stroke: #1c2333; stroke-width: 3.6px; stroke-linejoin: round; letter-spacing: .06em; }
.kqs-sign rect { fill: #6b4423; stroke: #f0d59a; stroke-width: 1.3; }
.kqs-sign text { font: 800 10.5px var(--jp); fill: #fff3d1; }
.kqn { cursor: pointer; outline: none; }
.kqn-in { transition: transform .18s; transform-origin: 0 0; }
.kqn:hover:not(.kqn-lock) .kqn-in, .kqn:focus-visible .kqn-in { transform: scale(1.09); }
.kqn:focus-visible .kqn-ring { stroke: #fff; stroke-width: 3; }
.kqn-sh { fill: #07140e; opacity: .34; }
.kqn-ring { fill: none; stroke: none; }
.kqn-hit { fill: transparent; }
.kqn-rim { fill: url(#kqg-rim); stroke: #5e3b03; stroke-width: 1.3; }
.kqn-base { fill: url(#kqg-open); stroke: #b98a2a; stroke-width: 1; }
.kqn-gloss { fill: #fff; opacity: .6; pointer-events: none; }
.kqn-num { font: 900 17px var(--en); fill: #8a3a12; pointer-events: none; }
.kqn-clear .kqn-base { fill: url(#kqg-clear); stroke: #7a240a; }
.kqn-clear .kqn-num { fill: #fff; }
.kqn-clear .kqn-gloss { opacity: .32; }
.kqn-lock { cursor: not-allowed; }
.kqn-lock .kqn-rim { fill: url(#kqg-stone); stroke: #4d5462; }
.kqn-lock .kqn-base { fill: url(#kqg-lock); stroke: #7c8494; }
.kqn-lock .kqn-gloss { opacity: .25; }
.kqn-lockbody { fill: #5a6170; stroke: #5a6170; stroke-width: 2; stroke-linejoin: round; }
.kqn-lockic { fill: none; stroke: #5a6170; stroke-width: 2.8; }
.kqn-cur .kqn-ring { stroke: #fff1b8; stroke-width: 3.5; transform-box: fill-box; transform-origin: center; animation: km-pulse 1.8s ease-out infinite; }
.kqn-rays { transform-origin: 0 0; animation: km-spin 14s linear infinite; pointer-events: none; }
.kqn-rays path { fill: #fff1b8; opacity: .92; }
.kqn-boss.kqn-lock .kqn-castle { filter: grayscale(1) brightness(.7); }
.kqn-boss .kqn-lockbody { fill: #fff6dc; stroke: #1c2333; stroke-width: 2.4; paint-order: stroke; }
.kqn-boss .kqn-lockic { stroke: #fff6dc; stroke-width: 3.2; }
.kqn-flag circle { fill: #1f9d6b; stroke: #fff; stroke-width: 2; }
.kqn-flag path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.kqn-stars path { fill: #59606e; stroke: #141b2e; stroke-width: 3; paint-order: stroke; stroke-linejoin: round; }
.kqn-stars path.on { fill: #ffd23f; }
.kqn-weak circle { fill: #e2552f; stroke: #fff; stroke-width: 2; }
.kqn-weak text { font: 900 11px var(--en); fill: #fff; }
.kqn-new .kqn-in { animation: kq-unlock .85s .5s both cubic-bezier(.3, 1.5, .5, 1); }
.kqn.is-deny .kqn-in { animation: kq-deny .4s; }
.kqn-hero { pointer-events: none; transition: transform .72s cubic-bezier(.4, 0, .3, 1); }
.kqn-hero-in { animation: km-bob 2.4s ease-in-out infinite; }
.kqn-hero image { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 3px 3px rgba(8, 12, 24, .5)); }
.kqn-hero.is-walk .kqn-hero-in { animation: kq-walk .17s linear infinite; }
.kqn-hero.is-flip image { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
.kq-clouds { pointer-events: none; }
.kq-cloud { animation: kq-cloud 44s linear infinite; }
.kq-ship { animation: km-bob 3.6s ease-in-out infinite; pointer-events: none; }

/* ── 戦いの舞台 ── */
.km-arena { height: clamp(190px, 31svh, 290px); background-color: #1b2540; background-size: cover; background-position: 50% 62%; box-shadow: inset 0 -30px 40px -20px rgba(8, 12, 24, .55), inset 0 0 0 1px rgba(8, 12, 24, .4); }
.is-boss .km-arena, .km-r0 .km-arena, .km-r2 .km-arena, .km-r3 .km-arena { background-color: #1b2540; }
.km-arena-fog { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(8, 12, 24, .5)); pointer-events: none; }
.is-rage .km-arena { box-shadow: inset 0 0 60px rgba(226, 50, 30, .65); }
.is-rage .km-arena-fog { background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(120, 10, 10, .55)); animation: km-glow 1.2s ease-in-out infinite; }
.km-foe { top: 6px; }
.km-foe-info { background: rgba(10, 14, 28, .62); border-radius: 12px; padding: 5px 9px 7px; box-shadow: inset 0 0 0 1px rgba(226, 169, 42, .5); backdrop-filter: blur(2px); }
.km-arena .km-foe-name { color: #fff6dc; }
.km-arena .km-bar { background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); height: 11px; }
.km-foe-fig { width: min(150px, 38vw); animation: kq-foein .55s cubic-bezier(.2, .9, .3, 1) both; }
.is-boss .km-foe-fig { width: min(170px, 42vw); }
.km-foe-fig .km-foesvg { animation: km-bob 2.8s ease-in-out infinite; }
.km-hero { bottom: 4px; }
.km-hero-fig { width: 118px; height: 118px; filter: drop-shadow(0 6px 5px rgba(8, 12, 24, .45)); animation: kq-heroin .5s cubic-bezier(.2, .9, .3, 1) both; }
.km-hero-info { background: rgba(10, 14, 28, .62); border-radius: 12px; padding: 6px 9px; margin-bottom: 6px; box-shadow: inset 0 0 0 1px rgba(226, 169, 42, .5); }
.km-hero-info small { color: #fff6dc; }
.km-combo { color: #ffd23f; font-size: 24px; text-shadow: 0 2px 0 #4a2a05, 0 0 10px rgba(0, 0, 0, .8); -webkit-text-stroke: 1px #4a2a05; paint-order: stroke fill; }
.km-num { color: #fff; font-size: 30px; text-shadow: 0 2px 0 #141b2e, 0 0 10px rgba(0, 0, 0, .9); -webkit-text-stroke: 1.2px #141b2e; paint-order: stroke fill; }
.km-num.is-crit { color: #ffd23f; font-size: 40px; }
.km-num.is-dmg { color: #ff7a66; }
.km-num.is-heal { color: #7dffb2; }
.km-foe-fig.is-hit .km-foebody { animation: km-hit .38s ease-out; }
.km-timer { height: 7px; background: #0b1020; }
.km-timer i { background: linear-gradient(90deg, #17b8a6, #7dffd6); }
.km-toast { background: #141b2e; color: #fff6dc; box-shadow: 0 0 0 1.5px #e2a92a, 0 8px 20px rgba(0, 0, 0, .35); }
.km-toast.is-boss { background: linear-gradient(180deg, #7a240a, #4a1205); color: #fff1b8; font-size: 15px; padding: 10px 20px; }

@media (max-height: 720px) { .km-foe-fig { width: min(124px, 33vw); } .is-boss .km-foe-fig { width: min(140px, 37vw); } .km-hero-fig { width: 84px; height: 84px; } }
@media (min-width: 761px) {
  .kqm { -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
  .km-arena { height: clamp(250px, 36svh, 330px); }
  .km-foe-fig { width: 184px; }
  .is-boss .km-foe-fig { width: 210px; }
  .km-hero-fig { width: 176px; height: 176px; }
  .km-hero { left: 5%; }
  .km-foe { right: 6%; }
  .km-title-bg { object-position: 60% 50%; }
}
@keyframes kq-ken { from { transform: scale(1.04) translateX(-1%); } to { transform: scale(1.14) translateX(1.5%); } }
@keyframes kq-mote { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 80% { opacity: .5; } 100% { transform: translate(24px, -72svh); opacity: 0; } }
@keyframes kq-logo { from { opacity: 0; transform: translateY(14px) scale(.94); letter-spacing: .3em; } }
@keyframes kq-cta { 50% { box-shadow: 0 5px 0 #8a5a06, 0 0 0 2px #fff6dc inset, 0 0 44px rgba(255, 205, 90, .9); } }
@keyframes kq-waves { to { transform: translateX(46px); } }
@keyframes kq-foam { 50% { stroke-width: 24; stroke-opacity: .22; } }
@keyframes kq-unlock { 0% { filter: grayscale(1) brightness(.8); transform: scale(.9); } 45% { filter: brightness(1.5); transform: scale(1.4); } 100% { transform: none; filter: none; } }
@keyframes kq-deny { 20% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
@keyframes kq-walk { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes kq-cloud { from { transform: translateX(-100px); } to { transform: translateX(460px); } }
@keyframes kq-foein { from { transform: translateX(60px) scale(.8); opacity: 0; filter: brightness(3); } }
@keyframes kq-heroin { from { transform: translateX(-50px); opacity: 0; } }


/* ── 動き ── */
@keyframes km-bob { 50% { transform: translateY(-4px); } }
@keyframes km-pulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes km-fade { from { opacity: 0; } }
@keyframes km-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes km-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes km-pop { from { transform: translate(-50%, 6px) scale(.9); opacity: 0; } }
@keyframes km-lunge { 0% { transform: none; } 40% { transform: translate(34px, -16px) rotate(6deg); } 100% { transform: none; } }
@keyframes km-foelunge { 0% { transform: none; } 45% { transform: translate(-30px, 22px) scale(1.05); } 100% { transform: none; } }
@keyframes km-hit { 0% { transform: none; filter: brightness(2.2); } 30% { transform: translateX(8px); } 60% { transform: translateX(-5px); filter: brightness(1.2); } 100% { transform: none; filter: none; } }
@keyframes km-hurt { 0%, 100% { transform: none; filter: none; } 20% { transform: translateX(-6px); filter: drop-shadow(0 0 6px var(--ng)) saturate(2); } 50% { transform: translateX(4px); opacity: .6; } 75% { opacity: 1; } }
@keyframes km-shake { 0%, 100% { transform: none; } 25% { transform: translate(-4px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, 1px); } }
@keyframes km-down { 0% { transform: none; opacity: 1; } 30% { transform: scale(1.06); filter: brightness(2); } 100% { transform: translateY(14px) scale(.6); opacity: 0; filter: blur(2px); } }
@keyframes km-slash { to { stroke-dashoffset: 0; } }
@keyframes km-float { 0% { transform: translateY(6px) scale(.8); opacity: 0; } 18% { transform: translateY(0) scale(1.1); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
@keyframes km-flick { 0%, 100% { transform: scaleY(1) skewX(0); } 50% { transform: scaleY(1.04) skewX(-2deg); } }
@keyframes km-spin { to { transform: rotate(360deg); } }
@keyframes km-flap { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.86); } }
@keyframes km-glow { 50% { opacity: .45; } }
@keyframes km-aura { 50% { transform: scale(1.08); opacity: .28; } }
@keyframes km-star { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
@keyframes km-ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .km-app *, .km-app *::before, .km-app *::after { animation: none !important; transition: none !important; }
  .km-slash { display: none; }
  .km-foe-fig.is-down { opacity: .25; }
}
.km-app.is-rm *, .km-app.is-rm *::before, .km-app.is-rm *::after { animation: none !important; transition: none !important; }
.km-app.is-rm .km-slash { display: none; }

/* ── 結果・シート・パネル（絵の版）── */
.km-result { padding: 0 0 26px; }
.km-result > :not(.km-res-hd) { margin-left: 16px; margin-right: 16px; }
.km-res-hd { position: relative; overflow: hidden; margin: 0 0 14px; padding: 22px 16px 20px; color: #fff6dc; background: radial-gradient(120% 150% at 50% 0%, #34487e, #141b2e 70%); border-bottom: 2px solid #a87a1c; }
.km-res-hd::before { content: ""; position: absolute; left: 50%; top: 40%; width: 760px; height: 760px; margin: -380px; background: repeating-conic-gradient(rgba(255, 220, 130, .13) 0 9deg, transparent 9deg 18deg); animation: km-spin 40s linear infinite; pointer-events: none; }
.km-result.is-lose .km-res-hd, .km-result.is-flee .km-res-hd { background: radial-gradient(120% 150% at 50% 0%, #4a4f5e, #1a1d26 70%); }
.km-result.is-lose .km-res-hd::before, .km-result.is-flee .km-res-hd::before { display: none; }
.km-res-hd > * { position: relative; }
.km-res-hd h3 { font: 900 30px/1.3 "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif; letter-spacing: .08em; color: #fff0bd; text-shadow: 0 2px 0 #7a4a00, 0 0 20px rgba(255, 200, 80, .5); }
.km-res-hd p { color: #dfe4f2; }
.km-res-stars span .kqi { width: 52px; height: 52px; color: #3b4563; fill: #3b4563; }
.km-res-stars span.on .kqi { color: #b9770e; fill: #ffd23f; filter: drop-shadow(0 0 10px rgba(255, 210, 63, .8)); }
.km-res-fig { width: 120px; height: 120px; margin: 0 auto -6px; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .45)); animation: kq-heroin .5s both; }
.km-res-grid div { background: linear-gradient(180deg, #1f2a47, #141b2e); color: #fff6dc; box-shadow: inset 0 0 0 1px rgba(226, 169, 42, .45); }
.km-res-grid small { color: #c9d0e2; }
.km-res-grid b { color: #fff1b8; font-size: 22px; }
.km-sheet, .km-panel { box-shadow: 0 -3px 0 #a87a1c, 0 -12px 34px rgba(0, 0, 0, .4); }
.km-panel-hd { background: linear-gradient(180deg, #1f2a47, #141b2e); color: #fff6dc; border-radius: 20px 20px 0 0; border-bottom: 2px solid #a87a1c; }
.km-panel-hd .km-ib { color: #fff6dc; }
.km-scrim { background: rgba(6, 10, 22, .62); backdrop-filter: blur(2px); }
