:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Meiryo", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ヘッダー */
.header {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* 画面切り替え */
.screen {
  display: none;
  padding: 20px;
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

.screen.active {
  display: flex;
}

.hero-badge {
  display: inline-block;
  align-self: flex-start;
  background: #ecfdf5;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9999px;
}

.main-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

/* カード */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* コース一覧 */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-card {
  border: 2px solid var(--border);
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.course-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.course-card.selected {
  border: 2px solid var(--primary);
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.mountain-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.badge-nature {
  background: #0284c7 !important;
}

.course-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.course-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* 入力インライン */
.input-inline {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.input-inline input {
  font-size: 28px;
  font-weight: 800;
  width: 100px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: right;
  outline: none;
}

.input-inline input:focus {
  border-color: var(--primary);
}

.unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
}

.note {
  font-size: 12px;
  color: var(--text-muted);
}

/* パートナー選択 */
.partner-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.partner-option input {
  display: none;
}

.partner-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.partner-option input:checked + .partner-card {
  border-color: var(--primary);
  background: #f0fdf4;
}

.partner-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.partner-name {
  font-size: 14px;
  font-weight: 700;
}

.partner-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* オフライン保存カード */
.offline-card {
  border: 1.5px dashed #cbd5e1;
  background: #fcfcfd;
}

.offline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.offline-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--text-muted);
}

.offline-badge.ready {
  background: #ecfdf5;
  color: var(--primary-dark);
}

.offline-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease-out;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ボタン群 */
.btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

.btn-outline {
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary-dark);
}

.bottom-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 登山中画面 */
.walking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-indicator {
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

.status-box {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  border: 1px solid var(--border);
}

.cal-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
}

.cal-number {
  font-size: 48px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
}

.cal-unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
}

.cal-equivalent {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* 相棒ふきだしカード */
.buddy-bubble-card {
  display: flex;
  gap: 12px;
  background: #f0fdf4;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  align-items: center;
}

.buddy-avatar {
  font-size: 36px;
  background: #fff;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.buddy-content {
  flex: 1;
}

.buddy-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.buddy-speech {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

/* プログレス */
/* ナビゲーション ビュータブ */
.nav-view-tabs {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.nav-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-view-content {
  display: flex;
  flex-direction: column;
}

/* 路線図・タイムラインビュー */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 4px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 8px;
}

.timeline-item.passed {
  color: #10b981;
}

.timeline-item.current {
  background: #ecfdf5;
  color: var(--primary-dark);
  font-weight: 800;
}

.timeline-bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #64748b;
}

.timeline-item.passed .timeline-bullet {
  background: #10b981;
  color: #fff;
}

.timeline-item.current .timeline-bullet {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.timeline-name {
  flex: 1;
}

.timeline-status {
  font-size: 11px;
}

/* 地図コンテナ */
.hike-map-container {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  border: 1px solid var(--border);
  z-index: 1;
}

.map-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.nav-next-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-distance-badge {
  background: #ecfdf5;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
}

.nav-next-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.gps-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.gps-dot {
  font-size: 10px;
  color: #94a3b8;
}

.gps-dot.active {
  color: var(--primary);
}

.nav-next-name {
  font-size: 18px;
  font-weight: 800;
}

.nav-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

.nav-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.walking-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

/* リザルト画面 */
.finish-badge {
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

.result-card {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 2px solid var(--primary);
  text-align: center;
}

.res-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.res-cal {
  font-size: 52px;
  font-weight: 900;
  color: var(--accent);
}

.res-unit {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-muted);
}

.res-praise {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

.res-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.res-val {
  font-size: 16px;
  font-weight: 800;
}

/* スポットリスト */
.spots-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.spot-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.spot-info {
  flex: 1;
  padding-right: 10px;
  min-width: 0;
}

.spot-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spot-name .pixel-icon {
  flex-shrink: 0;
}

.spot-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.spot-action-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 8px;
  background: #10b981;
  color: #ffffff;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 #059669;
}

.spot-action-btn:hover {
  background: #059669;
}

.audio-diag {
  display: none !important;
}

.footer-credit {
  margin-top: auto;
  padding: 16px 20px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* 進行中セッションの再開カード（オートセーブ復元） */
.resume-card {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 0 #d97706;
  animation: pulseResume 2s infinite alternate;
}

@keyframes pulseResume {
  0% { transform: translateY(0); }
  100% { transform: translateY(-2px); }
}

.resume-badge {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.5px;
}

.resume-title {
  font-size: 16px;
  font-weight: 900;
  color: #78350f;
}

.resume-meta {
  font-size: 12px;
  color: #92400e;
  font-weight: 600;
}

.resume-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

/* =========================================================
   ドット絵・レトロゲーム風 登山ナビUI（Hopo Pixel Style）
========================================================= */

/* 登山画面アクティブ時は共通Webヘッダーおよびフッタークレジットを自動非表示・背景一体化 */
body:has(#screen-walking.active) {
  background-color: #0f281e;
}

#app:has(#screen-walking.active) {
  background: #143526 !important;
  box-shadow: none;
}

#app:has(#screen-walking.active) > .header,
#app:has(#screen-walking.active) > .footer-credit {
  display: none !important;
}

.screen-pixel {
  padding: 0 !important;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 45%, #f0fdf4 100%);
  color: #0f172a;
  font-family: inherit;
  min-height: 100vh;
  width: 100%;
}

.screen-pixel:not(.active) {
  display: none !important;
}

.screen-pixel.active {
  display: flex !important;
  flex-direction: column;
}

/* ピクセルアイコン共通定義 */
.pixel-icon {
  display: inline-block;
  vertical-align: -2px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 16px;
  height: 16px;
}

.pixel-icon-lg {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}

/* トップバー（ホーム画面と統一感のあるクリーンな白ヘッダー） */
.pixel-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #ffffff;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  gap: 4px;
}

