/* シャリシャリのカード 1 戦(試し 2026-11-20)= 上に相手の手札・まな板・下に自分の手札・横に味の六角
   演出の長さは --spd(1 = ふつう・「動きを減らす」の端末は 0.55 = 短くするだけで止めない)を掛ける */
:root {
  --spd: 1;
  /* 盤の札は 104px より小さくしない(名前と味の字が読める大きさ = 1280×800 と同じ)。背の低い PC の画面では、1 画面に入らない分だけ頁を縦に送る(11-20 伺い 札4 = a) */
  --cell: clamp(104px, calc((100svh - 290px) / 4.9), 124px);
  --hw: calc(var(--cell) * .84);
  --cw: calc(var(--cell) * .66);
  --gap: 8px;
}
.table { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(200px, 1fr); grid-template-rows: auto auto auto;
  align-content: center; column-gap: 40px; row-gap: 14px; padding: 16px 24px; }
/* 長押しで画像の保存・字の選びが出ないように */
.table, .tip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.table button { touch-action: manipulation; }

/* 手札の並び = 持ち主の色のランチョンマット(自分 = 下・みかん色 / 相手 = 上・すみれ色) */
.row { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 16px; border-radius: 20px; transition: opacity .25s; }
.row.me { background: rgba(255, 222, 176, .75); }
.row.cpu { background: rgba(222, 214, 250, .8); }
.row.cpu { grid-row: 1; }
.row.me { grid-row: 3; }
.row:not(.turn) .hand { opacity: .62; }
.hand { display: flex; gap: var(--gap); align-items: flex-end; justify-content: center; transition: opacity .25s; }
.row.me .hand { min-width: calc(var(--hw) * 5 + var(--gap) * 4); min-height: calc(var(--hw) * 4 / 3); }
.row.cpu .hand { min-width: calc(var(--cw) * 5 + var(--gap) * 4); min-height: calc(var(--cw) * 4 / 3); }
.row.cpu .hand .cd { --w: var(--cw); }
/* 数 = 持ち主の色の丸(自分 = 実線の輪・相手 = 点線の輪。札の枠と同じ分け方)。増えると弾む */
.score { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .85); color: #fff; font-size: 36px; line-height: 52px; text-align: center;
  box-shadow: 0 2px 0 rgba(74, 52, 34, .2); }
.row.me .score { background: var(--me); }
.row.cpu .score { background: var(--cpu); border-style: dashed; }
.score.pop { animation: pop calc(420ms * var(--spd)) cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 30% { transform: scale(1.32); } 60% { transform: scale(.92); } }
.row.turn .score:not(.pop) { animation: bob 1.1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* 配る: 手札が 1 枚ずつ入ってくる */
.hand .deal { animation: deal calc(340ms * var(--spd)) cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 70ms * var(--spd)); }
.row.cpu .hand .deal { animation-name: dealc; }
@keyframes deal { from { transform: translateY(40px) rotate(-8deg); opacity: 0; } }
@keyframes dealc { from { transform: translateY(-34px) rotate(8deg); opacity: 0; } }
/* 相手の考える間: 手札が順に揺れる → 選んだ札が持ち上がる */
.row.cpu.thinking .hand > .cd { animation: think .9s ease-in-out infinite; animation-delay: calc(var(--i) * .14s); }
@keyframes think { 50% { transform: translateY(-5px) rotate(-1.5deg); } }
.row.cpu .hand > .cd.chosen { transform: translateY(12px) rotate(3deg) scale(1.08); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--cpu), 0 8px 14px rgba(74, 52, 34, .3); transition: transform .16s, box-shadow .16s; }

/* 自分の手札 */
.slot { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; transition: transform .16s; -webkit-tap-highlight-color: transparent; }
.slot .cd { --w: var(--hw); transition: transform .16s, box-shadow .16s; }
.slot:hover .cd { transform: translateY(-4px); }
.slot[aria-pressed="true"] .cd { transform: translateY(-14px) rotate(-2.5deg); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--me), 0 10px 18px rgba(74, 52, 34, .3); }
.hand .cd[data-owner] .cd-pick { display: none; }
.slot:focus-visible { outline: 3px solid var(--me); outline-offset: 4px; }
.row:not(.turn) .slot { cursor: default; }

