/* styles.css — ポイ活スコア */
/* 固有ビジュアルID: 模試成績表シート × スコア目盛りバンド */
/* 姉妹アプリ（請求書圧縮ゲージ / コイン貯金瓶 / アプリタイル）と一切被らせない */
/* AIデフォルト3類型（cream+セリフ/near-black+acid/新聞hairline）に寄せない */

/* ===== デザイントークン ===== */
:root {
  --paper:  #F2F4FB;   /* cool lavender-grey 基調 */
  --ink:    #1C1640;   /* deep indigo-violet */
  --brand:  #6C2BD9;   /* electric violet */
  --gain:   #00B3A4;   /* teal（伸びしろ/獲得余地） */
  --reward: #FFB020;   /* reward-gold */
  --rule:   #C9CEE6;   /* 罫線/目盛り */
  --muted:  #6B7DB3;
  --faint:  #B8C0DC;
  --surface: #FFFFFF;
  --brand-light: #F0EAFF;
  --gain-light:  #E0F7F5;
  --score-track: #E8ECF8;

  /* タイポグラフィ（Webフォント不使用） */
  --font-jp:  "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(28,22,64,0.08);
}

/* ===== リセット ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-jp);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

/* 成績表の薄い横罫（背景）*/
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    var(--rule) 27px,
    var(--rule) 28px
  );
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.container { max-width: 680px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ===== ヘッダ ===== */
.site-header {
  background: var(--ink);
  border-bottom: 4px solid var(--brand);
  padding: 18px 0;
  position: relative;
  z-index: 10;
}
.site-header .container { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.site-logo {
  font-family: var(--font-jp);
  font-size: 22px;
  font-weight: bold;
  color: #FFFFFF;
  letter-spacing: 0.03em;
}
.site-tagline { font-size: 13px; color: var(--faint); letter-spacing: 0.04em; }

/* ===== ヒーロー ===== */
.hero {
  padding: 52px 0 44px;
  text-align: center;
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-jp);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: bold;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 14px;
}
.hero-title .accent { color: var(--brand); }
.hero-subtitle {
  font-size: 15px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

/* ヒーロー目盛りバンドプレビュー */
.hero-band-preview {
  max-width: 440px;
  margin: 0 auto 28px;
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 24px 20px;
  box-shadow: var(--shadow);
}
.hero-band-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0 4px;
}
.hero-band-track {
  height: 28px;
  background: var(--score-track);
  border-radius: 6px;
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.hero-band-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gain) 0%, var(--brand) 70%);
  width: 60%;
  opacity: 0.35;
}
.hero-band-label {
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  margin-top: 8px;
}

.btn-hero {
  display: inline-block;
  background: var(--brand);
  color: #FFFFFF;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: bold;
  padding: 14px 36px;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(108,43,217,0.3);
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-hero:hover, .btn-hero:focus {
  background: #5821BB;
  box-shadow: 0 6px 20px rgba(108,43,217,0.4);
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ===== セクション共通 ===== */
section.input-section, section.result-section-wrap {
  padding: 40px 0;
}
.section-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule);
}
.section-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.card {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ===== 決済手段チップ ===== */
.method-group { margin-bottom: 14px; }
.method-group-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.method-chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.method-chip {
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 20px;
  padding: 7px 16px;
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.method-chip:hover { border-color: var(--brand); }
.method-chip.is-active {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: bold;
}
.method-chip:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.method-display-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
}

/* ===== ジャンル行 ===== */
.genre-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.1s;
}
.genre-row:last-child { border-bottom: none; }
.genre-row.selected { background: rgba(108,43,217,0.03); border-radius: var(--radius-sm); }

