/* 無限錬成図鑑の見た目。遊ぶ画面（body.play）、図鑑（body.zk）、共通部品が作る法務ページ（body のみ）で使う
 *
 * 方向：古い博物図鑑の札。胡粉の紙に藍墨の活字、罫線で区切り、角は丸めない（REN-004、REN-005）
 * ・言葉の1項目は「札」：縦書きの大きな語、小さな題と番号、言葉から決まる紋（網点）、短い説明と成分の印
 * ・図鑑の一覧は、左に1件の札、右に全件の格子。格子のマスは紋で埋める（画像を使わない）
 * ・世代が深い言葉ほど、札の縁に雷文と成分の文様を重ねる。文様はマスクで描くので、色は画面の色に合わせて変わる
 * 色：成分の4色は、水＝藍、火＝朱、土＝黄土、風＝若竹。初発見は金（印の色）。紋の網点は藍
 * 書体：題字と固定の文字は Zen Antique、札の縦書きの語は Yuji Syuku（どちらも Google Fonts）。
 *       言葉の名前は明朝、本文はゴシック。Web フォントが読めなくても、端末の明朝とゴシックで崩れない */

:root {
  --paper: #eef1ec;
  --sheet: #f8f9f5;
  --ink: #1b2848;
  --ink-2: #4a5571;
  --rule: #b9c2c9;
  --rule-2: #d9dfdd;
  --ai: #2c4f9e;
  --water: #2a68ae;
  --fire: #c8432a;
  --earth: #8f6a14;
  --wind: #2f8456;
  --gold: #9a6f05;
  --gold-soft: #f0dfa6;
  --focus: #2a68ae;
  --edge: #1b2848;
  --press: #1b2848;
  --mast-h: 74px;
  --shadow: rgb(27 40 72 / .28);
  --scrim: rgb(16 26 46 / .55);
  --display: "Zen Antique", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --brush: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --ease-out: cubic-bezier(.2, .7, .3, 1);
  /* 縁の文様（マスク。黒の部分が描かれる） */
  --tile-rai: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 12V1.5h9v7h-6v-3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  --tile-0: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8'%3E%3Cpath d='M0 8a8 8 0 0 1 16 0M3 8a5 5 0 0 1 10 0M6 8a2 2 0 0 1 4 0' fill='none' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E");
  --tile-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M0 12C3 9 1 5 3 1c1 4 3 5 3 11zM6 12c3-3 1-7 3-11c1 4 3 5 3 11z' fill='black'/%3E%3C/svg%3E");
  --tile-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M0 7l3-5 3 5 3-5 3 5' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
  --tile-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M1 9a3 3 0 0 1 3-3a4 4 0 0 1 8 0a3 3 0 0 1 3 3M6 6.5a2 2 0 0 1 4 0' fill='none' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E");
  color-scheme: light;
}


* { box-sizing: border-box; }
/* 成分の線。--c0〜--c3（水、火、土、風の百分率）を持つ要素ごとに組み立てる */
.piece, .tcard, .slot, .comp, .ghost, .fuda, .wl {
  --comp: linear-gradient(90deg,
    var(--water) 0 calc(var(--c0, 25) * 1%),
    var(--fire) 0 calc((var(--c0, 25) + var(--c1, 25)) * 1%),
    var(--earth) 0 calc((var(--c0, 25) + var(--c1, 25) + var(--c2, 25)) * 1%),
    var(--wind) 0 100%);
}
[data-el] { --el: var(--ink); }
[data-el="0"] { --el: var(--water); } [data-el="1"] { --el: var(--fire); } [data-el="2"] { --el: var(--earth); } [data-el="3"] { --el: var(--wind); }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select { font: inherit; color: inherit; }

/* ---- 共通部品が作るページ（プライバシーポリシー、運営者情報）と、文章の基本 ---- */
main { max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.35; letter-spacing: .04em; overflow-wrap: anywhere; }
h1 { font-size: 2rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.3rem; margin: 2.5rem 0 .75rem; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: var(--sheet); }
th, td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; }
th { width: 32%; font-weight: 600; color: var(--ink-2); }
ul, ol { padding-left: 1.4em; }
footer { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .9rem; }
footer a { margin-right: .25em; }

