/* fortune-uranai.css  -  モーダル3ステップ版 */

:root {
  --fu-accent: #a35307;
  --fu-pink: #eb6071;
  --fu-green: #22c55e;
  --fu-border: rgba(0, 0, 0, 0.12);
  --fu-muted: #666;
  --fu-card: #fff;
  --fu-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* === ランチャー（最初はボタンだけ） === */
.fu-launch {
  max-width: 980px;
  margin: 18px auto 22px auto;
  padding: 14px 14px 16px 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  position: relative;
  z-index: 1;
}

.fu-launch-title {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  font-weight: 900;
  color: #444;
}

.fu-launch-desc {
  margin: 0 0 12px 0;
  color: var(--fu-muted);
  font-size: .95em;
  line-height: 1.6;
}

.fu-launch-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

/* ランチャーの「オススメ店を占う」だけを大きくする（他の primary ボタンには影響させない） */
.fu-launch .fu-btn.primary {
  padding: 14px 28px;
  font-size: 1.05em;
  min-height: 48px;
  min-width: 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 700px) {

  /* スマホでは押しやすいように全幅 */
  .fu-launch .fu-btn.primary {
    width: 100%;
    min-width: 0;
  }

  .fu-launch-actions {
    width: 100%;
  }
}

.fu-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .06s ease, opacity .2s ease;
  user-select: none;
}

.fu-btn:active {
  transform: translateY(1px);
}

.fu-btn.primary {
  background: var(--fu-pink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(235, 96, 113, 0.28);
}

.fu-btn.ghost {
  background: rgba(255, 255, 255, 0.92);
  color: #444;
  border: 1px solid var(--fu-border);
  box-shadow: none;
}

.fu-btn.secondary {
  background: var(--fu-green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.25);
}

.fu-inline-note {
  font-size: .82em;
  color: #777;
}

/* === モーダル === */
.fu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 9999;
}

.fu-overlay.is-open {
  display: flex;
}

.fu-modal {
  width: min(920px, 96vw);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 16px;
  box-shadow: var(--fu-shadow);
  text-align: left;
}

.fu-modal-inner {
  padding: 14px 14px 16px 14px;
}

.fu-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 0 14px;
}

.fu-modal-title {
  margin: 0;
  font-size: 1.15em;
  font-weight: 900;
  color: #333;
}

.fu-close {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.fu-close:active {
  transform: translateY(1px);
}

/* === ステップ表示（安心要素） === */
.fu-step-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 10px 0;
}

.fu-step-label {
  font-weight: 900;
  color: #444;
}

.fu-step-remaining {
  font-size: .88em;
  color: #666;
}

.fu-progress {
  height: 10px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 20px 0;
  /* ★ステップバーの下に20px余白 */
}

.fu-progress>div {
  height: 100%;
  width: 0%;
  background: rgba(163, 83, 7, 0.72);
  transition: width .2s ease;
}

/* === 入力フォーム === */
.fu-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: end;
}

.fu-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fu-row label {
  font-size: .92em;
  font-weight: 900;
  color: #444;
}

.fu-row .hint {
  margin-top: -2px;
  font-size: .78em;
  color: #777;
}

.fu-row input,
.fu-row select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  font-size: 1em;
  color: #333;
  outline: none;
}

.fu-row input:focus,
.fu-row select:focus {
  border-color: rgba(163, 83, 7, 0.55);
  box-shadow: 0 0 0 3px rgba(163, 83, 7, 0.12);
}

.fu-error {
  grid-column: 1 / -1;
  color: #b91c1c;
  font-weight: 800;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.16);
  padding: 10px 12px;
  border-radius: 12px;
  display: none;
}

.fu-error.is-show {
  display: block;
}

.fu-nav {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fu-nav-left {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Stepパネル */
.fu-step {
  display: none;
}

.fu-step.is-active {
  display: block;
}

/* 新規開拓の除外 */
.fu-exclude {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
}

.fu-exclude-title {
  font-weight: 900;
  color: #444;
  margin-bottom: 6px;
  font-size: .95em;
}

.fu-exclude-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.fu-exclude-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92em;
  color: #444;
}

/* 結果カード */
.fu-result {
  margin-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 14px;
}

.fu-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  background: var(--fu-card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
}

.fu-card img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  display: block;
  background: #fafafa;
}

