/* ========================================
   お天気恋愛占い — style.css
   ======================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* カラーパレット */
  --c-primary: #ff6b9d;
  --c-primary-dark: #e0527e;
  --c-accent: #ffd166;
  --c-bg: #fff5f8;
  --c-text: #3a3a3a;
  --c-text-light: #777;
  --c-white: #ffffff;
  --c-card: #ffffff;
  --c-border: #ffe0ea;
  --c-star: #ffc107;
  --c-star-empty: #e0d6c0;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(255, 107, 157, .15);

  /* 天気テーマ（JS で body に data-weather を付与して切替） */
  --weather-gradient: linear-gradient(135deg, #ffe0ec 0%, #fff5f8 100%);
  --weather-emoji-size: 4rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--weather-gradient);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100dvh;
  transition: background .6s ease;
  overflow-x: hidden;
}

/* --- 天気テーマ --- */
body[data-weather="sunny"] {
  --weather-gradient: linear-gradient(135deg, #fff8e1 0%, #ffe0ec 100%);
}
body[data-weather="cloudy"] {
  --weather-gradient: linear-gradient(135deg, #e8eaf6 0%, #f3e5f5 100%);
}
body[data-weather="rain"] {
  --weather-gradient: linear-gradient(135deg, #e3f2fd 0%, #e8eaf6 100%);
}
body[data-weather="snow"] {
  --weather-gradient: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
}
body[data-weather="thunder"] {
  --weather-gradient: linear-gradient(135deg, #ede7f6 0%, #e8eaf6 100%);
}
body[data-weather="fog"] {
  --weather-gradient: linear-gradient(135deg, #eceff1 0%, #f5f5f5 100%);
}

/* --- Layout --- */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* --- Header --- */
.site-header {
  text-align: center;
  margin-bottom: 24px;
}

.site-header h1 {
  font-size: 1.35rem;
  color: var(--c-primary);
  line-height: 1.4;
}

.site-header .sub {
  font-size: .82rem;
  color: var(--c-text-light);
  margin-top: 4px;
}

/* --- Hero ビジュアル --- */
.hero-image-wrap {
  text-align: center;
  margin: 0 auto 16px;
  max-width: 420px;
  border-radius: 20px;
  /* overflow: hidden; */
  /* box-shadow: 0 8px 30px rgba(255, 107, 157, .18), 0 0 0 1px rgba(255, 107, 157, .1); */
  position: relative;
}

.hero-image-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .25), transparent);
  animation: shimmerSweep 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmerSweep {
  0%   { left: -100%; }
  50%  { left: 150%; }
  100% { left: 150%; }
}

.hero-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Hero バッジ */
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-badge-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-text);
  box-shadow: 0 2px 8px rgba(255, 107, 157, .08);
}

/* --- 天気カード --- */
.weather-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
  border: 1px solid var(--c-border);
}

.weather-card .weather-emoji {
  font-size: var(--weather-emoji-size);
  line-height: 1;
  display: block;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.weather-card .weather-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
}

.weather-card .weather-temp {
  font-size: .85rem;
  color: var(--c-text-light);
  margin-top: 4px;
}

.weather-card .weather-date {
  font-size: .78rem;
  color: var(--c-text-light);
  margin-top: 2px;
}

/* --- 明日の天気ミニ --- */
.tomorrow-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--c-border);
}

.tomorrow-card .tomorrow-emoji {
  font-size: 2rem;
}

.tomorrow-card .tomorrow-text {
  font-size: .88rem;
  color: var(--c-text);
}

.tomorrow-card .tomorrow-text strong {
  color: var(--c-primary);
}

/* --- セクション見出し --- */
.section-heading {
  font-size: 1.05rem;
  color: var(--c-primary-dark);
  margin-bottom: 12px;
  padding-left: 4px;
  border-left: 4px solid var(--c-primary);
  padding-left: 10px;
}

/* --- フォーム --- */
.fortune-form {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin-bottom: 24px;
  border: 1px solid var(--c-border);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--c-border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
  background: var(--c-bg);
}

.form-group input:focus {
  border-color: var(--c-primary);
}

.btn-fortune {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--c-primary), #ff8fab);
  color: var(--c-white);
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(255, 107, 157, .35);
}

.btn-fortune:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, .45);
}

.btn-fortune:active {
  transform: translateY(0);
}

.btn-fortune:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- 結果カード --- */
.result-card {
  display: none;
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 24px;
  border: 2px solid var(--c-primary);
  animation: fadeInUp .5s ease;
}

