/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: #0a0e1a;
  color: #e8eaf0;
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== VARIABLES ===== */
:root {
  --gold: #f0b429;
  --gold-light: #ffd166;
  --green: #06d6a0;
  --red: #ef476f;
  --blue: #118ab2;
  --purple: #8338ec;
  --bg: #0a0e1a;
  --bg2: #111827;
  --bg3: #1a2235;
  --surface: #1e2d40;
  --border: rgba(255,255,255,0.08);
  --text: #e8eaf0;
  --text-muted: #8899aa;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

/* ===== CONTAINER ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,14,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.2rem; }
.logo-icon { font-size: 1.4rem; }
.logo-ai { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 6px 14px; border-radius: 8px; font-size: 0.9rem;
  color: var(--text-muted); transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface); }
.btn-profile {
  margin-left: 8px; padding: 7px 18px;
  background: linear-gradient(135deg, var(--gold), #e6a020);
  color: #0a0e1a; font-weight: 700; font-size: 0.85rem;
  border-radius: 8px; transition: var(--transition);
}
.btn-profile:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(240,180,41,0.4); }
.hamburger { display: none; font-size: 1.4rem; color: var(--text); margin-left: auto; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 90%; max-width: 560px; position: relative;
  transform: translateY(16px); transition: transform 0.25s;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  font-size: 1.2rem; color: var(--text-muted); padding: 4px 8px;
  border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { background: var(--surface); color: var(--text); }

/* QUIZ */
.quiz-step { display: none; }
.quiz-step.active { display: block; }
.quiz-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.quiz-progress-dot {
  height: 4px; flex: 1; background: var(--border);
  border-radius: 2px; transition: var(--transition);
}
.quiz-progress-dot.done { background: var(--gold); }
.quiz-q { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; line-height: 1.5; }
.quiz-q span { color: var(--gold); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  padding: 14px 18px; border: 2px solid var(--border);
  border-radius: var(--radius); text-align: left; font-size: 0.95rem;
  color: var(--text); transition: var(--transition);
  background: var(--surface);
}
.quiz-option:hover { border-color: var(--gold); background: rgba(240,180,41,0.08); }
.quiz-option.selected { border-color: var(--gold); background: rgba(240,180,41,0.15); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.btn-quiz-back {
  padding: 10px 20px; border-radius: 8px; font-size: 0.9rem;
  color: var(--text-muted); border: 1px solid var(--border);
}
.btn-quiz-next {
  padding: 10px 24px; background: var(--gold); color: #0a0e1a;
  font-weight: 700; border-radius: 8px; font-size: 0.9rem;
}

/* QUIZ RESULT */
.quiz-result { text-align: center; padding: 20px 0; }
.result-emoji { font-size: 4rem; margin-bottom: 16px; }
.result-type { font-size: 1.6rem; font-weight: 900; margin-bottom: 8px; }
.result-desc { color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }
.result-traits { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.result-trait {
  padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
}
.btn-apply {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--gold), #e6a020);
  color: #0a0e1a; font-weight: 700; font-size: 1rem; border-radius: 10px;
}

/* ===== HERO ===== */
.hero {
  padding: 120px 20px 80px;
  position: relative; overflow: hidden; text-align: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(240,180,41,0.12) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 20% 100%, rgba(6,214,160,0.06) 0%, transparent 60%);
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-block; padding: 5px 14px;
  border: 1px solid rgba(240,180,41,0.4); border-radius: 20px;
  font-size: 0.8rem; color: var(--gold); margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900;
  line-height: 1.25; margin-bottom: 16px;
}
.highlight { color: var(--gold); }
.hero-sub { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 36px; line-height: 1.8; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.btn-primary {
  padding: 14px 32px; background: linear-gradient(135deg, var(--gold), #e6a020);
  color: #0a0e1a; font-weight: 700; font-size: 1rem; border-radius: 10px;
  transition: var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(240,180,41,0.4); }
.btn-secondary {
  padding: 14px 32px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 1rem; color: var(--text); transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.hero-stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-num { font-size: 2rem; font-weight: 900; color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ===== PROFILE BAR ===== */
.profile-bar {
  background: linear-gradient(135deg, rgba(240,180,41,0.15), rgba(240,180,41,0.05));
  border-top: 1px solid rgba(240,180,41,0.2);
  border-bottom: 1px solid rgba(240,180,41,0.2);
  padding: 14px 20px;
}
.profile-bar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
.profile-type-badge {
  font-size: 1.4rem; width: 44px; height: 44px;
  background: var(--surface); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.profile-info { flex: 1; }
.profile-info span { display: block; }
.profile-info span:first-child { font-weight: 700; font-size: 1rem; }
.profile-budget { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.btn-re-quiz {
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.85rem; color: var(--text-muted); transition: var(--transition);
}
.btn-re-quiz:hover { border-color: var(--gold); color: var(--gold); }

/* ===== SECTIONS ===== */
.section { padding: 70px 0; }
.section-dark { background: var(--bg2); }
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-title { font-size: 1.5rem; font-weight: 700; }
.section-date { font-size: 0.85rem; color: var(--text-muted); margin-left: auto; }
.section-sub { color: var(--text-muted); font-size: 0.95rem; width: 100%; margin-top: -20px; margin-bottom: 8px; }

/* ===== SUMMARY CARDS ===== */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.summary-card.loading { height: 100px; animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.summary-card-icon { font-size: 1.6rem; margin-bottom: 10px; }
.summary-card-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.summary-card-value { font-size: 2rem; font-weight: 900; color: var(--gold); }
.market-note {
  background: var(--bg3); border-left: 3px solid var(--gold);
  padding: 14px 18px; border-radius: 0 8px 8px 0;
  font-size: 0.9rem; color: var(--text-muted); margin-top: 8px;
}

/* ===== TYPE FILTER ===== */
.type-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 0.85rem;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.filter-btn.active { background: var(--gold); color: #0a0e1a; font-weight: 700; border-color: var(--gold); }

/* ===== RACES GRID ===== */
.races-grid { display: flex; flex-direction: column; gap: 20px; }
.race-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.race-header {
  padding: 18px 24px; background: var(--bg3);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.race-grade {
  padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700;
  background: rgba(240,180,41,0.2); color: var(--gold); border: 1px solid rgba(240,180,41,0.3);
}
.race-name { font-weight: 700; font-size: 1.05rem; flex: 1; }
.race-meta { display: flex; gap: 12px; margin-left: auto; font-size: 0.82rem; color: var(--text-muted); }
.race-body { padding: 20px 24px; }
.horses-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.horses-table th { text-align: left; font-size: 0.75rem; color: var(--text-muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.horses-table td { padding: 10px 10px; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.horse-num { font-weight: 700; color: var(--gold); }
.horse-name { font-weight: 600; }
.ev-badge {
  padding: 3px 8px; border-radius: 6px; font-size: 0.78rem; font-weight: 700;
}
.ev-high    { background: rgba(6,214,160,0.15); color: var(--green); }
.ev-mid     { background: rgba(240,180,41,0.15); color: var(--gold); }
.ev-low     { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.ev-pending { background: rgba(131,56,236,0.15); color: var(--purple); }

.picks-pending-banner {
  grid-column: 1 / -1;
  padding: 14px 18px;
  background: rgba(131,56,236,0.08);
  border: 1px solid rgba(131,56,236,0.25);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--purple);
  text-align: center;
  margin-bottom: 4px;
}

/* PICK PANELS */
.picks-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pick-panel {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  transition: var(--transition);
}
.pick-panel:hover { border-color: rgba(240,180,41,0.3); }
.pick-panel-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.pick-type-icon { font-size: 1rem; }
.pick-type-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.pick-bet-type { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.pick-horses { font-size: 1.1rem; font-weight: 900; color: var(--gold); margin-bottom: 6px; }
.pick-reason { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.pick-panel.highlighted { border-color: var(--gold); background: rgba(240,180,41,0.06); }

/* Colored borders per type */
.pick-panel.solid-panel { border-left: 3px solid var(--green); }
.pick-panel.balance-panel { border-left: 3px solid var(--blue); }
.pick-panel.medium-panel { border-left: 3px solid var(--gold); }
.pick-panel.longshot-panel { border-left: 3px solid var(--purple); }

/* ===== STRATEGY GRID ===== */
.strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.strategy-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 22px;
  transition: var(--transition);
}
.strategy-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.solid-card    { border-top: 3px solid var(--green); }
.balance-card  { border-top: 3px solid var(--blue); }
.medium-card   { border-top: 3px solid var(--gold); }
.longshot-card { border-top: 3px solid var(--purple); }
.strategy-icon { font-size: 2rem; margin-bottom: 12px; }
.strategy-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.strategy-target { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }
.strategy-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.strategy-list li { font-size: 0.87rem; padding-left: 14px; position: relative; }
.strategy-list li::before { content: '→'; position: absolute; left: 0; color: var(--gold); }
.strategy-ev {
  font-size: 0.78rem; font-weight: 700; color: var(--green);
  padding: 5px 10px; background: rgba(6,214,160,0.1); border-radius: 6px;
  display: inline-block;
}

/* ===== MEDIA / YOUTUBE ===== */
.media-search-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
}
.search-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.search-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.search-btn {
  padding: 8px 16px; border-radius: 20px; font-size: 0.85rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); transition: var(--transition);
}
.search-btn:hover { border-color: var(--gold); color: var(--gold); }
.search-btn.recommended { border-color: var(--gold); background: rgba(240,180,41,0.1); color: var(--gold); }

.channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.channel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: var(--transition);
}
.channel-card:hover { border-color: rgba(240,180,41,0.3); transform: translateY(-2px); }
.channel-header { display: flex; align-items: center; gap: 12px; }
.channel-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e6a020);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.channel-name { font-weight: 700; font-size: 0.95rem; }
.channel-category { font-size: 0.75rem; color: var(--text-muted); }
.channel-desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }
.channel-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.channel-tag {
  padding: 2px 8px; border-radius: 10px; font-size: 0.72rem;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted);
}
.channel-tag.match { background: rgba(240,180,41,0.1); border-color: rgba(240,180,41,0.3); color: var(--gold); }
.channel-link {
  margin-top: 4px; padding: 9px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; text-align: center; font-size: 0.85rem; font-weight: 600;
  transition: var(--transition);
}
.channel-link:hover { background: var(--gold); color: #0a0e1a; border-color: var(--gold); }
.media-note { font-size: 0.78rem; color: var(--text-muted); opacity: 0.6; padding: 12px 0; }

/* ===== BUDGET SIMULATOR ===== */
.simulator-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  max-width: 680px; margin: 0 auto;
}
.sim-input-group { margin-bottom: 28px; }
.sim-input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.sim-input-row { display: flex; align-items: center; gap: 16px; }
input[type="range"] {
  flex: 1; -webkit-appearance: none;
  height: 4px; background: var(--border); border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  background: var(--gold); border-radius: 50%; cursor: pointer;
}
.sim-value { font-size: 1.3rem; font-weight: 900; color: var(--gold); min-width: 100px; text-align: right; }
.sim-type-select { margin-bottom: 28px; }
.sim-type-select label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.sim-type-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sim-type-btn {
  padding: 9px 18px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.9rem; color: var(--text-muted); transition: var(--transition);
}
.sim-type-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(240,180,41,0.08); }
.sim-result { display: flex; flex-direction: column; gap: 10px; }
.sim-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg3); border-radius: 8px; font-size: 0.9rem;
}
.sim-row-label { color: var(--text-muted); }
.sim-row-value { font-weight: 700; color: var(--gold); }

/* ===== SUBSCRIPTION / PREMIUM ===== */
.btn-premium-nav {
  background: linear-gradient(135deg, #f0b429 0%, #e08e00 100%);
  color: #0a0e1a;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-premium-nav:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-premium-nav.btn-premium--active {
  background: linear-gradient(135deg, #8338ec 0%, #5e17c0 100%);
  color: #fff;
  cursor: default;
}

.btn-premium {
  display: inline-block;
  background: linear-gradient(135deg, #f0b429 0%, #e08e00 100%);
  color: #0a0e1a;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 10px;
}
.btn-premium:hover { opacity: 0.88; transform: translateY(-1px); }

/* ロックされたレースカード */
.race-card--locked {
  position: relative;
  overflow: hidden;
  min-height: 130px;
}
.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  padding: 24px;
}
.locked-icon { font-size: 2rem; }
.locked-text { font-size: 0.9rem; color: var(--text-muted); }

/* アップグレードバナー */
.upgrade-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(240,180,41,0.12) 0%, rgba(131,56,236,0.10) 100%);
  border: 1px solid rgba(240,180,41,0.35);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 8px;
}
.upgrade-banner-icon { font-size: 2rem; flex-shrink: 0; }
.upgrade-banner-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.upgrade-banner-text strong { font-size: 1rem; color: var(--gold); }
.upgrade-banner-text span { font-size: 0.83rem; color: var(--text-muted); }
.upgrade-banner .btn-premium { margin-top: 0; white-space: nowrap; flex-shrink: 0; }

/* 決済完了バナー */
.premium-activated-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: linear-gradient(135deg, #8338ec, #5e17c0);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 30px;
  box-shadow: 0 8px 32px rgba(131,56,236,0.4);
  animation: slideDown 0.4s ease;
  white-space: nowrap;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== FOOTER ===== */
.footer {
  background: #070a13; border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner { display: flex; gap: 32px; flex-direction: column; align-items: center; text-align: center; }
.footer-logo { font-size: 1.1rem; font-weight: 700; }
.footer-note p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.8; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .nav { display: none; }
  .hamburger { display: block; }
  .hero { padding: 100px 16px 60px; }
  .hero-title { font-size: 1.6rem; }
  .hero-stats { gap: 24px; }
  .section { padding: 50px 0; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .type-filter { margin-left: 0; }
  .race-meta { display: none; }
  .picks-panels { grid-template-columns: 1fr 1fr; }
  .simulator-card { padding: 24px 20px; }
  .sim-type-btns { gap: 6px; }
  .modal { padding: 28px 20px; }
}
