/* DOCCHI（PLAYROOM No.18）の画面。見た目はデザイン「ふせ札」v2（game-lab/geister/visual/d1/v2/screens.html から写した） */
:root {
  --bg: #D3E8F7; --well: #FFF8EC; --num: #BBD7EE;
  --o: #FF8A3D; --oD: #D9601A; --n: #1C2B4A; --nD: #0B1428; --ai: #6176B4; --cream: #FFFCF4; --red: #C83A3A;
  --green: #A8E08A; --fuji: #C3B5F5; --line: #B7D2EA;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--n);
  font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  word-break: keep-all; overflow-wrap: anywhere; line-break: strict;
  -webkit-tap-highlight-color: transparent;
}
body { overflow: hidden; }
button { font-family: inherit; color: inherit; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.dela { font-family: 'Dela Gothic One', sans-serif; font-weight: 400; }
.nw { white-space: nowrap; }
/* 2つ並べた .nw のあいだで折れるように、1つずつを箱にする（WebKit は nowrap どうしのあいだで折ってくれない） */
span.nw { display: inline-block; max-width: 100%; }
#app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* ボタン（下に厚みのある PLAYROOM のボタン） */
.btn {
  flex: 1; min-height: 52px; border: 0; border-radius: 16px; padding: 0 12px;
  font: 900 18px 'Zen Maru Gothic'; display: flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; cursor: pointer; color: var(--n); background: var(--cream); box-shadow: 0 6px 0 var(--line);
  transition: transform .06s linear, box-shadow .06s linear;
}
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--line); }
.btn.pri { background: var(--n); color: var(--cream); box-shadow: 0 6px 0 var(--nD); }
.btn.pri:active:not(:disabled) { box-shadow: 0 1px 0 var(--nD); }
.btn.org { background: var(--o); color: var(--n); box-shadow: 0 6px 0 var(--oD); }
.btn.org:active:not(:disabled) { box-shadow: 0 1px 0 var(--oD); }
.btn.shine { box-shadow: 0 6px 0 var(--oD), 0 0 0 5px var(--bg), 0 0 0 10px rgba(255,138,61,.5); }
.btn.line { background: #06C755; color: #fff; box-shadow: 0 6px 0 #04893B; }
.btn.big { min-height: 60px; font-size: 20px; }
.btn.small { min-height: 44px; font-size: 15px; border-radius: 12px; box-shadow: 0 4px 0 var(--line); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.waitb { background: rgba(255,252,244,.55); box-shadow: inset 0 0 0 2px var(--line); font-size: 15px; opacity: 1; }
.btns { display: flex; gap: 12px; }
.sticker { background: var(--cream); border-radius: 18px; box-shadow: 0 0 0 3px #fff, 0 6px 0 3px rgba(28,43,74,.10); }

/* 上の帯 */
.top { height: 56px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 12px; position: relative; z-index: 5; }
.howto { justify-self: start; white-space: nowrap; height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--cream); font: 900 14px 'Zen Maru Gothic'; box-shadow: 0 4px 0 var(--line); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.howto i { width: 18px; height: 18px; border-radius: 50%; background: var(--n); color: var(--cream); font-style: normal; font-size: 12px; display: grid; place-items: center; }
.turn { display: flex; align-items: center; gap: 8px; font: 900 22px 'Zen Maru Gothic'; white-space: nowrap; }
.turn b { display: block; width: 16px; height: 16px; border-radius: 4px; }
/* 「相手が言葉を選ぶ番」のような長い文は少し小さく（試遊1回目の B8） */
.turn.long { font-size: 17px; gap: 6px; }
.chip-o { background: var(--o); box-shadow: 0 3px 0 var(--oD); }
.chip-n { background: var(--ai); box-shadow: 0 3px 0 var(--n); }
.left { justify-self: end; text-align: right; line-height: 1.25; white-space: nowrap; }
.left .lt { font: 900 15px 'Zen Maru Gothic'; }
.left .lt em { font-style: normal; font-size: 20px; margin: 0 1px; }
.left .sm { font-size: 11px; opacity: .75; }
.left.warn .lt { color: var(--oD); }
.tbar { position: absolute; left: 16px; right: 16px; bottom: -2px; height: 4px; border-radius: 2px; background: rgba(28,43,74,.08); overflow: hidden; }
.tbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--o); }
.legend { display: flex; justify-content: center; gap: 14px; font: 900 14px 'Zen Maru Gothic'; align-items: center; }
.legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ring { width: 48px; height: 48px; position: relative; display: grid; place-items: center; justify-self: end; }
.ring svg { position: absolute; inset: 0; }
.ring b { font: 900 17px 'Zen Maru Gothic'; position: relative; display: flex; align-items: baseline; }
.ring b small { font-size: 10px; margin-left: 1px; }

/* 判定の帯（のこり10手から） */
.jstrip { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; z-index: 5; font-size: 12px; padding: 4px 8px; }
.jrow { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.judge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--o); font: 900 12px 'Zen Maru Gothic'; white-space: nowrap; }
.near { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--cream); box-shadow: inset 0 0 0 2px var(--o); font: 900 12px 'Zen Maru Gothic'; white-space: nowrap; }
.near b { font-size: 15px; color: var(--oD); margin: 0 2px; }
.jline { font-size: 11.5px; line-height: 1.4; text-align: center; }
/* 下の操作の場所に入れたときは、地の大きなのこり手数の線が文字にかからないよう下地を敷く */
.scr .act-in .jstrip { background: rgba(255,252,244,.92); border-radius: 12px; padding: 4px 8px; }
/* 詰めた帯（検査 qa-r1-2 の B-1・B-2）。地の文が無く、丸い札だけなので下地は要らない */
.scr .act-in .jstrip.jc { background: none; padding: 0; }

