/* 熟語しりとり固有の見た目（共通は ../common/base.css） */
[hidden] { display: none !important; }
.pm { font-weight: 700; margin-right: 2px; }
.status .count { margin-left: auto; color: var(--ink-sub); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; }
.message.ng { color: var(--ng); }
.message ruby rt, .need ruby rt { font-weight: 400; }
/* 熟語は明朝体で（紙の札の感じ）。なければ端末の字 */
.card .cardbtn, .need-head, .pz-cell, .opt, .cand, .wl-w, .result-box .big {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "BIZ UDMincho", "Noto Serif JP", serif;
}
/* ふりがな「なし」: 画面の文と意味のふりがなを消す（熟語の読みは残す） */
.no-furi .turnbar rt, .no-furi .panel rt, .no-furi .tools rt, .no-furi .controls rt, .no-furi .wl-m rt, .no-furi .need-text rt, .no-furi .need-sub rt, .no-furi .result-box .note rt, .no-furi .wordlist summary rt { display: none; }
.no-furi .message ruby:not(.w) rt { display: none; }
.no-furi .message .kw rt { display: revert; }

/* ---------- 遊ぶ人 ---------- */
.players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 8px; min-height: 30px; }
.pl { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border: 2px solid var(--line); border-radius: 999px; font-size: 15px; background: var(--surface); }
.pl b { color: var(--c); }
.pl small { color: var(--ink-sub); font-size: 14px; }
.pl.is-turn { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); font-weight: 700; }
.lives { display: inline-flex; gap: 3px; margin-left: 2px; }
.life { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); background: var(--surface); }
.life.used { background: var(--ng); border-color: var(--ng); }
.players:empty { display: none; }

