/* ばん脳 — 共通スタイル v2.2「雪原の専門紙 × netkeiba実画面準拠」
   配色: 白ヘッダー+青ロゴ × ロイヤルブルーナビ帯 × 赤CTA × 青リンク（design-banno-v2.md §1-fix）
   - 白ヘッダー（青ロゴ）+ 直下に青ベタ#2745C9ナビ帯（白字タブ）
   - CTA・的中バッジ・自信度S = 赤 / リンク = 青下線 / フッター = 濃紺#1E2F7A
   - フォント: システムゴシック（明朝・Webフォント全廃 → 表示高速化）
   - 雪原ばん馬SVGヒーロー（橙太陽含む）は唯一のブランド要素として維持
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* v3 公式ばんえい十勝準拠（深緑×ゴールド×雪色） */
  --brand:      #44651F;  /* 十勝の森 深緑（ナビ帯・主役） */
  --brand-navy: #3A5519;  /* ロゴ・見出しの濃緑 */
  --brand-pale: #EEF4DD;  /* 淡緑（チップ・カレンダー） */
  --bg:         #FFFFFF;
  --bg-sub:     #F1F3EA;  /* 暖かい雪色 */
  --surface:    #FFFFFF;
  --line:       #E2E6D8;
  --text:       #2B2A24;  /* 暖かい墨 */
  --text-sub:   #7A7A6E;
  --link:       #44651F;  /* 緑リンク */
  --cta:        #EFD42A;  /* ゴールドCTA（公式 開門バッジの金） */
  --cta-d:      #E0C520;
  --cta-ink:    #473D00;  /* ゴールド上の濃文字 */
  --gold:       #B8901A;  /* 白地に乗る金（テキスト用） */
  --mark-honmei:#C0392B;  /* ◎ 赤（伝統） */
  --table-head: #EEF4DD;  /* 表ヘッダの淡緑 */
  --accent:     #44651F;
  --accent-bg:  #EEF4DD;
  --footer:     #3A5519;  /* 濃緑フッター */
  /* 補助 */
  --surface2:   #F1F3EA;
  --green:      #44651F;
  --green-bg:   #EEF4DD;
  --red:        #C0392B;
  --red-bg:     #FDECEA;
  /* 旧名エイリアス（サブページ互換） */
  --border:     var(--line);
  --muted:      var(--text-sub);
  --orange:     var(--cta);
  --orange-d:   var(--cta-d);
  --orange-bg:  #FDF0F1;
  --orange-lt:  #FDF0F1;
  --blue:       var(--link);
  --blue-bg:    #EFF4FE;
  --snow:       #FFFFFF;
  --amber:      var(--gold);
}

