/* ko-kotoba（ことばの いみと つかい方）。字は Klee One（国語ページで よみこむ）→ 教科書体 → 丸ゴシック。
   色：正かい＝みどり・まちがい＝赤・えらんで いる もの＝オレンジ。こ＝青・そ＝オレンジ・あ＝みどり（こそあど）。字は 16px 以上 */
.kt { --kf: "Klee One", "UD Digi Kyokasho NK-R", "UD デジタル 教科書体 NK-R", "UD Digi Kyokasho N-R", "UD デジタル 教科書体 N-R", "YuKyokasho", "游教科書体", "HGKyokashotai", "HG教科書体", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "Zen Maru Gothic", "M PLUS Rounded 1c", "BIZ UDGothic", "Noto Sans JP", sans-serif;
  --o: #f59e0b; --od: #b45309; --ok: #10b981; --okd: #047857; --ng: #ef4444; --ngd: #b91c1c;
  --z0: #2563eb; --z0l: #e8f0ff; --z1: #ea580c; --z1l: #fff1e6; --z2: #059669; --z2l: #e6f7ef;
  --fs: 1.25rem; font-size: 1.05rem; position: relative; color: var(--ink, #1f2937); }
.kt.kt-big { --fs: 1.55rem; }
.kt [hidden] { display: none !important; }
.kt button { font-family: inherit; -webkit-tap-highlight-color: transparent; color: inherit; }
.kt ruby, .kt .kt-q, .kt .kt-chip, .kt .kt-mc, .kt .kt-sent, .kt .kt-kw0, .kt .kt-ch, .kt .kt-mw, .kt .kt-cap, .kt .kt-sc, .kt .kt-mex, .kt .kt-dl, .kt .kt-ask, .kt .kt-kw, .kt .kt-tab { font-family: var(--kf); }
.kt rt { font-size: .5em; font-weight: 500; font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; }
.kt svg { display: block; }

/* 問い・よそう・メッセージ（ko-bun と そろえる） */
.kt-qbox { display: flex; gap: 8px; align-items: flex-start; background: linear-gradient(180deg, #fff8e6, #fffdf6); border: 2px solid var(--o); border-radius: 16px; padding: 8px 8px 8px 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(245, 158, 11, .12); }
.kt-q { flex: 1; margin: 0; font-weight: 600; font-size: 1.12rem; line-height: 1.8; }
.kt-big .kt-q { font-size: 1.25rem; }
.kt-qs { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #bfdbfe; background: #fff; color: #2563eb !important; padding: 7px; cursor: pointer; }
.kt-qs svg { width: 100%; height: 100%; }
.kt-dots { display: flex; justify-content: center; gap: 6px; margin: -2px 0 8px; }
.kt-dots:empty { display: none; }
.kt-dots i { font-style: normal; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; background: #e5e7eb; color: #6b7280; font-size: .78rem; font-weight: 800; text-align: center; transition: all .2s; }
.kt-dots i.on { background: var(--o); color: #fff; transform: scale(1.12); }
.kt-dots i.ok { background: var(--ok); color: #fff; }
.kt-note { color: #6b7280; }
.kt-guess { background: #fff; border: 2px dashed var(--o); border-radius: 16px; padding: 8px 12px 10px; margin-bottom: 12px; }
.kt-gq { margin: 0 0 8px; font-weight: 700; line-height: 1.7; }
.kt-gt { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 999px; background: var(--o); color: #fff; font-size: .85rem; vertical-align: .1em; }
.kt-gb { display: flex; flex-wrap: wrap; gap: 8px; }
.kt-g { min-height: 50px; min-width: 64px; padding: 4px 16px; border: 2px solid #cbd5e1; background: #fff; border-radius: 12px; font-weight: 700; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 0 #cbd5e1; }
.kt-g:disabled { opacity: .5; cursor: default; }
.kt-g.ok { opacity: 1; background: #d1fae5; border-color: var(--ok); }
.kt-g.ng { opacity: 1; background: #fee2e2; border-color: var(--ng); }
.kt-gr { margin: 8px 0 0; font-weight: 700; color: var(--od); line-height: 1.7; }
.kt-gr.fin { color: var(--okd); }
.kt-gok { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--ok); color: #fff; font-size: .85rem; }
.kt-body.kt-wait { opacity: .35; pointer-events: none; filter: grayscale(.4); }
.kt-body.kt-in { animation: kt-in .35s ease-out; }
.kt-msg { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; font-weight: 700; line-height: 1.7; position: relative; }
.kt-msg::before { content: ""; position: absolute; top: -9px; left: 26px; border: 9px solid transparent; border-top: 0; }
.kt-msg.ok { background: #ecfdf5; border: 2px solid var(--ok); color: #065f46; } .kt-msg.ok::before { border-bottom-color: var(--ok); }
.kt-msg.ng { background: #fff1f2; border: 2px solid var(--ng); color: #9f1239; } .kt-msg.ng::before { border-bottom-color: var(--ng); }
.kt-msg.info { background: #eef4ff; border: 2px solid #93b4f0; color: #1e3a8a; } .kt-msg.info::before { border-bottom-color: #93b4f0; }
.kt-mi { flex: none; width: 26px; height: 26px; margin-top: 2px; } .kt-mi svg { width: 100%; height: 100%; }
.kt-msg small { font-weight: 600; opacity: .85; }
.kt-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.kt-acts:empty { display: none; }
.kt-go { display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 6px 24px; border: 0; border-radius: 14px; background: var(--teal-d, #0f8a72); color: #fff !important; font-weight: 700; font-size: 1.1rem; cursor: pointer; box-shadow: 0 3px 0 #0a6553; }
.kt-go svg { width: 22px; height: 22px; }
.kt-go:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a6553; }
.kt-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 4px 16px; border: 2px solid var(--ink, #1f2937); background: #fff; border-radius: 14px; font-weight: 700; font-size: 1.05rem; cursor: pointer; box-shadow: 0 3px 0 #cbd5e1; }
.kt-b:disabled { opacity: .45; cursor: default; }
.kt-b svg { width: 22px; height: 22px; }
.kt-shk { animation: kt-shake .3s 1; }
.kt-pop { animation: kt-pop .3s ease-out; }

/* 絵の わく（img が なければ ことば） */
.kt-pic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 10px 12px; margin-bottom: 10px; border-radius: 16px; text-align: center;
  background: repeating-linear-gradient(45deg, #f8fafc 0 10px, #f1f5f9 10px 20px); border: 2px solid #e2e8f0; }
.kt-pic img { max-height: 150px; max-width: 80%; object-fit: contain; border-radius: 10px; }
.kt-pic.kt-noimg { border: 2px dashed #cbd5e1; background: #fffdf8; }
.kt-pic.kt-empty { min-height: 72px; }
.kt-picon { width: 34px; height: 34px; color: #94a3b8; } .kt-picon svg { width: 100%; height: 100%; }
.kt-cap { font-weight: 700; font-size: 1.08rem; line-height: 1.7; color: #334155; }
.kt-cap.kt-cap0 { color: #94a3b8; font-size: .95rem; }

/* カード・チップ */
.kt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.kt-chip, .kt-mc { position: relative; min-height: 54px; min-width: 64px; padding: 6px 14px; border: 2px solid #d9d2bf; border-radius: 14px; cursor: pointer; font-size: var(--fs); font-weight: 600; line-height: 1.5;
  background: linear-gradient(180deg, #fff, #fffdf7 60%, #f8f3e6); box-shadow: 0 3px 0 #e3dbc6, 0 5px 10px rgba(80, 60, 20, .12); transition: transform .15s, border-color .15s; }
.kt-chip:active, .kt-mc:active { transform: translateY(2px); }
.kt-chip.tried { border-style: dashed; }
.kt-chip.on, .kt-mc.sel { border-color: var(--o); border-style: solid; background: linear-gradient(180deg, #fffaf0, #ffefc9); transform: translateY(-4px); box-shadow: 0 0 0 4px rgba(245, 158, 11, .3); }
.kt-chip.ok, .kt-mc.ok { border-color: var(--ok); border-style: solid; background: linear-gradient(180deg, #f3fdf8, #dcf7ea); box-shadow: 0 3px 0 #a7e9cc; }
.kt-chip.ng, .kt-mc.ng { border-color: var(--ng); border-style: solid; background: linear-gradient(180deg, #fff6f6, #ffe1e1); box-shadow: 0 3px 0 #fbb4b4; }
.kt-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 66px; padding: 12px 10px; margin-top: 12px; border-radius: 18px;
  background: linear-gradient(180deg, #f6e7c8, #efd9ad); box-shadow: inset 0 2px 6px rgba(120, 80, 20, .25); border: 1px solid #e0c48e; }
.kt-pool:empty { display: none; }

/* kosoado */
.kt-ks { position: relative; border-radius: 18px; overflow: hidden; border: 2px solid #dbe4ee; box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
.kt-kss { width: 100%; height: auto; touch-action: none; cursor: pointer; }
.kt-ksbg { fill: #f0f7ff; } .kt-ksgr { fill: #dcefd8; }
.kt-kz { opacity: 0; transition: opacity .4s; }
.kt-shown .kt-kz { opacity: 1; }
.kt-kzc { stroke-width: 2.5; stroke-dasharray: 7 6; }
.kt-kzc.z0 { fill: rgba(37, 99, 235, .1); stroke: var(--z0); } .kt-kzc.z1 { fill: rgba(234, 88, 12, .1); stroke: var(--z1); }
.kt-kzt { font-size: 14px; font-weight: 800; font-family: sans-serif; }
.kt-kzt.z0 { fill: var(--z0); } .kt-kzt.z1 { fill: var(--z1); } .kt-kzt.z2 { fill: var(--z2); }
.kt-ppb { fill: #94a3b8; } .kt-pph { fill: #fde4c8; stroke: #c49a6c; stroke-width: 1.5; } .kt-ppe { fill: #334155; } .kt-ppm { fill: none; stroke: #334155; stroke-width: 2; stroke-linecap: round; }
.kt-pp.a .kt-ppb { fill: #60a5fa; } .kt-pp.b .kt-ppb { fill: #fb923c; }
.kt-ppl { font-size: 13px; font-weight: 800; fill: #475569; font-family: sans-serif; }
.kt-pp.sp .kt-ppl { fill: #0f172a; }
.kt-bub rect { fill: #fff; stroke-width: 3; } .kt-bub text { font-size: 21px; font-weight: 800; font-family: var(--kf); }
.kt-bub.z0 rect, .kt-bub.z0 .kt-bubt { stroke: var(--z0); } .kt-bub.z0 text { fill: var(--z0); }
.kt-bub.z1 rect, .kt-bub.z1 .kt-bubt { stroke: var(--z1); } .kt-bub.z1 text { fill: #c2410c; }
.kt-bub.z2 rect, .kt-bub.z2 .kt-bubt { stroke: var(--z2); } .kt-bub.z2 text { fill: #047857; }
.kt-bubt { fill: #fff; stroke-width: 3; stroke-linejoin: round; }
.kt-ball { transition: transform .25s ease-out; cursor: grab; }
.kt-bl0 { fill: #fbbf24; stroke: #b45309; stroke-width: 2; } .kt-bl1 { fill: none; stroke: #b45309; stroke-width: 1.6; } .kt-bl2 { fill: #fff; opacity: .7; }
.kt-kscap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; background: #fff; border-top: 2px solid #dbe4ee; font-weight: 700; min-height: 48px; }
.kt-kw { font-size: 1.4rem; font-weight: 700; padding: 0 12px; border-radius: 10px; }
.kt-kw.z0 { color: var(--z0); background: var(--z0l); } .kt-kw.z1 { color: #c2410c; background: var(--z1l); } .kt-kw.z2 { color: #047857; background: var(--z2l); }
.kt-kst { display: flex; justify-content: center; margin-top: 10px; }
.kt-kst:empty { display: none; }

/* kiri */
.kt-kc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 10px; border-radius: 18px; background: linear-gradient(180deg, #fff, #fffdf6); border: 2px solid #ece0c2; box-shadow: 0 3px 0 #eadfc3; }
.kt-kw0 { font-size: calc(var(--fs) * 1.9); font-weight: 600; line-height: 1.5; cursor: pointer; letter-spacing: .04em; }
.kt-kw0.fin .kt-stem { color: var(--okd); }
.kt-cutp { color: var(--ngd); text-decoration: line-through; text-decoration-thickness: 3px; opacity: .75; display: inline-block; transform: translateY(6px) rotate(6deg); }
.kt-addp { color: var(--okd); background: #d1fae5; border-radius: 8px; padding: 0 2px; }
.kt-kn { font-weight: 700; color: #6b7280; font-size: .95rem; }
.kt-kbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.kt-back { border-color: var(--o); background: #fffaf0; }
.kt-look { border-color: #2563eb; color: #1e3a8a !important; }
.kt-dict { margin-top: 12px; border-radius: 12px 12px 16px 16px; border: 2px solid #c7b98f; background: #fffef8; box-shadow: 0 4px 0 #e6dcc0; overflow: hidden; }
.kt-dh { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #7c5f2c; color: #fff; font-weight: 700; }
.kt-dh svg { width: 22px; height: 22px; color: #fff; }
.kt-dl { padding: 6px 10px 10px; }
.kt-de { padding: 6px 8px; border-bottom: 1px dashed #e5dcc3; line-height: 1.6; }
.kt-de:last-child { border-bottom: 0; }
.kt-dy { font-size: 1.1rem; margin-right: 4px; }
.kt-di { display: block; font-size: .95rem; color: #475569; }
.kt-de.hit { background: #ecfdf5; border-radius: 10px; border: 2px solid var(--ok); }
.kt-de.miss { background: #fff1f2; border-radius: 10px; border: 2px dashed var(--ng); color: var(--ngd); }
.kt-de.miss .kt-di { color: var(--ngd); font-weight: 700; }

/* meter */
.kt-mt { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; background: #fffdf6; border: 2px solid #f1e6c8; }
.kt-face { flex: none; width: 92px; height: 92px; }
.kt-face * { transition: all .3s; }
.kt-mex { flex: 1; font-weight: 600; line-height: 1.7; font-size: 1.05rem; }
.kt-ruler { margin-top: 12px; }
.kt-rlab { display: flex; justify-content: space-between; font-weight: 800; font-size: .95rem; color: #475569; padding: 0 4px 4px; }
.kt-rlab span:last-child { color: #be123c; }
.kt-rrow { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; padding: 10px 6px 8px; border-radius: 14px;
  background: linear-gradient(90deg, #fef9c3, #fdba74 60%, #fb7185); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1); }
.kt-rrow.n2 { --n: 2; } .kt-rrow.n3 { --n: 3; } .kt-rrow.n4 { --n: 4; } .kt-rrow.n5 { --n: 5; } .kt-rrow.n6 { --n: 6; }
.kt-slot { position: relative; display: flex; align-items: center; justify-content: center; min-height: 92px; padding: 16px 2px 4px; border-radius: 12px; border: 2px dashed rgba(120, 53, 15, .45); background: rgba(255, 255, 255, .55); cursor: pointer; }
.kt-picking .kt-slot { border-color: var(--od); background: rgba(255, 255, 255, .85); animation: kt-glow 1s ease-in-out infinite alternate; }
.kt-sn { position: absolute; top: 2px; left: 6px; font-size: .8rem; font-weight: 800; color: #7c2d12; font-family: sans-serif; }
.kt-slot .kt-mc { min-width: 0; width: 100%; padding: 4px 1px; font-size: calc(var(--fs) * .78); word-break: keep-all; line-height: 1.35; }
.kt-rrow.n4 .kt-slot .kt-mc, .kt-rrow.n5 .kt-slot .kt-mc, .kt-rrow.n6 .kt-slot .kt-mc { font-size: calc(var(--fs) * .66); }
.kt-rrow.n5, .kt-rrow.n6 { gap: 3px; padding: 10px 3px 8px; }
.kt-slot .kt-mc.now { outline: 3px solid #2563eb; outline-offset: 2px; }
.kt-meter .kt-pool { min-height: 72px; }

/* swap */
.kt-ask { font-weight: 700; padding: 6px 12px; margin-bottom: 10px; border-left: 6px solid var(--o); background: #fffbeb; border-radius: 8px; line-height: 1.7; }
.kt-sent { word-break: keep-all; overflow-wrap: anywhere; font-size: calc(var(--fs) * 1.1); font-weight: 600; line-height: 2.2; padding: 10px 14px; border-radius: 16px; background: #fffdf6; border: 2px solid #ece0c2; text-align: center; cursor: pointer; }
.kt-slotw { display: inline-block; min-width: 3.2em; padding: 0 8px; margin: 0 4px; border-radius: 10px; border: 2px dashed var(--o); background: #fff; color: #b7a77f; line-height: 1.7; }
.kt-slotw.in { border-style: solid; color: #9a3412; background: #fff3e0; }

/* pair（シーソー） */
.kt-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px; }
.kt-tab { min-height: 46px; padding: 4px 16px; border-radius: 999px; border: 2px solid #cbd5e1; background: #fff; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.kt-tab.on { border-color: var(--o); background: #fff7e6; box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }
.kt-tab.ok::after { content: "✓"; margin-left: 6px; color: var(--ok); font-weight: 900; }
.kt-ss { position: relative; max-width: 380px; margin: 0 auto; }
.kt-sss { width: 100%; height: auto; }
.kt-sfu { fill: #94a3b8; } .kt-sp { fill: #475569; }
.kt-sb { transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); }
.kt-sbr { fill: #b45309; } .kt-sh { fill: #92400e; }
.kt-sc { position: absolute; top: 4%; min-width: 30%; max-width: 44%; min-height: 50px; padding: 4px 10px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 14px; border: 2px solid #2563eb; background: #eff6ff; font-weight: 700; font-size: var(--fs); line-height: 1.4; transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); cursor: pointer; }
.kt-sc.l { left: 3%; } .kt-sc.r { right: 3%; border-color: #ea580c; background: #fff7ed; }
.kt-sc.e { border-style: dashed; color: #b7a77f; background: #fff; }
.kt-sc.ok { border-color: var(--ok); background: #ecfdf5; color: var(--okd); }
.kt-sc.ng { border-color: var(--ng); background: #fff1f2; color: var(--ngd); }
.kt-sum { color: #475569; font-size: .92em; }

/* cut */
.kt-cw { display: flex; justify-content: center; align-items: stretch; padding: 14px 6px; border-radius: 18px; background: #fffdf6; border: 2px solid #ece0c2; transition: gap .35s; }
.kt-ch { min-width: 58px; min-height: 76px; padding: 0 2px; border: 2px solid #d9d2bf; border-radius: 12px; background: #fff; font-size: calc(var(--fs) * 1.7); font-weight: 600; line-height: 1.4; cursor: pointer; box-shadow: 0 3px 0 #e3dbc6; transition: margin .35s, border-color .3s, background .3s; }
.kt-gap { position: relative; width: 34px; min-height: 76px; padding: 0; border: 0; background: transparent; cursor: pointer; transition: width .35s; }
.kt-gl { position: absolute; top: 4px; bottom: 4px; left: 50%; width: 0; border-left: 3px dotted #cbd5e1; }
.kt-gs { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid #cbd5e1; color: #94a3b8; padding: 2px; }
.kt-gs svg { width: 100%; height: 100%; }
.kt-gap.on .kt-gl { border-left: 3px dashed var(--o); }
.kt-gap.on .kt-gs { border-color: var(--o); color: var(--od); background: #fff7e6; transform: translateX(-50%) rotate(-90deg); }
.kt-cw.split .kt-gap.on { width: 52px; }
.kt-cw.ok .kt-ch { border-color: var(--ok); background: #f0fdf7; }
.kt-cw.ng .kt-gap.on .kt-gl { border-left-color: var(--ng); }
.kt-means { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.kt-mn { flex: 1 1 0; min-width: 90px; max-width: 220px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 14px; text-align: center; animation: kt-pop .3s; }
.kt-mn.ok { background: #ecfdf5; border: 2px solid var(--ok); }
.kt-mn.ng { background: #fff1f2; border: 2px dashed var(--ng); }
.kt-mw { font-size: calc(var(--fs) * 1.05); }
.kt-mi2 { font-weight: 600; font-size: .95rem; line-height: 1.5; color: #334155; }
.kt-mn.ng .kt-mi2 { color: var(--ngd); font-size: 1.3rem; font-weight: 900; }
.kt-type { display: inline-block; padding: 0 10px; border-radius: 999px; background: #0f8a72; color: #fff; font-size: .9rem; }

@keyframes kt-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes kt-pop { from { transform: scale(.9); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes kt-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes kt-glow { from { box-shadow: 0 0 0 0 rgba(245, 158, 11, .2); } to { box-shadow: 0 0 0 4px rgba(245, 158, 11, .4); } }
@media (max-width: 380px) { .kt-ch { min-width: 50px; } .kt-gap { width: 26px; } .kt-cw.split .kt-gap.on { width: 40px; } }
@media (prefers-reduced-motion: reduce) { .kt *, .kt-msg { animation: none !important; transition: none !important; } }
