/* =========================================================
   AI競馬予想 ーウマ＋(プラス)ー  共通スタイル
   ---------------------------------------------------------
   配色: クリーム紙 × ターフグリーン × 墨色 × 差し色の朱
   （手描き水彩の馬イラストに合わせたレトロ紙面風）
   WP化メモ: このファイルはそのまま style.css として
   テーマに移植できるよう、WP依存のクラスは使っていない。
   ========================================================= */

:root {
  --paper: #f7f1e3;
  --paper-dark: #efe6d2;
  --ink: #3a2f26;
  --ink-soft: #6b5d4f;
  --turf: #2e6e4e;
  --turf-dark: #1f4f37;
  --accent: #b5452f;      /* 本命印・強調の朱色 */
  --gold: #b8923e;        /* 会員・プレミアム */
  --line: #d8cbb2;
  --white: #fffdf8;
  --shadow: 0 2px 10px rgba(58, 47, 38, .12);
  --radius: 10px;
}

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

html { scroll-padding-top: 92px; }  /* 固定ヘッダーぶん、アンカー移動先を下げる */

body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--paper);
  background-image: repeating-linear-gradient(
    0deg, transparent 0 31px, rgba(58, 47, 38, .035) 31px 32px);
  color: var(--ink);
  line-height: 1.7;
}

h1, h2, h3, .serif {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: .04em;
}

a { color: var(--turf); }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* =================== ヘッダー（WP化: header.php） =================== */
.site-header {
  background: var(--turf-dark);
  color: var(--white);
  border-bottom: 4px double var(--gold);
  position: sticky;      /* スクロールしても最上部に固定 */
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(31, 79, 55, .25);
}
/* ログイン中はWP管理バー(高さ32px/モバイル46px)の下に固定する */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); }
.brand-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background-color: var(--paper); border: 2px solid var(--gold);
  overflow: hidden; flex-shrink: 0;
}
.brand-text small {
  display: block; font-size: .68rem; letter-spacing: .3em;
  color: #cfe3d6; margin-bottom: 2px;
}
.brand-text strong { font-size: 1.35rem; font-family: "Yu Mincho", serif; }
.brand-text strong .plus { color: var(--gold); }

.global-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.global-nav a {
  color: var(--white); text-decoration: none; font-size: .9rem;
  padding: 8px 14px; border-radius: 6px; transition: background .2s;
}
.global-nav a:hover, .global-nav a.current { background: rgba(255, 255, 255, .16); }
.global-nav a.nav-member { border: 1px solid var(--gold); color: #f0dfae; }

/* 更新時刻バー */
.update-bar {
  background: var(--accent); color: var(--white);
  font-size: .82rem; text-align: center; padding: 5px 10px;
}
.update-bar .badge-sample {
  display: inline-block; margin-left: 10px; padding: 0 8px;
  background: var(--white); color: var(--accent);
  border-radius: 999px; font-weight: bold; font-size: .75rem;
}

/* =================== トプ画（ページ最上部のバナー img/uma-top2.png） ===================
   原寸(1210px)より拡大しない。左右は画像と同系の生成り色でつなぐ。 */
.top-visual {
  background: #f7f4ed;
  border-bottom: 1px solid var(--line);
}
.top-visual img {
  display: block; margin: 0 auto;
  width: 100%; max-width: 1210px; height: auto;
}

/* =================== キャッチコピー帯 =================== */
.hero {
  background: linear-gradient(160deg, var(--paper-dark), var(--paper));
  border-bottom: 1px solid var(--line);
  padding: 20px 0 18px;
}
.hero-lead {
  text-align: center;
  color: var(--ink-soft); font-size: .95rem;
}
.hero-lead .plus { color: var(--accent); font-weight: bold; }

/* スクリーンリーダー用（見た目は非表示） */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* アンカー移動を滑らかに＆止まる位置を調整 */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 12px; }

/* =================== 馬イラスト切り出し（CSSスプライト） ===================
   img/uma-imag.png（3列×2行の一枚絵、512px角×6カット）を
   background-position で切り出す。
   画像が無い間は、🐴プレースホルダを表示する。 */