html { scroll-behavior: smooth; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Meiryo", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* 見出しは太ゴシック（明朝全廃） */
h1, h2, .section-head {
  font-weight: 900;
  letter-spacing: .01em;
}

/* ── お試しバナー（最上部・控えめグレー帯） ── */
.beta-banner {
  background: var(--bg-sub);
  color: var(--text-sub);
  text-align: center;
  height: 30px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
}
.beta-banner.hidden { display: none; }

/* ── 白ヘッダー（青ロゴ）netkeiba式 ── */
.site-head {
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 54px;
  border-bottom: 1px solid var(--line);
}
.site-logo {
  font-size: 22px; font-weight: 900; color: var(--brand-navy);
  text-decoration: none; letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px;
}
.site-head-right { display: flex; align-items: center; gap: 12px; }
.site-head-label { font-size: 12px; color: var(--text-sub); }

/* ── 青ベタナビ帯（白字タブ） ── */
.nav-band {
  position: sticky; top: 0; z-index: 100;
  background: var(--brand);
  display: flex; align-items: stretch;
  padding: 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-band::-webkit-scrollbar { display: none; }
.nav-band a {
  color: #FFFFFF; text-decoration: none;
  font-size: 13.5px; font-weight: 700;
  padding: 10px 16px; white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background .15s;
}
.nav-band a:hover { background: rgba(255,255,255,.12); }
.nav-band a.active { border-bottom-color: #FFFFFF; }

/* ── CTAボタン（赤） ── */
.nav-cta {
  background: var(--cta); color: var(--cta-ink);
  border: none; border-radius: 6px;
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background .15s; white-space: nowrap;
}
.nav-cta:hover { background: var(--cta-d); }

/* ── セクション共通 ── */
section { padding: 52px 24px; }
.inner { max-width: 880px; margin: 0 auto; }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: var(--brand); text-transform: uppercase; margin-bottom: 10px;
}
.section-head {
  font-size: clamp(20px, 4vw, 27px);
  line-height: 1.4; color: var(--text); margin-bottom: 18px;
}

/* ── 本文リンク（青+下線） ── */
a.text-link { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a.text-link:hover { color: var(--brand-navy); }

/* ── ボタン ── */
.btn-primary {
  display: inline-block;
  background: var(--cta); color: var(--cta-ink);
  font-weight: 800; font-size: 15px;
  padding: 13px 30px; border-radius: 8px;
  border: none; cursor: pointer;
  text-decoration: none;
  min-height: 48px; line-height: 1.5;
  transition: background .15s;
}
.btn-primary:hover { background: var(--cta-d); }
.btn-secondary {
  display: inline-block;
  background: transparent; color: var(--brand);
  font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: 8px;
  border: 1.5px solid var(--brand); cursor: pointer;
  text-decoration: none;
  min-height: 48px; line-height: 1.5;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--brand-pale); }
.btn-ghost {
  display: inline-block;
  background: transparent; color: var(--text);
  font-weight: 700; font-size: 13px;
  padding: 10px 20px; border-radius: 8px;
  border: 1px solid var(--line); cursor: pointer;
  text-decoration: none; transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--brand); }

/* ── カード共通 ── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 20px;
  box-shadow: 0 1px 3px rgba(34,34,34,.05);
}


/* ── 自信度バッジ（S=赤塗り/A=青塗り/B=青アウトライン/C=グレー） ── */
.grade-badge {
  display: inline-block; font-size: 11px; font-weight: 800;
  padding: 1px 9px; border-radius: 4px; letter-spacing: .05em;
  line-height: 1.7;
}
.grade-S { background: var(--cta); color: var(--cta-ink); border: 1px solid var(--cta); }
.grade-A { background: #44651F; color: #fff; border: 1px solid #44651F; }
.grade-B { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.grade-C { background: var(--bg-sub); color: var(--text-sub); border: 1px solid var(--line); }

/* ── 印（専門紙: ◎=赤太） ── */
.mark { font-weight: 900; font-size: 16px; }
.mark-honmei { color: var(--mark-honmei); }
.mark-taikou { color: var(--text); }
.mark-tanana { color: var(--text-sub); }
.mark-renka  { color: var(--text-sub); }

/* ── 的中バッジ（赤） ── */
.hit-badge {
  display: inline-block;
  background: var(--cta); color: var(--cta-ink);
  font-size: 10px; font-weight: 800;
  padding: 1px 8px; border-radius: 4px; letter-spacing: .05em;
  white-space: nowrap;
}
.miss-badge {
  display: inline-block;
  background: var(--bg-sub); color: var(--text-sub);
  font-size: 10px; font-weight: 700;
  padding: 1px 8px; border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* ── 専門紙風レーステーブル（白地+#DDD細罫+薄グレー青ヘッダ・高密度） ── */
.paper-table-wrap { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.paper-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.paper-table thead th {
  background: var(--table-head); color: var(--text);
  padding: 6px 9px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
}
.paper-table tbody td {
  padding: 7px 9px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.paper-table tbody tr:last-child td { border-bottom: none; }
.paper-table tbody tr:nth-child(even) td { background: var(--bg-sub); }
.paper-table .cell-r { width: 56px; }
.paper-table .cell-honmei { color: var(--mark-honmei); font-weight: 800; }

/* ── テーブル共通（既存ページ用） ── */
.table-wrap { overflow-x: auto; border-radius: 6px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--table-head); color: var(--text);
  padding: 7px 10px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 7px 10px; border-bottom: 1px solid var(--line);
  color: var(--text); background: var(--surface);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-sub); }

/* ── 確率バー（青） ── */
.proba-bar-wrap { display: flex; align-items: center; gap: 8px; }
.proba-bar {
  flex: 1; height: 6px; background: #E8EAEF; border-radius: 3px; overflow: hidden;
}
.proba-bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.proba-val { font-size: 12px; font-weight: 700; color: var(--text); width: 40px; text-align: right; }

/* ── big number（実績） ── */
.big-num { font-size: clamp(40px, 6vw, 52px); font-weight: 900; line-height: 1.1; color: var(--text); letter-spacing: -0.01em; }
.big-num-unit { font-size: 18px; font-weight: 700; color: var(--text-sub); }

/* ── 日別的中バー（青・CSSのみ） ── */
.day-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 4px 0; }
.day-bar-date { width: 52px; color: var(--text-sub); flex-shrink: 0; }
.day-bar-track { flex: 1; height: 10px; background: #E8EAEF; border-radius: 5px; overflow: hidden; }
.day-bar-fill { height: 100%; background: var(--brand); border-radius: 5px; }
.day-bar-label { width: 64px; text-align: right; color: var(--text); font-weight: 700; flex-shrink: 0; }

/* ── 比較表（無料/プレミアム） ── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }
.compare-table th, .compare-table td { padding: 10px 14px; border: 1px solid var(--line); text-align: center; }
.compare-table th { background: var(--table-head); font-size: 12px; font-weight: 700; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; font-weight: 500; }
.compare-table .col-premium { background: #FBF8EE; }
.compare-table th.col-premium { color: var(--gold); }
.compare-table .yes { color: var(--text); font-weight: 900; }
.compare-table .no { color: #C9C9C9; font-weight: 700; }

/* ── ミニカレンダー ── */
.mini-cal { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-cal .cal-day {
  width: 44px; padding: 6px 0 4px;
  text-align: center; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); font-size: 11px; color: var(--text-sub);
  line-height: 1.4;
}
.mini-cal .cal-day .d { font-size: 14px; font-weight: 800; color: var(--text); display: block; }
.mini-cal .cal-day .dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin: 3px auto 0; }
.mini-cal .cal-day .dot.off { background: transparent; }
.mini-cal .cal-day.today { border-color: var(--text); border-width: 1.5px; }
.mini-cal .cal-day.raceday { background: var(--brand-pale); }

/* ── 状態バッジ ── */
.badge-beta {
  display: inline-block;
  background: var(--bg-sub); border: 1px solid var(--line);
  color: var(--text-sub); font-size: 10px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; letter-spacing: .05em;
}
.badge-coming {
  display: inline-block;
  background: var(--bg-sub); border: 1px solid var(--line);
  color: var(--text-sub); font-size: 10px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; letter-spacing: .05em;
}
.badge-green {
  display: inline-block;
  background: var(--green-bg); border: 1px solid #A7F3D0;
  color: var(--green); font-size: 10px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
}

/* ── フッター（濃紺帯・白字） ── */
footer {
  background: var(--footer);
  color: rgba(255,255,255,.78);
  text-align: center; padding: 40px 24px 32px;
  font-size: 12px;
}
footer a { color: rgba(255,255,255,.88); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: #fff; }
.footer-links { display: flex; gap: 18px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.footer-disclaimer {
  max-width: 680px; margin: 14px auto 0;
  font-size: 11px; line-height: 1.8; color: rgba(255,255,255,.6);
}

/* ── Loading overlay ── */
#loading {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,.75);
  align-items: center; justify-content: center;
}
#loading.show { display: flex; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--line);
  border-top-color: var(--cta);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── エラー表示 ── */
.error-box {
  background: var(--red-bg); border: 1px solid #F5B7B1;
  border-radius: 8px; padding: 20px; text-align: center;
  color: var(--red); margin: 20px 0;
}

/* ── モバイル下部固定CTA ── */
.mobile-cta-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
}
.mobile-cta-bar.mobile-cta-bar-split {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 8px;
}
.mobile-cta-bar a {
  display: flex; align-items: center; justify-content: center;
  background: var(--cta); color: var(--cta-ink); text-decoration: none;
  font-weight: 800; font-size: 14px;
  height: 48px; border-radius: 8px;
}
.mobile-cta-bar .mobile-cta-secondary {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line);
}
.mobile-cta-bar a:focus-visible {
  outline: 3px solid rgba(239, 212, 42, .55);
  outline-offset: 2px;
}

/* ── レスポンシブ（390px最優先・夜・片手） ── */
@media (max-width: 640px) {
  section { padding: 36px 16px; }
  .inner { padding: 0 2px; }
  .mobile-cta-bar { display: block; }
  .mobile-cta-bar.mobile-cta-bar-split { display: grid; }
  body.has-mobile-cta { padding-bottom: 72px; }
  .site-head { height: 48px; padding: 0 14px; }
  .site-logo { font-size: 19px; height: 48px; display: flex; align-items: center; }

  /* お試しバナー: モバイルは折り返して全文表示 */
  .beta-banner {
    height: auto; min-height: 30px;
    padding: 5px 12px;
    white-space: normal; font-size: 11px; line-height: 1.5;
  }

  /* 専門紙テーブル → カード型（横スクロールさせない） */
  .paper-table thead { display: none; }
  .paper-table, .paper-table tbody, .paper-table tr, .paper-table td { display: block; width: 100%; }
  .paper-table tbody tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 2px 10px;
    align-items: center;
  }
  .paper-table tbody tr:last-child { border-bottom: none; }
  .paper-table tbody td { border: none; padding: 1px 0; background: transparent !important; }
  .paper-table td.cell-r { grid-row: 1 / span 2; }
  .paper-table td.cell-time { grid-column: 2; font-size: 11px; color: var(--text-sub); }
  .paper-table td.cell-grade { grid-column: 3; grid-row: 1; text-align: right; }
  .paper-table td.cell-honmei { grid-column: 2 / span 2; font-size: 15px; }
  .paper-table td.cell-sub { grid-column: 2 / span 2; font-size: 12.5px; color: var(--text-sub); }
  .paper-table td.cell-result { grid-column: 2 / span 2; font-size: 12px; }
}
