/* =============================================
   俺もNISAシミュレーター - style.css
   俺もシリーズ / iiseikatu.com
============================================= */

:root {
  --forest:      #183D2C;
  --forest-mid:  #1E5038;
  --green:       #3ECF82;
  --green-light: #62E8A4;
  --mint:        #F0FDF8;
  --mint-dark:   #C2EDD8;
  --blue:        #4A90E2;
  --blue-light:  #7DB8F7;
  --gold:        #D4AF37;
  --gold-light:  #F0D060;
  --charcoal:    #1C1C1E;
  --gray:        #6B7280;
  --gray-light:  #E5E7EB;
  --bg:          #F4FDF9;
  --white:       #FFFFFF;
  --danger:      #E74C3C;
}

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

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--charcoal);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ======= ヘッダー ======= */
.header { background: #F0F0F0; text-align: center; line-height: 0; }
.header-img-link { display: block; max-width: 480px; margin: 0 auto; }
.header-img { width: 100%; height: auto; display: block; }

/* ======= コンテナ ======= */
.container { max-width: 480px; margin: 0 auto; padding: 0 12px 80px; }

/* ======= カード ======= */
.card {
  background: var(--white);
  border-radius: 18px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-light);
}

/* ======= 入力エリア ======= */
.input-row { margin-bottom: 20px; }
.input-row:last-child { margin-bottom: 0; }

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.input-label-text { font-size: 13px; font-weight: 500; color: var(--charcoal); }
.input-label-value { font-size: 22px; font-weight: 900; color: var(--forest); line-height: 1; }
.input-label-value .unit { font-size: 12px; font-weight: 500; color: var(--gray); margin-left: 2px; }

/* ======= レンジスライダー ======= */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--green) 0%, var(--green) var(--pct, 50%),
    var(--mint-dark) var(--pct, 50%), var(--mint-dark) 100%
  );
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--green);
  box-shadow: 0 2px 8px rgba(62,207,130,0.35);
  transition: box-shadow 0.15s;
}
input[type="range"]:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(62,207,130,0.2);
}

/* ======= タブボタン ======= */
.tab-group { display: grid; gap: 6px; }
.tab-group.col-4 { grid-template-columns: repeat(4, 1fr); }
.tab-group.col-5 { grid-template-columns: repeat(5, 1fr); }

.tab-btn {
  background: var(--mint);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 8px 4px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
}
.tab-btn .tab-sub { display: block; font-size: 9px; font-weight: 500; margin-top: 2px; opacity: 0.75; }
.tab-btn.active { background: var(--forest); color: var(--white); border-color: var(--forest); }
.tab-btn.active .tab-sub { opacity: 0.65; }

/* ======= 年率バッジ ======= */
.rate-badge {
  display: inline-flex;
  align-items: center;
  background: var(--mint);
  border: 1px solid var(--mint-dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--forest);
  margin-top: 6px;
}
.rate-badge::before { content: '📈'; margin-right: 4px; font-size: 12px; }

/* ======= 結果ヒーロー ======= */
.result-hero {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
  border-radius: 14px;
  padding: 18px 16px;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}
.result-hero::after {
  content: '';
  position: absolute;
  bottom: -24px; right: -24px;
  width: 110px; height: 110px;
  background: var(--green-light);
  border-radius: 50%;
  opacity: 0.12;
}
.result-hero-label { font-size: 11px; font-weight: 700; color: var(--green-light); letter-spacing: 0.08em; margin-bottom: 4px; }
.result-hero-value { font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
.result-hero-unit { font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.6); margin-left: 2px; }
.result-hero-real { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 6px; }
.result-hero-real strong { color: rgba(255,255,255,0.65); }

.result-sub-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.result-sub { background: var(--mint); border-radius: 12px; padding: 11px 8px; text-align: center; }
.result-sub-label { font-size: 10px; color: var(--gray); margin-bottom: 4px; white-space: nowrap; }
.result-sub-value { font-size: 15px; font-weight: 900; color: var(--forest); }
.result-sub-value .unit { font-size: 10px; font-weight: 500; }
.result-sub.highlight .result-sub-value { color: var(--green); }

/* ======= チャート凡例 ======= */
.chart-legend { display: flex; gap: 14px; margin-bottom: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--gray); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.principal { background: var(--blue); }      /* 青 = 投資元本 */
.legend-dot.profit    { background: var(--green); }     /* 緑 = 運用益   */

.chart-wrap { position: relative; height: 195px; }

/* ======= マイルストーン ======= */
.milestone-list { display: flex; flex-direction: column; }
.milestone-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-light);
  opacity: 0.3;
  transition: opacity 0.45s;
}
.milestone-item:last-child { border-bottom: none; }
.milestone-item.reached { opacity: 1; }

