html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, "Noto Sans JP", sans-serif;
  background: rgba(0, 0, 0);
  background-size: cover;
  /* 画面全体に画像を拡大してフィット */
  background-position: center;
  /* 中央に配置 */
  background-repeat: no-repeat;
  /* 繰り返しなし */
}

#vrFrame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 0;
}

/* ローディング */
#loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1000px 600px at 70% 30%, rgba(255, 255, 255, .06), transparent 60%),
    radial-gradient(900px 600px at 20% 70%, rgba(255, 255, 255, .05), transparent 60%),
    rgba(10, 20, 12, 0.7);
  backdrop-filter: blur(2px);
  z-index: 9999;
  color: #fff;
  transition: opacity .1s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  padding: 16px 20px;
}

.school {
  font-weight: 700;
  letter-spacing: .18em;
  font-size: clamp(14px, 2.3vw, 16px);
  color: #e8fff0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

#motto {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 32px);
  font-weight: 800;
  letter-spacing: .18em;
  line-height: 1.4;
}

#motto .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.35em);
  animation: rise .6s ease forwards;
  animation-delay: calc(var(--i) * .07s);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress {
  position: relative;
  width: min(70vw, 420px);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 4px 14px rgba(0, 0, 0, .18);
  margin-top: 10px;
}

.bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #88ffb0, #46d07a 60%, #2aa15a);
  border-radius: 999px 0 0 999px;
  transition: width 60ms linear;
}

.percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, .95);
  letter-spacing: .08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* HUD */
.hud {
  position: fixed;
  top: 5px;
  right: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
}

.clock {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.time-label {
  width: 160px;
  height: auto;
  object-fit: contain;
}

.logo {
  width: 180px;
  object-fit: contain;
}

/* 右列メニュー */
#sidebar {
  position: fixed;
  top: 140px;
  right: 10px;
  width: 170px;
  z-index: 5;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item {
  all: unset;
  display: block;
  text-align: center;
  font-weight: 700;
  letter-spacing: .12em;
  color: #fff;
  padding: 5px 2px;
  border-radius: 9px;
  background: rgba(41, 104, 41, .82);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
  cursor: pointer;
  transform: translateZ(0);
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.item:hover {
  background: rgba(41, 104, 41, .9);
}

.item.is-active {
  transform: scale(1.1);
  background: rgba(27, 73, 27, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  z-index: 1;
}

/* グループ内のボタンを黄色で強調 */
.item.is-group {
  background: rgba(255, 210, 70, 0.85);
  color: #222;
  border-color: #fffcc5;
  /*box-shadow: 0 0 10px rgba(255, 220, 80, 0.6);*/
}

.item.is-group.is-active {
  background: rgba(255, 200, 30, 0.95);
  transform: scale(1.1);
  /*box-shadow: 0 0 18px rgba(255, 200, 50, 0.9)*/
}

/*　ここから左下ナビゲーション　*/
/* 左下ナビゲーション */
#bottom-nav {
  position: fixed;
  left: 5%;
  bottom: 20%;
  display: flex;
  gap: 30px;
  align-items: flex-end;
  /* テキストの下端を揃える */
  z-index: 3;
}

#bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  /* 上→下に並べる */
  align-items: center;
  cursor: pointer;
}

#bottom-nav .label {
  font-size: 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  /* ← 半透明の背景 */
  padding: 2px 8px;
  border-radius: 6px;
  /* 角を少し丸く */
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
  margin-bottom: 6px;
  font-weight: 600;
  pointer-events: none;
}

#bottom-nav .nav-btn {
  width: 60px;
  height: 60px;
  opacity: 0.8;
  transition: transform 0.2s, opacity 0.2s;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
}

#bottom-nav .nav-btn:hover {
  transform: scale(1.15);
  opacity: 1;
}

/* スマホ対応（中央に寄せる） */
@media (max-width: 600px) {
  #bottom-nav {
    left: 50%;
    bottom: 10%;
    transform: translateX(-50%);
    gap: 60px;
  }

  #bottom-nav .nav-btn {
    width: 50px;
    height: 50px;
  }

  #bottom-nav .label {
    font-size: 13px;
  }
}

/* 矢印を半透明で点滅(誘導用アニメーション制御) */
@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

#bottom-nav .nav-btn {
  animation: pulse 2s infinite ease-in-out;
}

/* 環境でメニューを縮小（幅も位置も調整） */
/* ノートPCのみ（769px〜1280px） */
@media (min-width: 769px) and (max-width: 1280px) {
  #sidebar {
    transform: scale(0.8);
    /* ← 縮小 */
    transform-origin: top right;
    /* ← 位置ズレ防止 */
  }

  .hud {
    transform: scale(0.8);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 3px;
    /* 位置補正（調整可） */
    top: 5px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }

  #popupBox {
    width: 300px;
  }
}