/* まな板 */
.board { grid-column: 2; grid-row: 2; position: relative; justify-self: center; display: grid; grid-template-columns: repeat(3, var(--cell)); gap: var(--gap);
  padding: 14px; border-radius: 26px;
  background:
    repeating-linear-gradient(94deg, rgba(150, 100, 45, 0) 0 22px, rgba(150, 100, 45, .07) 22px 24px, rgba(150, 100, 45, 0) 24px 51px),
    linear-gradient(170deg, #eecd9c, #e2b87f);
  box-shadow: inset 0 0 0 3px rgba(130, 86, 38, .22), inset 0 -6px 0 rgba(130, 86, 38, .12), 0 8px 16px rgba(74, 52, 34, .24); }
.board::before { content: ""; position: absolute; right: 16px; top: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--cloth); box-shadow: inset 0 2px 3px rgba(74, 52, 34, .35); }
.board.thud { animation: thud calc(170ms * var(--spd)) ease-out; }
@keyframes thud { 35% { transform: translateY(3px) scale(.996); } }
.cell { position: relative; width: var(--cell); aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 12px; background: rgba(140, 92, 40, .10);
  box-shadow: inset 0 0 0 2px rgba(140, 92, 40, .14); cursor: default; perspective: 700px; -webkit-tap-highlight-color: transparent; }
.cell .cd { --w: var(--cell); position: absolute; inset: 0; }
.cell.front { z-index: 3; }
.board.choosing .cell.empty { cursor: pointer; background: rgba(255, 252, 240, .35); box-shadow: inset 0 0 0 3px rgba(224, 123, 20, .8); animation: pulse 1.3s ease-in-out infinite; }
.board.choosing .cell.empty:hover { background: rgba(255, 252, 240, .7); }
.cell:focus-visible { outline: 3px solid var(--me); outline-offset: 2px; }
/* 置く前に分かる: 取れる数(空いたマス)・取れる相手の数字と勝つ向きの自分の数字はみかん色・マスの上では置いた姿を薄く出す */
.pv-count { position: absolute; left: 50%; top: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; width: calc(var(--cell) * .38); height: calc(var(--cell) * .38);
  margin: calc(var(--cell) * -.19) 0 0 calc(var(--cell) * -.19); border-radius: 50%; border: 3px solid #fff; background: var(--me); color: #fff; font-size: calc(var(--cell) * .2); line-height: 1;
  box-shadow: 0 3px 0 rgba(74, 52, 34, .18); pointer-events: none; animation: pop calc(320ms * var(--spd)) cubic-bezier(.3, 1.6, .5, 1) both; }
.cd-n.pv { background: var(--me); color: #fff; box-shadow: 0 0 0 .9cqw #fff, 0 0 0 2.2cqw var(--me); animation: pvpulse calc(1.1s * var(--spd)) ease-in-out infinite; }
@keyframes pvpulse { 50% { transform: scale(1.12); } }
.cd.pv-ghost { opacity: .78; pointer-events: none; }
.cd.pv-ghost .cd-pick { display: none; }
.cell.drop { background: rgba(255, 244, 222, .9); box-shadow: 0 0 22px 6px rgba(255, 186, 84, .7); transform: scale(1.04); transition: transform .12s; z-index: 1; }
.board.choosing .cell.empty.drop { animation: none; box-shadow: 0 0 22px 6px rgba(255, 186, 84, .7); }
/* 引っぱって置く: 指 / カーソルについて動く札・元の札は薄く */
.hand .slot { touch-action: none; }
.slot.lifted .cd { opacity: .3; transform: none; box-shadow: none; }
.cd.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; margin: 0;
  box-shadow: 0 18px 26px rgba(74, 52, 34, .35), 0 0 0 3px #fff; will-change: transform; }
/* 置けるマスの上では、下の色(取れる数字)が見えるように薄く */
.cd.drag-ghost.over { opacity: .5; }
.cd.drag-ghost.back { transition: transform calc(240ms * var(--spd)) ease-in, opacity calc(240ms * var(--spd)) ease-in; opacity: .4; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 3px rgba(224, 123, 20, .3); } }