/* ---- 部品：紋、成分の印、縁の文様 ---- */
.mon { display: block; fill: currentColor; }
.mon-fine { opacity: .5; }
.seal { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.22em; flex: none; }
.seal rect, .seal circle { fill: var(--el); }
.seal-cut { fill: none; stroke: var(--sheet); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.band {
  position: absolute; inset: var(--bi, 0); padding: var(--bw, 10px); pointer-events: none;
  background: var(--band-c, var(--ink));
  -webkit-mask: var(--tile) 0 0 / var(--ts, 10px 10px) round, linear-gradient(#000 0 0) content-box;
  -webkit-mask-composite: source-out;
  mask: var(--tile) 0 0 / var(--ts, 10px 10px) round, linear-gradient(#000 0 0) content-box;
  mask-composite: subtract;
}
.band.rai { --tile: var(--tile-rai); }
.band.pat { --band-c: var(--el); --bi: 14px; --ts: 14px 8px; }
.band.pat[data-el="0"] { --tile: var(--tile-0); --ts: 16px 8px; }
.band.pat[data-el="1"] { --tile: var(--tile-1); --ts: 10px 10px; }
.band.pat[data-el="2"] { --tile: var(--tile-2); --ts: 12px 8px; }
.band.pat[data-el="3"] { --tile: var(--tile-3); --ts: 16px 10px; }

/* ---- 札（言葉の1項目） ---- */
.fuda { position: relative; container-type: inline-size; border: 1px solid var(--ink); background: var(--sheet); }
.fuda[data-r="2"] { padding: 14px; }
.fuda[data-r="3"] { padding: 28px; }
.fuda.mine { --band-c: var(--gold); border-color: var(--gold); }
.fuda-in {
  position: relative; display: grid; margin: 6px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "title mon word" "recipe recipe recipe" "comp comp comp";
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0 5cqi; padding: 6cqi 6cqi 4cqi; border: 1px solid var(--rule);
}
.fuda[data-r="1"] .fuda-in, .fuda[data-r="2"] .fuda-in, .fuda[data-r="3"] .fuda-in { border: 3px double var(--ink); }
.fuda[data-r="2"] .fuda-in, .fuda[data-r="3"] .fuda-in { margin: 0; }
.fuda.mine .fuda-in { border-color: var(--gold); }
.fuda-title {
  grid-area: title; align-self: start; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--display); color: var(--ink-2); line-height: 1.1;
}
.fuda-book { writing-mode: vertical-rl; font-size: max(.8rem, 3.6cqi); letter-spacing: .3em; }
.fuda-no { font-size: max(.75rem, 3.2cqi); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fuda-mon { grid-area: mon; align-self: center; justify-self: center; width: 100%; max-width: 58cqi; color: var(--ai); }
.fuda-mon .mon { width: 100%; height: auto; }
.fuda-word {
  grid-area: word; margin: 0; writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--brush); font-weight: 400; letter-spacing: .08em; line-height: 1;
  font-size: clamp(1.6rem, min(15cqi, calc(78cqi / var(--len, 3))), 5.5rem);
  max-height: 86cqi; overflow-wrap: anywhere;
}
.fuda-word a { text-decoration: none; }
.fuda-word a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.fuda-recipe { grid-area: recipe; margin: 4cqi 0 0; padding-top: 3cqi; border-top: 1px solid var(--rule); font-size: .95rem; line-height: 1.6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; }
.fuda.bare .fuda-comp { margin-top: 4cqi; padding-top: 3cqi; border-top: 1px solid var(--rule); }
.fuda-gen { color: var(--ink-2); }
.fuda-comp { grid-area: comp; display: flex; flex-wrap: wrap; gap: 2px 14px; list-style: none; margin: 8px 0 0; padding: 0 0 8px; font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; }
.fuda-comp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--comp); }
.fuda-comp li { display: inline-flex; align-items: center; gap: 5px; color: var(--el); }

/* ---- 上の帯（遊ぶ画面と図鑑）。題字と、2つの行き先だけ ---- */
.mast {
  display: flex; align-items: center; gap: 12px 32px; min-height: var(--mast-h);
  padding: 12px 24px 14px; border-bottom: 3px double var(--ink);
}
.logo { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.2; letter-spacing: .12em; }
.logo a { text-decoration: none; }
/* 行き先は押せる札にする。いまいる所は沈めて、藍墨で塗る */
.mast nav { display: flex; gap: 10px; }
.mast nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--edge); background: var(--sheet); box-shadow: 0 3px 0 var(--press);
  font-family: var(--display); font-size: 1.05rem; letter-spacing: .08em; text-decoration: none; color: var(--ink); white-space: nowrap;
  transition: transform .08s, box-shadow .08s, background-color .12s;
}
.mast nav a:hover { background: var(--paper); }
.mast nav a:active, .mast nav a[aria-current="page"] { transform: translateY(3px); box-shadow: 0 0 0 var(--press); }
.mast nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---- 遊ぶ画面 ---- */
.play-main { max-width: none; padding: 0; }
/* パソコン（900px 以上）：左は言葉を好きな位置に置ける作業台、右は持っている言葉。みんなの発見はその下 */
.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas: "bench shelf";
  height: calc(100dvh - var(--mast-h) - 3px);
  min-height: 640px;
}
.bench { grid-area: bench; position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px 0 20px 24px; }
.shelf { grid-area: shelf; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--ink); background: var(--paper); }
.ledger { max-width: 1180px; margin: 0 auto; padding: 40px 40px 28px; scroll-margin-top: 8px; }
.mast-link { margin-left: auto; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.mast-link:hover { color: var(--water); }

/* 合わせる台：二重の罫と雷文で囲んだ紙。「1つめ ＋ 2つめ ＝ 結果」の式を、最初から3つの枠で見せる */
.formula {
  position: relative; max-width: 760px; padding: 26px 28px 24px;
  border: 3px double var(--ink); background: var(--sheet);
  --band-c: color-mix(in srgb, var(--ink) 45%, transparent);
}
.formula > .band { --bi: 6px; --bw: 8px; --ts: 10px 10px; z-index: 0; }
.formula > :not(.band) { position: relative; z-index: 1; }
.table-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; margin: 0 0 14px; }
.table-title { font-family: var(--display); font-size: 1.05rem; letter-spacing: .2em; color: var(--ink-2); }
.guide { font-weight: 700; font-size: .98rem; color: var(--ink); }
.guide::before { content: "▶"; margin-right: 6px; color: var(--gold); font-size: .8em; }
.eq { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 0 14px; }
.op { align-self: center; font-family: var(--display); font-size: 2.2rem; line-height: 1; color: var(--ink-2); transition: opacity .3s; }
.slot {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "mon e" "mon ." "w w"; align-items: start; gap: 0 10px;
  min-width: 0; min-height: 148px; padding: 14px 16px 16px;
  border: 1px solid var(--rule); border-radius: 0; background: var(--paper); color: var(--ink); cursor: default; text-align: left;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--rule-2);
  transition: transform .4s var(--ease-out), opacity .4s var(--ease-out), border-color .15s;
}
/* 空の枠：大きな薄い字と、名前 */
.slot:not(.filled) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "mon" "w"; }
.slot .ord { grid-area: mon; align-self: center; justify-self: center; font-family: var(--display); font-size: 3.4rem; line-height: 1; color: var(--rule); }
.slot .hint { grid-area: w; color: var(--ink-2); font-size: .92rem; font-weight: 600; text-align: center; }
.slot.filled { border-color: var(--edge); background: var(--sheet); box-shadow: inset 0 0 0 4px var(--sheet), inset 0 0 0 5px var(--rule); }
button.slot.filled { cursor: pointer; }
button.slot:not(.filled) { border-style: dashed; }
.slot.filled::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 9px; height: 4px; background: var(--comp); }
button.slot.filled:hover { border-color: var(--water); }
.slot[data-r="2"], .slot[data-r="3"] { padding: 22px 24px 24px; }
.slot .band { --bw: 7px; --ts: 8px 8px; }
.slot .band.pat { --bi: 9px; --bw: 6px; --ts: 10px 6px; }
.slot-mon { grid-area: mon; width: 48px; color: var(--el); }
.slot-mon .mon { width: 100%; height: auto; }
.slot .e { grid-area: e; justify-self: end; font-size: 1.15rem; line-height: 1.1; opacity: .85; }
.slot .w { grid-area: w; align-self: end; margin-bottom: 8px; font-family: var(--mincho); font-weight: 700; font-size: clamp(1.15rem, 2.2vw, 1.55rem); line-height: 1.25; overflow-wrap: anywhere; max-width: 100%; }
.slot.result:not(.filled) { background: transparent; border-style: solid; box-shadow: none; }
.slot.result:not(.filled) .ord { color: var(--ink-2); opacity: .55; }
.slot.result.wait .ord { animation: pulse 1s ease-in-out infinite; }
.formula.hover .slot:not(.filled):not(.result) { border-style: solid; border-color: var(--water); background: color-mix(in srgb, var(--water) 9%, var(--paper)); }
@keyframes pulse { 50% { opacity: .15; } }

