/* =========================================================================
   Unity WebGL Default Layout (Unityの標準キャンバス・フッター配置を維持)
   ========================================================================= */
body {
  padding: 0;
  margin: 0;
  font-family: 'Roboto', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100); /* アドレスバー考慮の動的高さ */
}

#unity-container {
  position: absolute;
}

#unity-container.unity-mobile {
  position: fixed;
  width: 100%;
  height: 100%;
}

#unity-canvas {
  background: #15161e;
  display: block;
}

.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 10;
}

#unity-logo {
  width: 154px;
  height: 130px;
  background: transparent;
  margin: 0 auto;
}

#unity-progress-bar-empty {
  width: 141px;
  height: 18px;
  margin-top: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

#unity-progress-bar-full {
  width: 0%;
  height: 18px;
  margin-top: 15px;
  background: #ffffff;
  border-radius: 9px;
  transition: width 0.2s ease-out;
}

#unity-footer {
  position: relative;
  background: #171821;
  height: 38px;
  color: #8c909e;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.unity-mobile #unity-footer {
  display: none;
}

#unity-logo-title-footer {
  float: left;
  width: 102px;
  height: 38px;
  background: transparent;
  opacity: 0.6;
}

#unity-build-title {
  float: right;
  margin-right: 15px;
  line-height: 38px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

#unity-fullscreen-button {
  cursor: pointer;
  float: right;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

#unity-fullscreen-button:hover {
  opacity: 1;
  transform: scale(1.05);
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: #ff3366;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  display: none;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* =========================================================================
   Premium Glassmorphism Modal Styles (高級感のあるガラスモーフィズムUI)
   ========================================================================= */

/* モーダルの背景オーバーレイ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100); /* アドレスバーを完璧に考慮したウィンドウ高さ */
  background: rgba(0, 0, 0, 0.50); 
  backdrop-filter: blur(24px);     
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: none;
}

/* モーダル表示中の状態 */
.modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* モーダルのボディ部 */
.modal-body {
  display: flex;
  flex-direction: column;
  height: 100%;                   
  box-sizing: border-box;
}

/* 【6割配分】アートビジュアルコンテナ */
.modal-visual-container {
  height: 75%;                    /* 正確な6:4分割（上部60%） */
  min-height: 0;                  /* 子要素の画像縮小を許容するためのFlexboxバグ対策 */
  width: 100%;
  border-radius: 28px;
  position: relative;             
  overflow: visible;              
  background: #0d0e14;
}

/* アートの画像表現 */
.visual-image {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  object-fit: contain;            
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 画像右上アクションボタン群 */
.modal-action-buttons {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* アクションボタン共通スタイル（ズーム・閉じる） */
.action-btn {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1.4);
}

/* ナビゲーションボタン */
.nav-btn {
  position: absolute;            
  top: 50%;
  transform: translateY(-50%);   
  width: 52px;
  height: 80px;
  background: rgba(0, 0, 0, 0.0);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1.4), border-radius 0.3s cubic-bezier(0.16, 1, 0.3, 1.4), left 0.3s cubic-bezier(0.16, 1, 0.3, 1.4), right 0.3s cubic-bezier(0.16, 1, 0.3, 1.4);
}

.prev-btn {
  left: -84px;                   
}

.next-btn {
  right: -84px;                  
}

/* PC環境（1024px以上）でのスタイル設定 */
@media screen and (min-width: 1024px) {
  .modal-content {
    width: calc(100vw - 272px);
    max-width: 1300px;
    height: calc((var(--vh, 1vh) * 100) - -48px);
    color: #ffffff;
    position: relative;
    overflow: visible;              
    transform: scale(1.05);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1.4), height 0.3s cubic-bezier(0.16, 1, 0.3, 1.4);
  }

  .modal-overlay.is-active .modal-content{
    transform: scale(1);
    height: calc((var(--vh, 1vh) * 100) - 64px);
  }
 
  .action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    width: 64px;
  }

  .action-btn:active {
    width: 54px;
  }

  .prev-btn:hover {
    left: -98px;
    width: 64px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
  }
  
  .next-btn:hover {
    right: -98px;       
    width: 64px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
  }

  .prev-btn:active {
    left: -84px;
    width: 58px;
    border-radius: 16px;
  }

  .next-btn:active {
    right: -84px;       
    width: 58px;
    border-radius: 16px;
  }
}