.horse {
  display: block;   /* span で使っても幅高さが効くように */
  background-repeat: no-repeat;
  background-size: 300% 200%;
  border-radius: var(--radius);
}
html.has-horseimg .horse { background-image: url("../img/uma-imag.png"); }
html.has-horseimg .horse::after { content: none; }
.horse { position: relative; }
.horse::after {
  content: "🐴 img/uma-imag.png を置いてね";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: var(--ink-soft);
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--paper-dark);
}
/* 6カットの位置（左上から右へ 1,2,3 ／ 下段 4,5,6） */
.horse--stand  { background-position: 0% 0%; }     /* 鹿毛・正面立ち   */
.horse--white  { background-position: 50% 0%; }    /* 白馬・横向き     */
.horse--face   { background-position: 100% 0%; }   /* 顔アップ         */
.horse--dapple { background-position: 0% 100%; }   /* ぶち馬           */
.horse--run    { background-position: 50% 100%; }  /* 走る馬           */
.horse--graze  { background-position: 100% 100%; } /* 草を食む馬       */

.brand-logo .horse { width: 100%; height: 100%; border-radius: 50%; background-size: 320% 220%; }
.brand-logo .horse::after { content: "🐴"; font-size: 1.4rem; border: none; }

/* 会員案内ボックスの白馬メダリオン */
.member-horse {
  width: 96px; height: 96px; margin: 0 auto 14px;
  border-radius: 50%; border: 2px solid var(--gold);
  background-color: var(--paper); overflow: hidden;
}
.member-horse .horse { width: 100%; height: 100%; border-radius: 50%; }
.member-horse .horse::after { content: "🐴"; font-size: 1.6rem; border: none; }

/* =================== セクション共通 =================== */
.section { padding: 36px 0; }
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; color: var(--turf-dark); margin-bottom: 18px;
}
.section-title::before {
  content: ""; width: 10px; height: 28px;
  background: var(--turf); border-radius: 3px;
}
.section-title .en {
  font-size: .7rem; color: var(--gold); letter-spacing: .25em; font-family: sans-serif;
}
.section-lead { color: var(--ink-soft); font-size: .9rem; margin: -8px 0 16px; }

/* =================== 開催場カード =================== */
.venue-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.venue-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.venue-card h3 {
  color: var(--turf-dark); font-size: 1.1rem;
  border-bottom: 1px dashed var(--line); padding-bottom: 6px; margin-bottom: 8px;
}
.venue-card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: .88rem; }
.venue-card dt { color: var(--ink-soft); }

/* =================== レース一覧テーブル =================== */
.race-table-block { margin-bottom: 22px; }
.race-table-block h3 { color: var(--turf-dark); margin-bottom: 8px; font-size: 1.05rem; }
table.race-table {
  width: 100%; border-collapse: collapse; background: var(--white);
  box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden;
  font-size: .9rem;
}
.race-table th {
  background: var(--turf); color: var(--white);
  padding: 8px 10px; text-align: left; font-weight: normal; font-size: .82rem;
}
.race-table td { padding: 9px 10px; border-bottom: 1px solid var(--paper-dark); }
.race-table tr:last-child td { border-bottom: none; }
.race-table .r-no { font-weight: bold; color: var(--turf-dark); white-space: nowrap; }
.grade-badge {
  display: inline-block; margin-left: 6px; padding: 0 8px;
  border-radius: 999px; font-size: .72rem; font-weight: bold; color: var(--white);
}
.grade-badge.g3 { background: var(--accent); }
.grade-badge.op { background: var(--gold); }
.btn-yosou {
  display: inline-block; background: var(--accent); color: var(--white);
  text-decoration: none; font-size: .82rem; padding: 4px 14px;
  border-radius: 999px; white-space: nowrap;
}
.btn-yosou:hover { opacity: .85; }
.locked {
  color: var(--ink-soft); font-size: .82rem; white-space: nowrap;
}
.locked::before { content: "🔒 "; }

