/* 競艇ダッシュボード カスタムスタイル */

/* 枠番バッジスタイル (1〜6号艇) */
.boat-badge-1 { background-color: #ffffff; color: #000000; border: 2px solid #cbd5e1; }
.boat-badge-2 { background-color: #1e293b; color: #ffffff; border: 1px solid #475569; }
.boat-badge-3 { background-color: #dc2626; color: #ffffff; }
.boat-badge-4 { background-color: #2563eb; color: #ffffff; }
.boat-badge-5 { background-color: #eab308; color: #000000; }
.boat-badge-6 { background-color: #16a34a; color: #ffffff; }

/* 枠番ごとの行左ボーダー & 背景色（ダークモードデフォルト - 高コントラスト・視認性強化） */
.boat-row-1 { border-left: 5px solid #ffffff !important; background-color: rgba(255, 255, 255, 0.08) !important; }
.boat-row-2 { border-left: 5px solid #94a3b8 !important; background-color: rgba(148, 163, 184, 0.12) !important; }
.boat-row-3 { border-left: 5px solid #ef4444 !important; background-color: rgba(239, 68, 68, 0.13) !important; }
.boat-row-4 { border-left: 5px solid #3b82f6 !important; background-color: rgba(59, 130, 246, 0.13) !important; }
.boat-row-5 { border-left: 5px solid #eab308 !important; background-color: rgba(234, 179, 8, 0.13) !important; }
.boat-row-6 { border-left: 5px solid #22c55e !important; background-color: rgba(34, 197, 94, 0.13) !important; }

/* ダークモード時の行ホバー効果 */
.boat-row-1:hover { background-color: rgba(255, 255, 255, 0.14) !important; }
.boat-row-2:hover { background-color: rgba(148, 163, 184, 0.20) !important; }
.boat-row-3:hover { background-color: rgba(239, 68, 68, 0.20) !important; }
.boat-row-4:hover { background-color: rgba(59, 130, 246, 0.20) !important; }
.boat-row-5:hover { background-color: rgba(234, 179, 8, 0.20) !important; }
.boat-row-6:hover { background-color: rgba(34, 197, 94, 0.20) !important; }

/* ランキングハイライト（1位・2位） */
.rank-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #ffffff !important;
  font-weight: 700;
}

.rank-motor-1 {
  color: #fb923c !important;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(251, 146, 60, 0.5);
}

.rank-motor-2 {
  color: #fed7aa !important;
  font-weight: 700;
}

.rank-st-1 {
  color: #38bdf8 !important;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
}

.rank-ex-1 {
  color: #38bdf8 !important;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.rank-secst-1 {
  color: #34d399 !important;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

/* 枠番別過去10走: 進入コースカラー */
.waku-course-1 { background-color: #ffffff; color: #000000 !important; font-weight: 800; }
.waku-course-2 { background-color: #1e293b; color: #ffffff !important; font-weight: 800; }
.waku-course-3 { background-color: #dc2626; color: #ffffff !important; font-weight: 800; }
.waku-course-4 { background-color: #2563eb; color: #ffffff !important; font-weight: 800; }
.waku-course-5 { background-color: #eab308; color: #000000 !important; font-weight: 800; }
.waku-course-6 { background-color: #16a34a; color: #ffffff !important; font-weight: 800; }

/* 枠番別過去10走: 着順スタイル (枠なし・シンプル表示) */
.waku-rank-num {
  font-weight: 700;
  font-size: 0.875rem;
  color: #e2e8f0;
  display: inline-block;
}
.waku-rank-num.grade-race {
  color: #c084fc !important; /* 紫色 (グレードレース) */
  font-weight: 800;
}
.waku-rank-num.flying {
  color: #f43f5e !important; /* 赤色 (F/L事故) */
  font-weight: 800;
}

/* 節間成績アコーディオン用 */
.section-rank-1 { background-color: #eab308; color: #000000 !important; font-weight: 800; }
.section-rank-2 { background-color: #94a3b8; color: #000000 !important; font-weight: 800; }
.section-rank-3 { background-color: #b45309; color: #ffffff !important; font-weight: 800; }
.section-rank-other { background-color: #334155; color: #cbd5e1 !important; font-weight: 600; }
.section-rank-flying { background-color: #ef4444; color: #ffffff !important; font-weight: 800; }

.course-badge-1 { background-color: #ffffff; color: #000000 !important; font-weight: 800; }
.course-badge-2 { background-color: #1e293b; color: #ffffff !important; font-weight: 800; }
.course-badge-3 { background-color: #dc2626; color: #ffffff !important; font-weight: 800; }
.course-badge-4 { background-color: #2563eb; color: #ffffff !important; font-weight: 800; }
.course-badge-5 { background-color: #eab308; color: #000000 !important; font-weight: 800; }
.course-badge-6 { background-color: #16a34a; color: #ffffff !important; font-weight: 800; }

/* スクロールバー装飾 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0b0f19;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==========================================================================
   ダークモード枠線・視認性・コントラスト強化スタイル
   ========================================================================== */

/* メインカード & テーブル外枠 */
.bg-slate-900 {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

.bg-slate-850 {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

.bg-slate-850\/80,
.bg-slate-850\/90 {
  background-color: rgba(30, 41, 59, 0.9) !important;
  border-color: #334155 !important;
}

/* 境界線・区切り線のコントラスト強化 */
.border-slate-800 {
  border-color: #334155 !important;
}
.border-slate-700 {
  border-color: #475569 !important;
}
.border-slate-700\/80,
.border-slate-700\/60,
.border-slate-700\/50 {
  border-color: rgba(71, 85, 105, 0.8) !important;
}

.divide-slate-800 > :not([hidden]) ~ :not([hidden]) {
  border-color: #334155 !important;
}

/* 出走表テーブルの行区切り */
#entries-body tr {
  border-bottom: 1px solid rgba(71, 85, 105, 0.6) !important;
}

/* 新概念データテーブル: 縦横の境界グリッド線をくっきり表示 */
#shingainen-stats-table {
  border: 1px solid #475569 !important;
}
#shingainen-header-row th {
  border: 1px solid #475569 !important;
}
#shingainen-body-rows tr {
  border-bottom: 1px solid #334155 !important;
}
#shingainen-body-rows td {
  border-right: 1px solid #334155 !important;
  border-left: 1px solid #334155 !important;
}

/* 枠番別10走テーブル: 各走セルの枠線 */
#waku10-table {
  border: 1px solid #334155 !important;
}
#waku10-table th,
#waku10-table td {
  border-color: #334155 !important;
}
#waku10-table tr.border-t-2 {
  border-top: 2px solid #475569 !important;
}
#waku10-table tr.border-b {
  border-bottom: 1px solid #334155 !important;
}

/* 節間成績カード & 出走ボックスの視認性 */
#section-boats-list > div {
  border: 1px solid #475569 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

/* 確定着順テーブルの行区切り */
#result-ranks-body tr {
  border-bottom: 1px solid rgba(71, 85, 105, 0.6) !important;
}

/* 確定着順テーブルの事故・失格表示（転・落・欠・エ・失・不・妨） */
.rank-badge-c {
  color: #fb7185 !important;
  font-weight: 800;
}

/* ==========================================================================
   ライトモード対応スタイル (html:not(.dark))
   ========================================================================== */

html:not(.dark) {
  color-scheme: light;
}

html:not(.dark) body {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html:not(.dark) header {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   枠番バッジスタイル (1〜6号艇) - ダーク & ライト共通・高コントラスト保護
   ========================================================================== */

/* 1号艇 (白) */
.boat-badge-1,
th.boat-badge-1,
td.boat-badge-1 {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #cbd5e1 !important;
}
.boat-badge-1 *,
th.boat-badge-1 *,
td.boat-badge-1 * {
  color: #0f172a !important;
}

/* 2号艇 (黒) */
.boat-badge-2,
th.boat-badge-2,
td.boat-badge-2 {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid #475569 !important;
}
.boat-badge-2 *,
th.boat-badge-2 *,
td.boat-badge-2 * {
  color: #ffffff !important;
}

/* 3号艇 (赤) */
.boat-badge-3,
th.boat-badge-3,
td.boat-badge-3 {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}
.boat-badge-3 *,
th.boat-badge-3 *,
td.boat-badge-3 * {
  color: #ffffff !important;
}

/* 4号艇 (青) */
.boat-badge-4,
th.boat-badge-4,
td.boat-badge-4 {
  background-color: #2563eb !important;
  color: #ffffff !important;
}
.boat-badge-4 *,
th.boat-badge-4 *,
td.boat-badge-4 * {
  color: #ffffff !important;
}

/* 5号艇 (黄) */
.boat-badge-5,
th.boat-badge-5,
td.boat-badge-5 {
  background-color: #eab308 !important;
  color: #0f172a !important;
}
.boat-badge-5 *,
th.boat-badge-5 *,
td.boat-badge-5 * {
  color: #0f172a !important;
}

/* 6号艇 (緑) */
.boat-badge-6,
th.boat-badge-6,
td.boat-badge-6 {
  background-color: #16a34a !important;
  color: #ffffff !important;
}
.boat-badge-6 *,
th.boat-badge-6 *,
td.boat-badge-6 * {
  color: #ffffff !important;
}


/* コンテナ・カード背景 */
html:not(.dark) .bg-slate-950 {
  background-color: #f1f5f9 !important;
}

html:not(.dark) .bg-slate-900 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .bg-slate-850 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) .bg-slate-850\/80,
html:not(.dark) .bg-slate-850\/90 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) .bg-slate-800 {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) .bg-slate-800\/80,
html:not(.dark) .bg-slate-800\/50,
html:not(.dark) .bg-slate-800\/40,
html:not(.dark) .bg-slate-800\/30 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/60,
html:not(.dark) .bg-slate-900\/50,
html:not(.dark) .bg-slate-900\/40 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* 境界線 & 区切り線 */
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-750,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-700\/80,
html:not(.dark) .border-slate-700\/60,
html:not(.dark) .border-slate-700\/50,
html:not(.dark) .border-slate-600 {
  border-color: #e2e8f0 !important;
}

html:not(.dark) .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
html:not(.dark) .divide-slate-800\/80 > :not([hidden]) ~ :not([hidden]),
html:not(.dark) .divide-slate-700 > :not([hidden]) ~ :not([hidden]) {
  border-color: #e2e8f0 !important;
}

/* フォームコントロール */
html:not(.dark) select,
html:not(.dark) input[type="date"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) optgroup {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html:not(.dark) option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* テキストカラー（白・スレート系の反転・高コントラスト化） */
/* テキストカラー（白・スレート系の反転・高コントラスト化） */
html:not(.dark) .text-white {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-100 {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-200 {
  color: #1e293b !important;
}

html:not(.dark) .text-slate-300 {
  color: #334155 !important;
}

html:not(.dark) .text-slate-400 {
  color: #475569 !important;
}

html:not(.dark) .text-slate-500 {
  color: #475569 !important;
}

/* カラフルなテキスト色のライトモード調整（背景白でも見やすい濃色・高コントラスト化） */
html:not(.dark) .text-cyan-100,
html:not(.dark) .text-cyan-200,
html:not(.dark) .text-cyan-300,
html:not(.dark) .text-cyan-400,
html:not(.dark) .text-cyan-500 {
  color: #0369a1 !important; /* 濃いオーシャンブルー */
}

html:not(.dark) .text-blue-100,
html:not(.dark) .text-blue-200,
html:not(.dark) .text-blue-300,
html:not(.dark) .text-blue-400,
html:not(.dark) .text-blue-500 {
  color: #1d4ed8 !important; /* 濃いブルー */
}

html:not(.dark) .text-indigo-100,
html:not(.dark) .text-indigo-200,
html:not(.dark) .text-indigo-300,
html:not(.dark) .text-indigo-400,
html:not(.dark) .text-indigo-500 {
  color: #4338ca !important; /* 濃いインディゴ */
}

html:not(.dark) .text-violet-100,
html:not(.dark) .text-violet-200,
html:not(.dark) .text-violet-300,
html:not(.dark) .text-violet-400,
html:not(.dark) .text-violet-500 {
  color: #6d28d9 !important; /* 濃いバイオレット */
}

html:not(.dark) .text-amber-100,
html:not(.dark) .text-amber-200,
html:not(.dark) .text-amber-300,
html:not(.dark) .text-amber-400,
html:not(.dark) .text-amber-500 {
  color: #b45309 !important; /* 濃いアンバー */
}

html:not(.dark) .text-emerald-100,
html:not(.dark) .text-emerald-200,
html:not(.dark) .text-emerald-300,
html:not(.dark) .text-emerald-400,
html:not(.dark) .text-emerald-500 {
  color: #047857 !important; /* 濃いエメラルドグリーン */
}

html:not(.dark) .text-teal-100,
html:not(.dark) .text-teal-200,
html:not(.dark) .text-teal-300,
html:not(.dark) .text-teal-400,
html:not(.dark) .text-teal-500 {
  color: #0f766e !important; /* 濃いティール */
}

html:not(.dark) .text-purple-100,
html:not(.dark) .text-purple-200,
html:not(.dark) .text-purple-300,
html:not(.dark) .text-purple-400,
html:not(.dark) .text-purple-500 {
  color: #7e22ce !important; /* 濃いパープル */
}

html:not(.dark) .text-sky-100,
html:not(.dark) .text-sky-200,
html:not(.dark) .text-sky-300,
html:not(.dark) .text-sky-400,
html:not(.dark) .text-sky-500 {
  color: #0284c7 !important;
}

html:not(.dark) .text-rose-100,
html:not(.dark) .text-rose-200,
html:not(.dark) .text-rose-300,
html:not(.dark) .text-rose-400,
html:not(.dark) .text-rose-500 {
  color: #be123c !important;
}

html:not(.dark) .text-red-100,
html:not(.dark) .text-red-200,
html:not(.dark) .text-red-300,
html:not(.dark) .text-red-400,
html:not(.dark) .text-red-500 {
  color: #b91c1c !important;
}

html:not(.dark) .text-pink-300,
html:not(.dark) .text-pink-400,
html:not(.dark) .text-pink-500 {
  color: #be123c !important;
}

/* 白文字を保持すべき要素（ボタン・バッジ・着順等）の保護ルール */
html:not(.dark) button.bg-blue-600,
html:not(.dark) button.bg-blue-600 *,
html:not(.dark) button.bg-emerald-600,
html:not(.dark) button.bg-emerald-600 *,
html:not(.dark) button.bg-cyan-600,
html:not(.dark) button.bg-cyan-600 *,
html:not(.dark) button.bg-amber-600,
html:not(.dark) button.bg-amber-600 *,
html:not(.dark) button.bg-green-600,
html:not(.dark) button.bg-green-600 *,
html:not(.dark) button.bg-purple-600,
html:not(.dark) button.bg-purple-600 * {
  color: #ffffff !important;
}

html:not(.dark) .rank-1,
html:not(.dark) .rank-2,
html:not(.dark) .section-rank-3,
html:not(.dark) .section-rank-flying,
html:not(.dark) .rank-badge-s,
html:not(.dark) .rank-badge-a,
html:not(.dark) .rank-badge-b,
html:not(.dark) .ai-mark-honmei,
html:not(.dark) .ai-mark-taikou,
html:not(.dark) .ai-mark-tana,
html:not(.dark) .ai-mark-renka {
  color: #ffffff !important;
}

/* ライトモード時の確定着順事故・失格表示（濃い赤色で高い視認性を確保） */
html:not(.dark) .rank-badge-c {
  color: #dc2626 !important;
  font-weight: 800;
}

/* レース選択タブ */
html:not(.dark) #race-tabs button:not(.bg-blue-600) {
  background-color: #ffffff !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) #race-tabs button:not(.bg-blue-600):hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

/* ビュー切替タブ */
html:not(.dark) button[id^="tab-btn-"].border-transparent {
  color: #64748b !important;
}
html:not(.dark) button[id^="tab-btn-"].border-transparent:hover {
  color: #0f172a !important;
}
html:not(.dark) #tab-btn-racelist.border-blue-500 {
  color: #1d4ed8 !important;
}
html:not(.dark) #tab-btn-waku10.border-cyan-500 {
  color: #0284c7 !important;
}
html:not(.dark) #tab-btn-shingainen.border-purple-500 {
  color: #6d28d9 !important;
}
html:not(.dark) #tab-btn-section.border-indigo-500 {
  color: #4338ca !important;
}
html:not(.dark) #tab-btn-odds.border-amber-500 {
  color: #b45309 !important;
}
html:not(.dark) #tab-btn-result.border-emerald-500 {
  color: #047857 !important;
}

/* テーブルヘッダー（一般） */
html:not(.dark) thead th:not([class*="boat-badge-"]) {
  background-color: #f8fafc !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
html:not(.dark) thead th.text-cyan-300 { color: #0369a1 !important; }
html:not(.dark) thead th.text-blue-300 { color: #1d4ed8 !important; }
html:not(.dark) thead th.text-indigo-300 { color: #4338ca !important; }
html:not(.dark) thead th.text-violet-300 { color: #6d28d9 !important; }
html:not(.dark) thead th.text-emerald-300 { color: #047857 !important; }
html:not(.dark) thead th.text-teal-300 { color: #0f766e !important; }

/* 水面気象バッジ */
html:not(.dark) #race-header .bg-slate-800 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html:not(.dark) #race-header .bg-slate-800 strong {
  color: #0f172a !important;
}
html:not(.dark) #race-header .bg-slate-800 strong.text-white {
  color: #0f172a !important;
}
html:not(.dark) #race-header .bg-slate-800 strong.text-amber-300 {
  color: #b45309 !important;
}
html:not(.dark) #race-header .bg-slate-800 strong.text-cyan-300 {
  color: #0369a1 !important;
}

/* テーブル内の特殊列淡色背景 */
html:not(.dark) .bg-slate-900\/40 {
  background-color: rgba(241, 245, 249, 0.7) !important;
}

html:not(.dark) .bg-cyan-950\/20,
html:not(.dark) .bg-cyan-950\/40 {
  background-color: rgba(224, 242, 254, 0.7) !important;
}

html:not(.dark) .bg-blue-950\/20,
html:not(.dark) .bg-blue-950\/40 {
  background-color: rgba(239, 246, 255, 0.7) !important;
}

html:not(.dark) .bg-indigo-950\/20,
html:not(.dark) .bg-indigo-950\/40 {
  background-color: rgba(238, 242, 255, 0.7) !important;
}

html:not(.dark) .bg-violet-950\/20,
html:not(.dark) .bg-violet-950\/40 {
  background-color: rgba(245, 243, 255, 0.7) !important;
}

html:not(.dark) .bg-emerald-950\/20,
html:not(.dark) .bg-emerald-950\/40 {
  background-color: rgba(236, 253, 245, 0.7) !important;
}

html:not(.dark) .bg-teal-950\/20,
html:not(.dark) .bg-teal-950\/40 {
  background-color: rgba(240, 253, 250, 0.7) !important;
}

html:not(.dark) .bg-purple-950\/20,
html:not(.dark) .bg-purple-950\/40 {
  background-color: rgba(250, 245, 255, 0.7) !important;
}

html:not(.dark) .bg-amber-950\/20,
html:not(.dark) .bg-amber-950\/40 {
  background-color: rgba(254, 243, 199, 0.7) !important;
}

/* ライトモード時の枠番別行背景 */
html:not(.dark) .boat-row-1 { border-left: 5px solid #0f172a; background-color: #ffffff !important; }
html:not(.dark) .boat-row-2 { border-left: 5px solid #334155; background-color: #f8fafc !important; }
html:not(.dark) .boat-row-3 { border-left: 5px solid #dc2626; background-color: #fef2f2 !important; }
html:not(.dark) .boat-row-4 { border-left: 5px solid #2563eb; background-color: #eff6ff !important; }
html:not(.dark) .boat-row-5 { border-left: 5px solid #ca8a04; background-color: #fefce8 !important; }
html:not(.dark) .boat-row-6 { border-left: 5px solid #16a34a; background-color: #f0fdf4 !important; }

/* ランキングハイライト（ライトモード） */
html:not(.dark) .rank-motor-1 {
  color: #c2410c !important;
  text-shadow: none;
}

html:not(.dark) .rank-motor-2 {
  color: #ea580c !important;
  text-shadow: none;
}

html:not(.dark) .rank-st-1,
html:not(.dark) .rank-ex-1 {
  color: #0284c7 !important;
  text-shadow: none;
}

html:not(.dark) .rank-secst-1 {
  color: #059669 !important;
  text-shadow: none;
}

html:not(.dark) .waku-rank-num {
  color: #334155;
}
html:not(.dark) .waku-rank-num.grade-race {
  color: #9333ea !important; /* ライトモードで見やすい濃い紫色 */
}
html:not(.dark) .waku-rank-num.flying {
  color: #e11d48 !important;
}

html:not(.dark) .section-accordion-row {
  background-color: #f8fafc !important;
}

html:not(.dark) .section-rank-other {
  background-color: #e2e8f0;
  color: #475569 !important;
}

/* 新概念データ（ライトモード最適化） */
html:not(.dark) .from-amber-950\/20.via-slate-850.to-amber-950\/20 {
  background-image: linear-gradient(to right, rgba(254, 243, 199, 0.6), #ffffff, rgba(254, 243, 199, 0.6)) !important;
  border-color: #fcd34d !important;
}

html:not(.dark) #shingainen-boat-slots {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.04);
}

html:not(.dark) #shingainen-reset-btn {
  background-color: #ffffff !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
html:not(.dark) #shingainen-reset-btn:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html:not(.dark) #shingainen-stats-table,
html:not(.dark) #shingainen-motor-table {
  background-color: #ffffff !important;
}

html:not(.dark) #shingainen-header-row th.boat-badge-1 { background-color: #ffffff !important; color: #0f172a !important; border: 1.5px solid #cbd5e1 !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-2 { background-color: #1e293b !important; color: #ffffff !important; border-color: #334155 !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-3 { background-color: #dc2626 !important; color: #ffffff !important; border-color: #b91c1c !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-4 { background-color: #2563eb !important; color: #ffffff !important; border-color: #1d4ed8 !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-5 { background-color: #eab308 !important; color: #0f172a !important; border-color: #ca8a04 !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-6 { background-color: #16a34a !important; color: #ffffff !important; border-color: #15803d !important; }

html:not(.dark) #shingainen-header-row th.boat-badge-1 * { color: #0f172a !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-2 * { color: #ffffff !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-3 * { color: #ffffff !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-4 * { color: #ffffff !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-5 * { color: #0f172a !important; }
html:not(.dark) #shingainen-header-row th.boat-badge-6 * { color: #ffffff !important; }

html:not(.dark) #shingainen-body-rows tr:hover {
  background-color: #f8fafc !important;
}

html:not(.dark) #shingainen-motor-body tr:hover {
  background-color: #f8fafc !important;
}

/* 3連単オッズ（ライトモード最適化） */
html:not(.dark) #odds-top-popular-grid > div,
html:not(.dark) #odds-high-odds-grid > div {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

html:not(.dark) #odds-matrix-container > div {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

html:not(.dark) #odds-matrix-container .hover\:bg-slate-800\/50:hover {
  background-color: #f1f5f9 !important;
}

html:not(.dark) .bg-amber-500\/20 {
  background-color: #fef3c7 !important;
}

html:not(.dark) .bg-pink-500\/20 {
  background-color: #ffe4e6 !important;
}

html:not(.dark) .bg-emerald-500\/20,
html:not(.dark) .bg-emerald-500\/10 {
  background-color: #ecfdf5 !important;
}

html:not(.dark) .bg-purple-500\/20 {
  background-color: #f3e8ff !important;
}

html:not(.dark) .bg-blue-500\/20 {
  background-color: #dbeafe !important;
}

/* 払戻金カード（ライトモード） */
html:not(.dark) #payoffs-grid > div {
  background-color: #ffffff !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* 凡例フッター */
html:not(.dark) main > div:last-child {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* スクロールバー（ライトモード） */
html:not(.dark)::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html:not(.dark)::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
html:not(.dark)::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* スケジューラートグルボックス & バッジ（ライトモード対応） */
html:not(.dark) #scheduler-toggle-box {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
html:not(.dark) #scheduler-toggle-box span.text-slate-300 {
  color: #1e293b !important;
}

html:not(.dark) #scheduler-status-badge {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) #scheduler-status-badge.bg-emerald-950\/80,
html:not(.dark) #scheduler-status-badge.text-emerald-300 {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
  font-weight: 700 !important;
}

/* 締切予定時刻バッジ（ライトモード） */
html:not(.dark) #race-header .bg-amber-950\/60,
html:not(.dark) #race-header .bg-amber-950\/80,
html:not(.dark) #race-header .bg-amber-950\/40 {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fcd34d !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* レース個別更新ボタングループ（ライトモード） */
html:not(.dark) #race-header .bg-slate-800\/90 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

html:not(.dark) #btn-single-fetch-beforeinfo {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #7dd3fc !important;
  font-weight: 700 !important;
}
html:not(.dark) #btn-single-fetch-beforeinfo:hover {
  background-color: #bae6fd !important;
  color: #0284c7 !important;
}

html:not(.dark) #btn-single-fetch-odds {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fcd34d !important;
  font-weight: 700 !important;
}
html:not(.dark) #btn-single-fetch-odds:hover {
  background-color: #fde68a !important;
  color: #92400e !important;
}

html:not(.dark) #btn-single-fetch-result {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
  font-weight: 700 !important;
}
html:not(.dark) #btn-single-fetch-result:hover {
  background-color: #bbf7d0 !important;
  color: #166534 !important;
}

/* 展示タイム未反映通知バー（ライトモード） */
html:not(.dark) #race-header .bg-cyan-950\/40 {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #7dd3fc !important;
}
html:not(.dark) #race-header .bg-cyan-950\/40 strong {
  color: #0284c7 !important;
}

/* ==========================================================================
   節間成績マトリクステーブル（専門紙・公式スタイル）
   ========================================================================== */
.section-matrix-table {
  border: 1px solid #334155;
  background-color: #090d16;
}

.section-matrix-table th {
  border-color: #334155;
  background-color: #1e293b;
}

.section-matrix-table td {
  border-color: #1e293b;
}

.section-run-box {
  background-color: #020617;
  border: 1px solid #1e293b;
  border-radius: 3px;
}

html:not(.dark) .section-matrix-table {
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
}

html:not(.dark) .section-matrix-table th {
  background-color: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

html:not(.dark) .section-matrix-table td {
  border-color: #e2e8f0;
}

html:not(.dark) .section-run-box {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
}

html:not(.dark) .section-matrix-table td {
  border-color: #cbd5e1;
  color: #0f172a;
}

html:not(.dark) .section-matrix-table tr:hover {
  background-color: #f1f5f9;
}

html:not(.dark) .section-matrix-cell {
  background-color: #ffffff;
}

html.dark .section-matrix-table {
  border: 1px solid #1d4ed8;
  background-color: #0f172a;
}

html.dark .section-matrix-table th {
  background-color: #1e3a8a;
  color: #ffffff;
  border-color: #2563eb;
}

html.dark .section-matrix-table td {
  border-color: #1e293b;
}

html.dark .section-matrix-table tr:hover {
  background-color: rgba(30, 58, 138, 0.15);
}

/* ==========================================================================
   カレンダーポップアップ（ピッカー）専用スタイル (ライト / ダーク両対応)
   ========================================================================== */

/* ダークモード */
html.dark #calendar-popup,
.dark #calendar-popup {
  background-color: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
}
html.dark .cal-header-border,
.dark .cal-header-border {
  border-color: #334155 !important;
}
html.dark .cal-title-text,
.dark .cal-title-text {
  color: #f8fafc !important;
}
html.dark .cal-nav-btn,
.dark .cal-nav-btn {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
}
html.dark .cal-nav-btn:hover,
.dark .cal-nav-btn:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}
html.dark .cal-week-header,
.dark .cal-week-header {
  color: #94a3b8 !important;
}
html.dark .cal-footer-text,
.dark .cal-footer-text {
  color: #94a3b8 !important;
}

/* ライトモード（高いコントラストと清潔感のあるカードデザイン） */
html:not(.dark) #calendar-popup {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}
html:not(.dark) .cal-header-border {
  border-color: #e2e8f0 !important;
}
html:not(.dark) .cal-title-text {
  color: #0f172a !important;
  font-weight: 800 !important;
}
html:not(.dark) .cal-nav-btn {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
html:not(.dark) .cal-nav-btn:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}
html:not(.dark) .cal-week-header {
  color: #475569 !important;
}
html:not(.dark) .cal-footer-text {
  color: #475569 !important;
}

/* カレンダー日付セル */
.cal-day-cell {
  padding: 0.35rem 0.25rem;
  text-align: center;
  border-radius: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  height: 2.125rem;
}

/* 選択中の日付 */
.cal-day-selected {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4) !important;
  border: 1px solid #3b82f6 !important;
}
.cal-day-selected * {
  color: #ffffff !important;
}

/* データ保存済み（ライトモード） */
html:not(.dark) .cal-day-saved {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}
html:not(.dark) .cal-day-saved:hover {
  background-color: #d1fae5 !important;
  border-color: #6ee7b7 !important;
}
html:not(.dark) .cal-day-saved .cal-dot {
  background-color: #10b981 !important;
}

/* データ保存済み（ダークモード） */
html.dark .cal-day-saved,
.dark .cal-day-saved {
  background-color: #064e3b !important;
  color: #6ee7b7 !important;
  border: 1px solid #059669 !important;
}
html.dark .cal-day-saved:hover,
.dark .cal-day-saved:hover {
  background-color: #047857 !important;
  color: #ffffff !important;
}
html.dark .cal-day-saved .cal-dot,
.dark .cal-day-saved .cal-dot {
  background-color: #34d399 !important;
}

/* 未保存の通常日（ライトモード） */
html:not(.dark) .cal-day-default {
  background-color: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
}
html:not(.dark) .cal-day-default:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* 未保存の通常日（ダークモード） */
html.dark .cal-day-default,
.dark .cal-day-default {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
}
html.dark .cal-day-default:hover,
.dark .cal-day-default:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}

/* 余白（前月・翌月） */
html:not(.dark) .cal-day-empty {
  color: #cbd5e1 !important;
}
html.dark .cal-day-empty,
.dark .cal-day-empty {
  color: #475569 !important;
}

/* 本日枠 */
.cal-day-today:not(.cal-day-selected) {
  outline: 2px solid #0284c7 !important;
  outline-offset: -1px;
}

/* ==========================================================================
   ライトモード包括的スタイル対応 (html:not(.dark))
   ========================================================================== */

/* 全体背景・文字色 */
html:not(.dark) body {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

/* カード・コンテナのライトモード */
html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-950,
html:not(.dark) .bg-slate-850 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* テーブル・マトリクスのライトモード */
html:not(.dark) .bg-slate-800,
html:not(.dark) .bg-slate-800\/80,
html:not(.dark) .bg-slate-800\/60 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}

html:not(.dark) table thead {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
}

html:not(.dark) table thead th {
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

/* テキストカラーのライトモード補正 */
html:not(.dark) .text-slate-200,
html:not(.dark) .text-slate-300,
html:not(.dark) .text-slate-100 {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-400 {
  color: #475569 !important;
}

html:not(.dark) .text-slate-500 {
  color: #64748b !important;
}

/* ボーダー色のライトモード補正 */
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-700\/80,
html:not(.dark) .border-slate-700\/60 {
  border-color: #e2e8f0 !important;
}

html:not(.dark) .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
html:not(.dark) .divide-slate-700 > :not([hidden]) ~ :not([hidden]) {
  border-color: #e2e8f0 !important;
}

/* 2連単・3連単オッズテーブルのライトモード */
html:not(.dark) #odds-matrix-container > div,
html:not(.dark) #odds-2t-matrix-container > div {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) #odds-matrix-container .divide-y > div:hover,
html:not(.dark) #odds-2t-matrix-container .divide-y > div:hover {
  background-color: #f1f5f9 !important;
}

/* 枠番行のライトモード背景・ボーダー */
html:not(.dark) .boat-row-1 { border-left: 5px solid #0f172a !important; background-color: rgba(255, 255, 255, 0.9) !important; }
html:not(.dark) .boat-row-2 { border-left: 5px solid #334155 !important; background-color: rgba(241, 245, 249, 0.8) !important; }
html:not(.dark) .boat-row-3 { border-left: 5px solid #dc2626 !important; background-color: rgba(254, 242, 242, 0.8) !important; }
html:not(.dark) .boat-row-4 { border-left: 5px solid #2563eb !important; background-color: rgba(239, 246, 255, 0.8) !important; }
html:not(.dark) .boat-row-5 { border-left: 5px solid #d97706 !important; background-color: rgba(254, 252, 232, 0.8) !important; }
html:not(.dark) .boat-row-6 { border-left: 5px solid #16a34a !important; background-color: rgba(240, 253, 244, 0.8) !important; }

html:not(.dark) .boat-row-1:hover { background-color: rgba(241, 245, 249, 1) !important; }
html:not(.dark) .boat-row-2:hover { background-color: rgba(226, 232, 240, 1) !important; }
html:not(.dark) .boat-row-3:hover { background-color: rgba(254, 226, 226, 1) !important; }
html:not(.dark) .boat-row-4:hover { background-color: rgba(219, 234, 254, 1) !important; }
html:not(.dark) .boat-row-5:hover { background-color: rgba(254, 240, 138, 0.7) !important; }
html:not(.dark) .boat-row-6:hover { background-color: rgba(220, 252, 231, 1) !important; }

/* 買い目ハイライト効果 */
.odds-highlight-pick {
  outline: 2px solid #f59e0b !important;
  background-color: rgba(245, 158, 11, 0.2) !important;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   オッズマトリクス & 枠番バッジ 完全視認性保証ルール (ライト/ダーク両対応)
   ========================================================================== */

/* 1号艇 (白) */
.boat-badge-1,
th.boat-badge-1,
td.boat-badge-1,
div.boat-badge-1,
span.boat-badge-1 {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}
.boat-badge-1 .badge-racer-name {
  color: #0f172a !important;
  font-weight: 900 !important;
}
.boat-badge-1 .badge-num-circle {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}

/* 2号艇 (黒) */
.boat-badge-2,
th.boat-badge-2,
td.boat-badge-2,
div.boat-badge-2,
span.boat-badge-2 {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid #334155 !important;
}
.boat-badge-2 .badge-racer-name {
  color: #ffffff !important;
  font-weight: 900 !important;
}
.boat-badge-2 .badge-num-circle {
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 900 !important;
}

/* 3号艇 (赤) */
.boat-badge-3,
th.boat-badge-3,
td.boat-badge-3,
div.boat-badge-3,
span.boat-badge-3 {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
}
.boat-badge-3 .badge-racer-name {
  color: #ffffff !important;
  font-weight: 900 !important;
}
.boat-badge-3 .badge-num-circle {
  background-color: #ffffff !important;
  color: #dc2626 !important;
  font-weight: 900 !important;
}

/* 4号艇 (青) */
.boat-badge-4,
th.boat-badge-4,
td.boat-badge-4,
div.boat-badge-4,
span.boat-badge-4 {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}
.boat-badge-4 .badge-racer-name {
  color: #ffffff !important;
  font-weight: 900 !important;
}
.boat-badge-4 .badge-num-circle {
  background-color: #ffffff !important;
  color: #2563eb !important;
  font-weight: 900 !important;
}

/* 5号艇 (黄) */
.boat-badge-5,
th.boat-badge-5,
td.boat-badge-5,
div.boat-badge-5,
span.boat-badge-5 {
  background-color: #eab308 !important;
  color: #0f172a !important;
  border: 1px solid #ca8a04 !important;
}
.boat-badge-5 .badge-racer-name {
  color: #0f172a !important;
  font-weight: 900 !important;
}
.boat-badge-5 .badge-num-circle {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}

/* 6号艇 (緑) */
.boat-badge-6,
th.boat-badge-6,
td.boat-badge-6,
div.boat-badge-6,
span.boat-badge-6 {
  background-color: #16a34a !important;
  color: #ffffff !important;
  border: 1px solid #15803d !important;
}
.boat-badge-6 .badge-racer-name {
  color: #ffffff !important;
  font-weight: 900 !important;
}
.boat-badge-6 .badge-num-circle {
  background-color: #ffffff !important;
  color: #16a34a !important;
  font-weight: 900 !important;
}

/* 小バッジ（2着・3着枠番号） */
span.boat-badge-1 { color: #0f172a !important; }
span.boat-badge-2 { color: #ffffff !important; }
span.boat-badge-3 { color: #ffffff !important; }
span.boat-badge-4 { color: #ffffff !important; }
span.boat-badge-5 { color: #0f172a !important; }
span.boat-badge-6 { color: #ffffff !important; }

/* オッズ表内の文字色（ライトモード） */
html:not(.dark) #odds-matrix-container,
html:not(.dark) #odds-2t-matrix-container {
  color: #0f172a !important;
}

html:not(.dark) #odds-matrix-container .odds-val-normal,
html:not(.dark) #odds-2t-matrix-container .odds-val-normal {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html:not(.dark) .odds-pop-rank {
  color: #475569 !important;
  font-weight: 700 !important;
}

html.dark .odds-pop-rank,
.dark .odds-pop-rank {
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

/* ==========================================================================
   出走表 選手名横 新概念バッジ (ダーク & ライト両対応)
   ========================================================================== */
.shingainen-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

.shingainen-badge .badge-label {
  opacity: 0.9;
  margin-right: 3px;
  font-size: 9.5px;
  font-weight: 700;
}

.shingainen-badge .badge-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 800;
}

/* 1号艇: 逃げ率 */
.dark .shingainen-badge-nige,
html.dark .shingainen-badge-nige {
  background-color: rgba(225, 29, 72, 0.22) !important;
  color: #fda4af !important;
  border: 1px solid rgba(244, 63, 94, 0.6) !important;
}
html:not(.dark) .shingainen-badge-nige {
  background-color: #ffe4e6 !important;
  color: #9f1239 !important;
  border: 1px solid #fecdd3 !important;
}

/* 2号艇: 逃がし率 */
.dark .shingainen-badge-nigashi,
html.dark .shingainen-badge-nigashi {
  background-color: rgba(16, 185, 129, 0.22) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.6) !important;
}
html:not(.dark) .shingainen-badge-nigashi {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
}

/* 2〜6号艇: 差し率 */
.dark .shingainen-badge-sashi,
html.dark .shingainen-badge-sashi {
  background-color: rgba(6, 182, 212, 0.22) !important;
  color: #67e8f9 !important;
  border: 1px solid rgba(6, 182, 212, 0.6) !important;
}
html:not(.dark) .shingainen-badge-sashi {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

/* 2〜6号艇: まくり率 */
.dark .shingainen-badge-makuri,
html.dark .shingainen-badge-makuri {
  background-color: rgba(245, 158, 11, 0.22) !important;
  color: #fcd34d !important;
  border: 1px solid rgba(245, 158, 11, 0.6) !important;
}
html:not(.dark) .shingainen-badge-makuri {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}







/* ==========================================================================
   決まり手バッジ (ライト / ダーク両対応・高コントラスト視認性強化)
   ========================================================================== */
.kimarite-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ライトモード: 明るいミント背景に濃いエメラルド文字でくっきり視認 */
html:not(.dark) .kimarite-badge,
.kimarite-badge-light {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid #6ee7b7 !important;
}

/* ダークモード */
html.dark .kimarite-badge,
.dark .kimarite-badge {
  background-color: rgba(6, 78, 59, 0.6) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

/* レース中止バッジ */
html:not(.dark) .kimarite-badge-cancelled {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}
html.dark .kimarite-badge-cancelled,
.dark .kimarite-badge-cancelled {
  background-color: rgba(127, 29, 29, 0.6) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

/* ==========================================================================
   コース変更・進入順アラートバー (ライト / ダーク両対応・高視認性)
   ========================================================================== */
html:not(.dark) .course-order-alert-bar {
  background: #fef3c7 !important; /* 明るく温かみのある注意喚起イエロー */
  border: 2px solid #f59e0b !important;
  color: #78350f !important;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15) !important;
}

html:not(.dark) .course-order-label {
  color: #78350f !important; /* 濃いアンバーブラウンでくっきり明瞭 */
  font-weight: 800 !important;
}

html:not(.dark) .course-order-arrow {
  color: #b45309 !important; /* 濃く目立つオレンジの矢印 */
  font-weight: 900 !important;
  font-size: 13px !important;
}

html.dark .course-order-alert-bar {
  background: linear-gradient(to right, rgba(69, 26, 3, 0.9), rgba(120, 53, 15, 0.8), rgba(69, 26, 3, 0.9)) !important;
  border: 2px solid rgba(245, 158, 11, 0.8) !important;
}

html.dark .course-order-label {
  color: #fde68a !important;
  font-weight: 700 !important;
}

html.dark .course-order-arrow {
  color: #fcd34d !important;
  font-weight: 800 !important;
  font-size: 13px !important;
}
#scheduler-toggle-box,
#tab-btn-tasks {
  display: none !important;
}
/* 非開催場（オプトグループおよび非開催オプション）の完全非表示ルール */
optgroup[label*="非開催"],
optgroup[label*="レースなし"],
optgroup.inactive-stadium-group,
option[class*="text-slate-500"] {
  display: none !important;
  visibility: hidden !important;
}
/* 公開用: ボタン・凡例・保存済バッジの非表示ルール */
#btn-open-range-sync-modal,
#btn-fetch-shingainen,
#scraping-buttons-box,
#date-saved-status-badge,
#footer-legend {
  display: none !important;
  visibility: hidden !important;
}
/* 公開用: レース単一更新・展示・オッズ・結果ボタンの非表示ルール */
#single-fetch-buttons-box,
#btn-single-fetch-all,
#btn-single-fetch-beforeinfo,
#btn-single-fetch-odds,
#btn-single-fetch-result {
  display: none !important;
  visibility: hidden !important;
}
/* 公開用: 進入予想シミュレーション ヘッダー & BOATBoyバッジの非表示 */
#shingainen-sim-header,
#boatboy-badge {
  display: none !important;
  visibility: hidden !important;
}

/* 公開用: すべてのデータ取得・更新ボタン・モーダルの非表示ルール */
#scraping-buttons-box,
#btn-open-range-sync-modal,
#btn-fetch-shingainen,
#range-sync-modal,
#single-fetch-buttons-box,
#btn-single-fetch-all,
#btn-single-fetch-beforeinfo,
#btn-single-fetch-odds,
#btn-single-fetch-result,
button[onclick*="fetchSingleRaceData"],
button[onclick*="fetchOnlineData"],
button[onclick*="openRangeSyncModal"],
button[onclick*="executeRangeSync"] {
  display: none !important;
  visibility: hidden !important;
}


/* =========================================================================
   モバイル・レスポンシブ最適化 (Mobile Responsive & Sticky Columns)
   ========================================================================= */

/* スクロールバー非表示 (指でのスワイプ操作は有効) */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* 出走表テーブル: 艇番 & 選手名の左側固定 (Sticky Columns) */
.sticky-col-boat {
  position: sticky !important;
  left: 0 !important;
  z-index: 20 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
}

.sticky-col-racer {
  position: sticky !important;
  left: 48px !important;
  z-index: 20 !important;
  width: 175px !important;
  min-width: 175px !important;
  box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.25) !important;
}

/* thead（ヘッダー行）固定時の最前面表示 (Z-index 30) */
thead th.sticky-col-boat,
thead th.sticky-col-racer {
  z-index: 30 !important;
}
html.dark thead th.sticky-col-boat,
html.dark thead th.sticky-col-racer {
  background-color: #1e293b !important; /* bg-slate-800 */
}
html:not(.dark) thead th.sticky-col-boat,
html:not(.dark) thead th.sticky-col-racer {
  background-color: #f1f5f9 !important; /* bg-slate-100 */
}

/* tbody（各行）の固定列 背景色 (スクロール時に文字が透けないよう完全不透明化) */
/* ダークモード */
html.dark tr.boat-row-1 td.sticky-col-boat,
html.dark tr.boat-row-1 td.sticky-col-racer {
  background-color: #172033 !important;
}
html.dark tr.boat-row-2 td.sticky-col-boat,
html.dark tr.boat-row-2 td.sticky-col-racer {
  background-color: #141c2e !important;
}
html.dark tr.boat-row-3 td.sticky-col-boat,
html.dark tr.boat-row-3 td.sticky-col-racer {
  background-color: #21151b !important;
}
html.dark tr.boat-row-4 td.sticky-col-boat,
html.dark tr.boat-row-4 td.sticky-col-racer {
  background-color: #101c2e !important;
}
html.dark tr.boat-row-5 td.sticky-col-boat,
html.dark tr.boat-row-5 td.sticky-col-racer {
  background-color: #231f13 !important;
}
html.dark tr.boat-row-6 td.sticky-col-boat,
html.dark tr.boat-row-6 td.sticky-col-racer {
  background-color: #0f2119 !important;
}

/* ライトモード */
html:not(.dark) tr.boat-row-1 td.sticky-col-boat,
html:not(.dark) tr.boat-row-1 td.sticky-col-racer {
  background-color: #ffffff !important;
}
html:not(.dark) tr.boat-row-2 td.sticky-col-boat,
html:not(.dark) tr.boat-row-2 td.sticky-col-racer {
  background-color: #f8fafc !important;
}
html:not(.dark) tr.boat-row-3 td.sticky-col-boat,
html:not(.dark) tr.boat-row-3 td.sticky-col-racer {
  background-color: #fff1f2 !important;
}
html:not(.dark) tr.boat-row-4 td.sticky-col-boat,
html:not(.dark) tr.boat-row-4 td.sticky-col-racer {
  background-color: #eff6ff !important;
}
html:not(.dark) tr.boat-row-5 td.sticky-col-boat,
html:not(.dark) tr.boat-row-5 td.sticky-col-racer {
  background-color: #fefce8 !important;
}
html:not(.dark) tr.boat-row-6 td.sticky-col-boat,
html:not(.dark) tr.boat-row-6 td.sticky-col-racer {
  background-color: #f0fdf4 !important;
}

/* モバイル向けファーストビュー最適化 */
@media (max-width: 640px) {
  /* テーブルの最小幅保証 */
  #view-racelist table {
    min-width: 880px !important;
  }
  
  /* レースタブのパディング・文字最適化 */
  #race-tabs button {
    padding: 0.35rem 0.5rem !important;
    min-width: 48px !important;
  }
  
  /* ビュー切り替えタブのコンパクト化 */
  .border-b.border-slate-800 button[id^="tab-btn-"] {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    font-size: 0.8125rem !important;
  }
}


/* ==========================================================================
   オッズ倍率カラーリング (10倍未満: 赤 / 100倍〜999倍: 青 / 1000倍以上: 黄)
   ========================================================================== */
.odds-tier-low,
html:not(.dark) .odds-tier-low {
  color: #dc2626 !important; /* 赤色 */
  font-weight: 900 !important;
}

.odds-tier-mid,
html:not(.dark) .odds-tier-mid {
  color: #2563eb !important; /* 青色 */
  font-weight: 900 !important;
}

.odds-tier-high {
  color: #facc15 !important; /* ダーク: 鮮やかな黄色 */
  font-weight: 900 !important;
}
html:not(.dark) .odds-tier-high {
  color: #d97706 !important; /* ライト: 白背景でもクッキリ読める濃いアンバーゴールド */
  font-weight: 900 !important;
}


/* ==========================================================================
   展示・オリジナルタイム列の幅均等化および順位別着色
   ========================================================================== */
.col-time-stat {
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  box-sizing: border-box !important;
}

/* タイムのフォント・文字サイズ拡大 */
.time-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  display: block;
  text-align: center;
}

/* タイム順位別の文字色 (バッジ撤廃・文字直接着色) */
/* 1位: 赤色 */
.time-rank-1 {
  color: #dc2626 !important; /* red-600 */
  font-weight: 800 !important;
}
html.dark .time-rank-1 {
  color: #f87171 !important; /* red-400 */
}

/* 2位: 青色 */
.time-rank-2 {
  color: #2563eb !important; /* blue-600 */
  font-weight: 800 !important;
}
html.dark .time-rank-2 {
  color: #60a5fa !important; /* blue-400 */
}

/* それ以外: ライトモードは黒色、ダークモードは識別できる色(明るいグレー/白) */
.time-rank-other {
  color: #0f172a !important; /* slate-900 / 黒色 */
  font-weight: 700 !important;
}
html.dark .time-rank-other {
  color: #f1f5f9 !important; /* slate-100 / 白 */
}

/* 未測定/未発表 (-) */
.time-rank-empty {
  color: #94a3b8 !important; /* slate-400 */
  font-weight: 400 !important;
}
