/* ── Reset & tokens ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:     #06081a;
  --surf:   #0e1630;
  --surf2:  #162040;
  --border: #2a3f70;
  --accent: #4a9eff;
  --green:  #00e5a0;
  --text:   #c8d8f8;
  --dim:    #6880aa;
  --danger: #ff5555;
  --warn:   #ffaa44;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  overflow: hidden;   /* 対局画面は1画面に収める（スクロールさせない） */
}
.ghost { visibility: hidden; }   /* 場所は残したまま隠す（盤面整理中と対局中で盤面の大きさを変えないため） */

/* display:none を確実に適用（overlay 外の要素でも機能する） */
.hidden { display: none !important; }

/* ── Overlays ────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 20, .93); backdrop-filter: blur(8px);
  padding: 1.5rem;
}
.overlay.hidden { display: none; }

.ov-card {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.2rem 2rem;
  max-width: 480px; width: 100%; text-align: center;
  /* 画面が低い端末でも、内容が長いときにボタンごと画面外にはみ出さないよう
     カード自体をスクロール可能にする（body は overflow:hidden のため）。 */
  max-height: 92vh; overflow-y: auto;
}

.ov-title {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  text-shadow: 0 0 30px rgba(74, 158, 255, .5); margin-bottom: .5rem;
}
.ov-sub { color: var(--dim); font-size: .9rem; line-height: 1.6; margin-bottom: 1.4rem; }

