@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-Thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
}

@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-DemiLight.otf") format("opentype");
  font-weight: 350;
  font-style: normal;
}

@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Noto Sans CJK JP";
  src: url("assets/fonts/NotoSansCJKjp/NotoSansCJKjp-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans CJK JP", sans-serif;
  font-feature-settings: "palt";
  background: #000;
  overflow: hidden;
}

#container {
  width: 100vw;
  height: 100vh;
  position: relative;
}



/* カバーキャンバス（中央トリミング。画面を"覆う"ように拡大） */
body.cover-canvas {
  background: #000;
  overflow: hidden;
}
body.cover-canvas #container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* 16:9 キャンバスでビュー全体を覆う（余りはトリミング） */
  width: max(100vw, calc(100vh * (16 / 9)));
  height: max(100vh, calc(100vw * (9 / 16)));
  aspect-ratio: 16 / 9;
}



#panorama {
  width: 100%;
  height: 100%;
}

/* Pannellumコンテナのカスタマイズ */
.pnlm-container {
  cursor: grab !important;
}

.pnlm-container:active {
  cursor: grabbing !important;
}




/* カスタムコントロール */
.controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

/* 前後ボタン関連のスタイルは削除 */

/* 画像情報パネル（左下） */
.image-info-panel {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  left: calc(env(safe-area-inset-left, 0px) + 20px);
  background: transparent;
  color: #f7f7f7;
  padding: 0;
  z-index: 100;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.image-info-panel.show {
  opacity: 1;
}

.image-info-panel .campus-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  color: #ffffff;
  line-height: 1.15;
  background: transparent;
  padding: 0;
  position: relative;
  height: 74px;
}

.image-info-panel .campus-logo {
  width: 160px;
  height: 65.2px;
  border: none;
  outline: none;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  /* シンプルにdrop-shadowを適用 */
  filter: drop-shadow(0px 0px 25px rgba(70, 70, 90, 0.9));
  -webkit-filter: drop-shadow(0px 0px 25px rgba(70, 70, 90, 0.9));
}

.image-info-panel .image-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: #ffffff;
  background: transparent;
  padding: 0;
  text-shadow: 0 0px 5px rgba(0, 0, 0, 0.4);
  border: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.image-info-panel .view-params {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 8px;
  margin-top: 8px;
}

.image-info-panel .view-params p {
  margin: 3px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

/* キャプション（左下） */
.caption-panel {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5px);
  left: calc(env(safe-area-inset-left, 0px) + 5px);
  color: #ffffff;
  font-size: 10px;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  display: flex;
  align-items: center;
  gap: 8px;
}

.caption-panel.show {
  opacity: 1;
}

.caption-panel .mail-link {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.caption-panel .mail-link:hover {
  opacity: 0.7;
}

.caption-panel .mail-link svg {
  height: 1em;
  width: auto;
  display: block;
}

/* デバッグモード - デスクトップでも右上配置オプション */
body.debug-mode .image-info-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  right: calc(env(safe-area-inset-right, 0px) + 20px);
  left: auto;
  bottom: auto;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  max-width: 320px;
}

body.debug-mode .image-info-panel .view-params {
  display: block;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {

  .image-info-panel {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: calc(env(safe-area-inset-left, 0px) + 10px);
    right: auto;
    min-width: auto;
    font-size: 13px;
  }

  .image-info-panel .campus-name {
    font-size: 22px;
    margin-bottom: 6px;
    height: 55.5px;
  }

  .image-info-panel .campus-logo {
    width: 120px;
    height: 48.9px;
    /* drop-shadowは継承されるので再定義不要 */
  }

  .image-info-panel .view-params {
    display: none !important;
  }

  /* デバッグモード時はモバイルでもパラメータを表示（右上配置） */
  body.debug-mode .image-info-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    left: auto;
    bottom: auto;
    max-width: 250px;
    background: rgba(0, 0, 0, 0.95);
    padding: 10px 12px;
  }

  body.debug-mode .image-info-panel .image-title {
    font-size: 14px;
  }

  body.debug-mode .image-info-panel .view-params {
    display: block !important;
    font-size: 11px;
  }

  body.debug-mode .image-info-panel .view-params p {
    margin: 2px 0;
    font-size: 11px;
  }

  .controls {
    bottom: 10px;
    right: 10px;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    max-width: calc(100vw - 20px);
  }

  /* 前後ボタン関連のレスポンシブスタイルは削除 */
}

