/* ========================================================
   大相撲番付同定録 - スタイルシート (和風・Obra Dinnライク)
   中央共有番付表レイアウト (大相撲公式番付表スタイル)
   ======================================================== */

/* Google Fonts は index.html の <link> タグで先行読み込みしています */

:root {
  /* ========================================================
     ★ 下部バナー広告エリアの高さ設定
     将来広告を配置する際、広告サイズに合わせてこの数値を調整してください。
     例: スマホ標準(50px)〜PCリーダーボード(90px) + 余白 = 100px
     ======================================================== */
  --ad-banner-height: 90px;
  /* --drawer-width: clamp(340px, 34vw, 560px); */
  --drawer-width: clamp(340px, 34vw, 800px);

  /* === PALETTE:START === */
  /* 00Doc/color_palette.md から自動生成（python3 scripts/apply_palette.py） */
  /* --- マスターパレット変数 --- */
  --fc-5-1: #bd001a;
  --fc-5-2: #fa0066;
  --fc-5-3: #ff82c2;
  --fc-5-4: #ffd4e4;
  --fc-6-1: #b80000;
  --fc-6-2: #eb3300;
  --fc-6-3: #ff826e;
  --fc-6-4: #ffc9bd;
  --fc-7-1: #8c0e00;
  --fc-7-2: #db5814;
  --fc-7-3: #ffa645;
  --fc-7-4: #ffe3b8;
  --fc-8-1: #4d3600;
  --fc-8-2: #997f00;
  --fc-8-3: #ffca47;
  --fc-8-4: #ffedb0;
  --fc-9-1: #005200;
  --fc-9-2: #00a800;
  --fc-9-3: #8ee019;
  --fc-9-4: #e8ffb0;
  --fc-10-1: #005c00;
  --fc-10-2: #00bd00;
  --fc-10-3: #59eb54;
  --fc-10-4: #b8ffc9;
  --fc-11-1: #00471a;
  --fc-11-2: #00a342;
  --fc-11-3: #63ffa3;
  --fc-11-4: #bdffd6;
  --fc-12-1: #1f476b;
  --fc-12-2: #009199;
  --fc-12-3: #00f5e5;
  --fc-12-4: #adfff5;
  --fc-1-1: #2d1fa1;
  --fc-1-2: #007fff;
  --fc-1-3: #4ac9ff;
  --fc-1-4: #b8ecff;
  --fc-2-1: #0000bd;
  --fc-2-2: #2945ff;
  --fc-2-3: #6b80ff;
  --fc-2-4: #d1dfff;
  --fc-3-1: #5200b3;
  --fc-3-2: #9100ff;
  --fc-3-3: #b396ff;
  --fc-3-4: #dfd4ff;
  --fc-4-1: #9e0085;
  --fc-4-2: #d100d1;
  --fc-4-3: #ff85ff;
  --fc-4-4: #ffd4ff;
  --fc-0-1: #080808;
  --fc-0-2: #7d7d7d;
  --fc-0-3: #c7c7c7;
  --fc-0-4: #ffffff;
  --custom-skin-light: #fff4e6;
  --custom-skin-normal: #ffc9bd;
  --custom-skin-tan: #db956e;

  /* --- UIセマンティック変数（パレットID参照） --- */
  --bg-washi: var(--fc-8-4); /* #ffedb0 */
  --bg-washi-dark: var(--fc-8-3); /* #ffca47 */
  --bg-card: var(--fc-7-4); /* #ffe3b8 */
  --row-alt-bg: var(--fc-7-4); /* #ffe3b8 */
  --rank-cell-bg: var(--fc-8-4); /* #ffedb0 */
  --sanyaku-rank-bg: var(--fc-8-4); /* #ffedb0 */
  --card-hover-bg: var(--fc-8-4); /* #ffedb0 */
  --border-color: var(--fc-8-1); /* #4d3600 */
  --border-light: var(--fc-0-2); /* #7d7d7d */
  --border-subtle: var(--fc-0-1); /* #080808 */
  --text-main: var(--fc-0-1); /* #080808 */
  --text-muted: var(--fc-0-1); /* #080808 */
  --ink-black: var(--fc-12-1); /* #1f476b */
  --header-bg: var(--fc-0-1); /* #080808 */
  --header-text: var(--fc-0-4); /* #ffffff */
  --header-muted: var(--fc-0-4); /* #ffffff */
  --btn-bg: var(--fc-0-1); /* #080808 */
  --btn-hover-bg: var(--fc-8-2); /* #997f00 */
  --red-vermilion: var(--fc-6-1); /* #b80000 */
  --red-vermilion-hover: var(--fc-6-2); /* #eb3300 */
  --gold-accent: var(--fc-8-3); /* #ffca47 */
  --east-bg: var(--fc-11-1); /* #00471a */
  --west-bg: var(--fc-7-1); /* #8c0e00 */
  --tokuiwaza-color: var(--fc-11-1); /* #00471a */
  --tokuiwaza-bg: var(--fc-11-4); /* #bdffd6 */
  --tokuiwaza-border: var(--fc-11-2); /* #00a342 */
  --guess-color: var(--fc-12-1); /* #1f476b */
  --guess-bg: var(--fc-1-4); /* #b8ecff */
  --guess-border: var(--fc-1-2); /* #007fff */
  /* === PALETTE:END === */
  --font-mincho: 'Shippori Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  --font-brush: 'Yuji Boku', 'Shippori Mincho', serif;
  /* --font-brush: 'Yuji Mai', 'Shippori Mincho', serif; */
  /* --font-brush: 'Yuji Syuku', 'Shippori Mincho', serif; */

}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-washi);
  /* しっかり和紙・繊維入り＋金砂子（きんすなご）＋古和紙の焼けぼかし */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'%3E%3Cg%3E%3Crect x='28' y='42' width='3.2' height='2.4' rx='0.4' fill='%23c49228' opacity='0.43' transform='rotate(18 28 42)'/%3E%3Crect x='92' y='18' width='2.7' height='2' rx='0.4' fill='%23d8a83e' opacity='0.4' transform='rotate(-28 92 18)'/%3E%3Crect x='146' y='24' width='2.3' height='2.3' fill='%23e2b64c' opacity='0.41' transform='rotate(40 146 24)'/%3E%3Crect x='212' y='26' width='3.1' height='2.1' rx='0.4' fill='%23c49228' opacity='0.42' transform='rotate(14 212 26)'/%3E%3Crect x='262' y='66' width='3.4' height='2.5' rx='0.4' fill='%23b98620' opacity='0.4' transform='rotate(-22 262 66)'/%3E%3Crect x='304' y='18' width='2.1' height='1.8' fill='%23e5be58' opacity='0.41' transform='rotate(30 304 18)'/%3E%3Crect x='14' y='96' width='2.4' height='2.2' rx='0.4' fill='%23d8a83e' opacity='0.4' transform='rotate(-12 14 96)'/%3E%3Crect x='84' y='118' width='2.5' height='2' fill='%23d8a83e' opacity='0.43' transform='rotate(12 84 118)'/%3E%3Crect x='138' y='78' width='3' height='2.2' rx='0.4' fill='%23b98620' opacity='0.39' transform='rotate(24 138 78)'/%3E%3Crect x='214' y='136' width='3' height='2.8' rx='0.4' fill='%23c49228' opacity='0.39' transform='rotate(32 214 136)'/%3E%3Crect x='288' y='116' width='2.9' height='2' rx='0.4' fill='%23e2b64c' opacity='0.42' transform='rotate(-34 288 116)'/%3E%3Crect x='126' y='166' width='3.2' height='2.2' rx='0.4' fill='%23c49228' opacity='0.41' transform='rotate(-18 126 166)'/%3E%3Crect x='184' y='188' width='2.2' height='2.1' fill='%23e5be58' opacity='0.4' transform='rotate(42 184 188)'/%3E%3Crect x='258' y='164' width='2.7' height='2.3' rx='0.4' fill='%23b98620' opacity='0.42' transform='rotate(16 258 164)'/%3E%3Crect x='302' y='172' width='2.1' height='2.1' fill='%23e5be58' opacity='0.43'/%3E%3Crect x='46' y='214' width='3.5' height='2.4' rx='0.4' fill='%23b98620' opacity='0.4' transform='rotate(-15 46 214)'/%3E%3Crect x='96' y='246' width='2.9' height='2.1' rx='0.4' fill='%23c49228' opacity='0.41' transform='rotate(22 96 246)'/%3E%3Crect x='168' y='238' width='2.5' height='2.5' fill='%23d8a83e' opacity='0.41' transform='rotate(28 168 238)'/%3E%3Crect x='308' y='242' width='2.4' height='1.9' rx='0.4' fill='%23d8a83e' opacity='0.4' transform='rotate(-26 308 242)'/%3E%3Crect x='18' y='272' width='3' height='2.2' rx='0.4' fill='%23e2b64c' opacity='0.42' transform='rotate(36 18 272)'/%3E%3Crect x='112' y='294' width='2.1' height='1.8' fill='%23e5be58' opacity='0.42'/%3E%3Crect x='216' y='292' width='3.1' height='2.2' rx='0.4' fill='%23b98620' opacity='0.4' transform='rotate(-20 216 292)'/%3E%3Crect x='276' y='278' width='3.1' height='2.1' rx='0.4' fill='%23c49228' opacity='0.39' transform='rotate(-35 276 278)'/%3E%3Ccircle cx='192' cy='84' r='1.2' fill='%23c49228' opacity='0.4'/%3E%3Ccircle cx='62' cy='168' r='1' fill='%23d8a83e' opacity='0.39'/%3E%3Ccircle cx='244' cy='218' r='1.3' fill='%23b98620' opacity='0.39'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M18 32 Q34 28 52 37' stroke='%239b8366' stroke-width='0.9' opacity='0.22'/%3E%3Cpath d='M120 18 Q138 26 154 20' stroke='%23fffaf0' stroke-width='1.1' opacity='0.45'/%3E%3Cpath d='M210 48 Q228 42 246 54' stroke='%238c7355' stroke-width='0.8' opacity='0.2'/%3E%3Cpath d='M68 86 Q82 96 102 90' stroke='%23fffaf0' stroke-width='1.0' opacity='0.42'/%3E%3Cpath d='M165 78 Q178 68 198 76' stroke='%239b8366' stroke-width='0.85' opacity='0.22'/%3E%3Cpath d='M24 138 Q42 146 58 134' stroke='%238c7355' stroke-width='0.9' opacity='0.2'/%3E%3Cpath d='M108 148 Q128 140 148 152' stroke='%239b8366' stroke-width='0.8' opacity='0.18'/%3E%3Cpath d='M196 132 Q212 144 234 138' stroke='%23fffaf0' stroke-width='1.1' opacity='0.45'/%3E%3Cpath d='M44 198 Q62 190 80 202' stroke='%23fffaf0' stroke-width='1.0' opacity='0.4'/%3E%3Cpath d='M140 208 Q158 218 176 206' stroke='%238c7355' stroke-width='0.9' opacity='0.22'/%3E%3Cpath d='M218 216 Q234 208 250 220' stroke='%239b8366' stroke-width='0.8' opacity='0.2'/%3E%3Cpath d='M86 244 Q104 236 120 248' stroke='%239b8366' stroke-width='0.85' opacity='0.2'/%3E%3Cpath d='M14 74 Q22 92 16 108' stroke='%23fffaf0' stroke-width='0.9' opacity='0.35'/%3E%3Cpath d='M182 162 Q190 180 184 196' stroke='%239b8366' stroke-width='0.75' opacity='0.18'/%3E%3Cpath d='M242 86 Q236 104 246 120' stroke='%238c7355' stroke-width='0.75' opacity='0.18'/%3E%3Cpath d='M102 44 Q96 62 106 76' stroke='%238c7355' stroke-width='0.75' opacity='0.16'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='washi'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0.45 0 0 0 0.35  0 0.38 0 0 0.28  0 0 0.28 0 0.18  0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23washi)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 45%, rgba(252, 246, 236, 0.55) 0%, rgba(235, 220, 198, 0.35) 58%, rgba(190, 162, 128, 0.38) 100%);
  background-size: 500px 500px, 260px 260px, 220px 220px, 100% 100%;
  color: var(--text-main);
  font-family: var(--font-mincho);
  font-size: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: padding-right 0.35s ease;
}

