/* ==========================================================================
   OMEGA STONE - STYLE SHEET (v2026.02.08)
   ==========================================================================
   
   [TABLE OF CONTENTS]
   1.  Base & Layout ........ :root, html, body
   2.  Title Screen ......... #title-screen, .game-title, .boost-container
   3.  Inputs & Buttons ..... .rune-input, .btn, .final-input
   4.  Game HUD ............. .hud, .mana-bar, .chaos-bar
   5.  Logic Grid ........... .logic-grid, .cell-x, .cell-o
   6.  Prophecy List ........ .prophecy-list, .stone
   7.  Logs & Memo .......... .log-area, .memo-area
   8.  Modals ............... .modal-overlay, .modal-box
   9.  Tutorial ............. .btn-tutorial, #tut-overlay
   10. Animations ........... @keyframes definitions
   11. Omega/Tower Modes .... .bg-tower-*, .divine-frame
   12. Utilities ............ .text-*, .d-none, .w-100
   ========================================================================== */

:root {
    --bg-color: #050505;
    --text-main: #e0d0b0;
    --accent-color: #d4af37;
  }
  body {
    margin: 0;
    padding: 0;
    font-family: 'Shippori Mincho', serif;
    background-color: #000000 ;
    background-image: radial-gradient(circle at 50% 50%, #1a150e 0%, #000000 100%);
    color: var(--text-main);
    text-align: center;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: background-image 1s ease;
  }
  .en-font { font-family: 'Cinzel', serif; }

/* ゲーム画面自体にもトランジションをつけて、切り替えをフワッとさせる */
/* Game Screen */
#game-screen { display: none; max-width: 600px; margin: 0 auto; animation: slideIn; transition: opacity 0.5s ease-out; }

/* --- Title Screen (サイズ維持・スクロール対応版) --- */
#title-screen {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  min-height: 100vh;
  height: auto;
  padding: 40px 0;
  box-sizing: border-box;
  animation: fadeIn 2s;
}
#title-screen::before {
  content: '';
  flex: 1;
}
#title-screen::after {
  content: '';
  flex: 1;
  min-height: 20px; 
}
.game-title {
  font-family: 'Cinzel', serif; font-size: 2.5rem; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(to bottom, #fff, #aaa); -webkit-background-clip: text; color: transparent;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3); margin-bottom: 5px;
  flex-shrink: 0;
}
  
/* 数字入力欄 */
input.rune-input {
  font-family: 'Cinzel', serif; /* フォント適用 */
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3); 
}