.milestone-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--mint-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  transition: background 0.45s, box-shadow 0.45s;
}
.milestone-item.reached .milestone-icon {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, #A8870E 100%);
  box-shadow: 0 2px 8px rgba(212,175,55,0.45);
}
.milestone-body { flex: 1; }
.milestone-name { font-size: 13px; font-weight: 700; color: var(--charcoal); }
.milestone-age { font-size: 11px; color: var(--gray); margin-top: 1px; }
.milestone-age strong { font-size: 17px; font-weight: 900; color: var(--green); }

/* ======= 広告エリア（PR / ネイティブアド）======= */
.ad-card { margin-top: 12px; }

.ad-card-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ad-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray);
  background: var(--gray-light);
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.08em;
}

.ad-context {
  font-size: 11px;
  color: var(--gray);
  font-weight: 500;
}

.ad-link-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  padding: 2px;
  margin: -2px;
  transition: background 0.15s ease, transform 0.1s;
}

.ad-link-block:active {
  background: var(--mint);
  transform: scale(0.99);
}

.ad-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--green) 0%, var(--forest-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  box-shadow: 0 3px 10px rgba(62,207,130,0.3);
}

.ad-content { flex: 1; min-width: 0; }

.ad-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.ad-desc {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

.ad-cta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  margin-top: 6px;
}

.ad-arrow { color: var(--gray-light); font-size: 16px; flex-shrink: 0; }

/* ======= SEOリンクカード ======= */
.seo-links-card { margin-top: 12px; }

.seo-group { margin-bottom: 14px; }
.seo-group:last-child { margin-bottom: 0; }

.seo-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.seo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seo-chip {
  display: inline-block;
  padding: 5px 12px;
  background: var(--mint);
  border: 1.5px solid var(--mint-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.seo-chip:hover {
  background: var(--mint-dark);
  border-color: var(--green);
  transform: translateY(-1px);
}

/* 人気の組み合わせチップ：ゴールドアクセント */
.seo-chip-combo {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border-color: #D4AF37;
  color: #92400E;
}
.seo-chip-combo:hover {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-color: #B45309;
}

/* 動的リンク（別商品で試す）が空の場合は非表示 */
#relatedProductLinks:empty + .seo-group-label,
.seo-group:has(#relatedProductLinks:empty) { display: none; }

/* ======= シェアバー ======= */
.share-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 0 0 4px;
}

.share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.share-btn:active { opacity: 0.8; transform: scale(0.97); }

.share-btn-icon { font-size: 16px; line-height: 1; }

/* X（旧Twitter） */
.share-x {
  background: #000;
  color: #fff;
}
.share-x svg { width: 16px; height: 16px; fill: #fff; flex-shrink: 0; }

/* URLコピー */
.share-copy {
  background: var(--mint);
  color: var(--forest);
  border: 1.5px solid var(--mint-dark);
}
.share-copy.copied {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ======= デルタポップアップ ======= */
.delta-popup {
  position: fixed;
  top: 44%; left: 50%;
  transform: translate(-50%,-50%) scale(0.75);
  background: var(--forest);
  color: var(--green-light);
  padding: 9px 20px;
  border-radius: 40px;
  font-size: 20px; font-weight: 900;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  border: 1.5px solid rgba(98,232,164,0.25);
  white-space: nowrap;
}
.delta-popup.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.delta-popup.neg  { color: #FF7E7E; }

/* ======= CTAバナー ======= */
.cta-banner {
  background: linear-gradient(135deg,#1a1a2e 0%,#16213e 100%);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.cta-banner:active { opacity: 0.8; }
.cta-icon   { font-size: 28px; flex-shrink: 0; }
.cta-text   { flex: 1; }
.cta-title  { color: white; font-size: 13px; font-weight: 700; line-height: 1.3; }
.cta-sub    { color: rgba(255,255,255,0.45); font-size: 11px; margin-top: 2px; }
.cta-arrow  { color: rgba(255,255,255,0.3); font-size: 20px; font-weight: 300; }
.cta-banner-okuri { background: linear-gradient(135deg,#2C1B47 0%,#3D1F6B 100%); }

/* ======= フッターナビ ======= */
.footer-nav {
  display: flex; justify-content: center; gap: 24px;
  margin-top: 24px; padding: 0 8px;
}
.footer-nav-link {
  font-size: 12px; font-weight: 700; color: var(--forest);
  text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid var(--mint-dark);
  border-radius: 20px;
  background: var(--white);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.footer-nav-link:hover { background: var(--mint); border-color: var(--green); }

/* ======= 免責・コピーライト ======= */
.disclaimer {
  font-size: 10px; color: var(--gray);
  line-height: 1.8; text-align: center;
  padding: 14px 8px 8px;
}
.copyright {
  font-size: 10px; color: var(--gray);
  text-align: center;
  padding: 0 8px 20px;
  opacity: 0.7;
}
