/* コース傾向ページ専用スタイル */

/* ===== 競馬場タブ ===== */
.venue-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--app-bg);
  padding-top: 6px;
  padding-bottom: 2px;
  margin-top: -6px;
}

.venue-tabs-wrap::-webkit-scrollbar {
  display: none;
}

.venue-tabs {
  border-bottom: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
}

.venue-tabs .nav-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: #495057;
  background: #fff;
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: var(--app-radius);
  min-width: 7.5rem;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

.venue-tabs .nav-link:hover {
  color: #198754;
  background: rgba(15, 126, 77, 0.05);
  border-color: #198754;
}

.venue-tabs .nav-link.active {
  color: #fff;
  background: #198754;
  border-color: #198754;
}

/* ===== コースカードグリッド ===== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 14px;
}

/* ===== コースカード ===== */
.course-card {
  background: var(--app-panel-bg);
  border: 1px solid var(--app-panel-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-panel-shadow);
  overflow: hidden;
}

.course-card-header {
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(15, 126, 77, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
  border-bottom: 1px solid var(--app-panel-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.course-surface-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.surface-turf {
  background: #e1f5e9;
  color: #1b6c38;
  border: 1px solid #a5d6b3;
}

.surface-dirt {
  background: #f3e8d8;
  color: #7a4a1e;
  border: 1px solid #d4b48a;
}

.surface-jump {
  background: #fff3e0;
  color: #8c4a00;
  border: 1px solid #ffcc80;
}

.course-distance {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--app-text);
}

.course-direction {
  font-size: 0.78rem;
  color: var(--app-subtle);
}

.course-sample {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--app-subtle);
}

/* ===== 芝/ダート/障害 セクション分割 ===== */
.surface-section {
  margin-bottom: 20px;
}

.surface-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 10px;
}

.surface-section-header.suf-turf {
  background: linear-gradient(90deg, #1b5e20 0%, #2e7d32 60%, #388e3c 100%);
}

.surface-section-header.suf-dirt {
  background: linear-gradient(90deg, #4e342e 0%, #6d4c41 60%, #8d6035 100%);
}

.surface-section-header.suf-jump {
  background: linear-gradient(90deg, #7f3b00 0%, #b35a00 60%, #c66d00 100%);
}

.suf-header-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 5px;
  padding: 2px 9px;
  letter-spacing: 0.04em;
}

.suf-header-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.03em;
}

.suf-header-count {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
  margin-left: auto;
}

/* ===== コースダイアグラム（画像 + オーバーレイ） ===== */
.course-track-diagram {
  position: relative;
  height: 100px;
  overflow: hidden;
  border-bottom: 1px solid var(--app-panel-border);
  background-size: cover;
  background-position: center;
}

.course-track-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.52) 0%,
    rgba(0,0,0,0.18) 55%,
    rgba(0,0,0,0.0) 100%
  );
}

.diagram-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.diagram-distance {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: -0.02em;
}

.diagram-surface {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}

.diagram-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.diagram-direction {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  padding: 1px 7px;
}

.diagram-arrow {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
}

/* ===== カード本体 ===== */
.course-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== セクションヘッダ ===== */
.stat-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--app-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  border-left: 3px solid var(--app-accent);
  padding-left: 6px;
}

/* ===== 枠番傾向 ===== */
.frame-grid {
  display: flex;
  gap: 3px;
}

.frame-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.frame-label {
  font-size: 0.65rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* JRA公式枠色 */
.frame-1 { background: #ffffff; color: #333; border: 1px solid #bbb; }
.frame-2 { background: #1a1a1a; color: #fff; }
.frame-3 { background: #cc0033; color: #fff; }
.frame-4 { background: #0055a5; color: #fff; }
.frame-5 { background: #f5c518; color: #333; }
.frame-6 { background: #007a3e; color: #fff; }
.frame-7 { background: #e05a00; color: #fff; }
.frame-8 { background: #d94b91; color: #fff; }

.frame-bar-wrap {
  width: 22px;
  height: 52px;
  background: #eef1f4;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.frame-bar-place {
  width: 100%;
  background: #90caf9;
  position: absolute;
  bottom: 0;
  left: 0;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.frame-bar-win {
  width: 100%;
  background: #1565c0;
  position: absolute;
  bottom: 0;
  left: 0;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.frame-rate-label {
  font-size: 0.6rem;
  color: var(--app-subtle);
  text-align: center;
  line-height: 1.2;
}

/* ===== 脚質傾向 ===== */
.style-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.style-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 6px;
}

.style-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--app-text);
  text-align: right;
}

.style-bar-bg {
  height: 12px;
  background: #eef1f4;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.style-bar-place {
  height: 100%;
  background: #a5d6a7;
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
}

.style-bar-win {
  height: 100%;
  background: #2e7d32;
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
}

.style-rate-text {
  font-size: 0.7rem;
  color: var(--app-subtle);
  text-align: right;
  white-space: nowrap;
}

.style-no-data {
  font-size: 0.72rem;
  color: #b0bec5;
}

/* ===== 上がり傾向 ===== */
.last3f-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.08), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 200, 0, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
}

.last3f-stat {
  text-align: center;
}

.last3f-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #b8860b;
  line-height: 1;
}

.last3f-sub {
  font-size: 0.66rem;
  color: var(--app-subtle);
  margin-top: 2px;
}

.last3f-divider {
  width: 1px;
  height: 36px;
  background: var(--app-panel-border);
}

.last3f-desc {
  flex: 1;
  font-size: 0.72rem;
  color: var(--app-subtle);
  line-height: 1.4;
}

.no-last3f {
  font-size: 0.72rem;
  color: #b0bec5;
}

/* ===== データ不足表示 ===== */
.low-data-notice {
  text-align: center;
  color: #b0bec5;
  font-size: 0.78rem;
  padding: 12px 0;
}