/* ヘッダーエリア */
.game-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  border-bottom: 4px solid var(--gold-accent);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: right 0.35s ease;
}

.title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-badge {
  background-color: var(--red-vermilion);
  color: var(--header-text);
  font-size: 1.0rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 3px;
  letter-spacing: 0.1em;
}

.game-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  font-family: var(--font-brush);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-pill {
  background-color: var(--ink-black);
  border: 1px solid var(--gold-accent);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  gap: 8px;
  font-size: 1.0rem;
}

.progress-label {
  color: var(--header-muted);
}

.progress-value {
  color: var(--gold-accent);
  font-weight: 800;
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 4px;
  border: none;
  background-color: color-mix(in srgb, var(--fc-0-2) 22%, var(--header-bg));
  color: var(--fc-0-3);
  font-size: 0.88rem;
  font-family: var(--font-mincho);
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.autosave-status.is-saved {
  color: var(--header-text);
  background-color: color-mix(in srgb, var(--fc-0-2) 28%, var(--header-bg));
}

.autosave-status.is-flashing {
  color: var(--gold-accent);
  background-color: color-mix(in srgb, var(--fc-8-1) 60%, var(--header-bg));
}

.autosave-icon {
  font-size: 0.92em;
  line-height: 1;
}

.btn {
  background-color: var(--btn-bg);
  color: var(--header-text);
  border: 1px solid var(--border-light);
  padding: 7px 15px;
  font-size: 1.0rem;
  font-family: var(--font-mincho);
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background-color: var(--btn-hover-bg);
  border-color: var(--gold-accent);
  color: var(--header-text);
}

.btn.primary {
  background-color: var(--red-vermilion);
  border-color: var(--red-vermilion-hover);
  color: var(--header-text);
}

.btn.primary:hover {
  background-color: var(--red-vermilion-hover);
  box-shadow: 0 0 8px color-mix(in srgb, var(--red-vermilion) 60%, transparent);
}

.mode-switcher {
  display: flex;
  background-color: var(--ink-black);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.mode-btn {
  background: transparent;
  color: var(--header-muted);
  border: none;
  padding: 6px 12px;
  font-size: 1.0rem;
  font-family: var(--font-mincho);
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  background-color: var(--gold-accent);
  color: var(--ink-black);
  font-weight: 800;
}

/* メインコンテナ */
.main-container {
  max-width: 920px;
  /* max-width: 760px; */
  margin: var(--header-height, 68px) auto 0;
  padding: 24px 16px;
  width: 100%;
  flex: 1;
  transition: padding-right 0.35s ease;
}

/* 番付表コンテナ */
.banzuke-board {
  background-color: var(--bg-card);
  border: 4px double var(--border-color);
  box-shadow: 0 8px 24px rgba(40, 30, 20, 0.15);
  border-radius: 4px;
  padding: 24px 20px;
  position: relative;
}

.banzuke-board::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* 番付上部飾り */
.banzuke-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.banzuke-gomen {
  display: inline-block;
  font-family: var(--font-brush);
  font-size: 3.0rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  color: var(--ink-black);
  border: 2px solid var(--border-color);
  padding: 2px 24px 4px 32px;
  background-color: var(--bg-washi);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.banzuke-subtitle {
  margin-top: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ========================================================
   中央共有番付テーブル（大相撲公式スタイル）
   ======================================================== */
.banzuke-table-container {
  width: 100%;
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

/* テーブルヘッダー（東方・番付・西方） */
.banzuke-table-header {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  background-color: var(--header-bg);
  color: var(--header-text);
  border-bottom: 2px solid var(--border-color);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: 0.25em;
  text-align: center;
}

.th-col {
  padding: 10px 0;
}

.th-east {
  background-color: var(--east-bg);
  /* 東方：深緑 */
  border-right: 1.5px solid var(--border-color);
}

.th-rank {
  background-color: var(--ink-black);
  /* 番付：濃墨 */
  color: var(--gold-accent);
}

.th-west {
  background-color: var(--west-bg);
  /* 西方：深紅 */
  border-left: 1.5px solid var(--border-color);
}

/* 番付行リスト */
.banzuke-rows {
  display: flex;
  flex-direction: column;
}

.banzuke-row {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  border-bottom: 1.5px solid var(--border-subtle);
  min-height: 112px;
  transition: background-color 0.15s;
}

.banzuke-row:last-child {
  border-bottom: none;
}

.banzuke-row:nth-child(even) {
  background-color: var(--row-alt-bg);
}

/* 三役行は少し背景を強調 */
.banzuke-row.sanyaku-row {
  background-color: var(--row-alt-bg);
  border-bottom: 2px solid var(--border-color);
}

/* 中央番付セル */
.center-rank-cell {
  background-color: var(--rank-cell-bg);
  border-left: 1.5px solid var(--border-color);
  border-right: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
}

.sanyaku-rank {
  background-color: var(--sanyaku-rank-bg);
  font-weight: 800;
}

.rank-name-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-name-text {
  font-family: var(--font-brush);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink-black);
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
}

.sanyaku-rank .rank-name-text {
  font-size: 2.5rem;
  color: var(--ink-black);
  letter-spacing: 0.2em;
}

/* ========================================================
   力士カード（東方・西方）
   ======================================================== */
.wrestler-card {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}

.wrestler-card:hover {
  background-color: var(--card-hover-bg);
  box-shadow: inset 0 0 0 2px var(--red-vermilion);
}

.card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* 西方はアバターとテキストの配置を左右反転にして向かい合わせる */
.wrestler-card.side-west .card-inner {
  flex-direction: row-reverse;
}

.wrestler-card.side-west .field {
  flex-direction: row-reverse;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 98px;
  height: 98px;
}

.avatar-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wrestler-avatar {
  border-radius: 50%;
  overflow: hidden;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.hanko-seal {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  border: 2px solid var(--red-vermilion);
  border-radius: 50%;
  color: var(--red-vermilion);
  font-family: var(--font-brush);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: color-mix(in srgb, var(--bg-card) 95%, transparent);
  box-shadow: 1px 1px 3px color-mix(in srgb, var(--red-vermilion) 30%, transparent);
  transform: rotate(-12deg);
}

.info-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* 各情報フィールド */
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
}

/* 得意技、四股名、出身地などのラベル部分 */
.field-label {
  font-size: 1.25rem;
  color: var(--text-muted);
  width: 62px;
  flex-shrink: 0;
}

.wrestler-card.side-west .field-label {
  text-align: right;
}

/* 得意技（開示情報）バッジ */
.tokuiwaza-badge {
  background-color: var(--tokuiwaza-bg);
  color: var(--tokuiwaza-color);
  border: 1px solid var(--tokuiwaza-border);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  padding: 1px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  display: inline-block;
}

/* 力士プロフィールモーダル */
.modal-tokuiwaza-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 500;
}

.tokuiwaza-label {
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 500;
}

#modal-tokuiwaza {
  font-size: 1.5rem;
  padding: 2px 12px;
}

/* 四股名・出身地（穴埋め対象） */
.field-val {
  flex: 1;
  font-weight: 700;
}

/* 西方力士は得意技に合わせて四股名・出身地も右揃え */
.wrestler-card.side-west .field-val {
  text-align: right;
}

.field-val .placeholder {
  color: var(--text-muted);
  letter-spacing: 0.15em;
  font-style: italic;
  font-size: 1.13rem;
}

/* 四股名・出身地の推測表示（未確定） */
.field-val .guessed-name,
.field-val .guessed-origin {
  color: var(--guess-color);
  font-weight: 800;
  background-color: var(--guess-bg);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px dashed var(--guess-border);
  font-size: 1.25rem;
}

.field-val .confirmed-name {
  font-family: var(--font-brush);
  color: var(--ink-black);
  letter-spacing: 0.08em;
  font-size: 1.75rem;
}

.field-val .confirmed-origin {
  color: var(--ink-black);
  font-size: 1.38rem;
}

/* 確定済み力士カード */
.wrestler-card.is-confirmed {
  background-color: var(--row-alt-bg);
}

.wrestler-card.is-confirmed:hover {
  box-shadow: none;
  background-color: var(--row-alt-bg);
}

/* ========================================================
   モーダル全般
   ======================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(18, 14, 12, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
  overscroll-behavior: contain;
}

html.modal-open,
body.modal-open {
  overflow: hidden;
}

.modal-box {
  background-color: var(--bg-card);
  border: 3px double var(--border-color);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  width: 100%;
  /* max-width: 580px; */
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.modal-box .btn {
  font-size: 1.25rem;
}

.modal-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--gold-accent);
}

