@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700;900&family=Titillium+Web:wght@600;700&display=swap');

:root {
  /* ==========================================================================
     テーマカラー設定 (SofaScore 公式ダークテーマ配色システム)
     ========================================================================== */
  
  --bg-primary: #202124;       /* 全体背景（ユーザー指定色） */
  --bg-secondary: #26272b;     /* ヘッダー・カード背景（黒みを強めたニュートラルダーク） */
  --bg-card: #26272b;          /* カード背景 */
  --bg-card-hover: #2f3035;    /* ホバー時カード背景 */
  --border-color: #35363b;     /* ニュートラルダーク枠線 */

  --text-main: #ffffff;        /* 100% 純白 (SofaScore Activeテキスト/主文字) */
  --text-muted: #8c9db5;       /* SofaScore Inactiveテキスト (Favourites/Competitions等と同色) */
  --text-sub: #cbd5e1;         /* サブテキスト */
  
  /* ==========================================================================
     強調・アクセントカラー設定 (SofaScore Blue)
     ========================================================================== */
  
  --accent-white: #ffffff;
  --accent-gold: #374df5;     /* SofaScore 鮮烈ロイヤルブルー */
  --accent-orange: #1d4ed8;   /* ディープブルー */
  --accent-red: #ef4444;      /* 本来の指標レッド */
  --accent-navy: #121829;
  --accent-blue: #374df5;     /* SofaScore ブランドロイヤルブルー */
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  
  /* Boat Colors */
  --boat-1: #ffffff;
  --boat-1-text: #0f172a;
  --boat-2: #262626;
  --boat-2-text: #ffffff;
  --boat-3: #ef4444;
  --boat-3-text: #ffffff;
  --boat-4: #2563eb;
  --boat-4-text: #ffffff;
  --boat-5: #eab308;
  --boat-5-text: #0f172a;
  --boat-6: #16a34a;
  --boat-6-text: #ffffff;

  --shadow-glow-gold: 0 0 20px rgba(251, 191, 36, 0.25);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.25);
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 50px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header & Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-title {
  font-family: 'Titillium Web', 'Inter', sans-serif;
  font-size: 25px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0;
  line-height: 1.15;
}

.logo-sub {
  display: block;
  font-family: 'Titillium Web', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.badge-beta {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #38bdf8;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.24));
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 1.5px 7px;
  border-radius: 8px;
  letter-spacing: 0.4px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
  margin-left: 6px;
  vertical-align: middle;
  user-select: none;
}


.nav-links {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 30px;
  gap: 4px;
}

.nav-item {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  border: 1px solid rgba(147, 197, 253, 0.4);
}

/* Date Selector Segmented Control */
.date-selector-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px;
  border-radius: 30px;
  gap: 2px;
}

.btn-date {
  background: transparent;
  border: none;
  color: #8c9db5; /* SofaScore Inactive文字色 */
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
}

.btn-date:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-date.active[data-date="today"] {
  background: #374df5; /* SofaScore ロイヤルブルー */
  color: #ffffff;      /* 100% 純白 */
  box-shadow: 0 0 12px rgba(55, 77, 245, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-date.active[data-date="yesterday"] {
  background: linear-gradient(135deg, #0284c7, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  border: 1px solid rgba(186, 230, 253, 0.4);
}

/* Top Summary Banner */
.summary-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.summary-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

/* Pickups Section */
.pickup-section {
  margin-bottom: 24px;
}

.section-title-sm {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pickup-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pickup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pickup-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: #8c9db5; /* SofaScore Inactive文字色 */
}

/* 選手名ヘッダーの落ち着いた白字表示 */
.pickup-racer-name {
  font-size: 18.5px !important;
  font-weight: 800 !important;
  color: #e2e8f0 !important; /* 目に優しいソフトオフホワイト */
  margin: 3px 0;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.pickup-rankp {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1; /* 落ち着いた暗めの白字 */
  background: #1e293b; /* シックなダークネイビーバッジ */
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.pickup-runs-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--border-color);
}

/* 改行防止＆フィット用スタイル */
.pickup-run-item {
  font-size: 12.5px;
  font-weight: 400;
  color: #cbd5e1; /* 落ち着いた暗めの白字 */
  white-space: nowrap;
  letter-spacing: -0.1px;
}

/* 注目選手ピックアップ：出走レース2行表示（見出し＋項目名付きマークピル） */
.run-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  white-space: normal;
  margin-bottom: 5px;
}

.run-rank-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
}

.run-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  white-space: normal;
}