.genre-row > :first-child { display: flex; align-items: center; gap: 12px; }
.genre-cb { accent-color: var(--brand); width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.genre-name { font-size: 15px; font-weight: 500; cursor: pointer; user-select: none; }

.genre-edit {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.genre-edit.hidden { display: none; }

.genre-monthly-label { font-size: 13px; color: var(--muted); }
.genre-monthly-input {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: bold;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  width: 140px;
  text-align: right;
  appearance: none;
  -moz-appearance: textfield;
}
.genre-monthly-input:focus { outline: 3px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.genre-monthly-input.invalid { border-color: #C0392B; background: #FFF5F5; }
.genre-monthly-unit { font-size: 14px; color: var(--muted); }
.genre-monthly-err {
  font-size: 12px;
  color: #C0392B;
  margin-top: 2px;
}
.genre-monthly-err.hidden { display: none; }

.genre-cur-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: block; }
.genre-cur-select { display: flex; gap: 8px; }
.cur-btn {
  flex: 1;
  padding: 8px 0;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cur-btn.is-active {
  background: var(--gain-light);
  border-color: var(--gain);
  color: #008070;
  font-weight: bold;
}
.cur-btn:focus-visible { outline: 3px solid var(--gain); outline-offset: 2px; }

/* ===== スティッキーバー ===== */
.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  border-top: 3px solid var(--brand);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(28,22,64,0.2);
}
.sticky-bar.hidden { display: none; }
.sticky-bar-info { display: flex; flex-direction: column; gap: 2px; }
.sticky-bar-count { font-size: 12px; color: var(--faint); }
.sticky-bar-total { font-family: var(--font-num); font-size: 17px; font-weight: bold; color: var(--faint); }
.sticky-bar-total span { color: #FFFFFF; }
#diagnose-btn {
  background: var(--brand);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(108,43,217,0.4);
  transition: background 0.12s;
  white-space: nowrap;
}
#diagnose-btn:hover:not(:disabled) { background: #5821BB; }
#diagnose-btn:disabled { background: #7060A8; cursor: not-allowed; opacity: 0.6; }
#diagnose-btn:focus-visible { outline: 3px solid var(--reward); outline-offset: 2px; }
body.sticky-active { padding-bottom: 72px; }

/* ===== 結果セクション ===== */
#result-section.hidden { display: none; }
#result-card.hidden { display: none; }
#result-null-msg {
  padding: 20px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  color: var(--brand);
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
}
#result-null-msg.hidden { display: none; }

/* ===== スコア目盛りバンド（signature）===== */
.score-band-container { margin-bottom: 28px; }
.score-band {
  position: relative;
  height: 56px;
  background: var(--score-track);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  overflow: visible;
  margin: 16px 0 28px;
}
.score-band-teal {
  position: absolute;
  left: 0; top: 0; height: 100%;
  background: var(--gain);
  opacity: 0.2;
  border-radius: 6px 0 0 6px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@media (prefers-reduced-motion: reduce) { .score-band-teal { transition: none; } }

.score-tick {
  position: absolute;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--rule);
  transform: translateX(-50%);
}
.score-tick-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.score-marker {
  position: absolute;
  top: auto;
  bottom: -8px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid var(--reward);
  transition: left 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@media (prefers-reduced-motion: reduce) { .score-marker { transition: none; } }

.score-band-curve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.score-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 36px;
}
.score-number {
  font-family: var(--font-num);
  font-size: 72px;
  font-weight: bold;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.score-suffix {
  font-family: var(--font-num);
  font-size: 24px;
  color: var(--muted);
  font-weight: bold;
}
.score-judge-box {
  margin-left: auto;
  padding: 6px 16px;
  border: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: bold;
  color: var(--brand);
  transform: rotate(-2deg);
  white-space: nowrap;
}
.score-band-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ===== 最適化シナリオセレクタ ===== */
.scenario-wrap { margin-bottom: 24px; }
.scenario-label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.scenario-label { font-size: 14px; font-weight: bold; color: var(--ink); }
.scenario-note { font-size: 12px; color: var(--muted); }
#scenario-selector { display: flex; gap: 8px; }
.scenario-btn {
  flex: 1;
  padding: 10px 0;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: bold;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.scenario-btn.is-active {
  background: var(--gain-light);
  border-color: var(--gain);
  color: #008070;
}
.scenario-btn:focus-visible { outline: 3px solid var(--gain); outline-offset: 2px; }

/* ===== 年間獲得余地 ===== */
.gain-card {
  background: var(--surface);
  border: 2px solid var(--gain);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.gain-label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.gain-amount {
  font-family: var(--font-num);
  font-size: 48px;
  font-weight: bold;
  color: var(--gain);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.gain-year { font-size: 18px; color: var(--muted); font-family: var(--font-jp); margin-left: 4px; }
.gain-disclaimer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}

/* ===== タイプ ===== */
.tier-card {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.tier-name {
  font-size: 20px;
  font-weight: bold;
  color: var(--brand);
  margin-bottom: 6px;
}
.tier-body { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ===== 伸びしろマップ ===== */
.stretch-map-container { margin-bottom: 20px; }
.stretch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.stretch-label {
  font-size: 13px;
  color: var(--ink);
  min-width: 110px;
  flex-shrink: 0;
}
.stretch-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--score-track);
  border-radius: 7px;
  overflow: hidden;
}
.stretch-bar {
  height: 100%;
  background: var(--gain);
  border-radius: 7px;
  min-width: 2px;
  transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@media (prefers-reduced-motion: reduce) { .stretch-bar { transition: none; } }

/* ===== 複利テーブル ===== */
.fv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 10px;
}
.fv-table th {
  background: var(--paper);
  border-bottom: 1.5px solid var(--rule);
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.fv-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.fv-table tr:last-child td { border-bottom: none; }
.td-muted { color: var(--muted); }
.td-fv { font-weight: bold; color: var(--brand); }
.fv-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ===== シェアカード ===== */
#share-card-preview {
  display: none;
  max-width: 100%;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.share-preview-wrap { margin-bottom: 16px; }
.share-preview-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.share-preview-img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.share-variant-chooser { margin-bottom: 16px; }
.share-variant-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.share-variant-preview {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  white-space: pre-wrap;
  margin-top: 8px;
  min-height: 60px;
}
.share-image-notice { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.share-image-hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

#share-panel { margin-top: 16px; }
#share-panel.hidden { display: none; }

.share-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.12s;
}
.share-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.share-btn.btn-primary { background: var(--brand); color: #FFFFFF; }
.share-btn.btn-primary:hover { opacity: 0.88; }
.share-btn.btn-secondary { background: var(--paper); border: 1.5px solid var(--rule); color: var(--ink); }
.share-btn.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.share-btn.btn-variant {
  display: inline-block;
  width: auto;
  padding: 6px 14px;
  margin-right: 6px;
  margin-bottom: 6px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.share-btn.btn-variant.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.share-btn.btn-x { background: #000000; color: #FFFFFF; }
.share-btn.btn-x:hover { opacity: 0.85; }
.share-btn.btn-line { background: #06C755; color: #FFFFFF; }
.share-btn.btn-line:hover { opacity: 0.88; }

/* ===== CTA（アフィリエイト）===== */
.cta-section { display: none; margin-bottom: 20px; }
.cta-heading { font-size: 16px; font-weight: bold; margin-bottom: 12px; color: var(--ink); }
.affi-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.affi-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
}
.ad-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.affi-link {
  font-size: 14px;
  color: var(--brand);
  text-decoration: underline;
  word-break: break-all;
}
.affi-note { font-size: 12px; color: var(--muted); }

/* ===== 相互送客 ===== */
#crosspromo { margin: 40px 0 20px; }
#crosspromo.hidden { display: none; }
.crosspromo-heading {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}
.promo-row {
  margin-bottom: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s;
}
.promo-row:hover { border-color: var(--brand); }
.promo-row-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
}
.promo-row-title { font-size: 15px; font-weight: bold; color: var(--ink); }
.promo-row-blurb { font-size: 13px; color: var(--muted); }

/* ===== フッタ ===== */
.site-footer {
  background: var(--ink);
  color: var(--faint);
  padding: 40px 0;
  margin-top: 60px;
  font-size: 13px;
  line-height: 1.7;
}
.site-footer h3 { font-size: 14px; color: #FFFFFF; margin-bottom: 10px; }
.site-footer p { margin-bottom: 8px; }
.site-footer a { color: var(--faint); text-decoration: underline; }
.site-footer a:hover { color: #FFFFFF; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ===== リトライボタン ===== */
#retry-btn {
  background: transparent;
  border: 1.5px solid var(--muted);
  border-radius: var(--radius);
  padding: 10px 24px;
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  margin-top: 16px;
}
#retry-btn:hover { border-color: var(--brand); color: var(--brand); }
#retry-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ===== 注記 ===== */
.rate-disclaimer {
  font-size: 12px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
  line-height: 1.6;
}

/* ===== スロット ===== */
#ad-slot-result { display: none; }
#list-slot { display: none; }
#paid-slot { display: none; }
.list-link-btn, .paid-link-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
}
.list-disclosure, .paid-disclosure, .paid-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 6px; }

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
  .score-number { font-size: 56px; }
  .gain-amount { font-size: 38px; }
  .genre-cur-select { flex-wrap: wrap; }
  .cur-btn { min-width: 60px; }
}