.modal-title {
  font-family: var(--font-brush);
  font-size: 1.63rem;
  letter-spacing: 0.1em;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--header-muted);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: var(--header-text);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 14px 20px;
  background-color: var(--bg-washi-dark);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

/* 推理モーダル内部 */
.deduction-layout {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 2.94rem;
}

.deduction-avatar {
  flex-shrink: 0;
  width: 154px;
  height: 154px;
}

.deduction-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.deduction-meta h3 {
  font-size: 2.3rem;
  color: var(--ink-black);
  margin-bottom: 2px;
}

.deduction-meta p {
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 500;
}

.form-group {
  margin-bottom: 16px;
}

/* 力士プロフィールモーダルの四股名/出身地 */
.form-group label {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.req-star {
  color: var(--red-vermilion);
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-mincho);
  font-size: 1.38rem;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--red-vermilion);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-vermilion) 15%, transparent);
}

/* 力士プロフィールモーダル 指示テキスト */
.status-note {
  color: var(--text-muted);
  margin-top: 10px;
}

.status-note.confirmed {
  color: var(--red-vermilion);
  font-weight: 700;
}

/* 確定済み力士のひとことコメント */
.wrestler-comment-box {
  margin-top: 14px;
  padding: 12px 14px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
}

.wrestler-comment-box[hidden] {
  display: none;
}

