/* 色分けパズル 固有の見た目（共通は ../common/base.css）。色の玉・水の層は、ダーク表示でも同じ色（固定色） */
[hidden] { display: none !important; }

.board-wrap { position: relative; max-width: 640px; margin: 0 auto; }
.tubes-box { display: flex; justify-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 0 0; }
svg.csort {
  display: block; height: auto; width: 100%; max-height: min(62vh, 560px);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer;
}
svg.csort text { pointer-events: none; }

/* 筒: ガラスの地と線。持ち上げた筒はアクセント色の線 */
.csort .glass { fill: var(--bg); opacity: .7; }
.csort .tube-line { fill: none; stroke: var(--ink-sub); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.csort .tube .body { transition: transform .12s ease-out; }
.csort .tube.selected .body { transform: translateY(-22px); }
.csort .tube.selected .tube-line { stroke: var(--accent); stroke-width: 7; }
.csort .tube.drop .tube-line { stroke: var(--accent); stroke-width: 7; stroke-dasharray: 10 8; }
.csort .tube.cursor .hit { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 6; rx: 12; }
.csort .tube-no { font-family: var(--font); font-size: 28px; font-weight: 700; fill: var(--ink-sub); text-anchor: middle; }
.csort .tube.selected .tube-no { fill: var(--accent); }
.csort .unit { filter: none; }
.csort .flyer { filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .28)); pointer-events: none; }
.csort .target { fill: var(--accent); stroke: var(--surface); stroke-width: 3; stroke-linejoin: round; pointer-events: none; }

/* そろった筒の印 */
.csort .done-mark { opacity: 0; transition: opacity .2s; }
.csort .tube.complete .done-mark { opacity: 1; }
.csort .done-bg { fill: var(--ok); stroke: var(--surface); stroke-width: 3; }
.csort .done-ck { fill: none; stroke: #FFFFFF; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* ヒント: 注意色の点線の枠と矢印 */
.csort .hint-box { fill: none; stroke: var(--warn); stroke-width: 6; stroke-dasharray: 14 9; pointer-events: none; }
.csort .hint-path, .csort .hint-head { fill: none; stroke: var(--warn); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.csort .hint-path { stroke-dasharray: 2 12; }
.csort .over, .csort .marks { pointer-events: none; }

@media (prefers-reduced-motion: reduce) { .csort .tube .body, .csort .done-mark { transition: none; } }

/* 手番のバー: 問題・手数・最短 */
.status { flex-wrap: wrap; column-gap: 14px; row-gap: 0; }
.st-name { white-space: nowrap; }
.counter { font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter b { font-size: 1.12em; }
.counter.sub { font-weight: 400; color: var(--ink-sub); }

/* 問題の選択 */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; font-style: normal; }
.stages { gap: 6px; }
.stage-choice span { min-width: 48px; justify-content: center; padding: 0 6px; font-variant-numeric: tabular-nums; position: relative; }
.stage-choice .ck, .stage-choice .star { width: 14px; height: 14px; margin-left: 2px; }
.stage-choice .ck path { fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.stage-choice .star path { fill: var(--warn); }

/* ボタンの列 */
.btnrow { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }

/* 結果は盤の下に */
.result-box { position: static; margin: 10px auto 0; padding: 16px 20px; max-width: 560px; }
.result-box h2 { font-size: 1.4rem; margin-bottom: 4px; }
.result-box .big { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.result-box ul { list-style: none; padding: 0; margin: 0 0 8px; }
.result-box li + li { margin-top: 2px; }
.rstars { display: inline-flex; gap: 4px; }
.result-box .rstar { width: 34px; height: 34px; display: inline-block; }
.rstar path { fill: none; stroke: var(--line-strong); stroke-width: 1.2; stroke-linejoin: round; }
.rstar.on path { fill: var(--warn); stroke: var(--warn); }
.callout { z-index: 3; font-size: clamp(17px, 4vw, 22px); padding: 4px 18px; }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .controls .btn.icon, .btnrow .btn { padding: 0 10px; }
  .btnrow { margin-top: 8px; gap: 6px; }
  svg.csort { max-height: 52vh; }
  :root:lang(en) #controls-btn { display: none; }
}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; --tb-rt: 0px; --tb-st-rt: 0px; }
@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; } }
:root:lang(en) .turnbar { --tb-msg-lines: 3; --tb-st-lines: 1; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 3; --tb-st-lines: 1; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