/* VRモード用スタイル */
.vr-mode .info-panel,
.vr-mode .controls {
  opacity: 0.3;
}

/* 不要なPannellum標準タイトルを非表示 */
.pnlm-title-box { display: none !important; }
/* コンパスを強制的に非表示（保険） */
.pnlm-compass { display: none !important; }

/* 右上ボタングループ */
.top-right-buttons {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 11900;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.top-right-buttons.show {
  opacity: 1;
}

/* モーダル表示中はボタンを無効化して背面へ */
body.index-modal-open .top-right-buttons {
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* ヘルプボタン */
#openHelpBtn {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  backdrop-filter: none;
  transition: all 0.2s ease;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#openHelpBtn:hover {
  transform: translateY(-1px);
}

#openHelpBtn:active {
  transform: translateY(0);
}

#openHelpBtn svg {
  width: 44px;
  height: 44px;
}

/* 目次ボタン */
#openIndexBtn {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  backdrop-filter: none;
  transition: all 0.2s ease;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#openIndexBtn:hover {
  transform: translateY(-1px);
}

#openIndexBtn:active {
  transform: translateY(0);
}

#openIndexBtn svg {
  width: 44px;
  height: 44px;
}

/* モーダル全体 */
#indexModalOverlay {
  position: fixed; inset: 0; display: none;
  background: rgba(0,0,0,0.5);
  z-index: 14000;
}
#indexModalOverlay.show { display: block; }
#indexModal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 85vw;
  box-sizing: border-box; /* 枠線込みで計算して微小なはみ出しを防止 */
  height: 85%;
  max-height: 85vh;
  display: grid;
  grid-template-rows: auto auto 1fr; /* header, tabs, body */
  background: rgba(15,15,15,0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}
/* タブ（階層） */
.index-modal-tabs { position: sticky; top: 0; z-index: 1; background: rgba(15,15,15,0.96); }
.index-tabs { display: flex; gap: 0.5%; overflow-x: auto; padding: 1% 1.2%; scrollbar-width: thin; }
.index-tab {
  display: inline-flex; align-items: center; gap: 0.4%;
  padding: 0.5% 1%; border-radius: 999px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06); color: #fff; font-size: 0.8em; cursor: pointer;
  white-space: nowrap; user-select: none; transition: background .15s ease, transform .1s ease;
}
.index-tab:hover { background: rgba(255,255,255,0.12); }
.index-tab:active { transform: translateY(1px); }
.index-tab.active { background: rgba(74,144,226,0.25); border-color: rgba(74,144,226,0.5); }
.index-modal-header {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 1% 1.5%;
  position: relative; z-index: 2; background: rgba(15,15,15,0.96);
}
#closeIndexBtn {
  background: transparent; color: #fff; border: none; cursor: pointer;
  font-size: 1.25em; line-height: 1; padding: 0.5% 1%;
}
.index-modal-body { min-height: 0; overflow: auto; }
#indexList { list-style: none; }
/* PC向けカードグリッド */
#indexList {
  display: grid;
  row-gap: 12px;
  column-gap: 16px;
  padding: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* PC: 4列固定 */
}
.index-item { list-style: none; cursor: pointer; border: 0; padding: 0; background: transparent; position: relative; min-width: 0; }
.index-item.active .index-card-thumb { outline: 2px solid rgba(74,144,226,0.8); }
.index-card-thumb {
  width: 100%; aspect-ratio: 16/9; border-radius: 8px; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center;
  color: #e5e7eb; font-weight: 600; letter-spacing: 0.2px;
  transition: transform .15s ease, border-color .2s ease;
  position: relative; overflow: hidden;
}
.index-card-thumb img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  border-radius: 8px;
}
.index-item:hover .index-card-thumb { transform: translateY(-1px); border-color: rgba(255,255,255,0.28); }
.index-card-title {
  font-size: 0.85em; text-align: center; padding: 0 5%;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 2px 8px rgba(0,0,0,0.6);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.index-text { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 768px) {
  .top-right-buttons {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    gap: 6px;
  }

  #openHelpBtn,
  #openIndexBtn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  #indexModal {
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    grid-template-rows: auto auto 1fr;
  }
  .index-modal-body { min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .index-tab {
    font-size: 3.5vw;
    padding: 2vw 3vw;
    gap: 1.5vw;
  }
  #indexList {
    row-gap: 12px;
    column-gap: 14px;
    padding: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Mobile: 2列固定 */
  }
  .index-card-title {
    font-size: 0.7em;
    padding: 0 3%;
    white-space: normal;
    line-height: 1.5;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
  }
  .index-card-title > * {
    max-height: calc(0.7em * 1.5 * 2);
    overflow: hidden;
  }
}