.wrestler-comment-label {
  display: inline-block;
  background-color: var(--bg-washi-dark);
  color: var(--text-main);
  font-size: 0.85em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.wrestler-comment-text {
  font-size: 1.38rem;
  line-height: 1.65;
  color: var(--text-main);
}

/* 手帳モーダル ドロワー */
.notebook-box {
  max-width: 760px;
}

.clue-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clue-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--red-vermilion);
  padding: 14px 16px;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.clue-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.clue-category {
  background-color: var(--bg-washi-dark);
  color: var(--text-main);
  font-size: 1.13rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
}

.clue-title {
  font-size: 1.31rem;
  font-weight: 800;
  color: var(--ink-black);
}

.clue-body {
  font-size: 1.38rem;
  line-height: 1.6;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clue-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: calc(100% + 12px);
  margin: 0 -6px;
  padding: 5px 6px;
  background: transparent;
  border: none;
  border-radius: 3px;
  font: inherit;
  color: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.2s ease;
}

.clue-line:hover {
  background-color: color-mix(in srgb, var(--bg-washi-dark) 35%, transparent);
}

.clue-check-box {
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.22em;
  border: 1.5px solid var(--border-color);
  border-radius: 3px;
  background-color: color-mix(in srgb, var(--fc-0-4) 55%, transparent);
  color: var(--header-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.clue-line-text {
  flex: 1;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.clue-line.is-checked .clue-check-box {
  background-color: var(--red-vermilion);
  border-color: var(--red-vermilion);
}

.clue-line.is-checked .clue-line-text {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.clue-item.is-all-checked {
  border-left-color: var(--border-light);
  opacity: 0.72;
}

#clues-content.hide-checked .clue-line.is-checked,
#clues-content.hide-checked .clue-item.is-all-checked {
  display: none;
}

.clues-all-checked-notice {
  text-align: center;
  padding: 24px 12px;
  font-size: 1.05rem;
  color: var(--ink-black);
  background-color: color-mix(in srgb, var(--bg-card) 80%, transparent);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
}

/* Obra Dinn 風 3人確定カットイン演出 */
.cutin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 8, 7, 0.92);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.cutin-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cutin-content {
  text-align: center;
  color: var(--header-text);
  transform: scale(0.9);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 20px;
}

.cutin-overlay.active .cutin-content {
  transform: scale(1);
}

.cutin-badge {
  font-family: var(--font-brush);
  font-size: 1.75rem;
  letter-spacing: 0.25em;
  color: var(--gold-accent);
  margin-bottom: 12px;
}

.cutin-title {
  font-family: var(--font-brush);
  font-size: 3.25rem;
  letter-spacing: 0.15em;
  color: var(--header-text);
  margin-bottom: 24px;
  text-shadow: 0 0 16px color-mix(in srgb, var(--gold-accent) 40%, transparent);
}

.cutin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.cutin-item {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid color-mix(in srgb, var(--gold-accent) 50%, transparent);
  padding: 12px 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  animation: inkFade 0.8s ease-out;
}

.cutin-rank {
  font-size: 1.38rem;
  color: var(--gold-accent);
}

.cutin-name {
  font-family: var(--font-brush);
  font-size: 2.25rem;
  color: var(--header-text);
  letter-spacing: 0.1em;
}

.cutin-origin {
  font-size: 1.31rem;
  color: var(--header-muted);
}

@keyframes inkFade {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* クリアモーダル（瓦版タブ 1002 より前面に表示） */
#game-clear-modal {
  z-index: 1100;
}

.clear-box {
  text-align: center;
  padding: 30px;
}

.clear-badge {
  font-size: 3.75rem;
  margin-bottom: 10px;
}

.clear-title {
  font-family: var(--font-brush);
  font-size: 2.75rem;
  color: var(--red-vermilion);
  margin-bottom: 14px;
  letter-spacing: 0.15em;
}

.clear-text {
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 24px;
}

.clear-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.clear-actions .btn {
  padding: 11px 22px;
  font-size: 1.05rem;
  text-decoration: none;
  justify-content: center;
}

.btn-share-x {
  background-color: var(--ink-black);
  border-color: var(--border-color);
  color: var(--header-text);
}

.btn-share-x:hover {
  background-color: var(--header-bg);
  border-color: var(--gold-accent);
  color: var(--header-text);
}

.share-x-icon {
  flex-shrink: 0;
}

/* フッター */
.game-footer {
  text-align: center;
  padding: 16px 16px 24px;
  font-size: 1.0rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--red-vermilion);
}

/* 遊び方・ゲーム紹介（控えめな折りたたみセクション） */
.game-info-section {
  width: 100%;
  max-width: 960px;
  margin: 24px auto 8px;
}

.game-info-accordion {
  background-color: color-mix(in srgb, var(--bg-card) 85%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.game-info-summary {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  transition: color 0.2s, background-color 0.2s;
}

.game-info-summary::-webkit-details-marker {
  display: none;
}

.game-info-summary::before {
  content: '▸';
  font-size: 1.06rem;
  transition: transform 0.2s ease;
}

.game-info-accordion[open] .game-info-summary::before {
  transform: rotate(90deg);
}

.game-info-summary:hover {
  color: var(--text-main);
  background-color: color-mix(in srgb, var(--bg-washi-dark) 55%, transparent);
}

.game-info-body {
  font-size: 1.38rem;
  padding: 16px 22px 20px;
  border-top: 1px dashed var(--border-subtle);
  line-height: 1.8;
  color: var(--text-main);
  text-align: left;
}

.game-info-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink-black);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.game-info-body h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--red-vermilion);
  margin-top: 14px;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.game-info-body p {
  margin-bottom: 8px;
}

.game-info-body ol,
.game-info-body ul {
  padding-left: 1.4em;
  margin-bottom: 6px;
}

.game-info-body li {
  margin-bottom: 4px;
}

.noscript-notice {
  padding: 24px 16px;
  text-align: center;
  color: var(--red-vermilion);
  font-weight: 700;
}

/* ========================================================
   アンカー広告用スペーサー（高さのみの余白）
   高さの調整はファイル先頭の --ad-banner-height で行えます。
   ======================================================== */
.ad-banner-area {
  width: 100%;
  height: var(--ad-banner-height);
  margin: 16px auto 0;
  pointer-events: none;
}

/* 画面最下部に固定表示（フロートバナー）したい場合用クラス */
/* 適用する場合は HTMLの aside に class="ad-banner-area is-fixed" と付与してください */
.ad-banner-area.is-fixed {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 999;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  background-color: var(--bg-card);
}

/* レスポンシブ対応 */
@media (max-width: 860px) {
  .banzuke-table-header {
    grid-template-columns: 1fr 70px 1fr;
    font-size: 1.19rem;
  }

  .banzuke-row {
    grid-template-columns: 1fr 70px 1fr;
  }

  .rank-name-text {
    font-size: 1.19rem;
  }

  .sanyaku-rank .rank-name-text {
    font-size: 1.38rem;
  }

  .card-inner {
    gap: 8px;
  }

  .avatar-wrap {
    width: 74px;
    height: 74px;
  }

  .avatar-wrap svg {
    width: 74px;
    height: 74px;
  }

  .field-label {
    width: 56px;
    /* font-size: 0.65rem; */
    font-size: 1.25rem;
  }

  .tokuiwaza-badge {
    font-size: 1.25rem;
    padding: 0 4px;
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* ========================================================
   調査手帳・ドロワー（右端タブ）
   ======================================================== */

/* ----------------------------------------------------------
   縦書きタブボタン
   - 画面右端上部に固定
   - ドロワーが開いたら .open クラスでドロワー幅ぶん左へスライド
   ---------------------------------------------------------- */
.notebook-tab-btn {
  position: fixed;
  top: 80px;
  /* 画面右端上部 */
  right: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background-color: var(--red-vermilion);
  color: var(--header-text);
  border: none;
  border-radius: 6px 0 0 6px;
  padding: 16px 10px;
  /* font-size: 0.88rem; */
  font-size: 1.25rem;
  font-family: var(--font-mincho);
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  z-index: 1002;
  /* ドロワー(1000)より手前 */
  white-space: nowrap;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s, right 0.35s ease;
}

.notebook-tab-btn:hover {
  background-color: var(--red-vermilion-hover);
}

/* ドロワーが開いたときにタブをドロワー幅ぶん左へ移動 */
.notebook-tab-btn.open {
  right: var(--drawer-width);
}

/* ドロワー本体（初期は画面外右側に隠す） */
.notebook-drawer {
  position: fixed;
  top: 0;
  right: calc(var(--drawer-width) * -1 - 20px);
  width: var(--drawer-width);
  height: 100vh;
  background: var(--bg-card);
  border-left: 3px double var(--border-color);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
  transition: right 0.35s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 開いた状態 */
.notebook-drawer.open {
  right: 0;
}

/* モバイル縦持ち専用：ドロワー下端一体の閉じるハンドル（PC・横持ちでは非表示） */
.drawer-close-handle {
  display: none;
}

/* PC幅（1120px以上）：ドロワーを開いた時、番付表・力士プロフィールモーダルを左へ押し出して重なりを防ぐ */
#deduction-modal {
  transition: opacity 0.25s ease, right 0.35s ease, padding-right 0.35s ease;
}

@media (min-width: 1120px) {

  /* @media (min-width: 960px) { */
  body.drawer-open {
    padding-right: var(--drawer-width) !important;
  }

  body.drawer-open .game-header {
    right: var(--drawer-width);
  }

  body.drawer-open .main-container {
    padding-right: 52px;
  }

  body.drawer-open #deduction-modal {
    right: var(--drawer-width);
    padding-right: 52px;
  }
}

/* ドロワーヘッダー */
.drawer-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--gold-accent);
  flex-shrink: 0;
}