.fu-card-body {
  padding: 12px 12px 12px 0;
}

.fu-card-title {
  margin: 10px 0 8px 0;
  font-weight: 900;
  font-size: 1.15em;
  color: #2f2f2f;
}

/* 店名の下に出すサブ情報（イメージカラー等） */
.fu-card-sub {
  margin: -4px 0 10px 0;
  /* 店名に近づける */
  font-size: .86em;
  color: #666;
  font-weight: 800;
  line-height: 1.4;
}

.fu-pill {
  display: inline-block;
  font-size: .82em;
  font-weight: 900;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(163, 83, 7, 0.12);
  color: var(--fu-accent);
  margin-right: 6px;
  margin-bottom: 6px;
}

.fu-reasons {
  margin: 8px 0 10px 0;
  color: #444;
  font-size: .95em;
  line-height: 1.6;
}

.fu-reasons ul {
  margin: 6px 0 0 1.2em;
}

@media (max-width: 700px) {
  .fu-form {
    grid-template-columns: 1fr;
  }

  .fu-card {
    grid-template-columns: 1fr;
  }

  .fu-card-body {
    padding: 12px;
  }

  .fu-exclude-grid {
    grid-template-columns: 1fr;
  }

  .fu-btn {
    margin-top: 15px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .fu-progress>div {
    transition: none !important;
  }
}

/* === 選択内容サマリー（モーダル上部） === */
.fu-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.fu-summary-title {
  font-weight: 900;
  color: #444;
  font-size: .92em;
  margin-bottom: 6px;
}

.fu-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fu-sum-pill {
  display: inline-block;
  font-size: .82em;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(163, 83, 7, 0.10);
  color: #6b3a00;
  border: 1px solid rgba(163, 83, 7, 0.18);
  white-space: nowrap;
}

/* === aタグをボタンとして扱う（結果モーダルで使う） === */
a.fu-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

/* === 結果モーダルの“ジワッ”表示 === */
.fu-modal.fu-appear {
  animation: fuJiwaIn .45s ease both;
}

@keyframes fuJiwaIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fu-modal.fu-appear {
    animation: none !important;
  }
}


/* =========================================================
   お店カード登場：ウルトラマン風（小→大 + くるくる回転）
   - JSは変更不要（#fuResultBody 内の .fu-appear だけに適用）
   ========================================================= */
#fuResultModal .fu-modal-inner {
  perspective: 900px;
}

/* 結果ボディ内の .fu-appear だけを“くるくる登場”に */
#fuResultBody .fu-appear .fu-card {
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  /* 回転はゆるやかに：時間を伸ばす */
  animation: fuUltraCardIn 1.35s cubic-bezier(.12, .9, .18, 1) both;
}

/* ちらつき対策（3D回転時） */
#fuResultBody .fu-appear .fu-card {
  backface-visibility: hidden;
}

@keyframes fuUltraCardIn {
  0% {
    opacity: 0;
    /* 回転角を減らして“ゆるい回転”に */
    transform: translateY(24px) translateZ(-180px) scale(0.12) rotateZ(-540deg) rotateX(35deg);
  }

  65% {
    opacity: 1;
    /* ちょいオーバーシュートは残す（気持ち良さ） */
    transform: translateY(0) translateZ(0) scale(1.03) rotateZ(10deg) rotateX(0deg);
  }

  100% {
    opacity: 1;
    transform: translateY(0) translateZ(0) scale(1) rotateZ(0deg) rotateX(0deg);
  }
}

/* === 結果モーダル内：占い中ローディング === */
.fu-loading {
  margin-top: 12px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.fu-loading-title {
  font-weight: 900;
  color: #444;
  margin-bottom: 10px;
}

.fu-shimmer {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.06),
      rgba(0, 0, 0, 0.12),
      rgba(0, 0, 0, 0.06));
  background-size: 200% 100%;
  animation: fuShimmer 1.1s linear infinite;
}

@keyframes fuShimmer {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fu-shimmer {
    animation: none !important;
  }
}

