@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #070a13;
  --bg-gradient: radial-gradient(circle at 50% 0%, #0f162a 0%, #070a13 100%);
  --panel-bg: rgba(15, 22, 38, 0.6);
  --panel-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* デフォルト値（JSによりフィギュア固有の値に変更可能） */
  --accent-h: 215;
  --accent-s: 90%;
  --accent-l: 60%;
  --accent-color: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);
  --accent-glow-strong: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #070a13;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* グラスモルフィズムコンテナ共通 */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}

/* ヘッダー・ナビゲーション */
header {
  max-width: 2200px; /* 4Kモニター向けに最大幅を2200pxに拡張 */
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.back-button:hover {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}
.container {
  max-width: 2200px; /* 4Kモニター向けに最大幅を2200pxに拡張 */
  margin: 0 auto;
  padding: 40px 40px 0; /* ヘッダー削除に伴い、上部に40pxの余白を追加 */
  display: grid;
  grid-template-columns: 1fr 420px; /* ワイド画面でサイドバーを見やすい幅に調整 */
  gap: 40px;
  transition: var(--transition-smooth);
}

@media (max-width: 1400px) {
  .container {
    max-width: 1300px;
    grid-template-columns: 1fr 380px;
    gap: 32px;
  }
}

@media (max-width: 1200px) {
  .container {
    max-width: 1100px;
  }
}

@media (max-width: 992px) {
  .container {
    grid-template-columns: 1fr;
    padding: 24px 20px 0; /* スマホ画面用に上部の余白を24pxに調整 */
  }
}

/* JSで横並びが指定されている場合、幅が狭くても2カラムを維持する */
.container.has-sidebar {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

/* 画面幅が狭いデバイス（スマホ横持ちなど）での2カラム調整 */
@media (max-width: 992px) {
  .container.has-sidebar {
    grid-template-columns: 1fr 280px; /* 横幅が狭いためサイドバーを280pxに縮小 */
    gap: 20px;
    padding: 0 20px;
  }
  
  .container.has-sidebar .sidebar {
    position: static; /* 低画面高でのスタックを防ぎ、通常のスクロールフローに載せる */
  }

  /* 横持ちかつ低身長の画面（高さ500px以下）での余白・行間の極小化 */
  @media (max-height: 500px) {
    .container.has-sidebar {
      gap: 16px;
    }
    .main-content {
      gap: 20px;
    }
    .specs-panel, .links-panel {
      padding: 20px;
    }
    .specs-row .specs-label, 
    .specs-row .specs-value {
      padding: 8px 0; /* スペック表の行間をさらにコンパクトに */
    }
    .figure-overview {
      margin-bottom: 16px;
    }
  }
}

/* メインカラム */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0; /* Flexbox/Grid 内の画像縮小バグ防止 */
  width: 100%;
}

@media (max-width: 1400px) {
  .main-content {
    gap: 32px;
  }
}

/* 高解像度モニターでのレイアウト拡大 */
@media (min-width: 1800px) {
  .specs-value {
    font-size: 1rem;
  }
}

/* フィギュア基本情報タイトル */
.figure-title-section {
  padding: 32px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  text-shadow: 0 0 8px var(--accent-glow);
}

.figure-series {
  font-size: clamp(0.75rem, 1vw + 0.3rem, 0.9rem);
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.figure-name {
  font-size: clamp(1.5rem, 3vw + 0.8rem, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* セクション共通見出し */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.05em;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-color);
}

/* ベストショットエリア */
.best-shot-section {
  padding: 24px;
}

.best-shot-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #03050a;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.best-shot-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.best-shot-container:hover .best-shot-image {
  transform: scale(1.03);
}

/* 360度ビューアセクション */
.viewer-360-section {
  padding: 32px;
}

.viewer-360-container {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #03050a;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
}

.viewer-360-container:active {
  cursor: grabbing;
}

.viewer-360-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: none;
}

.viewer-360-image.active {
  display: block;
}

