/* =========================================================
   たなお競馬 - style.css
   デザインキャンバス(Main.dc.html / Mobile.dc.html)をもとにした
   実装用スタイルシート。1つのHTML+CSSでレスポンシブに対応する。
   ========================================================= */

:root {
  --navy: oklch(27% 0.055 260);
  --accent: oklch(56% 0.19 25);
  --bg: oklch(98% 0.004 250);
  --text: oklch(24% 0.02 260);
  --text-secondary: oklch(52% 0.02 260);
  --text-faint: oklch(58% 0.02 260);
  --border: oklch(90% 0.006 250);
  --border-soft: oklch(93% 0.004 250);
  --card-bg: #fff;

  --track-1: oklch(58% 0.14 250);
  --track-2: oklch(58% 0.13 150);
  --track-3: oklch(66% 0.15 60);
  --track-4: oklch(55% 0.14 300);
  --track-5: oklch(60% 0.17 5);
  --track-6: oklch(60% 0.11 195);

  --medal-1: oklch(74% 0.13 85);
  --medal-2: oklch(78% 0.008 260);
  --medal-3: oklch(60% 0.09 55);
  --medal-other: oklch(65% 0.01 260);

  --paid-bg: oklch(95% 0.03 350);
  --paid-border: oklch(88% 0.05 350);
  --paid-text: oklch(45% 0.16 350);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--text);
  min-height: 100%;
}

a { color: oklch(50% 0.14 250); text-decoration: none; }
a:hover { color: oklch(40% 0.16 250); }
h1, h2, h3 { font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif; margin: 0; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 32px; }