/* カード内ボタン（結果モーダル） */
.fu-card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .fu-card-actions .fu-btn {
    width: 100%;
  }
}

/* =========================================================
   モーダル内の「次へ」「占う」を大きく（押しやすく）
   - 影響範囲をID指定で限定
   ========================================================= */
#fuNext1,
#fuNext2,
#fuDo {
  padding: 14px 28px;
  font-size: 1.08em;
  min-height: 52px;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* スマホ：戻る＋次へ（占う）を横並びにする */
@media (max-width: 700px) {

  /* 左右2ボタンを1行に固定（折り返ししない） */
  .fu-nav-left {
    flex-wrap: nowrap;
  }

  /* 「次へ」「占う」：全幅にしないで半分 */
  #fuNext2,
  #fuDo {
    width: 50%;
    min-width: 0;
    flex: 1 1 0;
  }

  /* 「戻る」も同じ幅に（見た目を揃える） */
  #fuBack2,
  #fuBack3 {
    width: 50%;
    min-width: 0;
    flex: 1 1 0;
  }

  /* 余白がきつい時の保険（お好みで） */
  #fuBack2,
  #fuBack3,
  #fuNext2,
  #fuDo {
    padding: 12px 14px;
    font-size: 1.02em;
  }
}


/* =========================================================
   ★入力フォームのはみ出し/被り対策（最重要）
   - width:100% + padding/border で列を超える問題を潰す
   - grid子要素が内容幅で縮まない問題を潰す
   ========================================================= */

/* モーダル内だけ border-box にする（サイト全体へ影響させない） */
.fu-overlay,
.fu-overlay * {
  box-sizing: border-box;
}

/* 2カラムでも“縮める”ことを許可（min-width:auto 対策） */
.fu-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* グリッド子要素が内容幅で膨らまないように */
.fu-row {
  min-width: 0;
}

/* input/select が列幅からはみ出ないように */
.fu-row input,
.fu-row select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
}

/* 念のため：横スクロールバーを出さない（縦は維持） */
.fu-modal {
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

/* 除外チェックの店名が長いときに横にはみ出ないように（保険） */
.fu-exclude-grid label {
  min-width: 0;
}

.fu-exclude-grid label span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   ★占い演出モーダル（中央テキスト + 水晶玉くるくる）
   - 結果モーダルの上に重ねて表示
   ========================================================= */
.fu-fx {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 10020;
  /* 結果モーダルより前面 */
}

.fu-fx.is-show {
  display: flex;
}

.fu-fx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.fu-fx-panel {
  position: relative;
  width: min(560px, 92vw);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: var(--fu-shadow);
  padding: 18px 16px;
  text-align: center;
}

.fu-fx-title {
  margin: 0 0 10px 0;
  font-weight: 900;
  color: #333;
  font-size: 1.05em;
  line-height: 1.6;
  white-space: pre-line;
  /* \n を改行として表示 */
}

.fu-fx-sub {
  margin: 0 0 14px 0;
  color: #666;
  font-size: .9em;
}

.fu-crystal {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(235, 96, 113, 0.14);
  border: 1px solid rgba(235, 96, 113, 0.22);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.fu-crystal svg {
  width: 34px;
  height: 34px;
  display: block;
  transform-origin: 50% 50%;
  animation: fuSpin 1.0s linear infinite;
}

@keyframes fuSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fu-crystal svg {
    animation: none !important;
  }
}

.fu-birth-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fu-birth-row select {
  min-width: 92px;
  padding: 10px 12px;
}

.fu-birth-sep {
  opacity: .7;
  font-size: .95em;
}

/* Step3だけ：左右カラムを上揃え（生年月日側が高くても名前が下がらない） */
#fuStep3 .fu-form {
  align-items: start;     /* ← end を上書き */
}

#fuStep3 .fu-row {
  align-self: start;      /* ← 念のため */
}

@media (max-width: 700px) {
  #fuStep3 .fu-birth-row select {
    min-width: 72px;   /* 92px → 小さめにして折り返しを減らす */
    padding: 10px 10px;
  }
}

/* iOS12背景スクロール防止：bodyを固定する */
body.fu-scroll-lock {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden; /* 念のため */
}
