/* -----------------------------------------------------------------------
   リセット & ベース
----------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", sans-serif;
  background: #f5f5f5;
  color: #212121;
  min-height: 100vh;
}

/* -----------------------------------------------------------------------
   ヘッダー
----------------------------------------------------------------------- */
.app-header {
  background: #1565c0;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
}

.app-title {
  font-size: 1.125rem;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.app-header--result {
  background: #1565c0;
}

.header-title {
  font-size: 1.125rem;
  font-weight: bold;
}

.btn-back {
  color: #fff;
  font-size: 0.95rem;
  padding: 8px 4px;
  min-width: 0;
  height: auto;
  background: none;
  border: none;
}

.btn-back:hover {
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
}

/* -----------------------------------------------------------------------
   メインコンテンツ
----------------------------------------------------------------------- */
.app-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -----------------------------------------------------------------------
   入力セクション
----------------------------------------------------------------------- */
.input-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.text-input {
  flex: 1;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  color: #212121;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.text-input:focus {
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(21,101,192,0.2);
}

.text-input[readonly] {
  background: #f9f9f9;
  color: #666;
}

/* Google Places のドロップダウンが隠れないように */
#destination-section {
  overflow: visible;
  position: relative;
  z-index: 50;
}

/* -----------------------------------------------------------------------
   確認セクション
----------------------------------------------------------------------- */
.confirm-map {
  width: 100%;
  height: 180px;
  border-radius: 6px;
  background: #e0e0e0;
  margin-bottom: 12px;
}

.confirm-name {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #212121;
}

.confirm-buttons {
  display: flex;
  gap: 8px;
}

/* -----------------------------------------------------------------------
   ボタン
----------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #1565c0;
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: #0d47a1;
}

.btn-secondary {
  background: #e3f2fd;
  color: #1565c0;
  font-size: 0.875rem;
  padding: 0 12px;
  flex-shrink: 0;
}

.btn-secondary:hover {
  background: #bbdefb;
}

.btn-ghost {
  background: transparent;
  color: #1565c0;
  border: 1px solid #1565c0;
}

.btn-ghost:hover {
  background: #e3f2fd;
}

.btn-full {
  width: 100%;
}

/* -----------------------------------------------------------------------
   検索エリア
----------------------------------------------------------------------- */
.search-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* -----------------------------------------------------------------------
   スピナー（CSSアニメーション）
----------------------------------------------------------------------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #1565c0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* -----------------------------------------------------------------------
   エラーメッセージ
----------------------------------------------------------------------- */
.error-message {
  color: #d32f2f;
  font-size: 0.9rem;
  padding: 10px 14px;
  background: #ffebee;
  border-left: 4px solid #d32f2f;
  border-radius: 4px;
}

/* -----------------------------------------------------------------------
   結果画面: 目印カード
----------------------------------------------------------------------- */
.landmark-card {
  background: #fff;
  border: 2px solid #1565c0;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(21,101,192,0.15);
}

.landmark-category {
  font-size: 0.8rem;
  color: #1565c0;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.landmark-name {
  font-size: 3rem;
  font-weight: bold;
  color: #212121;
  line-height: 1.2;
  word-break: break-all;
}

/* -----------------------------------------------------------------------
   結果画面: 汎用 info-section
----------------------------------------------------------------------- */
.info-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.section-title {
  font-size: 0.9rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

/* -----------------------------------------------------------------------
   結果画面: 徒歩情報
----------------------------------------------------------------------- */
.walk-text {
  font-size: 1.1rem;
  font-weight: bold;
  color: #212121;
  text-align: center;
}

/* -----------------------------------------------------------------------
   結果画面: 進入案内
----------------------------------------------------------------------- */
.approach-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #333;
}

/* -----------------------------------------------------------------------
   結果画面: 地図
----------------------------------------------------------------------- */
.result-map {
  width: 100%;
  height: 240px;
  border-radius: 6px;
  background: #e0e0e0;
}

/* -----------------------------------------------------------------------
   結果画面: 候補リスト
----------------------------------------------------------------------- */
.candidates-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candidates-list li {
  padding: 12px 14px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid #ccc;
}

.candidates-list li:hover {
  background: #e3f2fd;
  border-left-color: #1565c0;
}

/* -----------------------------------------------------------------------
   結果画面: Tier 4 フォールバック
----------------------------------------------------------------------- */
.fallback-section {
  border-left: 4px solid #f57c00;
}

.fallback-message {
  font-size: 0.95rem;
  color: #e65100;
  line-height: 1.6;
}

/* -----------------------------------------------------------------------
   レスポンシブ（480px 超の場合）
----------------------------------------------------------------------- */
@media (min-width: 480px) {
  .app-main {
    padding: 24px 16px;
  }

  .landmark-name {
    font-size: 3.5rem;
  }
}
