/* =========================================
   1. 基本設定 & レイアウト
   ========================================= */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Georgia', 'Times New Roman', 'Hiragino Mincho ProN', 'MS Mincho', serif;
  background-color: #FFFFFF; /* 背景色：白 */
  color: #333;
  overflow: hidden; /* body自体のスクロールは防止 */
}

/* フェードインアニメーション（解答ページ用） */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- ロック画面のレイアウト --- */
#lock-screen {
  display: flex;       
  flex-direction: column; 
  align-items: center;    
  
  /* 上揃えにして上部のズレを防止 */
  justify-content: flex-start; 
  padding-top: 15vh;           

  height: 100vh;          
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
  box-sizing: border-box;
  
  /* ロック解除時に「ふわっと」消えるための設定 */
  transition: opacity 0.8s ease-out; 
  
  /* 左ズレ防止（常にスクロールバー領域を確保） */
  overflow-y: scroll; 
}

.content {
  width: 100%;
  max-width: 400px; /* PCでも広がりすぎないように制限 */
  text-align: center;
  padding-bottom: 40px; /* 下部の余白 */
}

/* ロゴ画像のスタイル */
.logo-image {
  max-width: 80%;      
  height: auto;        
  margin-bottom: 20px; 
  display: block;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-weight: normal;
  letter-spacing: 2px;
  color: #474747;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 30px;
}

/* --- フォームのデザイン --- */
#password-form {
  display: flex;
  flex-direction: column;
}

#password-input {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #CCC;
  background-color: #FFF;
  font-size: 1em;
  box-sizing: border-box;
  text-align: center;
}

#submit-button {
  padding: 15px;
  border: none;
  background-color: #333;
  color: white;
  font-size: 1em;
  font-family: inherit;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#submit-button:hover {
  background-color: #555;
}

/* エラーメッセージ */
#message {
  margin-top: 15px;
  color: #D9534F; 
  height: 1.2em; 
  font-size: 0.9em;
  margin-bottom: 20px; /* ヒントとの間隔 */
}

/* =========================================
   ヒントアコーディオンのデザイン
   ========================================= */
.hint-section {
  width: 100%;
  margin-top: 10px;
  text-align: left;
}

.hint-accordion {
  border-bottom: 1px solid #ddd;
  margin-bottom: 0;
  transition: all 0.3s ease;
}

/* 一番上の線 */
.hint-accordion:first-child {
  border-top: 1px solid #ddd;
}

/* 開閉のタイトル部分 */
.hint-accordion summary {
  display: flex;
  justify-content: space-between; /* 文字とアイコンを両端に */
  align-items: center;
  padding: 15px 10px;
  cursor: pointer;
  list-style: none; /* デフォルトの三角を消す */
  font-size: 0.95em;
  color: #555;
  transition: background-color 0.2s;
}

/* PCなどホバーできる端末のみ色を変える（スマホでは無効化） */
@media (hover: hover) {
  .hint-accordion summary:hover {
    background-color: #f9f9f9;
  }
}

/* デフォルトの三角を完全に消す（Safari等対応） */
.hint-accordion summary::-webkit-details-marker {
  display: none;
}

/* 右側の＋アイコン */
.hint-accordion summary::after {
  content: "+";
  font-weight: bold;
  font-size: 1.2em;
  color: #999;
  transition: transform 0.3s;
}

/* 開いている時のアイコン回転 */
.hint-accordion[open] summary::after {
  transform: rotate(45deg);
}

/* 中身のテキスト */
.hint-content {
  box-sizing: border-box; /* 高さ計算を正確に */
  padding: 10px 10px 20px 10px;
  font-size: 0.9em;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  overflow: hidden; /* アニメーション中にはみ出さないように */
  opacity: 0; /* JSで開くまで非表示に見せる */
}

/* JSで開いた状態の時は不透明度を1にする（JSが無い場合のフォールバック含む） */
.hint-accordion[open] .hint-content {
  opacity: 1;
}


/* =========================================
   2. 扉アニメーション (画像なし・CSSのみ版)
   ========================================= */
#door-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  /* 扉が開いた後の奥の色（ホワイトアウト） */
  background-color: #FFF; 
  
  /* 初期状態 */
  visibility: hidden;
  opacity: 0;
  z-index: 9999; /* 確実に一番手前に表示 */
  transition: opacity 0.5s ease-in;
}

.door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  
  /* ベースの色（濃いダークブラウン） */
  background-color: #2c1e19; 
  
  /* 木目のような縦縞ノイズと、中心が明るいライティングを重ねる */
  background-image: 
    repeating-linear-gradient(
      90deg, 
      transparent 0px, 
      transparent 2px, 
      rgba(0,0,0,0.1) 3px, 
      transparent 4px
    ),
    radial-gradient(
      circle at 50% 50%, 
      rgba(255,255,255,0.05) 0%, 
      rgba(0,0,0,0.6) 100%
    );

  /* 扉の内側（装飾パネル）風の凹凸を影で表現 */
  box-shadow: 
    inset 0 0 50px rgba(0,0,0,0.8); 

  /* アニメーション設定 */
  transition: transform 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- 左の扉 --- */
.left-door {
  left: 0;
  border-right: 2px solid #1a110e;
  box-shadow: inset -10px 0 20px rgba(0,0,0,0.5); 
  background-position: left center;
}

/* 左の扉の装飾枠 */
.left-door::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 60%;
  height: 70%;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 
    inset 2px 2px 5px rgba(0,0,0,0.5),
    1px 1px 2px rgba(255,255,255,0.05);
}

/* --- 右の扉 --- */
.right-door {
  right: 0;
  border-left: 2px solid #1a110e;
  box-shadow: inset 10px 0 20px rgba(0,0,0,0.5);
  background-position: right center;
}

/* 右の扉の装飾枠 */
.right-door::before {
  content: '';
  position: absolute;
  top: 15%;
  right: 20%;
  width: 60%;
  height: 70%;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 
    inset 2px 2px 5px rgba(0,0,0,0.5),
    1px 1px 2px rgba(255,255,255,0.05);
}

/* --- 開くときのアニメーション --- */
#door-animation.open .left-door {
  transform: translateX(-100%);
}

#door-animation.open .right-door {
  transform: translateX(100%);
}

/* =========================================
   ▼▼▼ 追加：確認モーダルのデザイン ▼▼▼
   ========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  
  /* 中央寄せ */
  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 80%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  
  /* レイアウト調整用フレックスボックス */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-text {
  margin-bottom: 25px;
  font-size: 1rem;
  color: #333;
  width: 100%; /* 横幅いっぱいに広げて中央揃えを確実に */
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  width: 100%; /* ボタンエリアも幅を確保 */
}

/* ▼▼▼ 修正箇所：ボタン幅を固定して統一 ▼▼▼ */
.modal-buttons button {
  width: 100px; /* 固定幅でサイズを揃える */
  padding: 10px 0; /* 横パディングではなく縦パディングで調整 */
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: opacity 0.2s;
}
/* ▲▲▲ 修正ここまで ▲▲▲ */

#modal-cancel {
  background-color: #eee;
  color: #333;
}

#modal-confirm {
  background-color: #333;
  color: #fff;
}

.modal-buttons button:hover {
  opacity: 0.8;
}