/* ---------- つながった熟語（紙の札の列） ---------- */
.chain {
  list-style: none; margin: 0 auto; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px 4px; align-items: center; align-content: flex-start;
  max-width: 560px; height: 168px; overflow-y: auto; background: var(--board); border: 1px solid var(--line); border-radius: var(--radius); color: #1F2328;
}
.card { display: inline-flex; }
.cardbtn {
  appearance: none; font-size: 24px; line-height: 1.2; padding: 3px 9px 4px; min-height: 44px; cursor: pointer;
  background: #FFFFFF; color: #1F2328; border: 1.5px solid #D9D6CE; border-left: 5px solid var(--c); border-radius: 5px; filter: var(--shadow-piece);
}
.cardbtn rt { font-size: 11px; color: #5B616B; font-family: system-ui, sans-serif; }
.cardbtn:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.card.start .cardbtn { border-left-color: #8A8F98; }
.card.last .cardbtn { border-color: var(--c); border-left-width: 5px; }
.tail { color: #FFFFFF; background: var(--c, #2F5D8A); border-radius: 4px; padding: 0 2px; font-weight: 700; }
.card.start .tail { background: #2F5D8A; }
.card.pop .cardbtn { animation: chip-in .25s ease-out; }
@keyframes chip-in { from { transform: translateY(6px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.chain .arr { color: #8A8F98; font-size: 14px; padding: 0 1px; }
.chip.miss { font-size: 14px; padding: 2px 8px; border-radius: 999px; background: #FBE3E0; color: #7A2A26; border: 1px solid #E8B4AD; }

/* ---------- 次の字 ---------- */
.need { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 10px auto 0; padding: 8px 12px; border: 2px solid var(--c, var(--accent)); border-radius: var(--radius); background: var(--surface); }
.need-head { flex: none; width: 60px; height: 60px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; background: var(--c, var(--accent)); color: #FFFFFF; font-size: 40px; font-weight: 700; line-height: 1; }
.need.thinking .need-head { animation: think 1s ease-in-out infinite alternate; }
@keyframes think { to { opacity: .55; } }
.need-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 17px; font-weight: 700; line-height: 1.5; }
.need-sub { font-size: 14px; font-weight: 400; color: var(--ink-sub); }
.timer { flex: none; position: relative; width: 48px; height: 48px; }
.timer svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.t-bg { stroke: var(--line); }
.t-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .1s linear; }
.timer.low .t-fg { stroke: var(--ng); }
.timer span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.low span { color: var(--ng); }

/* ---------- パズル ---------- */
.pz { max-width: 560px; margin: 0 auto; padding: 14px 10px 10px; background: var(--board); border: 1px solid var(--line); border-radius: var(--radius); color: #1F2328; }
.pz-row { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; }
.pz-cell {
  position: relative; flex: none; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; background: #FFFFFF; border: 2px dashed #858891; border-radius: var(--radius);
}
.pz-cell.fill { border-style: solid; border-color: #2F5D8A; filter: var(--shadow-piece); }
.pz-cell.shown { border-color: #B23A3A; }
.pz-cell.start, .pz-cell.goal { border-style: solid; border-color: #1F2328; background: #FFFFFF; filter: var(--shadow-piece); }
.pz-cell.goal { background: #FFF6DB; }
.pz-cell.next { border-color: #2F5D8A; border-width: 3px; background: #E3ECF5; }
.pz-cell small { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: #5B616B; white-space: nowrap; font-family: system-ui, sans-serif; }
.pz-link { position: relative; flex: 0 1 34px; min-width: 16px; height: 4px; background: #D9D6CE; border-radius: 2px; margin: 0 2px; }
.pz-link.on { background: #2F5D8A; }
.pz-yomi { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #2F5D8A; white-space: nowrap; font-family: system-ui, sans-serif; }
.pz-note { margin: 22px 0 0; text-align: center; font-size: 18px; min-height: 2.2em; }
.pz-note ruby rt { font-size: 11px; color: #5B616B; }
.pz-note .arr, .result-box .arr { color: #8A8F98; margin: 0 4px; font-size: 14px; }

/* ---------- 答える ---------- */
.answer-row { display: flex; gap: 8px; max-width: 560px; margin: 10px auto 0; }
.kin {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 12px; font: inherit; font-size: 22px; font-weight: 700; color: var(--ink);
  border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface);
}
.kin::placeholder { font-size: 15px; font-weight: 400; color: var(--ink-sub); }
.kin:focus-visible { outline: 3px solid var(--warn); outline-offset: 1px; }
.kin:disabled { border-color: var(--line); }
.answer-row.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.btn.go { flex: none; padding: 0 18px; font-size: 18px; }
.cands { display: flex; flex-wrap: wrap; gap: 8px; max-width: 560px; margin: 8px auto 0; min-height: 0; }
.cand {
  appearance: none; display: inline-flex; flex-direction: column; align-items: center; min-height: 52px; min-width: 64px; padding: 2px 12px; cursor: pointer;
  font-size: 24px; line-height: 1.2; color: var(--ink); background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius);
}
.cand rt { font-size: 11px; font-family: system-ui, sans-serif; }
.cand small { font-size: 12px; color: var(--ink-sub); font-family: system-ui, sans-serif; }
.cand.off { border-style: dashed; border-color: var(--line-strong); color: var(--ink-sub); }
.cand:focus-visible, .opt:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 560px; margin: 10px auto 0; }
.opt {
  appearance: none; position: relative; min-height: 56px; font-size: 28px; font-weight: 700; cursor: pointer; letter-spacing: .06em;
  color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius); filter: var(--shadow-piece);
}
.opt .num { position: absolute; top: 3px; left: 6px; font-size: 12px; color: var(--ink-sub); font-family: system-ui, sans-serif; letter-spacing: 0; }
.opt:active:not(:disabled) { transform: translateY(1px); background: var(--accent-soft); }
.opt.ng { color: var(--ng); text-decoration: line-through; border-style: dashed; filter: none; opacity: .7; }
.opt:disabled { cursor: not-allowed; }

/* ---------- 道具 ---------- */
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px auto 0; max-width: 560px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 16px; flex: 1 1 0; justify-content: center; white-space: nowrap; }
.tool svg { width: 20px; height: 20px; flex: none; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- 遊んだ熟語の一覧 ---------- */
.wordlist { max-width: 560px; margin: 12px auto 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.wordlist summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 700; color: var(--accent); }
.wordlist summary span { color: var(--ink-sub); font-weight: 400; font-size: 14px; }
.wl { list-style: none; margin: 0; padding: 0 12px 8px; max-height: 320px; overflow-y: auto; }
.wl li { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.wl-w { grid-row: span 2; font-size: 26px; line-height: 1.3; align-self: center; }
.wl-w rt { font-size: 11px; font-family: system-ui, sans-serif; }
.wl-r { font-size: 14px; color: var(--ink-sub); }
.wl-r em { font-style: normal; margin-left: 8px; font-size: 13px; padding: 0 6px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.wl-m { font-size: 15px; line-height: 1.8; }
.wl-m .none { color: var(--ink-sub); font-size: 14px; }

/* ---------- 結果 ---------- */
.result-box { position: static; max-width: 560px; margin: 10px auto 0; padding: 16px; }
.result-box h2 { font-size: 1.4rem; margin-bottom: 6px; }
.result-box .big { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.result-box .big rt { font-size: 11px; font-weight: 400; font-family: system-ui, sans-serif; }
#play.is-over .answer-row, #play.is-over .cands, #play.is-over .opts, #play.is-over .tools { display: none !important; }
.callout { z-index: 3; top: 42%; }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .players { flex-wrap: nowrap; gap: 4px; }
  .pl { padding: 2px 8px; gap: 4px; font-size: 14px; white-space: nowrap; }
  .life { width: 9px; height: 9px; }
  .chain { height: 124px; padding: 6px; gap: 6px 3px; }
  .cardbtn { font-size: 20px; padding: 2px 7px 3px; }
  .need { padding: 6px 8px; gap: 8px; margin-top: 8px; }
  .need-head { width: 50px; height: 50px; font-size: 34px; }
  .need-text { font-size: 15px; }
  .timer, .timer svg { width: 40px; height: 40px; }
  .pz-cell { width: 48px; height: 48px; font-size: 30px; }
  .pz-link { flex-basis: 22px; min-width: 10px; }
  .pz-yomi { font-size: 11px; }
  .kin { min-height: 46px; font-size: 20px; }
  .btn.go { padding: 0 12px; }
  .opt { min-height: 52px; font-size: 24px; }
  .tools { gap: 6px; margin-top: 8px; }
  .tool { padding: 0 6px; font-size: 15px; gap: 3px; min-width: 0; }
  .tools svg { display: none; }
  .controls .btn.icon { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .card.pop .cardbtn, .answer-row.shake, .need.thinking .need-head { animation: none; }
}

/* iPhone の「連絡先を自動入力」を出さないため入力欄は type=search（要望No.87）。検索欄の見た目は消す */
input[type=search]{-webkit-appearance:none;appearance:none}
input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{display:none;-webkit-appearance:none}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; --tb-rt: 11px; --tb-st-rt: 11px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
