/* NAVILinks — Web 受信ページ (Variant A · 保守的)
   ─ デザイントークンは Flutter 側 NLColors と一致 ─ */

:root {
  --nl-primary:    #1976D2;
  --nl-primary-50: #E3F2FD;
  --nl-primary-700:#1565C0;
  --nl-primary-900:#0D47A1;
  --nl-accent:     #FFA726;
  --nl-accent-50:  #FFF4E0;
  --nl-accent-700: #F57C00;
  --nl-success:    #2E7D32;
  --nl-error:      #D32F2F;

  --nl-bg:         #FAFAFA;
  --nl-surface:    #FFFFFF;
  --nl-surface-2:  #F4F5F7;
  --nl-ink:        #1A1F2A;
  --nl-ink-2:      #4A5160;
  --nl-ink-3:      #8A93A4;
  --nl-line:       #E6E8EE;

  --nl-radius-md:  16px;
  --nl-radius-lg:  22px;

  --nl-font-jp:    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
                   "Hiragino Sans", Meiryo, "Yu Gothic", "Yu Gothic UI",
                   system-ui, sans-serif;
  /* ETA 数字。DM Mono を hosting に同梱できれば差し替え */
  --nl-font-mono:  "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--nl-bg); }
body {
  font-family: var(--nl-font-jp);
  color: var(--nl-ink);
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ───── Top bar ───── */
.nl-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--nl-surface);
  border-bottom: 1px solid #EEF0F4;
  flex-shrink: 0;
}
.nl-brand { display: flex; align-items: center; gap: 8px; }
.nl-logo { width: 22px; height: 22px; flex-shrink: 0; }
.nl-wordmark {
  font-weight: 800; font-size: 13px; letter-spacing: -0.3px;
}
.nl-wordmark span { color: var(--nl-primary); }
.nl-url {
  font-family: var(--nl-font-mono);
  font-size: 11px; color: var(--nl-ink-3);
  background: var(--nl-surface-2);
  padding: 4px 8px; border-radius: 6px;
}

/* ───── Map ───── */
.nl-map {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(1000px 600px at 40% 30%, #d9e7f5 0%, transparent 60%),
    radial-gradient(800px 700px at 70% 80%, #e9efdf 0%, transparent 55%),
    linear-gradient(180deg, #eef3fa 0%, #e8eef6 100%);
}
/* Mapbox は #map に直接マウントするので overflow:hidden で角丸ナシ */
.mapboxgl-map { width: 100%; height: 100%; }

/* 更新ボタン (初回ロード失敗時の救済) — 地図左下にフローティング */
.nl-reload {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--nl-surface);
  color: var(--nl-primary);
  border: 1px solid var(--nl-line);
  border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.nl-reload:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18); }
.nl-reload:active { transform: translateY(1px); }

/* ───── Map markers (Mapbox + placeholder 共通) ───── */
.nl-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 発信者: 青い丸 + 白縁 + パルスリング */
.nl-pin-sender {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--nl-primary);
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(25, 118, 210, 0.45);
}
.nl-pin-sender::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: rgba(25, 118, 210, 0.22);
  animation: nl-ring 2.2s ease-out infinite;
  z-index: -1;
}
@keyframes nl-ring {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}
/* 目的地: 雫型 (オレンジ) + 中央白丸 */
.nl-pin-dest {
  width: 28px; height: 38px;
  background: var(--nl-accent);
  clip-path: path("M14 0 C21.7 0 28 6.3 28 14 C28 22.8 14 38 14 38 C14 38 0 22.8 0 14 C0 6.3 6.3 0 14 0 Z");
  filter: drop-shadow(0 4px 10px rgba(245, 124, 0, 0.45));
}
.nl-pin-dest::before {
  content: "";
  position: absolute;
  left: 50%; top: 36%;
  width: 10px; height: 10px;
  margin-left: -5px; margin-top: -5px;
  border-radius: 50%;
  background: #fff;
}

/* ───── Info panel ───── */
.nl-panel {
  flex-shrink: 0;
  background: var(--nl-surface);
  padding: 16px 20px 14px;
  display: flex; flex-direction: column;
}
.nl-panel-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.nl-panel-title {
  font-size: 13px; font-weight: 700; color: var(--nl-ink-2);
}
.nl-panel-title strong {
  color: var(--nl-ink); font-weight: 800;
}
.nl-who {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 2px;
  background: linear-gradient(155deg, var(--nl-accent), var(--nl-accent-700));
  color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 50%; vertical-align: middle;
}