/* 合わさる動き（REN-009）：1つめと2つめの中身が結果の枠へ寄り、結果の枠でドットが入れ替わり、組み上がる。動かすのは JS（app.js の slotView） */
.formula.reveal #slot-r { animation: settle .35s var(--ease-out); }
.formula.reveal #slot-a { opacity: .75; }
.formula.reveal.first { --band-c: var(--gold); }
.formula.reveal.first #slot-r { border-color: var(--gold); border-width: 2px; --band-c: var(--gold); }
/* 初発見の印 */
.formula.reveal.first #slot-r::before {
  content: "初発見"; position: absolute; top: 10px; right: 10px; z-index: 1;
  writing-mode: vertical-rl; padding: 6px 3px; border: 2px solid var(--gold); outline: 1px solid var(--gold); outline-offset: -5px;
  background: var(--sheet); font-family: var(--display); font-size: .95rem; line-height: 1.1; letter-spacing: .1em; color: var(--gold);
  animation: stamp .3s var(--ease-out) .15s both;
}
.formula.reveal.first #slot-r .e { margin-right: 2.6rem; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } }
@keyframes stamp { from { opacity: 0; transform: scale(1.3); } }

.under { max-width: 760px; margin-top: 14px; }
.table { display: none; }
.status { margin: 0; min-height: 3.2em; font-size: .98rem; }
.status b { font-weight: 700; }
.gold { color: var(--gold); font-weight: 700; }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
/* 押せるもの：枠と厚み。押すと沈む */
.act {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 18px;
  border: 1px solid var(--edge); border-radius: 0; background: var(--sheet); color: var(--ink); box-shadow: 0 3px 0 var(--press);
  font-weight: 700; font-size: .95rem; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, color .12s, transform .08s, box-shadow .08s;
}
.act:hover { background: var(--ink); color: var(--paper); }
.act:active { transform: translateY(3px); box-shadow: 0 0 0 var(--press); }
.act.primary { background: var(--ink); color: var(--paper); }
.act.primary:hover { background: var(--water); border-color: var(--water); color: #fff; }
.act.quiet { border-color: var(--rule); color: var(--ink-2); font-weight: 600; box-shadow: 0 3px 0 var(--rule); }
.act.quiet:hover { background: var(--rule-2); color: var(--ink); }
/* 使えないときも場所は空けておく（押した直後に下の一覧がずれて、次に押す言葉が画面の外に出ないように） */
.act:disabled { visibility: hidden; }
.act[hidden] { display: none; }
.tools[hidden] { display: none; }

/* 持っている言葉：押せる札（紋と言葉）。絵文字は並べない */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; padding: 22px 20px 10px; }
.shelf-head h2 { margin: 0; font-size: 1.25rem; }
.count { margin: 0; color: var(--ink-2); font-size: .88rem; white-space: nowrap; }
.count b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; }
.count .sep { margin: 0 6px; color: var(--rule); }
.tools { display: flex; gap: 8px; padding: 0 20px 16px; }
.tools input, .tools select {
  min-height: 44px; padding: 6px 12px; border: 1px solid var(--edge); border-radius: 0; background: var(--sheet); font-size: .95rem;
}
.tools input { flex: 1; min-width: 0; }
.tools input:hover, .tools select:hover { border-color: var(--ink-2); }
.case {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: 12px; align-content: start;
  overflow-y: auto; flex: 0 1 auto; margin: 0; padding: 16px 20px 18px; list-style: none;
  border-top: 1px solid var(--rule);
}
.piece {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 60px;
  padding: 10px 12px 15px; margin: 0; border: 1px solid var(--edge); border-radius: 0;
  background: var(--sheet); color: var(--ink); box-shadow: 0 3px 0 var(--press); text-align: left; text-decoration: none; line-height: 1.25;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: background-color .12s, transform .08s, box-shadow .08s;
}
.piece::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; background: var(--comp); }
.piece .pm { flex: none; width: 28px; color: var(--el); }
.piece .pm .mon { width: 100%; height: auto; }
.piece .w { font-family: var(--mincho); font-weight: 700; font-size: 1.08rem; overflow-wrap: anywhere; min-width: 0; }
.piece:hover { background: var(--paper); }
.piece:active { transform: translateY(3px); box-shadow: 0 0 0 var(--press); }
.piece:focus-visible { outline-offset: 2px; }
.piece .mark { position: absolute; top: 3px; right: 5px; font-family: var(--display); font-size: .72rem; line-height: 1; color: var(--gold); }
.piece.mine { border-color: var(--gold); box-shadow: 0 3px 0 var(--gold); }
.piece.suggest { border-color: var(--gold); border-width: 2px; box-shadow: 0 3px 0 var(--gold); }
.piece.fresh { animation: fresh 1.6s var(--ease-out); }
.piece.lifted { opacity: .35; }
@keyframes fresh { from { background: var(--gold-soft); } }
.empty { color: var(--ink-2); padding: 0 20px; }
.lure { margin: 4px 20px 24px; padding: 14px 16px; border: 1px solid var(--rule); border-top: 3px double var(--ink); background: var(--sheet); font-size: .92rem; line-height: 1.7; }
.lure b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--ink); }
.lure a { display: inline-block; margin-top: 2px; font-weight: 700; }
.ghost {
  position: fixed; z-index: 50; display: inline-flex; align-items: center; justify-content: center; gap: 6px; pointer-events: none;
  padding: 6px 12px; border: 1px solid var(--ink); background: var(--sheet); font-family: var(--mincho); font-weight: 700; white-space: nowrap;
}
.ghost .mon, .ghost .pm { display: none; }
.ghost.dragging { box-shadow: 0 8px 18px -8px var(--shadow); }
body.dragging { cursor: grabbing; user-select: none; }