/* 封印解除画面の入力欄スタイル */
.final-input-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}
.final-input {
  width: 60px;
  height: 80px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #555;
  border-radius: 8px;
  color: #d4af37; /* 金文字 */
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  text-align: center;
  outline: none;
  transition: 0.3s;
  box-shadow: inset 0 0 10px #000;
}
.final-input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), inset 0 0 10px #000;
  transform: scale(1.1);
}
  /* Difficulty Buttons */
  .btn {
    background: rgba(0,0,0,0.5); border: 1px solid #777; color: #ccc; padding: 18px; margin: 0 auto 20px auto;
    font-size: 1.1rem; font-family: 'Shippori Mincho', serif; font-weight: bold; cursor: pointer;
    width: 90%; max-width: 350px; position: relative; overflow: hidden; transition: 0.3s; border-radius: 8px;
    display: flex; justify-content: space-between; align-items: center;
  }
  .btn:active { transform: scale(0.98); }
  
  .btn-std { border-color: #3498db; color: #aed6f1; box-shadow: 0 0 10px rgba(52, 152, 219, 0.2); }
  .btn-hard { border-color: #e74c3c; color: #f5b7b1; box-shadow: 0 0 10px rgba(231, 76, 60, 0.2); }
  .btn-night { border-color: #9b59b6; color: #d7bde2; box-shadow: 0 0 10px rgba(155, 89, 182, 0.2); }
  .btn-chaos { border-color: #8d6e63; color: #d7ccc8; box-shadow: 0 0 10px rgba(141, 110, 99, 0.2); 
  }
  /* 履歴のラベル色 - 茶色 */
  .mode-chaos { background: #4e342e; color: #d7ccc8; }

  /* Omega Mode Styles */
  .btn-omega { 
    border-color: #fff; color: #fff; background: #000; 
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); font-family: 'Cinzel', serif;
  }

  .hud {
    display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px; margin-bottom: 20px; font-family: 'Cinzel', serif;
  }
  .hud-left { display: flex; gap: 8px; }
  .hud-btn { 
    cursor: pointer; font-size: 0.85rem; color: #aaa; border: 1px solid #555; 
    padding: 6px 12px; border-radius: 4px; background: rgba(0,0,0,0.6); 
    display: flex; align-items: center; justify-content: center;
  }
  .btn-guide { border-color: #d4af37; color: #f1c40f; font-weight: bold; }
  .mana-bar { font-size: 1.1rem; color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

  /* Rune Inputs */
  .rune-container {
    display: flex; justify-content: center; gap: 12px; margin-bottom: 20px;
    background: rgba(0,0,0,0.4); padding: 20px 10px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1);
  }
  .rune-wrapper { position: relative; width: 80px; }
  .rune-label { position: absolute; top: -28px; left: 0; width: 100%; font-size: 0.8rem; font-weight: bold; }
  .rune-sub { font-size: 0.6rem; color: #888; display: block; margin-top: -2px; font-family: 'Cinzel', serif; }
  
  input.rune-input {
    width: 100%; height: 75px; font-size: 2.2rem; text-align: center; background: #0f0f0f;
    border: 2px solid #333; border-radius: 8px; color: #fff; font-family: 'Cinzel', serif; transition: 0.3s;
  }
  input:focus { outline: none; border-color: #fff; box-shadow: 0 0 15px rgba(255,255,255,0.3); }
  
  #r1 { border-color: #8a1c1c; color: #ff9999; } /* Ignis */
  #r2 { border-color: #1c4e8a; color: #99ccff; } /* Aqua */
  #r3 { border-color: #1c8a5e; color: #99ffcc; } /* Ventus */

  /* Logic Matrix */
  .logic-grid {
    display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 4px;
    margin: 10px 0 10px 0; background: rgba(0,0,0,0.6); padding: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
  }
  .grid-header { font-family: 'Cinzel', serif; font-weight: bold; color: #888; font-size: 0.8rem; padding-bottom: 5px;}
  .grid-row-label { text-align: right; padding-right: 10px; font-size: 0.8rem; font-weight: bold; display: flex; align-items: center; justify-content: flex-end;}
  
  .grid-cell {
    background: rgba(255,255,255,0.05); border: 1px solid #333; aspect-ratio: 1; border-radius: 4px;
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    font-weight: bold; font-size: 1.2rem; user-select: none; transition: 0.1s;
  }
  
  /* マトリクスの開閉用 */
.logic-grid {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s;
  overflow: hidden;
}
/* 閉じている時のスタイル */
.logic-grid.closed {max-height: 0; padding: 0; opacity: 0; }
  /* Shared Cell Styles */
  .cell-x, .memo-btn.is-x { background: rgba(200, 50, 50, 0.2); color: #ff5555; border-color: #552222; }
  .cell-x::after, .memo-btn.is-x::after { content: "×"; }
  
  .cell-o, .memo-btn.is-o { background: rgba(50, 200, 50, 0.2); color: #55ff55; border-color: #225522; }
  .cell-o::after, .memo-btn.is-o::after { content: "○"; }

  /* Memo Toggle & Area */
  .memo-toggle-btn {
    width: 100%; padding: 8px; background: rgba(255,255,255,0.1); border: 1px solid #444; border-radius: 6px;
    color: #aaa; font-size: 0.8rem; cursor: pointer; margin-bottom: 5px; font-weight: bold; transition: 0.2s;
  }
  .memo-toggle-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

  .memo-area {
    background: rgba(0,0,0,0.4); padding: 10px; border-radius: 8px; margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 8px;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out; overflow: hidden;
  }
  .memo-area.closed {  max-height: 0; padding: 0; opacity: 0;  }

  .memo-row { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
  .memo-label { width: 100%; font-size: 0.7rem; color: #888; margin-bottom: 2px; text-align: left; padding-left: 5px;}
  .memo-btn {
    border: 1px solid #444; background: #111; color: #ccc; padding: 6px 8px; border-radius: 4px;
    font-size: 0.75rem; cursor: pointer; min-width: 45px; display: flex; align-items: center; justify-content: center; gap: 3px; user-select: none;
  }
  .memo-btn::after { margin-left: 2px; font-weight: bold; }

  /* Prophecy List */
  .prophecy-list { display: flex; flex-direction: column; gap: 10px; }
  .stone {
    background: linear-gradient(to right, rgba(30,30,30,0.9), rgba(10,10,10,0.9));
    border: 1px solid #444; padding: 10px 15px;
    border-radius: 5px; cursor: pointer; text-align: left; transition: 0.2s;
    display: flex; justify-content: space-between; align-items: center; position: relative;
    backdrop-filter: blur(5px);
  }
  .stone:hover { border-color: #aaa; transform: translateX(5px); }
  .stone::after { content: ''; position: absolute; top:0; left:0; width: 4px; height: 100%; background: #666; }
  .stone.disabled { opacity: 0.4; pointer-events: none; }
  .stone-title { font-size: 0.75rem; color: #888; margin-bottom: 2px; }
  .stone-text { font-size: 1rem; color: #fff; font-weight: bold; letter-spacing: 0.5px; }
  .stone-id { font-family: 'Cinzel', serif; font-size: 1.4rem; color: #444; margin-left: 10px;}
  /* 予言リスト開閉用 */
.prophecy-list.closed {max-height: 0; padding: 0; opacity: 0; }

  /* Mystery Stone (Omega) - 基本スタイル（アニメーションなし） */
  .stone.is-mystery {
    color: #d4af37;
    background: radial-gradient(circle, #1a1505 0%, #000 100%);
    border: 1px solid #d4af37;
    display: flex; justify-content: center; align-items: center;
    
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    transition: all 0.5s ease;
  }
  /* 着地した後に追加するクラス（ここで光らせる） */
  .stone.is-mystery.omega-pulsing {
    animation: omegaPulse 3s infinite alternate;
  }

  /* 判定済み（disabled）のスタイル */
  .stone.is-mystery.disabled {
    animation: none; /* 光を止める */
    border-color: #333;
    color: #333;
    background: #050505;
    box-shadow: none;
    opacity: 0.3;
    filter: grayscale(100%);
    cursor: not-allowed;
  }

  .stone.is-mystery .stone-text { 
    font-family: 'Cinzel', serif; 
    font-size: 1.5rem; 
    letter-spacing: 5px; 
    color: #d4af37;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
  }
  
  .stone.is-mystery.disabled .stone-text {
    color: #333;
    text-shadow: none;
  }

  /* Log */
  .log-area {
    margin-top: 20px; border-top: 1px solid #444; padding-top: 10px; max-height: 200px; overflow-y: auto; text-align: left; font-size: 0.9rem;
  }
  .log-entry { margin-bottom: 5px; padding: 8px 10px; border-radius: 4px; background: rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
  /* TRUE: 緑→金 (神聖な正解) */
  .log-true { border-left: 3px solid #d4af37; color: #ffd700; background: rgba(212, 175, 55, 0.1); }
  /* FALSE: 赤→紫 (虚無・不正解) */
  .log-false { border-left: 3px solid #9b59b6; color: #d7bde2; background: rgba(155, 89, 182, 0.1); }
  
  /* 数字の強調用クラス */
  .num-fire { color: #ff9999; font-weight: bold; }
  .num-water { color: #99ccff; font-weight: bold; }
  .num-wind { color: #99ffcc; font-weight: bold; }

  /* メモ欄フリーテキスト--- */
  .memo-textarea {
    width: 100%;
    height: 120px;
    background: #000;
    border: 1px solid #444;
    color: #ffffff;
    padding: 10px;
    font-family: 'Shippori Mincho', serif;
    font-size: 0.9rem;
    resize: none;
    box-sizing: border-box;
    border-radius: 4px;
    line-height: 1.5;
    transition: 0.3s;
  }
  .memo-textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    background: #111;
  }
  .memo-textarea::placeholder {
    color: #444;
    font-style: italic;
  }
  .log-nums { font-family: 'Cinzel', serif; font-weight: bold; background: #000; padding: 1px 6px; border-radius: 3px; letter-spacing: 1px; font-size: 0.8rem;}

  /* Action Bar */
  .action-bar { margin-top: 20px; display: flex; gap: 10px; justify-content: center; }
  .btn-action { flex: 1; padding: 15px; font-weight: bold; font-family: 'Shippori Mincho', serif; border: none; cursor: pointer; border-radius: 8px; font-size: 1rem; color: #fff; transition: 0.2s; }
  .btn-next { background: #333; border: 1px solid #555; }
  .btn-solve { background: #27ae60; box-shadow: 0 4px 0 #1e8449; }

  /* Chaos Bar */
  .chaos-bar { background: #c0392b; color: white; padding: 5px; font-size: 0.8rem; font-weight: bold; margin-bottom: 15px; border-radius: 4px; display: none; text-shadow: 0 0 5px #000; letter-spacing: 2px;}


/* すべてのモーダルを画面中央に固定する設定 */
.modal-overlay {
  display: none; 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.9); 
  z-index: 10000; 
  backdrop-filter: blur(5px);

  /* フレックス設定: 常に中央揃え */
  display: none; /* JSでflexに切り替え */
  flex-direction: column; 
  align-items: center; 
  justify-content: center; /* ① 中央固定を強制 */

  /* 中身が長い場合でもスクロール可能にする設定 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 0;
  box-sizing: border-box;
}

/* ★追加: 中身がはみ出すときのために、上下に透明なクッションを置く */
.modal-overlay::before,
.modal-overlay::after {
  content: '';
  flex-shrink: 0;
  height: 40px; /* 最小の余白 */
}

.modal-box {
    background: #111;
    padding: 25px 20px;
    border: 1px solid #444;
    border-radius: 12px;
    width: 85%;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    position: relative; /* バツボタン等の配置用 */
}

/* サイズバリエーション */
.modal-sm { max-width: 320px; }
.modal-md { max-width: 400px; }
.modal-lg { max-width: 500px; }

/* モーダル内の見出し */
.modal-title {
    color: #fff;
    margin-top: 0;
    margin-bottom: 15px;
    font-family: 'Shippori Mincho', serif;
    border-bottom: 1px solid #333; /* 必要な場合のみ */
    padding-bottom: 10px;
}

.modal-title.no-border { border-bottom: none; padding-bottom: 0; }

/* ID入力欄 */
.input-code {
    width: 90%;
    text-align: center;
    margin: 0 auto 20px auto;
    display: block;
    padding: 12px;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 20px;
    background: #000;
    border: 1px solid #555;
    border-radius: 6px;
    color: #fff;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    box-sizing: border-box;
}

/* グリッドボタン（ID入力画面の難易度選択など） */
.grid-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

/* 特定のモーダルで flex-start にしていた記述を削除、または上書き */
#history-modal,
#review-modal,
#prophecy-list-modal {
  justify-content: flex-start !important;
  padding-top: 60px;
  padding-bottom: 60px;
}
#result-modal,
#menu-modal {
  justify-content: center !important;
  align-items: center !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

  .seal-broken { font-size: 2.5rem; color: #fff; text-shadow: 0 0 30px #fff; font-weight: bold; }
  .answer-reveal { font-size: 4rem; letter-spacing: 15px; margin: 20px; color: #fff; font-family: 'Cinzel', serif; }

  /* Help & History Styles */
  #help-content, #history-content {
    background: #111; border: 1px solid #444; padding: 20px; border-radius: 10px; width: 85%; max-width: 500px;
    max-height: 80vh; overflow-y: auto; text-align: left; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.8);
  }
  .help-section { margin-bottom: 25px; border-bottom: 1px dashed #333; padding-bottom: 15px; }
  .help-title { color: #d4af37; font-weight: bold; margin-bottom: 10px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px;}
  .help-text { font-size: 0.9rem; line-height: 1.6; color: #ccc; }
  /* 閉じるボタン（スクロールしても追従するように変更） */
.close-help { 
  position: sticky !important; /* absolute から sticky に変更 */
  top: 0; 
  float: right; /* 右に寄せる */
  font-size: 2rem; /* 少し大きくして押しやすく */
  cursor: pointer; 
  color: #888; 
  padding: 5px 10px;
  background: #111; /* 背景をつけて文字と被らないように */
  border-radius: 0 0 0 8px;
  z-index: 10;
  margin-top: -10px; /* 位置微調整 */
  margin-right: -10px;
}

  .diagram-box {
    background: #222; border: 1px solid #444; padding: 15px; border-radius: 6px; margin: 10px 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .d-stone {
    width: 90%; background: #333; border-left: 3px solid #666; padding: 8px; margin: 5px 0; color: #fff; font-size: 0.8rem; display: flex; justify-content: space-between;
  }
  .d-arrow { font-size: 1.5rem; color: #d4af37; margin: 5px 0; }
  .d-result { font-weight: bold; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }
  .d-true { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
  .d-false { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid #e74c3c; }
  
  /* Liar Styles */
  .stone.is-liar {
    border: 2px solid #e74c3c;
    background: linear-gradient(to right, rgba(231, 76, 60, 0.2), rgba(0,0,0,0.8));
  }
  .stone.is-liar::after { background: #e74c3c; }
  .stone.is-liar .stone-title::after {
    content: " (嘘つき)"; color: #e74c3c; font-weight: bold; margin-left: 5px;
  }
  .res-row { font-size: 0.8rem; border-bottom: 1px solid #444; padding: 5px 0; color: #ccc; }
  .res-liar-txt { color: #e74c3c; font-weight:bold; }

  /* Omega Rule List */
  #omega-rule-area {
    margin-top: 15px; padding: 10px; border: 1px solid #444; border-radius: 8px;
    background: rgba(0,0,0,0.8); display: none; text-align: left;
    
    position: relative;
    z-index: 15000;
    overflow: visible !important; /* ← これがないとiPhoneで消えます！ */
  }
  .omega-label { color: #fff; font-size: 0.9rem; margin-bottom: 8px; border-bottom: 1px solid #333; padding-bottom: 5px; }
  .omega-list-item {
    padding: 6px; font-size: 0.85rem; color: #ccc; cursor: pointer; border-bottom: 1px dashed #333; transition: 0.2s;
  }
  .omega-list-item:hover { color: #fff; background: rgba(255,255,255,0.1); }
  .omega-list-item.excluded {
    text-decoration: line-through; color: #555; opacity: 0.6;
  }

    /* リスト項目のスタイル */
  .omega-list-item {
    opacity: 0; 
    position: relative;
    z-index: 15000; 
  }

  /* 降ってくる時のスタイル */
  .omega-list-item.falling {
  /* 薄い黄金色の背景（透明度25%） */
  background: rgba(212, 175, 55, 0.25);
  /* はっきりした金の枠線 */
  border: 1px solid #ffd700;
  /* ぼんやり黄金色に光らせる */
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  /* アニメーション設定*/
  animation: dropInBounce 3.0s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }

  /* History List Styles */
  .hist-item {
    background: #1a1a1a; border: 1px solid #333; border-radius: 6px; padding: 10px;
    margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
  }
  .hist-left { text-align: left; }
  .hist-mode { font-size: 0.7rem; padding: 2px 6px; border-radius: 3px; margin-right: 5px; font-weight: bold; }
  .mode-standard { background: #1c4e8a; color: #aed6f1; }
  .mode-hard { background: #8a1c1c; color: #f5b7b1; }
  .mode-nightmare { background: #4a1c8a; color: #d7bde2; }
  .mode-chaos { background: #555; color: #ccc; }
  .mode-omega { background: #000; color: #fff; border: 1px solid #fff; }

  .hist-id { font-family: 'Cinzel', serif; color: #d4af37; font-weight: bold; letter-spacing: 1px; }
  .hist-date { font-size: 0.7rem; color: #666; margin-top: 2px; }
  .hist-result { font-weight: bold; font-size: 0.9rem; }
  .res-win { color: #2ecc71; }
  .res-lose { color: #e74c3c; }

  .btn-replay {
    background: transparent; border: 1px solid #555; color: #aaa; cursor: pointer;
    padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; margin-left: 10px; transition: 0.2s;
  }
  .btn-replay:hover { background: #333; color: #fff; border-color: #fff; }
  
  /* Tutorial Styles */
  .t-container { display: flex; flex-direction: column; gap: 15px; }
  .t-step { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 15px; position: relative; text-align: left; }
  .t-step-num { background: var(--accent-color); color: #000; font-weight: bold; display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; margin-bottom: 8px; }
  .t-row { display: flex; align-items: center; justify-content: space-around; margin: 10px 0; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 6px; }
  .t-stone-mock { border: 1px solid #666; padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; color: #ccc; background: #222; }
  .t-result-mock { font-weight: bold; font-family: 'Cinzel', serif; padding: 5px 10px; border-radius: 4px; }
  .t-res-true { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
  .t-res-false { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid #e74c3c; }
  .t-logic-text { font-size: 0.9rem; line-height: 1.6; color: #ddd; margin-top: 5px; }
  .t-highlight { color: #ff9999; font-weight: bold; }
  .t-highlight-b { color: #99ccff; font-weight: bold; }
  .t-conclusion { border-top: 1px dashed #444; margin-top: 10px; padding-top: 10px; font-weight: bold; color: var(--accent-color); }

  #loading-indicator { font-size: 1.2rem; color: #d4af37; margin-top: 20px; display: none; }
  @keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
  
    /* --- チュートリアル用スタイル--- */
.title-top-right {
  position: fixed;
  top: max(20px, env(safe-area-inset-top)); 
  right: 20px; 
  left: auto;   /* ←コレ重要！左側は固定しない */
  width: auto;  /* ←コレ重要！勝手に伸びないようにする */
  
  display: flex; 
  gap: 10px; 
  z-index: 20000; 
  pointer-events: auto; 
}

  .btn-tutorial {
    background: rgba(46, 204, 113, 0.2); border: 1px solid #2ecc71; color: #2ecc71;
    padding: 10px 15px; border-radius: 30px; font-weight: bold; cursor: pointer;
    font-size: 0.9rem; display: flex; align-items: center; gap: 5px;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2); transition: 0.2s;
  }
  .btn-tutorial:hover { background: rgba(46, 204, 113, 0.4); transform: scale(1.05); }

  /* チュートリアルのメッセージBOX */
  #tut-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    /* 背景の暗さを少し和らげました (0.7 -> 0.4) */
    background: rgba(0,0,0,0.4); z-index: 2000; display: none;
    pointer-events: auto;
  }
  
  /* ハイライト（穴を開ける） */
  .tut-highlight {
    position: relative; z-index: 2001; 
    /* 周りの暗さも少し和らげました */
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.6); 
    pointer-events: auto; 
    border-radius: 4px;
    transition: all 0.3s ease;
  }

  .tut-blink {
    animation: blink-red 1.2s infinite ease-in-out !important;
    border: 2px solid #ff0000 !important;
    background: rgba(0, 0, 0, 0.8) !important; /* 文字が読みやすいように背景を濃く */
  }
  
  .tut-msg-box {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 92% !important; /* 横幅 */
    max-width: 500px !important;
    background: rgba(15, 15, 20, 0.95) !important;
    border: 1px solid #d4af37 !important;
    border-radius: 8px !important;
    padding: 12px 15px !important; /* パディングを減らす */
    z-index: 20001 !important; /* 最前面に */
    text-align: left !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9) !important;
    transition: all 0.3s ease !important;
    
    /* デフォルトは「画面の一番下」に配置 */
    bottom: 20px !important;
    top: auto !important;
  }

  /* 上に表示する場合のクラス */
  .tut-pos-top {
    top: 80px !important; /* ヘッダーの下 */
    bottom: auto !important;
  }

  /* 下に表示する場合のクラス (デフォルトと同じだが念のため) */
  .tut-pos-bottom {
    bottom: 20px !important;
    top: auto !important;
  }

  /* テキストサイズ調整 */
  .tut-text {
  color: #fff;
  line-height: 1.6;        /* 行間を少し広げて読みやすく */
  font-size: 1rem;         /* PC基準のサイズ */
  margin-bottom: 8px;
  
  /* ★重要: 右側にボタン用の余白を確保（被り防止） */
  padding-right: 80px; 
  box-sizing: border-box;
  }

  /* 2. スマホ用レイアウト調整 (画面幅480px以下) */
@media (max-width: 480px) {
  .tut-text {
    /* スマホでは文字を少し小さくして改行を減らす */
    font-size: 0.85rem; 
    line-height: 1.5;
    
    /* スマホは画面が狭いので、ボタン用余白も少し調整 */
    padding-right: 70px; 
  }

  /* メッセージボックス自体もスマホでは幅を広げる */
  .tut-msg-box {
    width: 96% !important;     /* 左右の余白を減らす */
    padding: 15px 10px !important; /* 内側の余白を調整 */
  }
  
  /* ボタンの位置微調整（必要であれば） */
  #tut-quit-btn {
    font-size: 0.65rem !important; /* ボタン文字も少し小さく */
    padding: 3px 6px !important;
    top: 8px !important;
    right: 8px !important;
  }
}

  /* ボタン調整 */
  .tut-next-btn {
    background: #d4af37;
    color: #000;
    border: none;
    padding: 5px 15px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    float: right;
    font-size: 0.8rem;
  }
  .tut-arrow {
    position: absolute; color: #d4af37; font-size: 2rem; font-weight: bold;
    animation: bounce 1s infinite; z-index: 2003; text-shadow: 0 0 5px #000;
  }
  @keyframes bounce { 0%, 100% { transform:translateY(0); } 50% { transform:translateY(-10px); } }

/* 埋め込みモードのメッセージボックス */
.tut-embedded-mode {
  position: relative !important; /* 固定配置を解除 */
  left: auto !important;
  transform: none !important;
  bottom: auto !important;
  top: auto !important;
  
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 20px 0 !important;
  box-sizing: border-box !important; 
  background: rgba(20, 20, 25, 0.95) !important;
  border: 1px solid #d4af37 !important;
  border-radius: 8px !important;
  padding: 15px !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
  
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-height: 120px; 
}

/* 矢印は埋め込みモードでは消す */
.tut-embedded-mode .tut-arrow {
  display: none !important;
}

/* 結果表示のデザイン */
.tut-result-display {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
  padding: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
}

/* --- Ωモード用メモ欄 (改修版) --- */
.omega-memo-box {
  margin-top: 5px;
  padding: 0 5px;
  display: flex; 
  gap: 5px;
  /* ★変更: テキストエリアが高くなっても、ボタンは「上揃え」か「中央」か。 */
  align-items: center; 
}

.omega-memo-input {
  flex: 1; 
  box-sizing: border-box;
  background: #000;
  border: 1px solid #444;
  color: #d4af37;
  font-size: 0.85rem; /* 少し読みやすく */
  padding: 8px;       /* 余白を広げる */
  border-radius: 4px;
  font-family: 'Shippori Mincho', serif;
  transition: 0.3s;
  resize: vertical;   /* 縦方向のみリサイズ許可 */
  min-height: 40px;   /* 最低限の高さ */
  line-height: 1.4;   /* 行間を空ける */
  overflow-y: auto;   /* 文字数が多い場合はスクロール */
}
.omega-memo-input:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
  background: #111;
}
.btn-omega-copy {
  width: 30px;
  height: 30px;
  background: #222;
  border: 1px solid #555;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  transition: 0.2s;
  flex-shrink: 0;  /* 「絶対に縮まない」という命令*/
}
.btn-omega-copy:active {
  transform: scale(0.9);
  background: #444;
}
/* コピー成功時の演出用クラス */
.copy-success {
  border-color: #2ecc71 !important;
  color: #2ecc71 !important;
  background: rgba(46, 204, 113, 0.1) !important;
}

/* --- ロック状態のスタイル --- */
input.rune-input:disabled {
  background: #222;       /* 背景を暗く */
  color: #555;            /* 文字を暗く */
  border-color: #444;     /* 枠線も目立たなく */
  opacity: 0.7;
  cursor: not-allowed;
}

/* --- iPhone (iOS Safari) 表示崩れ対策 --- */
/* 1. 入力欄のスタイルを強制リセット＆サイズ固定 */
.rune-input {
  /* iPhone特有の丸みや影を消す */
  -webkit-appearance: none !important; 
  appearance: none !important;
  
  /* 横幅を強制的に広げる */
  width: 80px !important; 
  min-width: 80px !important; 
  
  /* 余計な隙間を消す */
  margin: 0;
  border-radius: 8px; /* デザインに合わせて調整してOK */
  box-sizing: border-box; /* 枠線を含めたサイズ計算にする */
}

/* 2. 入力欄を包んでいる箱が潰れないようにする */
.rune-wrapper {
  flex-shrink: 0 !important; /* 「縮むな！」という命令 */
  width: auto !important;
}

/* --- 封印解除演出 --- */
/* === 十字線演出 (中心拡散・極細版) === */
.lightning-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  opacity: 0;
  transform-origin: center center; /* 中心を軸にする */
}
.lightning-path {
  fill: none;
  stroke: #fffbe0; 
  stroke-width: 0.4px; /* さらに細くして鋭さを出す */
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #d4af37) drop-shadow(0 0 6px #aa771c);
  vector-effect: non-scaling-stroke;
}
.lightning-path.main { stroke-width: 0.6px; }
.lightning-path.sub { stroke-width: 0.2px; opacity: 0.5; }
.lightning-svg.omega-mode .lightning-path {
  stroke: #ffffff !important;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 8px #fff) !important;
}
.lightning-svg {
  animation: explode-discharge 2.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* 石板本体 (質感を強化) */
.gate-stone {
  width: 180px; height: 180px; /* 少し大きく */
  /* 点線をやめて、ゴツゴツした実線と多重影に変更 */
  border: 8px solid #2a2a2a;
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-family: 'Cinzel', serif; font-size: 6rem; color: #111;
  position: relative;
  /* 岩っぽいテクスチャと内側からの光 */
  background: radial-gradient(circle, #333 0%, #000 100%);
  box-shadow: 
    inset 0 0 30px #000, /* 内側の深い影 */
    0 0 20px rgba(212, 175, 55, 0.3); /* 外側の微かな光 */
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.5); /* 文字の光 */
}

/* 内側の装飾リング */
.gate-inner {
  width: 140px; height: 140px;
  border: 4px solid rgba(212, 175, 55, 0.6); /* 金色のリング */
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
}

/* 石板のアニメーション (クラス付与で開始) */
.gate-active {
  animation: gateOpenHeavy 2.5s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

/* --- 予言リスト画面用スタイル --- */
#prophecy-list-content {
  background: #111; border: 1px solid #444; padding: 20px; border-radius: 10px; width: 85%; max-width: 500px;
  max-height: 80vh; overflow-y: auto; text-align: left; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.8);
}
.p-cat-title {
  margin-top: 20px; margin-bottom: 10px; font-weight: bold; border-left: 4px solid #555; padding-left: 8px; font-size: 0.95rem;
}
.p-item {
  margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; border-bottom: 1px dashed #333; padding-bottom: 8px; color: #ddd;
}
.p-ex {
  color: #888; font-size: 0.8rem; display: block; margin-top: 2px;
}

/* --- Ωモード特殊演出 (修正版: 天空からの降臨) --- */
.stone-fall {
  /* 3秒かけてゆっくり、ふんわりと着地する */
  animation: dropStone 3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0; /* 最初は隠しておく */
  
  /* 降ってくる間、他のパーツより手前に表示する */
  position: relative;
  z-index: 100; 
}

/* 2. 解除時: 白色の石板スタイル (変更なし) */
.gate-stone-omega {
  border-color: #fff !important;
  color: #fff !important;
  background: radial-gradient(circle, #555 0%, #000 100%) !important;
  box-shadow: inset 0 0 50px #fff, 0 0 30px #fff !important;
  text-shadow: 0 0 20px #fff !important;
}
.gate-inner-omega {
  border-color: #fff !important;
}

/* 通常の1.5倍の時間 (2.5s * 1.5 = 3.75s) */
.gate-active-omega {
  animation: gateOpenHeavy 3.75s cubic-bezier(0.7, 0, 0.3, 1) forwards !important;
}

/* =========================================
   神演出用フレーム (完全版)
   ========================================= */

/* 基本スタイル（位置とサイズ） */
.divine-frame {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 20000;
  border: 4px solid #fff;
  
  /* デフォルト: 金色の光アニメーション */
  box-shadow: inset 0 0 50px #fff, inset 0 0 100px rgba(212, 175, 55, 0.5);
  animation: divinePulse 3s infinite alternate;
}
/* --- Awakened Mode (赤色の神演出) --- */
/* クラス is-awakened がつくと赤色に変化 */
.divine-frame.is-awakened {
  border-color: #ffcccc !important; /* 枠線も少し赤く */
  
  /* 赤色の光アニメーション (importantで強制適用) */
  box-shadow: inset 0 0 50px #fff, inset 0 0 100px rgba(255, 0, 0, 0.5) !important;
  animation: divinePulseAwakened 3s infinite alternate !important;
}

/* 斬撃エフェクト本体 */
.slash-effect {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 30000; display: none;
}
.slash-line {
  position: absolute; background: #fff;
  box-shadow: 0 0 20px #fff, 0 0 40px #ff0000;
  transform: rotate(-20deg);
}

/* 数字が壊される時の震え */
@keyframes glitch-shake {
  0% { transform: translate(0); }
  20% { transform: translate(-5px, 5px); color: #ff0000; }
  40% { transform: translate(-5px, -5px); }
  60% { transform: translate(5px, 5px); }
  80% { transform: translate(5px, -5px); }
  100% { transform: translate(0); }
}
.glitch-active { animation: glitch-shake 0.3s linear infinite; }

/* --- カオスモード演出用 --- */
/* 1. 降り注ぐ禍々しいオーブ */
.chaos-orb {
  position: fixed;
  width: 20px; height: 20px;
  background: radial-gradient(circle, #fff 0%, #d7ccc8 30%, #000 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px #9b59b6, 0 0 20px #8e44ad;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}
/* 落下アニメーション */
@keyframes chaos-fall {
  0% { transform: translateY(-100px) scale(2); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 2. 石碑が呪われた時の振動と変色 */
@keyframes chaos-impact {
  0% { transform: scale(1); border-color: #777; }
  10% { transform: scale(1.1); border-color: #9b59b6; background: #2c0e3a; }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(3px, -3px); }
  60% { transform: translate(-3px, -3px); }
  80% { transform: translate(3px, 3px); }
  100% { transform: scale(1); border-color: #9b59b6; background: rgba(0,0,0,0.6); }
}
.stone.chaos-infected {
    animation: chaos-impact 0.5s cubic-bezier(.36,.07,.19,.97) forwards;
  /* 憑依後は枠線を茶色(サドルブラウン)に固定 */
  border-color: #8B4513 !important;  
  /* 影も茶色っぽく光らせる (RGB: 139, 69, 19) */
  box-shadow: 0 0 15px rgba(139, 69, 19, 0.5);
}


/* 警告文のじわっと表示 */
.chaos-bar {
  opacity: 0;
  transition: opacity 2s ease-in; 
  
  /* 以下は変更なし */
  background: #c0392b; color: white; padding: 5px; font-size: 0.8rem; 
  font-weight: bold; margin-bottom: 15px; border-radius: 4px; 
  display: none; text-shadow: 0 0 5px #000; letter-spacing: 2px;
}
.chaos-bar.visible {
  opacity: 1;
}

/* タップ時の遅延を無効化して即時反応させる */
button, .btn, .hud-btn, .stone, .memo-btn {
  touch-action: manipulation;
}

       /* アニメーション定義（テスト用に高さを半分に） */
  @keyframes dropInBounce {
    0% {
      opacity: 1; /* ★テスト用: 最初から不透明に */
      transform: translateY(-150vh) scale(0.9); /* ★テスト用: 半分の高さから */
    }
    70% { opacity: 1; transform: translateY(20px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Awakened Omega Style */
  /* style.css */
  .btn-awakened {
  border-color: #ff0000;
  color: #ff0000;
  background: #000;
  font-family: 'Cinzel', serif;
  box-shadow: 0 0 10px #500;
  border-style: double;
  border-width: 3px;
  letter-spacing: 1px;
  animation: awakenedPulse 2s infinite alternate;

  /* ▼▼▼ ここから追加（Singularityと合わせる設定） ▼▼▼ */
  width: 90%;
  max-width: 350px;
  padding: 15px; /* 元の18pxから15pxに変更して高さを揃える */
  display: flex;
  justify-content: center; /* 文字を真ん中に */
  align-items: center;
  margin: 8px auto; /* 上下の間隔をSingularityと揃える */
  /* ▲▲▲ ここまで追加 ▲▲▲ */
  }
  .btn-awakened:hover {
    background: #200;
    box-shadow: 0 0 20px #f00;
  }

  @keyframes awakenedPulse {
    0% { text-shadow: 0 0 5px #500; border-color: #800; }
    100% { text-shadow: 0 0 15px #f00; border-color: #f00; }
  }


/* --- 覚醒解放アニメーション --- */
#awakened-unlock-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000; /* 最前面 */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: overlayFadeIn 1s forwards;
}

.unlock-content {
  text-align: center;
  color: #ff0000;
  font-family: 'Cinzel', serif;
}

.unlock-icon {
  font-size: 5rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 0 20px #f00;
  opacity: 0;
  transform: scale(3);
  animation: iconDrop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.5s;
}

.unlock-text-main {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 10px;
  opacity: 0;
  letter-spacing: 5px;
  animation: textSlideUp 1s ease-out forwards 1.5s;
}

.unlock-text-sub {
  font-size: 1.2rem;
  color: #ff0000;
  text-shadow: 0 0 10px #800;
  opacity: 0;
  animation: textBlink 2s infinite alternate 2.5s, fadeIn 1s forwards 2.5s;
}

/* Keyframes */
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes iconDrop { 
  to { opacity: 1; transform: scale(1); text-shadow: 0 0 30px #ff0000; } 
}
@keyframes textSlideUp { 
  from { opacity: 0; transform: translateY(20px); } 
  to { opacity: 1; transform: translateY(0); } 
}
@keyframes textBlink {
  0% { text-shadow: 0 0 10px #500; }
  100% { text-shadow: 0 0 20px #f00, 0 0 40px #f00; }
}

  /* ボタン横並び用のコンテナ */
  .mode-row {
    display: flex;
    width: 90%;
    max-width: 350px;
    gap: 8px; /* ボタン間の隙間 */
    margin: 8px 0;
  }
  
  /* モードボタンのスタイル上書き (flexアイテム化) */
  .mode-row .btn {
    margin: 0; /* ラッパー側で制御するのでマージン削除 */
    flex: 1;   /* 横幅いっぱいに広げる */
  }

  /* ブーストボタン (ドクロ) */
  .btn-boost {
    width: 50px; /* 正方形に近い形 */
    background: #111;
    border: 1px solid #444;
    border-radius: 8px;
    color: #444;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    user-select: none;
  }
  
  /* ONになった時のスタイル (赤く光る) */
  .btn-boost.active {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
    background: rgba(50, 0, 0, 0.5);
    animation: boostPulse 1.5s infinite alternate;
  }
  
  @keyframes boostPulse {
    from { text-shadow: 0 0 5px #f00; }
    to { text-shadow: 0 0 15px #f00; transform: scale(1.05); }
  }
  
      /* --- Easy & Standard 完全整列スタイル --- */
  /* デフォルト（未解放）：縦積み＆全幅 */
  #easy-std-wrapper {
    display: flex;
    flex-direction: column; /* 縦に積む */
    width: 90%;             /* 下のボタンたちと同じ幅 (90%) */
    max-width: 350px;       /* 下のボタンたちと同じ最大幅 */
    gap: 8px;               /* ボタン同士の間隔 */
    margin: 8px 0;          /* 上下の間隔 */
  }

  /* 縦積みの時、中のボタンを親要素(wrapper)いっぱいに広げる */
  #easy-std-wrapper .btn {
    width: 100% !important;     /* 親の幅に合わせる */
    max-width: none !important; /* ボタン自体の制限を解除 */
    margin: 0 !important;       /* 余計なマージンを消す */
    flex: none;                 /* 縦積み時は伸縮させない */
  }

  /* 解放時：横並び（JSでこのクラスが付く） */
  #easy-std-wrapper.unlocked-row {
    flex-direction: row;        /* 横並びにする */
  }
  
  /* 横並びの時だけ、幅を半分こにする */
  #easy-std-wrapper.unlocked-row .btn {
    flex: 1; 
  }

  /* ブースト時の警告メッセージ */
  .boost-popup {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    
    color: #ff0000;
    font-family: 'Shippori Mincho', serif;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 5px #000, 0 0 10px #500;
    background: rgba(0,0,0,0.7); /* 文字が見やすいように背景を敷く */
    padding: 5px 0;
    
    pointer-events: none; /* クリックを邪魔しない */
    opacity: 0;
    z-index: 100;
    
    animation: boostMsgFade 2.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  @keyframes boostMsgFade {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -60%); }
  }

  /* --- Easy & Standard ラッパーのスタイル (完全版) --- */
  
  /* デフォルト状態（未解放）：縦積み */
  #easy-std-wrapper {
    display: flex;
    flex-direction: column; /* 縦に積む */
    align-items: center;    /* 真ん中に揃える */
    width: 100%;            /* 横幅は画面いっぱい使う */
    /* ボタン自体にマージンがあるので、ここではgap不要 */
  }

  /* 解放された状態：横並び（JSでこのクラスが付く） */
  #easy-std-wrapper.unlocked-row {
    flex-direction: row;       /* 横に並べる */
    width: 90%;                /* ラッパー自体の幅をボタンに合わせる */
    max-width: 350px;
    gap: 8px;                  /* ボタン間の隙間 */
    margin: 8px 0;             /* 上下の隙間 */
  }

  /* 横並びになった時の、中身のボタンの調整 */
  #easy-std-wrapper.unlocked-row .btn {
    margin: 0;        /* 横並び時は個別のマージンを消す */
    flex: 1;          /* 仲良く幅を半分こにする */
    width: auto;      /* 幅指定を解除してflexに任せる */
  }

/* レビューモーダル内のログ表示調整 */
#review-log .log-entry {
  /* ログのデザインを維持しつつ、サイズ感を調整 */
  margin-bottom: 4px;
  padding: 6px 8px;
  font-size: 0.75rem; 
}

/* ログ内の数字バッジなども少し小さく */
#review-log .log-nums {
  font-size: 0.7rem;
  padding: 1px 4px;
  width: auto; 
}

/* --- 判定演出アニメーション --- */

/* 1. ドーンと出る */
.anim-pop-in {
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 2. 下に吸い込まれる */
.anim-drop-down {
  animation: dropToLog 0.5s ease-in forwards;
}

@keyframes dropToLog {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  100% { 
    transform: scale(0.3) translateY(300px); /* 下へ移動して小さくなる */
    opacity: 0; 
  }
}

/* メモアイコン用のスタイル */
.memo-icon-img {
  width: 1.1rem;      /* 文字サイズに合わせる */
  height: 1.1rem;
  vertical-align: middle; /* 文字と高さを合わせる */
  margin-right: 5px;  /* 文字との隙間 */
  margin-bottom: 2px; /* 微調整 */
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.5)); /* 軽く光らせる */
}




/* ドクロ画像のサイズ強制矯正 */
.boost-img {
  width: 64px !important;  /* 強制的に小さくする */
  height: 64px !important;
  object-fit: contain;     /* 形を崩さない */
  
  /* 以下は演出用（お好みで） */
  filter: grayscale(100%) brightness(0.6);
  transition: 0.3s;
}

/* ONになった時の演出 */
.btn-boost.active .boost-img {
  filter: grayscale(0%) drop-shadow(0 0 5px #ff0000) brightness(1.2);
  transform: scale(1.2);
}

/* --- プレイ画面のドクロ用（常時覚醒モード） --- */

/* このクラスがつくと、強制的に赤くなって鼓動する */
.img-danger {
  /* 1. デフォルトの「グレー」を無効化して赤くする */
  filter: grayscale(0%) brightness(1.2) drop-shadow(0 0 5px #ff0000) !important;
  opacity: 1 !important;
  
  /* 2. アニメーションをセット */
  animation: skullPulse 1.2s infinite alternate;
}

/* 鼓動のアニメーション定義 */
@keyframes skullPulse {
  0% {
    transform: scale(1);
    filter: grayscale(0%) brightness(1.2) drop-shadow(0 0 5px #ff0000);
  }
  100% {
    transform: scale(1.15); /* 少し大きくなる */
    /* 光を強くする */
    filter: grayscale(0%) brightness(1.5) drop-shadow(0 0 15px #ff0000);
  }
}

/* --- 下部アイコンメニューのスタイル (透明版) --- */

.icon-menu-row {
  display: flex;
  justify-content: center;
  gap: 15px;               /* 3つ並ぶので狭くする */
  margin-top: 25px;
  width: 100%;
  max-width: 400px;        /* 広がりすぎ防止 */
  margin-left: auto;       /* 中央寄せ */
  margin-right: auto;
}


.icon-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 80px;
  transition: transform 0.2s;
}

.icon-menu-item:active {
  transform: scale(0.95);
}

/* 以前は「丸い枠」だった部分 → 透明なコンテナに変更 */
.icon-circle {
  width: 50px;
  height: 50px;
  
  /* ▼▼▼ 透明化！ ▼▼▼ */
  background: transparent; 
  border: none;
  box-shadow: none;
  /* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
  
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2px; /* 文字との距離を少し詰める */
  transition: 0.3s;
}

/* アイコン画像本体 (枠がないので少し大きく、リッチに) */
.menu-icon-img {
  width: 88px;  
  height: 88px;
  object-fit: contain;
  
  /* 常時、少しだけ魔法の光を帯びさせる */
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
  opacity: 0.8; /* 少し透けさせて馴染ませる */
  transition: 0.3s;
}

/* 下の文字 */
.menu-label {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.85rem;
  color: #888; /* 少し暗めにしてアイコンを目立たせる */
  letter-spacing: 1px;
  text-shadow: 0 0 2px #000;
  transition: 0.3s;
}

/* --- ホバー・タップ時の演出 (アイコン自体を光らせる) --- */
.icon-menu-item:hover .menu-icon-img {
  opacity: 1;
  transform: scale(1.1); /* ふわっと浮く */
  /* 金色に強く発光！ */
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8)) brightness(1.2);
}

.icon-menu-item:hover .menu-label {
  color: #d4af37;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* --- メインアクションボタン（JS制御版） --- */

.action-bar-icons {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 25px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.action-btn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 100px;
  transition: transform 0.2s;
}

.action-btn-item:active {
  transform: scale(0.95);
}

/* コンテナ（透明） */
.action-circle {
  width: 80px;
  height: 80px;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.3s;
}

/* アイコン画像 */
.action-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,0.8));
  
  /* ▼▼▼ これが大事！回転をヌルっと動かす設定 ▼▼▼ */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ラベル文字 */
.action-label {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.85rem;
  color: #ccc; 
  letter-spacing: 1px;
  transition: 0.3s;
  text-shadow: 0 0 2px #000;
  margin-top: 5px;
  font-weight: 500;
}

/* --- 個別のスタイル設定（回転は削除、光る演出のみ） --- */

/* 1. 次のラウンド (Next) - 青白く光る */
.action-btn-item:hover .next-circle .action-img {
  filter: drop-shadow(0 0 10px rgba(200, 200, 255, 0.6)) brightness(1.2);
}

/* 2. 封印解除 (Unlock) - 金色に光る */
.action-btn-item:hover .solve-circle .action-img {
  transform: scale(1.15);
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.8)) brightness(1.3);
}

.action-btn-item:hover .action-label {
  color: #fff !important;
  text-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* --- 石板風の入力欄スタイル --- */
.rune-img-display {
  width: 80px;  /* 横幅 */
  height: 80px; /* 高さ */
  background: linear-gradient(145deg, #1a1a1a, #0a0a0a); /* 立体的な黒 */
  border: 2px solid #333;
  border-radius: 10px;
  cursor: pointer;
  
  /* 中央寄せ設定 */
  display: flex;
  justify-content: center;
  align-items: center;
  
  /* 背景画像(SVG)の設定 */
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  
  transition: all 0.2s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.8);
}

/* タップした時の動き */
.rune-wrapper:active .rune-img-display {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,1);
}

/* ロックされた時の見た目 */
.rune-wrapper.locked .rune-img-display {
  opacity: 0.6;
  filter: grayscale(80%);
  border-color: #222;
  cursor: not-allowed;
}

/* Ω+ Singularity ボタン (深淵と事象の地平線) */
.btn-singularity {
  border: 2px solid #8e44ad;
  color: #fff;
  background: #000;
  font-family: 'Cinzel', serif;
  box-shadow: 0 0 10px rgba(142, 68, 173, 0.4);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
  animation: singularityPulse 3s infinite alternate;
  
  width: 90%;
  max-width: 350px;
  padding: 10px 15px; /* 上下のパディングを微調整 */
  
  /* ★変更: 縦積みに変更して中央揃えにする */
  display: flex; 
  flex-direction: column !important; /* row から column に変更 */
  justify-content: center;
  align-items: center;
  margin: 8px auto;
}

/* 中のテキストサイズ調整 */
.btn-singularity span {
  font-size: 1rem;
  line-height: 1.3; /* 行間を少し詰める */
}

/* ベストスコアの表示微調整（必要なら追加） */
#tower-best-score {
  margin-top: 2px;      /* タイトルとの隙間 */
  font-size: 0.6rem;    /* 少し小さく */
  letter-spacing: 2px;  /* 文字間隔を広げて格好良く */
}

.btn-singularity:hover {
  background: #1a001a;
  box-shadow: 0 0 30px rgba(142, 68, 173, 0.8), inset 0 0 20px rgba(142, 68, 173, 0.5);
  transform: scale(1.02);
  border-color: #d2b4de;
}



/* タワー階層表示用 (右上のID表示の代わり) */
#tower-floor-badge {
  font-family: 'Cinzel', serif;
  font-weight: bold;
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  margin-top: -5px;
  padding: 5px 15px;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  display: inline-block;
}

/* タワーモードでの敗北時テキスト強調 */
.tower-death-msg {
  color: #e74c3c;
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 10px;
  text-shadow: 0 0 5px #500;
}

/* アクションボタンの無効化スタイル */
.action-btn-item.disabled {
  opacity: 0.3;
  pointer-events: none; /* クリック不可にする */
  filter: grayscale(100%);
}

/* --- 塔解放 --- */
/* 画面振動アニメーション */
.shake-effect {
  animation: screenShake 0.1s linear infinite;
}
#tower-unlock-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 30000;
  
  display: none; 
  flex-direction: column; 
  justify-content: flex-end; 
  align-items: center;
  
  opacity: 0; transition: opacity 1s;
}

/* 1. コンテナ設定 */
.tower-image-container {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: flex-end; /* 画像を下揃え */
  
  transform: translateY(100%);
  transition: transform 4.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  pointer-events: none; z-index: 30001;
}

/* せり上がり発動クラス */
.tower-image-container.rise-active {
  transform: translateY(0%);
}

/* 2. バックライト（光）の設定：z-indexをマイナスにする */
.tower-image-container::before {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 300px; 
  height: 97%; 
  
  /* 紫と金の光 */
  background: radial-gradient(ellipse at bottom, rgba(142, 68, 173, 0.8) 0%, rgba(212, 175, 55, 0.3) 50%, transparent 80%);
  filter: blur(20px);
  
  z-index: -1; /* ★重要: 画像より後ろへ */
}

/* 3. 画像本体の設定：z-indexをプラスにする */
.tower-image {
  position:fixed; top: 0;
  z-index: 30000;        /* ★重要: 光より手前へ */
  
  width: auto;
  max-width: 95%;     /* 画面からはみ出さない */
  height: 100vh;       
  object-fit: contain; /* 比率を保つ */
  
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.8)) brightness(0.9);
  
  /* 念のためブロック要素にする */
  display: block; 
  
  animation: towerRumble 0.1s linear infinite;
}

/* テキストコンテナ（変更なし） */
.tower-unlock-container {
  position: absolute; top: 15%; left: 0; width: 100%; text-align: center; z-index: 30002;
  opacity: 0; transform: translateY(20px);
  transition: all 1s ease-out; transition-delay: 3.5s;
}
.tower-unlock-container.text-visible {
  opacity: 1; transform: translateY(0);
}

/* 石板直下の判定結果リスト
/* 石板直下のミニログ用コンテナ */
.mini-log-container {
  display: flex;
  flex-wrap: wrap; /* 端まで来たら折り返す */
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0 5px;
  width: 100%;
  box-sizing: border-box;
}

/* 個別の判定結果チップ */
.mini-res-item {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #333;
  white-space: nowrap; /* 折り返し防止 */
  animation: fadeIn 0.3s ease-out;
}

/* TRUEの場合のデザイン (金) */
.mini-res-t {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
  border-color: #8a7326;
}

/* FALSEの場合のデザイン (紫) */
.mini-res-f {
  background: rgba(155, 89, 182, 0.15);
  color: #d7bde2;
  border-color: #8e44ad;
}

/* T/Fの文字強調 */
.mini-label {
  font-weight: bold;
  margin-right: 3px;
  letter-spacing: 1px;
}

/* ミニログ内の数字をよりくっきりさせる */
.mini-res-item .num-fire,
.mini-res-item .num-water,
.mini-res-item .num-wind {
  text-shadow: 0 0 2px rgba(0,0,0,0.8); /* 黒い影をつけて文字を浮き立たせる */
  font-weight: 800; /* より太く */
}

/* テキストエリアのスクロールバーをダークにする */
.omega-memo-input::-webkit-scrollbar {
  width: 6px;
}
.omega-memo-input::-webkit-scrollbar-track {
  background: #000; 
}
.omega-memo-input::-webkit-scrollbar-thumb {
  background: #333; 
  border-radius: 3px;
}
.omega-memo-input::-webkit-scrollbar-thumb:hover {
  background: #d4af37; /* ホバー時に金色に */
}

/* --- タワー突入＆階段演出 --- */

/* --- 塔への突入演出（ヴォイド・ゲート ver.） --- */
/* アニメーションのベース設定 */
#anim-tower-img {
  transform-origin: center center; /* 真ん中を中心に変形 */
  will-change: transform, filter, opacity; /* 動作を軽くするおまじない */
}

/* クラスが付与されたら発動するアニメーション */
.tower-zoom-active {
  animation: voidDive 2.2s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

/* --- 突入演出の背景：激しい雷エフェクト --- */

/* オーバーレイの基本背景色（宇宙空間のような深い色） */
#tower-entry-anim-overlay {
  background: radial-gradient(ellipse at center, #1a0033 0%, #000000 100%);
}

/* 塔の画像を最前面に持ってくる設定 */
#anim-tower-img {
  position: relative;
  z-index: 10; 
}

/* --- 階段演出（登る感覚アップ版） --- */
#stairs-anim-overlay {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0; left: 0;
  
  /* 画像パス */
  background-image: url('../assets/images/stairs_img.png'); 
  
  /* 繰り返しなし */
  background-repeat: no-repeat; 
  
  /* 画面いっぱいに */
  background-size: 150% auto; /* 横幅を1.5倍に拡大 */
  
  /* 初期位置：足元（一番下） */
  background-position: center 100%;
  
  /* 最前面 */
  z-index: 40000 !important; 
  
  display: none;
  opacity: 0;
}

/* 階段アニメーションクラス */
.stairs-climb-active {
  /* イージングを調整して、踏み出しを力強く */
  animation: climbStairs 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* --- Awakened Mode (赤色演出) の追加定義 --- */

/* 1. 覚醒モードの石板 (通常時は赤黒く、文字は赤) */
.stone.is-awakened {
  color: #ff0000 !important;
  background: radial-gradient(circle, #1a0505 0%, #000 100%) !important;
  border-color: #8a1c1c !important;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.2), inset 0 0 10px rgba(0,0,0,0.8);
}

.stone.is-awakened .stone-text {
  color: #ff0000 !important;
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.6) !important;
}

/* 落下アニメーション中の発光 (赤) */
.stone.is-awakened.stone-fall {
   box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
   border-color: #ff0000;
}

/* 呼吸アニメーション (赤版) */
.stone.is-awakened.omega-pulsing {
  animation: awakenedPulseStone 3s infinite alternate !important;
}
/* 2. Search & Destroy (右側のリスト) の赤色化 */

/* 落下中のスタイル (赤枠・赤背景) */
.omega-list-item.is-awakened.falling {
  background: rgba(255, 0, 0, 0.25) !important;
  border: 1px solid #ff0000 !important;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.4) !important;
  color: #ffcccc !important;
}

/* リストアイテムのホバー時 (赤く光る) */
.omega-list-item.is-awakened:hover {
  color: #ff0000 !important;
  background: rgba(255, 0, 0, 0.15) !important;
  text-shadow: 0 0 5px #ff0000;
}

/* 3. Awakenedモード時の「真実のルーン」表示色調整 (結果画面用) */
.stone.is-awakened .stone-title {
  color: #8a1c1c !important; /* タイトルも少し赤暗く */
}

/* Awakenedモードのクリアオーバーレイ (赤色) */
.game-clear-overlay.is-awakened {
  background: radial-gradient(circle, transparent 40%, #ff0000 90%) !important; /* グラデーションを赤に */
  box-shadow: inset 0 0 50px #ff0000, inset 0 0 100px #8a1c1c !important; /* 影も赤に */
  animation: clearFlashAwakened 2s forwards !important; /* 専用アニメーションを適用 */
}

/* =========================================
   Ω+ SINGULARITY TOWER: 修正版
   ========================================= */

/* 全タワー階層共通の背景ベース設定 */
body[class*="bg-tower-"] {
    background-color: transparent !important; 
    background-image: none !important;      /* グラデーション画像だけ消す */
    
    /* アニメーションなどは ::before に任せるので影響なし */
    animation: none !important;
    filter: none !important;
}

body[class*="bg-tower-"]::before {
    content: "";
    position: fixed; /* 背景を画面に固定 */
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; /* コンテンツの裏側へ */
    pointer-events: none;
    will-change: transform, filter; /* 描画最適化 */
    /* グラデーションが崩れないようにカバー設定 */
    background-size: cover;
}

/* --- 1F-5F: 静寂の回廊 --- */
body.bg-tower-1::before {
  background: radial-gradient(circle at center, #001f3f 0%, #000000 90%);
  animation: towerBreath 5s infinite alternate ease-in-out;
}
/* テキスト等の色は body のままでOK */
body.bg-tower-1 .stone,
body.bg-tower-1 .omega-list-item {
  border-color: #00ffff !important;
  color: #e0ffff !important;
  background: rgba(0, 31, 63, 0.8) !important;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3) !important;
}
body.bg-tower-1 .stone-text,
body.bg-tower-1 .stone-title {
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6) !important;
  color: #00ffff !important;
}
/* --- 6F-10F: 悪夢の層 --- */
body.bg-tower-2::before {
  background: radial-gradient(circle at center, #2e003e 0%, #050005 100%);
  animation: towerBreath 3s infinite alternate ease-in-out;
}
body.bg-tower-2 .stone,
body.bg-tower-2 .omega-list-item {
  border-color: #9b59b6 !important;
  color: #e8daef !important;
  background: rgba(46, 0, 62, 0.8) !important;
  box-shadow: 0 0 15px rgba(155, 89, 182, 0.4) !important;
}
body.bg-tower-2 .stone-text,
body.bg-tower-2 .stone-title {
  text-shadow: 0 0 10px rgba(155, 89, 182, 0.8) !important;
  color: #d2b4de !important;
}

/* --- 11F-15F: 歪みの層 --- */
body.bg-tower-3::before {
  background: radial-gradient(circle at center, #003300 0%, #000000 100%);
  animation: towerBreath 5s infinite alternate linear;
}
body.bg-tower-3 .stone,
body.bg-tower-3 .omega-list-item {
  border-color: #00ff00 !important;
  color: #ccffcc !important;
  background: rgba(0, 20, 0, 0.9) !important;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.5), inset 0 0 10px rgba(0, 50, 0, 0.5) !important;
  font-family: 'Courier New', monospace !important;
}
body.bg-tower-3 .stone-text,
body.bg-tower-3 .stone-title {
  text-shadow: 0 0 5px #00ff00 !important;
  color: #00ff00 !important;
}
/* --- 16F-19F: 混沌の層 --- */
body.bg-tower-4::before {
  background: radial-gradient(circle at center, #3e0000 0%, #000000 100%);
  animation: towerBreath 2s infinite alternate ease-in;
}
body.bg-tower-4 .stone,
body.bg-tower-4 .omega-list-item {
  border-color: #ff0000 !important;
  color: #ffcccc !important;
  background: rgba(40, 0, 0, 0.85) !important;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5) !important;
}
body.bg-tower-4 .stone-text,
body.bg-tower-4 .stone-title {
  text-shadow: 0 0 15px #ff0000 !important;
  color: #ff0000 !important;
}
/* 20F*/
body.bg-tower-5::before {
  /* 背景: 全てを飲み込む「白」と「金」 */
  background: radial-gradient(circle at center, #ffffffa8 0%, #cccccc 30%, #000000 100%);
  animation: towerBreath 10s infinite alternate ease-in-out; /* 神々しくゆっくり */
}
body.bg-tower-5 .stone,
body.bg-tower-5 .omega-list-item {
  border-color: #d4af37 !important;
  background: rgba(255, 255, 255, 0.9) !important; /* 白い石板 */
  color: #000 !important; /* 黒い文字 */
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.8) !important;
}
body.bg-tower-5 .stone-text {
  color: #000 !important;
  text-shadow: none !important;
  font-weight: 900 !important;
}
body.bg-tower-5 .stone-title {
  color: #555 !important;
}
/* 20FのS&Dリストホバー時 */
body.bg-tower-5 .omega-list-item:hover {
  background: #d4af37 !important;
  color: #fff !important;
}

/* =========================================
   Tower Floor Frames (階層別クリア演出)
   ========================================= */
/* 1F-5F: Cyan Frame */
.divine-frame.tower-1 {
  border-color: #00ffff !important;
  box-shadow: inset 0 0 50px #fff, inset 0 0 100px rgba(0, 255, 255, 0.5) !important;
  animation: divinePulseCyan 3s infinite alternate !important;
}
/* 6F-10F: Purple Frame */
.divine-frame.tower-2 {
  border-color: #d2b4de !important;
  box-shadow: inset 0 0 50px #fff, inset 0 0 100px rgba(155, 89, 182, 0.5) !important;
  animation: divinePulsePurple 3s infinite alternate !important;
}
/* 11F-15F: Green Frame */
.divine-frame.tower-3 {
  border-color: #ccffcc !important;
  box-shadow: inset 0 0 50px #fff, inset 0 0 100px rgba(0, 255, 0, 0.5) !important;
  animation: divinePulseGreen 3s infinite alternate !important;
}
/* 16F-19F: Red Frame (Awakenedと同じ赤) */
.divine-frame.tower-4 {
  border-color: #ffcccc !important;
  box-shadow: inset 0 0 50px #fff, inset 0 0 100px rgba(255, 0, 0, 0.5) !important;
  animation: divinePulseAwakened 3s infinite alternate !important; /* 定義済みの赤アニメを流用 */
}
/* 20F: Gold/White Frame (デフォルトのまま、あるいはより神々しく) */
.divine-frame.tower-5 {
  box-shadow: inset 0 0 80px #b27c7c, inset 0 0 200px rgba(212, 175, 55, 0.8) !important;
}

/* 20F CLEAR: THE BIG BANG */
#singularity-ending-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 50000; /* 最前面 */
  display: none;
  justify-content: center; align-items: center;
  overflow: hidden;
}
/* 1. 特異点コア (中心の光) */
.s-core {
  width: 10px; height: 10px; background: #fff; border-radius: 50%;
  box-shadow: 0 0 50px #fff, 0 0 100px #d4af37;
  position: absolute;
  z-index: 10;
  opacity: 0;
}
/* 2. 衝撃波リング */
.s-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0;
  box-shadow: 0 0 20px #d4af37;
}
/* 3. 神の光条 (回転する光) */
.s-ray {
  position: absolute; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(255,255,255,0.1) 10%, transparent 20%, rgba(212,175,55,0.2) 50%, transparent 100%);
  animation: raySpin 10s linear infinite;
  opacity: 0;
}
/* 4. ホワイトアウト用フラッシュ */
.s-flash {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: #fff;
  opacity: 0;
  z-index: 20;
}
/* クラス付与で発火 */
.s-active .s-core { animation: coreSequence 4s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.s-active .ring-1 { animation: ringImplode 2.5s ease-in forwards; animation-delay: 0.5s; }
.s-active .ring-2 { animation: ringImplode 2.5s ease-in forwards; animation-delay: 1.0s; }
.s-active .s-ray  { animation: raySpin 4s linear forwards; }
.s-active .s-flash{ animation: whiteoutFlash 4s linear forwards; }

/*  =========================================
　　　　　　　アニメーション定義群
 　 ========================================= */
/* --- Game screen --- */
@keyframes slideIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* --- 生成ボタン --- */
@keyframes singularityPulse {
  0% { box-shadow: 0 0 10px rgba(142, 68, 173, 0.3); border-color: #5b2c6f; }
  100% { box-shadow: 0 0 25px rgba(142, 68, 173, 0.8); border-color: #d2b4de; }
}
/* チュートリアル用赤く点滅 */
@keyframes blink-red {
    0% { border-color: #ff0000; box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); transform: scale(1); }
    50% { border-color: #ffcccc; box-shadow: 0 0 25px rgba(255, 50, 50, 0.9); transform: scale(1.02); }
    100% { border-color: #ff0000; box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); transform: scale(1); }
}

/* ロックメッセージ */
@keyframes fadeIn { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:translateY(0); } }

/* 封印解除 */
@keyframes explode-discharge {
  0% { 
    opacity: 0; 
    transform: scale(0.2); /* 中心に凝縮 */
  }
  5% { 
    opacity: 1; 
    transform: scale(1.2); /* 一気に広がる */
  }
  /* バチバチと震えるノイズ */
  10%, 30%, 50%, 70%, 90% { transform: scale(1.05) translate(2px, -1px); opacity: 1; }
  20%, 40%, 60%, 80% { transform: scale(1) translate(-2px, 1px); opacity: 0.2; }
  95% { opacity: 1; transform: scale(1.2) filter(brightness(2)); }
  100% { opacity: 0; transform: scale(2); filter: brightness(10); }
}
@keyframes gateOpenHeavy {
  0% { 
    transform: rotate(0deg) scale(1);
    border-color: #2a2a2a; color: #111;
  }
  20% {
    /* 起動: ガガガッと少し回って止まる */
    transform: rotate(45deg) scale(1.1);
    color: #d4af37; border-color: #d4af37;
    box-shadow: inset 0 0 50px #d4af37, 0 0 50px #d4af37;
  }
  40% {
    /*溜め: 一瞬逆回転してエネルギーを溜める */
    transform: rotate(30deg) scale(1.05);
    filter: brightness(1.5);
  }
  100% {
    /* 解放: 一気に加速してホワイトアウト */
    transform: rotate(1080deg) scale(15);
    opacity: 0; filter: brightness(20);
    color: #fff; border-color: #fff;
  }
}

/* Ω開始時: 予言が画面最上部から降ってくる */
@keyframes dropStone {
  0% { 
    transform: translateY(-120vh); /* 画面の遥か上からスタート */
    opacity: 0;
  }
  10% {
    opacity: 1; /* 降り始めですぐ見えるように */
  }
  100% { 
    transform: translateY(0); /* 自分の場所に着地 */
    opacity: 1; 
  }
}
/* omega予言一覧アニメーション */
@keyframes omegaPulse {
    0% {
      box-shadow: 0 0 5px rgba(212, 175, 55, 0.2), inset 0 0 10px rgba(0,0,0,0.8);
      border-color: #8a7326;
    }
    100% {
      box-shadow: 0 0 25px rgba(212, 175, 55, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.1);
      border-color: #ffe066;
    }
}
/* omega石板アニメーション */
@keyframes divinePulse {
  0% { 
    box-shadow: inset 0 0 30px #fff, inset 0 0 80px rgba(212, 175, 55, 0.3); 
    opacity: 0.8; 
  }
  100% { 
    box-shadow: inset 0 0 60px #fff, inset 0 0 150px rgba(212, 175, 55, 0.8); 
    opacity: 1; 
  }
}

/* AwekeneD予言一覧アニメーション */
@keyframes awakenedPulseStone {
  0% {
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.2), inset 0 0 10px rgba(0,0,0,0.8);
    border-color: #8a1c1c;
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6), inset 0 0 20px rgba(255, 0, 0, 0.2);
    border-color: #ff4d4d;
  }
}
/* AwekeneD石板アニメーション */
@keyframes divinePulseAwakened {
  0% { 
    box-shadow: inset 0 0 30px #fff, inset 0 0 80px rgba(255, 0, 0, 0.3); 
    opacity: 0.8; 
  }
  100% { 
    box-shadow: inset 0 0 60px #fff, inset 0 0 150px rgba(255, 0, 0, 0.8); 
    opacity: 1; 
  }
}

/* 塔解放 */
@keyframes screenShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(3px, 3px); }
  50% { transform: translate(-3px, -2px); }
  75% { transform: translate(2px, -3px); }
  100% { transform: translate(-2px, 2px); }
}
@keyframes towerRumble {
  0% { transform: translateX(0); }
  25% { transform: translateX(1px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}
/* 塔突入禍々しいアニメーション本体 */
@keyframes voidDive {
  0% {
    transform: scale(1);
    filter: brightness(1) drop-shadow(0 0 0 rgba(142,68,173,0));
    opacity: 1;
  }
  /* [溜め] 塔が黒く沈み込み、背後から紫の光が溢れ出す */
  20% {
    transform: scale(0.95);
    filter: brightness(0.5) drop-shadow(0 0 30px rgba(142,68,173, 0.8));
  }
  /* [覚醒] 激しく振動し、色が反転しかける */
  40% {
    transform: scale(1.1) rotate(2deg);
    filter: brightness(1.5) contrast(2) drop-shadow(0 0 60px rgba(212,175,55, 1)) hue-rotate(45deg);
  }
  45% {
    transform: scale(1.15) rotate(-2deg);
    filter: invert(1) drop-shadow(0 0 80px rgba(142,68,173, 1)); /* 一瞬ネガポジ反転 */
  }
  /* [突入] 空間ごとねじ曲がりながら吸い込まれる */
  60% {
    transform: scale(3) rotate(5deg);
    filter: brightness(1) blur(2px);
  }
  100% {
    /* 最後は超拡大して、闇の中に消える */
    transform: scale(20) rotate(15deg); 
    filter: brightness(0) blur(20px); /* 完全に真っ黒になる */
    opacity: 0;
  }
}

/* 次のフロアへ */
@keyframes climbStairs {
  0% {
    opacity: 0;
    transform: scale(1);
    /* スタート：階段の一番下（足元）を見る */
    background-position: center 100%; 
  }
  15% {
    opacity: 1; /* すぐに表示 */
  }
  80% {
    opacity: 1; /* 登っている間は見えている */
  }
  100% {
    opacity: 0; /* 最後はフェードアウト */
    
    /* アクション：奥に進みつつ（拡大）、視線を上げる（位置移動） */
    transform: scale(1.25); 
    background-position: center 40%; /* 画像の上の方へ視点をずらす */
  }
}

/* --- 共通設定: 背景の呼吸アニメーション --- */
@keyframes towerBreath {
  0% { 
    /* サイズ変更ではなく、レイヤー自体を「等倍」にする */
    transform: scale(1); 
    filter: brightness(1); 
  }
  50% { 
    /* レイヤー自体を「1.1倍」にズームする（画質劣化なしで軽い！） */
    transform: scale(1.1); 
    filter: brightness(1.2); 
  }
  100% { 
    transform: scale(1); 
    filter: brightness(1); 
  }
}
/* --- クリア演出カラー --- */
/* Awakened専用の赤色フラッシュアニメーション */
@keyframes clearFlashAwakened {
  0% { opacity: 0; }
  20% { 
    opacity: 1; 
    box-shadow: inset 0 0 80px #ff4d4d, inset 0 0 150px #ff0000; /* 明るい赤で発光 */
  }
  50% { 
    opacity: 1; 
    box-shadow: inset 0 0 120px #ff8080, inset 0 0 250px #ff0000; /* さらに強く発光 */
  }
  100% { 
    opacity: 1; 
    box-shadow: inset 0 0 50px #ff0000, inset 0 0 100px #8a1c1c; /* 落ち着いた赤に戻る */
  }
}
@keyframes divinePulseCyan {
  0% { box-shadow: inset 0 0 30px #fff, inset 0 0 80px rgba(0, 255, 255, 0.3); opacity: 0.8; }
  100% { box-shadow: inset 0 0 60px #fff, inset 0 0 150px rgba(0, 255, 255, 0.8); opacity: 1; }
}
@keyframes divinePulsePurple {
  0% { box-shadow: inset 0 0 30px #fff, inset 0 0 80px rgba(155, 89, 182, 0.3); opacity: 0.8; }
  100% { box-shadow: inset 0 0 60px #fff, inset 0 0 150px rgba(155, 89, 182, 0.8); opacity: 1; }
}
@keyframes divinePulseGreen {
  0% { box-shadow: inset 0 0 30px #fff, inset 0 0 80px rgba(0, 255, 0, 0.3); opacity: 0.8; }
  100% { box-shadow: inset 0 0 60px #fff, inset 0 0 150px rgba(0, 255, 0, 0.8); opacity: 1; }
}

/* 20Fクリア演出 */
@keyframes coreSequence {
  0% { transform: scale(0); opacity: 0; }
  20% { transform: scale(5); opacity: 1; box-shadow: 0 0 50px #d4af37; } /* 出現 */
  60% { transform: scale(0.5); opacity: 1; background: #000; border: 2px solid #fff; } /* 収束（黒点化） */
  70% { transform: scale(0.1); background: #fff; box-shadow: 0 0 200px #fff; } /* 臨界点 */
  100% { transform: scale(300); opacity: 0; } /* 爆発 */
}
/* リング：収束に合わせて吸い込まれる */
@keyframes ringImplode {
  0% { width: 200vw; height: 200vw; opacity: 0; border-width: 1px; }
  30% { opacity: 0.5; border-width: 5px; }
  100% { width: 0; height: 0; opacity: 1; border-width: 20px; }
}
/* フラッシュ：爆発の瞬間に真っ白にする */
@keyframes whiteoutFlash {
  0%, 70% { opacity: 0; }
  75% { opacity: 1; } /* ピカッ！ */
  100% { opacity: 0; } /* フェードアウトしてリザルトへ */
}
@keyframes raySpin {
  0% { transform: rotate(0deg); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 0; transform: rotate(180deg); } /* 収束時に消える */
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   12. Utilities (New Section)
   ========================================================================== */
.text-gold { color: #d4af37 !important; }
.text-green { color: #2ecc71 !important; }
.text-red { color: #e74c3c !important; }
.text-sub { color: #aaa; font-size: 0.8rem; }
.text-center { text-align: center; }
.font-cinzel { font-family: 'Cinzel', serif; }
.font-mincho { font-family: 'Shippori Mincho', serif; }

/* 非表示・隠蔽用 */
.d-none { display: none; } 
.hidden { visibility: hidden; }

/* 幅・余白調整 */
.w-100 { width: 100% !important; justify-content: center; }
.mt-10 { margin-top: 10px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-20 { margin-bottom: 20px !important; }
.p-0 { padding: 0 !important; }

/* =========================================
   Specific Components (個別パーツ)
   ========================================= */
/* タイトル画面のサブタイトル */
.title-subtitle {
    color: #aaa;
    margin-bottom: 40px;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* ブーストアイコン（ドクロ）のコンテナ */
.boost-container {
    display: none; /* デフォルト */
    border: none;
    background: transparent;
}
/* スペーサー用 */
.boost-spacer {
    display: none;
    visibility: hidden;
    cursor: default;
}
/* --- ID入力モーダルの間隔調整 --- */
/* 1. グリッド内のボタン（Easy〜Ω）の余白を強制削除 */
.grid-buttons .btn {
  margin: 0 !important;
}
/* 2. Awakened Omegaボタンの上下余白を詰める */
#id-modal #btn-id-awakened {
  margin-top: 10px !important;    /* 上のグリッドとの隙間 */
  margin-bottom: 10px !important; /* 下の閉じるボタンとの隙間 */
}
/* 3. 閉じるボタンの上余白を詰める */
#id-modal button.mt-20 {
  margin-top: 0 !important;
}

/* 警告バーのバリエーション */
.chaos-bar.nightmare, .chaos-bar.omega {
    background: #4a1c8a;
    border: 1px solid #9b59b6;
    box-shadow: 0 0 10px #4a1c8a;
}

/* 封印解除の金枠モーダル */
.modal-box.gold-border {
    border: 1px solid #d4af37;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}

/* Awakened Entry Modal (赤) */
.modal-box.awakened-entry {
    background: #050000;
    border: 2px solid #ff0000;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3);
    overflow: hidden;
}

/* Singularity Entry Modal (紫) */
.modal-box.singularity-entry {
    background: #050505;
    border: 2px solid #8e44ad;
    box-shadow: 0 0 50px rgba(142, 68, 173, 0.3);
    overflow: hidden;
}

/* 履歴詳細：予言リストのグリッドレイアウト */
.review-prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2列表示 */
  gap: 8px;
  background: #000;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #333;
  max-height: 200px;
  overflow-y: auto;
}

/* 予言アイテム単体 */
.review-prop-item {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 嘘つきだった場合の強調スタイル */
.review-prop-item.is-review-liar {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

/* スマホなど画面が狭いときは1列にする */
@media (max-width: 380px) {
  .review-prop-grid {
    grid-template-columns: 1fr;
  }
}
/* --- 突入確認モーダル内のボタン共通設定 --- */
/* 「やめる」も「深淵を覗く」も、この画面では全く同じサイズ感にする */
#awakened-entry-modal .btn {
  width: auto !important;       /* 幅固定を解除 */
  max-width: none !important;   /* 最大幅制限を解除 */
  flex: 1;                      /* 横幅を仲良く半分こ（50%:50%）にする */
  margin: 0 !important;         /* 余計なマージン削除 */
  padding: 15px !important;     /* 高さを揃える */
  
  /* フレックスボックスで文字を中央揃え */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ※Awakenedボタンは枠線が太い(3px)ので、その分だけ高さを微調整 */
#awakened-entry-modal .btn-awakened {
   /* 通常ボタン(枠1px)と見た目の高さを合わせるための微調整 */
   /* paddingを少し減らしてバランスを取ります */
   padding: 13px !important; 
}

/* --- アチーブメントモーダル全体 --- */
.achiev-box-layout {
  display: flex;
  flex-direction: column;
  height: 85vh; /* 画面の85% */
  max-height: 800px; /* 最大高さを少し緩和 */
  background: radial-gradient(circle at center, #1a1a1a, #000);
  border: 1px solid #444;
  box-shadow: 0 0 50px rgba(0,0,0,0.9);
  padding: 0 !important;
  overflow: hidden;
}

/* ヘッダー */
.achiev-header {
  padding: 10px 20px; /* 高さを少し詰める */
  border-bottom: 1px solid #333;
  background: rgba(20, 20, 20, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; /* 縮小させない */
}
.achiev-header h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
  color: #d4af37;
  font-size: 1.1rem;
  letter-spacing: 2px;
}
.achiev-stats {
  font-size: 0.8rem;
  color: #666;
  font-family: 'Cinzel', serif;
}
.stat-num { color: #fff; font-weight: bold; }

/* --- グリッドエリア (棚) - ここを広くする --- */
.achiev-grid-area {
  flex: 1; /* 残りのスペースを全て使う */
  overflow-y: auto;
  padding: 20px;
  /* 棚の背景演出 */
  background: 
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 98px,
      rgba(255, 255, 255, 0.05) 99px,
      rgba(255, 255, 255, 0.05) 100px
    ); /* 簡易的な棚板ライン */
  
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  grid-auto-rows: 90px; /* アイテムの高さを少しコンパクトに */
  gap: 15px;
  align-content: start;
}

/* --- アイテムセル (台座) --- */
.achieve-cell {
  position: relative;
  background: linear-gradient(to bottom, #2a2a2a, #151515);
  border: 1px solid #333;
  border-radius: 4px;
  box-shadow: inset 0 0 10px #000, 0 5px 10px rgba(0,0,0,0.5);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.achiev-icon-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  /* ▼▼▼ 変更箇所: 未獲得時は明るさを0にして完全なシルエット(黒)にする ▼▼▼ */
  filter: brightness(0); 
  opacity: 0.6; /* 真っ黒すぎると浮くので、少し背景になじませる */
  transition: 0.5s;
}


/* --- 【新機能】選択時のじんわり発光アニメーション --- */
@keyframes selectedPulse {
  0% {
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.1);
    border-color: #8a7326;
  }
  50% {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.2);
    border-color: #ffe066;
  }
  100% {
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.1);
    border-color: #8a7326;
  }
}

.achieve-cell.selected {
  background: linear-gradient(to bottom, #3a2a1a, #1a1100);
  z-index: 1;
  transform: scale(1.05);
  border-color: #555; /* 未獲得時は地味な枠線 */
}

/* 【重要】獲得済み(unlocked)の場合のみ、金色の発光アニメーションを適用 */
.achieve-cell.selected.unlocked {
  animation: selectedPulse 2s infinite ease-in-out;
  border-color: #8a7326; /* アニメーション開始色に合わせる */
}

/* 選択時は中の画像も明るく光らせる（★unlockedがついている場合のみに限定！） */
.achieve-cell.selected.unlocked .achiev-icon-img {
  filter: grayscale(0%) brightness(1.2) drop-shadow(0 0 8px rgba(212, 175, 55, 0.8));
  opacity: 1;
}

/* ★追加: 選択されていても、未獲得なら黒塗りを強制する */
.achieve-cell.selected:not(.unlocked) .achiev-icon-img {
  filter: brightness(0) !important;
  opacity: 0.6;
}
/* 獲得済みアイコン（ここは変更なしでOKですが、確認用に載せておきます） */
.achieve-cell.unlocked .achiev-icon-img {
  /* 獲得したらカラー＆元の明るさに戻す */
  filter: grayscale(0%) brightness(0.8);
  opacity: 0.8;
}

/* --- 詳細パネル (スリム化 & 画像強調) --- */
.achiev-detail-panel {
  /* 高さを固定せず、中身に合わせてフィットさせる */
  min-height: 100px; 
  background: #0f0f0f;
  border-top: 1px solid #d4af37;
  
  /* 上下パディングを減らしてスリムに */
  padding: 10px 15px; 
  
  display: flex;
  gap: 15px;
  align-items: center; /* 縦方向中央揃え */
  box-shadow: 0 -5px 20px rgba(0,0,0,0.8);
  position: relative;
  z-index: 10;
  flex-shrink: 0; /* 縮小させない */
}

/* アイコンボックス (画像を大きく強調) */
.detail-icon-box {
  width: 90px;  /* 横幅アップ */
  height: 90px; /* 高さアップ */
  
  /* 枠線をなくして画像だけを浮かび上がらせる */
  background: transparent; 
  border: none;
  
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

/* 詳細画像のスタイル */
#detail-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  
  /* デフォルトは非表示 */
  opacity: 0; 
  display: none; /* ここで一度消す */
  
  filter: drop-shadow(0 5px 15px rgba(0,0,0,0.9));
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 【新定義】画像用の呼吸発光アニメーション */
@keyframes detailIconPulse {
  0% {
    /* 金色の光彩、標準サイズ */
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6)) brightness(1.1);
    transform: scale(1);
  }
  50% {
    /* 強い輝き、少し拡大 */
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 1)) brightness(1.4);
    transform: scale(1.08);
  }
  100% {
    /* 元に戻る */
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6)) brightness(1.1);
    transform: scale(1);
  }
}

/* 選択された状態（is-selectedクラス付与時） */
.detail-icon-box.is-selected #detail-icon {
  display: block; /* ブロック要素として復活させる */
  opacity: 1;
  transform: scale(1);
  
  /* 獲得済みなら呼吸アニメーション */
  animation: detailIconPulse 3s infinite ease-in-out;
}

/* 未獲得(Locked)の場合の上書きスタイル */
.detail-icon-box.is-selected.locked #detail-icon {
  /* ▼▼▼ 修正: ここを brightness(0) にして完全なシルエットにします ▼▼▼ */
  filter: brightness(0) !important; 
  opacity: 0.6; /* 一覧と同じくらいの薄さに */
  /* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */

  /* 以下はアニメーション停止などの設定（変更なし） */
  animation: none !important;
  transform: scale(1) !important;
  display: block !important;
}
/* --- ホバー（カーソル合わせ）時の制御 --- */

/* 1. 獲得済み(.unlocked)の場合だけ、ホバーで光らせる */
.achieve-cell.unlocked:hover {
  border-color: #d4af37;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  transform: scale(1.05); /* 少し拡大 */
  z-index: 2;
}

/* 2. 未獲得(ロック中)の場合は、ホバーしても変化させない */
.achieve-cell:not(.unlocked):hover {
  border-color: #444; /* 変化なしか、ごくわずかな変化に留める */
  box-shadow: none;   /* 光らせない */
  transform: none;    /* 拡大しない */
  cursor: default;    /* クリックできなさそうなカーソルにする（お好みで） */
}

/* 3. 画像自体のホバー制御 */

/* 獲得済みなら、ホバーで画像を明るく強調する */
.achieve-cell.unlocked:hover .achiev-icon-img {
  filter: grayscale(0%) brightness(1.1);
  opacity: 1;
}

/* ★重要: 未獲得なら、ホバーしても「真っ黒」を死守する */
.achieve-cell:not(.unlocked):hover .achiev-icon-img {
  filter: brightness(0) !important; 
  opacity: 0.6;
}

/* プレースホルダー文字 */
#detail-placeholder-icon {
  color: #333; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
}

/* テキストエリア */
.detail-text-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden; /* はみ出し防止 */
}

.detail-title {
  color: #d4af37;
  font-family: 'Shippori Mincho', serif;
  font-size: 1rem; /* 少し控えめに */
  font-weight: bold;
  margin-bottom: 3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-desc {
  color: #ccc;
  font-size: 0.8rem; /* 小さくして行数を稼ぐ */
  line-height: 1.4;
  margin-bottom: 5px;
  
  /* 長文対応：3行まで表示して省略 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-condition {
  font-size: 0.7rem;
  color: #666;
  padding-top: 0;
}

/* 閉じるボタン */
#achievement-modal .btn {
  margin: 10px 0 15px 0; /* 余白を詰める */
  width: auto;
  min-width: 120px;
  align-self: center;
  padding: 8px 0; /* ボタン自体の高さも少し詰める */
}

/* --- 通知バナー --- */
#achievement-notification {
  position: fixed;
  /* 画面外(上)に配置 */
  top: -150px; 
  left: 50%;
  /* translateXのみで中央寄せ (Y軸はtopで制御) */
  transform: translateX(-50%);
  
  width: 70%;
  max-width: 400px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid #d4af37;
  border-left: 5px solid #d4af37; /* 左端を太くしてリッチに */
  box-shadow: 0 5px 20px rgba(0,0,0,0.8);
  
  display: flex;
  align-items: center;
  padding: 15px;
  gap: 15px;
  
  /* 最前面指定 */
  z-index: 1000000; 
  pointer-events: none;
  
  /* アニメーション設定 */
  transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 表示クラス */
#achievement-notification.show {
  top: 20px;
}
.achieve-notify-icon { font-size: 2rem; }
.achieve-notify-title { font-size: 0.7rem; color: #d4af37; letter-spacing: 2px; font-weight: bold; }
.achieve-notify-name { font-size: 1rem; color: #fff; font-family: 'Shippori Mincho', serif; font-weight: bold; }