/*
  道の駅TRIP 2.0 — 01 ホーム｜旅の扉
  実装用正本（Single Source of Truth）に100%忠実なレイアウト・サイズ・タイポグラフィ
  iPhone 390x844基準、スクロール不要の完璧な1枚絵
*/
.v2-home {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  background: #F6F4F0;
}

/* ---------- HERO / MAP (正本の美麗な鳥瞰旅情マップ) ---------- */
.v2-hero {
  position: relative;
  width: 100%;
  height: 378px;
  overflow: hidden;
  background: #091D3E;
}

#v2Map {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* 正本そのものの鳥瞰マップビジュアル (全景パノラマ・上端の空から下端まで自然に接続) */
.v2-hero-exact-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/hero-map-exact.png') center top / 100% auto no-repeat;
  z-index: 2;
  pointer-events: none;
}

/* 右側の縦書きコピー (目的地ピン右上・右端から適度に内側に配置) */
.v2-hero-copy {
  position: absolute;
  top: 54px;
  right: 20px;
  z-index: 4;
  writing-mode: vertical-rl;
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.55;
  letter-spacing: 0.16em;
  color: #FFFFFF;
  text-shadow:
    0 1px 3px rgba(9, 29, 62, 0.85),
    0 2px 8px rgba(9, 29, 62, 0.65),
    0 4px 14px rgba(9, 29, 62, 0.45);
  pointer-events: none;
  user-select: none;
}

.v2-copy-line {
  display: inline-block;
}
.v2-copy-line:first-child {
  margin-left: 6px;
}

/* ---------- JOURNEY CARD (正本の角丸フローティングカード: コンテンツに応じた自然な高さ) ---------- */
.v2-journey-card {
  position: relative;
  margin: -20px 14px 0 14px;
  height: auto;
  min-height: 0;
  z-index: 15;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 8px 8px 18px 8px;
  box-shadow: 0 10px 32px rgba(11, 42, 107, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
  color: var(--night);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 写真エリア: カードの端近くまで広がる迫力のワイドレイアウト */
.v2-photo-container {
  margin: 0 0 6px 0;
  flex: 0 0 auto;
}

.v2-photo {
  position: relative;
  width: 100%;
  height: 104px;
  border-radius: 16px;
  overflow: hidden;
  background: #E8E2D5;
}

.v2-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* カード本文 (正本の密度・文字サイズ・行間: 上品に凝縮) */
.v2-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 8px;
}

/* 「あと12kmだけ、寄り道しませんか？」 */
.v2-message {
  margin: 0 0 2px 0;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: #0B2A6B;
}

.v2-message .num {
  font-family: var(--font-en), var(--font-body);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* 「道の駅 うみの丘」 */
.v2-station-name {
  display: block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  color: #0B2A6B;
  margin: 1px 0 2px 0;
}

/* サブコピー：「海と空が出会う、絶景のやすらぎ。」 */
.v2-desc {
  margin: 0 0 4px 0;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: #556377;
  font-weight: 500;
  line-height: 1.32;
}

/* メタ情報：「🚗 あと12km ｜ ⏱ 約20分」 */
.v2-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0 6px 0;
}
.v2-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 12px;
  color: #0B2A6B;
  font-weight: 700;
}
.v2-meta-item svg {
  width: 14px;
  height: 14px;
  color: #0B2A6B;
  flex: 0 0 auto;
}
.v2-meta-divider {
  color: #C8D1DC;
  font-size: 12px;
}

/* 主CTA：「旅をはじめる →」 */
.v2-cta {
  pointer-events: auto;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #005AEB;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 90, 235, 0.3);
  transition: transform 0.15s ease, background-color 0.15s ease;
  margin-top: 2px;
}
.v2-cta svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.v2-cta:active {
  transform: scale(0.985);
  background: #004ecc;
}

/* サブアクション：「あとで」「別の旅を見る」 */
.v2-sub-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.v2-sub-btn {
  pointer-events: auto;
  flex: 1;
  height: 33px;
  border: 1px solid rgba(11, 42, 107, 0.09);
  background: #F6F4EE;
  color: #0B2A6B;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.v2-sub-btn svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: #0B2A6B;
}
.v2-sub-btn:active {
  background: rgba(11, 42, 107, 0.06);
}

/* ---------- BOTTOM NAVIGATION (Journey Card直後に通常フローで配置) ---------- */
.v2-bottom-nav {
  position: static;
  margin: 18px 0 0 0;
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 12px calc(8px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #FFFFFF;
  border-top: 1px solid #ECE8E0;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.03);
}

/* ============================================================
   OPENING SCREEN — 正本に完全一致の全画面演出
   ============================================================ */
.v2-opening {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: #091F4B;
  display: flex;
  flex-direction: column;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.v2-opening.is-hidden {
  display: none !important;
}

.v2-opening.is-fading-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* 各ステップ共通 */
.v2-opening-step {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.v2-opening-step.is-hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

/* STEP 1: Opening背景・画像 */
.v2-opening-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* STEP 1: CTA フェードインラッパー */
.v2-opening-cta-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(40px, env(safe-area-inset-bottom, 40px));
  display: flex;
  justify-content: center;
  padding: 0 24px;
  z-index: 10;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.v2-opening-cta-wrap.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* STEP 1: 主ボタン「旅をはじめる →」 */
.v2-btn-journey-start {
  background: rgba(255, 255, 255, 0.96);
  color: #005AEB;
  border: none;
  border-radius: 9999px;
  padding: 16px 36px;
  font-family: var(--font-body, "Noto Sans JP", sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 1px rgba(255, 255, 255, 0.8);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.v2-btn-journey-start:active {
  transform: scale(0.97);
  background: #FFFFFF;
}

/* STEP 2: 位置情報案内画面 (Openingの世界観を継承) */
.v2-location-guide-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 28px max(44px, env(safe-area-inset-bottom, 44px));
  background: radial-gradient(circle at 50% 28%, #173E84 0%, #0B2458 60%, #061536 100%);
  text-align: center;
  box-sizing: border-box;
}

.v2-location-guide-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
  margin-bottom: 24px;
  box-shadow: 0 0 24px rgba(96, 165, 250, 0.2);
}

.v2-location-guide-title {
  font-family: var(--font-display, "Shippori Mincho", serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin: 0 0 18px 0;
}

.v2-location-guide-body {
  font-family: var(--font-body, "Noto Sans JP", sans-serif);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
  margin: 0 0 40px 0;
}

.v2-location-guide-actions {
  width: 100%;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* 主CTA「現在地を使う →」 */
.v2-btn-use-location {
  width: 100%;
  background: #005AEB;
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 16px 24px;
  font-family: var(--font-body, "Noto Sans JP", sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 90, 235, 0.4), 0 0 1px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.v2-btn-use-location:active {
  transform: scale(0.97);
  background: #0045b5;
}

/* サブCTA「位置情報を使わず始める」 */
.v2-btn-skip-location {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-body, "Noto Sans JP", sans-serif);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 10px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.v2-btn-skip-location:active {
  color: #FFFFFF;
}

/* STEP 3: 完了フィードバック画面 */
.v2-opening-feedback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: radial-gradient(circle at 50% 35%, #173E84 0%, #0B2458 65%, #061536 100%);
  z-index: 20;
  transition: opacity 0.4s ease;
}

.v2-opening-feedback.is-hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.v2-opening-feedback-text {
  font-family: var(--font-display, "Shippori Mincho", serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.65;
  color: #FFFFFF;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  animation: v2GuideFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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


