/* -------------------------------------------- */
/* ▼ MOBILE FIRST DESINE ▼ */
/* -------------------------------------------- */

html,
body,
#map_view {
  height: 100%;
  width: 100vw;
}

/* -------------------------------------------- */
/* ICON DESINE */
/* -------------------------------------------- */
.marker_staff {
  font-size: 1.5em;
}

/* .marker_staff {
  font-size: 0.7em;
} */

.marker_info_distance {
  font-size: 0.7em;
}

/* -------------------------------------------- */
/* ICON DESINE */
/* -------------------------------------------- */
/* ================================================
   marker-badge — Leaflet divIcon カスタムバッジ
   ================================================ */
.marker-badge {
  display: inline-flex;
  align-items: stretch;
  border-radius: 6px;
  /* 左上だけ角を無くして吹き出し（フキダシ）風のデザインに */
  border-top-left-radius: 0;
  overflow: hidden;
  border-width: 1.5px;
  border-style: solid;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  cursor: pointer;
  font-family: sans-serif;
}

.marker-badge__num {
  font-size: 13px;
  font-weight: 700;
  min-width: 26px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.marker-badge__lbl {
  font-size: 9px;
  font-weight: 500;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  line-height: 1;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- ICON_CD: 1 / 選手（待機中）— 緑 ---- */
.marker-badge--athlete {
  border-color: #006b3e;
}
.marker-badge--athlete .marker-badge__num {
  background: #ffffff;
  color: #006b3e;
}
.marker-badge--athlete .marker-badge__lbl {
  background: #006b3e;
  color: #ffffff;
}

/* ---- ICON_CD: 2 / レース中 — ブルー ---- */
.marker-badge--racing {
  border-color: #1565c0;
}
.marker-badge--racing .marker-badge__num {
  background: #ffffff;
  color: #1565c0;
}
.marker-badge--racing .marker-badge__lbl {
  background: #1565c0;
  color: #ffffff;
}

/* ---- ICON_CD: 3 / FINISH — ゴールド ---- */
.marker-badge--finish {
  border-color: #b8860b;
}
.marker-badge--finish .marker-badge__num {
  background: #ffffff;
  color: #8b6508;
}
.marker-badge--finish .marker-badge__lbl {
  background: #d4a017;
  color: #3d2b00;
}

/* ---- ICON_CD: 4 / DNF — グレー ---- */
.marker-badge--dnf {
  border-color: #757575;
}
.marker-badge--dnf .marker-badge__num {
  background: #f5f5f5;
  color: #555555;
}
.marker-badge--dnf .marker-badge__lbl {
  background: #9e9e9e;
  color: #ffffff;
}

/* ---- デフォルト（上記以外）— 緑・薄め ---- */
.marker-badge--default {
  border-color: #006b3e;
}
.marker-badge--default .marker-badge__num {
  background: #ffffff;
  color: #006b3e;
}
.marker-badge--default .marker-badge__lbl {
  background: #006b3e;
  color: #ffffff;
  opacity: 0.75;
}

/* ================================================
   course-icon-anchor-tr — START/FINISHアイコンの位置調整
   ・選手アイコン（左上アンカー＝座標から右下に伸びる）と重ならないよう、
     このラッパーで自身の横幅ぶん左にずらし、座標が右上に来るようにする
   ・Leafletがマーカー位置決めのために外側のdivへ直接transformを設定するため、
     位置調整用のtransformは必ずこの内側の別divに設定すること
   ================================================ */
.course-icon-anchor-tr {
  display: inline-block;
  transform: translateX(-100%);
}

/* ================================================
   sf-badge — START / FINISH 専用バッジ（小サイズ）
   ================================================ */

.sf-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  /* アンカー座標（右上）に来る角だけ丸みを無くし、選手アイコンと同じ「とんがり形」に */
  border-top-right-radius: 0;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  font-family: sans-serif;
}

.sf-badge__icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sf-badge__text {
  padding: 0 8px 0 6px;
  display: flex;
  align-items: center;
  height: 22px;
}

.sf-badge__main {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.07em;
}

/* ---- START — 緑 ---- */
.sf-badge--start {
  background: #006b3e;
  border: 1.5px solid #004d2c;
  box-shadow: 0 2px 6px rgba(0, 107, 62, 0.45);
  color: #ffffff;
}
.sf-badge--start .sf-badge__icon {
  background: #004d2c;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---- FINISH — チェッカー柄＋黒地 ---- */
.sf-badge--finish {
  border: 1.5px solid #000000;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  color: #ffffff;
}
.sf-badge--finish .sf-badge__icon {
  background-image: repeating-conic-gradient(#111111 0% 25%, #ffffff 0% 50%);
  background-size: 5px 5px;
  background-position: 0 0;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
}
.sf-badge--finish .sf-badge__text {
  background: #111111;
}

/* ---- START+FINISH 同一地点 — 分割バッジ ---- */
.sf-badge--startfinish {
  display: inline-flex;
  align-items: stretch;
  border-radius: 5px;
  /* アンカー座標（右上）に来る角だけ丸みを無くし、選手アイコンと同じ「とんがり形」に */
  border-top-right-radius: 0;
  overflow: hidden;
  border: 1.5px solid #111111;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  cursor: pointer;
  font-family: sans-serif;
}
.sf-badge--startfinish .sf-half-start {
  background: #006b3e;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}
.sf-badge--startfinish .sf-half-finish {
  background-image: repeating-conic-gradient(#111111 0% 25%, #ffffff 0% 50%);
  background-size: 5px 5px;
  background-position: 0 0;
  display: flex;
  align-items: stretch;
}
.sf-badge--startfinish .sf-half-finish-inner {
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* ================================================
   dist-marker — 距離マーカー（5km毎）
   ================================================ */

.dist-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid #8a8a8a;
  flex-direction: column;
  line-height: 1;
  font-family: sans-serif;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.dist-marker__num {
  font-size: 10px;
  font-weight: 700;
  color: #444444;
  line-height: 1;
}

.dist-marker__unit {
  font-size: 7px;
  font-weight: 500;
  color: #777777;
  line-height: 1;
  margin-top: 1px;
}
/* -------------------------------------------- */
/* TABLET DESINE */
/* -------------------------------------------- */
@media (min-width: 768px) {
}

/* ------------------------------------ */
/* PC DESINE */
/* ------------------------------------ */
@media (min-width: 1024px) {
}

/* ------------------------------------ */
/* Leaflet POPUP DESINE */
/* ------------------------------------ */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgb(37, 37, 37);
  /* border-color: white; */
}

.leaflet-popup-content,
a.leaflet-popup-close-button {
  color: white !important;
  /* font: bold 14pt monospace; */
}

.leaflet-popup-content-wrapper {
  border-width: 2px;
  border-style: solid;
  border-radius: 5px !important; /* 角丸を取り消す */
}

.leaflet-popup-tip-container {
  margin-top: -3px;
  height: 23px;
}

.leaflet-popup-tip {
  border-style: solid;
  border-width: 0 3px 3px 0;
  border-radius: 5px; /* 少し丸みを持たせる */
}

.popup_header {
  border-bottom: 1px solid white; /* 白線を引く */
  padding-bottom: 4px; /* 下線とコンテンツの間に余白 */
  margin-bottom: 4px; /* 次のコンテンツとの間隔 */
  padding: 0 12px 5px 12px;
  margin: -12px -10px 0 -12px;
}

.popup_number {
  font-size: 12px;
  font-weight: inherit;
}

.popup_name {
  font-size: 16px;
}

.popup_contents {
  margin: 7px 0 0 0;
}

.popup_box {
  display: flex;
  align-items: center; /* 縦方向中央揃え */
  gap: 4px; /* タイトルと情報の間にスペースを追加 */
}

.popup_title {
  margin-right: 2px; /* タイトルと情報の間隔 */
}

.popup_info {
  font-weight: bold;
  font-size: 14px;
}

.marker_rotate i {
  transform: rotate(135deg) !important;
}

/* ------------------------------------ */
/* Auto Reload Toggle DESINE            */
/* ------------------------------------ */

.updateTimeText {
  font-size: 13px;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 8px; /* トグルとランプの間隔 */
}

.small-toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.small-toggle-switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 20px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #46bddd;
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* ランプ（スライダーの外） */
.blinker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #0f0;
  opacity: 0;
}

/* 点滅アニメーション */
@keyframes blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.popup-message {
  position: absolute;
  background: #46bddd;
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  bottom: 40px; /* 上に表示する */
  left: 60px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  white-space: nowrap;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.popup-message::after {
  content: "";
  position: absolute;
  top: 100%; /* 吹き出しの下に配置 */
  left: 15px; /* 矢印の横位置調整 */
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #46bddd transparent transparent transparent;
}

/* ------------------------------------ */
/* Auto Reload Toggle DESINE END        */
/* ------------------------------------ */

/* ------------------------------------ */
/* 戻るボタン DESINE                    */
/* ------------------------------------ */

.back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  /* Leafletのコントロールより上 */
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  background: #ffffff;
  color: #555555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition:
    background 0.15s,
    color 0.15s;
}

.back-btn:hover {
  background: #f0f0f0;
  color: #222222;
}

/* ------------------------------------ */
/* 戻るボタン DESINE END                */
/* ------------------------------------ */

/* ------------------------------------ */
/* データ無し 案内ダイアログ DESINE      */
/* ------------------------------------ */

.no-data-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
}

.no-data-overlay.is-open {
  display: flex;
}

.no-data-box {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 24px 20px;
  width: min(320px, calc(100vw - 48px));
  text-align: center;
  font-family: sans-serif;
}

.no-data-message {
  font-size: 14px;
  color: #333333;
  line-height: 1.7;
  margin: 0 0 18px 0;
}

.no-data-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  border: none;
  border-radius: 6px;
  background: #e95412;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.no-data-back-btn:hover {
  background: #d1490f;
}

/* ------------------------------------ */
/* データ無し 案内ダイアログ DESINE END  */
/* ------------------------------------ */

/* ------------------------------------ */
/* Info Button&modal START              */
/* ------------------------------------ */

/* ---- インフォボタン ---- */
.info-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  /* Leafletのコントロールより上 */
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  background: #ffffff;
  color: #555555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition:
    background 0.15s,
    color 0.15s;
}

.info-btn:hover {
  background: #f0f0f0;
  color: #222222;
}

/* ---- オーバーレイ ---- */
.info-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.3);
}

.info-overlay.is-open {
  display: block;
}

/* ---- モーダル ---- */
.info-modal {
  display: none;
  position: fixed;
  z-index: 1200;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  font-family: sans-serif;
}

.info-modal.is-open {
  display: block;
}

.info-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #eeeeee;
}

.info-modal__title {
  font-size: 13px;
  font-weight: 700;
  color: #333333;
  letter-spacing: 0.02em;
}

.info-modal__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #666666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.info-modal__close:hover {
  background: #e0e0e0;
  color: #333333;
}

.info-modal__list {
  margin: 0;
  padding: 12px 16px 16px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: disc;
}

.info-modal__list li {
  font-size: 12px;
  color: #444444;
  line-height: 1.7;
}

.info-modal__list li strong {
  color: #222222;
}

/* ------------------------------------ */
/* Info Button&modal END                */
/* ------------------------------------ */