/* =================== 注目レースダイジェスト =================== */
.digest-card {
  background: var(--white); border: 2px solid var(--turf);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.digest-horse { flex: 0 0 180px; }
.digest-horse .horse { width: 180px; height: 180px; }
.digest-body { flex: 1 1 300px; }
.digest-body h3 { color: var(--turf-dark); font-size: 1.2rem; margin-bottom: 6px; }
.digest-honmei { font-size: 1.05rem; margin: 6px 0; }
.digest-honmei .mark { color: var(--accent); font-weight: bold; font-size: 1.3rem; }
.digest-buy {
  background: var(--paper-dark); border-radius: 8px; padding: 10px 14px;
  font-size: .9rem; margin-top: 8px;
}

/* =================== 会員案内 =================== */
.member-box {
  background: linear-gradient(135deg, #23483a, var(--turf-dark));
  color: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gold); padding: 28px; text-align: center;
}
.member-box h2 { color: #f0dfae; font-size: 1.4rem; margin-bottom: 10px; }
.member-box .price { font-size: 2rem; font-family: "Yu Mincho", serif; color: var(--white); }
.member-box .price small { font-size: .9rem; }
.member-features {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  list-style: none; margin: 16px 0;
}
.member-features li {
  background: rgba(255, 255, 255, .12); border-radius: 999px;
  padding: 6px 16px; font-size: .85rem;
}
.btn-member {
  display: inline-block; background: var(--gold); color: var(--turf-dark);
  font-weight: bold; text-decoration: none; padding: 10px 34px;
  border-radius: 999px; margin-top: 6px;
}
.member-note { font-size: .75rem; color: #cfe3d6; margin-top: 10px; }

/* =================== レース詳細ページ =================== */
.race-head {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 24px;
}
.race-head h1 { font-size: 1.5rem; color: var(--turf-dark); }
.race-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-soft); font-size: .88rem; margin-top: 6px; }
.weather-note {
  margin-top: 10px; padding: 8px 14px; background: var(--paper-dark);
  border-left: 4px solid var(--turf); border-radius: 4px; font-size: .88rem;
}

/* 出走表 */
table.entry-table {
  width: 100%; border-collapse: collapse; background: var(--white);
  box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden;
  font-size: .88rem;
}
.entry-table th {
  background: var(--turf); color: var(--white); padding: 8px 6px;
  font-weight: normal; font-size: .8rem;
}
.entry-table td { padding: 8px 6px; border-bottom: 1px solid var(--paper-dark); text-align: center; }
.entry-table td.t-left { text-align: left; }
.entry-table tr:last-child td { border-bottom: none; }
.entry-table .mark { font-size: 1.15rem; font-weight: bold; }
.mark-1 { color: var(--accent); }          /* ◎ */
.mark-2 { color: var(--turf); }            /* ○ */
.mark-3 { color: #2f5d8a; }                /* ▲ */
.mark-4, .mark-5 { color: var(--ink-soft); } /* △☆ */
.horse-name { font-weight: bold; }
.ai-bar-cell { min-width: 120px; }
.ai-bar { background: var(--paper-dark); border-radius: 999px; height: 14px; overflow: hidden; }
.ai-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--turf), #6aa984);
}
.ai-score-num { font-size: .78rem; color: var(--ink-soft); }

/* AI総評 */
.ai-comment {
  background: var(--white); border: 2px solid var(--turf);
  border-radius: var(--radius); padding: 18px 20px; margin: 20px 0;
  display: flex; gap: 16px; align-items: flex-start;
}
.ai-comment .horse { flex: 0 0 90px; height: 90px; }
.ai-comment h3 { color: var(--turf-dark); font-size: 1rem; margin-bottom: 6px; }
.ai-comment p { font-size: .92rem; }

/* 買い目カード */
.buy-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.buy-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  border-top: 4px solid var(--gold);
}
.buy-card h4 { color: var(--turf-dark); display: flex; justify-content: space-between; align-items: center; }
.buy-card .stars { color: var(--gold); letter-spacing: 2px; }
.buy-card .target { font-size: 1.15rem; font-weight: bold; margin: 8px 0 4px; color: var(--accent); }
.buy-card .points { font-size: .8rem; color: var(--ink-soft); }
.buy-card p { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }

