/* 競艇予測ラボ サイト共通スタイル
 * 配色: 濃紺ヘッダー + 寒色ベース(維持)。影・階層・カードで立体感を出す。 */
:root {
  --primary: #0b5394;
  --primary-dark: #073763;
  --accent: #e69138;
  --bg: #eef2f6;
  --card-bg: #ffffff;
  --text: #24303c;
  --muted: #64748b;
  --border: #e4e9f0;
  --border-strong: #d3dce6;
  --hit: #1a7f4b;
  --hit-bg: #e9f7ef;
  --miss: #b3392f;
  --miss-bg: #fceeec;
  --zebra: #f5f8fb;
  --th-bg: #eaf1f8;
  /* 影は淡く上品に重ねる */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-header: 0 2px 10px rgba(7, 55, 99, .18);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-header {
  background: linear-gradient(180deg, #0b5394, #073763);
  color: #fff;
  padding: 14px 0;
  box-shadow: var(--shadow-header);
  position: relative;
  z-index: 10;
}
.site-logo { font-size: 1.4rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .02em; }
.site-tagline { margin: 2px 0 10px; font-size: 0.8rem; color: #cfe2f3; }
.global-nav a {
  color: #fff; text-decoration: none; margin-right: 16px; font-size: 0.95rem;
  border-bottom: 2px solid transparent; padding-bottom: 3px; transition: border-color .15s ease;
}
.global-nav a:hover { border-bottom-color: var(--accent); }

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: 0.8rem; color: var(--muted); padding: 12px 16px 4px; }
.breadcrumb a { color: var(--muted); }

main { padding: 16px 16px 56px; }

/* ---------- headings ---------- */
h1 {
  font-size: 1.55rem; line-height: 1.4; font-weight: 700;
  border-left: 5px solid var(--primary); padding-left: 12px; margin: 6px 0 18px;
}
h2 {
  font-size: 1.28rem; font-weight: 700; line-height: 1.4;
  padding-bottom: 8px; margin: 0 0 16px;
  border-bottom: 2px solid var(--border-strong);
}
h3 { font-size: 1.08rem; font-weight: 700; margin-top: 1.6em; }
.lead { color: var(--text); }
.note { font-size: 0.82rem; color: var(--muted); }
.empty-note {
  background: #fff8e7; border: 1px solid #f0dfb2; padding: 14px 18px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}

/* セクション間の余白を広げ階層を作る */
main > section { margin: 0 0 32px; }
main > section > h2 { margin-top: 0; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(125deg, #0d5da0, #073763);
  color: #fff; padding: 32px 28px; border-radius: var(--radius);
  margin: 4px 0 32px; box-shadow: var(--shadow-md);
}
.hero h1 { color: #fff; border: none; padding-left: 0; margin: 0 0 14px; font-size: 1.7rem; }
.hero-lead { color: #eaf2fb; margin: 0 0 14px; }
.hero .update-time {
  color: #ffe08a; font-weight: 700; margin: 0; font-size: .95rem;
  display: inline-block; background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 224, 138, .5); border-radius: 999px; padding: 6px 16px;
}

/* ---------- panel(テキスト系モジュールを白カード化) ---------- */
.howto, .policy-summary, .yesterday, .definition,
.my-venues, .tracker-section, .disclaimer-block,
.verification-detail, .summary-cards, .featured, .venues-tomorrow,
.chart-section, .daily-table-section, .venue-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
/* パネル見出しに一貫した左アクセント(絵文字の代替) */
.howto > h2, .policy-summary > h2, .yesterday > h2, .definition > h2,
.my-venues > h2, .tracker-section > h2, .summary-cards > h2, .featured > h2,
.venues-tomorrow > h2, .chart-section > h2, .daily-table-section > h2,
.verification-detail > h2 {
  border-bottom: none; padding: 0 0 0 12px; margin-bottom: 14px;
  border-left: 4px solid var(--primary); line-height: 1.3;
}

/* ---------- stat cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
}
.card-main {
  border: 1px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 83, 148, .10), var(--shadow-sm);
}
.card-label { font-size: 0.82rem; color: var(--muted); }
.card-value { font-size: 2.1rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card-main .card-value { color: var(--primary-dark); }
.card-sub { font-size: 0.82rem; color: var(--muted); }

/* ---------- tables(データらしく立体化) ---------- */
.race-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card-bg); font-size: 0.9rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}
/* パネル内のテーブルは影を持たせず二重感を避ける */
.tracker-section .race-table, .daily-table-section .race-table,
.verification-detail .race-table, .venue-block .race-table,
.summary-cards .race-table {
  box-shadow: none;
}
.race-table th, .race-table td {
  border-bottom: 1px solid var(--border); padding: 9px 11px;
  text-align: left; vertical-align: top;
}
.race-table tbody tr:last-child td { border-bottom: none; }
.race-table thead th {
  background: var(--th-bg); font-weight: 700; color: #33465a;
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
/* ゼブラ(検証表は的中/外れ色を優先するため除外) */
.race-table:not(.kensho-table) tbody tr:nth-child(even) td { background: var(--zebra); }
.race-table .honmei { font-weight: 700; color: var(--primary-dark); }
.race-name, .racer-name { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.reasons { font-size: 0.78rem; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 的中/外れ/判定不可の行 */
.row-hit td { background: var(--hit-bg); }
.row-miss td { background: var(--miss-bg); }
.row-void td { background: #f1f4f7; color: var(--muted); }
.mark { font-weight: 700; }
.row-hit .mark { color: var(--hit); }
.row-miss .mark { color: var(--miss); }
.pos { color: var(--hit); font-weight: 700; }
.neg { color: var(--miss); font-weight: 700; }
.stats-table th { width: 20%; background: var(--th-bg); }
.stats-table td { font-variant-numeric: tabular-nums; }

/* ---------- venue cards(クリック可・ホバーで浮遊) ---------- */
.venue-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.venue-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.venue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.venue-card-head { display: flex; justify-content: space-between; align-items: center; }
.venue-name { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.venue-name:hover { text-decoration: underline; }
.venue-meta { font-size: 0.8rem; color: var(--muted); margin: 4px 0; }
.venue-desc { font-size: 0.82rem; margin: 6px 0; }
.venue-open { font-size: 0.8rem; color: var(--hit); font-weight: 700; }
.venue-honmei { font-size: 0.85rem; }
.venue-card p { margin: 6px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; background: var(--primary); color: #fff; text-decoration: none;
  padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 700;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.fav-btn {
  background: #fff; border: 1px solid var(--border-strong); border-radius: 8px;
  cursor: pointer; font-size: 1rem; padding: 3px 9px; color: var(--muted);
  transition: transform .12s ease, color .12s ease, border-color .12s ease;
}
.fav-btn:hover { transform: translateY(-1px); }
.fav-btn.active { color: var(--accent); border-color: var(--accent); background: #fff9f1; }
.fav-btn-large { font-size: 0.9rem; padding: 7px 14px; }
.track-btn {
  background: #fff; border: 1px solid var(--primary); color: var(--primary);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 0.78rem; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.track-btn:hover { background: #eef4fb; }
.track-btn.tracked { background: var(--primary); color: #fff; }
.small-link { font-size: 0.82rem; background: none; border: none; color: var(--primary); cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- jump nav ---------- */
.jump-nav {
  margin: 0 0 24px; font-size: 0.9rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; box-shadow: var(--shadow-sm); line-height: 2;
}
.jump-nav a { margin-right: 14px; white-space: nowrap; }

/* ---------- venue block heading ---------- */
.venue-block h2 { display: flex; align-items: center; gap: 10px; }

/* ---------- howto ---------- */
.howto-steps { margin: 0; padding-left: 22px; }
.howto-steps li { margin-bottom: 12px; }
.policy-summary ul { margin: 0; padding-left: 22px; }
.policy-summary li { margin-bottom: 8px; }

/* ---------- columns ---------- */
.column-list { list-style: none; padding: 0; margin: 0; }
.column-list li {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.column-list li:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.column-title { font-weight: 700; font-size: 1.05rem; }
.column-desc { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }
.column-article, .static-page {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 28px 30px; box-shadow: var(--shadow-sm);
}
.column-article h2 { margin-top: 1.8em; }
.article-meta { font-size: 0.8rem; color: var(--muted); }
.column-nav { margin-top: 20px; }
.racer-summary {
  background: #f6f9fc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 14px 0; font-size: .92rem;
}

/* ---------- chart ---------- */
.chart-section svg {
  width: 100%; height: auto; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* ---------- disclaimer / my venues ---------- */
.disclaimer-block { background: #f3f6f9; font-size: 0.85rem; color: var(--muted); }
.disclaimer-block h2 { color: var(--muted); }
.my-venues { background: #fffdf6; border-color: #f0e4c2; }

/* ---------- footer ---------- */
.site-footer {
  background: linear-gradient(180deg, #073763, #062c50); color: #cfe2f3;
  padding: 30px 0; font-size: 0.8rem; margin-top: 48px;
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, .12);
}
.site-footer a { color: #cfe2f3; margin-right: 14px; }
.footer-nav { margin: 12px 0; }
.attribution { font-weight: 700; }
.update-notice { color: #ffe08a; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  main { padding: 12px 12px 48px; }
  .howto, .policy-summary, .yesterday, .definition, .my-venues,
  .tracker-section, .disclaimer-block, .verification-detail, .summary-cards,
  .featured, .venues-tomorrow, .chart-section, .daily-table-section, .venue-block {
    padding: 16px 15px;
  }
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.15rem; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.4rem; }
  /* 横に溢れる表はカード内で横スクロール(レイアウトを崩さない) */
  .race-table {
    display: block; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .race-table thead, .race-table tbody, .race-table tr { width: 100%; }
  .reasons { display: none; }
}
