@charset "utf-8";
@import url("_template.css");


/* 遊戲頁剛好塞滿一個視窗、不出現捲軸。
   原本 .game-frame 用 aspect-ratio: 16/9 算高度，在寬螢幕上會超出視窗
   （1920 寬 → 1080 高，再加上 #moonrabi-bar）而長出捲軸。改成用 flex 讓
   遊戲容器吃掉扣除頭部後的剩餘高度，遊戲本身（Cocos exactFitScreen）會自行適應。 */
body { margin: 0; }

main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* 行動裝置改用動態視窗高度，避免網址列伸縮造成誤差 */
}

#moonrabi-bar { flex: 0 0 auto; }

.game-container {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0; /* 沒有這行，flex item 的最小高度會是內容高度而撐破容器 */
  position: relative;
  overflow: hidden;
}

.game-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* ==========================================================================
   ② 上部警告バー（テクスチャ背景・レスポンシブ）
   ========================================================================== */
.trial-warning-bar {
  background-image: url('../images/pattern.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  box-sizing: border-box;
  width: 100%;
  padding: 1% 3%;
}

.trial-warning-bar .inner {
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
}

.bar-txt {
  margin: 0;
  color: #462a25;
  font-size: clamp(18px, 1.84vw, 20px);
  line-height: 1.4;
  text-align: left;
}
.bar-txt span {
  font-size: clamp(14px, 1.4vw, 16px);
}
#openModalBtn,
#openDdtRegBtn {
  width: 200px;
}
#openModalBtn a,
#openDdtRegBtn a {
  width: 100%;
  max-height: 60px;
  min-height: 3.5em;
  background-color: #462a25;
  color: #fff;
  font-size: clamp(18px, 1.84vw, 20px);
  font-weight: bold;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 4px 0 #271512;
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
#openModalBtn a:hover,
#openDdtRegBtn a:hover {
  background-color: #6d4038;
  cursor: pointer;
}

/* ==========================================================================
   上部警告バー 開閉（黄色バー＋茶色バー）
   ========================================================================== */
.trial-bar-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
}

.trial-collapse {
  overflow: hidden;
  max-height: 300px;
  transition: max-height .35s ease;
}

/* 茶色バー */
.trial-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 39px;
  padding: 5px;
  border: 0;
  background: #462a25;
  cursor: pointer;
  transition: background-color .2s;
}
.trial-toggle:hover { background: #6d4038; }
.trial-toggle svg {
  transform: rotate(180deg);   /* 開いている時：︿ */
  transition: transform .35s ease;
}

.trial-bar-wrap.is-collapsed .trial-collapse { max-height: 0; }
.trial-bar-wrap.is-collapsed .trial-toggle svg { transform: rotate(0); }  /* 閉じている時：﹀ */


/* ==========================================================================
   ③ モーダルウィンドウ（ポップアップ）
   ========================================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
}

.modal-overlay.is-active {
  display: block;
}

.modal-content {
	width: 80%;
  max-width: 760px;
  max-height: 350px;
  height: 80%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  padding: 2% 0;
}

.modal-window {
  aspect-ratio: 5 / 3; /* モーダル自体の縦横比を維持 */
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
	
}

/* 閉じる（×）ボタン */
.modal-close {
  position: absolute;
  top: -10%;
  right: 0;
  background: none;
  border: none;
  font-size: 2.5vw;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.modal-ttl {
  margin: 0 0 2% 0;
  font-size: clamp(24px, 2.2vw, 26px);
  font-weight: bold;
  text-align: center;
  line-height: 1.5;
}

.modal-buttons{
	width: 90%;
  background-color: #ffffff;
  border: 4px solid #ffab2b;
  border-radius: 36px;
  padding-top: 32px;
  height: 182px;
	padding: 25px 10px;
	display: flex;
  align-items: center;
  justify-content: center;
	margin: 0 auto;
	
}

.modal-buttons a{
	display: inline-block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	margin-right: 20px;
}

.modal-buttons a:last-child{
	margin: 0;
}

.modal-buttons a img {
  transition: transform 0.15s ease, filter 0.15s ease;
}

.modal-buttons a img:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.modal-btn {
  display: block;
  width: 45%;
	max-width: 293px;
  box-sizing: border-box;
}

.modal-btn img {
  width: 100%;
  height: auto; 
  display: block;
}


/* ==========================================================================
   スマートフォン（SP）版の表示微調整
   ========================================================================== */
@media (max-width: 750px) {
  #openModalBtn a {
	  padding: 20%;
	}
	.modal-close {
	  top: -7%;
	}
	
	.modal-content{
	  max-width: 450px;
		width: 90%;
		max-height: 500px;
		text-align: center;
		height: 90%;
		padding: 5%;
		
	}
	.modal-buttons{
		max-width: 420px;
		width: 100%;
		display: inline-block;
		height: auto;
	}
	
	.modal-buttons a{
	margin: 0 0 20px 0;
}
	.modal-btn img{
		margin: 0 auto;
	}
	
	.trial-warning-bar {
  padding: 3% 5%;
}
}

@media (max-width: 412px) {
	.trial-warning-bar {
  padding: 5% 5%;
}
	
	.trial-warning-bar .inner {
  display: inherit;
}
	#openModalBtn{
		margin: 0 auto;
	}
	#openModalBtn a{
		padding: 10%;
	}
	
	.bar-txt {
	  padding-bottom: 5%;
		margin-bottom: 5%;
		border-bottom: 1px solid #75453e;
	}

}