/* ---------- header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.site-header .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo-group { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; border-radius: 4px; }
.site-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-name { font-size: 22px; font-weight: 900; color: var(--navy); letter-spacing: .02em; line-height: 1.1; }
.x-badge { display: inline-flex; align-items: center; gap: 4px; background: oklch(96% 0.006 250); border: 1px solid oklch(88% 0.008 260); border-radius: 999px; padding: 3px 10px 3px 8px; color: oklch(35% 0.02 260); font-size: 11px; font-weight: 700; }
.x-badge svg { flex-shrink: 0; }
.tagline { font-size: 11px; color: var(--text-secondary); margin-top: 3px; letter-spacing: .02em; }
.tagline-short { display: none; }

.header-actions { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.header-links { display: flex; align-items: center; gap: 22px; }
.header-link { display: flex; flex-direction: column; align-items: center; gap: 4px; color: oklch(38% 0.02 260); font-size: 11px; font-weight: 500; min-width: 52px; }
.icon-btn { color: oklch(38% 0.02 260); display: flex; }
.x-square { width: 34px; height: 34px; border-radius: 8px; background: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hamburger-btn { display: none; color: var(--navy); background: none; border: none; padding: 0; align-items: center; }

/* ---------- main nav ---------- */
.main-nav { background: var(--navy); }
.nav-inner { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-link { color: oklch(94% 0.01 260); font-size: 14px; font-weight: 500; padding: 15px 16px; white-space: nowrap; flex-shrink: 0; }
.nav-link:hover { color: #fff; }
.nav-cta { margin-left: auto; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; padding: 9px 20px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.nav-cta:hover { color: #fff; opacity: .92; }

/* ---------- page body / grid ---------- */
.page-body { padding-top: 24px; padding-bottom: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.main-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sidebar-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- ad banners ---------- */
.ad-banner { position: relative; border-radius: 12px; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ad-banner--light { background: linear-gradient(135deg, oklch(96% 0.02 250), oklch(93% 0.03 250)); border: 1px solid oklch(89% 0.01 250); }
.ad-banner--dark { background: var(--navy); }
.ad-badge { position: absolute; top: 12px; left: 16px; font-size: 10px; border-radius: 4px; padding: 1px 6px; }
.ad-banner--light .ad-badge { color: oklch(58% 0.02 260); border: 1px solid oklch(78% 0.01 260); }
.ad-banner--dark .ad-badge { color: oklch(75% 0.02 260); border: 1px solid oklch(55% 0.02 260); }
.ad-content { display: flex; align-items: center; gap: 16px; margin-top: 6px; min-width: 0; }
.ad-icon { width: 48px; height: 48px; border-radius: 10px; background: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ad-banner--dark .ad-icon { background: rgba(255,255,255,.12); }
.ad-title { font-size: 17px; font-weight: 900; color: var(--navy); }
.ad-banner--dark .ad-title { color: #fff; }
.ad-sub { font-size: 12px; color: oklch(50% 0.02 260); margin-top: 2px; }
.ad-banner--dark .ad-sub { color: oklch(85% 0.01 260); }
.ad-cta { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 8px; padding: 8px 16px; white-space: nowrap; background: transparent; }
.ad-banner--dark .ad-cta { color: var(--navy); background: #fff; border: none; }

/* ---------- section heading ---------- */
.section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-heading h2 { font-size: 19px; font-weight: 900; color: var(--navy); }
.section-note { font-size: 12px; color: var(--text-secondary); margin: -4px 0 14px; }

/* ---------- 本日の開催 ---------- */
.tracks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.track-card { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.track-card-head { color: #fff; text-align: center; font-weight: 900; font-size: 15px; padding: 10px 4px; }
.track-card-body { text-align: center; padding: 10px 4px; }
.track-card-body div { font-size: 12px; color: oklch(45% 0.02 260); }
.track-card-body div + div { margin-top: 2px; }

.link-btn { display: block; text-align: center; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--navy); border: 1px solid oklch(85% 0.008 260); border-radius: 8px; padding: 9px; background: #fff; }

/* ---------- 会場別血統データ ---------- */
.pedigree-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pedigree-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: #fff; border: 1px solid oklch(88% 0.008 260); border-radius: 10px; padding: 16px 6px; text-align: center; color: inherit; }
.pedigree-name { font-size: 14px; font-weight: 900; color: var(--navy); }
.pedigree-link { display: flex; align-items: center; gap: 3px; font-size: 11px; color: oklch(55% 0.02 260); }
.pedigree-link svg { stroke: var(--accent); }

/* ---------- ランキング / 的中実績 ---------- */
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.card h3 { font-size: 16px; font-weight: 900; color: var(--navy); margin-bottom: 2px; }
.card-note { font-size: 11px; color: oklch(55% 0.02 260); margin: 0 0 12px; }

.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.rank-item:last-child { border-bottom: none; }
.rank-badge { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-info { min-width: 0; flex-grow: 1; }
.rank-meta { font-size: 11px; color: oklch(52% 0.02 260); }
.rank-horse { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.horse-mark { flex-shrink: 0; }
.horse-no { font-size: 12px; font-weight: 700; color: oklch(48% 0.02 260); }
.horse-name { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-size: 16px; font-weight: 900; color: var(--accent); flex-shrink: 0; }

.result-item { display: grid; grid-template-columns: 44px 1fr 44px auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.result-item:last-child { border-bottom: none; }
.result-date { font-size: 11px; color: oklch(52% 0.02 260); }
.result-race { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.result-race span { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.hit-badge { font-size: 11px; font-weight: 900; color: #fff; background: var(--accent); border-radius: 6px; text-align: center; padding: 3px 0; }
.result-payout { font-size: 13px; font-weight: 900; color: var(--navy); text-align: right; white-space: nowrap; }

/* ---------- ピックアップレース ---------- */
.pickup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pickup-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pickup-bar { height: 5px; }
.pickup-body { padding: 16px; }
.pickup-track { font-size: 12px; font-weight: 700; color: var(--navy); }
.pickup-time { font-size: 11px; color: oklch(52% 0.02 260); margin-top: 2px; }
.pickup-horse { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pickup-score-row { display: flex; align-items: baseline; gap: 4px; margin-top: 10px; }
.pickup-score-label { font-size: 11px; color: oklch(52% 0.02 260); }
.pickup-score { font-size: 22px; font-weight: 900; color: var(--accent); }
.pickup-cta { display: block; text-align: center; margin-top: 12px; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy); border-radius: 7px; padding: 9px; }
.pickup-cta:hover { color: #fff; opacity: .9; }

/* ---------- sidebar ---------- */
.search-row { display: flex; gap: 8px; }
.search-field { flex-grow: 1; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid oklch(85% 0.008 260); border-radius: 8px; padding: 0 12px; }
.search-field input { border: none; outline: none; font-size: 12px; color: var(--text); padding: 9px 0; width: 100%; background: transparent; font-family: inherit; }
.search-field input::placeholder { color: oklch(60% 0.02 260); }
.search-btn { width: 38px; height: 38px; border-radius: 8px; background: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: none; }

.ad-side { position: relative; background: oklch(96% 0.02 250); border: 1px solid oklch(89% 0.01 250); border-radius: 12px; padding: 18px 16px 16px; text-align: center; }
.ad-side .ad-badge { position: absolute; top: 10px; left: 12px; }
.ad-side-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-top: 8px; }
.ad-side-sub { font-size: 20px; font-weight: 900; color: var(--navy); margin-top: 4px; }
.ad-side-cta { display: block; margin-top: 14px; font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 8px; padding: 10px; }
.ad-side-cta:hover { color: #fff; opacity: .9; }
.ad-side--plain { text-align: center; background: oklch(96% 0.006 250); }
.ad-side--plain .ad-side-title { font-size: 13px; }

.articles-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.articles-card h3 { font-size: 14px; font-weight: 900; color: var(--navy); margin-bottom: 10px; }
.article-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); color: inherit; }
.article-row:last-child { border-bottom: none; }
.article-badge { width: 20px; height: 20px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.article-thumb { width: 46px; height: 36px; border-radius: 6px; flex-shrink: 0; }
.article-title { font-size: 12px; font-weight: 700; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.paid-card { background: var(--paid-bg); border: 1px solid var(--paid-border); border-radius: 12px; padding: 18px 16px; }
.paid-card-title { font-size: 14px; font-weight: 900; color: var(--paid-text); }
.paid-card-sub { font-size: 12px; font-weight: 700; color: oklch(30% 0.02 260); margin-top: 2px; }
.paid-features { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.paid-feature { display: flex; align-items: center; gap: 6px; }
.paid-feature svg { stroke: var(--paid-text); flex-shrink: 0; }
.paid-feature span { font-size: 12px; color: oklch(30% 0.02 260); }
.paid-cta { display: block; text-align: center; margin-top: 14px; font-size: 13px; font-weight: 700; color: #fff; background: var(--paid-text); border-radius: 8px; padding: 10px; }
.paid-cta:hover { color: #fff; opacity: .9; }

/* ---------- footer ---------- */
.site-footer { margin-top: 16px; background: #fff; border-top: 1px solid var(--border); }
.footer-grid { padding: 36px 32px; display: grid; grid-template-columns: 1.5fr 1fr 1.3fr; gap: 32px; }
.footer-brand-name { font-size: 15px; font-weight: 900; color: var(--navy); }
.footer-desc { font-size: 12px; color: oklch(50% 0.02 260); line-height: 1.8; margin: 10px 0 0; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { width: 30px; height: 30px; border-radius: 50%; background: oklch(94% 0.006 250); display: flex; align-items: center; justify-content: center; }
.footer-col-title { font-size: 12px; font-weight: 900; color: oklch(35% 0.02 260); margin-bottom: 10px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 12px; color: oklch(45% 0.02 260); }
.footer-owner { font-size: 12px; color: oklch(45% 0.02 260); line-height: 2; }
.footer-disclaimer { font-size: 11px; color: oklch(58% 0.02 260); line-height: 1.7; margin-top: 10px; }
.footer-bottom { background: var(--navy); text-align: center; padding: 14px; font-size: 11px; color: oklch(75% 0.02 260); }

/* =========================================================
   モバイル (max-width: 860px)
   ========================================================= */
@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .site-header .wrap { padding-top: 14px; padding-bottom: 14px; }

  .logo-img { width: 38px; height: 38px; }
  .site-name { font-size: 17px; }
  .tagline { font-size: 10px; }
  .tagline-full { display: none; }
  .tagline-short { display: inline; }
  .site-name-row { gap: 6px; }

  .header-links { display: none; }
  .header-links.is-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    position: absolute; top: 100%; right: 16px; margin-top: 6px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 16px; box-shadow: 0 8px 24px rgba(20, 25, 45, .12); z-index: 20;
  }
  .header-links.is-open .header-link { flex-direction: row; min-width: 0; gap: 8px; }
  .x-square { display: none; }
  .hamburger-btn { display: flex; }
  .header-actions { position: relative; }

  .nav-link { background: rgba(255,255,255,.08); border-radius: 999px; padding: 7px 14px; margin: 12px 0; }
  .nav-inner { padding: 12px 16px; gap: 8px; }
  .nav-cta { border-radius: 999px; padding: 7px 16px; margin: 12px 0 12px auto; }
  .main-nav .wrap { padding: 0; }

  .page-body { grid-template-columns: 1fr; padding: 18px 16px 0; gap: 22px; }
  .main-col, .sidebar-col { gap: 18px; }

  .ad-banner { padding: 16px; flex-direction: column; align-items: stretch; }
  .ad-cta { width: 100%; text-align: center; margin-top: 4px; }
  .ad-title { font-size: 14px; }

  .tracks-grid { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 4px; scrollbar-width: none; }
  .tracks-grid::-webkit-scrollbar { display: none; }
  .track-card { flex-shrink: 0; width: 118px; }

  .pedigree-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .pedigree-card { padding: 12px 4px; }

  .stats-row { grid-template-columns: 1fr; }

  .pickup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pickup-body { padding: 12px; }
  .pickup-score { font-size: 19px; }

  .footer-grid { grid-template-columns: 1fr; padding: 28px 16px; gap: 24px; }
}