.name-input {
  width: 100%; padding: .7rem 1rem;
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 1rem;
  outline: none; transition: border-color .2s; margin-bottom: 1rem;
}
.name-input:focus { border-color: var(--accent); }
.name-input::placeholder { color: var(--dim); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: .75rem 2rem;
  border-radius: 10px; font-size: 1rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .2s; letter-spacing: .04em;
}
.btn-blue  { background: linear-gradient(135deg, #1a5a9a, #0a3060); color: #adf; border: 1px solid #4a8adf; }
.btn-green { background: linear-gradient(135deg, #1a6a3a, #0a4020); color: #8fe; border: 1px solid #4adf8a; }
.btn:hover  { filter: brightness(1.2); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.btn:active { transform: translateY(0); }

/* ── 退室ボタン ──────────────────────────────────────────── */
.btn-leave {
  display: block; width: 100%; margin-top: .8rem;
  padding: .55rem 1rem; font-size: .85rem;
  background: transparent; color: var(--dim); border: 1px solid var(--border);
}
.btn-leave:hover { color: var(--danger); border-color: var(--danger); filter: none; transform: none; box-shadow: none; }

/* ── Lobby ───────────────────────────────────────────────── */
.lobby-url {
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem 1rem;
  font-size: .8rem; color: var(--green); font-family: monospace;
  margin-bottom: 1.25rem; word-break: break-all;
  cursor: text; user-select: all;
}
.lobby-url-label {
  font-size: .65rem; color: var(--dim);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .4rem;
}
.lobby-players { margin-bottom: 1.5rem; max-height: 220px; overflow-y: auto; }
.lobby-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .75rem; margin-bottom: .35rem;
  background: var(--surf); border-radius: 8px; border: 1px solid var(--border);
}
.lobby-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.lobby-name { font-size: .9rem; flex: 1; text-align: left; }
.lobby-you  { font-size: .7rem; color: var(--dim); }

/* ── Difficulty picker（ホストのみ・ロビー）──────────────── */
.diff-picker { margin-bottom: 1.1rem; }
.diff-label  { font-size: .7rem; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .4rem; }
.diff-btns   { display: flex; gap: .5rem; }
.diff-btn {
  flex: 1; padding: .55rem .4rem; font-size: .85rem; font-weight: 600;
  background: var(--surf); border: 1px solid var(--border); border-radius: 8px;
  color: var(--dim); cursor: pointer; transition: all .15s;
}
.diff-btn:hover  { filter: brightness(1.15); }
.diff-btn.active {
  background: linear-gradient(135deg, #1a6a3a, #0a4020);
  border-color: #4adf8a; color: #8fe;
}

/* ── ホスト用注意書き（ゲーム中・読み上げ欄下）────────────── */
.host-notice { font-size: .75rem; color: #ffcf5c; margin-top: .35rem; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 8, 26, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  /* 3列グリッド：中央列はホスト／参加者で左右の表示物（デバッグボタン等）の
     量が違っても、常に画面中央に来る（左右の列が常に同じ幅になるため）。 */
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: .75rem;
  padding: .45rem 1.2rem; min-height: 56px;
}
.header-left   { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; justify-self: start; }
.header-center { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.header-right  { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; justify-self: end; }
.logo { font-size: 1.15rem; font-weight: 700; color: var(--accent); white-space: nowrap; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.chip {
  display: flex; align-items: center; gap: .3rem;
  padding: .22rem .55rem;
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 20px; font-size: .75rem;
  transition: border-color .3s, box-shadow .3s;
}
.chip-dot     { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chip-name    { color: var(--text); white-space: nowrap; }
.chip-score   { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 自分のチップ — 目立つ強調表示 */
.chip.me {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(74, 158, 255, .22), rgba(74, 158, 255, .06));
  padding: .28rem .65rem;
  font-size: .82rem;
  animation: myChipGlow 2.5s ease-in-out infinite;
}
.chip.me .chip-name  { color: #e8f4ff; font-weight: 700; }
.chip.me .chip-score { color: #7df; text-shadow: 0 0 8px rgba(0, 229, 160, .5); }
.chip-rank {
  font-size: .68rem; font-weight: 700; color: var(--warn);
  background: rgba(255, 170, 68, .16); border-radius: 8px; padding: .05rem .4rem;
  white-space: nowrap;
}

@keyframes myChipGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(74, 158, 255, .4); }
  50%       { box-shadow: 0 0 20px rgba(74, 158, 255, .85), 0 0 0 2px rgba(74, 158, 255, .25); }
}

.game-timer { font-size: .9rem; font-weight: 700; color: #aaf; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Round / Spectator badges ────────────────────────────── */
.round-badge {
  font-size: .78rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), #7b5fff);
  border-radius: 10px; padding: .2rem .65rem; white-space: nowrap;
}
.spectator-badge {
  font-size: .78rem; font-weight: 700; color: var(--bg);
  background: var(--warn); border-radius: 10px; padding: .2rem .65rem; white-space: nowrap;
}

/* ── Survivor count row ──────────────────────────────────── */
.survivor-row {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: .4rem;
}
.survivor-input {
  width: 5rem; padding: .35rem .55rem;
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 8px; color: var(--green); font-size: 1.4rem; font-weight: 800;
  text-align: center; outline: none; transition: border-color .2s;
  appearance: textfield; -moz-appearance: textfield;
}
.survivor-input::-webkit-outer-spin-button,
.survivor-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.survivor-input:focus { border-color: var(--accent); }
.surv-btn {
  width: 2.2rem; height: 2.2rem; border-radius: 8px; font-size: 1.1rem; font-weight: 700;
  background: var(--surf); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; transition: all .15s; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.surv-btn:hover { border-color: var(--accent); color: var(--accent); filter: brightness(1.2); }
.surv-hint { color: var(--dim); font-size: .82rem; }

/* ── Round Result overlay ────────────────────────────────── */
.rr-card {
  max-width: 540px; padding: 1.8rem 1.6rem;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.rr-round-dots { display: flex; justify-content: center; gap: .5rem; margin-bottom: .8rem; flex-shrink: 0; }
.rr-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: background .3s;
}
.rr-dot.done   { background: var(--green); }
.rr-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.rr-table {
  flex: 1; overflow-y: auto; min-height: 0;
  margin: .8rem 0; text-align: left;
}
.rr-row {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .6rem; border-radius: 8px; margin-bottom: .3rem;
  background: var(--surf); border: 1px solid var(--border);
}
.rr-row.survivor  { border-color: var(--green); background: rgba(0,229,160,.07); }
.rr-row.eliminated { opacity: .55; }
.rr-row.me        { outline: 2px solid var(--accent); outline-offset: 1px; }
.rr-rank    { min-width: 1.8rem; font-size: .85rem; font-weight: 700; color: var(--dim); }
.rr-name    { flex: 1; font-weight: 600; font-size: .9rem; }
.rr-score   { font-size: .85rem; color: var(--green); font-weight: 700; white-space: nowrap; }
.rr-badge   { font-size: .7rem; padding: .15rem .45rem; border-radius: 6px; white-space: nowrap; }
.rr-badge.adv  { background: var(--green); color: #000; font-weight: 700; }
.rr-badge.elim { background: var(--danger); color: #fff; font-weight: 700; }
.rr-badge.spec { background: var(--warn); color: #000; font-weight: 700; }

.rr-cpu { color: var(--dim); font-size: .7rem; margin-left: .2rem; font-weight: 400; }

/* 通過者と敗退者の境目を示す区切り線（試合のボーダーがひと目でわかるように） */
.rr-cutoff-divider { height: 3px; background: var(--warn); border-radius: 2px; margin: .1rem 0 .55rem; box-shadow: 0 0 6px rgba(255,170,68,.6); }

/* 1〜3位が複数名いても自分の行が見つけやすいよう、順位ごとの背景色はつけない。
   順位は名前の先頭のアイコン（🥇🥈🥉／4位以降は数字）だけで示し、色で目立たせるのは「自分」の行だけ。 */
.rr-rank { font-size: 1.05rem; min-width: 2.4rem; text-align: center; }
.rr-row.me { background: linear-gradient(135deg, rgba(74, 158, 255, .28), rgba(74, 158, 255, .08)); border-color: var(--accent); }
.rr-score small { font-size: .7rem; color: var(--dim); font-weight: 400; margin-left: .2rem; }

/* ── 大会モード：結果画面の「自分の結果」欄（ランキング一覧とは独立して表示）──── */
.rr-me-summary {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  background: linear-gradient(135deg, rgba(74, 158, 255, .2), rgba(74, 158, 255, .05));
  border: 2px solid var(--accent); border-radius: 10px;
  padding: .6rem .9rem; margin: .5rem 0;
}
.rr-me-rank  { font-size: 1.15rem; font-weight: 800; color: #fff; white-space: nowrap; }
.rr-me-rank small { font-size: .72rem; font-weight: 400; color: var(--dim); margin-left: .15rem; }
.rr-me-score { font-size: 1.05rem; font-weight: 700; color: var(--green); white-space: nowrap; }

/* ── 大会モード：最終試合の結果画面だけ、上位3名を目立つ見た目にする。
   他の結果一覧（本戦の通過／敗者復活戦など）には適用しない専用クラス。 ──── */
.rr-row.final-top1, .rr-row.final-top2, .rr-row.final-top3 {
  padding: .6rem .8rem; margin-bottom: .45rem; border-width: 2px;
}
.rr-row.final-top1 .rr-rank, .rr-row.final-top2 .rr-rank, .rr-row.final-top3 .rr-rank { font-size: 1.9rem; min-width: 2.8rem; }
.rr-row.final-top1 .rr-name, .rr-row.final-top2 .rr-name, .rr-row.final-top3 .rr-name { font-size: 1.02rem; font-weight: 800; }
.rr-row.final-top1 {
  background: linear-gradient(135deg, rgba(255, 208, 80, .3), rgba(138, 80, 0, .1));
  border-color: #ffd050; box-shadow: 0 0 16px rgba(255, 208, 80, .35);
}
.rr-row.final-top2 {
  background: linear-gradient(135deg, rgba(210, 220, 235, .26), rgba(130, 140, 155, .1));
  border-color: #d2dceb; box-shadow: 0 0 12px rgba(210, 220, 235, .25);
}
.rr-row.final-top3 {
  background: linear-gradient(135deg, rgba(224, 155, 95, .26), rgba(130, 75, 30, .1));
  border-color: #e09b5f; box-shadow: 0 0 12px rgba(224, 155, 95, .22);
}

/* 昇格バッジ */
.rr-badge.promoted { background: linear-gradient(135deg, #b87000, #7a4800); color: #ffe0a0; font-weight: 700; border: 1px solid #c8900a; }

/* ── 式典オーバーレイ ──────────────────────────────────── */
#oCeremony { z-index: 250; background: rgba(2, 3, 15, .97); }
.ceremony-wrap {
  text-align: center; max-width: 500px; width: 100%; padding: 2rem 1.5rem;
}
.ceremony-wrap.reveal {
  animation: ceremonyReveal .65s cubic-bezier(.22,1,.36,1);
}
@keyframes ceremonyReveal {
  from { opacity: 0; transform: scale(.7) translateY(40px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ceremony-step {
  font-size: .75rem; color: var(--dim); letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: .6rem;
}
.ceremony-place {
  font-size: 1.4rem; font-weight: 700; color: var(--dim);
  letter-spacing: .05em; margin-bottom: .8rem;
  transition: color .3s;
}
.ceremony-wrap.rank-1 .ceremony-place { font-size: 2rem; color: #ffd060; text-shadow: 0 0 30px rgba(255,208,96,.6); }
.ceremony-wrap.rank-2 .ceremony-place { color: #b0c0d8; }
.ceremony-wrap.rank-3 .ceremony-place { color: #c8a060; }
.ceremony-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  margin: 0 auto .8rem; font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--border);
}
.ceremony-wrap.rank-1 .ceremony-avatar { border-color: #c8900a; box-shadow: 0 0 24px rgba(200,144,10,.5); }
.ceremony-wrap.rank-2 .ceremony-avatar { border-color: #7888aa; }
.ceremony-wrap.rank-3 .ceremony-avatar { border-color: #8a5a00; }
.ceremony-name {
  font-size: 2.8rem; font-weight: 800; line-height: 1.2;
  margin-bottom: .4rem; word-break: break-all;
  transition: text-shadow .3s;
}
.ceremony-wrap.rank-1 .ceremony-name { font-size: 3.4rem; text-shadow: 0 0 50px currentColor; }
.ceremony-score {
  font-size: 1.4rem; font-weight: 700; color: var(--green);
  margin-bottom: .5rem;
}
.ceremony-promoted {
  font-size: .8rem; color: #c8900a; margin-bottom: 1rem; min-height: 1.2em;
}
.ceremony-actions { margin-top: 1.5rem; }
.ceremony-skip-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--dim); font-size: .8rem; padding: .3rem .9rem;
  border-radius: 8px; cursor: pointer;
  transition: all .15s;
}
.ceremony-skip-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── ロビーグループボタン状態 ──────────────────────────── */

/* 完了済み：全体をオーバーレイで覆う */
.btn-group-done {
  position: relative;
  filter: saturate(0.3) brightness(0.55);
}
.btn-group-done::after {
  content: '✅ 完了';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55);
  border-radius: 10px;
  font-size: 1rem; font-weight: 700; color: var(--green);
  letter-spacing: .05em; pointer-events: none;
}

/* ロック中：完全に無効化＋明確な視覚表示 */
.btn-group-waiting {
  position: relative;
  filter: saturate(0) brightness(0.3);
  cursor: not-allowed !important;
}
.btn-group-waiting::after {
  content: '🔒 上位は下位・中位完了後に解放';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .65);
  border-radius: 10px;
  font-size: .75rem; color: var(--dim);
  letter-spacing: .03em; pointer-events: none;
}
.btn-group-waiting:disabled { cursor: not-allowed !important; }

/* ロック中ボタンのカーソル（disabled 属性も制御） */
.btn-group-top:disabled,
.btn-group-middle:disabled,
.btn-group-bottom:disabled {
  cursor: not-allowed !important;
}

/* 利用可能ボタンのホバー強調 */
.btn-group-top:not(.btn-group-done):not(.btn-group-waiting):not(:disabled):hover,
.btn-group-middle:not(.btn-group-done):not(.btn-group-waiting):not(:disabled):hover,
.btn-group-bottom:not(.btn-group-done):not(.btn-group-waiting):not(:disabled):hover {
  filter: brightness(1.35);
  outline: 2px solid rgba(255,255,255,.4);
  outline-offset: 2px;
}

/* 昇格者リスト */
.lobby-promoted-list {
  margin-top: .5rem; padding: .5rem .6rem;
  background: rgba(200,144,10,.08);
  border: 1px solid rgba(200,144,10,.3);
  border-radius: 8px; font-size: .78rem;
}
.lobby-promoted-list-title {
  color: #c8900a; font-weight: 700; margin-bottom: .3rem;
}
.lobby-promoted-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .15rem 0; color: var(--text);
}
.lobby-promoted-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.rr-my-status {
  margin: .7rem 0 .4rem; font-size: .92rem; font-weight: 600; text-align: center;
  flex-shrink: 0;
}
.rr-my-status.adv  { color: var(--green); }
.rr-my-status.elim { color: var(--warn); }

/* ── Reading panel ───────────────────────────────────────── */
.reading-wrap { margin: 0 0 8px; padding: 0; flex: none; }
.reading-box {
  background: linear-gradient(135deg, var(--surf2), var(--surf));
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: .8rem 1.2rem;
  display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 2px 20px rgba(74, 158, 255, .1);
}
.reading-icon  { font-size: 1.5rem; flex-shrink: 0; animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.reading-label { font-size: .6rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .18rem; }
.reading-text  { font-size: 1.05rem; color: #fff; line-height: 1.55; }

/* ── Card scatter board（盤面整理・対局共通）─────────────────
   盤面は論理サイズ 1280×880 の固定の大きさで作り、画面に収まるよう拡大縮小(transform: scale)する。
   札は論理pxで絶対配置するので、盤面整理タイムと対局で見た目の位置関係がまったく変わらず、
   画面サイズが違っても札が重なることはない。
   位置は left/top（札の中心）、中心合わせは translate、向きだけを transform: rotate() に持たせる
   ことで、取得時のアニメーション（transform を上書きする）が起きても位置そのものはズレない。 */
.board-wrap {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  border: 1px solid #16223f; border-radius: 12px;
  background: radial-gradient(ellipse at 50% 100%, rgba(74, 158, 255, .06), rgba(255, 255, 255, .01) 70%);
}
.grid {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 880px; margin: 0;
  transform-origin: center center;
}
.grid::before {   /* 相手側と自分側の境目 */
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px dashed rgba(100, 130, 190, .22); pointer-events: none;
}

.card {
  position: absolute; translate: -50% -50%;
  width: 180px; height: 100px; box-sizing: border-box;
  background: linear-gradient(160deg, #182848, #0d1a30);
  border: 1px solid var(--border); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: .5rem;
  font-size: 1.08rem; font-weight: 600; color: #b0c8f0;
  white-space: nowrap;   /* 用語は折り返さず1行で表示する */
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  overflow: hidden;
}
/* 札の文字。枠(180px − 余白)に収まらないときは game.js が transform: scaleX() で横に縮める */
.card-text { display: inline-block; white-space: nowrap; transform-origin: center center; }
.card.zone-top    { cursor: default; }
.card.draggable    { cursor: grab; }
.card.dragging     { opacity: .4; z-index: 5; }
.card.drag-bad     { border-color: var(--danger); box-shadow: 0 0 16px rgba(255, 85, 85, .6); }
.card:hover:not(.removed):not(.correct-mine):not(.correct-other):not(.wrong),
.card.vhover:not(.removed):not(.correct-mine):not(.correct-other):not(.wrong) {
  background: linear-gradient(160deg, #223d6a, #112030);
  border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 20px rgba(74, 158, 255, .25); z-index: 2;
}

/* 定位置（現実のかるたで手を置く場所）。ここからスタートして札を取りに行く */
.home-circle {
  position: absolute; translate: -50% -50%;
  width: 76px; height: 76px; border-radius: 50%;
  border: 3px dashed rgba(0, 229, 160, .85);
  background: rgba(0, 229, 160, .07);
  box-shadow: 0 0 18px rgba(0, 229, 160, .35), inset 0 0 14px rgba(0, 229, 160, .18);
  pointer-events: none; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: rgba(0, 229, 160, .95);
}
.home-circle::after { content: '定位置'; }

/* 札を取る側の画面で、マウスを定位置に固定してから始めるための案内 */
.lock-prompt {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 26, .78); backdrop-filter: blur(2px); cursor: pointer;
}
.lock-prompt-box {
  background: var(--surf2); border: 2px solid var(--green); color: #fff;
  padding: 1.3rem 2.4rem; border-radius: 16px; text-align: center;
  font-size: 1.7rem; font-weight: 800; box-shadow: 0 8px 40px rgba(0, 229, 160, .25);
}
.lock-prompt-box small { display: block; font-size: .85rem; font-weight: 400; color: var(--dim); margin-top: .5rem; }

/* 仮想カーソル（Pointer Lock 中。取れない間は定位置に固定して🚫を出す） */
.v-cursor { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; will-change: transform; }
.v-cursor svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.v-cursor-ban { position: absolute; left: 18px; top: 16px; font-size: 34px; line-height: 1; display: none; text-shadow: 0 0 6px #000; }
.v-cursor.forbidden .v-cursor-ban { display: block; }
body.vcursor-on, body.vcursor-on * { cursor: none !important; }

/* Correct — taken by me */
.card.correct-mine { animation: cMine .55s ease forwards; pointer-events: none; }
@keyframes cMine {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); background: linear-gradient(160deg, #104028, #062018); border-color: var(--green); color: #0f9; box-shadow: 0 0 24px rgba(0, 229, 160, .5); }
  75%  { transform: scale(.9); opacity: .6; }
  100% { transform: scale(0); opacity: 0; }
}

/* Correct — taken by other player */
.card.correct-other { animation: cOther .65s ease forwards; pointer-events: none; font-size: 1.05rem; }
@keyframes cOther {
  0%   { transform: scale(1); opacity: 1; }
  35%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(.8); opacity: 0; }
}

/* Wrong */
.card.wrong {
  animation: cWrong .42s ease;
  border-color: var(--danger) !important;
  background: linear-gradient(160deg, #3a1020, #200810) !important;
  color: #ff9999 !important;
}
@keyframes cWrong {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

.card.removed { visibility: hidden; pointer-events: none; }

/* ホストは進行役のみ・札は取れない（ホバー無効・禁止カーソル） */
.grid.host-locked .card,
.grid.spectator-locked .card { cursor: not-allowed !important; }
.grid.spectator-locked .card:hover {
  transform: none !important; box-shadow: none !important;
  background: linear-gradient(160deg, #182848, #0d1a30) !important;
  border-color: var(--border) !important; color: #7090c0 !important;
}
.grid.host-locked .card { cursor: not-allowed !important; }
.grid.host-locked .card:hover {
  transform: none !important; box-shadow: none !important;
  background: linear-gradient(160deg, #182848, #0d1a30) !important;
  border-color: var(--border) !important; color: #b0c8f0 !important;
}
.card.host-forbidden { animation: cForbidden .42s ease; }
.card.host-forbidden::after {
  content: '🚫'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; background: rgba(10, 14, 24, .55); animation: cForbiddenMark .42s ease;
}
@keyframes cForbidden {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
@keyframes cForbiddenMark {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

/* 今は1枚も取れない状態（お手付き中／正解発表中・次の札待ち／ホスト・観戦中）のとき、
   クリックしなくてもカーソルを乗せた瞬間に🚫を出す。マウスを乗せている間だけ表示され、
   クリック時の一瞬だけの演出（cForbiddenMark）とは別に、静的に表示し続ける。 */
.grid.grab-forbidden .card:not(.removed):hover,
.grid.grab-forbidden .card.vhover:not(.removed) {
  cursor: not-allowed;
}
.grid.grab-forbidden .card:not(.removed):hover::after,
.grid.grab-forbidden .card.vhover:not(.removed)::after {
  content: '🚫'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; background: rgba(10, 14, 24, .55);
}
/* すでに誰かが取った直後（消える演出中）の札は、盤面全体の状態に関わらず個別に禁止表示する */
.card.correct-mine:hover, .card.correct-other:hover, .card.wrong:hover { cursor: not-allowed; }
.card.correct-mine:hover::after, .card.correct-other:hover::after, .card.wrong:hover::after {
  content: '🚫'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; background: rgba(10, 14, 24, .55);
}

/* ── Float score ─────────────────────────────────────────── */
.float-score {
  position: fixed; pointer-events: none; z-index: 300;
  font-size: 1rem; font-weight: 700;
  animation: floatUp .9s ease forwards;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-55px); }
}

/* ── Game over rankings ──────────────────────────────────── */
#oGameOver .ov-card {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rankings {
  flex: 1;
  overflow-y: auto;
  margin: 1rem 0;
  min-height: 0;
  padding-right: .25rem;
}
.rank-row {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .8rem; margin-bottom: .35rem;
  background: var(--surf); border-radius: 8px; border: 1px solid var(--border);
}
.rank-medal { font-size: 1.2rem; width: 1.7rem; text-align: center; }
.rank-name  { flex: 1; font-size: .9rem; text-align: left; }
.rank-score { font-weight: 700; color: var(--green); font-size: .95rem; }
.rank-miss  { font-size: .72rem; color: var(--warn); }

/* 4位以降：横並びタイル */
.rank-others {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem;
}
.rank-others-item {
  display: flex; align-items: center; gap: .35rem;
  padding: .3rem .6rem;
  background: var(--surf); border-radius: 6px; border: 1px solid var(--border);
  font-size: .8rem;
}
.rank-others-pos   { color: var(--dim); font-size: .72rem; white-space: nowrap; }
.rank-others-name  { font-weight: 600; }
.rank-others-name small { font-weight: 400; color: var(--dim); margin-left: .2rem; }
.rank-others-score { color: var(--green); font-weight: 700; white-space: nowrap; }

/* ── 盤面整理タイム／対局中カウントダウン ──────────────────── */
.arrange-badge {
  font-size: .78rem; font-weight: 700; color: var(--bg);
  background: linear-gradient(135deg, #ffd060, #ff9944);
  border-radius: 10px; padding: .2rem .65rem; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.btn-revival {
  background: linear-gradient(135deg, #6a1a5a, #3a0030);
  color: #fce; border: 1px solid #bf4aaf;
}
.btn-revival:hover { filter: brightness(1.25); }

.rr-divider { border-top: 1px solid var(--border); margin: .8rem 0 .6rem; }
.rr-revival-progress {
  font-size: .85rem; font-weight: 700; color: #fce;
  background: rgba(106, 26, 90, .3); border: 1px solid #bf4aaf;
  border-radius: 8px; padding: .45rem .8rem; margin-bottom: .6rem;
  text-align: center;
}

/* ── モードタブ ──────────────────────────────────────────── */
.rr-mode-tabs {
  display: flex; gap: .4rem; margin: .5rem 0 .4rem;
  border-bottom: 1px solid var(--border); padding-bottom: .4rem;
}
.rr-tab {
  flex: 1; padding: .4rem .6rem; border-radius: 6px 6px 0 0;
  background: var(--surf); border: 1px solid var(--border); border-bottom: none;
  color: var(--dim); font-size: .85rem; cursor: pointer; transition: all .15s;
}
.rr-tab.active { background: var(--surf2); color: var(--accent); border-color: var(--accent); }
.rr-tab:hover:not(.active) { color: var(--text); }

/* ── 復活戦ユーザー選択リスト ────────────────────────────── */
.rr-user-list {
  max-height: 140px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
  padding: .3rem; margin-bottom: .3rem;
}
.rr-user-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .4rem; border-radius: 6px; cursor: pointer;
  font-size: .88rem; transition: background .12s;
}
.rr-user-item:hover { background: var(--surf2); }
.rr-user-item input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; cursor: pointer; }
.rr-user-dot { width: .7rem; height: .7rem; border-radius: 50%; flex-shrink: 0; }

.btn-sm {
  padding: .2rem .8rem; font-size: .8rem; border-radius: 6px;
  background: var(--surf2); border: 1px solid var(--border); color: var(--dim);
  cursor: pointer; transition: all .12s;
}
.btn-sm:hover { color: var(--text); border-color: var(--accent); }

/* ── グループ戦ボタン ────────────────────────────────────── */
.group-btns { display: flex; flex-direction: column; gap: .5rem; margin: .2rem 0; }
.btn-group-top, .btn-group-middle, .btn-group-bottom {
  width: 100%; padding: .6rem 1rem; border-radius: 10px; border: 1px solid;
  cursor: pointer; font-size: .9rem; font-weight: 600;
  text-align: center; line-height: 1.4; transition: filter .15s;
}
.btn-group-top {
  background: linear-gradient(135deg, #4a2800, #7a5200);
  color: #ffe0a0; border-color: #c8900a;
}
.btn-group-middle {
  background: linear-gradient(135deg, #1a2a3a, #2a3f55);
  color: #b0d4f0; border-color: #4a8abb;
}
.btn-group-bottom {
  background: linear-gradient(135deg, #1a2a1a, #2a402a);
  color: #a0d4a0; border-color: #4a8a4a;
}
.btn-group-top:hover, .btn-group-middle:hover, .btn-group-bottom:hover { filter: brightness(1.25); }
.btn-group-top small, .btn-group-middle small, .btn-group-bottom small {
  display: block; font-size: .75rem; font-weight: 400; opacity: .8;
}

/* サブテキスト色 */
:root { --subtext: #5a7aaa; }

/* ── ロビー敗者復活戦セクション ───────────────────────── */
/* ── Spectator panel（敗退者の自動観戦画面）。盤面はそのまま見せたまま、
   ニコニコ動画のように右から左へ流れるコメントと、画面下部のリアクション・
   コメント入力バーだけを盤面に重ねて表示する ──────────────────────── */
.spec-panel {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  pointer-events: none;   /* 下部バー以外は素通しして盤面が見えるようにする */
}
.spec-panel.hidden { display: none; }
.spec-comments-layer { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.spec-comment {
  position: absolute; left: 100%; white-space: nowrap;
  font-weight: 800; font-size: 1.35rem; line-height: 1;
  color: #fff; text-shadow: 0 0 5px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.6);
  animation: specCommentFly linear forwards;
}
.spec-comment.me { color: #9fd4ff; }
@keyframes specCommentFly {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100vw - 100%)); }
}
.spec-bottom-bar {
  pointer-events: auto; flex: none;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: rgba(6, 8, 26, .82); backdrop-filter: blur(6px);
  border-top: 1px solid var(--border); border-radius: 0 0 12px 12px;
  padding: .5rem .7rem;
}
.spec-react-bar { display: flex; gap: .3rem; flex-wrap: wrap; flex: none; }
.spec-react-btn { font-size: 1.3rem; background: var(--surf2); border: 1px solid var(--border); border-radius: 10px; padding: .1rem .5rem; cursor: pointer; transition: transform .1s, border-color .15s; }
.spec-react-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.spec-react-btn:active { transform: scale(.92); }
.spec-chat-form { flex: 1; min-width: 160px; display: flex; gap: .4rem; }
.spec-chat-form input { flex: 1; padding: .45rem .7rem; background: var(--surf2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .9rem; outline: none; }
.spec-chat-form input:focus { border-color: var(--accent); }
.spec-chat-form .btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.spec-chat-warn { pointer-events: none; color: var(--danger); font-weight: 700; font-size: .85rem; text-align: center; min-height: 1.3em; flex: none; text-shadow: 0 0 6px rgba(0,0,0,.9); }
.react-float-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.react-float { position: absolute; bottom: 70px; display: flex; flex-direction: column; align-items: center; animation: reactUp 2.6s ease-out forwards; }
.react-float span { font-size: 2.6rem; line-height: 1; }
.react-float small { font-size: .7rem; color: var(--dim); white-space: nowrap; text-shadow: 0 0 6px rgba(0,0,0,.9); }
@keyframes reactUp {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  12%  { opacity: 1; transform: translateY(-30px) scale(1.1); }
  85%  { opacity: 1; }
  100% { transform: translateY(-380px) scale(1); opacity: 0; }
}

/* ── Lobby mode select ────────────────────────────────── */
.lobby-mode-select { margin: .6rem 0 1rem; }
.lobby-mode-btns { display: flex; gap: .7rem; margin-top: .5rem; }
.btn-mode {
  flex: 1; padding: 1.1rem .8rem; border-radius: 12px;
  background: var(--surf); border: 1px solid var(--border);
  color: var(--text); font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: all .15s; line-height: 1.6;
}
.btn-mode:hover { border-color: var(--accent); filter: brightness(1.15); transform: translateY(-1px); }
.btn-mode small { display: block; color: var(--dim); font-size: .72rem; font-weight: 400; margin-top: .15rem; }
.btn-back {
  display: inline-block; margin-bottom: .8rem; padding: .35rem .8rem;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--dim); font-size: .78rem; cursor: pointer; transition: all .15s;
}
.btn-back:hover { color: var(--text); border-color: var(--accent); }

/* ── Grade/course（名前入力画面）───────────────────────── */
.grade-course-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.grade-select, .course-select {
  flex: 1; padding: .6rem .5rem;
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
}

/* ── House assignment（ロビー・大会モード）───────────────── */
.lobby-house-section {
  width: 100%; margin: .8rem 0 .5rem;
  padding: .8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.lobby-house-title {
  font-size: 1rem; font-weight: 700; color: var(--green);
  margin-bottom: .25rem; letter-spacing: .03em;
}
.lobby-house-list { margin-top: .7rem; display: flex; flex-direction: column; gap: .5rem; max-height: 260px; overflow-y: auto; }
.house-block { background: var(--surf); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; }
.house-block-title { font-size: .82rem; font-weight: 700; color: var(--accent); margin-bottom: .3rem; }
.house-member { font-size: .78rem; color: var(--text); padding: .1rem 0; }
.house-member small { color: var(--dim); }

.lobby-revival-section {
  width: 100%; margin: .8rem 0 .5rem;
  padding: .8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: opacity .3s;
}
.lobby-revival-section.locked {
  opacity: 0.35;
  pointer-events: none;
}
.lobby-revival-title {
  font-size: 1rem; font-weight: 700; color: var(--accent);
  margin-bottom: .25rem; letter-spacing: .03em;
}
.lobby-revival-desc {
  font-size: .78rem; color: var(--subtext); margin-bottom: .6rem;
}

.btn-debug {
  display: inline-block; padding: .5rem 1.2rem; margin-top: .6rem;
  border-radius: 8px; font-size: .8rem; font-weight: 600;
  cursor: pointer; border: 1px dashed var(--dim);
  background: transparent; color: var(--dim);
  transition: all .2s; letter-spacing: .03em;
}
.btn-debug:hover { border-color: var(--warn); color: var(--warn); }

/* ── Read button（ホスト専用の読み上げボタン）───────────── */
.read-btn {
  background: linear-gradient(135deg, #1a6a1a, #0a3a0a);
  border: 1px solid #4adf4a; border-radius: 8px;
  color: #afe; font-size: .85rem; font-weight: 700;
  padding: .4rem .9rem; cursor: pointer;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
  align-self: flex-start; margin-top: .05rem;
  letter-spacing: .04em;
}
.read-btn:hover { filter: brightness(1.3); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 200, 80, .35); }
.read-btn:active { transform: translateY(0); }
.read-btn.hidden { display: none; }
.read-btn:disabled {
  background: linear-gradient(135deg, #333, #1a1a1a);
  border-color: var(--border); color: var(--dim);
  cursor: not-allowed; filter: none;
}
.read-btn:disabled::before { content: '🚫 '; }
.read-btn:disabled:hover { filter: none; transform: none; box-shadow: none; }

/* ── Lobby host badge ────────────────────────────────────── */
.lobby-host { font-size: .7rem; color: var(--warn); margin-left: .2rem; }

/* ── 対局画面のレイアウト（左：ランキング／中央：読み上げ＋盤面／右：判定の内訳）──
   画面いっぱいに使い、ページ全体はスクロールさせない。ランキングは左の縦のスペースを
   すべて使い、入りきらない分は内側のスクロールバーで見る。 */
.game-layout {
  display: grid; grid-template-columns: 270px minmax(0, 1fr) 310px; gap: 12px;
  height: calc(100vh - var(--hdr, 56px)); padding: 8px 12px; margin: 0; max-width: none;
}
.game-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.side-panel { width: auto; min-height: 0; padding-top: 0; display: flex; flex-direction: column; }
.side-panel.hidden { display: none; }
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 200px minmax(0, 1fr) 230px; }
}

.top3-wrap { margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.top3-label {
  font-size: .8rem; color: var(--dim); font-weight: 700;
  letter-spacing: .04em; white-space: nowrap; margin-bottom: .4rem; display: block; flex: none;
}
.rank-count { font-weight: 400; font-size: .72rem; margin-left: .3rem; }
.top3-list {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px; padding-right: 4px;
}
.top3-list::-webkit-scrollbar { width: 8px; }
.top3-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.house-score-wrap { margin: 0 0 .8rem; flex: none; }
.house-score-wrap.hidden { display: none; }
.house-score-list {
  display: grid; grid-template-columns: 1fr; gap: .25rem;
}
.house-score-chip {
  display: flex; align-items: center; justify-content: space-between; gap: .3rem;
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 6px; padding: .2rem .5rem; font-size: .78rem; font-weight: 700;
}
.house-score-chip .hs-score { color: var(--green); }

/* ランキングの行は全員同じ見た目。順位は先頭のアイコンだけ（上位でも色は変えない）。自分の行だけ青で強調。 */
.t3-row {
  display: flex; align-items: center; gap: .35rem; flex: none;
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 6px; padding: .28rem .5rem;
  min-width: 0;
}
.t3-rank  { font-size: .95rem; font-weight: 700; flex-shrink: 0; min-width: 2.1rem; text-align: center; color: var(--dim); }
.t3-name  { flex: 1; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t3-cpu   { font-size: .6rem; background: var(--surf); border: 1px solid var(--border); border-radius: 3px; padding: 0 .25rem; margin-left: .25rem; color: var(--dim); vertical-align: middle; }
.t3-you   { font-size: .6rem; background: rgba(74,158,255,.25); border-radius: 3px; padding: 0 .3rem; margin-left: .25rem; color: #cfe6ff; font-weight: 700; vertical-align: middle; }
.t3-score { font-size: .85rem; font-weight: 700; color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t3-score small { font-size: .62rem; font-weight: 400; color: var(--dim); margin-left: .1rem; }

.t3-row.me {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(74, 158, 255, .32), rgba(74, 158, 255, .12));
}
.t3-row.me .t3-name  { color: #fff; font-weight: 800; }
.t3-row.me .t3-score { color: #8ff; }

/* 大会モード中、今の試合で何位までが通過かを示すボーダー（ランキング更新のたびに位置も更新される） */
.t3-cutoff-divider { height: 3px; background: var(--warn); border-radius: 2px; margin: .2rem 0; box-shadow: 0 0 6px rgba(255,170,68,.6); flex: none; }

/* ── 取得通知バナー（右サイドパネルに常設）──────────────────── */
.taken-notif {
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  background: rgba(10, 16, 40, .96);
  border: 2px solid var(--accent); border-radius: 14px;
  padding: 1rem .8rem;
  font-size: 1rem; font-weight: 700; text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  animation: tnSlideIn .3s cubic-bezier(.2, .8, .4, 1);
}
.taken-notif.hidden  { display: none; }
.taken-notif.tn-fade { animation: tnSlideOut .5s ease forwards; }

@keyframes tnSlideIn {
  from { opacity: 0; transform: translateY(-14px) scale(.92); }
  to   { opacity: 1; transform: translateY(0)      scale(1);   }
}
@keyframes tnSlideOut {
  to   { opacity: 0; transform: translateY(-10px) scale(.95); }
}

.tn-dot   { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; }
.tn-name  { color: #fff; }
.tn-label { color: var(--green); }

/* お手付き中（次の札が読まれるまで取れない） */
.grid.grab-locked .card { cursor: not-allowed !important; filter: grayscale(.6) brightness(.7); }
.grid.grab-locked .card:hover { transform: none !important; box-shadow: none !important; }
.lock-banner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: rgba(120, 30, 40, .92); color: #fff; padding: .45rem 1.1rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); pointer-events: none;
}
.lock-banner.hidden { display: none; }

/* ── 判定の内訳（札を取った直後〜次の札が読まれるまでずっと表示）── */
.score-panel {
  margin-top: 10px; flex: none;
  background: rgba(10, 16, 40, .96); border: 1px solid var(--border); border-radius: 12px;
  padding: .8rem .9rem; font-size: .85rem; animation: tnSlideIn .3s cubic-bezier(.2, .8, .4, 1);
}
.score-panel.miss { border-color: var(--danger); }
.sp-title { font-weight: 800; font-size: .95rem; margin-bottom: .45rem; display: flex; align-items: center; gap: .4rem; }
.sp-title .tn-dot { width: 11px; height: 11px; }
.sp-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .28rem 0; border-bottom: 1px solid rgba(42, 63, 112, .5); }
.sp-label { color: var(--dim); font-size: .78rem; white-space: nowrap; }
.sp-detail { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.sp-detail small { display: block; font-size: .7rem; color: var(--dim); font-weight: 400; }
.sp-pts { color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.6rem; text-align: right; }
.sp-hc { color: var(--warn); }
.sp-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: .5rem; font-weight: 800; }
.sp-total .sp-big { font-size: 1.7rem; color: #8ff; font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(0, 229, 160, .45); }
.sp-miss-big { font-size: 1.7rem; font-weight: 800; color: var(--danger); font-variant-numeric: tabular-nums; }
.sp-cont { margin-top: .55rem; font-size: .72rem; color: var(--dim); line-height: 1.6; }
.sp-cont b { color: var(--text); }
.sp-cont .win { color: var(--green); }

/* クリックした人の一覧（縦に1行ずつ。人数が多いときはスクロールで見る） */
.sp-list-title { margin-top: .7rem; font-size: .75rem; font-weight: 700; color: var(--dim); }
.sp-list { margin-top: .25rem; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 3px; }
.sp-list::-webkit-scrollbar { width: 7px; }
.sp-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sp-li { display: grid; grid-template-columns: minmax(0, 1fr) 3.6rem 3.9rem 2.6rem; gap: .3rem; align-items: baseline;
  padding: .2rem .4rem; border-radius: 6px; font-size: .74rem; font-variant-numeric: tabular-nums; }
.sp-li span { white-space: nowrap; }
.sp-li .n { overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.sp-li span:nth-child(n+2) { text-align: right; }
.sp-li.head { position: sticky; top: 0; background: var(--surf2, #0a1428); color: var(--dim); font-size: .66rem; padding-top: 0; padding-bottom: 0; }
.sp-li.win { background: rgba(0, 229, 160, .16); }
/* 自分の行は一目でわかるよう、枠と背景ではっきり強調する（ランキング等の自分の行と同じ配色） */
.sp-li.me { border: 2px solid var(--accent); padding: .15rem .35rem;
  background: linear-gradient(135deg, rgba(74, 158, 255, .3), rgba(74, 158, 255, .1)); }
.sp-li.win.me { background: linear-gradient(135deg, rgba(0, 229, 160, .32), rgba(74, 158, 255, .12)); }
.sp-li.me .n { font-weight: 800; color: #fff; }

/* ══ 和風（試合中の画面）══════════════════════════════════════
   試合中(盤面整理タイムを含む)だけ body.in-game を付け、色の変数を和の色に差し替える。
   盤面は畳、札は和紙の取り札、読み上げ欄・判定パネルは和紙の札風にする。 */
body.in-game {
  --bg: #1b130c; --surf: #2b2016; --surf2: #38291b; --border: #73552f;
  --accent: #e2ae4a; --green: #a8d46f; --text: #f3e8cf; --dim: #bfa883;
  --danger: #ea5a43; --warn: #f2b955; --me: #69bfe0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 3px, transparent 3px 11px), #1b130c;
}
body.in-game .header {
  background: linear-gradient(#33241a, #251a11); border-bottom: 3px solid #5a4024;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
body.in-game .logo { font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'MS PMincho', serif; color: #e8c06a; letter-spacing: .08em; }
body.in-game .round-badge { background: linear-gradient(135deg, #b8382a, #8a2418); color: #fff3dc; }
body.in-game .chip { background: #3a2b1c; border-color: var(--border); }
body.in-game .chip.me { border: 2px solid var(--me); background: linear-gradient(135deg, rgba(105, 191, 224, .25), rgba(105, 191, 224, .08)); }
body.in-game .chip.me .chip-score { color: #bfeaff; }
body.in-game .game-timer { color: #e8c06a; }

body.in-game .reading-box {
  background: linear-gradient(135deg, #f6eed9, #ecdfc0); border: 1px solid #b79f7c; border-left: 8px solid #c4382a;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
body.in-game .reading-label { color: #a8352a; }
body.in-game .reading-text { color: #221b13; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'MS PMincho', serif; font-weight: 700; }
body.in-game .host-notice { color: #6a4a1c; }

body.in-game .top3-label { color: #e8c06a; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'MS PMincho', serif; font-size: .95rem; }
body.in-game .t3-row { background: #3a2b1c; border-color: #5d4426; }
body.in-game .t3-row.me { border: 2px solid var(--me); background: linear-gradient(135deg, rgba(105, 191, 224, .3), rgba(105, 191, 224, .1)); }
body.in-game .t3-row.me .t3-score { color: #bfeaff; }
body.in-game .t3-you { background: rgba(105, 191, 224, .3); color: #e6f6ff; }
body.in-game .top3-list::-webkit-scrollbar-thumb { background: #73552f; }

body.in-game .taken-notif { background: #f6eed9; border-color: #c4382a; color: #221b13; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
body.in-game .tn-name { color: #221b13; }
body.in-game .tn-label { color: #9b2a1f; }

body.in-game .score-panel { background: #f6eed9; border-color: #b79f7c; color: #221b13; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
body.in-game .score-panel.miss { border-color: #c4382a; }
body.in-game .sp-title { color: #221b13; }
body.in-game .sp-row { border-bottom-color: #d4c4a0; }
body.in-game .sp-label { color: #7a6444; }
body.in-game .sp-detail { color: #1f1a14; }
body.in-game .sp-detail small { color: #7a6444; }
body.in-game .sp-pts { color: #2f6b25; }
body.in-game .sp-total .sp-big { color: #9b2a1f; text-shadow: none; }
body.in-game .sp-miss-big { color: #b4301f; }
body.in-game .sp-cont, body.in-game .sp-list-title, body.in-game .sp-li.head { color: #7a6444; }
body.in-game .sp-cont b { color: #221b13; }
body.in-game .sp-li.win { background: rgba(196, 56, 42, .14); }
body.in-game .sp-li.me { border-color: #c4382a; background: linear-gradient(135deg, rgba(196, 56, 42, .28), rgba(196, 56, 42, .1)); }
body.in-game .sp-li.me .n { color: #221b13; }

/* 盤面＝畳（2×2枚）。縁(黒い帯)が上下の長い辺にある */
body.in-game .board-wrap {
  background: #24180e; border: 6px solid #3b2615; border-radius: 6px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .5), 0 6px 24px rgba(0, 0, 0, .55);
}
body.in-game .grid {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27640%27%20height%3D%27440%27%20viewBox%3D%270%200%20640%20440%27%3E%0A%3Crect%20width%3D%27640%27%20height%3D%27440%27%20fill%3D%27%23a3b172%27%2F%3E%0A%3Crect%20y%3D%2714%27%20width%3D%27640%27%20height%3D%27412%27%20fill%3D%27%23a9b778%27%2F%3E%0A%3Cg%20stroke%3D%27%2393a263%27%20stroke-width%3D%271.2%27%20opacity%3D%27.55%27%3E%3Cline%20x1%3D%278%27%20y1%3D%2714%27%20x2%3D%278%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2716%27%20y1%3D%2714%27%20x2%3D%2716%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2724%27%20y1%3D%2714%27%20x2%3D%2724%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2732%27%20y1%3D%2714%27%20x2%3D%2732%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2740%27%20y1%3D%2714%27%20x2%3D%2740%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2748%27%20y1%3D%2714%27%20x2%3D%2748%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2756%27%20y1%3D%2714%27%20x2%3D%2756%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2764%27%20y1%3D%2714%27%20x2%3D%2764%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2772%27%20y1%3D%2714%27%20x2%3D%2772%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2780%27%20y1%3D%2714%27%20x2%3D%2780%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2788%27%20y1%3D%2714%27%20x2%3D%2788%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2796%27%20y1%3D%2714%27%20x2%3D%2796%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27104%27%20y1%3D%2714%27%20x2%3D%27104%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27112%27%20y1%3D%2714%27%20x2%3D%27112%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27120%27%20y1%3D%2714%27%20x2%3D%27120%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27128%27%20y1%3D%2714%27%20x2%3D%27128%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27136%27%20y1%3D%2714%27%20x2%3D%27136%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27144%27%20y1%3D%2714%27%20x2%3D%27144%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27152%27%20y1%3D%2714%27%20x2%3D%27152%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27160%27%20y1%3D%2714%27%20x2%3D%27160%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27168%27%20y1%3D%2714%27%20x2%3D%27168%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27176%27%20y1%3D%2714%27%20x2%3D%27176%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27184%27%20y1%3D%2714%27%20x2%3D%27184%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27192%27%20y1%3D%2714%27%20x2%3D%27192%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27200%27%20y1%3D%2714%27%20x2%3D%27200%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27208%27%20y1%3D%2714%27%20x2%3D%27208%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27216%27%20y1%3D%2714%27%20x2%3D%27216%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27224%27%20y1%3D%2714%27%20x2%3D%27224%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27232%27%20y1%3D%2714%27%20x2%3D%27232%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27240%27%20y1%3D%2714%27%20x2%3D%27240%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27248%27%20y1%3D%2714%27%20x2%3D%27248%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27256%27%20y1%3D%2714%27%20x2%3D%27256%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27264%27%20y1%3D%2714%27%20x2%3D%27264%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27272%27%20y1%3D%2714%27%20x2%3D%27272%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27280%27%20y1%3D%2714%27%20x2%3D%27280%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27288%27%20y1%3D%2714%27%20x2%3D%27288%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27296%27%20y1%3D%2714%27%20x2%3D%27296%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27304%27%20y1%3D%2714%27%20x2%3D%27304%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27312%27%20y1%3D%2714%27%20x2%3D%27312%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27320%27%20y1%3D%2714%27%20x2%3D%27320%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27328%27%20y1%3D%2714%27%20x2%3D%27328%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27336%27%20y1%3D%2714%27%20x2%3D%27336%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27344%27%20y1%3D%2714%27%20x2%3D%27344%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27352%27%20y1%3D%2714%27%20x2%3D%27352%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27360%27%20y1%3D%2714%27%20x2%3D%27360%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27368%27%20y1%3D%2714%27%20x2%3D%27368%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27376%27%20y1%3D%2714%27%20x2%3D%27376%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27384%27%20y1%3D%2714%27%20x2%3D%27384%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27392%27%20y1%3D%2714%27%20x2%3D%27392%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27400%27%20y1%3D%2714%27%20x2%3D%27400%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27408%27%20y1%3D%2714%27%20x2%3D%27408%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27416%27%20y1%3D%2714%27%20x2%3D%27416%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27424%27%20y1%3D%2714%27%20x2%3D%27424%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27432%27%20y1%3D%2714%27%20x2%3D%27432%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27440%27%20y1%3D%2714%27%20x2%3D%27440%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27448%27%20y1%3D%2714%27%20x2%3D%27448%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27456%27%20y1%3D%2714%27%20x2%3D%27456%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27464%27%20y1%3D%2714%27%20x2%3D%27464%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27472%27%20y1%3D%2714%27%20x2%3D%27472%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27480%27%20y1%3D%2714%27%20x2%3D%27480%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27488%27%20y1%3D%2714%27%20x2%3D%27488%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27496%27%20y1%3D%2714%27%20x2%3D%27496%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27504%27%20y1%3D%2714%27%20x2%3D%27504%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27512%27%20y1%3D%2714%27%20x2%3D%27512%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27520%27%20y1%3D%2714%27%20x2%3D%27520%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27528%27%20y1%3D%2714%27%20x2%3D%27528%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27536%27%20y1%3D%2714%27%20x2%3D%27536%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27544%27%20y1%3D%2714%27%20x2%3D%27544%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27552%27%20y1%3D%2714%27%20x2%3D%27552%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27560%27%20y1%3D%2714%27%20x2%3D%27560%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27568%27%20y1%3D%2714%27%20x2%3D%27568%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27576%27%20y1%3D%2714%27%20x2%3D%27576%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27584%27%20y1%3D%2714%27%20x2%3D%27584%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27592%27%20y1%3D%2714%27%20x2%3D%27592%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27600%27%20y1%3D%2714%27%20x2%3D%27600%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27608%27%20y1%3D%2714%27%20x2%3D%27608%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27616%27%20y1%3D%2714%27%20x2%3D%27616%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27624%27%20y1%3D%2714%27%20x2%3D%27624%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27632%27%20y1%3D%2714%27%20x2%3D%27632%27%20y2%3D%27426%27%2F%3E%3C%2Fg%3E%0A%3Cg%20stroke%3D%27%23bcc88b%27%20stroke-width%3D%271%27%20opacity%3D%27.45%27%3E%3Cline%20x1%3D%2712%27%20y1%3D%2714%27%20x2%3D%2712%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2720%27%20y1%3D%2714%27%20x2%3D%2720%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2728%27%20y1%3D%2714%27%20x2%3D%2728%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2736%27%20y1%3D%2714%27%20x2%3D%2736%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2744%27%20y1%3D%2714%27%20x2%3D%2744%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2752%27%20y1%3D%2714%27%20x2%3D%2752%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2760%27%20y1%3D%2714%27%20x2%3D%2760%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2768%27%20y1%3D%2714%27%20x2%3D%2768%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2776%27%20y1%3D%2714%27%20x2%3D%2776%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2784%27%20y1%3D%2714%27%20x2%3D%2784%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%2792%27%20y1%3D%2714%27%20x2%3D%2792%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27100%27%20y1%3D%2714%27%20x2%3D%27100%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27108%27%20y1%3D%2714%27%20x2%3D%27108%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27116%27%20y1%3D%2714%27%20x2%3D%27116%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27124%27%20y1%3D%2714%27%20x2%3D%27124%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27132%27%20y1%3D%2714%27%20x2%3D%27132%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27140%27%20y1%3D%2714%27%20x2%3D%27140%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27148%27%20y1%3D%2714%27%20x2%3D%27148%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27156%27%20y1%3D%2714%27%20x2%3D%27156%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27164%27%20y1%3D%2714%27%20x2%3D%27164%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27172%27%20y1%3D%2714%27%20x2%3D%27172%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27180%27%20y1%3D%2714%27%20x2%3D%27180%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27188%27%20y1%3D%2714%27%20x2%3D%27188%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27196%27%20y1%3D%2714%27%20x2%3D%27196%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27204%27%20y1%3D%2714%27%20x2%3D%27204%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27212%27%20y1%3D%2714%27%20x2%3D%27212%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27220%27%20y1%3D%2714%27%20x2%3D%27220%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27228%27%20y1%3D%2714%27%20x2%3D%27228%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27236%27%20y1%3D%2714%27%20x2%3D%27236%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27244%27%20y1%3D%2714%27%20x2%3D%27244%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27252%27%20y1%3D%2714%27%20x2%3D%27252%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27260%27%20y1%3D%2714%27%20x2%3D%27260%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27268%27%20y1%3D%2714%27%20x2%3D%27268%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27276%27%20y1%3D%2714%27%20x2%3D%27276%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27284%27%20y1%3D%2714%27%20x2%3D%27284%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27292%27%20y1%3D%2714%27%20x2%3D%27292%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27300%27%20y1%3D%2714%27%20x2%3D%27300%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27308%27%20y1%3D%2714%27%20x2%3D%27308%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27316%27%20y1%3D%2714%27%20x2%3D%27316%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27324%27%20y1%3D%2714%27%20x2%3D%27324%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27332%27%20y1%3D%2714%27%20x2%3D%27332%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27340%27%20y1%3D%2714%27%20x2%3D%27340%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27348%27%20y1%3D%2714%27%20x2%3D%27348%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27356%27%20y1%3D%2714%27%20x2%3D%27356%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27364%27%20y1%3D%2714%27%20x2%3D%27364%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27372%27%20y1%3D%2714%27%20x2%3D%27372%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27380%27%20y1%3D%2714%27%20x2%3D%27380%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27388%27%20y1%3D%2714%27%20x2%3D%27388%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27396%27%20y1%3D%2714%27%20x2%3D%27396%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27404%27%20y1%3D%2714%27%20x2%3D%27404%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27412%27%20y1%3D%2714%27%20x2%3D%27412%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27420%27%20y1%3D%2714%27%20x2%3D%27420%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27428%27%20y1%3D%2714%27%20x2%3D%27428%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27436%27%20y1%3D%2714%27%20x2%3D%27436%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27444%27%20y1%3D%2714%27%20x2%3D%27444%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27452%27%20y1%3D%2714%27%20x2%3D%27452%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27460%27%20y1%3D%2714%27%20x2%3D%27460%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27468%27%20y1%3D%2714%27%20x2%3D%27468%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27476%27%20y1%3D%2714%27%20x2%3D%27476%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27484%27%20y1%3D%2714%27%20x2%3D%27484%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27492%27%20y1%3D%2714%27%20x2%3D%27492%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27500%27%20y1%3D%2714%27%20x2%3D%27500%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27508%27%20y1%3D%2714%27%20x2%3D%27508%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27516%27%20y1%3D%2714%27%20x2%3D%27516%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27524%27%20y1%3D%2714%27%20x2%3D%27524%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27532%27%20y1%3D%2714%27%20x2%3D%27532%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27540%27%20y1%3D%2714%27%20x2%3D%27540%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27548%27%20y1%3D%2714%27%20x2%3D%27548%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27556%27%20y1%3D%2714%27%20x2%3D%27556%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27564%27%20y1%3D%2714%27%20x2%3D%27564%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27572%27%20y1%3D%2714%27%20x2%3D%27572%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27580%27%20y1%3D%2714%27%20x2%3D%27580%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27588%27%20y1%3D%2714%27%20x2%3D%27588%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27596%27%20y1%3D%2714%27%20x2%3D%27596%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27604%27%20y1%3D%2714%27%20x2%3D%27604%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27612%27%20y1%3D%2714%27%20x2%3D%27612%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27620%27%20y1%3D%2714%27%20x2%3D%27620%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27628%27%20y1%3D%2714%27%20x2%3D%27628%27%20y2%3D%27426%27%2F%3E%3Cline%20x1%3D%27636%27%20y1%3D%2714%27%20x2%3D%27636%27%20y2%3D%27426%27%2F%3E%3C%2Fg%3E%0A%3Crect%20width%3D%27640%27%20height%3D%2714%27%20fill%3D%27%231f2a1d%27%2F%3E%3Crect%20y%3D%27426%27%20width%3D%27640%27%20height%3D%2714%27%20fill%3D%27%231f2a1d%27%2F%3E%0A%3Crect%20y%3D%2713%27%20width%3D%27640%27%20height%3D%271.5%27%20fill%3D%27%23506046%27%2F%3E%3Crect%20y%3D%27426%27%20width%3D%27640%27%20height%3D%271.5%27%20fill%3D%27%23506046%27%2F%3E%0A%3Crect%20width%3D%274%27%20height%3D%27440%27%20fill%3D%27%23243020%27%20opacity%3D%27.7%27%2F%3E%3Crect%20x%3D%27636%27%20width%3D%274%27%20height%3D%27440%27%20fill%3D%27%23243020%27%20opacity%3D%27.7%27%2F%3E%0A%3C%2Fsvg%3E");
  background-size: 640px 440px;
  box-shadow: 0 0 30px rgba(0, 0, 0, .45);
}
body.in-game .grid::before { display: none; }

/* 定位置の円は朱色 */
body.in-game .home-circle {
  border-color: #c4382a; background: rgba(246, 238, 217, .4); color: #8f2519;
  box-shadow: 0 0 0 3px rgba(246, 238, 217, .55), 0 0 16px rgba(196, 56, 42, .4);
}

/* 札＝和紙の取り札（墨の文字・朱の内枠） */
body.in-game .card {
  background: linear-gradient(160deg, #fbf5e6, #efe3c6);
  border: 2px solid #3a2c1e; border-radius: 4px;
  color: #1c1712; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'MS PMincho', serif; font-weight: 700;
  box-shadow: 0 3px 0 #b7a577, 0 6px 10px rgba(0, 0, 0, .4);
}
body.in-game .card::before {
  content: ''; position: absolute; inset: 4px; border: 1px solid rgba(176, 48, 36, .55); border-radius: 2px; pointer-events: none;
}
body.in-game .card:hover:not(.removed):not(.correct-mine):not(.correct-other):not(.wrong),
body.in-game .card.vhover:not(.removed):not(.correct-mine):not(.correct-other):not(.wrong) {
  background: linear-gradient(160deg, #fffaf0, #f6ebcf); border-color: #c4382a; color: #000;
  box-shadow: 0 6px 0 #b7a577, 0 12px 18px rgba(0, 0, 0, .5);
}
body.in-game .card.drag-bad { border-color: #e03a28; box-shadow: 0 0 0 3px rgba(224, 58, 40, .6); }
body.in-game .card.host-forbidden::after,
body.in-game .grid.grab-forbidden .card:not(.removed):hover::after,
body.in-game .grid.grab-forbidden .card.vhover:not(.removed)::after,
body.in-game .card.correct-mine:hover::after, body.in-game .card.correct-other:hover::after, body.in-game .card.wrong:hover::after {
  background: rgba(27, 19, 12, .6);
}
body.in-game .grid.grab-locked .card { filter: grayscale(.5) brightness(.8); }
body.in-game .lock-prompt { background: rgba(27, 19, 12, .82); }
body.in-game .lock-prompt-box { background: #f6eed9; color: #221b13; border-color: #c4382a; }
body.in-game .lock-prompt-box small { color: #7a6444; }

/* 試合開始の待ち合わせ画面（ハンデの説明つき） */
.lock-prompt.ready-wait { pointer-events: none; cursor: default; }
.lock-prompt-box { max-width: 560px; }
.start-extra { margin-top: .9rem; font-size: .95rem; font-weight: 400; text-align: left; }
.hc-box { background: rgba(255, 255, 255, .06); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; line-height: 1.7; }
.hc-box b { font-weight: 800; }
.hc-box table { width: 100%; border-collapse: collapse; margin: .3rem 0; font-size: .85rem; }
.hc-box th, .hc-box td { padding: .15rem .4rem; border-bottom: 1px solid rgba(128, 128, 128, .3); text-align: left; font-weight: 400; }
.hc-box th { font-weight: 700; }
.hc-mine { margin-top: .4rem; font-size: 1.05rem; font-weight: 800; }
.hc-mine.none { color: var(--green); }
.hc-mine.has { color: var(--warn); }
.start-status { margin-top: .6rem; font-weight: 700; text-align: center; font-size: 1rem; }
.start-note { margin-top: .4rem; font-size: .72rem; color: var(--dim); text-align: center; }
body.in-game .hc-box { background: rgba(176, 48, 36, .06); border-color: #c9b58a; }
body.in-game .hc-mine.has { color: #a8352a; }
body.in-game .hc-mine.none { color: #2f6b25; }
body.in-game .start-note { color: #7a6444; }
.hc-box th:nth-child(n+2), .hc-box td:nth-child(n+2) { white-space: nowrap; }

/* マウスが定位置に戻った（読み上げ開始の案内〜上の句の1文字目まで）ときの強調 */
.home-circle.alert {
  border-style: solid; border-width: 4px; border-color: #ffd23a; background: rgba(255, 210, 58, .38);
  color: #fff; z-index: 3; animation: homePulse .7s ease-in-out infinite;
}
@keyframes homePulse {
  0%, 100% { scale: 1;    box-shadow: 0 0 0 4px rgba(255, 210, 58, .55), 0 0 22px rgba(255, 210, 58, .85); }
  50%      { scale: 1.22; box-shadow: 0 0 0 16px rgba(255, 210, 58, .16), 0 0 46px rgba(255, 210, 58, 1); }
}
body.in-game .home-circle.alert {
  border-color: #e8301c; background: rgba(255, 255, 255, .7); color: #b01c0c;
  animation-name: homePulseWafu;
}
@keyframes homePulseWafu {
  0%, 100% { scale: 1;    box-shadow: 0 0 0 4px rgba(232, 48, 28, .5), 0 0 22px rgba(232, 48, 28, .8); }
  50%      { scale: 1.22; box-shadow: 0 0 0 16px rgba(232, 48, 28, .15), 0 0 46px rgba(232, 48, 28, 1); }
}

/* ── 投影専用画面 ──────────────────────────────────────────── */
body.pj-body { overflow: hidden; }
.pj-main { display: flex; height: 100vh; }
.pj-left {
  flex: 1.3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3vw; border-right: 1px solid var(--border); text-align: center;
}
.pj-status { font-size: 2.6vw; font-weight: 700; color: var(--accent); margin-bottom: 1.2vw; }
.pj-yomi   { font-size: 4.2vw; font-weight: 800; line-height: 1.3; }
.pj-right  { flex: 1; display: flex; flex-direction: column; padding: 2vw; min-width: 0; }
.pj-ranking-title { font-size: 1.8vw; font-weight: 700; color: var(--dim); margin-bottom: .8vw; }
.pj-ranking { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .4vw; }
.pj-rank-row {
  display: grid; grid-template-columns: 2.6vw 1fr auto; gap: .8vw; align-items: center;
  font-size: 1.6vw; padding: .3vw .5vw; border-radius: .4vw; background: var(--surf);
}
.pj-rank-no    { font-size: 1.8vw; text-align: center; }
.pj-rank-name  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.pj-rank-cpu   { margin-left: .5vw; font-size: .9vw; color: var(--dim); }
.pj-rank-score { font-weight: 800; color: var(--green); white-space: nowrap; }
.pj-result {
  position: fixed; inset: 0; z-index: 300; background: rgba(4, 6, 20, .97);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3vw;
}
.pj-result.hidden { display: none; }
.pj-result-title { font-size: 3.2vw; font-weight: 800; color: var(--accent); margin-bottom: 2vw; }
.pj-result-table { width: min(60vw, 900px); max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: .5vw; }

/* ── 管理画面 ──────────────────────────────────────────────── */
body.admin-body { overflow-y: auto; padding: 1.5rem; }
.admin-wrap { max-width: 760px; margin: 0 auto; }
.admin-title { font-size: 1.6rem; margin-bottom: 1rem; }
.admin-card { background: var(--surf2); border: 1px solid var(--border); border-radius: .8rem; padding: 1.2rem; margin-bottom: 1.2rem; }
.admin-h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.admin-row { display: flex; flex-direction: column; gap: .2rem; margin: .7rem 0; }
.admin-row label { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.admin-row input[type="number"] { width: 5rem; background: var(--surf); border: 1px solid var(--border); color: var(--text); border-radius: .4rem; padding: .3rem .5rem; }
.admin-hint { font-size: .78rem; color: var(--dim); }
.admin-saved { margin-left: .8rem; color: var(--green); font-weight: 700; }
.admin-schedule { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0; }
.admin-sched-row { display: grid; grid-template-columns: 1fr 6.5rem auto auto auto; gap: .5rem; align-items: center; }
.admin-sched-label, .admin-sched-time { background: var(--surf); border: 1px solid var(--border); color: var(--text); border-radius: .4rem; padding: .3rem .5rem; }
.admin-sched-actual { font-size: .82rem; color: var(--green); white-space: nowrap; }
.btn-sched-start, .btn-sched-del { border: 1px solid var(--border); background: var(--surf); color: var(--text); border-radius: .4rem; padding: .3rem .6rem; cursor: pointer; }
.btn-sched-del { color: var(--danger); }

/* ── 負荷テスト ────────────────────────────────────────────── */
.btn-danger { background: linear-gradient(135deg, #8a2a2a, #4a0a0a); color: #fbb; border: 1px solid var(--danger); }
.loadtest-card { max-width: 480px; text-align: left; }
.lt-warn { background: rgba(255, 170, 68, .12); border: 1px solid var(--warn); color: var(--warn); border-radius: .6rem; padding: .7rem 1rem; margin: .8rem 0; font-size: .9rem; }
.loadtest-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 1rem 0; }
.loadtest-controls label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--dim); }
.loadtest-controls input[type="number"] { width: 5.5rem; background: var(--surf); border: 1px solid var(--border); color: var(--text); border-radius: .4rem; padding: .4rem .5rem; font-size: 1rem; }
.loadtest-status { background: var(--surf); border: 1px solid var(--border); border-radius: .6rem; padding: .8rem 1rem; margin-top: .6rem; display: flex; flex-direction: column; gap: .35rem; }
.lt-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; }
.lt-row span { color: var(--dim); }
.lt-row b { color: var(--text); }
.loadtest-note { margin-top: 1rem; font-size: .8rem; }

/* ── 実機ボットテストの通信・スペック診断パネル ──────────────────── */
.bot-metrics-panel {
  position: fixed; right: .6rem; bottom: .6rem; z-index: 500;
  background: rgba(10, 14, 36, .95); border: 1px solid var(--border); border-radius: .6rem;
  max-width: min(90vw, 560px); font-size: .78rem; color: var(--text);
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
}
.bot-metrics-panel.hidden { display: none; }
.bmp-header { padding: .45rem .7rem; cursor: pointer; white-space: nowrap; color: var(--dim); user-select: none; }
.bmp-header b { color: var(--text); }
.bmp-body { max-height: 40vh; overflow: auto; border-top: 1px solid var(--border); }
.bmp-body.collapsed { display: none; }
.bmp-table { border-collapse: collapse; width: 100%; }
.bmp-table th, .bmp-table td { padding: .25rem .5rem; text-align: right; white-space: nowrap; }
.bmp-table th:first-child, .bmp-table td:first-child { text-align: left; }
.bmp-table th { color: var(--dim); font-weight: 600; position: sticky; top: 0; background: rgba(10,14,36,.97); }
.bmp-table tr.bmp-bad   { color: var(--danger); }
.bmp-table tr.bmp-warn  { color: var(--warn); }