.viewer-360-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.viewer-360-slider-container {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.viewer-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.viewer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
  cursor: pointer;
  transition: transform 0.1s;
}

.viewer-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ギャラリーセクション */
.gallery-section {
  padding: 32px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #03050a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.gallery-item:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* サイドバー */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  height: fit-content;
  position: sticky;
  top: 32px;
}

@media (max-width: 992px) {
  .sidebar {
    position: static;
  }
}

/* 概要・スペックパネル */
.specs-panel {
  padding: 32px;
}

.figure-overview {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 28px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-row:last-child {
  border-bottom: none;
}

.specs-label {
  padding: 14px 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 110px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.specs-value {
  padding: 14px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}

/* 関連リンクパネル */
.links-panel {
  padding: 32px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.custom-link-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-2px);
}

.custom-link-btn span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-link-btn .arrow-icon {
  font-size: 1.1rem;
  transition: transform 0.3s;
}

.custom-link-btn:hover .arrow-icon {
  transform: translateX(4px);
}

/* ライトボックス (画像拡大モーダル) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 5, 10, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-slider-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  touch-action: none; /* 標準のスワイプ判定を無効化し、JSでフリック処理 */
}

.lightbox-slider {
  display: flex;
  width: 300%;
  height: 100%;
  gap: 40px; /* スライド間の黒い隙間 */
  will-change: transform;
  flex-shrink: 0;
}

.lightbox-slide {
  width: 33.333%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.lightbox-img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, opacity;
}

.lightbox-close {
  position: absolute;
  top: 40px;
  right: 40px;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
  z-index: 1010;
}

.lightbox-close:hover {
  opacity: 1;
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-glow-strong);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(7, 10, 19, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  z-index: 1010;
  backdrop-filter: blur(8px);
}

.lightbox-nav:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 20px var(--accent-color);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 40px;
}

.lightbox-next {
  right: 40px;
}

@media (max-width: 768px) {
  .lightbox-prev {
    left: 20px;
  }
  .lightbox-next {
    right: 20px;
  }
  .lightbox-close {
    top: 20px;
    right: 20px;
  }
}

/* 直リンク時の年齢制限オーバーレイ */
.direct-age-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 5, 10, 0.98); /* 背後を完全ブロック */
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* 年齢制限共通スタイル（index.cssと統一） */
.direct-age-gate-overlay .age-gate-content {
  position: relative;
  max-width: 480px;
  width: 90%;
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 0 25px rgba(239, 68, 68, 0.15) !important;
  --accent-color: #ef4444;
}

.direct-age-gate-overlay .age-gate-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  line-height: 1;
}

.direct-age-gate-overlay .age-gate-close:hover {
  color: #ef4444;
}