/* =================== 投票（AI vs みんな） =================== */
.vote-panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.vote-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.vote-form select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px;
  font-size: .95rem; background: var(--white); color: var(--ink);
}
.btn-vote {
  background: var(--turf); color: var(--white); border: none;
  padding: 9px 26px; border-radius: 999px; font-size: .95rem; cursor: pointer;
}
.btn-vote:hover { background: var(--turf-dark); }
.vote-status { font-size: .85rem; color: var(--accent); }

.vote-row { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; align-items: center; margin-bottom: 10px; font-size: .85rem; }
.vote-row .vname { text-align: right; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-bars { display: grid; gap: 3px; }
.vbar { display: flex; align-items: center; gap: 6px; }
.vbar .track {
  flex: 1; min-width: 0; height: 12px;
  background: var(--paper-dark); border-radius: 999px; overflow: hidden;
}
.vbar .bar { display: block; height: 100%; border-radius: 999px; min-width: 2px; transition: width .4s; }
.vbar.ai .bar { background: var(--turf); }
.vbar.crowd .bar { background: var(--accent); }
.vbar .pct { flex: none; width: 92px; font-size: .74rem; color: var(--ink-soft); white-space: nowrap; }
.vote-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--ink-soft); margin-bottom: 12px; }
.vote-legend .chip { display: inline-block; width: 22px; height: 10px; border-radius: 999px; margin-right: 4px; vertical-align: middle; }
.vote-legend .chip.ai { background: var(--turf); }
.vote-legend .chip.crowd { background: var(--accent); }

/* =================== 掲示板・コメント =================== */
.board-form {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 20px;
}
.board-form label { display: block; font-size: .82rem; color: var(--ink-soft); margin-bottom: 2px; }
.board-form input[type="text"], .board-form textarea {
  width: 100%; padding: 9px 12px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: .95rem; font-family: inherit; background: var(--white); color: var(--ink);
}
.board-form textarea { min-height: 90px; resize: vertical; }
.board-notice { font-size: .76rem; color: var(--ink-soft); margin-top: 8px; }