.pixel-top-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pixel-logo {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #10b981;
  white-space: nowrap;
}

.pixel-top-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pixel-btn-sim {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.pixel-btn-sim:hover {
  background: #e2e8f0;
}

.pixel-top-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pixel-gps-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: #ecfdf5;
  padding: 4px 8px;
  border-radius: 999px;
  color: #047857;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
  max-width: 145px;
  overflow: hidden;
}

.pixel-gps-badge #gps-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pixel-gps-badge .gps-dot {
  color: #34d399;
  font-size: 9px;
}

/* ① 最優先カード: 次の目的地 & 残り距離（屋外高コントラスト白カード） */
.pixel-target-card {
  margin: 10px 14px 6px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 10px 14px 12px 14px;
  position: relative;
}

.target-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.target-card-pin {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pin-label {
  font-size: 12px;
  font-weight: 700;
  color: #e11d48;
}

.target-spot-count {
  font-size: 11px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

.target-spot-name {
  font-size: 19px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.5px;
  line-height: 1.3;
  margin: 2px 0 6px 0;
}

.target-divider {
  border-bottom: 2px dashed #cbd5e1;
  margin: 4px 0 8px 0;
}

.target-distance-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.dist-prefix {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
}

.dist-number {
  font-family: 'DotGothic16', monospace, sans-serif;
  font-size: 42px;
  font-weight: 900;
  color: #059669;
  letter-spacing: -1px;
  line-height: 1;
}

.dist-unit {
  font-size: 20px;
  font-weight: 800;
  color: #047857;
}

/* ドット絵プログレスバー */
.pixel-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pixel-progress-track {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.pixel-progress-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.4s steps(10);
}

.pixel-flag {
  width: 18px;
  height: 18px;
  animation: flagWave 1s infinite alternate ease-in-out;
}

@keyframes flagWave {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-2px) rotate(8deg); }
}