@media (max-width: 768px) {
  #sidebar {
    transform: scale(0.7);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 3px;
    /* 位置補正（調整可） */
    top: 90px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }

  .item {
    /* font-size: 10px; */
    padding: 3px 0;
    /* letter-spacing: .06em; */
    /* 字間を詰める場合 */
  }

  .hud {
    transform: scale(0.7);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 3px;
    /* 位置補正（調整可） */
    top: 5px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }
}

@media (max-width: 600px) {
  #sidebar {
    transform: scale(0.6);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 3px;
    /* 位置補正（調整可） */
    top: 90px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }

  .item {
    /* font-size: 10px; */
    padding: 3px 0;
    /* letter-spacing: .06em; */
    /* 字間を詰める場合 */
  }

  .hud {
    transform: scale(0.6);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 3px;
    /* 位置補正（調整可） */
    top: 5px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }
}

@media (max-width: 390px) {
  #sidebar {
    transform: scale(0.5);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 5px;
    /* 位置補正（調整可） */
    top: 75px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }

  .item {
    /* font-size: 10px; */
    padding: 3px 0;
    /* letter-spacing: .06em; */
    /* 字間を詰める場合 */
  }

  .hud {
    transform: scale(0.5);
    transform-origin: top right;
    /* 右上を基準に縮小 */
    right: 3px;
    /* 位置補正（調整可） */
    top: 5px;
    /* 位置補正（調整可） */
    /* width: 120px; */
    /* 横幅を狭めるなら */
  }

  #popupBox {
    width: 300px;
  }
}

/*　ここからポップアップ　*/
/* ===== オーバーレイ（iframe より上） ===== */
.overlay {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  /* 最初は非表示 */
  justify-content: center;
  align-items: center;
  z-index: 10;
  /* iframeより上に表示 */
  background: rgba(0, 0, 0, 0.3);
  /* 背景を透明にした状態で半透明の黒に */
}

/* 背景画像レイヤー */
.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('infobimg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* filter: blur(2px);
  opacity: 0.85; */
}

#popupBox {
  position: relative;
  /* ボタンを内部で絶対配置するために必要 */
  color: #fff;
  /* 文字色を白に */
  font-family: "Meiryo", "ヒラギノ角ゴシック W3", "MS PGothic", sans-serif;
  /* 明朝体に */
  overflow: auto;
  /* はみ出した場合にスクロール */
  background: rgba(41, 104, 41, 0.7);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  line-height: 1.5;
  animation: fadeIn .25s ease-out;
  z-index: 1;
  /* popupBoxがoverlayより上に表示される */
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

#popupTitle {
  font-size: 17px;
  margin: 0 0 5px 0;
}

#popupText {
  font-size: 13px;
  margin: 3px 0 0 0;
}

#popupBox img {
  max-width: 100%;
  max-height: 450px;
  margin: 5px 0;
  border-radius: 5px;
  border: 2px solid #fff;
  /* 白い縁取り */
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
  /* 影をつける場合 */
  box-sizing: border-box;
  /* ←追加 */
  display: block;
  /* ←余白ズレ防止 */
}

#popupClose {
  position: absolute;
  top: 15px;
  /* 上からの距離 */
  right: 15px;
  /* 右からの距離 */
  padding: 5px 10px;
  background: rgba(0, 90, 60, 0.3);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.slider {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.slides {
  display: flex;
  transition: transform 0.4s ease;
}

.slides img {
  width: 100%;
  flex-shrink: 0;
  object-fit: cover;
}

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 60, 40, 0.7);
  color: #fff;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}

.slide-btn.prev {
  left: 10px;
}

.slide-btn.next {
  right: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1980px) {
  #popupBox {
    width: 90%;
    max-width: 800px;
  }
}

@media (max-width: 1280px) {
  #popupBox {
    width: 75%;
  }
}

@media (max-height: 800px) {
  #popupBox {
    width: 40%;
  }
}

@media (max-height: 700px) {
  #popupBox {
    width: 30%;
    max-width: 500px;
    min-width: 420px;
  }
}

@media (max-height: 550px) {
  #popupBox {
    width: 25%;
    max-width: 500px;
    min-width: 420px;
  }
}

@media (max-height: 450px) {
  #popupBox {
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  #popupBox {
    width: 85%;
  }
}

@media (max-height: 700px) and (max-width: 768px) {
  #popupBox {
    width: 30%;
    max-width: 500px;
    min-width: 420px;
  }
}

@media (max-height: 550px) and (max-width: 768px) {
  #popupBox {
    width: 30%;
    max-width: 500px;
    min-width: 420px;
  }
}

@media (max-height: 400px) {
  #popupBox {
    min-width: 200px;
  }
}

@media (max-height: 350px) {
  #popupBox {
    min-width: 180px;
  }
}

@media (max-width: 600px) {
  #popupBox {
    width: 85%;
  }
}

@media (max-width: 390px) {
  #popupBox {
    min-width: 280px;
  }
}