/* カスタムホットスポットスタイル */
.custom-hotspot {
  height: 30px;
  width: 30px;
  background-image: url('./assets/circle.svg');
  background-size: 30px 30px;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border-radius: 0;
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.5));
}

/* 波紋エフェクト用の疑似要素 */
.custom-hotspot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  animation: ripple 2s ease-out infinite;
}

.custom-hotspot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: ripple 2s ease-out infinite 1s;
}

.custom-hotspot:hover {
  opacity: 0.9;
  transform: scale(1.1);
}

/* 中心から外側に広がる波紋アニメーション */
@keyframes ripple {
  0% {
    width: 30px;
    height: 30px;
    opacity: 1;
    border-width: 2px;
  }
  100% {
    width: 60px;
    height: 60px;
    opacity: 0;
    border-width: 1px;
  }
}


/* 矢印ホットスポットスタイル */
.arrow-hotspot {
  height: 30px;
  width: 30px;
  background-image: url('./assets/arrow_circle_0d.svg'); /* デフォルト矢印 */
  background-size: 30px 30px;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border-radius: 0;
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.5));
}

.arrow-hotspot:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* 矢印ホットスポット用の波紋エフェクト */
.arrow-hotspot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  animation: ripple 2s ease-out infinite;
  z-index: -1; /* 矢印アイコンの背景に配置 */
}

.arrow-hotspot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: ripple 2s ease-out infinite 1s;
  z-index: -1; /* 矢印アイコンの背景に配置 */
}

/* 8方向の矢印アイコンクラス（詳細度を上げる） */
.arrow-hotspot.arrow-0d { background-image: url('./assets/arrow_circle_0d.svg') !important; }
.arrow-hotspot.arrow-45d { background-image: url('./assets/arrow_circle_45d.svg') !important; }
.arrow-hotspot.arrow-90d { background-image: url('./assets/arrow_circle_90d.svg') !important; }
.arrow-hotspot.arrow-135d { background-image: url('./assets/arrow_circle_135d.svg') !important; }
.arrow-hotspot.arrow-180d { background-image: url('./assets/arrow_circle_180d.svg') !important; }
.arrow-hotspot.arrow-225d { background-image: url('./assets/arrow_circle_225d.svg') !important; }
.arrow-hotspot.arrow-270d { background-image: url('./assets/arrow_circle_270d.svg') !important; }
.arrow-hotspot.arrow-315d { background-image: url('./assets/arrow_circle_315d.svg') !important; }

.custom-tooltip {
  visibility: hidden;
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  white-space: nowrap;
  font-size: 14px;
  z-index: 1000;
}

.custom-hotspot:hover .custom-tooltip {
  visibility: visible;
}

/* 矢印ホットスポット */
.arrow-hotspot {
  width: 40px;
  height: 40px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translate(-50%, -50%);
  }
  40% {
    transform: translate(-50%, -60%);
  }
  60% {
    transform: translate(-50%, -55%);
  }
}

/* 二段階クリック用のスタイル */
/* デフォルトツールチップを完全に非表示 */
.pnlm-tooltip {
  display: none !important;
}

/* ホットスポットの最小サイズ確保（タッチフレンドリー） */
.pnlm-hotspot {
  min-width: 44px !important;
  min-height: 44px !important;
  cursor: pointer;
}

/* カスタムホットスポットのスタイル */
.pnlm-hotspot.custom-hotspot {
  background-image: url('assets/circle.svg') !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  width: 32px !important;
  height: 32px !important;
  filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.5)) !important;
}