/* ② メインビジュアル領域: 純粋な山岳ゲーム空間 ＆ トコトコ相棒 ＆ RPGメッセージウィンドウ */
.pixel-stage-container {
  position: relative;
  flex: 1;
  min-height: 250px;
  max-height: 330px;
  margin: 4px 14px 8px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  background: #87ceeb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pixel-bg-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.pixel-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* 雲レイヤーアニメーション（空の高い位置のみ） */
.pixel-clouds-layer {
  position: absolute;
  top: 4px;
  left: 0;
  width: 100%;
  height: 20px;
  pointer-events: none;
  z-index: 2;
}

.pixel-cloud {
  position: absolute;
  font-size: 15px;
  opacity: 0.7;
}

.cloud-1 {
  left: 10%;
  animation: cloudDrift1 25s infinite linear;
}

.cloud-2 {
  left: 60%;
  animation: cloudDrift2 35s infinite linear;
}

@keyframes cloudDrift1 {
  0% { transform: translateX(-50px); }
  100% { transform: translateX(350px); }
}

@keyframes cloudDrift2 {
  0% { transform: translateX(-30px); }
  100% { transform: translateX(300px); }
}

/* キャラクターレイヤー（登山道の中央・メッセージウィンドウの直上に美しく配置） */
.pixel-character-stage {
  position: absolute;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.pixel-hiker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.pixel-hiker-wrap.walking {
  animation: none;
}

.pixel-hiker-img {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pixel-hiker-img svg,
.pixel-hiker-img img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.pixel-hiker-shadow {
  position: absolute;
  bottom: -2px;
  width: 56px;
  height: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  filter: blur(1px);
}

/* ナチュラル・ピクセルメッセージウィンドウ（屋外高コントラスト白ベース） */
.pixel-dialog-box {
  position: relative;
  z-index: 5;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.94);
  border-top: 2px solid #10b981;
  padding: 9px 12px 10px 12px;
  color: #0f172a;
  backdrop-filter: blur(4px);
  animation: bubblePop 0.25s ease-out;
}

.dialog-speaker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.speaker-avatar {
  font-size: 15px;
}

.speaker-name {
  font-size: 12px;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.3px;
}

.dialog-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.48;
  color: #0f172a;
  position: relative;
}

/* 送りカーソル点滅（▼） */
.dialog-text::after {
  content: ' ▼';
  display: inline-block;
  color: #10b981;
  font-size: 11px;
  margin-left: 6px;
  animation: blinkCursor 0.8s infinite steps(1);
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0; transform: translateY(1px); }
}

/* メインアクションボタン（手袋でも押しやすい主役ボタン・改行完全防止） */
.pixel-primary-action-wrap {
  margin: 0 14px 8px 14px;
}

