/* ko-keigo（けいご）。字は Klee One（国語ページで よみこむ）→ 教科書体 → 丸ゴシック。
   色：尊敬語＝青（あいての 台が 上がる）・謙譲語＝むらさき（じぶんがわの 台が 下がる）・丁寧語＝みどり・けいごの 部分＝オレンジの マーカー・正かい＝みどり・まちがい＝赤。字は 16px 以上 */
.kgo { --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; --s: #2563eb; --sl: #e8f0ff; --m: #7c3aed; --ml: #f3edff;
  font-size: 1.05rem; position: relative; color: var(--ink, #1f2937); }
.kgo [hidden] { display: none !important; }
.kgo button { font-family: inherit; -webkit-tap-highlight-color: transparent; color: inherit; }
.kgo ruby, .kgo .kgo-q, .kgo .kgo-st, .kgo .kgo-pn, .kgo .kgo-hint, .kgo .kgo-say, .kgo .kgo-tab, .kgo .kgo-cap, .kgo .kgo-ch, .kgo .kgo-chq, .kgo .kgo-paper, .kgo .kgo-gq, .kgo .kgo-g, .kgo .kgo-tbl { font-family: var(--kf); }
.kgo rt { font-size: .5em; font-weight: 500; font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; }
.kgo svg { display: block; }

/* 問い */
.kgo-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); }
.kgo-q { flex: 1; margin: 0; font-weight: 600; font-size: 1.12rem; line-height: 1.8; }
.kgo-qs, .kgo-ts { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #bfdbfe; background: #fff; color: var(--s) !important; padding: 7px; cursor: pointer; }
.kgo-qs svg, .kgo-ts svg { width: 100%; height: 100%; }
.kgo-dots { display: flex; justify-content: center; gap: 6px; margin: -2px 0 8px; }
.kgo-dots:empty { display: none; }
.kgo-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; }
.kgo-dots i.on { background: var(--o); color: #fff; transform: scale(1.12); }
.kgo-dots i.ok { background: var(--ok); color: #fff; }
.kgo-note { color: #6b7280; }

/* よそう */
.kgo-guess { background: #fff; border: 2px dashed var(--o); border-radius: 16px; padding: 8px 12px 10px; margin-bottom: 12px; }
.kgo-gq { margin: 0 0 8px; font-weight: 700; line-height: 1.8; }
.kgo-gt { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 999px; background: var(--o); color: #fff; font-size: .85rem; vertical-align: .1em; font-family: sans-serif; }
.kgo-gb { display: flex; flex-wrap: wrap; gap: 8px; }
.kgo-g { min-height: 50px; min-width: 64px; padding: 4px 14px; border: 2px solid #cbd5e1; background: #fff; border-radius: 12px; font-weight: 700; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 0 #cbd5e1; }
.kgo-g:disabled { opacity: .5; cursor: default; }
.kgo-g.pick { opacity: 1; border-color: var(--o); background: #fff7e6; }
.kgo-g.ok { opacity: 1; background: #d1fae5; border-color: var(--ok); box-shadow: 0 2px 0 #6ee7b7; }
.kgo-g.ng { opacity: 1; background: #fee2e2; border-color: var(--ng); }
.kgo-gr { margin: 8px 0 0; font-weight: 700; color: var(--od); line-height: 1.8; }
.kgo-gr.fin { color: var(--okd); }
.kgo-gok { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--ok); color: #fff; font-size: .85rem; font-family: sans-serif; }
.kgo-body.kgo-wait { opacity: .35; pointer-events: none; filter: grayscale(.4); }
.kgo-body.kgo-in { animation: kgo-in .35s ease-out; }

/* level：文と 台 */
.kgo-sent { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid #e5e7eb; border-radius: 14px; padding: 8px 8px 8px 14px; margin-bottom: 10px; }
.kgo-st { flex: 1; font-size: 1.25rem; font-weight: 600; line-height: 2; }
mark.kgo-k { background: linear-gradient(transparent 45%, #fde68a 45%); color: inherit; padding: 0 2px; border-radius: 3px; }
.kgo-stage { position: relative; padding: 52px 6px 0; border-radius: 18px; background: linear-gradient(180deg, #f8fbff 0%, #fff 60%, #f3efe4 100%); border: 2px solid #ece6d6; overflow: hidden; }
.kgo-row { display: flex; justify-content: space-around; align-items: flex-end; gap: 4px; position: relative; z-index: 2; }
.kgo-pp { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; max-width: 120px; padding: 0; border: 0; background: none; cursor: pointer; }
.kgo-fig { width: 72px; height: 108px; display: block; transition: transform .2s; }
.kgo-fig img, .kgo-fig svg { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.kgo-pn { display: block; font-weight: 700; font-size: 1.02rem; line-height: 1.5; text-align: center; margin-top: 2px; }
.kgo-pn small { display: block; font-size: .72rem; color: #64748b; font-family: sans-serif; }
.kgo-dai { display: block; width: 92%; height: 34px; margin-top: 4px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #d6c7a6, #bba57a); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45); transition: height .7s cubic-bezier(.3, .7, .3, 1.2), background .4s; }
.kgo-aite .kgo-dai { background: linear-gradient(180deg, #c7d7f5, #9fb6e4); }
.kgo-pp:hover .kgo-fig, .kgo-pp:focus-visible .kgo-fig { transform: translateY(-3px); }
.kgo-pp.ng .kgo-fig { filter: drop-shadow(0 0 6px rgba(239, 68, 68, .8)); }
.kgo-pp.kgo-who .kgo-pn { color: var(--od); }
.kgo-pp.kgo-up .kgo-dai { height: 96px; background: linear-gradient(180deg, #93b4f0, var(--s)); }
.kgo-pp.kgo-down .kgo-dai { height: 6px; background: linear-gradient(180deg, #c4b5fd, var(--m)); }
.kgo-pp.kgo-up::before, .kgo-pp.kgo-down::before { content: ""; }
.kgo-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 3; }
.kgo-ap { fill: none; stroke-width: 4; stroke-linecap: round; }
.kgo-anim .kgo-ap { stroke-dasharray: 500; stroke-dashoffset: 500; animation: kgo-draw .6s ease-out forwards; }
.kgo-arr.son .kgo-ap { stroke: var(--s); } .kgo-arr.son .kgo-ah { fill: var(--s); }
.kgo-arr.ken .kgo-ap { stroke: var(--m); } .kgo-arr.ken .kgo-ah { fill: var(--m); }
.kgo-arr.tei .kgo-ap { stroke: var(--ok); } .kgo-arr.tei .kgo-ah { fill: var(--ok); }
.kgo-at { font-size: 14px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 5px; font-family: sans-serif; }
.kgo-arr.son .kgo-at { fill: #1e3a8a; } .kgo-arr.ken .kgo-at { fill: #5b21b6; } .kgo-arr.tei .kgo-at { fill: var(--okd); }
.kgo-hint { margin: 10px 0 0; font-weight: 700; color: #475569; line-height: 1.8; text-align: center; }
.kgo-hint:empty { display: none; }

/* scene */
.kgo-say { background: #fff; border: 2px solid #e5e7eb; border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; font-weight: 700; font-size: 1.1rem; line-height: 2; }
.kgo-sl { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 999px; background: #334155; color: #fff; font-size: .8rem; line-height: 1.8; vertical-align: .15em; font-family: sans-serif; }
.kgo-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.kgo-tab { flex: 1; min-height: 48px; padding: 2px 4px; border: 2px solid #e2e8f0; border-radius: 12px; background: #f8fafc; font-weight: 700; font-size: .95rem; line-height: 1.6; }
.kgo-tab:disabled { cursor: default; opacity: .6; }
.kgo-tab.on { opacity: 1; border-color: var(--o); background: #fff7e6; }
.kgo-tab.ok { opacity: 1; border-color: var(--ok); background: #ecfdf5; }
.kgo-tab.ok::after { content: " ✓"; color: var(--okd); }
.kgo-frame { border: 3px solid #e7dcc3; border-radius: 16px; background: #fffdf7; overflow: hidden; margin-bottom: 10px; }
.kgo-frame img { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #fff; }
.kgo-frame.kgo-noimg { min-height: 96px; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, #fffdf7 0 12px, #faf5e8 12px 24px); }
.kgo-cap { margin: 0; padding: 8px 12px; font-weight: 700; line-height: 1.9; text-align: center; }
.kgo-chs { display: flex; flex-direction: column; gap: 8px; }
.kgo-chs:empty { display: none; }
.kgo-chq { font-weight: 700; color: #475569; line-height: 1.8; }
.kgo-ch { min-height: 52px; padding: 6px 14px; border: 2px solid #d9d2bf; border-radius: 14px; background: linear-gradient(180deg, #fff, #fffdf7 60%, #f8f3e6); box-shadow: 0 3px 0 #e3dbc6; font-weight: 600; font-size: 1.1rem; line-height: 1.8; text-align: left; cursor: pointer; }
.kgo-ch:disabled { cursor: default; }
.kgo-ch.ok { border-color: var(--ok); background: #dcf7ea; box-shadow: 0 3px 0 #a7e9cc; }
.kgo-ch.ng { border-color: var(--ng); background: #ffe1e1; opacity: .7; }
.kgo-ch.so { border-color: #93b4f0; background: #eef4ff; }
.kgo-tbl { background: #fff; border: 2px solid var(--ok); border-radius: 14px; padding: 8px 12px; }
.kgo-tt { margin: 0 0 6px; font-weight: 800; color: var(--okd); }
.kgo-tr { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px dashed #d1d5db; line-height: 1.9; }
.kgo-td1 { flex: none; width: 7.5em; font-weight: 700; color: #475569; font-size: .95rem; }
.kgo-td2 { flex: 1; font-weight: 600; font-size: 1.08rem; }

/* fix */
.kgo-paper { background: repeating-linear-gradient(#fff 0 47px, #e9e4d6 47px 48px); border: 2px solid #ece6d6; border-radius: 14px; padding: 12px 8px; font-size: 1.15rem; line-height: 2.4; }
.kgo-w { display: inline; padding: 2px 3px; border: 0; border-bottom: 3px solid transparent; background: none; font-size: inherit; font-weight: 600; line-height: inherit; cursor: pointer; border-radius: 6px; }
.kgo-w:hover { background: #fff7e6; }
.kgo-w.ng { background: #ffe1e1; border-bottom-color: var(--ng); }
.kgo-w.sel { background: #ffefc9; border-bottom-color: var(--o); }
.kgo-w.kgo-look { outline: 3px dashed var(--o); outline-offset: 2px; }
.kgo-w.ok { background: #dcf7ea; cursor: default; }
.kgo-pu { display: inline; font-weight: 600; }
.kgo-old { color: var(--ngd); text-decoration-thickness: 2px; font-size: .75em; margin-right: 4px; }
.kgo-new { color: var(--okd); font-weight: 800; }
.kgo-rd { margin: 10px 0; }
.kgo-rd svg { width: 22px; height: 22px; }

/* ひとこと・ボタン */
.kgo-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.8; position: relative; }
.kgo-msg.ok { background: #ecfdf5; border: 2px solid var(--ok); color: #065f46; }
.kgo-msg.ng { background: #fff1f2; border: 2px solid var(--ng); color: #9f1239; }
.kgo-msg.info { background: #eef4ff; border: 2px solid #93b4f0; color: #1e3a8a; }
.kgo-mi { flex: none; width: 26px; height: 26px; margin-top: 3px; }
.kgo-mi svg { width: 100%; height: 100%; }
.kgo-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.kgo-acts:empty { display: none; }
.kgo-go { 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; }
.kgo-b { display: inline-flex; align-items: 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; }
.kgo-shk { animation: kgo-shake .3s 1; }
.kgo button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
@keyframes kgo-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes kgo-draw { to { stroke-dashoffset: 0; } }
@keyframes kgo-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kgo *, .kgo-msg { animation: none !important; transition: none !important; } .kgo-ap { stroke-dashoffset: 0 !important; } }
