:root {
  --ink: #f1e6d2; --dim: #b8aa92; --amber: #e8b46a; --red: #d8473c; --red2: #ff6a5a; --green: #7fd1a1;
  --panel: rgba(14, 11, 8, .78); --line: rgba(255, 228, 186, .18); --line2: rgba(255, 228, 186, .34);
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", serif; --sans: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --safeB: env(safe-area-inset-bottom, 0px); --safeT: env(safe-area-inset-top, 0px);
  --selectionSpace: 0px;
  /* iOS 26 の Safari で下端がツールバーに隠れる分（100% と 100svh の差）。画面全体の下端をこの分だけ上げる（ひな形と同じ） */
  --tb: max(0px, calc(100% - 100svh));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #060504; color: var(--ink); font-family: var(--sans); overflow: hidden; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; bottom: var(--tb); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
.btn { appearance: none; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(40, 32, 24, .9), rgba(18, 14, 10, .92)); border-radius: 10px; padding: 13px 18px; font-size: 16px; letter-spacing: .08em; min-height: 48px; transition: border-color .15s, transform .1s, background .15s; }
.btn:hover { border-color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .segB:focus-visible, .iconB:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn.main { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: .2em; background: linear-gradient(180deg, #e9d6ad, #b99659); color: #1c130a; border-color: #f5e3bd; }
.btn.sub { font-size: 14px; padding: 10px 12px; min-height: 44px; }
.btn.warn { border-color: rgba(255, 106, 90, .6); color: #ffd0c8; }

/* 読み込み */
#boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #060504; z-index: 50; transition: opacity .8s; }
#boot.out { opacity: 0; pointer-events: none; }
.bootLogo { display: block; width: min(64vw, 260px); height: auto; margin: 0 auto 14px; filter: invert(.92) sepia(.3) saturate(1.3) drop-shadow(0 0 18px rgba(170, 120, 255, .35)); animation: bootBreath 2.4s ease-in-out infinite; }
@keyframes bootBreath { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.bootMsg { margin: 0; color: var(--dim); font-size: 13px; letter-spacing: .14em; text-align: center; }

/* タイトル */
.scr { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safeT)) 16px calc(16px + var(--safeB)); background: radial-gradient(ellipse at 50% 60%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .55) 100%); }
.tBox { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.logo { margin: 0 0 14px; text-align: center; font-weight: 400; }
.lg1 { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(42px, 12vw, 64px); letter-spacing: .22em; padding-left: .22em; color: #f3e5c6; text-shadow: 0 2px 30px rgba(0, 0, 0, .8), 0 0 18px rgba(255, 190, 110, .25); }
.lg2 { display: block; margin-top: 14px; font-size: 11px; letter-spacing: .42em; color: var(--dim); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; background: rgba(10, 8, 6, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.segB { appearance: none; border: 0; background: transparent; padding: 11px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--dim); transition: background .2s, color .2s; }
.segB b { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; }
.segB small { font-size: 11px; letter-spacing: .08em; }
.segB.on { background: rgba(232, 180, 106, .16); color: #fff2d8; }
.segB[data-mode=cheat].on { background: rgba(200, 50, 40, .22); color: #ffd9d2; }
.seg.sm .segB { min-height: 44px; padding: 8px; }
.seg.sm .segB b { font-size: 16px; }
.modeNote { margin: -2px 0 2px; text-align: center; font-size: 13px; color: var(--dim); min-height: 2.6em; line-height: 1.5; text-shadow: 0 1px 8px #000; }
.tBtns { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tFoot { position: absolute; left: 12px; right: 12px; bottom: calc(8px + var(--safeB)); text-align: center; }
#credit { margin: 0; font-size: 12px; line-height: 1.9; color: var(--dim); letter-spacing: .04em; text-shadow: 0 1px 6px #000; }
#credit a { color: var(--ink); text-underline-offset: 3px; }
#credit .cg { white-space: nowrap; }
body.cheat .lg1 { color: #f0d2c4; text-shadow: 0 2px 30px #000, 0 0 22px rgba(255, 70, 50, .35); }

/* 対局の画面 */
#hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.topBar { position: absolute; top: calc(8px + var(--safeT)); left: 8px; right: 8px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.topBar > * { pointer-events: auto; }
.iconB { appearance: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; flex: none; }
.iconB svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; }
.round { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13px; line-height: 1.35; letter-spacing: .04em; }
.round b { font-family: var(--serif); font-size: 17px; margin-right: 6px; letter-spacing: .1em; }
.doraBox { margin-left: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.doraBox img { width: 26px; height: auto; display: block; }
/* カンでドラ表示が3枚以上になったら少し小さく（スマホの上の帯に収める） */
#doraImgs:has(img:nth-child(3)) img { width: 21px; }
#doraImgs { display: flex; gap: 2px; }

#plates { position: absolute; inset: 0; pointer-events: none; }
.plate { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px 6px; min-width: 96px; text-align: center; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); transition: border-color .2s, box-shadow .2s; }
.plate .nm { font-size: 12px; letter-spacing: .06em; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.plate .wd { font-family: var(--serif); font-weight: 700; font-size: 14px; color: var(--amber); }
.plate.dealer .wd { color: var(--red2); }
.plate .sc { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: .04em; }
.plate .badge { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 4px; background: #c8202a; color: #fff; letter-spacing: .1em; margin-left: 2px; }
.plate.turn { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(232, 180, 106, .4), 0 0 18px rgba(232, 180, 106, .25); }
.plate .acc { display: block; margin: 5px auto 0; appearance: none; border: 1px solid rgba(255, 106, 90, .55); background: rgba(120, 20, 14, .5); color: #ffd6cf; border-radius: 8px; font-size: 12px; padding: 6px 10px; min-height: 34px; letter-spacing: .1em; white-space: nowrap; }
.plate.me { min-width: 0; padding: 4px 10px; }
.plate .away { font-size: 10px; color: var(--dim); }
.plateInfo { appearance: none; display: block; width: 100%; min-height: 48px; padding: 0; border: 0; border-radius: 5px; background: none; color: inherit; }
.plateInfo:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.plateInfo:hover .plateMore { color: var(--amber); }
.plate .playerName { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.plate .wd, .plate .badge { flex: none; }
.plateMore { display: block; font-family: var(--sans); font-size: 10px; line-height: 1.5; letter-spacing: .02em; color: var(--dim); white-space: nowrap; }
.plate.me .plateInfo { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; min-height: 0; }
.plate.me .nm { grid-column: 1 / -1; }
.accShort { display: none; }

#whispers { position: absolute; inset: 0; pointer-events: none !important; }
.whisper { position: absolute; transform: translate(-50%, -100%); font-family: var(--serif); font-size: 13px; color: #f6e2c8; text-shadow: 0 0 8px #000, 0 0 2px #000; white-space: nowrap; opacity: 0; animation: wh 3.2s ease forwards; letter-spacing: .06em; }
@keyframes wh { 0% { opacity: 0; margin-top: 6px; } 12% { opacity: 1; margin-top: 0; } 80% { opacity: 1; } 100% { opacity: 0; margin-top: -8px; } }

#hud.has-selection { --selectionSpace: 40px; }
.selectionHint { position: absolute; left: 50%; transform: translateX(-50%); bottom: var(--handTop, 34vh); max-width: calc(100% - 16px); height: 32px; display: flex; align-items: center; padding: 5px 10px; border: 1px solid var(--amber); border-radius: 8px; background: rgba(20, 16, 12, .92); color: #fff1d6; font-size: 12px; line-height: 1.5; white-space: nowrap; pointer-events: none !important; }
.actBar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--handTop, 34vh) + var(--selectionSpace)); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 16px); }
/* 鳴き待ちの透明な隙間は卓へ通す。ボタンと案内の表示部分は従来どおり保護する。 */
#actBar:has(.callSkipHint) { pointer-events: none; }
#actBar:has(.callSkipHint) > * { pointer-events: auto; }
.callSkipHint { flex: 0 0 100%; padding: 0 4px; border-radius: 5px; background: rgba(14, 11, 8, .72); text-align: center; font-size: 11px; line-height: 1.5; color: var(--ink); pointer-events: none; }
.aB { appearance: none; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(48, 38, 28, .94), rgba(20, 16, 12, .94)); border-radius: 10px; padding: 9px 16px; min-height: 46px; min-width: 76px; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .12em; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.aB.hot { background: linear-gradient(180deg, #f0d79e, #b98d4c); color: #1b1108; border-color: #fbe6b6; }
.aB.win { background: linear-gradient(180deg, #ff7a5c, #b8261c); color: #fff; border-color: #ffb3a0; }
.aB.cheat { background: linear-gradient(180deg, rgba(110, 24, 18, .95), rgba(40, 8, 6, .95)); border-color: rgba(255, 110, 90, .6); color: #ffd8cf; }
.aB.pass { font-family: var(--sans); font-weight: 500; font-size: 15px; color: var(--dim); }
.aB small { display: block; font-family: var(--sans); font-weight: 400; font-size: 10px; letter-spacing: .04em; opacity: .85; }
.aB img { height: 34px; display: inline-block; vertical-align: middle; margin: 0 1px; }
.subBar { position: absolute; right: 8px; bottom: calc(10px + var(--safeB)); display: flex; gap: 6px; }
.subBar.above-hand { bottom: calc(var(--handTop, 34vh) + var(--selectionSpace) + var(--actionsHeight, 0px) + 12px); }
/* 自動の切り替え（右下。裏卓ではイカサマの上）。押すと上に3つの切り替えが開く。左下の名札は見張りの行で横に伸びるので、中央には置かない */
.autoBox { position: absolute; right: 8px; bottom: calc(10px + var(--safeB)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
body.cheat .autoBox.has-cheat { bottom: calc(68px + var(--safeB)); }
body.cheat .autoBox.above-hand { bottom: calc(var(--handTop, 34vh) + var(--selectionSpace) + var(--actionsHeight, 0px) + var(--footerLift, 0px) + 12px); }
.autoB { appearance: none; min-height: 40px; min-width: 64px; padding: 6px 14px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(20, 16, 12, .86); color: var(--dim); font-family: var(--sans); font-size: 13px; letter-spacing: .08em; }
.autoB.on { color: #f3dfb6; border-color: rgba(240, 215, 158, .7); }
.autoPop { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(14, 11, 8, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.autoPop[hidden], body.lesson .autoBox { display: none !important; }
.autoPop button { appearance: none; min-width: 168px; min-height: 44px; padding: 6px 12px 6px 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: left; font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: .06em; position: relative; }
.autoPop button small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0; color: var(--dim); }
.autoPop button::before { content: ''; position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 4px; border: 1px solid var(--line2); }
.autoPop button.on { background: rgba(240, 215, 158, .1); border-color: rgba(240, 215, 158, .35); }
.autoPop button.on::before { background: #e8c27a; border-color: #f5dfae; box-shadow: inset 0 0 0 3px rgba(14, 11, 8, .94); }
.callText { position: absolute; inset: 0; pointer-events: none !important; }
.callText span { position: absolute; transform: translate(-50%, -50%) scale(.6); font-family: var(--serif); font-weight: 700; font-size: clamp(40px, 11vw, 72px); letter-spacing: .1em; color: #fff4dc; text-shadow: 0 0 24px rgba(255, 170, 80, .7), 0 4px 18px #000; opacity: 0; animation: ct 1.3s cubic-bezier(.2, .8, .2, 1) forwards; white-space: nowrap; }
.callText span.red { color: #ffe1db; text-shadow: 0 0 26px rgba(255, 50, 30, .85), 0 4px 18px #000; }
@keyframes ct { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); } }
.toast { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 16px; font-size: 14px; letter-spacing: .04em; opacity: 0; transition: opacity .3s; pointer-events: none !important; max-width: calc(100% - 24px); text-align: center; }
.toast.on { opacity: 1; }

/* 待った */
.matta { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.matta button { appearance: none; border: 2px solid #ffb3a0; background: radial-gradient(circle at 50% 35%, #ff5a40, #8e140c); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 30px; letter-spacing: .2em; padding: 16px 30px 16px 36px; border-radius: 16px; box-shadow: 0 0 40px rgba(255, 60, 30, .5); }
.matta .bar { width: 180px; height: 4px; background: rgba(255, 255, 255, .15); border-radius: 2px; overflow: hidden; }
.matta .bar i { display: block; height: 100%; background: #ffb3a0; transform-origin: left; }
.matta p { margin: 0; font-size: 12px; color: #ffd8cf; text-shadow: 0 0 6px #000; }

/* 小窓 */
.modal { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.mBox { width: min(520px, 100%); max-height: calc(100% - 20px); overflow: auto; background: rgba(16, 12, 9, .94); border: 1px solid var(--line2); border-radius: 14px; padding: 18px 18px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); touch-action: pan-y pinch-zoom; overscroll-behavior: contain; }
.mBody h2 { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: .12em; margin: 0 0 10px; text-align: center; }
.mBody h3 { font-family: var(--serif); font-size: 17px; margin: 16px 0 6px; letter-spacing: .08em; color: var(--amber); }
.mBody p, .mBody li { font-size: 14px; line-height: 1.75; color: #e6d9c2; }
.mBody ul { padding-left: 1.2em; margin: 6px 0; }
.mBtns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.mBtns .btn { min-width: 130px; }
.handRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; margin: 8px 0; align-items: flex-end; }
.handRow img { width: 30px; height: auto; }
.handRow .gap { width: 10px; }
.handRow .win { margin-left: 8px; filter: drop-shadow(0 0 6px rgba(255, 200, 120, .8)); }
.yakuList { list-style: none; padding: 0 !important; margin: 10px auto !important; max-width: 300px; }
.yakuList li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 3px 2px; font-family: var(--serif); font-size: 16px; }
.pts { text-align: center; font-family: var(--serif); font-size: 20px; margin: 8px 0; }
.pts b { font-size: 30px; color: var(--amber); margin: 0 4px; }
.deltas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.deltas div { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px; font-size: 12px; }
.deltas b { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.deltas .p { color: var(--green); } .deltas .m { color: var(--red2); }
.big { text-align: center; font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: .2em; margin: 4px 0 4px; }
.big.red { color: #ff8a78; text-shadow: 0 0 20px rgba(255, 60, 30, .5); }
.rank { list-style: none; padding: 0 !important; }
.rank li { display: grid; grid-template-columns: 2.4em 1fr auto; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 4px; font-size: 16px; }
.rank li b { font-family: var(--serif); font-size: 20px; color: var(--amber); }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice button { text-align: left; }
.choice button small { display: block; font-size: 12px; color: var(--dim); letter-spacing: 0; margin-top: 2px; line-height: 1.5; }
.lookRow { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.lookRow button { appearance: none; border: 2px solid transparent; background: none; padding: 2px; border-radius: 6px; }
.lookRow button.on { border-color: var(--red2); }
.lookRow img { width: 44px; display: block; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field input { font-size: 18px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line2); background: #120e0a; color: var(--ink); letter-spacing: .2em; text-transform: uppercase; user-select: text; -webkit-user-select: text; }
.field label { font-size: 12px; color: var(--dim); }
.seats { display: grid; gap: 6px; margin: 10px 0; }
.seats div { display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.seats div span:last-child { color: var(--dim); font-size: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 10px 0; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 30px; letter-spacing: .3em; text-align: center; margin: 6px 0; color: var(--amber); }
.small { font-size: 12px !important; color: var(--dim) !important; }

/* ガン牌で見ている相手の手 */
#peeks { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.peek { position: absolute; transform: translate(-50%, 0); background: rgba(60, 10, 8, .82); border: 1px solid rgba(255, 110, 90, .5); border-radius: 8px; padding: 4px 6px; display: flex; gap: 1px; max-width: 96vw; flex-wrap: wrap; justify-content: center; }
.peek img { width: 18px; height: auto; }
.peek p { margin: 0 4px 0 0; font-size: 10px; color: #ffd8cf; align-self: center; }

@media (min-width: 900px) {
  .plate { min-width: 120px; }
  .plate .nm { font-size: 13px; }
  .plate .sc { font-size: 17px; }
}

/* 見張り・指摘のボタン列と視線 */
.plate .pbtns { display: flex; gap: 5px; justify-content: center; margin-top: 5px; }
.plate .pbtns .acc { margin: 0; }
.plate .watch { appearance: none; border: 1px solid var(--line2); background: rgba(30, 24, 18, .7); color: var(--ink); border-radius: 8px; font-size: 12px; padding: 6px 10px; min-height: 34px; letter-spacing: .08em; white-space: nowrap; }
.plate .watch.on { border-color: var(--amber); background: rgba(232, 180, 106, .22); color: #fff1d6; }
.plate .eyes { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 3px; font-size: 11px; color: #f0c98a; white-space: nowrap; }
.plate .eyes svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.plate .eyes span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* スマホ・タブレットの名札は上家・対面・下家の順で上端にまとめ、河・副露と操作列を空ける。 */
@media (max-width: 900px) {
  #plates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; align-items: start; gap: 6px; padding: var(--platesTop, 72px) 8px 0; }
  .plate:not(.me) { position: relative; left: auto !important; top: auto !important; transform: none; min-width: 0; width: 100%; padding: 5px 4px; }
  .plate[data-r="3"] { order: 0; }
  .plate[data-r="2"] { order: 1; }
  .plate[data-r="1"] { order: 2; }
  .plate .nm { gap: 3px; letter-spacing: 0; }
  .plate .badge { font-size: 9px; padding: 0 3px; margin: 0; letter-spacing: 0; }
  .plate .sc { font-size: 14px; line-height: 1.3; letter-spacing: 0; }
  .plateMore { font-size: 9px; }
  .plate .pbtns { gap: 4px; margin-top: 5px; }
  .plate .pbtns .watch, .plate .pbtns .acc { min-width: 0; min-height: 36px; padding: 6px 2px; font-size: 11px; letter-spacing: 0; }
  .plate .pbtns .watch { flex: 1.4; }
  .plate .pbtns .acc { flex: 1; }
  .plate .eyes { font-size: 10px; gap: 3px; }
  .accFull { display: none; }
  .accShort { display: inline; }
  .topBar { gap: 6px; }
  .round { padding: 5px 7px; font-size: 11px; }
  .round b { font-size: 15px; margin-right: 4px; }
  .doraBox { padding: 4px 5px; gap: 3px; flex: none; }
  .doraBox:has(img:nth-child(3)) { flex-direction: column; gap: 0; font-size: 9px; }
  #doraImgs:has(img:nth-child(3)) img { width: 18px; }
}
/* 名札から開く、正面向きの公開牌。表示順を保ち、鳴かれた牌も薄く残す。 */
.mBox:has(.publicInfo) { padding: 12px 14px; }
.publicHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -12px; z-index: 1; padding: 8px 0; margin-top: -8px; background: #100c09; }
.publicHead h2 { margin: 0; font-size: 22px; letter-spacing: .06em; }
.publicHead button { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.publicTabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 12px; }
.publicTabs button { min-width: 0; min-height: 44px; padding: 6px; font-size: 13px; letter-spacing: 0; }
.publicTabs button[aria-pressed="true"] { border-color: var(--amber); color: #fff1d6; background: #49351e; }
.mBody .publicName { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; margin: 10px 0 4px; }
.mBody .publicStatus, .mBody .publicNote, .mBody .publicLegend { font-size: 12px; line-height: 1.6; color: var(--dim); margin: 6px 0; overflow-wrap: anywhere; }
.mBody .publicEmpty { font-size: 13px; color: var(--dim); }
.mBody .publicContent h3 { font-size: 15px; margin: 14px 0 8px; }
.publicRiver { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; max-width: 360px; margin: 0; padding: 0; list-style: none; }
.publicRiver li { min-width: 0; border-radius: 5px; }
.publicTile img { display: block; width: 100%; height: auto; }
.publicTile span { display: block; min-height: 15px; text-align: center; white-space: nowrap; font-size: 10px; line-height: 15px; color: var(--amber); }
.publicRiver .riichi { background: rgba(216, 71, 60, .22); box-shadow: inset 0 0 0 1px #da6b5e; }
.publicRiver .riichi span { color: #ffc0b2; }
.publicRiver .called img { opacity: .5; }
.publicRiver .called span { color: var(--dim); }
.publicMeld { display: inline-flex; flex-direction: column; margin: 0 14px 10px 0; max-width: 100%; }
.publicMeldLabel { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.publicMeldTiles { display: flex; gap: 3px; }
.publicMeldTiles .publicTile { width: 48px; }
@media (max-width: 360px) {
  .modal:has(.publicInfo) { padding: 10px; }
  .mBox:has(.publicInfo) { padding: 12px; }
  .publicRiver { gap: 2px; }
  .publicTile span { font-size: 9px; }
}
/* イカサマの選択 */
.cRow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; }
.cRow .btn { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.cTxt b { font-family: var(--serif); font-size: 16px; }
.cTxt small { display: block; font-size: 12px; color: var(--dim); line-height: 1.5; margin-top: 2px; }
@media (max-width: 420px) { .cRow { grid-template-columns: 1fr 1fr; } .cTxt { grid-column: 1 / -1; } }
/* 種明かし */
.reveal { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; }
.reveal th, .reveal td { border-bottom: 1px solid var(--line); padding: 5px 4px; text-align: center; }
.reveal tr th:first-child { text-align: left; font-weight: 500; }
.reveal tr:first-child th { font-size: 11px; color: var(--dim); font-weight: 400; }

/* 鳴きの文字の後ろの細い帯 */
.callText span.cl::before { content: ''; position: absolute; left: -45%; right: -45%; top: 26%; bottom: 22%; z-index: -1; background: linear-gradient(90deg, transparent, rgba(8, 6, 4, .78) 22%, rgba(8, 6, 4, .78) 78%, transparent); border-top: 1px solid rgba(232, 180, 106, .55); border-bottom: 1px solid rgba(232, 180, 106, .55); transform: skewX(-16deg) scaleX(0); animation: clBand 1.3s cubic-bezier(.2, .9, .2, 1) forwards; }
.callText span.red.cl::before { border-color: rgba(255, 110, 90, .65); background: linear-gradient(90deg, transparent, rgba(40, 6, 4, .8) 22%, rgba(40, 6, 4, .8) 78%, transparent); }
@keyframes clBand { 0% { transform: skewX(-16deg) scaleX(0); } 20% { transform: skewX(-16deg) scaleX(1); } 80% { opacity: 1; } 100% { transform: skewX(-16deg) scaleX(1.05); opacity: 0; } }

/* カットイン */
#cutin { position: absolute; inset: 0; pointer-events: none; z-index: 25; }
.ci { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; --dur: 1.75s; }
.ci .band { position: absolute; left: -25%; right: -25%; height: clamp(120px, 24vh, 210px); transform: skewY(-7deg) translateX(-115%); background: linear-gradient(90deg, rgba(8, 6, 4, 0), rgba(12, 9, 6, .94) 10%, rgba(34, 22, 10, .96) 50%, rgba(12, 9, 6, .94) 90%, rgba(8, 6, 4, 0)); border-top: 2px solid #e8b46a; border-bottom: 2px solid #e8b46a; box-shadow: 0 0 60px rgba(0, 0, 0, .7); animation: ciBand var(--dur) cubic-bezier(.16, .9, .2, 1) forwards; overflow: hidden; }
.ci .band i { position: absolute; top: 0; bottom: 0; width: 26%; left: -30%; background: linear-gradient(90deg, transparent, rgba(255, 238, 200, .32), transparent); animation: ciShine var(--dur) ease-out forwards; }
.ci .txt { position: relative; text-align: center; transform: skewY(-7deg); animation: ciTxt var(--dur) cubic-bezier(.16, .9, .2, 1) forwards; opacity: 0; }
.ci .txt small { display: block; font-size: clamp(14px, 3.6vw, 20px); letter-spacing: .3em; color: #e9dcc2; text-shadow: 0 2px 8px #000; }
.ci .txt b { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(60px, 17vw, 132px); line-height: 1.05; letter-spacing: .14em; padding-left: .14em; background: linear-gradient(180deg, #fff8e2 10%, #f0c27a 55%, #a46f2c 92%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .8)); }
.ci .txt em { display: block; font-style: normal; font-family: var(--serif); font-size: clamp(18px, 4.6vw, 30px); letter-spacing: .12em; color: #f6e7c8; text-shadow: 0 2px 8px #000; }
@keyframes ciBand { 0% { transform: skewY(-7deg) translateX(-115%); } 16% { transform: skewY(-7deg) translateX(0); } 84% { transform: skewY(-7deg) translateX(0); } 100% { transform: skewY(-7deg) translateX(115%); } }
@keyframes ciTxt { 0%, 8% { opacity: 0; transform: skewY(-7deg) translateX(30%); } 24% { opacity: 1; transform: skewY(-7deg) translateX(0); } 80% { opacity: 1; transform: skewY(-7deg) translateX(-3%); } 100% { opacity: 0; transform: skewY(-7deg) translateX(-30%); } }
@keyframes ciShine { 0%, 18% { left: -30%; } 50% { left: 110%; } 100% { left: 110%; } }
.ci-caught { --dur: 1.9s; }
.ci-caught .band { background: linear-gradient(90deg, rgba(20, 2, 0, 0), rgba(70, 6, 4, .95) 10%, rgba(140, 14, 8, .96) 50%, rgba(70, 6, 4, .95) 90%, rgba(20, 2, 0, 0)); border-color: #ff8a70; }
.ci-caught .txt b { background: linear-gradient(180deg, #fff, #ffd2c8 50%, #ff7a62); -webkit-background-clip: text; background-clip: text; }
.ci-false { --dur: 1.6s; }
.ci-false .band { background: linear-gradient(90deg, rgba(10, 10, 10, 0), rgba(30, 30, 30, .92) 10%, rgba(50, 50, 50, .94) 50%, rgba(30, 30, 30, .92) 90%, rgba(10, 10, 10, 0)); border-color: #9a9a9a; }
.ci-false .txt b { background: linear-gradient(180deg, #f2f2f2, #a8a8a8); -webkit-background-clip: text; background-clip: text; }
/* 役満：暗転して金の文字と火の粉 */
.ci-yakuman { --dur: 3s; }
.ci-yakuman .veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(40, 24, 6, .92), #000 70%); animation: ciVeil var(--dur) ease forwards; }
.ci-yakuman .band { background: none; border: 0; box-shadow: none; }
.ci-yakuman .band i { width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 220, 140, .25), transparent); }
.ci-yakuman .txt b { font-size: clamp(76px, 22vw, 170px); background: linear-gradient(180deg, #fffbe8 5%, #ffd36a 45%, #c8862a 75%, #fff0b8 95%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 22px rgba(255, 190, 80, .55)) drop-shadow(0 4px 10px #000); }
.ci-yakuman .txt em { font-size: clamp(16px, 4vw, 24px); max-width: 90vw; }
.ci-yakuman .spark { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffd68a; box-shadow: 0 0 10px 3px rgba(255, 190, 90, .8); opacity: 0; animation: ciSpark 1.4s ease-out forwards; }
@keyframes ciVeil { 0% { opacity: 0; } 12% { opacity: 1; } 86% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ciSpark { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-80px) scale(1.2); } }
/* 濡れ衣：指摘した人の名札がしぼむ */
.plate.shrink { animation: plShrink 1.5s ease forwards; }
@keyframes plShrink { 0% { transform: translate(-50%, -50%) scale(1); filter: none; } 20% { transform: translate(-50%, -50%) scale(.78); filter: grayscale(1) brightness(.7); } 70% { transform: translate(-50%, -50%) scale(.84); filter: grayscale(1) brightness(.7); } 100% { transform: translate(-50%, -50%) scale(1); filter: none; } }

/* 結果の小窓：ドラ・裏ドラ・役を順に */
.doraRow { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; margin: 4px 0 2px; font-size: 11px; color: var(--dim); }
.doraRow span { margin: 0 4px 0 10px; }
.doraRow img { width: 24px; height: auto; }
.doraRow img.flip { animation: uraFlip .38s ease; }
.doraRow img.hit { filter: drop-shadow(0 0 6px rgba(255, 200, 110, .95)); }
@keyframes uraFlip { 0% { transform: scaleX(1); } 45% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
.yakuList li.yk { opacity: 0; transform: translateX(-10px); transition: opacity .25s, transform .25s; }
.yakuList li.yk.in { opacity: 1; transform: none; }
.pts { position: relative; }
.stamp { position: absolute; right: 2%; top: 50%; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .1em; color: #ff8a70; border: 2px solid #ff8a70; border-radius: 6px; padding: 2px 8px; transform: translateY(-50%) rotate(-12deg) scale(2.2); opacity: 0; transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), opacity .15s; }
.stamp.in { opacity: 1; transform: translateY(-50%) rotate(-12deg) scale(1); }
@media (prefers-reduced-motion: reduce) { .ci .band, .ci .txt { animation-duration: .01s !important; } }

/* オンラインの CPU の札 */
.plate .badge.cpu { background: rgba(255, 228, 186, .16); color: var(--dim); border: 1px solid var(--line2); }

/* ロゴ（image/logo.svg を読みこんで、文字ごとに動かす。色は表卓＝象牙と金、裏卓＝象牙と紫・赤い灯） */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root { --lg1: #fff6e2; --lg2: #e9c98e; --lg3: #a87a3e; --lgGlow: rgba(178, 132, 255, .55); }
body.cheat { --lg1: #fff1ea; --lg2: #e3b6c9; --lg3: #8e4a72; --lgGlow: rgba(255, 82, 60, .5); }
.lgMark { position: relative; display: block; width: min(84vw, 440px); aspect-ratio: 324.73 / 110.67; margin: 0 auto; }
.lgMark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lgMark .lgGlow { filter: blur(14px); opacity: 0; transform: scale(1.02); }
.lgMark .lgGlow path { fill: var(--lgGlow); }
.lgMark .lgMain { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .7)) drop-shadow(0 6px 24px rgba(0, 0, 0, .8)); }
.lgMark .ch { transform-box: fill-box; transform-origin: 50% 60%; opacity: 0; }
.lgMark.play .lgMain .ch { animation: lgIn 1.15s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * .17s + .2s); }
.lgMark.play .lgGlow { animation: lgGlowIn 2.6s ease-out .4s both, lgSmoke 7s ease-in-out 3s infinite; }
.lgMark.play .lgGlow .ch { opacity: 1; }
@keyframes lgIn { 0% { opacity: 0; transform: translateY(10px) scale(1.08) rotate(-2deg); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes lgGlowIn { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: .55; } }
@keyframes lgSmoke { 0%, 100% { opacity: .55; transform: scale(1.02) translateY(0); } 50% { opacity: .8; transform: scale(1.05) translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .lgMark.play .lgMain .ch, .lgMark.play .lgGlow { animation: none; opacity: 1; } .lgMark .ch { opacity: 1; } }

/* タイトル：長さと CPU の強さを1段に */
.row2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.seg.s3 { grid-template-columns: repeat(3, 1fr); }
.seg.s3 .segB { padding-left: 4px; padding-right: 4px; }
.seg.s3 .segB b { font-size: 14px; letter-spacing: .02em; line-height: 1.2; white-space: nowrap; }
.seg.sm .segB b { line-height: 1.2; }
.modeNote .pill { appearance: none; display: inline-block; margin-left: 6px; border: 1px solid var(--line2); background: rgba(20, 16, 12, .8); color: var(--ink); border-radius: 999px; font-size: 12px; padding: 4px 12px; min-height: 30px; vertical-align: middle; letter-spacing: .04em; }
.modeNote .pill.on { border-color: var(--amber); background: rgba(232, 180, 106, .22); color: #fff1d6; }
/* はじめての手助け */
.assist { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--handTop, 34vh) + var(--selectionSpace) + 58px); max-width: min(560px, calc(100% - 16px)); background: rgba(12, 10, 8, .82); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 12px; font-size: 13px; line-height: 1.6; pointer-events: none !important; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.assist p { margin: 2px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.assist img { width: 22px; height: auto; }
.assist .warn { color: #ffb8a8; }
.assist .hot { color: #ffe2a8; font-weight: 700; }
.aB .note { display: block; font-family: var(--sans); font-weight: 500; font-size: 10px; color: #ffcfc4; letter-spacing: 0; }

/* 読み込み：暗い階段 */
#bootCv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bootUi { position: absolute; left: 0; right: 0; bottom: calc(40px + var(--safeB)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bootBar { width: min(220px, 60vw); height: 2px; background: rgba(255, 228, 186, .12); border-radius: 1px; overflow: hidden; }
.bootBar i { display: block; height: 100%; background: linear-gradient(90deg, #a8783c, #ffd9a0); transform-origin: left; transform: scaleX(0); }
.bootGo { position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%); white-space: nowrap; appearance: none; border: 1px solid rgba(255, 214, 160, .55); background: rgba(30, 20, 12, .7); color: #ffe9c8; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .3em; padding: 12px 26px 12px 34px; border-radius: 999px; min-height: 48px; box-shadow: 0 0 24px rgba(255, 170, 90, .25); animation: bootGo 2s ease-in-out infinite; }
@keyframes bootGo { 0%, 100% { box-shadow: 0 0 14px rgba(255, 170, 90, .18); opacity: .85; } 50% { box-shadow: 0 0 34px rgba(255, 170, 90, .45); opacity: 1; } }
#boot { cursor: default; }

/* 危ない牌の札（手助け） */
.dangerTags { position: absolute; inset: 0; pointer-events: none !important; }
.dangerTags .dt { position: absolute; transform: translate(-50%, -150%); font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.dangerTags .l0 { background: #1f6e5a; color: #e6fff6; }
.dangerTags .l1 { background: #9a7a12; color: #fff6d6; }
.dangerTags .l2 { background: #b3261e; color: #fff; }
/* レッスン：ドラ表示 → ドラ */
.doraPairs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 10px 0 4px; }
.doraPairs > div { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--dim); }
.doraPairs > div > div { margin: 0; }
.doraPairs i { font-style: normal; color: var(--amber, #e8b46a); }
.doraPairs em { font-style: normal; min-width: 2.6em; text-align: left; color: var(--ink); }
/* 音の設定：SOUND の横の小さなボタン（タイトルの縦は増やさない）と、BGM・効果音の切り替え */
.sndPair { display: flex; gap: 6px; min-width: 0; }
.sndPair #btnSound { flex: 1; min-width: 0; }
.sndOpt { flex: none; width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.sndOpt svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sndSet { display: flex; flex-direction: column; gap: 8px; }
.sndSet .row { gap: 8px; }
.sndSet button { text-align: center; }
.sndSet button.off { color: var(--dim); }
.sndSet button.muted { opacity: .55; }
.sndNote { margin: 0; text-align: center; color: var(--dim); }
/* SOUND の文字は1行に（横に設定ボタンが並ぶので） */
.sndPair #btnSound { white-space: nowrap; letter-spacing: .04em; padding-left: 8px; padding-right: 8px; }
/* 背の低い画面（例：320×568）：タイトルの余白とロゴを詰め、下のクレジットと重ならないようにする（公開版でも重なっていた） */
@media (max-height: 640px) {
  #scrTitle { padding-bottom: calc(52px + var(--safeB)); padding-top: calc(8px + var(--safeT)); }
  #scrTitle .tBox { gap: 8px; }
  #scrTitle .logo { margin-bottom: 4px; }
  #scrTitle .lgMark { width: min(70vw, 360px); }
  #scrTitle .lg2 { margin-top: 6px; }
  #scrTitle .tBtns { gap: 8px; margin-top: 2px; }
  #scrTitle .seg .segB { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
  #scrTitle .btn { min-height: 44px; }
}