/* みんなの発見：新しく見つかった言葉を、紋と言葉の整った格子で。その下に台帳の行 */
.ledger-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 0 8px; border-bottom: 1px solid var(--ink); }
.ledger-head h2 { margin: 0; font-size: 1.15rem; }
.ledger-head a { font-size: .88rem; white-space: nowrap; }
.ledger-head b { font-family: var(--display); font-weight: 400; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.flow { margin: 16px 0 22px; max-width: 760px; }
.newfound { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); }
.newfound li { display: flex; min-width: 0; }
.sw {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 10px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--sheet); color: var(--el); text-decoration: none;
}
.sw .mon { width: 36px; height: 36px; }
.sw-w { max-width: 100%; padding: 0 2px; font-family: var(--mincho); font-weight: 700; font-size: .85rem; line-height: 1.3; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw:hover { background: var(--paper); }
.sw:hover .sw-w { text-decoration: underline; }
.sw.newest::after { content: "新"; position: absolute; top: 3px; left: 5px; font-family: var(--display); font-size: .68rem; line-height: 1; color: var(--gold); }
.ledger-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ledger-list li { border-bottom: 1px solid var(--rule-2); }
.ledger-list a {
  display: grid; grid-template-columns: 3em 24px minmax(6em, 1fr) minmax(0, 1.3fr) minmax(0, 1fr) 4.5em;
  align-items: center; column-gap: 12px; padding: 9px 0; text-decoration: none; line-height: 1.45;
}
.ledger-list a:hover .w { text-decoration: underline; }
.ledger-list .no { font-family: var(--display); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.ledger-list .m { color: var(--el); }
.ledger-list .m .mon { width: 22px; height: 22px; }
.ledger-list .w { font-family: var(--mincho); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-list .r, .ledger-list .by, .ledger-list .t { color: var(--ink-2); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-list .t { text-align: right; }

/* 下の説明 */
.about { max-width: 680px; margin: 0 auto; padding: 48px 16px 8px; }
.about h2 { font-size: 1.2rem; margin-top: 0; }
.about p { margin: 0 0 .8em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0 0 1em; padding: 0; font-family: var(--display); font-size: 1.05rem; }
.legend li { display: inline-flex; align-items: center; gap: 6px; color: var(--el); }
.legend .seal { width: 1.6em; height: 1.6em; }
.keys { color: var(--ink-2); font-size: .9rem; }
.more-how { margin-top: 4px; }
/* 折りたたみの開閉：押せる札にする */
.more-how summary, .more-pairs summary {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 18px; margin: 0 0 12px; cursor: pointer; list-style: none;
  border: 1px solid var(--edge); background: var(--sheet); color: var(--ink); box-shadow: 0 3px 0 var(--press);
  font-weight: 700; font-size: .95rem; transition: transform .08s, box-shadow .08s, background-color .12s;
}
.more-how summary::-webkit-details-marker, .more-pairs summary::-webkit-details-marker { display: none; }
.more-how summary::before, .more-pairs summary::before { content: "＋"; margin-right: 8px; font-family: var(--display); }
.more-how[open] > summary::before, .more-pairs[open] > summary::before { content: "－"; }
.more-how summary:hover, .more-pairs summary:hover { background: var(--paper); }
.more-how summary:active, .more-pairs summary:active { transform: translateY(3px); box-shadow: 0 0 0 var(--press); }
.more-pairs { margin-top: 12px; }
.more-pairs[open] > summary { margin-bottom: 8px; }
.foot { max-width: 680px; margin: 32px auto 0; padding: 16px 16px 48px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .88rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { white-space: nowrap; }
.foot p { margin: 8px 0 0; }

/* 初発見の記録 */
.found { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--ink); border-radius: 0; background: var(--sheet); color: var(--ink); box-shadow: 0 24px 60px -24px var(--shadow); }
.found::backdrop { background: var(--scrim); }
.found[open] { animation: settle .25s var(--ease-out); }
.found-in { padding: 20px 20px 16px; }
.found h2 { margin: 0 0 4px; font-size: 1.4rem; color: var(--gold); letter-spacing: .2em; }
.found-lead { margin: 0 0 12px; }
.found canvas { display: block; width: 100%; height: auto; }
.found-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.found-note { min-height: 1.5em; margin: 8px 0 0; font-size: .85rem; color: var(--ink-2); }
.found-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.found-foot a { font-weight: 600; }

/* ---- 図鑑（Worker が組み立てるページ） ---- */
.zk-main { max-width: 1200px; padding-top: 32px; }
.zk-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); align-items: end; gap: 12px 40px; }
.zk-head h1 { font-size: 2.8rem; margin: 0; letter-spacing: .2em; line-height: 1.1; }
.lead { color: var(--ink-2); margin: 6px 0 0; }
.num { font-family: var(--display); font-weight: 400; font-size: 1.4em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.zk-search { display: flex; gap: 0; }
.zk-search input { flex: 1; min-width: 0; min-height: 44px; padding: 6px 12px; border: 1px solid var(--ink); border-right: 0; border-radius: 0; background: var(--sheet); }
.zk-search button { min-height: 44px; padding: 6px 18px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--paper); font-weight: 700; white-space: nowrap; cursor: pointer; }
.zk-search button:hover { background: var(--water); border-color: var(--water); }
.zk-tabs { display: flex; gap: 4px 28px; flex-wrap: wrap; margin: 28px 0 0; padding: 0 0 8px; border-bottom: 3px double var(--ink); }
.zk-tabs a { font-family: var(--display); font-size: 1.1rem; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.zk-tabs a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em; }
.zk-tabs a:not([aria-current]):hover { color: var(--ink); }
.zk-sub { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; margin: 0 0 8px; }
.note { color: var(--ink-2); font-size: .9rem; max-width: 46em; margin: 0 0 14px; }

/* 左に1件の札、右に全件の格子 */
.zk-split { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px 36px; align-items: start; margin-top: 24px; }
.zk-panel { position: sticky; top: 16px; }
.panel-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 10px 0 0; font-size: .88rem; }
.panel-meta div { display: contents; }
.panel-meta dt, .panel-meta dd { margin: 0; padding: 5px 0; border-bottom: 1px solid var(--rule-2); }
.panel-meta dt { padding-right: 14px; color: var(--ink-2); }
.panel-meta dd { font-weight: 600; overflow-wrap: anywhere; }
.panel-hint { margin: 8px 0 0; color: var(--ink-2); font-size: .8rem; }
.zk-body { min-width: 0; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr)); list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--ink); border-left: 1px solid var(--rule);
}
.grid > li { display: flex; min-width: 0; }
.cell {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 18px 6px 9px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: var(--sheet); text-decoration: none; line-height: 1.3; text-align: center;
}
.cell .mon { width: 44px; height: 44px; color: var(--el); margin-bottom: 4px; }
.cell-no { position: absolute; top: 4px; left: 6px; font-size: .68rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cell-w { font-family: var(--mincho); font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; max-width: 100%; }
.cell-r { font-size: .7rem; color: var(--ink-2); overflow-wrap: anywhere; max-width: 100%; }
.cell:hover, .cell.on { background: var(--paper); }
.cell.on { outline: 2px solid var(--ink); outline-offset: -2px; }
.cell:hover .cell-w { text-decoration: underline; }
.cell:focus-visible { outline-offset: -3px; }
.zk-main .foot { max-width: none; margin: 48px 0 0; padding: 16px 0 48px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-weight: 600; }
.pager a { white-space: nowrap; }

.zk-gen + .zk-gen { margin-top: 8px; }
.zk-gen h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 24px 0 0; padding-bottom: 6px; }
.zk-gen:first-of-type h2 { margin-top: 0; }
.zk-gen h2 small { font-family: var(--sans); font-size: .82rem; color: var(--ink-2); }
.zk-el h2 { color: var(--el); }
.zk-el h2 .seal { width: 1.4em; height: 1.4em; }
.zk-el h2 small { color: var(--ink-2); }
.more { color: var(--ink-2); font-size: .85rem; }

