/* 漢字クラフト：和紙と墨 */
:root {
  --accent: #b0302b; --accent-ink: #ffffff; --accent-soft: #f6e1dc;
  --paper: #f7f0e1; --paper-2: #efe4cc; --ink: #1d1a16; --ink-soft: rgba(29, 26, 22, .78);
  --kc-tile: #fffaf0; --kc-part: #efe4cc; --kc-radical: #e6eef2;
  --serif: "Hiragino Mincho ProN", "Noto Serif CJK JP", "Noto Serif JP", "Yu Mincho", "YuMincho", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #ef7d6f; --accent-ink: #1a1210; --accent-soft: #3a211d;
    --paper: #1e1b17; --paper-2: #2a251f; --ink: #f1e8d6; --ink-soft: rgba(241, 232, 214, .8);
    --kc-tile: #26221c; --kc-part: #332c22; --kc-radical: #222b31;
  }
}
:root[data-theme="dark"] {
  --accent: #ef7d6f; --accent-ink: #1a1210; --accent-soft: #3a211d;
  --paper: #1e1b17; --paper-2: #2a251f; --ink: #f1e8d6; --ink-soft: rgba(241, 232, 214, .8);
  --kc-tile: #26221c; --kc-part: #332c22; --kc-radical: #222b31;
}
.mn-title { font-family: var(--serif); letter-spacing: .06em; }

/* ヒーロー */
.kc-hero { position: relative; background: radial-gradient(circle at 30% 20%, var(--paper), var(--paper-2)); border: 1px solid var(--line); border-radius: var(--radius); height: 190px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.kc-hero-enso { position: absolute; width: 180px; height: 180px; right: 6%; top: 5px; opacity: .9; }
.kc-hero-eq { position: relative; font-family: var(--serif); font-size: 46px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.kc-hero-eq i { font-style: normal; font-size: 28px; color: var(--text-sub); }
.kc-hero-eq b { color: var(--accent); font-size: 64px; margin-left: 4px; }
.kc-enso-ring { stroke: var(--ink); opacity: .85; stroke-dasharray: 640; stroke-dashoffset: 0; animation: kc-draw 1.6s ease-out both; }
.kc-enso-ring.thin { opacity: .6; }
.kc-enso-dot { fill: var(--ink); opacity: .6; }
@keyframes kc-draw { from { stroke-dashoffset: 640; } to { stroke-dashoffset: 0; } }

/* 合体台 */
.kc-bench { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 8px; }
.kc-eq { display: flex; align-items: center; justify-content: center; gap: 6px; }
.kc-eq > i { font-style: normal; color: var(--text-sub); font-size: 22px; font-weight: 700; }
.kc-slot { width: 64px; height: 64px; border-radius: 12px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 38px; color: var(--text-sub); background: var(--kc-tile); cursor: pointer; }
.kc-slot.is-on { border-style: solid; border-color: var(--ink-soft); color: var(--ink); }
.kc-out { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.kc-out .kc-enso { position: absolute; inset: 0; width: 100%; height: 100%; }
.kc-out .kc-enso-ring { animation: none; opacity: .35; }
.kc-out-ch { position: relative; font-family: var(--serif); font-weight: 800; font-size: 50px; color: var(--ink); }
.kc-out.is-hit .kc-enso-ring { opacity: .9; animation: kc-draw .7s ease-out both; }
.kc-out.is-hit .kc-out-ch { color: var(--accent); animation: kc-ink .6s ease-out both; }
.kc-out.is-miss .kc-out-ch { color: var(--text-sub); font-size: 34px; }
@keyframes kc-ink { 0% { transform: scale(.4); filter: blur(6px); opacity: 0; } 60% { transform: scale(1.12); filter: blur(0); opacity: 1; } 100% { transform: none; } }
.kc-msg { text-align: center; font-size: 14px; color: var(--text-sub); margin: 8px 0 0; min-height: 1.6em; }

/* 発見表示 */
.kc-detail:empty { display: none; }
.kc-found { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.kc-found.is-new { border-color: var(--accent); background: var(--accent-soft); }
.kc-found-ch { font-family: var(--serif); font-size: 46px; font-weight: 800; line-height: 1; width: 60px; text-align: center; color: var(--ink); flex: none; }
.kc-found-recipe { font-weight: 800; margin: 0; font-size: 15px; }
.kc-found-yomi { margin: 0; font-size: 14px; color: var(--text); }

/* トレイ */
.kc-tray { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 10px; background: var(--surface); }
.kc-tray-h { font-size: 13px; font-weight: 700; color: var(--text-sub); margin: 8px 0 6px; }
.kc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.kc-grid-center { grid-template-columns: repeat(auto-fill, 52px); justify-content: center; }
.kc-tile { height: 50px; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--kc-tile); color: var(--ink); font-family: var(--serif); font-size: 28px; font-weight: 700; cursor: pointer; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .08s; }
.kc-tile:active { transform: scale(.94); }
.kc-tile.is-part { background: var(--kc-part); }
.kc-tile.is-radical { background: var(--kc-radical); }
.kc-tile.is-sel { outline: 3px solid var(--accent); outline-offset: -1px; }
.kc-tile.is-new { box-shadow: 0 0 0 2px var(--accent) inset; }
.kc-ghost { position: fixed; z-index: 999; pointer-events: none; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 10px; background: var(--kc-tile); border: 2px solid var(--accent); font-family: var(--serif); font-size: 30px; display: flex; align-items: center; justify-content: center; color: var(--ink); box-shadow: var(--shadow); }

/* お題・結果 */
.kc-target { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.kc-target-ch { position: relative; width: 88px; height: 88px; flex: none; display: flex; align-items: center; justify-content: center; }
.kc-target-ch .kc-enso { position: absolute; inset: 0; width: 100%; height: 100%; }
.kc-target-ch span { position: relative; font-family: var(--serif); font-size: 50px; font-weight: 800; color: var(--accent); }
.kc-target-ch.big { width: 120px; height: 120px; }
.kc-target-ch.big span { font-size: 70px; }
.kc-result-hero { display: flex; gap: 16px; align-items: center; }
.mn-big small { font-size: 24px; margin-left: 4px; color: var(--text); }
.kc-squares { font-size: 22px; letter-spacing: 2px; margin: 0; word-break: break-all; }
.kc-line { font-size: 18px; font-weight: 800; }
.kc-titles { list-style: none; padding: 0; margin: 6px 0 0; }
.kc-titles li { margin: 0; color: var(--text-sub); }
.kc-titles li.is-got { color: var(--text); font-weight: 700; }
.kc-daily-card .mn-daily b { display: block; }

/* 図鑑 */
.kc-zukan { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.kc-zk { height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-sub); font-family: var(--serif); font-size: 20px; padding: 0; cursor: default; }
.kc-zk.is-got { background: var(--kc-tile); color: var(--ink); font-weight: 700; cursor: pointer; }

@media (max-width: 380px) {
  .kc-slot { width: 54px; height: 54px; font-size: 32px; }
  .kc-out { width: 78px; height: 78px; }
  .kc-hero-eq { font-size: 38px; }
  .kc-hero-eq b { font-size: 54px; }
}
