/* 色の組（2026-10-23 持ち主の指示: トランプ・カジノのシリーズは「明るく落ち着いた地」にそろえる）。
   地 #E9E8E3・墨色の文字 #1E2B27・薄い文字 #5C6660・主なボタン えんじ #8E3B2E に白い字。2 つ目以降のボタンは細い線（線と文字 #1E2B27、地は透明）。
   卓は全カードゲーム共通の緑（cards-common.js）、札の裏も今のまま。角丸 6px まで・影なし・グラデーションなし */
:root{--bg:#E9E8E3;--ink:#1E2B27;--sub:#5C6660;--accent:#8E3B2E;--accent-ink:#FFFFFF;--line:#C4C1B8;--chipbg:#DEDCD5;
  --hi:#F4F1EA;/* 卓（緑）の上で取れる札を囲む線。緑の上で目立つ明るい色 */
  --mincho:"Shippori Mincho B1","Hiragino Mincho ProN","Yu Mincho",serif}
html,body{margin:0}
body{-webkit-tap-highlight-color:transparent}
/* 遊ぶ画面の地もホームと同じ。結果の幕・小さなウィンドウ・遊び方の図の地も同じ組 */
html .shell-stage,.hf-room,.hf-lay,.hf-bar,.hf-acts,.hf-ref,.hf-pn,.hf-ov{--ui-display:var(--mincho);--ui-body:var(--mincho);--ui-shade:rgba(233,232,227,.97);--ui-chip:var(--chipbg);--ui-card:var(--bg);--ui-paper:var(--bg);--ui-soft:var(--line);
  --ui-red:var(--accent);--ui-red-ink:var(--accent-ink);--ui-ink:var(--ink);--ui-sub:var(--sub)}