.zk-finders { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: f; border-top: 1px solid var(--ink); }
.zk-finders li { counter-increment: f; border-bottom: 1px solid var(--rule-2); }
.zk-finders a { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) 4.5em minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 10px 4px; text-decoration: none; }
.zk-finders a::before { content: counter(f); font-family: var(--display); color: var(--ink-2); text-align: right; }
.zk-finders a:hover { background: var(--sheet); }
.zk-finders .name { font-weight: 700; }
.zk-finders .n { font-family: var(--display); font-size: 1.3rem; text-align: right; }
.zk-finders .n small { font-size: .7rem; margin-left: 2px; }
.zk-finders .last { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .85rem; overflow: hidden; white-space: nowrap; }
.last-mon { color: var(--el); flex: none; }
.last-mon .mon { width: 18px; height: 18px; }

/* 言葉のページ：札と、初発見の記録 */
.entry { padding-bottom: 36px; border-bottom: 3px double var(--ink); }
.sp-word { margin: 0; font-family: var(--brush); font-weight: 400; font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1.15; overflow-wrap: anywhere; }
.sp-recipe { margin: 14px 0 0; font-size: 1.05rem; color: var(--ink-2); }
.op-t { color: var(--ink-2); margin: 0 .5em; }
.fuda-recipe .op-t { margin: 0 .35em; }
.fuda-recipe { display: block; }
.fuda-recipe .wl-t { font-family: var(--mincho); font-weight: 700; color: var(--ink); text-decoration: underline dotted; text-underline-offset: 4px; }

