html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 地図コンテナを相対配置 */
#map-container {
  height: calc(100vh - 220px); /* 標高グラフ分を引いた高さ */
  position: relative;
}

/* 地図本体 */
#map {
  height: 100%;
}

/* 凡例のスタイル */
#legend {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%); /* 中央寄せ */
  background-color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #333;
}

.color-bar {
  width: 150px;
  height: 12px;
  background: linear-gradient(to right,
    hsl(220, 100%, 80%),
    hsl(230, 100%, 70%),
    hsl(240, 100%, 60%),
    hsl(255, 100%, 50%),
    hsl(270, 100%, 40%)
  );
  border-radius: 4px;
}
#gpx-stats {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-collapse: collapse;
}

#gpx-stats th,
#gpx-stats td {
  padding: 2px 6px;
  text-align: left;
}

/* select-boxのスタイル */
#gpxSelect {
  background-color: white;
  border: 1px solid #ccc;
}
#gpxSelect:focus {
  outline: none;
  box-shadow: none;
  background-color: white;
}

.km-flag {
    display: flex;
    align-items: center;
    justify-content: center;
}

.km-flag-badge {
    background: red;
    color: white;
    font-weight: bold;
    font-size: 12px;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    text-align: center;
    line-height: 22px;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

/* 標高差グラフね */
#elevation-container {
  height: 200px;
  background: white;
  padding: 10px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}
#elevationChart {
  width: 100%;
  height: 150px;
}




/* スマホ（画面幅600px以下）のときだけ適用 */
@media screen and (max-width: 600px) {

  #gpx-stats {
    font-size: 11px;
    padding: 6px 8px;
    top: 5px;
    left: 5px;
    max-width: 90vw;
  }

  #legend {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    font-size: 11px;
  }

  .color-bar {
    width: 120px;
    height: 10px;
  }

  #gpxSelect {
    font-size: 14px;
    max-width: 100%;
    margin-bottom: 6px;
  }

  h2 {
    font-size: 16px;
    text-align: center;
  }

  #map-container {
    height: 60vh; /* 画面高さの60%に縮める */
  }
}