.direct-age-gate-overlay .age-gate-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ef4444;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.direct-age-gate-overlay .age-gate-icon {
  font-size: 3rem;
  font-weight: 800;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid #ef4444;
  color: #ef4444;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.direct-age-gate-overlay .age-gate-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.direct-age-gate-overlay .age-gate-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.direct-age-gate-overlay .age-btn {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.direct-age-gate-overlay .age-yes {
  background: #ef4444;
  border: 1px solid #ef4444;
  color: white;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.direct-age-gate-overlay .age-yes:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.direct-age-gate-overlay .age-no {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.direct-age-gate-overlay .age-no:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}/* SPECIFICATIONS & LINKS アスペクト比レスポンシブ用のフレーム解除スタイル */
.specs-panel.no-frame,
.links-panel.no-frame {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 16px 0;
  width: 100%;
}

.specs-panel.no-frame:hover,
.links-panel.no-frame:hover {
  border-color: transparent;
  box-shadow: none;
}
/* no-frame時のスペックテーブルの改善（2列グリッド、改行幅の縮小、フォント調整） */
.specs-panel.no-frame .specs-table {
  display: block;
  max-width: 800px;
  margin: 0 auto;
}

.specs-panel.no-frame .specs-table tbody {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  width: 100%;
}

.specs-panel.no-frame .specs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0; /* 改行幅（パディング）を大幅に縮小 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-panel.no-frame .specs-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: auto;
  text-align: left;
  padding: 0;
}

.specs-panel.no-frame .specs-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: right;
  padding: 0;
}

/* 非常に狭い画面（例えばスマホの480px以下）では、2列だと窮屈になるため1列に戻す */
@media (max-width: 480px) {
  .specs-panel.no-frame .specs-table tbody {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .specs-panel.no-frame .specs-row {
    padding: 7px 0;
  }
}

/* ギャラリー縦3列強制スタイル */
.gallery-grid.three-columns {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px;
}

/* ベストショット拡大モーダル */
.bestshot-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 5, 10, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bestshot-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.bestshot-lightbox-content {
  width: 100%;
  height: 100%;
  overflow: auto;
  cursor: grab;
  user-select: none;
  display: flex;
  touch-action: none; /* ブラウザ標準のパン・軸ロックを無効化 */
}

.bestshot-lightbox-content.grabbing {
  cursor: grabbing;
}

.bestshot-lightbox-img {
  display: block;
  margin: auto; /* はみ出さないときは中央、はみ出したらスクロール可能にするためのFlex中央配置ハック */
  max-width: none;
  max-height: none;
  flex-shrink: 0;
}

.bestshot-lightbox-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 10, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  z-index: 2010;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  letter-spacing: 0.05em;
  opacity: 0;
}

/* 360度ビューア拡大モーダル */
.view360-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 5, 10, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.view360-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.view360-lightbox-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.view360-lightbox-viewer {
  width: 100%;
  height: 100%;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.view360-lightbox-viewer.grabbing {
  cursor: grabbing;
}

.view360-lightbox-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: none;
}

.view360-lightbox-viewer img.active {
  display: block;
}

.view360-lightbox-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 10, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  z-index: 2010;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  letter-spacing: 0.05em;
  opacity: 0;
}

/* ギャラリー全幅表示（スマホ横持ち時の最適化） */
.gallery-section.full-width {
  max-width: 2200px;
  width: auto;
  margin: 0 auto;
  padding: 32px 40px;
}

.gallery-section.full-width .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 12px;
}

@media (max-width: 992px) {
  .gallery-section.full-width {
    padding: 24px 20px;
  }
}