/* 言葉への小さな札：紋 + 明朝の太字 + 下に成分の色の線。藍墨の枠と押せる影（持っている言葉の札と同じ形）。.on は系統図の結果 */
.wl {
  position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 6px 12px 10px 10px;
  border: 1px solid var(--edge); border-radius: 0; background: var(--sheet); color: var(--ink); box-shadow: 0 2px 0 var(--press);
  font-family: var(--mincho); font-weight: 700; font-size: 15px; line-height: 1.25; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, transform .08s, box-shadow .08s;
}
.wl::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 4px; height: 2px; background: var(--comp); }
.wl[data-el="-1"]::after { background: var(--rule); }
.wl .pm { flex: none; width: 18px; color: var(--el); }
.wl .pm .mon { width: 100%; height: auto; }
.wl .w { min-width: 0; overflow-wrap: anywhere; }
.wl:hover { background: var(--paper); }
.wl:active { transform: translateY(2px); box-shadow: 0 0 0 var(--press); }
.wl.on, .wl.on:hover { background: var(--ink); color: var(--sheet); }
.wl.on .pm { color: var(--sheet); }

/* 言葉のページ（REN-010）：パソコンは左に札、右に作り方。スマホは見出し、札、記録、作り方、作れるもの、遊ぶ */
.crumb { margin: 0 0 22px; font-family: var(--mincho); font-size: 13px; color: var(--ink-2); }
.crumb a { color: var(--ink-2); }
.wp { display: flex; flex-direction: column; gap: 24px; }
.wp-card { display: contents; }
.wp-head { order: 1; }
.wp-card .fuda { order: 2; }
.rec { order: 3; }
.wp-sec { order: 4; }
.wp-card .wp-cta { order: 9; }
.wp-gen { margin: 0; font-family: var(--display); font-size: 14px; letter-spacing: .2em; color: var(--ink-2); }
.wp-title { margin: 6px 0 0; font-size: 28px; line-height: 1.25; letter-spacing: normal; }
.wp-lead { margin: 10px 0 0; font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.wp-card .fuda-word { font-size: clamp(1.6rem, min(18cqi, calc(78cqi / var(--len, 3))), 5.5rem); }
.wp-card .fuda-mon { max-width: 44cqi; }
.wp-cta {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; background: var(--ink); color: var(--sheet);
  font-family: var(--display); font-size: 18px; letter-spacing: .08em; text-decoration: none; box-shadow: 0 3px 0 var(--gold);
}
.wp-cta:hover { background: var(--water); }
.wp-cta:active { transform: translateY(3px); box-shadow: 0 0 0 var(--gold); }
/* 初発見の記録：標本のラベル。二重の枠、題は Zen Antique、値は明朝 */
.rec { border: 1px solid var(--ink); background: var(--sheet); outline: 1px solid var(--ink); outline-offset: 3px; margin: 3px; }
.rec dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rec dl > div { padding: 12px 16px; min-width: 0; }
.rec dl > div:nth-child(even) { border-left: 1px solid var(--rule); }
.rec dl > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
.rec dt { font-family: var(--display); font-size: 12px; letter-spacing: .15em; color: var(--ink-2); }
.rec dd { margin: 4px 0 0; font-family: var(--mincho); font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.rec dd a { text-decoration-style: dotted; text-underline-offset: 4px; }
.rec-note { margin: 0; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--ink-2); }
/* 見出し：Zen Antique、右に二重の罫 */
.wp-sec h2 { margin: 0 0 6px; display: flex; align-items: center; gap: 12px; font-size: 22px; letter-spacing: .12em; }
.wp-sec h2::after { content: ""; flex: 1; height: 0; border-top: 3px double var(--ink); }
/* 作り方の系統図：番号の四角を縦の線でつなぐ */
/* 「＋ 札」「→ 札」は1まとまりで折り返す（記号だけが行末に残らないように） */
.pair { display: inline-flex; align-items: center; gap: inherit; white-space: nowrap; }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 17px; top: 22px; bottom: 22px; width: 2px; background: var(--rule); }
.steps li { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.st-no {
  flex: none; min-width: 36px; height: 36px; padding: 0 3px; margin-top: 4px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink);
  background: var(--paper); color: var(--ink); font-family: var(--display); font-size: 17px; line-height: 1; white-space: nowrap; letter-spacing: -.04em;
}
.steps li:last-child .st-no { background: var(--ink); color: var(--sheet); }
.st-body, .pairs li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.st-body { flex: 1; }
.op { font-family: var(--display); font-size: 18px; color: var(--ink-2); }
.pairs { list-style: none; padding: 0; margin: 0; }
.pairs li { padding: 6px 0; }
.wp-sec .empty { margin: 8px 0 0; padding: 0; font-size: .92rem; color: var(--ink-2); }
.more-pairs[open] > summary { margin-bottom: 8px; }
@media (min-width: 900px) {
  .wp { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr; gap: 0 48px; align-items: start; }
  .wp-card { display: flex; flex-direction: column; gap: 18px; grid-column: 1; grid-row: 1 / span 6; position: sticky; top: 16px; }
  .wp-head, .rec, .wp-sec { grid-column: 2; margin-bottom: 34px; }
  .wp-head, .wp-card .fuda, .rec, .wp-sec, .wp-card .wp-cta { order: 0; }
  .wp-title { font-size: 38px; }
  .wp-card .fuda-mon { max-width: 48cqi; }
}
@media (min-width: 1100px) {
  .rec dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rec dl > div:nth-child(n + 3) { border-top: 0; }
  .rec dl > div + div { border-left: 1px solid var(--rule); }
}
.cta { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 24px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; white-space: nowrap; }
.cta:hover { background: var(--water); border-color: var(--water); }