.drawer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background-color: var(--btn-bg);
  color: var(--header-text);
  font-family: var(--font-mincho);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.drawer-filter-btn:hover {
  border-color: var(--gold-accent);
  background-color: var(--btn-hover-bg);
}

.drawer-filter-btn.active {
  background-color: var(--gold-accent);
  border-color: var(--gold-accent);
  color: var(--ink-black);
}

.drawer-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  border-radius: 3px;
  background-color: var(--red-vermilion);
  color: var(--header-text);
  font-size: 1.05em;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.drawer-filter-count {
  font-size: 0.82em;
  padding: 1px 6px;
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--fc-0-2) 32%, var(--header-bg));
  color: var(--fc-0-3);
}

.drawer-filter-btn.active .drawer-filter-count {
  background-color: color-mix(in srgb, var(--ink-black) 18%, transparent);
  color: var(--ink-black);
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: var(--font-mincho);
}

/* ドロワーボディ（スクロール可能） */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px;
}

/* ========================================================
   スマホ対応（縦向き・小幅画面: 768px以下）
   - ヘッダーの固定を解除して画面占有を解消
   - 番付表を3列収まる縦積みコンパクトカード化
   - かわら版を画面上部のトップシート分割表示にし、
     画面最下部のAdSenseアンカー広告と干渉させない
   ======================================================== */
