/* ==========================================================================
   北海道 船釣り水深マップ - モバイルファースト＆PC対応 マリンUI
   ========================================================================== */

:root {
  --bg-dark: #070d19;
  --bg-card: #0f1c32;
  --bg-card-glass: rgba(15, 28, 50, 0.92);
  --border-color: rgba(64, 128, 255, 0.22);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --marine-accent: #00d2ff;
  --marine-sub: #3a7bd5;
  --marine-cyan: #06b6d4;
  --marine-warning: #f59e0b;
  --marine-danger: #ef4444;
  --marine-success: #10b981;
  --hud-bg: rgba(6, 15, 30, 0.92);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
  touch-action: none;
}

/* 全画面マップ */
#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ==================== 上部 HUD (航海情報バー) ==================== */
.hud-top {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 10px;
  right: 10px;
  height: 54px;
  background: var(--hud-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 2px 6px;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  max-width: 800px;
  margin: 0 auto;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  cursor: pointer;
}

.hud-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hud-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  font-family: "SF Pro Display", -apple-system, sans-serif;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.hud-speed .hud-value {
  color: var(--marine-accent);
}

.hud-unit {
  font-size: 10px;
  font-weight: 600;
  color: var(--marine-cyan);
  margin-left: 2px;
}

.hud-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

.hud-tide-mini {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px 8px;
}

.hud-badge {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  margin-top: 1px;
}

/* ==================== 計測情報バナー (kmメイン & 断面表示ボタン) ==================== */
.nav-info-banner {
  position: absolute;
  top: calc(var(--safe-top) + 72px);
  left: 10px;
  right: 10px;
  max-width: 700px;
  margin: 0 auto;
  background: rgba(2, 44, 84, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--marine-accent);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.25);
}

.nav-metrics {
  display: flex;
  gap: 12px;
  font-size: 13px;
  align-items: center;
}

.nav-metrics .lbl {
  color: var(--text-secondary);
  margin-right: 3px;
}

.nav-metrics strong {
  color: var(--marine-accent);
  font-size: 16px;
}

.nav-actions {
  display: flex;
  gap: 6px;
}