/* カスタムホットスポットのホバー効果 */
.pnlm-hotspot.custom-hotspot:hover {
  opacity: 0.8;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* カスタムツールチップ（二段階クリック用） */
.pannellum-custom-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Noto Sans CJK JP", sans-serif;
  z-index: 10000;
  pointer-events: auto; /* クリック可能にする */
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 250px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.pannellum-custom-tooltip:hover {
  background: rgba(0, 0, 0, 0.95);
  transform: scale(1.05);
}

.pannellum-custom-tooltip.visible {
  opacity: 1;
}

.tooltip-content {
  text-align: center;
}

.tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 20px;
}

.tooltip-instruction {
  font-size: 12px;
  opacity: 0.8;
  font-style: italic;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .pannellum-custom-tooltip {
    font-size: 13px;
    padding: 10px 14px;
  }

  .tooltip-title {
    font-size: 14px;
  }

  .tooltip-instruction {
    font-size: 11px;
  }

  .intro-content {
    gap: 30px;
  }

  .intro-title {
    width: auto;
    height: 60vh;
    max-width: 90vw;
    min-height: 300px;
  }

  .intro-start-button img {
    width: 140px;
    height: auto;
  }
}

/* 高さベースの調整（iPad横向きなど画面高さが低い場合） */
/* タブレット以上のデバイスで高さが900px以下の場合 */
@media (min-width: 769px) and (max-height: 900px) {
  .intro-title {
    height: 70vh;
    max-height: none;
  }

  .intro-content {
    gap: 35px;
  }
}

/* タブレット横向き（iPad横向きなど）*/
@media (min-width: 769px) and (max-height: 700px) {
  .intro-title {
    height: 50vh;
    max-height: 400px;
  }

  .intro-content {
    gap: 25px;
  }
}

/* スマホ横向き（極端に高さが低い場合のみ）*/
@media (max-width: 768px) and (max-height: 500px) {
  .intro-title {
    height: 30vh;
    max-height: 150px;
  }

  .intro-content {
    gap: 20px;
  }

  .intro-start-button img {
    width: 120px;
    height: auto;
  }
}

/* イントロ画面 */
.intro-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 動的ビューポート高さ（Safari対応） */
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  cursor: default;
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: none; /* ピンチズーム無効化 */
  -ms-touch-action: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro-screen.fade-out {
  animation: fadeOut 0.8s ease-out forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.intro-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none; /* ピンチズーム無効化 */
  -ms-touch-action: none;
}

.intro-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  z-index: 10;
}

.intro-title {
  width: 156px;
  filter: drop-shadow(0px 0px 100px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-start-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  position: relative;
}

.intro-start-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 25px;
  z-index: -1;
  transition: all 0.3s ease;
}

.intro-start-button img {
  width: 158px;
  height: 51px;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.3));
  transition: filter 0.3s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-start-button:hover {
  transform: scale(1.05);
}

.intro-start-button:hover::before {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.intro-start-button:hover img {
  filter: drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.5)) drop-shadow(0px 0px 20px rgba(255, 255, 255, 0.3));
}

.intro-start-button:active {
  transform: scale(0.98);
}

/* メインコンテナは最初非表示 */
#container {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

#container.show {
  opacity: 1;
}

/* フォトアルバムボタン */
.photo-album-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  cursor: pointer;
  z-index: 11900; /* 目次ボタンと同じレベル */
  user-select: none;
  -webkit-user-select: none;
}

.photo-album-btn.show {
  opacity: 1 !important;
}

/* モーダル表示中はボタンを無効化して背面へ */
body.index-modal-open .photo-album-btn {
  z-index: 1;
  pointer-events: none;
  opacity: 0.6 !important;
}

.photo-album-btn img {
  width: 118px;
  height: 47px;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.photo-album-btn:hover img {
  filter: brightness(1.2) drop-shadow(0px 0px 15px rgba(255, 255, 255, 0.5));
  transform: scale(1.05);
}

.photo-album-btn:active img {
  transform: scale(0.98);
}

/* モバイル対応 */
@media (max-width: 768px) {
  .photo-album-btn {
    bottom: 20px;
    right: 10px;
  }

  .photo-album-btn img {
    width: 88.5px;  /* 75% */
    height: 35.25px;
  }
}

/* フォトアルバムモーダル */
#photoAlbumModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  z-index: 25000; /* イントロ画面より上 */
  align-items: center;
  justify-content: center;
}