.result-card.show {
  display: block;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card .result-title {
  font-size: 1.1rem;
  color: var(--c-primary-dark);
  margin-bottom: 8px;
}

.result-card .result-names {
  font-size: .9rem;
  color: var(--c-text-light);
  margin-bottom: 12px;
}

.result-card .stars {
  font-size: 1.8rem;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.result-card .stars .star-filled {
  color: var(--c-star);
}

.result-card .stars .star-empty {
  color: var(--c-star-empty);
}

.result-card .result-level {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 16px;
}

.result-card .result-action {
  background: var(--c-bg);
  border-radius: 12px;
  padding: 16px;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--c-text);
  text-align: left;
}

.result-card .result-action .action-label {
  font-weight: 700;
  color: var(--c-primary-dark);
  display: block;
  margin-bottom: 6px;
  font-size: .82rem;
}

/* --- SNS共有ボタン --- */
.share-buttons {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--c-border);
}

.share-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 12px;
}

.share-btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--c-white);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  text-decoration: none;
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: .9;
}

.share-btn:active {
  transform: translateY(0);
}

.share-btn svg {
  flex-shrink: 0;
}

.share-btn--line {
  background: #06C755;
  box-shadow: 0 3px 10px rgba(6, 199, 85, .3);
}

.share-btn--x {
  background: #000000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

.share-btn--threads {
  background: #000000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

/* --- 完了メッセージ --- */
.done-message {
  display: none;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: .88rem;
  color: #856404;
  text-align: center;
  margin-bottom: 24px;
}

.done-message.show {
  display: block;
}

/* --- 履歴ページ --- */
.history-list {
  list-style: none;
}

.history-item {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--c-border);
}

.history-item .history-date {
  font-size: .78rem;
  color: var(--c-text-light);
}

.history-item .history-names {
  font-size: .9rem;
  font-weight: 600;
  margin: 4px 0;
}

.history-item .history-stars {
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.history-item .history-stars .star-filled {
  color: var(--c-star);
}

.history-item .history-stars .star-empty {
  color: var(--c-star-empty);
}

.history-item .history-action {
  font-size: .82rem;
  color: var(--c-text-light);
  margin-top: 6px;
}

.history-empty {
  text-align: center;
  color: var(--c-text-light);
  padding: 40px 0;
  font-size: .9rem;
}

/* --- ナビリンク --- */
.nav-links {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 24px;
}

.nav-links a {
  color: var(--c-primary);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: opacity .2s;
}

.nav-links a:hover {
  opacity: .7;
}

/* --- SEO導入テキスト --- */
.intro-section {
  margin-bottom: 20px;
}

.intro-text {
  font-size: .88rem;
  line-height: 1.8;
  color: var(--c-text);
  margin-bottom: 12px;
}

.intro-text strong {
  color: var(--c-primary-dark);
}

/* --- フッター --- */
.site-footer {
  text-align: center;
  font-size: .75rem;
  color: var(--c-text-light);
  padding: 20px 0 28px;
  border-top: 1px solid var(--c-border);
  margin-top: 16px;
}

.site-footer .footer-disclaimer {
  font-size: .78rem;
  line-height: 1.6;
  color: var(--c-text-light);
  margin-bottom: 8px;
}

.site-footer .footer-update {
  font-size: .72rem;
  color: var(--c-text-light);
  margin-bottom: 8px;
}

.site-footer .footer-credit {
  font-size: .72rem;
  margin-bottom: 10px;
}

.site-footer .footer-credit a {
  color: var(--c-primary);
  text-decoration: none;
}

.site-footer .footer-credit a:hover {
  text-decoration: underline;
}

.footer-links {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--c-primary);
  text-decoration: none;
  font-size: .75rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-sep {
  margin: 0 6px;
  color: var(--c-border);
}

.site-footer .footer-copy {
  font-size: .7rem;
  color: #aaa;
}

/* --- FAQセクション --- */
.faq-section {
  margin-bottom: 24px;
}

.faq-item {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-item summary {
  padding: 14px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '＋';
  font-size: 1rem;
  color: var(--c-primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform .2s;
}

.faq-item[open] summary::after {
  content: '－';
}

.faq-item .faq-a {
  padding: 0 16px 14px;
  font-size: .82rem;
  line-height: 1.7;
  color: var(--c-text-light);
}

/* --- ローディング --- */
.loading-spinner {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.loading-spinner.show {
  display: block;
}

.loading-spinner::after {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- ユーティリティ --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* --- AdSense 広告ラップ --- */
.adsense-wrap {
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(255, 107, 157, 0.2);
  border-radius: 8px;
  text-align: center;
  padding: 12px;
  margin: 28px 0;
  font-size: 11px;
  color: var(--c-text-light);
  letter-spacing: 1px;
  min-height: 100px;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.adsense-wrap ins {
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden;
}

/* --- レスポンシブ微調整 --- */
@media (min-width: 600px) {
  .container {
    padding: 32px 24px 48px;
  }
  .site-header h1 {
    font-size: 1.5rem;
  }
}