@media (max-width: 768px) {
  :root {
    --mobile-drawer-height: clamp(210px, 40svh, 340px);
  }

  body {
    font-size: 1rem;
    overflow-x: hidden;
    transition: padding-top 0.3s ease;
  }

  body.drawer-open {
    padding-top: var(--mobile-drawer-height);
  }

  /* ヘッダー：上部固定を解除してコンパクト化 */
  .game-header {
    position: static;
    padding: 10px 12px;
    gap: 8px;
    border-bottom-width: 3px;
  }

  .title-area {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
  }

  .title-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .game-title {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    line-height: 1.3;
  }

  .header-controls {
    width: 100%;
    gap: 6px;
    justify-content: space-between;
  }

  .mode-btn {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .progress-pill {
    padding: 4px 10px;
    gap: 4px;
    font-size: 0.78rem;
  }

  .autosave-status {
    padding: 4px 8px;
    gap: 4px;
    font-size: 0.74rem;
  }

  .btn {
    padding: 5px 9px;
    font-size: 0.78rem;
    gap: 4px;
  }

  /* メインコンテナ：固定ヘッダー分の余白を解除 */
  .main-container {
    margin-top: 0;
    padding: 10px 6px 16px;
  }

  .banzuke-board {
    padding: 12px 6px;
    border-width: 3px;
  }

  .banzuke-board::before {
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
  }

  .banzuke-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .banzuke-gomen {
    font-size: 1.65rem;
    letter-spacing: 0.28em;
    padding: 2px 14px 3px 20px;
  }

  .banzuke-subtitle {
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.45;
    letter-spacing: 0.03em;
  }

  /* 番付テーブル：東西3列が375px幅でもはみ出さないグリッド */
  .banzuke-table-header {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    font-size: 0.88rem;
    letter-spacing: 0.12em;
  }

  .th-col {
    padding: 7px 0;
  }

  .banzuke-row {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    min-height: 132px;
  }

  .center-rank-cell {
    padding: 4px 2px;
  }

  .rank-name-text {
    font-size: 0.92rem;
    letter-spacing: 0.06em;
  }

  .sanyaku-rank .rank-name-text {
    font-size: 1.05rem;
    letter-spacing: 0.1em;
  }

  /* 力士カード：縦積みコンパクト化（ラベル省略でスッキリ表示） */
  .wrestler-card {
    padding: 8px 5px;
    align-items: flex-start;
  }

  .card-inner,
  .wrestler-card.side-west .card-inner {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .avatar-wrap {
    width: 80px;
    height: 80px;
  }

  .avatar-wrap svg {
    width: 100%;
    height: 100%;
  }

  .hanko-seal {
    width: 22px;
    height: 22px;
    font-size: 0.95rem;
    right: -4px;
    bottom: -2px;
  }

  .info-wrap {
    width: 100%;
    align-items: center;
    gap: 3px;
  }

  .field,
  .wrestler-card.side-west .field {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    gap: 0;
    font-size: 0.82rem;
  }

  .field-label {
    display: none;
  }

  .field-val,
  .wrestler-card.side-west .field-val {
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tokuiwaza-badge {
    font-size: 0.76rem;
    padding: 1px 7px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .field-val .placeholder {
    font-size: 0.78rem;
  }

  .field-val .guessed-name,
  .field-val .guessed-origin {
    font-size: 0.82rem;
    padding: 1px 5px;
  }

  .field-val .confirmed-name {
    font-size: 1.12rem;
    letter-spacing: 0.04em;
  }

  .field-val .confirmed-origin {
    font-size: 0.82rem;
  }

  /* かわら版：閉じた状態のタブは右端中段（上下のアンカー広告と非干渉） */
  .notebook-tab-btn {
    top: 42%;
    right: 0;
    padding: 12px 7px;
    font-size: 0.88rem;
    border-radius: 6px 0 0 6px;
    transform: translateX(0);
    opacity: 1;
    transition: background-color 0.2s, transform 0.22s ease, opacity 0.2s ease;
  }

  /* 開いた状態：右端タブはその場で右へ引っ込んで消える（空中移動させない） */
  .notebook-tab-btn.open {
    right: 0;
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
  }

  /* かわら版：開いた状態は上部トップシート（下半分で番付表を操作可能） */
  .notebook-drawer {
    top: calc(-1 * var(--mobile-drawer-height) - 48px);
    left: 0;
    right: 0;
    width: 100%;
    height: var(--mobile-drawer-height);
    border-left: none;
    border-bottom: 3px double var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    overflow: visible;
    transition: top 0.3s ease;
  }

  .notebook-drawer.open {
    top: 0;
    right: 0;
  }

  /* 開いた状態の閉じるハンドル：ドロワー下端中央に一体化して一緒にスライド */
  .drawer-close-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--red-vermilion);
    color: var(--header-text);
    border: none;
    border-radius: 0 0 10px 10px;
    padding: 6px 20px;
    font-size: 0.82rem;
    font-family: var(--font-mincho);
    font-weight: 700;
    letter-spacing: 0.1em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  }

  .drawer-close-handle:hover {
    background-color: var(--red-vermilion-hover);
  }

  .drawer-close-arrow {
    font-size: 0.72rem;
  }

  .drawer-header {
    padding: 8px 14px;
  }

  .drawer-title {
    font-size: 0.95rem;
  }

  .drawer-filter-btn {
    padding: 4px 10px;
    font-size: 0.95rem;
    gap: 5px;
  }

  .drawer-body {
    padding: 10px 12px 16px;
  }

  .clue-list {
    gap: 10px;
  }

  .clue-item {
    padding: 10px 12px;
  }

  .clue-header {
    gap: 6px;
    margin-bottom: 5px;
    flex-wrap: wrap;
  }

  .clue-category {
    font-size: 0.74rem;
    padding: 1px 6px;
  }

  .clue-title {
    font-size: 0.9rem;
  }

  .clue-body {
    font-size: 0.85rem;
    line-height: 1.55;
    gap: 3px;
  }

  .clue-line {
    gap: 7px;
    padding: 4px 5px;
    width: calc(100% + 10px);
    margin: 0 -5px;
  }

  /* 推理モーダル：スマホ縦向き最適化 */
  .modal-backdrop {
    padding: 10px;
  }

  .modal-box {
    max-height: 88dvh;
  }

  .modal-header {
    padding: 10px 14px;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .modal-body {
    padding: 14px;
  }

  .wrestler-comment-box {
    margin-top: 10px;
    padding: 9px 11px;
  }

  .wrestler-comment-label {
    margin-bottom: 4px;
  }

  .wrestler-comment-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .deduction-layout {
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .deduction-avatar {
    width: 108px;
    height: 108px;
  }

  .deduction-meta h3 {
    font-size: 1.35rem;
  }

  .deduction-meta p {
    font-size: 0.85rem;
  }

  .modal-tokuiwaza-wrap,
  .tokuiwaza-label {
    font-size: 0.85rem;
  }

  #modal-tokuiwaza {
    font-size: 0.9rem;
    padding: 1px 8px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  .form-control {
    padding: 8px 10px;
    font-size: 0.95rem;
  }

  .modal-footer {
    padding: 10px 14px;
  }

  .modal-box .btn {
    font-size: 0.95rem;
    padding: 8px 16px;
  }

  /* カットイン演出・クリアモーダル */
  .cutin-title {
    font-size: 1.35rem;
  }

  .cutin-name {
    font-size: 1.35rem;
  }

  .cutin-rank,
  .cutin-origin {
    font-size: 0.9rem;
  }

  .clear-box {
    padding: 20px 16px;
  }

  .clear-title {
    font-size: 1.55rem;
  }

  .clear-text {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  .clear-actions {
    flex-direction: column;
    gap: 10px;
  }

  .clear-actions .btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  /* 遊び方・フッター */
  .game-info-section {
    margin: 16px auto 6px;
  }

  .game-info-body {
    padding: 12px 14px 14px;
    font-size: 0.84rem;
    line-height: 1.7;
  }

  .game-footer {
    font-size: 0.78rem;
    padding: 12px 10px 16px;
  }
}

/* ========================================================
   スマホ横向き対応（高さ520px以下の横画面）
   - ヘッダーの固定を解除して表示領域を確保
   - かわら版を右44%・番付表を左56%の2カラム分割表示
   - かわら版下部にもAdSenseアンカー広告用の余白を確保
   ======================================================== */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --landscape-drawer-width: 44vw;
  }

  body {
    font-size: 1rem;
    padding-top: 0 !important;
    transition: padding-right 0.3s ease;
  }

  body.drawer-open {
    padding-right: var(--landscape-drawer-width) !important;
  }

  /* ヘッダー：固定解除＆極薄コンパクト化 */
  .game-header {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    gap: 8px;
    border-bottom-width: 2px;
  }

  .title-area {
    width: auto;
    gap: 6px;
  }

  .title-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .game-title {
    font-size: 0.95rem;
    letter-spacing: 0.06em;
  }

  .header-controls {
    width: auto;
    gap: 6px;
  }

  .mode-btn,
  .progress-pill,
  .autosave-status,
  .btn {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  /* メインコンテナ：固定ヘッダー分の余白を解除 */
  .main-container {
    margin-top: 0;
    padding: 8px 10px 12px;
  }

  .banzuke-board {
    padding: 10px 8px;
    border-width: 3px;
  }

  .banzuke-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .banzuke-gomen {
    font-size: 1.45rem;
    padding: 1px 14px 2px 18px;
  }

  .banzuke-subtitle {
    margin-top: 4px;
    font-size: 0.76rem;
  }

  /* 番付テーブル：2カラム分割時でも左56%に綺麗に収まる */
  .banzuke-table-header {
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
  }

  .th-col {
    padding: 6px 0;
  }

  .banzuke-row {
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
    min-height: 76px;
  }

  .rank-name-text {
    font-size: 0.9rem;
  }

  .sanyaku-rank .rank-name-text {
    font-size: 1rem;
  }

  .wrestler-card {
    padding: 6px 6px;
  }

  .card-inner {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .wrestler-card.side-west .card-inner {
    flex-direction: row-reverse;
  }

  .avatar-wrap {
    width: 64px;
    height: 64px;
  }

  .avatar-wrap svg {
    width: 100%;
    height: 100%;
  }

  .hanko-seal {
    width: 20px;
    height: 20px;
    font-size: 0.85rem;
  }

  .info-wrap {
    align-items: stretch;
    gap: 2px;
  }

  .field {
    justify-content: flex-start;
    font-size: 0.78rem;
  }

  .wrestler-card.side-west .field {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }

  .field-label {
    display: none;
  }

  .field-val {
    text-align: left;
  }

  .wrestler-card.side-west .field-val {
    text-align: right;
  }

  .tokuiwaza-badge {
    font-size: 0.72rem;
    padding: 1px 6px;
  }

  .field-val .placeholder,
  .field-val .guessed-name,
  .field-val .guessed-origin,
  .field-val .confirmed-origin {
    font-size: 0.78rem;
  }

  .field-val .confirmed-name {
    font-size: 1.02rem;
  }

  /* かわら版：右44%の2カラムドロワー */
  .notebook-drawer {
    top: 0;
    bottom: 0;
    left: auto;
    right: calc(-1 * var(--landscape-drawer-width) - 10px);
    width: var(--landscape-drawer-width);
    height: auto;
    border-bottom: none;
    border-left: 3px double var(--border-color);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: right 0.3s ease;
  }

  .notebook-drawer.open {
    top: 0;
    right: 0;
  }

  .drawer-close-handle {
    display: none;
  }

  .notebook-tab-btn {
    writing-mode: vertical-rl;
    top: 28%;
    right: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding: 10px 6px;
    font-size: 0.82rem;
    border-radius: 6px 0 0 6px;
    transition: background-color 0.2s, right 0.3s ease;
  }

  .notebook-tab-btn.open {
    writing-mode: vertical-rl;
    top: 28%;
    right: var(--landscape-drawer-width);
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding: 10px 6px;
    font-size: 0.82rem;
    border-radius: 6px 0 0 6px;
  }

  .drawer-header {
    padding: 6px 12px;
  }

  .drawer-title {
    font-size: 0.9rem;
  }

  .drawer-filter-btn {
    padding: 3px 9px;
    font-size: 0.9rem;
    gap: 5px;
  }

  /* 下部アンカー広告と最後の手がかりが重ならないよう下部余白を確保 */
  .drawer-body {
    padding: 8px 10px calc(var(--ad-banner-height) + 12px);
  }

  .clue-item {
    padding: 8px 10px;
  }

  .clue-title {
    font-size: 0.86rem;
  }

  .clue-body {
    font-size: 0.8rem;
    line-height: 1.5;
    gap: 2px;
  }

  .clue-line {
    gap: 6px;
    padding: 3px 4px;
    width: calc(100% + 8px);
    margin: 0 -4px;
  }

  /* 推理モーダル：高さ375〜430pxの横画面でスクロール最小限に収める */
  body.drawer-open #deduction-modal {
    right: var(--landscape-drawer-width);
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-box {
    max-width: 440px;
    max-height: 94dvh;
  }

  .modal-header {
    padding: 8px 14px;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 10px 14px;
    overflow-y: auto;
  }

  .wrestler-comment-box {
    margin-top: 8px;
    padding: 8px 10px;
  }

  .wrestler-comment-label {
    margin-bottom: 3px;
  }

  .wrestler-comment-text {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .deduction-layout {
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .deduction-avatar {
    width: 84px;
    height: 84px;
  }

  .deduction-meta h3 {
    font-size: 1.2rem;
  }

  .deduction-meta p,
  .modal-tokuiwaza-wrap,
  .tokuiwaza-label {
    font-size: 0.8rem;
  }

  #modal-tokuiwaza {
    font-size: 0.85rem;
    padding: 1px 8px;
  }

  .form-group {
    margin-bottom: 8px;
  }

  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 3px;
  }

  .form-control {
    padding: 6px 10px;
    font-size: 0.88rem;
  }

  .status-note {
    font-size: 0.78rem;
    margin-top: 6px;
  }

  .modal-footer {
    padding: 8px 14px;
  }

  .modal-box .btn {
    font-size: 0.88rem;
    padding: 6px 14px;
  }
}