/* ================================================================
   monolith — 共通スタイルシート（netkeiba デザイン参考）
   ================================================================ */

/* ── リセット & ベース ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", Meiryo, "BIZ UDPGothic", sans-serif;
  font-size: 13px;
  color: #333;
  background: #f0f2f5;
  min-height: 100vh;
}

a { color: #1a5499; text-decoration: none; }
a:hover { text-decoration: underline; color: #e8380d; }

/* ── サイトヘッダー ─────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(to bottom, #1e3d7a, #1b346b);
  border-bottom: 3px solid #e8380d;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
}
.site-logo a {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.site-logo a:hover { text-decoration: none; opacity: 0.85; }
.site-tagline {
  color: #b0c4de;
  font-size: 11px;
}

/* ── パンくず ────────────────────────────────────────────────────── */
.breadcrumb {
  background: #ecf0f6;
  border-bottom: 1px solid #d0d8e8;
  font-size: 11px;
  color: #666;
}
.breadcrumb-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 12px;
}
.breadcrumb a { color: #1a5499; }
.breadcrumb .sep { margin: 0 4px; color: #999; }

/* ── メインコンテナ ──────────────────────────────────────────────── */
.main-container {
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 12px;
}

/* ── ページタイトル ──────────────────────────────────────────────── */
.page-title-block {
  background: #fff;
  border: 1px solid #d0d8e8;
  border-left: 4px solid #1b346b;
  padding: 8px 14px;
  margin-bottom: 12px;
}
.page-title {
  font-size: 16px;
  font-weight: bold;
  color: #1b346b;
}

/* ── 日付タブ ────────────────────────────────────────────────────── */
.date-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.date-tab {
  padding: 7px 18px;
  background: #dde3ee;
  border: 1px solid #b8c4d8;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  transition: background 0.15s;
  user-select: none;
}
.date-tab:hover { background: #cdd5e8; }
.date-tab.active {
  background: #1b346b;
  color: #fff;
  border-color: #1b346b;
}

/* ── 会場セクション ──────────────────────────────────────────────── */
.venue-section {
  background: #fff;
  border: 1px solid #ccd4e0;
  margin-bottom: 16px;
  border-radius: 2px;
}
.venue-header {
  background: linear-gradient(to right, #1b346b, #254a90);
  color: #fff;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.venue-name {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.venue-round {
  font-size: 11px;
  color: #b0c4de;
}

/* ── レース一覧テーブル（INDEX） ─────────────────────────────────── */
.race-table {
  width: 100%;
  border-collapse: collapse;
}
.race-table th {
  background: #ecf0f6;
  border: 1px solid #d0d8e8;
  padding: 6px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #445;
  white-space: nowrap;
}
.race-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  vertical-align: middle;
}
.race-table tr:nth-child(even) td { background: #fafbfd; }
.race-table tr:hover td { background: #eef4ff !important; }

.td-race-num {
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  width: 36px;
}
.td-race-name { min-width: 180px; }
.td-class     { text-align: center; white-space: nowrap; width: 90px; }
.td-course    { text-align: center; white-space: nowrap; width: 110px; }
.td-time      { text-align: center; white-space: nowrap; width: 58px; }
.td-heads     { text-align: center; white-space: nowrap; width: 42px; color: #555; }

.race-link {
  font-weight: bold;
  font-size: 13px;
  color: #1a5499;
}
.race-link:hover { color: #e8380d; }

/* ── グレードバッジ ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
  line-height: 1.5;
}
.badge-g1  { background: #c00; color: #fff; }
.badge-g2  { background: #005aab; color: #fff; }
.badge-g3  { background: #5a7a00; color: #fff; }
.badge-l   { background: #666; color: #fff; }
.badge-op  { background: #888; color: #fff; }

/* ── トラック表示 ────────────────────────────────────────────────── */
.track-turf   { color: #007700; font-weight: bold; }
.track-dirt   { color: #996633; font-weight: bold; }
.track-hurdle { color: #663300; font-weight: bold; }

/* ── 馬場状態 ────────────────────────────────────────────────────── */
.cond-good   { color: #0055cc; }
.cond-yayamo { color: #007700; }
.cond-heavy  { color: #cc6600; }
.cond-bad    { color: #cc0000; }

/* ── 枠番カラーボックス ──────────────────────────────────────────── */
.gate-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}
.gate-1 { background: #f8f8f8; color: #333; border: 1px solid #aaa; }
.gate-2 { background: #222; color: #fff; }
.gate-3 { background: #c00; color: #fff; }
.gate-4 { background: #005aab; color: #fff; }
.gate-5 { background: #f0c800; color: #333; }
.gate-6 { background: #007700; color: #fff; }
.gate-7 { background: #e05c00; color: #fff; }
.gate-8 { background: #e86fa0; color: #fff; }

/* ── 人気ランク ──────────────────────────────────────────────────── */
.pop-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
}
.pop-1 { background: #ffeeee; color: #cc0000; border: 2px solid #cc0000; }
.pop-2 { background: #eeeeff; color: #0000cc; border: 2px solid #0000cc; }
.pop-3 { background: #eeffee; color: #006600; border: 2px solid #006600; }
.pop-other { background: #f4f4f4; color: #555; border: 1px solid #bbb; }
.pop-none  { color: #aaa; font-size: 11px; }

/* ── レース詳細ヘッダー ──────────────────────────────────────────── */
.race-info-header {
  background: #fff;
  border: 1px solid #ccd4e0;
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}
.race-info-top {
  background: linear-gradient(to right, #1b346b, #254a90);
  color: #fff;
  padding: 10px 16px;
}
.race-info-top .race-round {
  font-size: 11px;
  color: #b0c4de;
  margin-bottom: 3px;
}
.race-info-top .race-title {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.race-info-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 8px 16px;
  border-top: 2px solid #e8380d;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 20px;
  padding: 4px 0;
  font-size: 12px;
}
.info-label {
  color: #888;
  font-size: 11px;
}
.info-value {
  font-weight: bold;
  color: #222;
}

/* ── 出走馬テーブル ──────────────────────────────────────────────── */
.entry-table-wrap {
  background: #fff;
  border: 1px solid #ccd4e0;
  border-radius: 2px;
  overflow-x: auto;
}
.entry-table-header {
  padding: 8px 14px;
  border-bottom: 1px solid #e0e6f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.entry-table-title {
  font-size: 14px;
  font-weight: bold;
  color: #1b346b;
}
.odds-updated {
  font-size: 11px;
  color: #888;
}

.entry-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}
.entry-table th {
  background: #ecf0f6;
  border: 1px solid #d0d8e8;
  padding: 6px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #445;
  white-space: nowrap;
}
.entry-table td {
  border: 1px solid #e2e8f0;
  padding: 7px 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.entry-table tr:nth-child(even) td { background: #fafbfd; }
.entry-table tr:hover td { background: #eef4ff !important; }

.et-pop     { text-align: center; width: 40px; }
.et-gate    { text-align: center; width: 36px; }
.et-num     { text-align: center; width: 36px; font-weight: bold; }
.et-name    { min-width: 110px; font-weight: bold; font-size: 13px; }
.et-sex     { text-align: center; width: 52px; color: #555; }
.et-weight  { text-align: center; width: 46px; }
.et-jockey  { width: 72px; }
.et-trainer { width: 90px; color: #666; font-size: 11px; }
.et-bw      { text-align: center; width: 74px; color: #555; }
.et-win     { text-align: right; width: 62px; font-weight: bold; }
.et-place   { text-align: right; width: 90px; color: #555; }

.win-odds-val {
  font-size: 14px;
  font-weight: bold;
  color: #cc0000;
}
.win-odds-na { color: #bbb; font-size: 12px; }

/* ── ローディング / エラー / データなし ─────────────────────────── */
.state-box {
  background: #fff;
  border: 1px solid #ccd4e0;
  border-radius: 2px;
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 14px;
}
.state-box .icon { font-size: 32px; margin-bottom: 10px; }
.loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid #dde3ee;
  border-top-color: #1b346b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── フッター ────────────────────────────────────────────────────── */
.site-footer {
  background: #1b346b;
  color: #b0c4de;
  font-size: 11px;
  margin-top: 32px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 12px;
  text-align: center;
}

/* ── レスポンシブ補助 ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .entry-table-wrap { font-size: 12px; }
  .et-trainer { display: none; }
  .et-bw      { display: none; }
}