/* 名前と取った駒の列 */
.prow { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; position: relative; z-index: 4; }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.who .chip { flex: none; width: 22px; height: 22px; border-radius: 6px; }
.who .nm { font: 900 16px 'Zen Maru Gothic'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.who .nm small, .who .recrow small, .tagme { flex: none; font: 900 10.5px 'Zen Maru Gothic'; background: var(--n); color: var(--cream); border-radius: 999px; padding: 2px 7px; }
.who .nm .off { background: var(--red); }
.who .recrow { display: flex; align-items: center; gap: 6px; }
.who .rec { font-size: 12px; white-space: nowrap; }
/* ほんと・うその数を押すと説明が出る（試遊1回目の B7）。列が42px の画面でも、押せる高さを44px とる */
.who[data-act] { cursor: pointer; min-height: 44px; }
.who[data-act] .rec { text-decoration: underline dotted rgba(28,43,74,.45); text-underline-offset: 3px; }
.who .rec b { font: 900 13px 'Zen Maru Gothic'; margin: 0 1px; }
.slots { flex: none; display: flex; align-items: flex-end; gap: 4px; }
.slots .sep { width: 2px; height: 22px; border-radius: 1px; background: var(--line); margin: 0 3px; align-self: center; }
.slot { position: relative; width: var(--ss); height: calc(var(--ss) * 64 / 58); }
.slot .hole { position: absolute; left: 0; top: 0; width: var(--ss); height: var(--ss); border-radius: 7px; background: rgba(255,248,236,.55); box-shadow: inset 0 2px 0 rgba(28,43,74,.07); display: grid; place-items: center; }
.slot .hole .mk { opacity: .5; }
.slot.hot .hole { box-shadow: inset 0 0 0 2.2px var(--o); background: rgba(255,138,61,.14); }
.slot.hot.red .hole { box-shadow: inset 0 0 0 2.2px var(--red); background: rgba(200,58,58,.10); }
.slot .cd { position: absolute; left: 0; top: 0; }
.slot .mtab { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); height: 12px; padding: 0 2px; border-radius: 3px 3px 1px 1px; background: var(--cream); border: 1.2px solid var(--n); display: grid; place-items: center; z-index: -1; }
.slot .mtab.lie { transform: translateX(-50%) rotate(-8deg); border-style: dashed; }