/* ① バシッ: 上から叩きつけて、少しつぶれて戻る */
.cd.slam { z-index: 2; animation: slam calc(300ms * var(--spd)) ease-in both; }
@keyframes slam {
  0% { transform: translateY(-34%) scale(1.3) rotate(-7deg); opacity: .25; box-shadow: 0 34px 30px rgba(74, 52, 34, .22); }
  55% { transform: none; opacity: 1; box-shadow: 0 1px 2px rgba(74, 52, 34, .3); animation-timing-function: ease-out; }
  68% { transform: scale(1.04, .95) rotate(1.2deg); }
  84% { transform: scale(.99, 1.02) rotate(-.6deg); }
  100% { transform: none; }
}
/* ② ぶつかる: 置いた札が押し出す・相手が押し返されて揺れる */
.cd.bash { z-index: 3; animation: bash calc(240ms * var(--spd)) cubic-bezier(.3, .7, .4, 1); }
@keyframes bash { 35% { transform: translate(calc(var(--bx) * 10%), calc(var(--by) * 8%)) scale(1.05); } }
.cd.push { animation: push calc(220ms * var(--spd)) ease-out calc(50ms * var(--spd)); }
@keyframes push {
  30% { transform: translate(calc(var(--bx) * 8%), calc(var(--by) * 6%)) rotate(calc(var(--bx) * 5deg + var(--by) * -4deg)); }
  65% { transform: translate(calc(var(--bx) * -2%), calc(var(--by) * -1.5%)) rotate(calc(var(--bx) * -2deg + var(--by) * 1.5deg)); }
}
/* ③ 裏返る: 勢いよく回り(途中で持ち主の色に替わる)、ポンと跳ねて止まる */
.cd.flipy { z-index: 3; animation: flipy calc(380ms * var(--spd)) linear; }
.cd.flipx { z-index: 3; animation: flipx calc(380ms * var(--spd)) linear; }
@keyframes flipy {
  0% { transform: none; animation-timing-function: ease-in; }
  49.9% { transform: translateY(-10%) rotateY(90deg) scale(1.14); box-shadow: 0 18px 18px rgba(74, 52, 34, .25); }
  50% { transform: translateY(-10%) rotateY(-90deg) scale(1.14); animation-timing-function: ease-out; }
  76% { transform: translateY(-3%) rotateY(12deg) scale(1.08); }
  90% { transform: rotateY(-4deg) scale(.97, 1.03); }
  100% { transform: none; }
}
@keyframes flipx {
  0% { transform: none; animation-timing-function: ease-in; }
  49.9% { transform: translateY(-10%) rotateX(90deg) scale(1.14); box-shadow: 0 18px 18px rgba(74, 52, 34, .25); }
  50% { transform: translateY(-10%) rotateX(-90deg) scale(1.14); animation-timing-function: ease-out; }
  76% { transform: translateY(-3%) rotateX(12deg) scale(1.08); }
  90% { transform: rotateX(-4deg) scale(1.03, .97); }
  100% { transform: none; }
}
/* 取られた札: 新しい持ち主の色の輪が広がって消える */
.cd.taken::after { content: ""; position: absolute; inset: -3px; border-radius: 11% / 8.25%; box-shadow: 0 0 0 5px var(--frame); pointer-events: none; opacity: 0;
  animation: taken calc(750ms * var(--spd)) ease-out; }