#photoAlbumModal.show {
  display: flex;
}

.photo-album-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-album-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none; /* iOS Safari */
  pointer-events: auto; /* クリックは有効 */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.photo-album-image.swiping {
  transition: none; /* スワイプ中はトランジションなし */
}

.photo-album-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  z-index: 10;
  touch-action: manipulation; /* ダブルタップズームを無効化 */
  -webkit-tap-highlight-color: transparent; /* タップ時のハイライトを無効化 */
}

.photo-album-close:hover {
  opacity: 0.6;
}

.photo-album-close::before,
.photo-album-close::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  background: #333;
  transition: background 0.3s ease;
}

.photo-album-close:hover::before,
.photo-album-close:hover::after {
  background: #000;
}

.photo-album-close::before {
  transform: rotate(45deg);
}

.photo-album-close::after {
  transform: rotate(-45deg);
}

.photo-album-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  touch-action: manipulation; /* ダブルタップズームを無効化 */
  -webkit-tap-highlight-color: transparent; /* タップ時のハイライトを無効化 */
}

.photo-album-nav:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.photo-album-nav.prev {
  left: 30px;
}

.photo-album-nav.next {
  right: 30px;
}

.photo-album-nav::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
}

.photo-album-nav.prev::before {
  border-width: 10px 15px 10px 0;
  border-color: transparent #333 transparent transparent;
  margin-right: 3px;
}

.photo-album-nav.next::before {
  border-width: 10px 0 10px 15px;
  border-color: transparent transparent transparent #333;
  margin-left: 3px;
}

.photo-album-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  padding: 0;
  border-radius: 0;
  z-index: 20;
  pointer-events: none; /* クリックイベントを透過 */
}

/* モバイル対応 */
@media (max-width: 768px) {
  #photoAlbumModal {
    height: 100%;
  }

  .photo-album-content {
    padding: 60px 20px;
  }

  .photo-album-image {
    max-width: 95%;
    max-height: calc(100vh - 120px);
  }

  .photo-album-close {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
  }

  .photo-album-close::before,
  .photo-album-close::after {
    width: 25px;
    height: 2.5px;
  }

  /* スワイプ操作があるので前後ボタンは非表示 */
  .photo-album-nav {
    display: none;
  }

  .photo-album-counter {
    top: 15px;
    left: 15px;
    font-size: 14px;
  }
}

/* チュートリアルオーバーレイ */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 15000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tutorial-overlay.show {
  display: flex;
  opacity: 1;
}

.tutorial-content {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  color: white;
  position: relative;
}

.tutorial-step {
  display: none;
  animation: fadeInStep 0.4s ease;
}

.tutorial-step[data-step].active {
  display: block;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tutorial-icon {
  margin: 0 auto 24px;
  display: block;
  opacity: 0.9;
}

.tutorial-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.tutorial-description {
  font-size: 15px;
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 32px;
}

.tutorial-steps-indicator {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.tutorial-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s ease, transform 0.3s ease;
}

.tutorial-step-dot.active {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.3);
}

.tutorial-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.tutorial-skip,
.tutorial-next {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Noto Sans CJK JP", sans-serif;
}

.tutorial-skip {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.tutorial-skip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.tutorial-next {
  background: rgba(74, 144, 226, 0.9);
  color: white;
}

.tutorial-next:hover {
  background: rgba(74, 144, 226, 1);
  transform: translateY(-1px);
}

.tutorial-next:active,
.tutorial-skip:active {
  transform: translateY(0);
}

/* モバイル対応 */
@media (max-width: 768px) {
  .tutorial-content {
    padding: 36px 28px;
    max-width: 90%;
  }

  .tutorial-icon {
    width: auto;
    height: auto;
    max-width: 88px;
    margin-bottom: 20px;
  }

  .tutorial-title {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .tutorial-description {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .tutorial-steps-indicator {
    margin-bottom: 24px;
  }

  .tutorial-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .tutorial-skip,
  .tutorial-next {
    width: 100%;
    padding: 14px 20px;
  }
}
