/* === 基本設定 === */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background: #f7f7f7;
  color: #333;
}

/* === タイトル・見出し関連 === */
.title-container {
  text-align: center;
  padding: 5px 10px;
  background-color: #fff;
  margin-bottom: 0;
}

#facility-name {
  font-size: 32px;
  margin: 0;
  padding-bottom: 8px;
  color: #007acc;
}

.underline {
  width: 90%;
  height: 1px;
  background-color: #007acc;
  margin: 0 auto 5px auto;
}

.subtitle {
  font-size: 20px;
  padding: 0;
  margin: 0;
  font-weight: bold;
  color: #007acc;
  display: block;
}

/* === デバッグ表示（非表示）=== */
#debug {
  display: none;
  padding: 10px;
  background: #eee;
  font-size: 12px;
  border-bottom: 1px solid #ccc;
  white-space: pre-wrap;
}

/* === 時刻・日付表示 === */
#local-time-container {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  background: #fff;
  border-bottom: 2px solid #ccc;
  padding: 10px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 1000;
}

#local-date {
  font-size: 26px;
}

#local-date span {
  font-size: 32px;
}

#local-weekday {
  display: inline-block;
  font-size: 26px;
  border-radius: 50%;
  padding: 0 10px;
  background: #eee;
}

#local-clock {
  font-size: 22px;
  margin-left: 20px;
}

/* === メインレイアウト（3カラム） === */
.main-container {
  display: flex;
  gap: 20px;
  flex-wrap: nowrap;
}

.left-container,
.center-container,
.right-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.left-container {
  width: 35%;
}

.center-container {
  width: 35%;
  padding-top: 20px;
}

.right-container {
  width: 30%;
  padding-top: 20px;
  gap: 10px;
}

.right-container .metric-container {
  display: none;
}

.left-container .info-container {
  display: none;
  margin-top: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

/* 画像を左右中央揃え */
.thumbnail-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#facility-image {
  max-width: 95%;
  height: auto;
  display: block;
  border-radius: 3px;
}


.info-container .tag {
  background: #0094ff;
  color: white;
  padding: 6px 20px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
}

/* === 指標表示ラベル === */
.metric-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.label {
  padding: 3px 20px;
  border-radius: 8px;
  color: white;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.label.average { background: #4caf50; }
.label.max     { background: #ff7043; }
.label.pass    { background: #42a5f5; }

.value {
  font-size: 25px;
  font-weight: bold;
  color: black;
}

/* === 現在時刻表示 === */
#current-time {
  font-size: 40px;
  background: #ccf2ff;
  color: red;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  font-weight: bold;
  width: 80%;
  margin: 10px auto 0 0;
}

#current-time span {
  font-size: 16px;
  color: #333;
  margin-left: 4px;
  font-weight: normal;
}

/* === 待ち時間関連 === */
.waittime-container {
  max-width: 95%;
  margin: 0 auto;
  padding: 10px;
  background: #fff;
}

.waittime-container h2 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
  color: #007acc;
}

.update-time {
  text-align: right;
  font-size: 18px;
  font-weight: bold;
  color: #555;
  margin-bottom: 5px;
}

hr.dotted-line {
  border: none;
  border-top: 1px dotted #007acc;
  margin: 10px 0;
}

/* === 本日待ち時間エリア === */
#today-waittimes-container {
  max-width: 95%;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 12px;
}

#today-waittimes-title {
  font-size: 30px;
  margin-bottom: 20px;
  text-align: center;
  color: #007acc;
  background-color: white;
}

#todaywaittimes {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  justify-content: center;
}

.waittime-box {
  width: calc(100% / 12 - 5px);
  text-align: center;
  border-radius: 0;
  overflow: hidden;
}

.waittime-box .timebox {
  background-color: #f0f0f0;
  color: #000;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  line-height: 1;
}

.waittime-box .waittimebox {
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  line-height: 1;
}

/* === 待ち時間カラー === */
.waittimebox.gray      { background-color: #999;    color: #fff; }
.waittimebox.dark      { background-color: #000;    color: #fff; }
.waittimebox.lightgray { background-color: #eee;    color: #000; }
.waittimebox.lightblue { background-color: #b3e5fc; color: #fff; }
.waittimebox.blue      { background-color: #03a9f4; color: #fff; }
.waittimebox.green     { background-color: #8bc34a; color: #fff; }
.waittimebox.yellow    { background-color: #fff176; color: #000; }
.waittimebox.pink      { background-color: #f8bbd0; color: #fff; }
.waittimebox.hotpink   { background-color: #ec407a; color: #fff; }
.waittimebox.red       { background-color: #f44336; color: #fff; }

/* === ボタン・セレクター === */
.selector-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 10px;
  background-color: #fff;
}

.left-button,
.right-selector {
  flex: 1 1 48%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.common-button {
  width: 90%;
  max-width: 300px;
  padding: 10px 14px;
  font-size: 16px;
  background-color: #007acc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  appearance: none;
}

.common-button:hover {
  background-color: #005fa3;
}

.common-button:focus {
  outline: 2px solid #007acc;
}

/* === スマホ対応（767px以下）=== */
@media (max-width: 1024px) {
  #facility-name { font-size: 20px; }
  .subtitle { font-size: 16px; }

  .main-container {
    display: flex;
    flex-wrap: wrap;
  }

  .left-container {
    width: 100%;
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .center-container {
    width: 45%;
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
  }

  .right-container {
    width: 45%;
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
  }

  .center-container {
    order: 1;
  }

  .right-container {
    order: 2;
  }

  .thumbnail-container img {
    width: 70%;
  }

  .info-container .tag {
    font-size: 12px;
    padding: 3px 30px;
    border-radius: 5px;
    text-align: center;
  }

  .label {
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 5px;
  }

  .value {
    font-size: 15px;
  }

  #current-time {
    font-size: 30px;
    padding: 5px;
    width: 80%;
    margin: 0 auto 0 0;
  }

  .update-time {
    font-size: 14px;
  }

  .waittime-container h2 {
    font-size: 25px;
    margin-bottom: 10px;
  }

  #todaywaittimes {
    gap: 1px;
  }

  .waittime-box {
    width: calc(100% / 12 - 1px);
  }

  .waittime-box .timebox {
    font-size: 10px;
    height: 16px;
  }

  .waittime-box .waittimebox {
    font-size: 14px;
    height: 18px;
  }

  .waittime-container {
    max-width: 100%;
    padding: 1px;
  }

  #today-waittimes-container {
    max-width: 96%;
    margin: 20px auto;
    padding: 1px;
  }

  #facility-tags {
    display: none;
  }

  .right-container .metric-container {
    display: flex;
  }

  .right-container .info-container {
    display: none;
  }

  #facility-tags {
    display: none !important;
  }
}