.pixel-big-action-btn {
  width: 100%;
  padding: 13px 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
  font-family: inherit;
  font-size: clamp(14px, 4.2vw, 16px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  letter-spacing: 0.3px;
  white-space: nowrap !important;
  word-break: keep-all;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}

.pixel-big-action-btn:hover {
  filter: brightness(0.97);
}

.pixel-big-action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.pixel-big-action-btn .btn-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.pixel-big-action-btn .btn-label {
  font-size: clamp(14px, 4.2vw, 16px);
  white-space: nowrap !important;
}

/* ③ 下部ステータスバー（標高・経過・カロリー） */
.pixel-stats-bar {
  margin: 0 14px 8px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 7px 10px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.stat-label {
  font-size: 11px;
  color: #4b5563;
  font-weight: 700;
}

.stat-val {
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

.stat-cal-val {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stat-unit {
  font-size: 11px;
  font-weight: 700;
  color: #111827;
}

.stat-sub {
  font-size: 10px;
  font-weight: 800;
  color: #047857;
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-col-divider {
  width: 1px;
  height: 26px;
  background: #cbd5e1;
}

/* ④ フッターナビ */
.pixel-footer-nav {
  margin-top: auto;
  display: flex;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
}

.pixel-nav-item {
  flex: 1;
  background: none;
  border: none;
  color: #64748b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  cursor: pointer;
}

.pixel-nav-item.active {
  color: #059669;
}

.pixel-nav-item.finish {
  color: #e11d48;
}

.pixel-nav-item .nav-icon {
  font-size: 18px;
}

/* ⑤ 地図・進捗ドロワー（ボトムシート） */
.map-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.map-drawer-content {
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 16px 20px;
  overflow-y: auto;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.drawer-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.drawer-close-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ==============================================================
   相棒カスタマイズ UI & モーダル（第4ターン）
   ============================================================== */

/* 準備画面の相棒設定カード */
.companion-setup-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #ffffff;
}

.companion-setup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.companion-setup-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.companion-setup-preview {
  width: 58px;
  height: 58px;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.companion-setup-preview svg,
.companion-setup-preview img,
.companion-setup-preview .pixel-companion-composite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* 登山画面トップバーの相棒着せ替えボタン */
.pixel-btn-custom {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
  margin-left: 4px;
  box-shadow: 0 1px 0 #064e3b;
  transition: all 0.15s ease;
}

.pixel-btn-custom:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* カスタマイズモーダル・オーバーレイ */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.custom-modal-overlay.hidden {
  display: none !important;
}

.custom-modal-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 16px 18px 20px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.custom-modal-scroll-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.custom-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.modal-close-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
}

/* モーダル内プレビュー領域 */
.custom-preview-area {
  background: linear-gradient(180deg, #ecfdf5 0%, #e0f2fe 100%);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px 12px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.custom-preview-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0.85;
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.custom-preview-stage {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-preview-shadow {
  position: absolute;
  bottom: 0px;
  width: 50px;
  height: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  filter: blur(1px);
}

.pixel-hiker-img-modal {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pixel-hiker-img-modal svg,
.pixel-hiker-img-modal img,
.pixel-companion-sprite,
.pixel-companion-sprite-animated {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* 2コマ重ね合わせアニメーション（立ち姿560ms / 腕広げ280ms = 合計840ms） */
.companion-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.frame-idle {
  animation: companion-idle-loop 840ms steps(1) infinite;
}

.frame-motion {
  animation: companion-motion-loop 840ms steps(1) infinite;
}

@keyframes companion-idle-loop {
  0%, 66.66% {
    opacity: 1;
    visibility: visible;
  }
  66.67%, 100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes companion-motion-loop {
  0%, 66.66% {
    opacity: 0;
    visibility: hidden;
  }
  66.67%, 100% {
    opacity: 1;
    visibility: visible;
  }
}

.custom-preview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.custom-meta-badge {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  padding: 2px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-meta-badge.color-badge {
  background: #f8fafc;
  border-color: #64748b;
  color: #0f172a;
}

/* カテゴリタブバー */
.custom-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.custom-tab-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.custom-tab-btn.active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.custom-tab-panel {
  display: none;
  padding-bottom: 8px;
}

.custom-tab-panel.active {
  display: block;
}

/* 髪型選択グリッド（3列＋実ドット絵） */
.hair-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hair-style-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hair-style-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.hair-style-btn.active {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.hair-thumb-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.hair-style-name {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-align: center;
  line-height: 1.2;
}

/* 髪色プリセットサークル（スマホ向けにタップ領域拡大） */
.color-presets-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 8px 4px 16px 4px;
}

.color-preset-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-preset-circle:hover {
  transform: scale(1.1);
}

.color-preset-circle.active {
  box-shadow: 0 0 0 3px #10b981, 0 3px 6px rgba(0, 0, 0, 0.25);
  transform: scale(1.12);
}

/* カラーピッカー自由入力 */
.custom-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
}

.picker-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.picker-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.picker-input-wrap input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.hex-badge {
  font-family: monospace;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.custom-modal-footer {
  margin-top: 10px;
  flex-shrink: 0;
}

/* 装備品レイヤー合成コンテナ（正方形固定） */
.pixel-companion-composite {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pixel-gear-layer {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

/* 頭部装備（帽子・アクセサリー）の位置合わせ */
.pixel-gear-head {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 4;
}

.pixel-gear-head.safari-hat {
  top: -29%;
  width: 56%;
}

.pixel-gear-head.knit-beanie {
  top: -30%;
  width: 34%;
}

.pixel-gear-head.sun-cap {
  top: -22%;
  width: 44%;
}

/* 手持ちギアの位置合わせ */
.pixel-gear-hand {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 5;
}

.pixel-gear-hand.trekking-poles {
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%);
  width: 78%;
}

.pixel-gear-hand.compass {
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
}

.pixel-gear-hand.summit-flag {
  top: 18%;
  right: -2%;
  width: 36%;
}

.pixel-gear-hand.thermal-mug {
  top: 48%;
  right: 18%;
  width: 22%;
}

/* 装備・服装ボタングリッド（全12着、2列横並び・二重スクロール廃止） */
.gear-style-grid,
.outfit-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gear-style-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  min-width: 0;
}

.gear-style-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.gear-style-btn.active {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.outfit-thumb-img {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.gear-style-name {
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  text-align: left;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* 背景（風景）選択グリッド（全12種、3列サムネイル・二重スクロール廃止） */
.bg-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bg-style-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bg-style-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.bg-style-btn.active {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.bg-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #e2e8f0;
}

.bg-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.bg-category-tag {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.2;
}

.bg-style-name {
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  text-align: center;
  line-height: 1.2;
}

/* =========================================================
   ホーム画面：お山・コース選択カード & 相棒サマリー
   ========================================================= */
.setup-course-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-course-kicker {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
}

.setup-course-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.btn-mountain-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #10b981;
  color: #065f46;
  font-size: 15px;
  font-weight: 800;
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.16);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-mountain-pick:active {
  transform: translateY(1px);
  box-shadow: none;
}

.mountain-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.setup-offline-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.offline-label {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.offline-download-area {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offline-download-area.hidden {
  display: none;
}

.setup-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 6px 0;
}

.summary-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  padding: 2px 8px;
}

/* =========================================================
   別画面：地図でお山・コースを決める画面
   ========================================================= */
#app:has(#screen-course-map.active) > .header,
#app:has(#screen-course-map.active) > .footer-credit {
  display: none !important;
}

.screen-course-map {
  padding: 0 !important;
  height: 100vh;
  height: 100dvh;
  display: none;
  flex-direction: column;
  background: #f8fafc;
}

.screen-course-map.active {
  display: flex;
}

.course-map-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.btn-back-map {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
}

.course-map-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.course-map-spacer {
  width: 56px;
}

.course-map-hint {
  background: #ecfdf5;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 6px 10px;
  border-bottom: 1px solid #a7f3d0;
  flex-shrink: 0;
}

.course-map-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.course-select-map {
  width: 100%;
  height: 100%;
}

.map-course-pill-wrap {
  background: transparent;
  border: none;
}

.map-course-pill {
  width: max-content;
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #10b981;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-course-pill.selected {
  background: #10b981;
  color: #ffffff;
  border-color: #064e3b;
  transform: scale(1.06);
}

.map-course-cluster {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.map-course-cluster:hover,
.map-course-cluster:active {
  transform: scale(1.08);
}

.map-course-cluster.has-selected {
  background: linear-gradient(135deg, #059669 0%, #064e3b 100%);
  border-color: #fde68a;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35), 0 4px 12px rgba(15, 23, 42, 0.35);
}

.map-course-cluster-num {
  font-size: 15px;
}

.map-course-cluster-sub {
  font-size: 8px;
  font-weight: 700;
  opacity: 0.94;
  margin-top: 1px;
}

.course-detail-sheet {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 500;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.25);
  border: 1px solid #e2e8f0;
  animation: slideUp 0.2s ease-out;
}

.course-detail-sheet.hidden {
  display: none;
}

.detail-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.detail-course-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.detail-course-meta {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  margin-bottom: 6px;
}

.detail-course-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 12px 0;
}

/* =========================================================
   モーダル5タブ＆声・体重タブ調整
   ========================================================= */
.custom-tabs-5 {
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.custom-tabs-5 .custom-tab-btn {
  font-size: 10px;
  padding: 7px 2px;
}

.modal-voice-section {
  margin-bottom: 16px;
}

.modal-weight-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

/* =========================================================
   下山完了画面：相棒の祝福バナー
   ========================================================= */
.finished-companion-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 2px solid #a7f3d0;
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.finished-companion-avatar {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  background: #ffffff;
  border: 2px solid #10b981;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finished-companion-bubble {
  flex: 1;
  min-width: 0;
}

.finished-bubble-name {
  font-size: 11px;
  font-weight: 800;
  color: #059669;
  margin-bottom: 2px;
}

.finished-bubble-text {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}

/* =========================================================
   地図コース選択画面：エリア切り替えタブ
   ========================================================= */
.course-area-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.area-tab-btn {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.area-tab-btn.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.badge-soon {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  vertical-align: middle;
}

.partner-option-disabled {
  cursor: not-allowed;
}

.partner-card-disabled {
  opacity: 0.6;
  background: #f8fafc;
  border-style: dashed;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

.modal-name-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.input-partner-name {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-partner-name:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.timeline-item {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.timeline-item:hover,
.timeline-item:active {
  background: #f1f5f9;
}

.about-nav-link {
  text-decoration: none;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}

.footer-link {
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.footer-link:hover {
  color: #059669;
}

/* ========================================================
   2D横スクロール・パララックス ピクセルステージ
   ======================================================== */
.stage-parallax-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.parallax-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.img-scroll-track {
  display: flex;
  width: 804px;
  height: 100%;
  will-change: transform;
}

.stage-bg-tile-img {
  width: 201px;
  height: 100%;
  object-fit: fill;
  flex-shrink: 0;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@keyframes stageTileLoop {
  0% { transform: translateX(0); }
  100% { transform: translateX(-201px); }
}

.parallax-stage.speed-normal .img-scroll-track {
  animation: stageTileLoop 10s linear infinite;
}

.parallax-stage.speed-slow .img-scroll-track {
  animation: stageTileLoop 18s linear infinite;
}

@keyframes jumpOverStep {
  0%, 4.5%     { transform: translate(-50%, 0); }
  7.5%         { transform: translate(-50%, -23px); }
  10.5%, 37.5% { transform: translate(-50%, -11px); }
  40.0%        { transform: translate(-50%, -18px); }
  43.0%, 100%  { transform: translate(-50%, 0); }
}

.step-jump-sync {
  animation: jumpOverStep 10s linear infinite;
}

.map-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 450;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-expand-btn:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.walking-main-map-card.is-expanded {
  position: fixed;
  inset: 10px;
  z-index: 900;
  margin: 0;
  max-height: none;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.35);
}

.walking-main-map-card.is-expanded .timeline-inline {
  max-height: none;
}

.header-logo-img {
  height: 26px;
  width: auto;
  display: block;
}

.pixel-logo-img {
  height: 18px;
  width: auto;
  display: block;
}

/* ========================================================
   登山中画面：常時表示マップ＆コンパクト横長バディステージ
   ======================================================== */
#screen-walking .pixel-target-card {
  margin: 6px 12px;
  padding: 8px 12px 9px;
}

#screen-walking .target-spot-name {
  font-size: 16px;
  margin: 1px 0 4px;
}

#screen-walking .target-divider {
  margin: 3px 0 5px;
}

#screen-walking .target-distance-row {
  margin-bottom: 4px;
}

#screen-walking .dist-number {
  font-size: 32px;
}

.walking-main-map-card {
  flex: 1;
  min-height: 135px;
  margin: 0 12px 6px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.walking-map-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.walking-map-tab {
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.walking-map-tab.active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.walking-view-pane {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.walking-view-pane.hidden {
  display: none !important;
}

.hike-map-inline {
  width: 100%;
  flex: 1;
  min-height: 100px;
}

.timeline-inline {
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
  padding: 6px 10px;
}

.buddy-walk-card {
  margin: 0 12px 6px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.buddy-stage-viewport {
  position: relative;
  width: 100%;
  height: 112px;
  overflow: hidden;
}

.buddy-character-anchor {
  position: absolute;
  bottom: 18px;
  left: 60px;
  transform: translateX(-50%);
  z-index: 4;
}

.buddy-character-anchor .pixel-hiker-img,
.buddy-character-anchor .pixel-companion-composite {
  width: 64px;
  height: 64px;
}

.buddy-character-anchor .pixel-hiker-shadow {
  width: 32px;
  height: 7px;
  bottom: -2px;
}

.buddy-walk-card .pixel-dialog-box {
  margin-top: 0;
  padding: 7px 10px 8px;
  background: #ffffff;
  border-top: 2px solid #10b981;
}

.buddy-walk-card .dialog-text {
  font-size: 12.5px;
  line-height: 1.4;
}

#screen-walking .pixel-primary-action-wrap {
  margin: 0 12px 6px;
}

#screen-walking .pixel-big-action-btn {
  padding: 10px 12px;
}

#screen-walking .pixel-stats-bar {
  margin: 0 12px 6px;
  padding: 5px 8px;
}

/* ホーム画面：相棒＋山背景のミニフィールドプレビュー */
.setup-companion-stage {
  position: relative;
  width: 100%;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  margin-bottom: 12px;
  background: #87ceeb;
}

.setup-companion-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.setup-companion-sprite-wrap {
  position: absolute;
  bottom: 18px;
  left: 60px;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.setup-companion-sprite-wrap svg,
.setup-companion-sprite-wrap img,
.setup-companion-sprite-wrap .pixel-companion-composite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