.btn-profile-trigger {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-banner-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

/* ==================== 右側フローティング操作ボタン ==================== */
/* ==================== 右側フローティング操作ボタン ==================== */
.floating-controls {
  position: fixed;
  right: 10px;
  top: calc(var(--safe-top) + 68px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.fab-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--hud-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fab-btn:active {
  transform: scale(0.92);
  background: var(--marine-sub);
  color: #fff;
}

.fab-btn.active {
  background: var(--marine-accent);
  color: #070d19;
  border-color: #fff;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.6);
}

/* 間隔切替ボタン (5m / 10m) */
.fab-interval-toggle {
  font-size: 13px;
  font-weight: 800;
  color: var(--marine-accent);
  background: var(--hud-bg);
}

.track-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.fab-btn.recording .track-indicator {
  background: var(--marine-danger);
  box-shadow: 0 0 8px var(--marine-danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* ==================== 下部クイックアクションバー ==================== */
.bottom-action-bar {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 10px);
  left: 10px;
  right: 10px;
  max-width: 600px;
  margin: 0 auto;
  height: 54px;
  background: var(--hud-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  z-index: 50;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6);
}

/* スマホ表示最適化 (画面縦幅・横幅が狭い端末での完全見切れ防止) */
@media (max-width: 600px) {
  .hud-top {
    height: 48px;
    left: 6px;
    right: 6px;
    top: calc(var(--safe-top) + 6px);
    padding: 2px 4px;
    border-radius: 12px;
  }
  .hud-item {
    padding: 1px 3px;
  }
  .hud-label {
    font-size: 9px;
  }
  .hud-value {
    font-size: 15px;
  }
  .hud-unit {
    font-size: 9px;
  }
  .hud-sub {
    font-size: 9px;
  }
  .hud-badge {
    font-size: 9px;
    padding: 1px 4px;
  }
  .floating-controls {
    right: 8px;
    top: calc(var(--safe-top) + 58px);
    gap: 6px;
  }
  .fab-btn {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .fab-interval-toggle {
    font-size: 11px;
  }
  .bottom-action-bar {
    height: 50px;
    left: 8px;
    right: 8px;
    bottom: calc(var(--safe-bottom) + 8px);
    border-radius: 20px;
  }
  .btn-primary-action {
    font-size: 13px;
    gap: 6px;
    height: 40px;
  }
  .btn-sub-action {
    font-size: 10px;
}

.btn-primary-action {
  flex: 1.4;
  height: 44px;
  background: linear-gradient(135deg, #00d2ff 0%, #0066ff 100%);
  border: none;
  border-radius: 22px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 102, 255, 0.4);
}

.btn-primary-action:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}

.btn-sub-action {
  flex: 1;
  height: 44px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  border-radius: 12px;
}

.btn-sub-action i {
  font-size: 19px;
  color: #94a3b8;
}

.btn-sub-action:active {
  background: rgba(255, 255, 255, 0.1);
}

/* ==================== モーダル & ボトムシート (PC 1/4画面対応) ==================== */
.modal-backdrop, .drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open, .drawer-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 92%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-sheet {
  transform: scale(1);
}

.drawer-backdrop {
  align-items: flex-end;
}

/* モバイル時のドロワー */
.drawer-content {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: var(--safe-bottom);
}

.drawer-backdrop.open .drawer-content {
  transform: translateY(0);
}

/* PC・タブレット表示時: 画面いっぱいに広がらず、コンパクトな1/4画面カード（幅420px〜480px）に収める */
@media (min-width: 768px) {
  .drawer-backdrop {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    background: transparent; /* 背景を暗くしすぎず地図を見やすく */
    pointer-events: none;
  }
  .drawer-content {
    width: 440px;
    max-height: 75vh;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
  }
}

.modal-header, .drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3, .drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close, .drawer-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.modal-body, .drawer-body {
  padding: 14px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==================== 海底断面プロファイル (Cross-Section) ==================== */
.profile-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.p-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  border-radius: 10px;
}

.p-card .p-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--marine-accent);
}

.p-card .p-lbl {
  font-size: 11px;
  color: var(--text-secondary);
}

.profile-graph-box {
  background: rgba(2, 18, 40, 0.9);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.profile-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ==================== 潮汐（タイドグラフ）UI (1日/2日切替) ==================== */
.tide-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.period-toggle-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
}

.btn-period {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-period.active {
  background: var(--marine-accent);
  color: #070d19;
}

.tide-station-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.tide-station-selector select {
  flex: 1;
}

.tide-graph-card {
  background: rgba(2, 20, 45, 0.7);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.tide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.tide-badge {
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}

.tide-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ==================== 毎時気象・海況予報 (今後24時間) ==================== */
.hourly-weather-wrapper {
  margin-top: 14px;
  margin-bottom: 14px;
}

.hourly-weather-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.hw-card {
  flex: 0 0 74px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
}

.hw-time {
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 4px;
}

.hw-wave {
  font-size: 13px;
  font-weight: 800;
  color: var(--marine-accent);
}

.hw-wind {
  font-size: 11px;
  color: #60a5fa;
  margin-top: 2px;
}

/* ==================== フォームUI ==================== */
.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.form-row-grid label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--marine-accent);
  background: rgba(255, 255, 255, 0.09);
}

.form-help {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-save {
  background: linear-gradient(135deg, #00d2ff 0%, #0066ff 100%);
  border: none;
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-sm {
  background: var(--marine-sub);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* ==================== ポイント一覧 ==================== */
.points-actions-top {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.points-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.point-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.point-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.point-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  display: flex;
  gap: 8px;
}

.point-actions {
  display: flex;
  gap: 6px;
}

.point-btn-jump {
  background: rgba(0, 210, 255, 0.15);
  color: var(--marine-accent);
  border: none;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.point-btn-del {
  background: rgba(239, 68, 68, 0.15);
  color: var(--marine-danger);
  border: none;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
}

/* ==================== スイッチ＆ラジオ ==================== */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.switch-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--marine-accent);
}

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.radio-options label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.depth-marker-popup {
  color: #070d19;
  font-size: 12px;
  font-weight: bold;
}

.hazard-marker-popup {
  color: #070d19;
  font-size: 12px;
}

/* ==================== 航行安全アラート (三角波・潮立ち) ==================== */
.safety-alert-card {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: alertPulse 2s infinite ease-in-out;
}

.safety-alert-warning {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.safety-alert-caution {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fde68a;
}

.safety-alert-title {
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.safety-alert-warning .safety-alert-title {
  color: #ef4444;
}

.safety-alert-caution .safety-alert-title {
  color: #f59e0b;
}

.safety-alert-desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: #e2e8f0;
}

@keyframes alertPulse {
  0% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.35); }
  100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==================== 水深別水温カード ==================== */
.depth-temp-pill {
  flex: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 4px;
}

.depth-temp-pill .dt-depth {
  font-size: 10px;
  color: #94a3b8;
}

.depth-temp-pill .dt-val {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 2px;
}

/* ==================== 底質・海底地形名ポップアップ ==================== */
.seabed-popup {
  color: #0f172a;
  padding: 4px;
  max-width: 220px;
}

.seabed-popup h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.seabed-popup .sb-raw {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.seabed-popup .sb-depth {
  font-size: 13px;
  font-weight: 800;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.seabed-popup .sb-hint {
  font-size: 11.5px;
  background: #f1f5f9;
  border-left: 3px solid #0284c7;
  padding: 4px 8px;
  border-radius: 0 4px 4px 0;
  color: #0369a1;
  font-weight: 600;
}

.btn-popup-nav {
  width: 100%;
  background: linear-gradient(135deg, #00d2ff, #0066ff);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ==================== 魚マークのみマーカー (Fish Pin) ==================== */
.waypoint-fish-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #0284c7 0%, #082f49 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 210, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translate(-50%, -50%);
}

.waypoint-fish-pin:hover, .waypoint-fish-pin:active {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.9);
}

/* ==================== 移動モード (Navigation HUD Dashboard) ==================== */
.nav-hud-dashboard {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 16px) 16px;
  background: radial-gradient(circle at center, rgba(3, 22, 51, 0.6) 0%, rgba(2, 10, 25, 0.92) 80%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.nav-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

.nav-target-badge {
  background: rgba(15, 28, 50, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.nav-target-badge i {
  color: var(--marine-accent);
  font-size: 18px;
}

.nav-target-info {
  display: flex;
  flex-direction: column;
}

.nav-target-lbl {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.nav-target-info strong {
  font-size: 13px;
  color: #fff;
}

.btn-nav-hud-close {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--marine-danger);
  color: #fca5a5;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* 中央コンパス & 巨大矢印 */
.nav-hud-compass-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nav-arrow-dial {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.08) 0%, rgba(2, 6, 23, 0.4) 70%);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 35px rgba(0, 210, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-huge-arrow-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease-out;
}

.nav-huge-arrow {
  width: 140px;
  height: 140px;
  fill: #10b981; /* 良好時は緑 */
  filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.8));
  transition: fill 0.3s ease;
}

.nav-huge-arrow.off-course-mid {
  fill: #f59e0b;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.8));
}

.nav-huge-arrow.off-course-high {
  fill: #ef4444;
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.9));
}

.nav-center-ship-icon {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #fff;
  color: #00d2ff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0,0,0,0.8);
}

.nav-steer-guidance {
  margin-top: 14px;
  text-align: center;
}

.nav-steer-text {
  font-size: 22px;
  font-weight: 800;
  color: #10b981;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  letter-spacing: 0.5px;
}

.nav-bearing-diff {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

/* 下部大型計器バー */
.nav-hud-metrics-bar {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 10px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  pointer-events: auto;
}

.nav-metric-box {
  background: rgba(15, 28, 50, 0.92);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nav-metric-box .m-lbl {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 2px;
}

.nav-metric-box .m-val-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
}

.nav-metric-box .m-val {
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-family: monospace, sans-serif;
}

.nav-metric-speed .m-val {
  color: #00d2ff;
}

.nav-metric-dist .m-val {
  color: #facc15;
}

.nav-metric-eta .m-val {
  color: #10b981;
}

.nav-metric-box .m-unit {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}

.nav-metric-box .m-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}