@keyframes taken { 0% { opacity: 1; transform: scale(.97); } 100% { opacity: 0; transform: scale(1.16); } }
.cd.cheer { animation: cheer calc(520ms * var(--spd)) ease-in-out both; animation-delay: calc(var(--i) * 55ms * var(--spd)); }
@keyframes cheer { 40% { transform: translateY(-12%) rotate(-4deg); } 70% { transform: translateY(2%) scale(1.02, .97); } }
.cd.sweep { animation: sweep calc(260ms * var(--spd)) ease-in forwards; animation-delay: calc(var(--i) * 22ms); }
@keyframes sweep { to { transform: translateY(16%) scale(.82) rotate(4deg); opacity: 0; } }
.cd-n.lose { background: #ece3d4; color: #9c8466; transform: scale(.86); }

/* 演出の部品(盤の上・押せない) */
.fx { position: absolute; z-index: 4; pointer-events: none; }
.fx-ring { border-radius: 12px; box-shadow: 0 0 0 3px rgba(255, 248, 228, .95), 0 0 0 6px rgba(74, 52, 34, .22); animation: ring calc(400ms * var(--spd)) ease-out forwards; }
@keyframes ring { from { transform: scale(.97); opacity: 1; } to { transform: scale(1.24); opacity: 0; } }
.fx-dust { width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%; background: #fff6df; box-shadow: 0 0 0 1px rgba(122, 86, 46, .32);
  animation: dust calc(480ms * var(--spd)) ease-out forwards; }
@keyframes dust { from { transform: none; opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.35); opacity: 0; } }
.fx-hit { transform: translate(-50%, -50%); animation: hit calc(330ms * var(--spd)) ease-out forwards; }
.fx-hit svg { width: 100%; height: 100%; overflow: visible; }
.hit-l path { stroke: #f2b705; stroke-width: 4.5; stroke-linecap: round; }
.hit-c { fill: #fff8d6; stroke: #f2b705; stroke-width: 2.5; }
@keyframes hit { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-12deg); opacity: 1; } 65% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.3) rotate(10deg); opacity: 0; } }
.fx-gain { transform: translate(-50%, -50%); padding: 2px 10px 4px; border-radius: 999px; color: #fff; font-size: calc(var(--cell) * .2); line-height: 1.1; white-space: nowrap;
  border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 2px 0 rgba(74, 52, 34, .2); animation: gain calc(820ms * var(--spd)) ease-out forwards; }
.fx-gain.me { background: var(--me); }
.fx-gain.cpu { background: var(--cpu); border-style: dashed; }
/* おそろい・あわせ・つられ の名前の札(弾んで出て、上へ消える) */
.fx-name { z-index: 7; transform: translate(-50%, -50%); padding: 3px 14px 6px; border-radius: 999px; background: #fff; color: var(--nc); font-size: calc(var(--cell) * .22); line-height: 1.15; white-space: nowrap;
  box-shadow: 0 0 0 3px var(--nc), 0 4px 0 rgba(74, 52, 34, .2); animation: name calc(950ms * var(--spd)) cubic-bezier(.3, 1.5, .5, 1) forwards; animation-delay: calc(var(--k, 0) * 90ms * var(--spd)); }
.fx-name.same { --nc: #c98500; }
.fx-name.sum { --nc: #13897f; }
.fx-name.chain { --nc: #c2410c; font-size: calc(var(--cell) * .18); }
@keyframes name { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-12deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.25) rotate(4deg); opacity: 1; } 40% { transform: translate(-50%, -50%) scale(.95) rotate(-2deg); } 80% { transform: translate(-50%, -62%); opacity: 1; } 100% { transform: translate(-50%, -85%); opacity: 0; } }
@keyframes gain { 0% { transform: translate(-50%, -20%) scale(.4); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -130%) scale(1); opacity: 0; } }

/* 終わり: 大きな字と数(盤の色は透かして見せる) */
/* 上から 字 → 数の丸 → シャリー / シャリオと吹き出し → もう1戦 の 1 列に並べる(重ならない・押し物はいつも下に見える) */
.end { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--cell) * .1); padding: 10px; border-radius: 26px;
  background: rgba(255, 250, 238, .62); animation: fade calc(300ms * var(--spd)); }
