/* ko-cards（国語の ことばカード）。えらんだ カード＝オレンジ、正かい＝みどり、まちがい＝赤。はこの 色 b 青・o オレンジ・g みどり・p むらさき・k ピンク。字は 16px 以上 */
.kc { --kc-o: #f59e0b; --kc-od: #b45309; --kc-ok: #10b981; --kc-okd: #047857; --kc-ng: #ef4444; --kc-ngd: #b91c1c; --kc-fs: 1.2rem; --kc-img: 72px;
  font-size: 1.05rem; position: relative; }
.kc.kc-big { --kc-fs: 1.6rem; --kc-img: 88px; }
.kc [hidden] { display: none !important; }
.kc-qbox { background: linear-gradient(180deg, #fff8e6, #fffdf6); border: 2px solid var(--kc-o); border-radius: 16px; padding: 8px 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(245, 158, 11, .12); }
.kc-q { margin: 0; font-weight: 700; font-size: 1.1rem; line-height: 1.7; }
.kc-big .kc-q { font-size: 1.25rem; }
.kc rt { font-size: .5em; font-weight: 500; }

/* カード */
.kc-card { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 56px; min-height: 56px; padding: 8px 14px; box-sizing: border-box; border-radius: 14px; cursor: grab; touch-action: none;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf7 60%, #f8f3e6 100%); border: 2px solid #d9d2bf;
  box-shadow: 0 3px 0 #e3dbc6, 0 5px 12px rgba(80, 60, 20, .12); color: var(--ink, #1f2937);
  font-weight: 700; font-size: var(--kc-fs); line-height: 1.35; text-align: center; user-select: none; -webkit-user-select: none;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .2s; outline: none; }
.kc-card:focus-visible { box-shadow: 0 0 0 4px #bfdbfe, 0 3px 0 #e3dbc6; }
.kc-card:hover { border-color: #c4b893; }
.kc-t { display: block; word-break: keep-all; overflow-wrap: anywhere; }
.kc-img { display: block; width: var(--kc-img); height: var(--kc-img); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px #eee6d2; }
.kc-img img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.kc-hasimg { padding: 6px 6px 4px; }
.kc-hasimg .kc-t { font-size: .85em; }
.kc-spk { width: 44px; height: 44px; }
.kc-sel { border-color: var(--kc-o); background: linear-gradient(180deg, #fffaf0, #ffefc9); transform: translateY(-4px) rotate(-1.5deg);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .3), 0 8px 16px rgba(180, 83, 9, .22); }
.kc-lift { opacity: .35; }
.kc-ghost { position: fixed; z-index: 9999; pointer-events: none; margin: 0; transform: rotate(-3deg) scale(1.06); opacity: .96;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .25); border-color: var(--kc-o); }
.kc-mark { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; pointer-events: none; }
.kc-mark:empty { display: none; }
.kc-mark svg, .kc-mi svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.kc-card.kc-ok { border-color: var(--kc-ok); background: linear-gradient(180deg, #f3fdf8, #dcf7ea); box-shadow: 0 3px 0 #a7e9cc, 0 5px 10px rgba(16, 185, 129, .15); }
.kc-card.kc-ng { border-color: var(--kc-ng); background: linear-gradient(180deg, #fff6f6, #ffe1e1); box-shadow: 0 3px 0 #fbb4b4; animation: kc-shake .35s 2; }
.kc-lock { cursor: default; }
.kc-seed { border-style: dashed; }
.kc-seed::after { content: "みほん"; position: absolute; top: -9px; left: 8px; font-size: .7rem; line-height: 1; padding: 2px 6px; border-radius: 999px; background: #64748b; color: #fff; }

/* カードおき場（木の おぼん） */
.kc-pool { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; min-height: 72px; padding: 14px 10px; margin-bottom: 12px; border-radius: 18px;
  background: linear-gradient(180deg, #f6e7c8 0%, #efd9ad 100%); box-shadow: inset 0 2px 6px rgba(120, 80, 20, .25), 0 1px 0 #fff; border: 1px solid #e0c48e; transition: min-height .3s; }
.kc-pool.kc-empty { min-height: 0; padding: 6px; opacity: .55; }
.kc-done .kc-pool.kc-empty { display: none; }
.kc-pool.kc-src { position: sticky; top: 0; z-index: 3; }
.kc-picking .kc-pool:not(.kc-src) { outline: 2px dashed rgba(180, 83, 9, .35); outline-offset: -6px; }

/* はこ */
.kc-boxes { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kc-boxes.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kc-boxes.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kc-boxes.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kc-boxes.n1 { grid-template-columns: 1fr; }
.kc-box { --c: #2563eb; --cl: #eaf1ff; --cm: #bcd0ff; position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: visible; cursor: pointer;
  background: linear-gradient(180deg, var(--cl) 0%, #fff 100%); border: 2px solid var(--cm); box-shadow: 0 4px 0 var(--cm), 0 6px 14px rgba(0, 0, 0, .06); transition: box-shadow .2s, transform .2s; }
.kc-box.c-o { --c: #d97706; --cl: #fff3dc; --cm: #fbd38d; }
.kc-box.c-g { --c: #059669; --cl: #e3f8ef; --cm: #9fe0c4; }
.kc-box.c-p { --c: #7c3aed; --cl: #f1eafe; --cm: #cdb8fb; }
.kc-box.c-k { --c: #db2777; --cl: #fde9f3; --cm: #f7b6d4; }
.kc-bh { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 6px; border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 80%, #000)); }
.kc-bn { display: inline-block; color: #fff; font-weight: 800; font-size: calc(var(--kc-fs) * .95); line-height: 1.4; letter-spacing: .04em; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); text-align: center; }
/* はこの 見出しの ふりがな：行の 高さを とって、白い 字でも 読める 太さ・大きさに（2026-11-14） */
.kc .kc-bn:not(.kc-unk) { line-height: 1.95; padding-top: 4px; }
.kc .kc-bn rt { font-size: max(.55em, 12px); font-weight: 700; letter-spacing: .02em; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); opacity: 1; line-height: 1.2; padding-bottom: 1px; }
.kc .kc-bn.kc-named rt { color: var(--c); text-shadow: none; }
.kc-bn.kc-unk { width: 2em; height: 2em; line-height: 2em; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 2px dashed rgba(255, 255, 255, .8); }
.kc-bn.kc-named { background: #fff; color: var(--c); border-radius: 999px; padding: 2px 18px; text-shadow: none; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); animation: kc-pop .35s; position: relative; z-index: 2; }
.kc-bwhy { margin: 6px 8px 0; padding: 4px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--cm); font-size: .95rem; font-weight: 700; color: var(--c); line-height: 1.6; animation: kc-pop .35s; }
.kc-bz { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 8px; min-height: 96px; padding: 12px 6px 14px; margin: 8px; border-radius: 12px;
  border: 2px dashed var(--cm); background: rgba(255, 255, 255, .6); position: relative; z-index: 1; }
.kc-picking .kc-box { box-shadow: 0 4px 0 var(--cm), 0 0 0 4px rgba(245, 158, 11, .25); }
.kc-picking .kc-box .kc-bz { border-color: var(--kc-o); background: #fffaf0; }
.kc-box.kc-over, .kc-pool.kc-over { transform: scale(1.02); box-shadow: 0 0 0 5px rgba(245, 158, 11, .55); }
.kc-box.kc-fin .kc-bz { border-style: solid; border-color: transparent; background: rgba(255, 255, 255, .85); }
.kc-tree .kc-bz { padding: 12px 4px 12px 30px; margin-top: 14px; justify-content: flex-start; }
.kc-tree .kc-bwhy { order: 3; margin-bottom: 8px; }
.kc-tn { fill: var(--c); stroke: #fff; stroke-width: 2; }
.kc-ch { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.kc-c { min-height: 46px; padding: 2px 10px; white-space: nowrap; border-radius: 12px; border: 2px solid #fff; background: rgba(255, 255, 255, .95); color: var(--c); font-weight: 800; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.kc-big .kc-c { font-size: 1.15rem; }
.kc-c.kc-x { background: #fee2e2; color: var(--kc-ngd); text-decoration: line-through; opacity: .8; }
.kc-wire { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.kc-tl { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; opacity: .75; }

/* match */
.kc-mw { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 44px; }
.kc-col { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; position: relative; z-index: 2; }
.kc-col .kc-card { display: flex; width: 100%; }
.kc-side-l::before, .kc-side-r::before { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid #94a3b8; }
.kc-side-l::before { right: -11px; } .kc-side-r::before { left: -11px; }
.kc-on::before { background: #2563eb; border-color: #1e40af; }
.kc-ok.kc-on::before { background: var(--kc-ok); border-color: var(--kc-okd); }
.kc-ng.kc-on::before { background: var(--kc-ng); border-color: var(--kc-ngd); }
.kc-sel::before { border-color: var(--kc-o); }
.kc-mw .kc-wire { z-index: 3; }
/* match の 絵カードは 列の はばいっぱいに（スマホでも 小さい 絵を 見分けられるように。2026-11-15） */
.kc-mw .kc-hasimg .kc-img { width: 100%; max-width: 168px; height: auto; aspect-ratio: 1 / 1; }
.kc-ln { fill: none; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.kc-ln.w0 { stroke: #2563eb; } .kc-ln.w1 { stroke: #d97706; } .kc-ln.w2 { stroke: #7c3aed; } .kc-ln.w3 { stroke: #0891b2; } .kc-ln.w4 { stroke: #db2777; }
.kc-ln.live { stroke: var(--kc-o); stroke-dasharray: 8 6; }
.kc-ln.ok { stroke: var(--kc-ok); }
.kc-ln.ng { stroke: var(--kc-ng); stroke-dasharray: 9 6; }
.kc-picking .kc-side-r:not(.kc-sel):not(.kc-lock) { border-color: #fbbf24; }

/* order */
.kc-lane { display: flex; gap: 8px; padding: 12px 8px; border-radius: 18px; background: linear-gradient(180deg, #eef4ff, #f8fbff); border: 2px solid #c7d7f5; position: relative; }
.kc-lane.row { flex-wrap: wrap; justify-content: center; align-items: stretch; }
.kc-lane.col { flex-direction: column; }
.kc-slot { position: relative; display: flex; align-items: center; justify-content: center; min-width: 76px; min-height: 76px; padding: 18px 6px 6px; border-radius: 14px; border: 2px dashed #9db6e6; background: rgba(255, 255, 255, .7); cursor: pointer; box-sizing: border-box; }
.kc-lane.col .kc-slot { justify-content: stretch; padding: 6px 6px 6px 44px; min-height: 64px; }
.kc-lane.col .kc-slot .kc-card { width: 100%; }
.kc-sn { position: absolute; top: 3px; left: 8px; font-size: .85rem; font-weight: 800; color: #3b5ba9; }
.kc-lane.col .kc-sn { top: 50%; left: 8px; transform: translateY(-50%); width: 28px; height: 28px; line-height: 28px; border-radius: 50%; background: #3b5ba9; color: #fff; text-align: center; }
.kc-want .kc-slot { border-color: var(--kc-o); background: #fffaf0; }
.kc-slot.kc-over { box-shadow: 0 0 0 4px rgba(245, 158, 11, .5); }
.kc-lane.kc-fin .kc-slot { border-style: solid; border-color: #a7e9cc; background: #f3fdf8; }
.kc-end { align-self: center; font-weight: 800; color: #3b5ba9; font-size: .95rem; padding: 2px 10px; border-radius: 999px; background: #dbe7ff; }
.kc-lane.row .kc-end.s::after { content: " ▶"; } .kc-lane.row .kc-end.e::before { content: "▶ "; }
.kc-lane.col .kc-end { align-self: flex-start; }
.kc-ks { display: inline-flex; gap: 1px; }
.kc-ks i { font-style: normal; display: inline-block; min-width: 1em; border-radius: 6px; transition: background .2s; }
.kc-ks i.hi { background: #fde68a; color: #9a3412; box-shadow: 0 0 0 2px var(--kc-o); }
.kc-kt { display: block; font-size: .6em; color: var(--sub, #4b5563); }
.kc-cmp { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); font-size: .75rem; font-weight: 800; color: #fff; background: var(--kc-od); border-radius: 999px; padding: 1px 8px; white-space: nowrap; z-index: 2; }
.kc-cmp::before { content: "▲"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); color: var(--kc-od); font-size: .7rem; }

/* fill */
.kc-items { display: flex; flex-direction: column; gap: 12px; }
.kc-item { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: #fff; border: 2px solid var(--line, #e5e7eb); box-shadow: 0 2px 6px rgba(0, 0, 0, .05); }
.kc-item.kc-done1 { border-color: #a7e9cc; background: linear-gradient(90deg, #fff, #f3fdf8); }
.kc-sen { font-size: var(--kc-fs); font-weight: 700; line-height: 2.1; }
.kc-in { display: inline-block; width: 1.6em; height: 1.6em; line-height: 1.6em; margin-right: 6px; border-radius: 50%; background: #3b5ba9; color: #fff; font-size: .6em; text-align: center; vertical-align: .3em; }
.kc-blank { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2em; min-height: 1.8em; margin: 0 4px; padding: 0 6px; vertical-align: middle; border-radius: 10px; line-height: 1.2;
  border: 3px dashed #94a3b8; background: #f8fafc; cursor: pointer; box-sizing: border-box; transition: background .2s, border-color .2s; }
.kc-want .kc-item:not(.kc-done1) .kc-blank { border-color: var(--kc-o); background: #fff7e6; animation: kc-glow 1s ease-in-out infinite alternate; }
.kc-blank.kc-over { box-shadow: 0 0 0 4px rgba(245, 158, 11, .5); }
.kc-blank.kc-full { border-style: solid; animation: kc-pop .3s; }
.kc-blank.kc-ok { border-color: var(--kc-ok); background: #dcf7ea; color: var(--kc-okd); }
.kc-blank.kc-ng { border-color: var(--kc-ng); background: #ffe1e1; color: var(--kc-ngd); }
.kc-pic { position: relative; height: 104px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; overflow: visible; padding: 6px; box-sizing: border-box;
  background: repeating-linear-gradient(45deg, #f8fafc 0 10px, #f1f5f9 10px 20px); border: 2px solid #e2e8f0; text-align: center; }
.kc-pic img { max-width: 100%; max-height: 64px; object-fit: contain; border-radius: 8px; }
.kc-pq { font-size: 2rem; font-weight: 900; color: #cbd5e1; }
.kc-cap { font-size: .9rem; font-weight: 700; line-height: 1.45; }
.kc-pic.kc-ok { background: linear-gradient(180deg, #f0fdf7, #d1fae5); border-color: var(--kc-ok); color: var(--kc-okd); animation: kc-pop .35s; }
.kc-pic.kc-ng { background: linear-gradient(180deg, #fff7ed, #ffe4e6); border-color: var(--kc-ng); color: var(--kc-ngd); animation: kc-wob .5s; }
.kc-pic.kc-ok .kc-pq { color: var(--kc-ok); } .kc-pic.kc-ng .kc-pq { color: var(--kc-ng); }
.kc-copy { cursor: copy; }

/* ひとこと・ボタン */
.kc-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; }
.kc-msg::before { content: ""; position: absolute; top: -9px; left: 26px; border: 9px solid transparent; border-top: 0; border-bottom-color: inherit; }
.kc-msg.ok { background: #ecfdf5; border: 2px solid var(--kc-ok); color: #065f46; border-bottom-color: var(--kc-ok); }
.kc-msg.ng { background: #fff1f2; border: 2px solid var(--kc-ng); color: #9f1239; }
.kc-msg.info { background: #eef4ff; border: 2px solid #93b4f0; color: #1e3a8a; }
.kc-msg.ok::before { border-bottom-color: var(--kc-ok); } .kc-msg.ng::before { border-bottom-color: var(--kc-ng); } .kc-msg.info::before { border-bottom-color: #93b4f0; }
.kc-mi { flex: none; width: 26px; height: 26px; margin-top: 3px; }
.kc-ml { display: block; }
.kc-ml + .kc-ml { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #fda4af; }
.kc-shk { animation: kc-shake .3s 1; }
.kc-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.kc-acts:empty { display: none; }
.kc-go { min-height: 52px; padding: 6px 26px; border: 0; border-radius: 14px; background: var(--teal-d, #0f8a72); color: #fff; font-weight: 700; font-size: 1.1rem; cursor: pointer; box-shadow: 0 3px 0 #0a6553; }
.kc-go:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a6553; }
.kc-b { min-height: 50px; padding: 4px 18px; border: 2px solid var(--ink, #1f2937); background: #fff; border-radius: 14px; font-weight: 700; font-size: 1.05rem; color: var(--ink, #1f2937); cursor: pointer; }
.kc-b.kc-off { border-color: transparent; background: transparent; color: var(--sub, #4b5563); cursor: default; }
.kc-rest { font-size: 1rem; }

@media (max-width: 480px) {
  .kc { --kc-fs: 1.1rem; --kc-img: 64px; }
  .kc.kc-big { --kc-fs: 1.45rem; --kc-img: 76px; }
  .kc-boxes.n3, .kc-boxes.n5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kc-boxes.n3 > :last-child, .kc-boxes.n5 > :last-child { grid-column: 1 / -1; }
  .kc-boxes { gap: 8px; }
  .kc-bz { margin: 6px; padding: 10px 4px 12px; gap: 6px; }
  .kc-card { padding: 6px 10px; }
  .kc-mw { column-gap: 32px; }
  .kc-item { grid-template-columns: minmax(0, 1fr) 92px; padding: 8px; }
  .kc-pic { height: 92px; }
  .kc-cap { font-size: .8rem; }
}
@keyframes kc-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes kc-pop { from { transform: scale(.85); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes kc-wob { 0%, 100% { transform: none; } 30% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } }
@keyframes kc-glow { from { box-shadow: 0 0 0 0 rgba(245, 158, 11, .2); } to { box-shadow: 0 0 0 5px rgba(245, 158, 11, .35); } }
@media (prefers-reduced-motion: reduce) { .kc *, .kc-msg { animation: none !important; transition: none !important; } }
.kc-tree .kc-bz .kc-card { font-size: calc(var(--kc-fs) * .85); padding: 6px 8px; white-space: nowrap; }