.run-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 500;
  color: #6b7a90;
  white-space: nowrap;
}

.run-pill.is-good {
  color: #e0f2fe;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.run-pill.is-bad {
  color: #fecaca;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.65);
}

.run-rank {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-white);
  white-space: nowrap;
}

/* Controls / Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #8c9db5; /* SofaScore Inactive文字色 */
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter:hover {
  color: #ffffff;
  background: var(--bg-card-hover);
}

.btn-filter.active {
  background: #374df5; /* SofaScore ブランドロイヤルブルー */
  color: #ffffff;      /* 100% 純白 */
  border-color: #374df5;
  box-shadow: 0 0 12px rgba(55, 77, 245, 0.4);
}

.btn-filter.active-chao {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
  color: white;
  border-color: var(--accent-orange);
}

/* Race Grid */
.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 20px;
}

/* レースカード (狙い目総合点 穴Pの4段階背景グラデーション: トーンダウン暗め設定) */

/* 1. 通常 (0~199P) */
/* 1. 通常レース (0P〜199P: シックなダークスレート) */
.race-card {
  background: linear-gradient(145deg, #141720, #11131a);
  border: 1px solid #232734;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
}

.race-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* 2. 厳選 (200~399P: ほんのり青みがかったダークネイビー) */
.race-card.strict {
  background: linear-gradient(145deg, #151d2d, #101624) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  border-left: 3.5px solid rgba(56, 189, 248, 0.7) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* 3. 準高穴P (400~599P: 深みのあるミッドナイトサファイア) */
.race-card.strict-high {
  background: linear-gradient(145deg, #17253f, #111e35) !important;
  border: 1px solid rgba(56, 189, 248, 0.48) !important;
  border-left: 4.5px solid #38bdf8 !important;
  box-shadow: 0 5px 20px rgba(14, 116, 144, 0.2) !important;
}

/* 4. 超厳選 (600P+: 上品で格調高いロイヤルサファイアブルー) */
.race-card.super {
  background: linear-gradient(145deg, #1a2f58, #132446) !important;
  border: 1px solid rgba(56, 189, 248, 0.7) !important;
  border-left: 5px solid #60a5fa !important;
  box-shadow: 0 6px 26px rgba(37, 99, 235, 0.25) !important;
}


.race-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.race-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.race-time {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff; /* 純白でくっきり可読化 */
}

.race-title-txt {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff; /* くっきり鮮明な純白 */
  display: flex;
  align-items: center;
  gap: 8px;
}

.race-day-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.ana-p-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ana-p-badge {
  font-size: 24px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 8px;
  background: #26272b;
  color: white;
  border: 1px solid var(--border-color);
}

.ana-p-badge.strict {
  background: linear-gradient(135deg, #1e3a5f, #16213a);
  color: #93c5fd;
  border: 1px solid rgba(30, 58, 138, 0.4);
}

.ana-p-badge.strict-high {
  background: linear-gradient(135deg, #0369a1, #0c4a6e);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.3);
  color: #ffffff;
  border: 1px solid rgba(186, 230, 253, 0.3);
}

.ana-p-badge.super {
  background: linear-gradient(135deg, #0284c7, #1d4ed8);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.55);
  color: #ffffff;
  border: 1px solid rgba(186, 230, 253, 0.5);
}

.ana-p-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 4 Metrics Gauges Mini Grid */
.card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
}

.card-metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-metric-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}

.card-metric-label {
  color: var(--text-muted);
}

.card-metric-val {
  font-weight: 800;
}

.card-metric-bar-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.card-metric-bar-fill {
  height: 100%;
  border-radius: 3px;
}

/* 6-Boat Horizontal Mini Table */
.card-racers-horizontal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11px;
  table-layout: fixed;
}

.card-racers-horizontal-table th,
.card-racers-horizontal-table td {
  border: 1px solid var(--border-color);
  padding: 5px 3px;
  text-align: center;
  white-space: normal;
  word-break: break-all;
  line-height: 1.35;
}

.card-racers-horizontal-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.15);
}

.boat-mini-chip {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  margin-right: 2px;
}

.boat-1 { background: var(--boat-1); color: var(--boat-1-text); }
.boat-2 { background: var(--boat-2); color: var(--boat-2-text); }
.boat-3 { background: var(--boat-3); color: var(--boat-3-text); }
.boat-4 { background: var(--boat-4); color: var(--boat-4-text); }
.boat-5 { background: var(--boat-5); color: var(--boat-5-text); }
.boat-6 { background: var(--boat-6); color: var(--boat-6-text); }

/* Aim Labels Section */
.aim-labels-block {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.aim-label-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.2);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card-footer-btn {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

.btn-detail-link {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  background: #202b42;
  border: 1px solid rgba(55, 77, 245, 0.45);
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-detail-link:hover,
.race-card:hover .btn-detail-link {
  background: #374df5;
  color: #ffffff;
  border-color: #374df5;
  box-shadow: 0 0 12px rgba(55, 77, 245, 0.5);
  gap: 8px;
}

/* ==================== Detail Page Styles ==================== */
.back-bar {
  margin: 20px 0;
}

.btn-back {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-back:hover {
  color: var(--text-main);
}

.detail-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

.detail-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-title {
  font-size: 26px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-meta-list {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Gauges Row in Detail Header */
.metrics-gauge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: 10px;
  margin-top: 16px;
}

.gauge-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.gauge-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.gauge-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.gauge-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.gauge-bar-fill-expect {
  height: 100%;
  border-radius: 5px;
  background-color: var(--accent-white);
}

.gauge-bar-fill-head {
  height: 100%;
  border-radius: 5px;
  background-color: var(--accent-red);
}

.gauge-bar-fill-aout {
  height: 100%;
  border-radius: 5px;
  background-color: var(--accent-blue);
}

.gauge-bar-fill-narrow {
  height: 100%;
  border-radius: 5px;
  background-color: var(--accent-green);
}

/* Layout Toggle (縦/横) */
.layout-toggle-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px;
  border-radius: 20px;
  gap: 2px;
}

.btn-layout {
  background: transparent;
  border: none;
  color: #8c9db5;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  outline: none;
}

.btn-layout:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-layout.active {
  background: #374df5;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(55, 77, 245, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 6-Boat Matrix Table */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow-x: auto;
  margin-bottom: 30px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
  min-width: 700px;
}

.matrix-table th,
.matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: none;
}

.matrix-table th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-muted);
}

.matrix-table tr:hover {
  background: var(--bg-card-hover);
}

.matrix-boat-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

/* 縦レイアウト：艇番・選手名セル */
.racer-info-cell {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.racer-name-txt {
  overflow-wrap: break-word;
}

/* Mini Bar in Table Cell */
.cell-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.cell-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 3px;
}

.cell-bar-val {
  font-weight: 700;
  font-size: 12px;
  min-width: 32px;
  text-align: right;
}

/* col-equal: 縦レイアウト ST/足力/成績/実力 列幅均等化 */
.col-equal {
  width: 11%;
  text-align: center;
}

/* 有料ロック通知カード（本日200P+厳選レース） */
.detail-locked-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 44px 24px;
  text-align: center;
  margin-bottom: 30px;
}

.detail-locked-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-red);
  margin-bottom: 14px;
}