/* ---- 混ぜる演出（REN-009）。作業台とスマホの台で共通：寄る → 待つ（ドットが入れ替わる）→ 組み上がる → 名前が浮かぶ → 初発見の輪 ---- */
.synth { display: grid; justify-items: center; align-content: center; color: var(--ink-2); pointer-events: none; }
.synth .mon { width: 56px; height: 56px; }
.synth.lit { color: var(--el, var(--ai)); }
.mon-lit rect { transform-box: fill-box; transform-origin: center; animation: dot .14s var(--ease-out) both; animation-delay: var(--t, 0ms); }
@keyframes dot { from { opacity: 0; transform: scale(.1); } }
.synth-name { font-family: var(--mincho); font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--ink); white-space: nowrap; animation: float .32s var(--ease-out) both; }
@keyframes float { from { opacity: 0; transform: translateY(8px); } }
.ring {
  position: absolute; z-index: 5; width: 90px; height: 90px; margin: -45px 0 0 -45px; border: 3px solid var(--gold); border-radius: 50%; pointer-events: none;
  animation: ring .7s var(--ease-out) both;
}
@keyframes ring { from { opacity: 1; transform: scale(.35); } to { opacity: 0; transform: scale(3.4); } }
.slot.result.synthing { padding: 0; }
/* スマホの台：混ぜている間は、台の真ん中に紋を出す。記号と結果の枠は薄くする */
.formula.fusing .eq > .op, .formula.fusing #slot-r { opacity: .25; transition: opacity .15s; }
.eq > .synth.center { position: absolute; left: 50%; top: 50%; z-index: 3; width: 120px; height: 120px; transform: translate(-50%, -50%); gap: 6px;
  border: 1px solid var(--edge); background: var(--sheet); box-shadow: 0 3px 0 var(--press); }
.eq > .synth.center .mon { width: 56px; height: 56px; }
.eq > .synth.center .synth-name { max-width: 100%; padding: 0 6px; font-size: 1rem; text-align: center; white-space: normal; overflow-wrap: anywhere; }
@keyframes float-c { from { opacity: 0; transform: translate(-50%, 8px); } }
.slot.result .synth { position: absolute; inset: 0; gap: 6px; }
.slot.result .synth .mon { width: 44px; height: 44px; }
.slot.result .synth-name { max-width: 100%; padding: 0 4px; font-size: 1rem; text-align: center; white-space: normal; overflow-wrap: anywhere; }

/* ---- パソコンの作業台（900px 以上） ---- */
@media (min-width: 900px) {
  .bench .formula { display: none; }
  .table {
    display: block; position: relative; flex: 1; min-height: 0; overflow: hidden;
    border: 1px solid var(--ink); background-color: var(--sheet);
    background-image: radial-gradient(var(--rule-2) 1.2px, transparent 1.2px); background-size: 24px 24px;
  }
  .table::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--rule); pointer-events: none; }
  .table.hover { border-color: var(--water); box-shadow: inset 0 0 0 2px var(--water); }
  .table-label { position: absolute; left: 22px; top: 16px; margin: 0; font-family: var(--display); font-size: 15px; letter-spacing: .3em; color: var(--ink-2); }
  .table-pieces { position: absolute; inset: 0; z-index: 1; }
  .table-foot { position: absolute; z-index: 2; left: 22px; right: 22px; bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
  .table-foot > * { pointer-events: auto; }
  .table-tip { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); pointer-events: none; }
  .table-foot .guide { margin: 0; font-size: .92rem; }
  .table-foot #table-clear { flex: none; }

  /* 結果の一言は作業台の上部中央。aria-live はそのまま */
  .under { display: contents; }
  .status {
    position: absolute; z-index: 6; left: calc(50% + 12px); top: 36px; transform: translateX(-50%);
    max-width: min(640px, 78%); min-height: 0; margin: 0; padding: 8px 16px; background: var(--ink); color: var(--paper);
    font-size: 14px; line-height: 1.6; text-align: center; text-wrap: balance; pointer-events: none;
  }
  .status .gold { color: var(--gold-soft); }
  .acts { position: absolute; z-index: 6; left: 46px; bottom: 96px; margin: 0; }
  #clear { display: none; }

  /* 作業台の札。持っている言葉の札と同じ形（藍墨の枠、押せる影、下の成分の線） */
  .tcard {
    position: absolute; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 9px 14px 14px 12px; margin: 0;
    border: 1px solid var(--edge); border-radius: 0; background: var(--sheet); color: var(--ink); box-shadow: 0 3px 0 var(--press);
    font-family: var(--mincho); font-weight: 700; font-size: 17px; line-height: 1.25; white-space: nowrap; text-align: left;
    cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  }
  .tcard::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; background: var(--comp); }
  .tcard .pm { flex: none; width: 26px; color: var(--el); }
  .tcard .pm .mon { width: 100%; height: auto; }
  .tcard .mark { position: absolute; top: -10px; right: -10px; z-index: 1; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--gold); color: #fff; font-family: var(--display); font-size: 14px; line-height: 1; }
  .tcard.dragging { z-index: 20; cursor: grabbing; transform: rotate(-2deg); box-shadow: 0 10px 18px var(--shadow); }
  .tcard.target { outline: 3px solid var(--gold); outline-offset: 3px; }
  .tcard.armed { border-color: var(--gold); box-shadow: 0 3px 0 var(--gold); }
  .tcard.hidden { visibility: hidden; }
  .tcard.settle { animation: settle .3s var(--ease-out); }
  .drop-hint { position: absolute; z-index: 21; margin: 0; font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; pointer-events: none; }
  .table .synth { position: absolute; z-index: 4; width: 92px; height: 92px; border: 1px solid var(--edge); background: var(--sheet); box-shadow: 0 3px 0 var(--press); }
  .table .synth .synth-name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 10px; animation-name: float-c; }
  @keyframes float-c { from { opacity: 0; transform: translate(-50%, 8px); } }

  /* 持っている言葉：小さな札を詰めて折り返す */
  .shelf-head { padding: 20px 22px 14px; }
  .shelf-head h2 { font-size: 1.25rem; }
  .tools { padding: 0 22px 14px; }
  .tools select { width: 120px; }
  .case { display: flex; flex-wrap: wrap; gap: 10px 8px; align-content: flex-start; flex: 1 1 auto; min-height: 0; padding: 16px 22px; }
  .case .piece { min-height: 44px; gap: 8px; padding: 7px 12px 11px 10px; box-shadow: 0 2px 0 var(--press); cursor: grab; }
  .case .piece::after { left: 10px; right: 10px; bottom: 4px; height: 2px; }
  .case .piece .pm { width: 20px; }
  .case .piece .w { font-size: 15px; }
  .case .piece.mine { box-shadow: 0 2px 0 var(--press); border-color: var(--edge); }
  .case .piece.suggest { box-shadow: 0 2px 0 var(--gold); }
  .case .piece .mark { top: -8px; right: -8px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; background: var(--gold); color: #fff; font-size: 12px; }
  .empty { padding: 0 22px; }
  .lure { margin: 0; padding: 14px 22px 18px; border: 0; border-top: 1px solid var(--rule); background: transparent; font-size: 13px; }
  .lure b { font-size: 1.1rem; }
}