/* 【4割配分】テキスト詳細カードエリア */
.modal-text-content {
  height: 25%;                    
  min-height: 0;                  
  padding: 8px 48px 0px 48px;     
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* テキストヘッダー（タイトルと場所の横並び） */
.modal-text-header {
  flex-shrink: 0;                 
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-radius: 28px 28px 4px 4px;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  padding: 16px 28px;
}

/* 【新規追加】絶対に動かない固定背景コンテナ（アウター） */
.modal-description-wrapper {
  margin-top: 4px;
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.5); /* 背景色をここに固定 */
  border-radius: 4px 4px 28px 28px;
  position: relative;
  overflow: hidden; /* スクロール時の内部のテキストはみ出しをここでカット */
  display: flex;
  flex-direction: column;
}

/* 可変対応詳細解説文コンテナ（インナー） */
#modal-description {
  margin: 0;                      
  width: 100%;
  height: 100%;
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-weight: 300;
  font-size: 16px;
  overflow-y: auto;               
  background: transparent; /* 背景を透明にして分離！ */
  padding: 16px 28px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch; 
}

/* 作品タイトル */
.modal-text-content h2 {
  font-family: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif;
  margin: 0;
  font-size: 24px;
  font-weight: 300;
  color: #ffffff;
}

/* 場所表示コンテナ */
.modal-location-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 0px;
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
}

.location-icon {
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  vertical-align: -3px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* 作品詳細説明のフォント調整 */
.modal-text-content p {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
}

/* =========================================================================
   Premium Custom Circle Cursor Styles (高級カスタムカーソル)
   ========================================================================= */
html, 
body, 
#unity-container, 
#unity-canvas, 
a, 
button, 
button *, 
.action-btn, 
.action-btn *, 
.nav-btn, 
.nav-btn *, 
.material-symbols-rounded {
  cursor: none !important;
}

body:has(#artwork-modal.is-active),
body:has(#artwork-modal.is-active) *,
#unity-loading-bar,
#unity-loading-bar * {
  cursor: auto !important;
}

body:has(#artwork-modal.is-active) a,
body:has(#artwork-modal.is-active) button,
body:has(#artwork-modal.is-active) .action-btn,
body:has(#artwork-modal.is-active) .nav-btn {
  cursor: pointer !important;
}

body:has(#artwork-modal.is-active) #custom-cursor {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
}

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 72px;  
  height: 72px; 
  border: 3px solid rgba(255, 255, 255, 0.85); 
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference; 
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 
    width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.cursor-dot {
  width: 12px;  
  height: 12px; 
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
}

#custom-cursor.is-hovering-ui {
  width: 120px;  
  height: 120px; 
  border-color: rgba(255, 255, 255, 0.95);
  background-color: rgba(255, 255, 255, 0.12); 
  border-width: 2px; 
}

#custom-cursor.is-hovering-ui .cursor-dot {
  transform: scale(0);
  opacity: 0;
}

#custom-cursor.is-dragging {
  width: 42px;  
  height: 42px; 
  border-color: rgba(255, 255, 255, 1);
  background-color: rgba(255, 255, 255, 0.85); 
  border-width: 3px;
}

#custom-cursor.is-dragging .cursor-dot {
  transform: scale(0);
  opacity: 0;
}

.action-btn span,
.nav-btn span {
  pointer-events: none;
}

/* モバイル・タブレット環境（1024px未満）のレスポンス定義 */
@media (max-width: 1024px) {
  .modal-content {
    width: calc(100vw - 32px);               
    max-width: 1280px;
    height: calc((var(--vh, 1vh) * 100) - 32px);
    color: #ffffff;
    position: relative;
    overflow: visible; 
    transform: scale(1.05);             
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1.4), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1.4);
  }

  .modal-overlay.is-active .modal-content{
    height: calc((var(--vh, 1vh) * 100) - 64px);
    transform: scale(1);
  }

  .modal-visual-container {
    height: 50%; 
  }

  .modal-text-content {
    height: 50%;
    padding: 16px 0 0px;     
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .prev-btn {
    left: 8px;                   
    right: auto;
  }

  .next-btn {
    right: 8px;                  
    left: auto;
  }

  .nav-btn {
    top: calc(100% - 24px - 8px);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .prev-btn:active,
  .next-btn:active {
    width: 64px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
  }

  .action-btn:active {
    width: 64px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
  }
}