.detail-locked-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.75;
  max-width: 560px;
  margin: 0 auto 22px;
}

@media (max-width: 768px) {
  .detail-locked-card {
    padding: 28px 16px;
  }

  .detail-locked-title {
    font-size: 15.5px;
  }
}

/* Stacked Mini Bar for 4-Points Breakdown */
.stacked-bar-container {
  display: flex;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  margin-top: 4px;
}

.stacked-seg {
  height: 100%;
}

.seg-expect { background: #ffffff; }
.seg-head   { background: #ef4444; }
.seg-aout   { background: #3b82f6; }
.seg-narrow { background: #10b981; }

.external-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.external-btn-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Option 1: 勝利コラム発光 */
.win-column-ogre {
  background: rgba(2, 132, 199, 0.12) !important;
  border-left: 2px solid #38bdf8 !important;
  border-right: 2px solid #38bdf8 !important;
}

.win-column-skull {
  background: rgba(126, 34, 206, 0.12) !important;
  border-left: 2px solid #c084fc !important;
  border-right: 2px solid #c084fc !important;
}

/* 縦レイアウト：鬼/ドクロ成功時の行全体強調 */
.tr-win-ogre td {
  background: rgba(2, 132, 199, 0.12);
  border-top: 2px solid #38bdf8;
  border-bottom: 2px solid #38bdf8;
}

.tr-win-skull td {
  background: rgba(126, 34, 206, 0.12);
  border-top: 2px solid #c084fc;
  border-bottom: 2px solid #c084fc;
}

/* Option 2: 鬼・ドクロ超強調バッジ (Glow / Chip) */
.ogre-badge-glow {
  display: inline-block;
  background: linear-gradient(135deg, #0284c7, #1e3a8a);
  color: #ffffff;
  font-weight: 900;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 4px 9px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  border: 1px solid #38bdf8;
  white-space: normal;
  word-break: break-word;
  animation: pulseGlowOgre 2s infinite alternate;
}

@keyframes pulseGlowOgre {
  0% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.4); }
  100% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.8); }
}

.skull-badge-glow {
  display: inline-block;
  background: linear-gradient(135deg, #7e22ce, #581c87);
  color: #ffffff;
  font-weight: 900;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 4px 9px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
  border: 1px solid #c084fc;
  white-space: normal;
  word-break: break-word;
  animation: pulseGlowSkull 2s infinite alternate;
}

@keyframes pulseGlowSkull {
  0% { box-shadow: 0 0 6px rgba(168, 85, 247, 0.4); }
  100% { box-shadow: 0 0 16px rgba(168, 85, 247, 0.8); }
}

.header-mark-chip {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.ogre-chip {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.skull-chip {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.rainbow-hit-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(59, 130, 246, 0.25));
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.5);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

/* 特に際立った的中（虹フラグ）：背景は通常バッジと同じ、枠線のみ虹色（角丸維持） */
.rainbow-ring {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: linear-gradient(90deg, #f87171, #fbbf24, #34d399, #38bdf8, #a78bfa);
}

.rainbow-ring .rainbow-hit-badge {
  border: none;
  background-color: var(--bg-card);
  background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(59, 130, 246, 0.25));
}

@keyframes rainbowHue {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* メダル風確定着順バッジ */
.rank-badge-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.rank-badge-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #ffffff;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.rank-badge-3 {
  background: linear-gradient(135deg, #b45309, #78350f);
  color: #fef3c7;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

/* 統合成功スタンプ */
.stamp-badge-ogre {
  background: linear-gradient(135deg, #0284c7, #1e3a8a);
  color: #e0f2fe;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  font-weight: 900;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stamp-badge-skull {
  background: linear-gradient(135deg, #7e22ce, #581c87);
  color: #f3e8ff;
  border: 1px solid #c084fc;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
  font-weight: 900;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* 虹枠で囲む場合：バッジ本来の枠線を消し、背景グラデーションはそのまま維持 */
.rainbow-ring .stamp-badge-ogre,
.rainbow-ring .stamp-badge-skull {
  border: none;
}

/* レースカード内の成功スタンプ：狭いセル幅に合わせて省スペース化 */
.card-racers-horizontal-table .stamp-badge-ogre,
.card-racers-horizontal-table .stamp-badge-skull {
  font-size: 10px;
  padding: 2px 5px;
  letter-spacing: -0.2px;
}

/* 鬼スタンプは常に1行表示 */
.card-racers-horizontal-table .stamp-badge-ogre {
  white-space: nowrap;
}

.card-racers-horizontal-table .stamp-badge-skull {
  white-space: normal;
  line-height: 1.3;
}

.rank-badge-normal {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
}

/* 総合点 内訳（ST・足力・成績・実力の構成比バー） */
.highlight-val {
  display: inline-block;
}

.mini-stack-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 7px auto 0;
  background: rgba(255, 255, 255, 0.08);
}

.stack-seg {
  height: 100%;
}

.stack-st  { background: #fbbf24; }
.stack-leg { background: #ef4444; }
.stack-sek { background: #22c55e; }
.stack-jit { background: #3b82f6; }

/* 各指標行ラベル：ドット(主要4指標) / 補足タグ(伸度・足度) */
.metric-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}

.sub-metric-val {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 横マトリクス比較テーブル（スマホ表示時レスポンシブ最適化） */
.matrix-table-h {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12.5px;
  table-layout: fixed;
}

.matrix-table-h th,
.matrix-table-h td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.matrix-table-h td {
  white-space: normal;
  word-break: break-word;
}

.matrix-table-h th:last-child,
.matrix-table-h td:last-child {
  border-right: none;
}

.matrix-table-h th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-muted);
  vertical-align: middle;
}

.matrix-table-h th:first-child,
.matrix-table-h td:first-child {
  width: 96px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-secondary);
  text-align: left;
  padding-left: 12px;
  white-space: nowrap;
}

/* 1〜6号艇 ヘッダーセル（艇番バッジ・選手名・級別） */
.boat-col-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 2px;
}

.boat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.racer-name-h {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.racer-class-h {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .race-grid {
    grid-template-columns: 1fr;
  }

  .matrix-table-h {
    font-size: 10.5px;
  }

  .matrix-table-h th,
  .matrix-table-h td {
    padding: 5px 2px;
  }

  .matrix-table-h th:first-child,
  .matrix-table-h td:first-child {
    width: 58px;
    font-size: 10px;
    padding-left: 6px;
  }

  .sub-metric-val {
    font-size: 9.5px;
  }

  .boat-badge {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .racer-name-h {
    font-size: 10.5px;
  }

  .racer-class-h {
    font-size: 9px;
    padding: 0 5px;
  }

  .boat-mini-chip {
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 9px;
  }

  .stamp-badge-ogre,
  .stamp-badge-skull {
    font-size: 10.5px;
    padding: 2px 4px;
  }

  .header-mark-chip {
    font-size: 10.5px;
    padding: 3px 7px;
  }

  .ogre-badge-glow,
  .skull-badge-glow {
    font-size: 11px;
    padding: 3px 7px;
  }

  .metrics-gauge-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
    padding: 14px;
  }

  .gauge-label {
    font-size: 11px;
  }
}

/* ==========================================================================
   フッター ＆ 利用規約・免責事項スタイル
   ========================================================================== */

.site-footer {
  margin-top: 60px;
  padding: 40px 0 24px;
  background-color: #17181b;
  border-top: 1px solid #303136;
}

.footer-terms-box {
  background: #1c1d20;
  border: 1px solid #303136;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.terms-title {
  font-size: 15px;
  font-weight: 800;
  color: #e2e8f0;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #303136;
  padding-bottom: 10px;
}

.terms-list {
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #8c9db5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terms-list li {
  margin-bottom: 4px;
}

.footer-bottom {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding-top: 16px;
  border-top: 1px solid #141c2d;
}

/* ==========================================================================
   有料ロックエリア スタイル (落ち着いたシックなネイビー/グレー調)
   ========================================================================== */

.card-locked-full {
  background: rgba(23, 27, 38, 0.75) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px !important;
  transition: all 0.25s ease;
}

.card-locked-full:hover {
  border-color: rgba(56, 189, 248, 0.4) !important;
  background: rgba(26, 32, 46, 0.85) !important;
}

.card-locked-full::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.04), transparent 70%);
  pointer-events: none;
}

.card-locked-full-inner {
  text-align: center;
  padding: 22px 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  z-index: 1;
}

.locked-title-lg {
  font-size: 15px;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

.locked-sub-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 12px;
  border-radius: 14px;
}

.btn-lock-action {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-lock-action:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}