/* ---- 幅の狭い画面 ---- */
@media (max-width: 1100px) {
  .ledger { padding: 32px 28px 24px; }
  .ledger-list a { grid-template-columns: 2.8em 20px minmax(5em, 1fr) minmax(0, 1.2fr) 4.5em; }
  .ledger-list .by { display: none; }
  .zk-split { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 899px) {
  :root { --mast-h: 64px; }
  .mast { padding: 10px 20px 12px; justify-content: space-between; }
  .logo { font-size: 1.3rem; letter-spacing: .08em; }
  .mast nav { gap: 8px; }
  .mast nav a { padding: 0 14px; font-size: 1rem; letter-spacing: .04em; }
  .desk { display: block; height: auto; min-height: 0; }
  .bench { display: block; padding: 20px 20px 4px; }
  .formula { padding: 16px 14px 16px; }
  .formula > .band { --bi: 4px; --bw: 6px; --ts: 8px 8px; }
  .table-head { margin-bottom: 10px; }
  .eq { gap: 0 6px; }
  .op { font-size: 1.4rem; }
  .slot {
    min-height: 118px; padding: 10px 6px 16px; gap: 4px 0;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "mon" "w";
    justify-items: center; align-items: center; text-align: center;
  }
  .slot:not(.filled) { grid-template-rows: minmax(0, 1fr) auto; }
  .slot[data-r="2"], .slot[data-r="3"] { padding: 14px 10px 18px; }
  .slot .band { --bw: 4px; --ts: 6px 6px; }
  .slot .band.pat { display: none; }
  .slot .ord { font-size: 2.4rem; }
  .slot .hint { font-size: .84rem; }
  .slot-mon { width: 34px; }
  .slot .e { display: none; }
  .slot .w { align-self: center; margin-bottom: 0; font-size: 1.05rem; line-height: 1.3; }
  .slot.filled::after { left: 8px; right: 8px; bottom: 7px; height: 4px; }
  .formula.reveal.first #slot-r::before { top: 4px; right: 4px; font-size: .62rem; padding: 3px 1px; outline-offset: -4px; }
  .under { margin-top: 10px; }
  .status { min-height: 3.2em; font-size: .92rem; line-height: 1.7; }
  .acts { margin-top: 6px; }
  .shelf { border-left: 0; margin-top: 12px; border-top: 1px solid var(--ink); }
  .shelf-head { padding: 18px 20px 10px; }
  .tools { padding: 0 20px 14px; }
  .case { max-height: min(46vh, 430px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 20px 16px; }
  .piece { min-height: 56px; }
  .lure { margin: 4px 20px 24px; }
  .ledger { max-width: none; margin: 0; padding: 4px 20px 0; }
  .ledger-head { padding-top: 20px; }
  .mast-link { display: none; }
  .flow { max-width: none; margin: 14px 0 18px; }
  .newfound { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .newfound li:nth-child(n + 9) { display: none; }
  .ledger-list a { grid-template-columns: 2.6em 20px minmax(0, 1fr) auto; grid-template-areas: "no m w t" "no m r r"; row-gap: 0; }
  .ledger-list .no { grid-area: no; } .ledger-list .m { grid-area: m; } .ledger-list .w { grid-area: w; }
  .ledger-list .r { grid-area: r; } .ledger-list .t { grid-area: t; }
  .about { padding: 36px 20px 8px; }
  .foot { padding-left: 20px; padding-right: 20px; }
  .zk-main { padding: 24px 20px 64px; }
  .zk-head { grid-template-columns: minmax(0, 1fr); }
  .zk-head h1 { font-size: 2.2rem; }
  .zk-tabs { gap: 4px 20px; }
  .zk-split { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  .zk-panel { position: static; }
  .zk-panel .fuda-word { font-size: clamp(1.4rem, min(12cqi, calc(56cqi / var(--len, 3))), 3.4rem); }
  .zk-split:not([data-view="new"]) .zk-panel { display: none; }
  .panel-hint { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); }
  .cell .mon { width: 40px; height: 40px; }
  .zk-finders a { grid-template-columns: 2em minmax(0, 1fr) auto; }
  .zk-finders .last { grid-column: 2 / -1; }
}
@media (max-width: 340px) {
  .logo { font-size: 1.15rem; }
  .case { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 動きを減らす設定：位置の動きをやめ、短い切り替えだけにする。寄る、揺れる、ドットの演出は JS が出さない */
@media (prefers-reduced-motion: reduce) {
  .synth, .ring { display: none !important; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .formula.fusing #slot-a, .formula.fusing #slot-b { opacity: .5; }
}