.post {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.post-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.post-name { font-weight: bold; color: var(--turf-dark); }
.post-time { font-size: .76rem; color: var(--ink-soft); }
.post-mine { font-size: .7rem; background: var(--paper-dark); border-radius: 999px; padding: 1px 8px; color: var(--ink-soft); }
.post-text { font-size: .92rem; white-space: pre-wrap; }
.post-del {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: .76rem; margin-left: auto;
}
.post-empty { color: var(--ink-soft); font-size: .9rem; }

/* =================== フッター（WP化: footer.php） =================== */
.site-footer {
  background: var(--turf-dark); color: #cfe3d6;
  margin-top: 40px; padding: 30px 0 20px; font-size: .8rem;
  border-top: 4px double var(--gold);
}
.site-footer .wrap { display: grid; gap: 16px; }
.footer-grid {
  display: flex; gap: 24px; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-start;
}
.footer-brand { flex: 1 1 220px; }
.footer-brand strong {
  display: block; font-family: "Yu Mincho", serif;
  font-size: 1.15rem; color: var(--white); margin-bottom: 4px;
}
.footer-brand .plus { color: var(--gold); }
.footer-nav {
  flex: 1 1 320px;
  display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 6px 18px;
}
.footer-nav a {
  color: #cfe3d6; text-decoration: none; padding: 3px 0;
  border-bottom: 1px dashed transparent; width: fit-content;
}
.footer-nav a::before { content: "▸ "; color: var(--gold); }
.footer-nav a:hover { color: var(--white); border-bottom-color: var(--gold); }
.footer-disclaimer {
  line-height: 1.9; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 14px;
}
.footer-copy { color: #9dbfab; text-align: center; }

/* =================== 汎用 =================== */
.back-link { display: inline-block; margin-bottom: 16px; font-size: .88rem; }
.note-sample {
  background: #fdf3e3; border: 1px solid var(--gold); color: #7a5c1e;
  border-radius: 8px; padding: 10px 16px; font-size: .82rem; margin-bottom: 20px;
}

/* 横スクロールできる表ラッパー（スマホで表が潰れないように） */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.table-scroll > table { min-width: 560px; }
.scroll-hint { display: none; }

/* =================== レスポンシブ =================== */
@media (max-width: 820px) {
  .site-header .wrap { justify-content: center; text-align: center; }
  .global-nav { justify-content: center; }
  .footer-grid { flex-direction: column; gap: 14px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .section { padding: 26px 0; }
  .section-title { font-size: 1.15rem; }
  .hero { padding: 18px 0 16px; }
  .hero-lead { font-size: .88rem; text-align: left; }
  .global-nav a { font-size: .82rem; padding: 7px 10px; }
  .update-bar { font-size: .74rem; }
  .update-bar .badge-sample { display: block; width: fit-content; margin: 3px auto 0; }

  .vote-row { grid-template-columns: 84px 1fr; }
  .vbar .pct { width: 78px; font-size: .68rem; }
  .entry-table .note-col { display: none; }
  .scroll-hint {
    display: block; font-size: .72rem; color: var(--ink-soft);
    margin: 4px 2px 0; text-align: right;
  }

  .digest-card { padding: 14px; gap: 12px; }
  .digest-horse { flex: 0 0 104px; }
  .digest-horse .horse { width: 104px; height: 104px; }

  .ai-comment { flex-direction: column; align-items: center; }
  .ai-comment .horse { flex: none; width: 120px; height: 120px; }

  .member-box { padding: 20px 14px; }
  .member-box .price { font-size: 1.6rem; }

  .race-head { padding: 14px; }
  .race-head h1 { font-size: 1.2rem; }

  .footer-nav { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   ▼ 追加コンポーネント（会員/的中/みんなの予想）
   ========================================================= */

/* ---- 会員モード切替バー ---- */
.member-bar {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px; padding: 7px 12px; font-size: .82rem;
  border-bottom: 1px solid var(--line);
}
.member-bar.as-guest { background: #fbf6ea; color: var(--ink-soft); }
.member-bar.as-member { background: #f3ead2; color: #6d571f; }
.member-bar .member-state { font-weight: bold; }
.member-bar .member-toggle {
  background: var(--gold); color: #fff; border: none;
  padding: 5px 16px; border-radius: 999px; font-size: .82rem; cursor: pointer;
}
.member-bar.as-member .member-toggle { background: var(--ink-soft); }
.member-bar .member-hint { color: var(--ink-soft); }

/* ---- 会員/無料の出し分け ---- */
.member-only { display: none; }
.guest-only { display: none; }
body.is-member .member-only { display: block; }
body.is-guest .guest-only { display: block; }

/* ---- ヒーローのタグ ---- */
.hero-catch {
  text-align: center; font-family: "Yu Mincho", serif;
  font-size: 1.15rem; color: var(--turf-dark); margin-bottom: 8px;
}
.free-tag, .member-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .78rem; font-weight: bold; margin: 0 2px;
}
.free-tag { background: var(--turf); color: #fff; }
.member-tag { background: var(--gold); color: #fff; }

/* ---- 的中実績サマリー ---- */
.stats-band {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  background: var(--turf-dark); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 16px; margin-bottom: 18px;
  position: relative;
}
.stats-band .stat { text-align: center; color: #eafff3; }
.stats-band .stat-num {
  display: block; font-family: "Yu Mincho", serif; font-size: 1.6rem;
  font-weight: bold; color: #fff; line-height: 1.1;
}
.stats-band .stat-num small { font-size: .8rem; color: #cfe3d6; }
.stats-band .stat.best .stat-num { color: var(--gold); }
.stats-band .stat-label { font-size: .74rem; color: #cfe3d6; }
.stats-band .stat-period {
  position: absolute; right: 12px; bottom: 4px;
  font-size: .66rem; color: #9dbfab;
}

/* ---- 的中実績カード ---- */
.result-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.result-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; position: relative; overflow: hidden;
}
.result-card.is-hit { border-left: 5px solid var(--accent); }
.result-card.is-miss { border-left: 5px solid var(--line); opacity: .9; }
.result-card.is-best { border: 2px solid var(--gold); background: #fffdf3; }
.rc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rc-date { font-size: .78rem; color: #fff; background: var(--turf); border-radius: 4px; padding: 1px 8px; }
.rc-name { font-weight: bold; color: var(--turf-dark); font-size: .95rem; }
.rc-order { font-size: .92rem; margin: 2px 0; }
.rc-ai { font-size: .82rem; color: var(--ink-soft); }
.rc-ai b { color: var(--accent); }
.rc-pay {
  display: inline-flex; align-items: baseline; gap: 6px; margin-top: 6px;
  background: #fdefe9; border-radius: 6px; padding: 3px 10px;
}
.rc-pay .rc-type { font-size: .78rem; color: var(--ink-soft); }
.rc-pay strong { font-size: 1.25rem; color: var(--accent); font-family: "Yu Mincho", serif; }
.rc-headline { font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }

/* ---- 的中スタンプ ---- */
.hit-stamp {
  margin-left: auto; background: var(--accent); color: #fff;
  font-weight: bold; font-size: .82rem; padding: 3px 12px;
  border-radius: 6px; transform: rotate(-4deg); box-shadow: 0 1px 3px rgba(0,0,0,.2);
  border: 1.5px solid #fff; outline: 1.5px solid var(--accent);
}
.hit-stamp.small { font-size: .72rem; padding: 2px 8px; background: var(--gold); outline-color: var(--gold); }
.miss-stamp {
  margin-left: auto; background: #e7ded0; color: var(--ink-soft);
  font-size: .78rem; padding: 3px 10px; border-radius: 6px;
}

/* ---- ティザー（会員限定の誘導） ---- */
.teaser-card, .member-teaser {
  background: var(--white); border: 2px dashed var(--gold);
  border-radius: var(--radius); padding: 22px; text-align: center;
}
.teaser-card.big { padding: 30px 22px; }
.teaser-lock { font-size: 1.8rem; display: block; }
.teaser-card p, .member-teaser p { color: var(--ink-soft); margin: 8px 0; }
.teaser-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.member-teaser h3 { color: var(--turf-dark); }
.member-teaser-price { font-family: "Yu Mincho", serif; font-size: 1.3rem; color: var(--gold); font-weight: bold; }
.member-teaser-note { font-size: .76rem; color: var(--ink-soft); }
.member-teaser .member-horse { margin-bottom: 6px; }

/* ---- ボタン派生 ---- */
.btn-ghost {
  background: transparent; border: 1.5px solid var(--gold); color: #6d571f;
  padding: 8px 18px; border-radius: 999px; font-size: .85rem; cursor: pointer;
}
.btn-ghost:hover { background: #f3ead2; }
.btn-member.sm { padding: 8px 18px; font-size: .85rem; margin-top: 0; }
.btn-yosou.sm { margin-top: 6px; }

/* ---- TOP みんなの予想速報 ---- */
.vote-brief {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.vote-brief .vb-count { font-size: .8rem; color: var(--ink-soft); }
.vote-brief .vb-line { font-size: .9rem; }
.vote-brief .vb-judge { display: inline-block; margin-left: 4px; font-weight: bold; font-size: .85rem; }
.vote-brief .vb-judge.agree { color: var(--turf); }
.vote-brief .vb-judge.split { color: var(--accent); }
.vote-brief .btn-yosou.sm { display: inline-block; margin-top: 8px; }

/* =========================================================
   みんなの予想ページ
   ========================================================= */
.race-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.race-tab {
  background: var(--white); border: 1px solid var(--line); color: var(--ink);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .9rem;
}
.race-tab.active { background: var(--turf); color: #fff; border-color: var(--turf); }

/* 予想入力カード（＝投票の場所） */
.pick-card {
  background: linear-gradient(160deg, #fffdf6, #f5eeda);
  border: 2px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.pick-card h3 { color: #6d571f; font-size: 1.15rem; }
.pick-help { font-size: .85rem; color: var(--ink-soft); margin: 4px 0 14px; }
.pick-selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pick-slot { display: flex; flex-direction: column; gap: 6px; }
.pick-medal { font-weight: bold; font-size: .95rem; color: var(--turf-dark); }
.pick-slot select {
  padding: 10px 12px; border: 1.5px solid var(--gold); border-radius: 8px;
  font-size: 1rem; background: #fff; color: var(--ink);
}
.pick-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pick-actions .vote-status { font-size: .9rem; color: var(--accent); font-weight: bold; }

/* AI vs みんな ランキング2カラム */
.rank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.rank-col { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.rank-title { font-size: 1.05rem; padding-bottom: 8px; border-bottom: 2px solid var(--line); margin-bottom: 10px; }
.rank-title.ai { color: var(--turf-dark); }
.rank-title.crowd { color: var(--accent); }
.rank-note { font-size: .76rem; color: var(--ink-soft); margin-bottom: 8px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rank-table th { background: var(--turf); color: #fff; padding: 6px 8px; font-weight: normal; font-size: .78rem; }
.rank-table td { padding: 7px 8px; border-bottom: 1px solid var(--paper-dark); text-align: center; }
.rank-table td.t-left { text-align: left; }
.rank-table td.rk { font-weight: bold; color: var(--turf-dark); }
.rank-table td.mk { font-weight: bold; }

/* みんなのランキング行 */
.crowd-row { display: grid; grid-template-columns: 34px 1fr 90px auto; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--paper-dark); }
.crowd-row.mine { background: #fdf3e3; border-radius: 6px; }
.crowd-rk { font-size: 1.1rem; text-align: center; }
.crowd-name { font-size: .9rem; }
.crowd-name em { font-style: normal; font-size: .7rem; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.crowd-bar { height: 10px; background: var(--paper-dark); border-radius: 999px; overflow: hidden; }
.crowd-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.crowd-pts { font-size: .8rem; color: var(--ink-soft); white-space: nowrap; text-align: right; }
.crowd-pts small { font-size: .7rem; }

/* 的中チェック（デモ） */
.result-check { margin-top: 8px; }
.btn-result-demo {
  background: var(--turf); color: #fff; border: none;
  padding: 10px 22px; border-radius: 999px; font-size: .95rem; cursor: pointer;
}
.result-check-note { font-size: .76rem; color: var(--ink-soft); margin-left: 10px; }
.result-box {
  margin-top: 14px; background: var(--white); border: 2px solid var(--turf);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.result-order { font-size: 1rem; margin-bottom: 10px; }
.result-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.result-line .hit-stamp, .result-line .miss-stamp { margin-left: 0; }
.result-foot { font-size: .74rem; color: var(--ink-soft); margin-top: 8px; }

/* レース詳細ページの みんなの予想CTA */
.cta-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(160deg, #fffdf6, #f0e7d2);
  border: 2px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.cta-horse { flex: 0 0 90px; }
.cta-horse .horse { width: 90px; height: 90px; }
.cta-body { flex: 1 1 260px; }
.cta-body h3 { color: #6d571f; }
.cta-body p { font-size: .88rem; color: var(--ink-soft); margin: 4px 0 10px; }

@media (max-width: 640px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: 12px 8px; padding: 14px 10px 20px; }
  .stats-band .stat-num { font-size: 1.35rem; }
  .rank-cols { grid-template-columns: 1fr; gap: 12px; }
  .pick-selects { grid-template-columns: 1fr; gap: 10px; }
  .member-bar { font-size: .76rem; gap: 6px; }
  .member-bar .member-hint { display: none; }
  .crowd-row { grid-template-columns: 28px 1fr 60px auto; }
  .hero-catch { font-size: 1rem; }
}