html .shell-stage,.hf-room{background:var(--bg)}
/* 2 つ目以降のボタン（相手をさがす・下の段・帯・閉じる など）は細い線。outline なので大きさは変わらない */
.shell-stage .ui-btn.sub,.hf-bar .ui-btn.sub,.hf-acts .ui-btn.sub,.hf-ov .ui-btn.sub,.hf-ref .ui-btn.sub,.hf-pn .ui-btn.sub{background:transparent;color:var(--ink);box-shadow:none;outline:1.5px solid var(--ink);outline-offset:-1.5px}
.sh-tabs button[aria-selected="true"]{color:var(--bg)}
.sh-box header{border-bottom:1px solid var(--line);padding-bottom:12px}
.hf-bar{background:var(--bg)}
/* 一言の帯: 地の色に墨色の字。自分の番はえんじに白い字。手番の席は細い線（影は使わない） */
.hf-lay .cd-say{background:var(--bg);color:var(--ink)}
.hf-lay .cd-say.me{background:var(--accent);color:var(--accent-ink)}
.hf-lay .cd-say .cd-think{margin-left:10px;font-size:18px;color:var(--sub)}
.hf-lay .cd-seat.turn{box-shadow:none;outline:3px solid var(--hi);outline-offset:-3px}
/* ホームの背景: シリーズ共通のごく薄い菱形の線（#DEDCD5） */
.hf-bd{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
.hf-ov[hidden],.hf-ref[hidden]{display:none}

/* 卓は共通の T.layout（cards-common.js。緑の卓・上に相手の席・真ん中に場・一言の帯・下に手札・右下に操作）。
   卓・席・一言・手札の置き場の見た目は共通のまま。ここは中に置く花札の札と、出し入れ（hidden）だけ */
.hf-lay{user-select:none;-webkit-user-select:none}
.cd-layout.hf-lay[hidden]{display:none}
.cd-seat .back{width:30px;height:46px}
.cd-hand .card,.cd-hand .back.big{width:var(--cd-w);height:calc(var(--cd-w) * 1.625)}
/* 手札は 1 枚ずつ同じ幅の置き場（.hf-hs）に入れ、置き場ごと押せる（横は 8 枚で 1 列、縦は 4 枚ずつ 2 段。押せる幅は横 約127px・縦 約164px） */
.cd-hand{flex-wrap:wrap;align-content:flex-end;row-gap:8px}
.hf-hs{flex:none;width:var(--hf-slot,12.5%);display:flex;justify-content:center;align-items:flex-end}
.hf-port .cd-hand{min-height:calc(var(--cd-w) * 3.25 + 8px);padding-top:14px}
.cd-hand.mine .hf-hs{cursor:pointer}
/* 相手の番・返事を待つ間は、手札を薄くして押せないと分かるように（出した札だけ上がったまま） */
.cd-hand.idle .card:not(.sel){filter:saturate(.45) brightness(.62)}
/* 部屋には共通の帯が無いので、同じ位置に帯と右下の操作の置き場（shell.bar と同じ大きさ） */
.hf-bar{position:absolute;left:0;right:0;top:0;height:64px;display:flex;align-items:center;gap:16px;padding:0 20px;box-sizing:border-box;z-index:20;color:var(--ink);font-family:var(--mincho)}
.hf-bar b{font-size:24px;font-weight:700}
.hf-info{font-size:20px;color:var(--sub);white-space:nowrap}
.hf-tools{margin-left:auto;display:flex;gap:10px}
.hf-acts{position:absolute;right:20px;bottom:20px;display:flex;gap:12px;z-index:20}
.hf-lay.hf-port~.hf-acts{left:20px;justify-content:flex-end}
/* デモ（ホームの絵）は帯と右下の操作が無いので、卓を箱いっぱいに */
.hf-demo .cd-layout.cd-table{left:8px;right:8px;top:8px;bottom:8px}

/* 札 */
.card{position:relative;flex:none;box-sizing:border-box;width:64px;height:104px;background:#2b211b;padding:2px;border-radius:4px;transition:transform .12s}
.card svg{display:block;width:100%;height:100%;border-radius:2px}
.card .mo{position:absolute;left:3px;top:3px;display:flex;align-items:baseline;gap:2px;background:rgba(255,255,255,.93);color:var(--ink);font:800 13px/1 var(--mincho);padding:2px 3px;border-radius:2px}
.card .mo i{font-style:normal;font-size:10px;font-weight:700}
.nolabel .card .mo{display:none}
.tg{position:absolute;left:2px;right:2px;bottom:2px;font:700 12px/17px sans-serif;text-align:center;white-space:nowrap;overflow:hidden;border-radius:2px;pointer-events:none}
.tg.me{background:var(--accent);color:var(--accent-ink)}
.tg.op{background:var(--bg);color:var(--ink);outline:1px dashed var(--ink);outline-offset:-1px}
.tg.me+.tg.op{bottom:21px}
.tg i{font-style:normal;margin-right:2px;padding:0 2px;border-right:1px solid currentColor}
.back{display:block;box-sizing:border-box;width:36px;height:56px;border-radius:3px;background:#3a2219;border:2px solid #7a3a26;flex:none}
.back.big{width:78px;height:127px}

/* 場（L.field の中）: 横は 場札｜相手の取り札・自分の取り札、縦は 相手の取り札／場札／自分の取り札。地は共通の緑の卓のまま */
.hf-fd{position:absolute;inset:0;display:grid;gap:8px;grid-template-columns:minmax(0,1fr) 400px;grid-template-rows:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"mat ctop" "mat cbot"}
.hf-port .hf-fd{grid-template-columns:minmax(0,1fr);grid-template-rows:160px minmax(0,1fr) 160px;grid-template-areas:"ctop" "mat" "cbot"}
.hf-fd .ctop{grid-area:ctop}.hf-fd .cbot{grid-area:cbot}
.mat{grid-area:mat;display:flex;gap:12px;padding:12px;box-sizing:border-box;min-height:0}
.pile{display:flex;flex-direction:column;gap:10px;flex:none}
.deck{box-sizing:border-box;width:64px;height:104px;border-radius:4px;background:#3a2219;border:3px solid #7a3a26;display:flex;align-items:center;justify-content:center;color:#e9cfa0;font-size:15px;font-weight:700}
.slot{box-sizing:border-box;width:64px;height:104px;border:1px dashed rgba(255,235,200,.5);border-radius:4px}
.slot .card{margin:-1px}
.field{flex:1;display:flex;flex-wrap:wrap;gap:8px;align-content:flex-start}
.field.place{outline:2px dashed rgba(255,240,200,.75);outline-offset:4px;cursor:pointer}
.field.many{gap:6px 8px}
.field.many .card{width:48px;height:78px}
/* 縦の枠は手札が 2 段なので、場札と山を少し小さく */
.hf-port .field:not(.many) .card,.hf-port .deck,.hf-port .slot,.hf-port .slot .card{width:54px;height:88px}
.hf-port .grp{min-height:45px}
/* 取れる札は緑の卓の上で目立つ明るい線で囲む（影やぼかしの光は使わない）。押せる札はえんじと交互に点滅 */
.card.can{outline:3px solid var(--hi)}
/* 選んだ札は少し上がって明るい枠 */
.card.sel{transform:translateY(-14px);outline:3px solid var(--hi)}
.card.hit{cursor:pointer;outline:4px solid var(--hi);animation:pulse .8s ease-in-out infinite alternate}
.card.cand{outline:3px solid rgba(255,248,230,.8)}
.card.dim{filter:saturate(.5) brightness(.78)}
@keyframes pulse{to{outline-color:var(--accent)}}

/* 取り札（場の中。4 種類を 2×2 に並べる） */
.caps{background:var(--bg);color:var(--ink);border-radius:4px;padding:8px;display:flex;flex-direction:column;gap:4px;min-height:0;min-width:0;box-sizing:border-box;overflow:hidden}
/* 名前は長いと文字を小さくして収める。点・こいこい・親は縮めない */
.ch{display:flex;gap:8px;align-items:baseline;min-width:0}
.ch b{font-size:16px;white-space:nowrap;overflow:hidden;min-width:0;flex:0 1 auto}
.ch span{flex:none;white-space:nowrap}
.ch .pt{font-weight:800;color:var(--accent)}
.ch .koi{background:var(--accent);color:var(--accent-ink);font-size:14px;padding:1px 6px;border-radius:2px}
.ch .oya{border:1px solid var(--ink);font-size:14px;padding:0 4px}
.grps{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px 12px}
.grp{display:flex;align-items:center;gap:6px;min-height:47px;min-width:0}
.grp i{font-style:normal;font-size:14px;width:30px;color:var(--sub);flex:none}
.gc{display:flex;flex:1;min-width:0;align-items:center}
.gc .card{width:28px;height:45px;padding:1px;border-radius:2px}
/* 横の枠は場の高さが少ないので、4 種類を横 1 列に（種類の名前は札の上） */
.hf-lay:not(.hf-port) .grps{grid-template-columns:repeat(4,minmax(0,1fr));gap:2px 8px}
.hf-lay:not(.hf-port) .grp{flex-direction:column;align-items:stretch;gap:2px;min-height:0}
.hf-lay:not(.hf-port) .grp i{width:auto;line-height:1.2}
.hf-lay:not(.hf-port) .gc{min-height:45px}
.chips{display:flex;flex-wrap:wrap;gap:4px;max-height:24px;overflow:hidden}
.chip{font-size:14px;padding:1px 6px;color:var(--ink);background:var(--chipbg);border-radius:2px;white-space:nowrap}
.chip.near{color:var(--accent);font-weight:700}
.chip.done{background:var(--accent);color:var(--accent-ink);font-weight:700}

/* 幕 */
.hf-ov{position:absolute;inset:0;z-index:20;background:rgba(233,232,227,.97);color:var(--ink);border-radius:inherit;display:flex;align-items:center;justify-content:center;box-sizing:border-box;overflow:auto}
.ban{text-align:center;padding:24px;max-width:92%;box-sizing:border-box;min-width:0}
.ban .by{font-size:18px;color:var(--sub);margin-bottom:6px;white-space:nowrap;overflow:hidden}
.ban .big{font:800 64px/1.15 var(--mincho);letter-spacing:.12em;color:var(--ink);white-space:nowrap;overflow:hidden}
.ban .koih{color:var(--accent)}
.ban .cs{display:flex;gap:10px;justify-content:center;margin:18px 0 10px;flex-wrap:wrap}
.ban .cs .card{width:72px;height:117px;animation:fly .55s cubic-bezier(.2,.8,.3,1.2) both}
@keyframes fly{from{transform:translateY(90px) rotate(-16deg) scale(.5);opacity:0}}
.ban .pts{font-size:18px;font-weight:700;color:var(--accent)}
.ban .q{margin:14px 0 0;font-size:18px;line-height:1.7}
.ban .q b{color:var(--accent)}
.nm{display:flex;gap:8px;justify-content:center;margin-top:14px;flex-wrap:wrap}
.nm .ui-input{width:220px;max-width:100%}
.btns{display:flex;gap:12px;justify-content:center;margin-top:14px;flex-wrap:wrap}
.res ul{list-style:none;padding:0;margin:10px auto;width:280px;font-size:17px}
.res li{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:4px 0}
.sc2{display:flex;gap:28px;justify-content:center;font-size:18px;margin-top:10px;flex-wrap:wrap}
.sc2 b{font-size:26px;color:var(--accent)}
.setup .rules,.hf-rbox,.hf-obox{display:flex;flex-direction:column;gap:8px}
.setup .rules{margin:16px auto 0;align-items:flex-start}
.rrow{display:flex;align-items:center;gap:12px}
.rl{width:120px;text-align:right;font-weight:700;flex:none}
.ro{display:flex;gap:6px;flex-wrap:wrap}

/* 札と役の一覧（部屋の卓の中と、小さなウィンドウの中） */
.hf-ref{position:absolute;inset:0;z-index:30;background:var(--bg);color:var(--ink);border-radius:inherit;display:flex;flex-direction:column;padding:12px 16px;box-sizing:border-box}
.refhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:20px}
.hf-ref .refbody{overflow:auto;flex:1}
.refm{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 16px}
.hf-port .refm{grid-template-columns:repeat(2,1fr)}
.rm{display:flex;gap:6px;align-items:flex-start}
.rm>b{width:48px;font-size:16px;display:flex;flex-direction:column;flex:none}
.rm>b span{font-size:14px;color:var(--accent)}
.rm figure{margin:0;width:54px;text-align:center}
.rm figure .card{width:48px;height:78px;margin:0 auto}
.rm figcaption{font-size:11px;line-height:1.2;margin-top:3px}
.refy{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 20px;margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.hf-port .refy{grid-template-columns:1fr}
.ry{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;padding:6px 0;border-bottom:1px solid var(--line)}
.ry b{font-size:17px;min-width:96px}
.ry .rp{color:var(--accent);font-weight:700;min-width:52px}
.ry .rc{display:flex;gap:3px}
.ry .rc .card{width:30px;height:49px;padding:1px}
.ry .rd{font-size:14px;color:var(--sub)}
.ry.off{opacity:.45}

/* ホームの絵：CPU 同士のデモ（本番の卓を縮めて流す。押しても何も起きない） */
.hf-demo{position:absolute;left:0;top:0;transform-origin:0 0;overflow:hidden;pointer-events:none;font-family:var(--mincho);color:var(--ink);user-select:none;-webkit-user-select:none}
.hf-demo *{pointer-events:none}

/* 遊び方の図（guide.js）。本番の札を 260×160 に並べ、赤い丸と矢印で指す */
.hf-gd{position:absolute;left:50%;top:50%;width:260px;height:160px;margin:-80px 0 0 -130px;font-family:var(--mincho);color:var(--ink);background:var(--bg);pointer-events:none}
.hf-gd .card{animation:none;transition:none}
/* 卓の図は本番と同じ共通の緑の卓（cards-common.js の色）。場札の置き場は枠だけ */
.hf-gd.tb{background:#2f6b4f;color:#f4f1ea}
.hf-gd .gm{position:absolute;border:1px solid rgba(255,255,255,.3);border-radius:4px;box-sizing:border-box}
.hf-gd.tb .gt.s{color:#f4f1ea}
.hf-gd .gt{position:absolute;font-size:15px;font-weight:700;line-height:1.2;white-space:nowrap}
.hf-gd .gt.c{transform:translateX(-50%)}
.hf-gd .gt.s{font-size:13px;color:var(--sub)}
.hf-gd .gt.w{color:#f3e2c4}
.hf-gd .gt.r{color:var(--accent)}
.hf-gd .gdk{position:absolute;box-sizing:border-box;width:38px;height:62px;border-radius:3px;background:#3a2219;border:2px solid #7a3a26}
.hf-gd .gsp{position:absolute;box-sizing:border-box;width:38px;height:62px;border:1.5px dashed rgba(255,235,200,.8);border-radius:4px}
.hf-gd .gb{position:absolute;box-sizing:border-box;width:96px;height:38px;line-height:36px;text-align:center;font-size:17px;font-weight:700;border:1.5px solid var(--accent);border-radius:4px;background:var(--accent);color:var(--accent-ink)}
.hf-gd .gb.sub{background:transparent;color:var(--ink);border-color:var(--ink)}
.hf-gd .gs{position:absolute;left:30px;width:200px;display:flex;justify-content:space-between;font-size:18px;border-bottom:1px solid var(--line);padding:2px 4px;box-sizing:border-box}
.hf-gd .gs b{color:var(--accent)}
.hf-gd .gk{position:absolute;box-sizing:border-box;height:24px;line-height:21px;text-align:center;font:700 13px/21px sans-serif;background:var(--bg);color:var(--ink);border:1.5px solid var(--sub);border-bottom-width:3px;border-radius:4px}
/* 卓の図（本番と同じ並び）: 上の相手の席・一言の帯 */
.hf-gd .gse,.hf-gd .gsy{position:absolute;box-sizing:border-box;height:16px;line-height:16px;font-size:11px;text-align:center;white-space:nowrap;color:#f4f1ea;border-radius:3px}
.hf-gd .gse{left:70px;top:2px;width:120px;background:rgba(0,0,0,.25)}
.hf-gd .gsy{left:6px;top:90px;width:248px;font-weight:700;background:var(--accent)}
.hf-gd .card.hit{animation:none}
.hf-gd .card.sel{transform:none}
.hf-gd .mk{position:absolute;left:0;top:0;overflow:visible;fill:none;stroke:var(--accent);stroke-width:3.5;paint-order:stroke}
.hf-gd .mk .hd{fill:var(--accent)}
/* 緑の卓の図では、えんじは沈むので印と強調の字は明るい線にする */
.hf-gd.tb .mk{stroke:var(--hi)}
.hf-gd.tb .mk .hd{fill:var(--hi)}
.hf-gd.tb .gt.r{color:var(--hi)}

/* 小さなウィンドウ（shell.panel）の中身：詳しく・設定・記録 */
.hf-pn{font-family:var(--mincho);color:var(--ink);font-size:17px;line-height:1.6}
.hf-pn p{margin:4px 0 12px}
.hf-pn h3{margin:20px 0 10px}
.hf-row{display:flex;gap:8px;flex-wrap:wrap}
.hf-lead{color:var(--sub)}
.hf-pn .rrow{flex-wrap:wrap;gap:8px 12px}
.hf-pn .rl{width:110px}
.hf-pn .refm{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.hf-pn .rm figure{width:50px}
.hf-pn .rm figure .card{width:44px;height:72px}
.hf-pn .refy{grid-template-columns:1fr}
.hf-pn .card{animation:none}
/* オンラインの入口は共通部品の見た目のまま。縮めて中身を重ねない。誰もいないうちは［相手をさがす］を出さず、人数だけ薄く */
/* 入口の箱は自分の重なりの中に閉じ込め（z-index:0）、下の段のボタンはそれより手前に置く（入口が伸びても、中の説明文や箱が下の段の ui-btn sub にかぶらない。起動時の covered-error） */
.sh-room{flex:none;position:relative;z-index:0}
.sh-home .sh-foot{flex:none;position:relative;z-index:3}
/* 下の段は 4 つ（遊び方・設定・記録・詳しく）。ボタンの大きさは共通のまま、収まらなければ折り返す（文字は切らない） */
.sh-home .sh-foot{flex-wrap:wrap;gap:8px}
.sh-room.hf-none [data-find]{display:none}
.sh-room.hf-none [data-count]{color:var(--ui-sub)}
/* 結果に足す行（役の集まり） */
.hf-rx{display:flex;flex-direction:column;align-items:center;gap:4px;max-width:640px;font-family:var(--mincho)}
.hf-link{background:none;border:0;padding:0 0 0 10px;font:inherit;color:var(--accent);text-decoration:underline;cursor:pointer}
.torec{font-size:15px;margin:6px 0 0;text-align:center}
.hf-big{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.hf-big div{border-top:2px solid var(--accent);padding:8px 4px;display:flex;flex-direction:column}
.hf-big span{font-size:17px;color:var(--sub)}
.hf-big b{font-size:44px;line-height:1.15;color:var(--accent);white-space:nowrap}
.hf-big small{font-size:20px;margin-left:4px;color:var(--ink)}
.hf-sm{margin:8px 0 0;font-size:16px;color:var(--sub)}
.hf-note{color:var(--sub);margin:20px 0 8px}
.hf-yk{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.hf-yk span{border-bottom:1px solid var(--line);padding:6px 4px;display:flex;justify-content:space-between;gap:6px;color:var(--sub);font-size:16px;white-space:nowrap}
.hf-yk span.got{border-bottom:2px solid var(--accent);color:var(--ink)}
.hf-yk b{font-weight:700}
