/* 八八固有の見た目（花合わせ games/hanaawase と同じ作り）（共通は ../common/base.css） */
#table { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#table text { pointer-events: none; }
@media (max-width: 480px) { .stage { padding: 6px; } }

/* 卓の上の文字・枠 */
.zone { fill: rgba(0, 0, 0, .10); stroke: rgba(255, 255, 255, .22); stroke-width: 1.5; stroke-dasharray: 6 5; }
.cap-box { fill: rgba(0, 0, 0, .12); stroke: rgba(255, 255, 255, .16); stroke-width: 1; }
.cap-label { fill: #F2EEE3; paint-order: stroke; stroke: rgba(0, 0, 0, .35); stroke-width: 3px; }
.cap-label.near { fill: #FFE08A; }
.on-felt { fill: #F2EEE3; }
.on-felt, .reach-head { paint-order: stroke; stroke: rgba(0, 0, 0, .35); stroke-width: 3px; } /* 畳の上でも読めるよう縁取り */
.on-felt.sub { fill: #DCD6C8; }

/* 席の札 */
.strip-box { fill: #FFF8EA; stroke: rgba(0, 0, 0, .3); stroke-width: 1.5; }
.strip.on .strip-box { stroke: #1F2328; stroke-width: 3.5; }
.strip-name, .strip-score { fill: #1F2328; }
.strip-sub { fill: #5B616B; }
.tag rect { fill: #FFFFFF; stroke: #B7791F; stroke-width: 1.5; }
.tag text { fill: #8A5A10; }
.tag.dark rect { fill: #1F2328; stroke: #1F2328; }
.tag.dark text { fill: #FFF8EA; }

/* できかけの役 */
.reach-head { fill: #F2EEE3; }
.pill rect { fill: #FFF3C4; stroke: #1F2328; stroke-width: 1.2; }
.pill text { fill: #1F2328; }
.pill.warn rect { fill: #FFFFFF; stroke: #B23A3A; stroke-width: 2; }
.pill.warn text { fill: #8E2020; }

/* 札 */
.card .ring { fill: none; stroke: none; }
.card .lift { transition: transform 150ms ease-out; }
.card.can .ring { stroke: #F2C230; stroke-width: 4; }
.card.sel .lift { transform: translateY(-16px); }
.card.sel .ring { stroke: #FFFFFF; stroke-width: 5; }
.card.sel .piece { filter: var(--shadow-lift); }
.card.target .ring { stroke: #F2C230; stroke-width: 6; }
.card.target.focus .ring { stroke: #FFFFFF; stroke-width: 6; stroke-dasharray: 8 4; }
.card.dim { opacity: .5; }
.card.clickable { cursor: pointer; }
.card { transition: opacity 150ms; }
.card .flip { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .card .lift { transition: none; } }

/* 役・結果の知らせ（卓の上に重ねる） */
.yaku-box {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: min(94%, 460px); max-height: 74%; overflow: auto;
  background: var(--surface); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; text-align: center;
}
.yaku-box h2 { margin: 0 0 6px; font-size: 1.35rem; }
.yaku-box .yrows { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.yaku-box .yrow { display: flex; align-items: center; gap: 8px; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.yaku-box .yname { font-weight: 800; font-size: 1.1rem; min-width: 5.5em; text-align: left; }
.yaku-box .ycards { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; justify-content: flex-start; }
.yaku-box .ycards img { height: 44px; width: auto; border-radius: 2px; }
.yaku-box .ycards .more { align-self: center; font-size: 14px; color: var(--ink-sub); margin-left: 4px; }
.yaku-box .ypts { font-weight: 800; min-width: 3em; text-align: right; }
.yaku-box .total { font-size: 1.15rem; font-weight: 800; margin: 4px 0; }
.yaku-box .note { color: var(--ink-sub); font-size: 14px; margin: 4px 0 0; }
.yaku-box .controls { justify-content: center; margin-top: 10px; }
.btn.koi { background: #B23A3A; border-color: #B23A3A; color: #FFFFFF; }
@media (max-width: 480px) { .yaku-box { top: 8%; max-height: 88%; padding: 10px; } .yaku-box .ycards img { height: 36px; } }

/* 操作 */
#actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; min-height: var(--tap); align-items: center; }
#actions .note { color: var(--ink-sub); font-size: 14px; }

/* 役の一覧（解説） */
.yaku-table td:first-child { white-space: nowrap; font-weight: 700; }
.howto img[src*="parts"] { max-width: 460px; }
.howto img[src*="turn"], .howto img[src*="score"] { max-width: 600px; }

/* 花札の絵のクレジット */
.site-footer .credit { margin: 0 0 8px; font-size: 14px; }

/* 役の持ち主・精算の表・場の倍率 */
.yaku-box .ywho { font-size: 14px; font-weight: 800; border-left: 5px solid; padding-left: 5px; min-width: 3.6em; text-align: left; }
.yaku-box .yname { min-width: 5em; }
.calc-wrap { overflow-x: auto; margin: 8px 0 4px; }
.calc { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.calc th, .calc td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: right; white-space: nowrap; }
.calc tr > th:first-child { text-align: left; font-weight: 700; color: var(--ink-sub); font-size: 14px; }
.calc .total-row td { font-size: 1.1rem; }
.rate { fill: #FFE08A; }
@media (max-width: 480px) { .calc { font-size: 14px; } .calc th, .calc td { padding: 3px 4px; } }

/* 八八: 手役の札・下げ中の印 */
.pill.te rect { fill: #EAF1F8; stroke: #2F5D8A; stroke-width: 1.5; }
.pill.te text { fill: #1F3F5E; }
.tag.sage rect { fill: #B23A3A; stroke: #B23A3A; }
.tag.sage text { fill: #FFFFFF; }
#actions .btn { white-space: normal; }

/* 役一覧（ゲームの下の折りたたみ） */
details.guide { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 12px; }
details.guide > summary { cursor: pointer; font-weight: 800; padding: 10px 0; min-height: var(--tap); display: flex; align-items: center; }
details.guide h3 { font-size: 1.05rem; margin: 10px 0 4px; }
details.guide .note { color: var(--ink-sub); font-size: 14px; margin: 4px 0; }
.calc.guide td, .calc.guide tr > th:not(:first-child) { text-align: center; }
.calc.guide td.left { text-align: left; white-space: normal; }
.calc.guide td.ok { color: var(--ok); font-weight: 800; }
.calc.guide td.near { color: var(--warn); font-weight: 800; }
.calc.guide td.gone { color: var(--ink-sub); }
.guide-list { margin: 4px 0 8px; padding-left: 1.2em; }
.guide-list li { margin: 4px 0; }
.guide-list .ycards { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.guide-list .ycards img { height: 40px; width: auto; border-radius: 2px; }
details.te-all { margin: 8px 0 12px; }
details.te-all > summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.yaku-box .yname { min-width: 4.5em; }
/* 設定「札の左上に月の数字を出す」をオフにしたとき */
#table.no-mnum .mnum { display: none; }
/* 英語は役の名前が長いので、知らせを折り返す（日本語は共通のまま1行） */
:root:lang(en) .callout { white-space: normal; width: max-content; max-width: 92%; text-align: center; border-radius: 24px; line-height: 1.3; }
/* 英語の役の名前は長いので、名前を折り返して札の並びの幅を残す */
:root:lang(en) .yaku-box .yname { flex: 0 1 9.5em; font-size: 1rem; line-height: 1.25; }
:root:lang(en) .yaku-box .ycards { min-width: 30%; }
:root:lang(en) .yaku-box .ypts { white-space: nowrap; }
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 3; --tb-st-lines: 1; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 3; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
:root:lang(en) .turnbar { --tb-msg-lines: 4; --tb-st-lines: 2; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 3; --tb-st-lines: 2; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