/* ギャラリー拡大モーダルのスムーズ切り替えアニメーション */
.lightbox-slider.transitioning {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-img.transitioning {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.transitioning {
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ドラッグ中の画像縮小防止 */
.lightbox.active-drag .lightbox-img {
  max-width: 100%;
}

/* スマホ縦長画面（vertical-layout）時のファーストビュービジュアル最適化 */
@media (max-width: 768px) {
  .vertical-layout .figure-title-section {
    padding: 20px;
    margin-bottom: 12px;
  }
  
  .vertical-layout .figure-name {
    font-size: clamp(1.1rem, 4vw + 0.5rem, 1.5rem);
  }

  .vertical-layout .figure-series {
    font-size: clamp(0.7rem, 2vw + 0.3rem, 0.85rem);
  }
  
  .vertical-layout .best-shot-section {
    padding: 12px;
  }

  .vertical-layout .specs-panel.no-frame {
    padding: 16px 4px 8px;
  }
  
  .vertical-layout .viewer-360-section {
    padding: 20px 12px;
  }

  .vertical-layout .gallery-section {
    padding: 20px 12px;
  }
}

/* スマホ横長画面（低画面高 max-height: 540px）でのファーストビュー最適化 */
@media (max-height: 540px) {
  .figure-title-section {
    padding: 16px 20px;
  }
  .tag-list {
    margin-bottom: 8px;
  }
  .figure-series {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }
  .figure-name {
    font-size: 1.4rem;
  }
  .best-shot-section {
    padding: 16px;
  }
}

/* 詳細ページの下部フッター（ポータルに戻るボタン） */
.detail-footer {
  max-width: 2200px;
  margin: 60px auto 40px;
  padding: 0 40px;
  text-align: center;
}

.bottom-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 36px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.bottom-back-button:hover {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 20px var(--accent-glow-strong);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .detail-footer {
    margin: 40px auto 30px;
    padding: 0 20px;
  }
  .bottom-back-button {
    font-size: 1.0rem;
    padding: 12px 28px;
    width: 100%; /* スマホ画面でタップしやすいように横幅いっぱいに広げる */
  }
}

/* Prevent blue text selection and image ghost dragging in 360 viewer and lightbox */
.viewer-360-container,
.viewer-360-container img,
.view360-lightbox,
.view360-lightbox * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-user-drag: none !important;
}

/* ====================================================
   360度ビューア オンデマンド・ロード対応スタイル
   ==================================================== */

/* アクティベーション用オーバーレイ */
.viewer-360-activation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 10, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.viewer-360-activation-overlay:hover {
  background: rgba(3, 5, 10, 0.35);
}

.viewer-360-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(7, 10, 19, 0.85);
  border: 1px solid var(--accent-color);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 0 15px var(--accent-glow), inset 0 0 10px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.viewer-360-activation-overlay:hover .viewer-360-btn {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--accent-color);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

/* ローディングスピナー */
.viewer-360-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 500;
  pointer-events: none;
}

.spinner-icon {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin-360 0.8s linear infinite;
  box-shadow: 0 0 8px var(--accent-glow);
}

@keyframes spin-360 {
  to { transform: rotate(360deg); }
}

/* インライン用ビューアの画像透過切り替えフェード */
.viewer-360-container img {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.viewer-360-container img.active {
  opacity: 1;
}

/* アクティブ時のカーソル表示 */
.viewer-360-container.active-viewer {
  cursor: grab;
}
.viewer-360-container.active-viewer:active {
  cursor: grabbing;
}

/* 未アクティブ時はドラッグ案内オーバーレイを非表示にする */
.viewer-360-container:not(.active-viewer) .viewer-360-overlay {
  display: none !important;
}

/* iPadなどの縦向き表示時（vertical-layout）に右余白ができるのを防ぐため、グリッド列を1列に強制 */
.container.vertical-layout {
  grid-template-columns: 1fr !important;
}

/* iOS/Safariでのfixedモーダルはみ出しによるドキュメント全体の横スクロール（右余白）バグ防止 */
.lightbox,
.bestshot-lightbox,
.view360-lightbox {
  overflow: hidden;
}

/* no-frame（縦長）時にテーブル行がiOS/Safariで押し出されてはみ出すバグを防止 */
.specs-panel.no-frame .specs-row {
  width: 100%;
  box-sizing: border-box;
}

/* Lightboxの無操作（静止）時に左右の隣スライドの画像をフェードアウト非表示にする */
.lightbox-slide.prev-slide img,
.lightbox-slide.next-slide img {
  opacity: 0;
  transition: opacity 0.2s ease; /* フェードアウトをスライド移動(300ms)の間に完了させるため0.2秒に設定 */
}

/* ドラッグ中のみ左右の画像をフェードイン表示する（指を離した後のスライド移動中にフェードアウトさせます） */
.lightbox.is-dragging .lightbox-slide.prev-slide img,
.lightbox.is-dragging .lightbox-slide.next-slide img {
  opacity: 1;
  transition: none; /* ドラッグ開始時は瞬時に表示 */
}

/* スライド切り替えアニメーション中（next）の不透明度制御 */
.lightbox.sliding-to-next .lightbox-slide.next-slide img {
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.sliding-to-next .lightbox-slide.prev-slide img {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* スライド切り替えアニメーション中（prev）の不透明度制御 */
.lightbox.sliding-to-prev .lightbox-slide.prev-slide img {
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.sliding-to-prev .lightbox-slide.next-slide img {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* センタリングスクロール中（stay）の不透明度制御 */
.lightbox.sliding-to-stay .lightbox-slide.prev-slide img,
.lightbox.sliding-to-stay .lightbox-slide.next-slide img {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}