/* Live dot */
.nl-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--nl-ink-3);
  white-space: nowrap;
}
.nl-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--nl-success);
  animation: nl-pulse 1.6s ease-in-out infinite;
}
@keyframes nl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

/* ───── ETA hero ───── */
.nl-eta-row {
  display: flex; align-items: baseline; justify-content: center;
  gap: 6px; margin-top: 12px;
}
.nl-eta-prefix {
  font-size: 16px; font-weight: 700; color: var(--nl-ink-2);
  align-self: flex-end; margin-bottom: 12px;
}
.nl-eta-num {
  font-family: var(--nl-font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 84px;
  line-height: 1;
  letter-spacing: -2.5px;
  color: var(--nl-primary);
  animation: nl-eta-breath 4.5s ease-in-out infinite;
  transform-origin: center;
}
.nl-eta-suffix {
  font-size: 24px; font-weight: 700; color: var(--nl-ink-2);
  align-self: flex-end; margin-bottom: 8px;
}
@keyframes nl-eta-breath {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: 0.92; }
}

/* ───── Meta ───── */
.nl-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 6px;
  font-size: 13px; color: var(--nl-ink-2);
}
.nl-meta-num {
  font-family: var(--nl-font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--nl-ink);
  font-weight: 700;
}

/* ───── Ad ───── */
.nl-ad {
  margin: 0 12px;
  padding: 8px 0 10px;
  border-top: 1px solid #EEF0F4;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nl-ad ins { width: 100%; }
.nl-ad-placeholder {
  width: 100%; max-width: 320px; height: 50px;
  border: 1px dashed var(--nl-line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: 1px; color: var(--nl-ink-3);
}
/* 本番では adsbygoogle が描画されたら placeholder を消す */
.nl-ad .adsbygoogle[data-ad-status="filled"] + .nl-ad-placeholder { display: none; }

/* ───── Footer ───── */
.nl-footer {
  flex-shrink: 0;
  padding: 10px 16px env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--nl-ink-3);
  border-top: 1px solid #EEF0F4;
  background: var(--nl-surface);
}
.nl-install {
  color: var(--nl-primary); text-decoration: none; font-weight: 700;
}

/* Larger phones: tighten ETA */
@media (min-width: 480px) {
  .nl-eta-num { font-size: 104px; letter-spacing: -3px; }
  .nl-eta-prefix { font-size: 18px; margin-bottom: 16px; }
  .nl-eta-suffix { font-size: 28px; margin-bottom: 10px; }
}

/* セッション終了状態 */
.nl-panel.ended .nl-eta-num { color: var(--nl-ink-3); animation: none; }
.nl-panel.ended .nl-live-dot { background: var(--nl-ink-3); animation: none; }

/* ───── PIN ゲート (全画面オーバーレイ) ───── */
.nl-pin-gate {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.nl-pin-gate[hidden] { display: none; }
.nl-pin-card {
  background: var(--nl-surface);
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  padding: 24px 22px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  text-align: center;
}
.nl-pin-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--nl-primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nl-pin-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--nl-ink);
  margin: 0 0 6px;
}
.nl-pin-msg {
  font-size: 13px;
  color: var(--nl-ink-2);
  margin: 0 0 16px;
  line-height: 1.6;
}
.nl-pin-input {
  width: 100%;
  height: 48px;
  font-size: 22px;
  font-family: var(--nl-font-mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 6px;
  border: 1.5px solid var(--nl-line);
  border-radius: 12px;
  outline: none;
  margin-bottom: 12px;
  -webkit-appearance: none;
}
.nl-pin-input:focus {
  border-color: var(--nl-primary);
}
.nl-pin-submit {
  width: 100%;
  height: 46px;
  background: var(--nl-primary);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.nl-pin-submit:active { opacity: 0.85; }
.nl-pin-submit:disabled {
  background: var(--nl-ink-3);
  cursor: not-allowed;
}
.nl-pin-err {
  color: var(--nl-error);
  font-size: 12px;
  min-height: 16px;
  margin: 8px 0 0;
}
