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

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 横ずれ対策 */
  overflow-y: auto;   /* スクロールは残す */
  height: 100%;
}


body {
  background-color:rgb(20, 20, 20); 
  color: white;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 横スクロール防止 */
}

.header {
  transform: none !important;   /* 👈 スケール継承を無効化 */
  transform-origin: initial !important;
  width: 100%;
  padding: 10px 0;
  display: flex;
  justify-content: center; /* ナビ中央寄せ */
  align-items: center;
  border-bottom: 2px solid #fff; /* 下線 */
  box-sizing: border-box;
}

.main-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap; /* 横並び固定 */
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.main-nav a img {
  width: auto;
  height: auto;
  display: block;
}

.slideshow {
  position: relative;
  width: 100%;         /* 画面幅に合わせる */
  max-width: 1200px;   /* 最大幅は1200pxで制限 */
  aspect-ratio: 2;     /* 横:縦 = 2:1（1200px:600px相当） */
  margin: 40px auto;   /* 中央揃え */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
}

.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.slideshow img.active {
  display: block;
  animation: fade 1s ease-in-out;
}

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

.thumbnails {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 15px;
}

.thumbnails img {
  width: 180px;
  height: 100px;
  object-fit: cover;
  opacity: 0.5;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.thumbnails img.active {
  opacity: 1;
  transform: scale(1.1);
  border: 2px solid #fff;
}

.container {
  display: flex;
  max-width: 1200px; /* 中央揃え幅制限 */
  margin: 20px auto;
  gap: 20px;
  padding: 0 10px;
}
main {
  flex: 3;
  padding: 20px;
  min-width: 0; /* flexはみ出し防止 */
}

.news_box{
  display: flex;
  gap: 10px;
  margin: 15px;
}
.news_link{
  text-decoration: none;
}

.news_image{
  width: 35%;
  border-radius: 20px;
  display: table-cell;
}
.news_text{
  width: 65%;
  display: table-cell;
  background: rgb(255, 255, 255);
}
.news_text_time{
  height: 20%; 
  border-radius: 20px;
  margin: 10px;
  padding: 5px 10px;
  display: flex;             /* 子要素をflexで配置 */
  align-items: center; 
  font-size: clamp(0.6rem, 2vw, 1.2rem); 
  color: #ffffff; 
  font-weight: bold;
  background: rgb(0, 0, 0);
}
.news_text_title{
  width: 100%;           /* 親要素いっぱいに広げる */
  max-width: 100%;       /* はみ出さないように最大幅を制限 */
  box-sizing: border-box; /* paddingやborderを含めた幅計算 */
  font-size: clamp(0.8rem, 2vw, 1.4rem);
  color: #000000; 
  font-weight: bold;
}
.news_text_excerpt{
  padding: 10px 20px;
  font-size: clamp(0.6rem, 2vw, 1rem);
  color: #000000; 
}

aside {
  flex: 1;
  padding: 20px;
  min-width: 0;
}
.pseudo-fullscreen {
  position: absolute !important; 
  top: 0; left: 0;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 9999;
  background: black;
  touch-action: auto;
  overflow: auto !important;
}

#FullscreenContent{
  position: relative;
  height: auto;
}

#fullscreen-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  font-size: 16px;
  background-color: #e6119f;
  color: #fff;
  border: none;
  border-radius: 8px;
  z-index: 2000; 
  cursor: pointer;
}

#hiddenInput {
  position: absolute;
  width: 1px;
  height: 1px;
  left: 0;
  top: 0;
  opacity: 1; /* 透明でなくても良い */
  background: transparent;
  border: none;
  color: transparent;
}

#unity-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}

/* ===== Canvas 共通 aaaaaaaa===== */
#unity-canvas {
    width: 100%;              /* 親に合わせる */
    height: 100%;
    display: block;
    background: #000 url('../TemplateData/background.png') center/cover no-repeat;
}

/* ===== ローディングバー ===== */
#unity-loading-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;         /* PC用固定 */
  max-width: 80%;       /* スマホは自動調整 */
  height: 20px;
  z-index: 10;
}

/* 空バー背景 */
#unity-progress-bar-empty {
width: 100%;
height: 100%;
position: relative; /* 親として基準 */ 
border-radius: 0px;
overflow: hidden; background: url('../TemplateData/progress-bar-empty-dark.png') no-repeat center center;
background-size: 100% 100%;
}

/* 進行中バー */
#unity-progress-bar-full {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 0%;
background: url('../TemplateData/progress-bar-full-dark.png') no-repeat left center;
background-size: 100% 100%;
}

#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

@media (min-width: 1281px) {
  #unity-container {
    width: 1280px;
    height: 720px;
    margin-top: 60px;
  }
}
@media (min-width: 601px) and (max-width: 1280px) {
  #unity-container {
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9;
    margin-top: 60px;
  }
  #unity-canvas {
    width: 100%;
    height: 100%;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .main-nav a img {
    max-width: 50px;  /* 小さくする */
    width: auto;
    height: auto;
    display: block;
  }
  .slideshow {
  margin: 20px auto;   /* 中央揃え */
  }
  .thumbnails img {
    width: 100px;   /* 幅を小さく */
    height: 60px;   /* 高さも比率に合わせて小さく */
  }
  .container {
    flex-direction: column;
    flex-wrap: wrap;     /* 幅が狭い場合は折り返す */
  }
  main, aside {
    width: 100%; /* 横幅いっぱいに広げる */
    padding: 10px; /* 余白を少し小さく */
  }
  #fullscreen-btn {
  padding: 10px 20px;
  font-size: 12px;
  }

  #unity-container {
      transform: none !important;
  transform-origin: center center !important;
    width: 100%;
    padding-top: 56.25%; /* 16:9比率 */
    margin-top: 60px;
  }
  #unity-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  #unity-loading-bar {
    width: 85%;
    height: 15px;
    bottom: 10px;
  }
}

@media screen and (orientation: landscape) {
  #unity-container.unity-mobile {
    position: relative; /* ← fixedを解除してスクロール許可 */
    height: auto;        /* ← 固定高さを外す */
    max-height: none;
    overflow: visible;   /* ← スクロールOKに */
  }

  html, body {
    overflow-y: auto;   /* ← 縦スクロール許可 */
  }

  #unity-canvas {
    width: 100vw;
    height: auto;
    aspect-ratio: 16 / 9; 
  }

  #unity-loading-bar {
    width: 70%;         /* 画面幅の90%に拡大 */
    height: 14px;       /* 高さを少し小さく */
    bottom: 8px;       /* 下から少し上げる */
  }
}