.end[hidden] { display: none; }
.end b { font-weight: 400; font-size: calc(var(--cell) * 1.02); line-height: 1; letter-spacing: .02em;
  text-shadow: 0 0 1px #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 3px 0 #fff, 0 -3px 0 #fff, 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 0 6px 0 rgba(74, 52, 34, .18);
  animation: word calc(620ms * var(--spd)) cubic-bezier(.3, 1.5, .5, 1) both; }
.end b { order: 1; }
.tally { order: 2; }
.pal { order: 3; }
.again { order: 4; }
.end.win b { color: var(--me); }
.end.lose b { color: var(--cpu); font-size: calc(var(--cell) * .8); animation-name: wordsoft; }
@keyframes word { 0% { transform: scale(.2) rotate(-10deg); opacity: 0; } 55% { transform: scale(1.22) rotate(3deg); opacity: 1; } 75% { transform: scale(.93) rotate(-1deg); } 100% { transform: none; } }
@keyframes wordsoft { 0% { transform: translateY(-20px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.tally { display: flex; gap: calc(var(--cell) * .3); align-items: center; }
.tally span { width: calc(var(--cell) * .66); height: calc(var(--cell) * .66); border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9); color: #fff;
  font-size: calc(var(--cell) * .4); line-height: calc(var(--cell) * .66 - 8px); text-align: center; box-shadow: 0 3px 0 rgba(74, 52, 34, .2);
  animation: pop calc(420ms * var(--spd)) cubic-bezier(.3, 1.6, .5, 1) both; }
.tally .t-me { background: var(--me); animation-delay: calc(260ms * var(--spd)); }
.tally .t-cpu { background: var(--cpu); border-style: dashed; animation-delay: calc(380ms * var(--spd)); }
@keyframes fade { from { opacity: 0; } }
.again { position: relative; z-index: 2; padding: 10px 28px 12px; border: 0; border-radius: 999px; background: var(--go); color: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 3px 0 #356e28; }
.again:active { transform: translateY(2px); box-shadow: 0 1px 0 #356e28; }
/* シャリーかシャリオの一言(今ある絵だけ) */
.pal { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; pointer-events: none;
  animation: palin calc(520ms * var(--spd)) cubic-bezier(.3, 1.4, .5, 1) calc(480ms * var(--spd)) both; }
.pal img { display: block; flex: none; width: calc(var(--cell) * .8); filter: drop-shadow(0 3px 0 rgba(74, 52, 34, .18)); }
.end.lose .pal img { width: calc(var(--cell) * .66); }
/* 吹き出しは絵の左に置き、しっぽを絵へ向ける */
.say { order: -1; position: relative; margin-bottom: calc(var(--cell) * .2); padding: 6px 14px 8px; border-radius: 18px; background: #fff; color: var(--ink); font-size: calc(var(--cell) * .17); line-height: 1.2; white-space: nowrap;
  box-shadow: 0 0 0 2px rgba(74, 52, 34, .3), 0 3px 0 rgba(74, 52, 34, .12); }
.say::after { content: ""; position: absolute; right: -16px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-left: 11px solid #fff; filter: drop-shadow(1.5px 0 0 rgba(74, 52, 34, .3)); }
@keyframes palin { from { transform: translateY(40%) rotate(8deg); opacity: 0; } }
.end.win .pal img { animation: hop .7s ease-in-out calc(1000ms * var(--spd)) 3; }
@keyframes hop { 40% { transform: translateY(-9%) rotate(-3deg); } }
/* 紙吹雪と湯気(勝った時) */
.party { position: absolute; inset: 0; z-index: 6; overflow: hidden; border-radius: 26px; pointer-events: none; }
.cf { position: absolute; top: -8%; width: var(--w); height: calc(var(--w) * .62); background: var(--c); border-radius: 2px; box-shadow: 0 0 0 1px rgba(74, 52, 34, .2);
  animation: fall calc(var(--du) * var(--spd)) cubic-bezier(.3, .2, .6, 1) var(--dl) both; }
.cf1 { border-radius: 50%; height: var(--w); }
.cf2 { height: calc(var(--w) * .3); border-radius: 3px; }
@keyframes fall { from { transform: translateY(0) rotate(var(--r)); opacity: 1; } 85% { opacity: 1; } to { transform: translate(var(--sx), calc(var(--cell) * 4.4)) rotate(calc(var(--r) + 540deg)); opacity: 0; } }
.steam { position: absolute; bottom: 4%; width: calc(var(--cell) * .3); height: calc(var(--cell) * .9); overflow: visible; opacity: 0;
  animation: steam calc(1.9s * var(--spd)) ease-out var(--dl) both; }
.steam path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 1px rgba(74, 52, 34, .35)); }
@keyframes steam { 0% { transform: translateY(20%) scaleY(.6); opacity: 0; } 30% { opacity: .95; } 100% { transform: translateY(-70%) scaleY(1.1); opacity: 0; } }

/* 横 = 味の六角と引き立て・強さ・音 */
.side { grid-column: 3; grid-row: 1 / 4; align-self: center; justify-self: start; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 200px; }
.hx { width: 170px; height: 170px; display: block; }
.side.off .hx-e { opacity: .14; stroke-dasharray: 2 7; }
.hx-e.lit { stroke: var(--hk); opacity: 1; stroke-width: 7; }
.hx-v.lit circle { transform: scale(1.22); stroke: var(--hk); stroke-width: 4; }
.rules { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.sw { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 0; border-radius: 999px; background: rgba(255, 252, 244, .8);
  box-shadow: inset 0 0 0 2px rgba(74, 52, 34, .18); font-size: 20px; white-space: nowrap; cursor: pointer; }
.sw i { position: relative; width: 44px; height: 26px; border-radius: 13px; background: #cdbda4; transition: background .2s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.sw[aria-checked="true"] i { background: var(--hk); }
.sw[aria-checked="true"] i::after { transform: translateX(18px); }
.sw:focus-visible { outline: 3px solid var(--hk); outline-offset: 3px; }
.lv { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 252, 244, .8); box-shadow: inset 0 0 0 2px rgba(74, 52, 34, .18); white-space: nowrap; }
.lv button { padding: 5px 14px 7px; border: 0; border-radius: 999px; background: none; font-size: 17px; cursor: pointer; color: var(--ink2); }
.lv button[aria-checked="true"] { background: var(--ink); color: #fff; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; align-items: center; white-space: nowrap; }
.redo { padding: 6px 16px 8px; border: 0; border-radius: 999px; background: rgba(255, 252, 244, .8); box-shadow: inset 0 0 0 2px rgba(74, 52, 34, .18); font-size: 18px; cursor: pointer; color: var(--ink); text-decoration: none; }
.snd { width: 40px; height: 40px; padding: 4px; border: 0; border-radius: 50%; background: rgba(255, 252, 244, .8); box-shadow: inset 0 0 0 2px rgba(74, 52, 34, .18); cursor: pointer; }
.snd svg { width: 100%; height: 100%; display: block; }
.snd .sp { fill: var(--ink); }
.snd .wv, .snd .no { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.snd .no { display: none; }
.snd[aria-pressed="false"] .wv { display: none; }
.snd[aria-pressed="false"] .no { display: inline; }
.snd[aria-pressed="false"] .sp { fill: var(--ink2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 札の効果(カーソル / 長押し)。説明の字はこの札の中だけ */
.tip { position: fixed; z-index: 50; width: 236px; padding: 12px 14px 12px; border-radius: 14px; background: #fffaf0 var(--noise); color: var(--ink); font-family: var(--hand);
  box-shadow: 0 0 0 2px rgba(74, 52, 34, .28), 0 10px 20px rgba(74, 52, 34, .25); pointer-events: none; animation: tipin .14s ease-out; }
.tip[hidden] { display: none; }
@keyframes tipin { from { transform: translateY(4px); opacity: 0; } }
.tip p { margin: 8px 0 0; font-size: 15px; line-height: 1.4; }
.tp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-h b { font-weight: 400; font-size: 21px; line-height: 1.2; }
.tp-t { display: inline-block; padding: 1px 9px 3px; border-radius: 999px; background: var(--t, #999); color: #fff; font-size: 14px; line-height: 1.3; white-space: nowrap; }
.tp-t.all { background: conic-gradient(#2f86c9 0 60deg, #e2679a 0 120deg, #c49500 0 180deg, #1f8a70 0 240deg, #e2752b 0 300deg, #b5302f 0); text-shadow: 0 0 2px rgba(0, 0, 0, .5); }
.tp-t.none { background: none; color: var(--ink2); box-shadow: inset 0 0 0 1.5px rgba(74, 52, 34, .45); }
.tp-n { display: grid; grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(3, 26px); justify-content: center; margin-top: 8px; }
.tp-n i { font-style: normal; display: block; width: 28px; height: 28px; border-radius: 50%; background: #fffdf7; box-shadow: 0 0 0 1.5px rgba(74, 52, 34, .45); text-align: center; font-size: 18px; line-height: 28px; }
.tp-n .u { grid-area: 1 / 2; } .tp-n .r { grid-area: 2 / 3; } .tp-n .d { grid-area: 3 / 2; } .tp-n .l { grid-area: 2 / 1; }
.tp-hk { display: flex; align-items: center; gap: 6px; }
.tp-hk .pl { color: var(--hk); font-size: 17px; }
.tp-hk.off { opacity: .4; }
.tp-sp { color: var(--ink); }
.tp-say { color: var(--ink2); }


/* 中くらいの幅(窓を半分にした PC・タブレットの縦): 横の列を下へ送る(横に揺れない) */
@media (min-width: 761px) and (max-width: 1100px) {
  .table { grid-template-columns: 1fr; }
  .row, .board, .side { grid-column: 1; }
  .row { justify-self: center; }
  .side { grid-row: 4; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; width: auto; justify-self: stretch; gap: 12px 18px; }
  .rules { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .hx { width: 96px; height: 96px; }
}

/* スマホ: 1 列(相手の手札・まな板・自分の手札・六角) */
@media (max-width: 760px) {
  :root {
    /* 高さは 相手の手札・まな板・自分の手札 だけで取る(六角とボタンは下へ送ってよい = Safari の帯が出た 664 でも札の名前が出る大きさ) */
    --cell: min(calc((100vw - 32px - 28px - 16px) / 3), calc((100svh - 254px) / 4));
    --hw: calc((100vw - 32px - 16px - 54px - 4 * var(--gap)) / 5);
    --cw: calc((100vw - 32px - 16px - 54px - 4 * var(--gap)) / 5 * .82);
    --gap: 6px;
  }
  .table { grid-template-columns: 1fr; row-gap: 12px; padding: 12px 16px 16px; align-content: start; }
  .row, .board, .side { grid-column: 1; }
  .row { gap: 10px; justify-content: space-between; padding: 6px 8px; border-radius: 16px; }
  .row.cpu { justify-content: space-between; }
  .score { width: 44px; height: 44px; font-size: 27px; line-height: 38px; }
  .board { padding: 14px; border-radius: 20px; }
  .end, .party { border-radius: 20px; }
  .end { gap: 8px; }
  .row.me .hand, .row.cpu .hand { justify-content: flex-start; }
  .side { grid-row: 4; flex-direction: row; flex-wrap: wrap; justify-content: center; width: auto; justify-self: stretch; gap: 10px 14px; margin-top: 4px; }
  .links { order: -1; flex-basis: 100%; justify-content: center; }   /* 配りなおす・カード・音を、手札のすぐ下に(最初の画面で音を消せる) */
  .hx { width: 66px; height: 66px; }
  .rules { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .sw { font-size: 16px; gap: 8px; padding: 5px 12px 5px 5px; }
  .lv button { font-size: 16px; padding: 5px 12px 7px; }
  .redo { font-size: 15px; padding: 6px 11px 8px; }
  .tip { width: 214px; }
}