/* 盤 */
.bw { position: relative; flex: none; display: flex; align-items: center; justify-content: center; z-index: 2; }
.board { position: relative; }
.well { position: absolute; border-radius: var(--wr); background: var(--well); box-shadow: inset 0 4px 0 rgba(28,43,74,.09), inset 0 0 0 1.5px rgba(28,43,74,.05), 0 1.5px 0 rgba(255,255,255,.8); }
.well.exitme { background: #FFE6D1; box-shadow: inset 0 3px 0 rgba(217,96,26,.16), inset 0 0 0 2px rgba(255,138,61,.75); }
.well.exitme.lit { box-shadow: inset 0 3px 0 rgba(217,96,26,.16), inset 0 0 0 3px var(--o), 0 0 0 4px var(--bg), 0 0 0 8px rgba(255,138,61,.55); }
.well.exitop { background: #E6EBF6; box-shadow: inset 0 3px 0 rgba(28,43,74,.08), inset 0 0 0 2px rgba(84,104,168,.55); }
/* 盤を開いたときの説明のあいだは、相手の出口も光らせる（試遊1回目の B1） */
.well.exitop.lit { box-shadow: inset 0 3px 0 rgba(28,43,74,.08), inset 0 0 0 3px var(--ai), 0 0 0 4px var(--bg), 0 0 0 8px rgba(97,118,180,.5); }
/* 並べる画面の「前の列の3マス」（試遊1回目の B9） */
.well.flash { animation: frontflash .5s ease-in-out 5 alternate; }
/* 出口の角で取って、取った駒がもとのマスに残ったとき、そのマスを少しのあいだ光らせる（角の決まり案1。app.js の STAY_FLASH_MS と同じ2.5秒） */
.well.stayflash { animation: frontflash .5s ease-in-out 5 alternate; }
@keyframes frontflash { from { box-shadow: inset 0 4px 0 rgba(28,43,74,.09); } to { box-shadow: inset 0 0 0 3px var(--o), 0 0 0 3px rgba(255,138,61,.45); background: #FFE6D1; } }
.well.sel { box-shadow: inset 0 3px 0 rgba(28,43,74,.075), inset 0 0 0 3px var(--o), 0 0 0 3px rgba(255,138,61,.25); }
.well.can { cursor: pointer; }
.well .dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--n); opacity: .6; }
.well .ghost { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; transform: translate(-50%,-50%); border-radius: 5px; border: 2px dashed var(--gc); background: rgba(28,43,74,.06); background: color-mix(in srgb, var(--gc) 14%, transparent); } /* 1つ目は color-mix が読めない iOS 16.1 までの Safari 用 */
.exitarrow { position: absolute; pointer-events: none; line-height: 0; }
.danger { position: absolute; border-radius: calc(var(--wr) + 4px); background: repeating-linear-gradient(-45deg, var(--red) 0 6px, var(--cream) 6px 12px); }
.dim { position: absolute; z-index: 30; pointer-events: none; border-radius: calc(var(--wr) + 6px); box-shadow: 0 0 0 3000px rgba(28,43,74,.22); }
.pc { position: absolute; display: block; cursor: pointer; }
.pc > .lay { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); line-height: 0; }
.pc.lift > .lay { transform: translate(-50%, calc(-50% - 4px)); }
.pc.flipin > .lay { animation: flipin .3s both; animation-delay: var(--fd, 0s); }
@keyframes flipin { 0% { transform: translate(-50%,-50%) scaleY(1); filter: brightness(1); } 45% { transform: translate(-50%,-50%) scaleY(.04); } 50% { transform: translate(-50%,-50%) scaleY(.04); } 100% { transform: translate(-50%,-50%) scaleY(1); } }
.tab { position: absolute; left: 50%; top: var(--tabtop); transform: translateX(-50%); height: 19px; padding: 1px 6px 0 4px; border-radius: 6px 6px 2px 2px; background: var(--cream); border: 1.6px solid var(--n); display: flex; align-items: flex-start; gap: 3px; font: 900 11px/15px 'Zen Maru Gothic'; white-space: nowrap; z-index: 0; }
.tab .mk { margin-top: 1.5px; }
.tab.lie { transform: translateX(-50%) rotate(-8deg); transform-origin: 50% 100%; border-style: dashed; }
/* いちばん上の行の札を下げたときは、駒の本体より上に描く（検査 qa-r1-2 の B-3。駒の下に隠れて字が読めなかった） */
.tab.over { z-index: 2; }
.tab.pull { transition: transform .25s linear; }
.tab .stamp { position: absolute; left: calc(100% + 2px); top: -1px; font: 900 11px/1 'Zen Maru Gothic'; padding: 3px 4px; border-radius: 4px; white-space: nowrap; box-shadow: 0 0 0 1.5px var(--cream); }
.stamp.t { background: var(--n); color: var(--cream); }
.stamp.l { background: var(--o); color: var(--n); transform: rotate(-10deg); }
/* 「すぐ取れる」「すぐ取られる」は、すべての駒より上の重なりに描く（試遊1回目の A2）。left・top は app.js が駒のマスから決める */
.chips { position: absolute; inset: 0; z-index: 29; pointer-events: none; }
.chipx { position: absolute; transform: translateX(-50%); height: 19px; padding: 0 5px; border-radius: 999px; background: var(--n); color: var(--cream); font: 900 11px/19px 'Zen Maru Gothic'; white-space: nowrap; box-shadow: 0 0 0 2px var(--cream); pointer-events: none; }
.chipx.danger2 { background: var(--red); }
/* 角かっこは言葉の札より下に描く（札の字を欠かさない）。DOM でも札より前に置いている */
.brk { position: absolute; inset: -5px; pointer-events: none; z-index: 0; }
.brk i { position: absolute; width: 14px; height: 14px; border: 3px solid var(--o); }
.brk i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.brk i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.brk i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.brk i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.brk.soft i { border-width: 2.4px; opacity: .7; }
.atk { position: absolute; pointer-events: none; z-index: 35; line-height: 0; }

/* 下の操作の場所 */
.act { flex: 1; min-height: 0; position: relative; z-index: 6; }
.act-in { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 16px; }
.numwrap { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.bgnum { position: absolute; left: 0; right: 0; text-align: center; color: var(--num); line-height: 1; letter-spacing: -.05em; white-space: nowrap; user-select: none; }
.bgnum.ten { color: #F7CDAE; }
.bgnum.five { color: transparent; -webkit-text-stroke: 6px var(--o); }
.say { display: flex; gap: 12px; }
.say .btn { min-height: 72px; flex-direction: column; gap: 2px; font-size: 19px; border-radius: 18px; }
.timeline { height: 6px; border-radius: 3px; background: rgba(28,43,74,.10); position: relative; overflow: hidden; flex: none; }
.timeline i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--n); }
.tinfo { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 8px; min-height: 20px; }
.tinfo b { font: 900 15px 'Zen Maru Gothic'; white-space: nowrap; }
.word { display: flex; justify-content: center; }
.bigtab { height: 44px; padding: 0 18px 0 12px; border-radius: 12px 12px 4px 4px; background: var(--cream); border: 2.2px solid var(--n); display: flex; align-items: center; gap: 8px; font: 900 22px 'Zen Maru Gothic'; white-space: nowrap; }
.wait { display: flex; align-items: center; gap: 14px; justify-content: center; }
.wait b { font: 900 18px 'Zen Maru Gothic'; }
.pips { display: flex; gap: 6px; margin-top: 8px; }
.pips i { width: 30px; height: 8px; border-radius: 4px; background: rgba(28,43,74,.13); position: relative; overflow: hidden; }
.pips i u { position: absolute; inset: 0; background: var(--n); border-radius: 4px; transform-origin: 0 50%; transform: scaleX(0); }
.banner { background: var(--cream); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; box-shadow: 0 0 0 2px var(--o), 0 6px 0 rgba(217,96,26,.25); }
.banner.big { font: 900 16px/1.5 'Zen Maru Gothic'; text-align: center; }
.banner.soft { box-shadow: 0 0 0 2px var(--line); }
/* 相手の駒が手前の角に入ったときの知らせ（試遊1回目の B1・B6）。角の赤白の縞と同じ赤で囲む */
.banner.warn { box-shadow: 0 0 0 2.5px var(--red), 0 6px 0 rgba(200,58,58,.22); font-size: 14px; }
.banner.warn b { display: block; color: var(--red); }
/* 1回だけ出す知らせ。押すと閉じる */
.banner.note1, .banner.tipin[data-act] { position: relative; padding-right: 28px; min-height: 44px; cursor: pointer; }
.banner.note1::after, .banner.tipin[data-act]::after { content: "×"; position: absolute; right: 9px; top: 6px; font: 900 15px/1 'Zen Maru Gothic'; opacity: .55; }
.tip { font-size: 13.5px; line-height: 1.55; }
.tip small { display: block; font-size: 12.5px; opacity: .85; margin-top: 2px; }
.tipin { box-shadow: 0 0 0 2px var(--o); }
/* 低い画面：説明を上の帯と相手の名前の列の上に重ねる（盤は小さくしない） */
.tipfloat { position: absolute; left: 0; right: 0; top: 0; z-index: 40; display: flex; align-items: center; padding: 4px 8px; pointer-events: none; }
.tipfloat .banner { width: 100%; max-height: 100%; overflow: hidden; padding: 6px 10px; font-size: 12.5px; line-height: 1.45; pointer-events: auto; cursor: pointer; position: relative; }
/* 重ねた説明はタップで閉じる。閉じると下の「あなたの番」やのこり手数、相手の記録が見える */
.tipfloat .banner { padding-right: 26px; min-height: 44px; }
.tipfloat .banner::after { content: "×"; position: absolute; right: 8px; top: 4px; font: 900 15px/1 'Zen Maru Gothic'; opacity: .55; }
/* 攻める側の説明は上に寄せて、相手の ほんと・うそ を見えるように */
.tipfloat.attack { align-items: flex-start; }
/* のこり10手の1行は、どの画面でも下の操作の場所に入れる（検査 qa-r1-1 の B-2。自分の列に重ねると、押すまで自分の記録と赤い枠を隠した）。
   低い画面では、下の操作の場所に収まるよう少し詰める */
.cp .banner.tipin.ten { padding: 6px 26px 6px 10px; }
.cp .banner.tipin.ten::after { right: 8px; top: 4px; }
.cp .banner.tipin.ten .tip { font-size: 12.5px; line-height: 1.45; }
.tipfloat .tip { font-size: 12.5px; line-height: 1.45; }
.tipfloat .tip small { font-size: 11.5px; margin-top: 0; }
.status { text-align: center; font: 900 15px 'Zen Maru Gothic'; opacity: .75; padding: 6px 0; }

/* 帯（うそだった・ほんとだった・外に出した） */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.veil { position: absolute; inset: 0; background: rgba(211,232,247,.62); animation: fadein .15s both; }
.band { position: absolute; left: -30px; right: -30px; height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.band.lie { background: var(--o); color: var(--n); transform: rotate(-6deg); filter: drop-shadow(0 8px 0 var(--n)); animation: slidein .25s cubic-bezier(.2,.9,.25,1) both; }
.band.lie::before, .band.lie::after { content: ""; position: absolute; left: 0; right: 0; height: 11px; background-repeat: repeat-x; background-size: 17.6px 11px; background-image: var(--zz); }
.band.lie::before { top: -10.5px; transform: scaleY(-1); }
.band.lie::after { bottom: -10.5px; }
.band.tru, .band.out { background: var(--n); color: var(--cream); animation: growx .25s cubic-bezier(.2,.9,.25,1) both; }
.band.plain { background: var(--cream); color: var(--n); box-shadow: 0 0 0 3px var(--n); height: 104px; animation: growx .22s cubic-bezier(.2,.9,.25,1) both; }
.band .bt { font-family: 'Dela Gothic One', sans-serif; font-weight: 400; font-size: min(54px, calc((100vw - 28px) / 6.4)); line-height: 1; display: flex; letter-spacing: .02em; white-space: nowrap; }
.band.plain .bt { font-size: min(40px, calc((100vw - 28px) / 7)); }
.band .bt span { display: inline-block; }
.band.lie .bt span { animation: rollin .14s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(.12s + var(--i) * .06s); }
.band.lie .bt span:nth-child(2) { translate: 0 -6px; }
.band.lie .bt span:nth-child(3) { translate: 0 2px; }
.band.lie .bt span:last-child { translate: 0 8px; rotate: 6deg; }
.band.tru .bt span, .band.out .bt span { animation: riseup .2s cubic-bezier(.2,.8,.3,1) both; animation-delay: .1s; }
.band .bs { font: 900 15px 'Zen Maru Gothic'; margin-top: 14px; }
.band.lie .bs { margin-top: 22px; }
.band.tru .bs, .band.out .bs { color: #C9D7F2; }
.band.leave { animation: leave .2s ease-in both; }
.band.lie.leave { animation: leavelie .2s ease-in both; }
.bigcard { position: absolute; left: 50%; line-height: 0; animation: cardflip .28s both; }
.bigcard .tab { --tabtop: -15px; height: 22px; font-size: 13px; line-height: 18px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes slidein { from { transform: rotate(-6deg) translateX(-130%); } }
@keyframes leavelie { to { transform: rotate(-6deg) translateX(130%); } }
@keyframes leave { to { opacity: 0; transform: scaleX(.2); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes rollin { from { transform: perspective(160px) rotateX(-90deg); opacity: 0; } to { opacity: 1; } }
@keyframes riseup { from { transform: translateY(40%); opacity: 0; } }
@keyframes cardflip { 0% { transform: scaleY(.04); } 100% { transform: scaleY(1); } }

/* 入口・待合室 */
.page { min-height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 24px; max-width: 480px; margin: 0 auto; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.brand .sub { font: 900 14px 'Zen Maru Gothic'; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 900 14px 'Zen Maru Gothic'; }
.input { height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--cream); padding: 0 14px; font: 900 20px 'Zen Maru Gothic'; color: var(--n); width: 100%; }
.input:focus { outline: none; border-color: var(--o); }
.input.code { font-family: 'Dela Gothic One', sans-serif; font-weight: 400; letter-spacing: .2em; font-size: 26px; text-align: center; }
.card { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0; font: 900 15px 'Zen Maru Gothic'; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 14px 10px 18px; gap: 10px; }
.code-box small { display: block; color: var(--red); font: 900 13px 'Zen Maru Gothic'; }
.code-box .cv { font-family: 'Dela Gothic One', sans-serif; font-size: 40px; letter-spacing: .08em; line-height: 1.1; white-space: nowrap; }
.copy { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--bg); font: 900 14px 'Zen Maru Gothic'; cursor: pointer; white-space: nowrap; }
.players { display: flex; gap: 10px; }
.pl { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: rgba(255,252,244,.6); min-width: 0; min-height: 52px; }
/* 名前と「あなた」の札を縦に積む（8文字の名前を切らないため） */
.pl .pn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.pl .nm { font: 900 16px 'Zen Maru Gothic'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl .sq { flex: none; width: 24px; height: 24px; border-radius: 7px; }
.pl.empty .nm { opacity: .5; }
.rules { padding: 14px 14px; }
.rules ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
/* 5行の下に小さく出す上限の1行（試遊1回目の B3） */
.rules .rnote { margin: 10px 0 0; padding-top: 8px; border-top: 2px dashed var(--line); font-size: 12.5px; line-height: 1.5; opacity: .85; }
/* 「言い張り」の設定の下の1行（試遊1回目の B4） */
.rules li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 13.5px; line-height: 1.55; }
/* 長い文はふつうの日本語の折り方にする（keep-all だと「見えませ」「ん。」のように変な所で割れる） */
.rules li span, .modal p, .tip, .banner, #toast div, .note, .rules .rnote, .three li span, .jnote { word-break: normal; overflow-wrap: break-word; }
.rules li b { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 900 12px 'Zen Maru Gothic'; color: var(--cream); background: var(--n); box-shadow: 0 2px 0 var(--nD); margin-top: 1px; }
.rules li:nth-child(odd) b { background: var(--o); color: var(--n); box-shadow: 0 2px 0 var(--oD); }
.foot { position: sticky; bottom: 0; padding: 10px 0 4px; background: linear-gradient(rgba(211,232,247,0), var(--bg) 30%); }
.note { font-size: 12.5px; line-height: 1.5; opacity: .85; }

/* 答え合わせ */
.result { text-align: center; padding: 10px 16px 0; }
.result .rt { font-family: 'Dela Gothic One', sans-serif; font-size: 40px; line-height: 1.1; }
.result .rr { display: inline-block; margin-top: 6px; font: 900 15px 'Zen Maru Gothic'; background: var(--n); color: var(--cream); padding: 5px 14px; border-radius: 999px; }
.result .jd { margin-top: 6px; font-size: 13px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1em; }
.result .jnote { margin: 4px auto 0; max-width: 360px; font-size: 12.5px; line-height: 1.5; opacity: .85; }
/* 答え合わせの「だれが取った駒か」（試遊1回目の C） */
.slotsw { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 11px; }
.slotcap { font: 900 10.5px/1.2 'Zen Maru Gothic'; opacity: .75; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.addline { text-align: center; padding: 6px 16px 0; }
.total { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.total b { font: 900 18px 'Zen Maru Gothic'; }
.after { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 24px; max-width: 520px; margin: 0 auto; width: 100%; }

/* 説明（モーダル） */
#over { position: fixed; inset: 0; z-index: 60; display: none; }
#over.on { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(28,43,74,.28); }
.modal { position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); max-width: 460px; margin: 0 auto; max-height: calc(100% - 32px); display: flex; flex-direction: column; }
.modal .mb { overflow-y: auto; padding: 18px 18px 8px; }
.modal .mf { padding: 8px 18px 18px; flex: none; display: flex; }
/* 最初の試合の説明は上に寄せて、下の自分の駒（並べる場所）をふさがない。
   class 名は attop。前の top は上の帯の .top { height: 56px } にも当たって、札がつぶれていた（試遊1回目の A1） */
.modal.attop { top: 64px; transform: none; max-height: calc(100% - 80px); }
/* 盤を開いたときの札を、低い画面で奥の列と手前の列のあいだに収める形（検査 qa-r1-1 の C-2）。文を少し詰め、それでも入らなければ図を外す（nofig） */
.modal.snug .mini { padding: 0 0 4px; }
.modal.snug.nofig .mini { display: none; }
.modal.snug .mb { padding: 10px 14px 0; }
.modal.snug p { font-size: 13px; line-height: 1.45; margin-bottom: 4px; }
.modal.snug .mf { padding: 4px 14px 12px; }
.modal.snug .btn { min-height: 44px; font-size: 16px; }
.modal h3 { margin: 14px 0 4px; font: 900 16px 'Zen Maru Gothic'; }
.modal h3:first-child { margin-top: 0; }
.modal p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.65; }
.mini { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 0 8px; line-height: 0; }
.mini.exits { gap: 28px; }
.mini.exits span { display: flex; align-items: center; gap: 8px; }
.mini.exits small { font: 900 12px/1.35 'Zen Maru Gothic'; text-align: left; }
/* 遊び方：先頭のまとめと、押すと開く見出し（試遊1回目の B11） */
.three { background: #FFF1E2; border-radius: 14px; padding: 12px 12px 10px; box-shadow: inset 0 0 0 2px rgba(255,138,61,.55); }
.three h3 { margin: 0 0 8px !important; font: 900 16px 'Zen Maru Gothic'; }
.three ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.three li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 14px; line-height: 1.6; }
.three li b { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 900 12px 'Zen Maru Gothic'; color: var(--cream); background: var(--n); margin-top: 1px; }
.modal p.more { margin: 12px 0 4px; font-size: 12.5px; opacity: .8; }
.hsec { border-top: 2px solid rgba(28,43,74,.08); }
.hsec:last-child { border-bottom: 2px solid rgba(28,43,74,.08); }
.hsec summary { list-style: none; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 900 15.5px 'Zen Maru Gothic'; cursor: pointer; }
.hsec summary::-webkit-details-marker { display: none; }
.hsec summary::after { content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px; border-right: 3px solid var(--n); border-bottom: 3px solid var(--n); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.hsec[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.hsec p { margin: 0 0 8px !important; }

/* 知らせ */
#toast { position: fixed; left: 16px; right: 16px; top: 64px; z-index: 70; pointer-events: none; display: flex; justify-content: center; }
#toast div { max-width: 420px; width: fit-content; background: var(--n); color: var(--cream); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.5; text-align: center; box-shadow: 0 6px 0 rgba(11,20,40,.25); animation: fadein .15s both; }
/* 知らせの文は、読点・句点で区切ったかたまりの間で先に折る（直し2回目） */
#toast .ph, span.ph { display: inline-block; max-width: 100%; }
.netpill { position: fixed; right: 10px; bottom: 10px; z-index: 65; background: var(--cream); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; box-shadow: 0 0 0 2px var(--o); }

/* 低い画面 */
.cp .top { height: 50px; }
.cp .prow { height: 46px; }
.cp .say .btn { min-height: 60px; }
.cp .btn.big { min-height: 52px; }
.cp .act-in { gap: 8px; padding-bottom: 10px; }
.cp .jstrip { padding: 0; }
.cp .tinfo { font-size: 12px; }
/* 狭い画面（320幅） */
.nr .top { padding: 0 8px; }
.nr .howto { padding: 0 10px; font-size: 12px; gap: 4px; }
.nr .turn { font-size: 17px; gap: 6px; }
.nr .turn b { width: 12px; height: 12px; }
.nr .left .lt { font-size: 12px; }
.nr .left .lt em { font-size: 16px; }
.nr .prow { gap: 6px; padding: 0 10px; }
.cp.nr .prow { height: 42px; }
.nr .who { gap: 6px; }
.nr .who .chip { width: 16px; height: 16px; border-radius: 4px; }
.nr .who .nm { font-size: 14px; }
.nr .who .rec { font-size: 11px; }
.nr .slots { gap: 3px; }
.nr .slots .sep { margin: 0 1px; }
.nr .legend { gap: 8px; font-size: 13px; }
.nr .chipx { font-size: 10.5px; padding: 0 3px; letter-spacing: -.04em; height: 16px; line-height: 16px; }
.nr .turn.long { font-size: 13.5px; gap: 5px; }
/* 横に並んだ印が、押し広げると持ち主のマスから外れるときは、その組の印だけ字を詰める（検査 qa-r1-2 の C-2・C-3。app.js の layoutChips） */
.chipx.tight { font-size: 10px; padding: 0 3px; letter-spacing: -.06em; }
.nr .chipx.tight { font-size: 9.5px; padding: 0 2px; letter-spacing: -.07em; }
.nr .tab { font-size: 10.5px; padding: 1px 3px 0 2px; gap: 2px; letter-spacing: -.03em; }
.nr .act-in { padding-left: 10px; padding-right: 10px; }
.nr .bigtab { font-size: 19px; }
.nr .say .btn { font-size: 17px; }

/* PC：盤を真ん中に大きく。横の列は名前・記録・取った駒・のこり手数・ボタンだけ */
.pcx { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: 72px 1fr; column-gap: 48px; padding: 0 32px 24px; }
.pcx .ptop { grid-column: 1 / 4; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: relative; }
.pcx .ptop .turn { font-size: 28px; }
.pcx .ptop .turn b { width: 20px; height: 20px; }
.pcx .side { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 340px; padding-top: 8px; }
.pcx .side.l { justify-self: end; align-items: flex-end; text-align: right; }
.pcx .side.r { justify-self: start; }
.pcx .side .who { flex: none; }
.pcx .side .who .nm { font-size: 22px; }
.pcx .side .who .rec { font-size: 15px; }
.pcx .side h4 { margin: 0; font: 900 13px 'Zen Maru Gothic'; opacity: .7; }
.pcx .pleft { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.pcx .pleft .pn { font-family: 'Dela Gothic One', sans-serif; font-size: 120px; line-height: .9; color: var(--num); letter-spacing: -.04em; }
.pcx .pleft.ten .pn { color: #F2B98E; }
.pcx .pleft.five .pn { color: transparent; -webkit-text-stroke: 4px var(--o); }
.pcx .pleft span { font: 900 18px 'Zen Maru Gothic'; }
.pcx .pact { display: flex; flex-direction: column; gap: 12px; width: 320px; }
.pcx .pact .btns { flex-direction: column; }
.pcx .bw { align-self: start; }
.pcx .pmid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* 400幅未満の待合室は、2人の欄を縦に並べる（8文字の名前を切らないため） */
@media (max-width: 399px) { .players { flex-direction: column; gap: 8px; } }
/* 400幅未満では、対戦の画面と答え合わせの自分の列に「あなた」の札を出さない（直し2回目）。
   記録の右に置くと、取った駒の置き場に重なるため。記録が2けたになると 390 幅でも重なる。
   自分の列は盤のすぐ下にあり、駒の色も自分の色なので、札が無くても分かる */
@media (max-width: 399px) { .who .recrow small.me { display: none; } }

/* 320幅で「えらび直す」と「この駒を取りに行く」が並ぶと 330px 要って右にはみ出すので、狭い画面では詰める（qa3 B-1） */
@media (max-width: 359px) {
  .btns { gap: 8px; }
  .btns .btn { padding-left: 10px; padding-right: 10px; min-width: 0; }
  .btns .btn.big { font-size: 17px; }
}

/* ---- PLAYROOM の部品（本番で足したもの） ---- */
/* 左上の「PLAYROOM へ戻る」。入口・待合室・答え合わせに出す。押せる高さは 44px */
.topbar { display: flex; align-items: center; height: 44px; margin: -10px 0 -10px -4px; position: relative; z-index: 2; }
.rtop { margin: 0; padding: 6px 12px 0; }
.back { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 10px; border-radius: 999px; color: var(--n); text-decoration: none; font: 900 13px 'Zen Maru Gothic'; letter-spacing: .02em; }
.back svg { flex: none; }
.back:active { background: rgba(255,252,244,.7); }
/* 会員専用だという案内（「部屋を作る」のすぐ上）。/premium.js が会員には隠す */
.member-note { border-radius: 14px; padding: 9px 12px; background: #FFF1E2; box-shadow: inset 0 0 0 2px rgba(255,138,61,.55); font-size: 13px; line-height: 1.55; }
.member-note p { margin: 0; }
.member-note p.sub { margin-top: 2px; font-size: 12.5px; }
/* 押せる高さは 44px。上下にはみ出す分は負の余白で吸い、文の行の高さは変えない */
.member-note .mlink { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; margin: -13px 0; vertical-align: middle; white-space: nowrap; color: var(--oD); font: 900 13px 'Zen Maru Gothic'; text-decoration: underline; text-underline-offset: 3px; }
.cpunote { margin: -4px 0 0; }
.lenline { text-align: center; margin: 0; }
/* /feedback.js が描く感想の入口（Shadow DOM なので :empty で隠さない。中身が無いときは高さ0） */
.feedback-slot { text-align: center; }
/*
 * X や LINE のアプリ内ブラウザは、ページの「上に」カードやツールバーを重ねる。画面の高さは縮まないので、
 * 下のほうのボタンが覆われて押せない。その環境のときだけ、スクロールする画面（入口・待合室・答え合わせ）の下に逃げを作る。
 * 対戦の画面（.scr）は盤がずれるので当てない
 */
:root[data-inapp="1"] .scroll::after { content: ""; display: block; height: calc(34vh + env(safe-area-inset-bottom)); }

