/* =========================
   style.css (Refactored)
   ========================= */

/* +--------------------------------------------+
   1) Reset & Base Styles
   +--------------------------------------------+ */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Cinzel', 'Noto Sans JP', serif; 
    background: #f4f4f4;
    color: #333;
    line-height: 1.6;
  }
  
  img, video {
    max-width: 100%;
    height: auto;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
  
  /* +--------------------------------------------+
     2) Header & Navigation (Desktop)
     +--------------------------------------------+ */
  
  .rpg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c2a40;
    padding: 10px 5%;
  }
  
  .rpg-header .logo-area {
    display: flex;
    align-items: center;
  }
  
  .site-logo {
    height: 50px;
    margin-right: 10px;
  }
  
  .rpg-header h1 {
    color: #fff;
    font-size: 1.4rem;
  }
  
  .main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
  }
  
  .main-nav li a {
    color: #fff;
    font-weight: bold;
  }
  
  .main-nav li a:hover {
    color: #ffcc00; /* ゴールド系 */
  }
  
  .main-nav .active {
    text-decoration: underline;
  }
  
  /* +--------------------------------------------+
     3) Hamburger Menu (Mobile)
     +--------------------------------------------+ */
  
  /* 初期PC：非表示ボタン */
  .menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    align-items: center;
    justify-content: center;
  }
  
  /* ハンバーガー3本線 */
  .hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
  }
  
  /* メニュー本体（PC時は横並び） */
  .main-nav {
    transition: max-height 0.3s ease;
  }
  
  /* 開閉用クラス */
  .main-nav.open {
    max-height: 300px; /* アニメ用固定高さ */
  }
  
  /* +--------------------------------------------+
     4) Hero Section (Video BG + Overlay)
     +--------------------------------------------+ */
  
  .hero-section {
    position: relative;
    height: 70vh;
    background: #2c2a40; /* fallback color if video fails */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
  }
  
  .hero-bg-video {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
  }
  
  /* 半透明オーバーレイ */
  .hero-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1; 
  }
  
  .hero-text {
    position: relative;
    z-index: 2; /* on top of overlay */
    max-width: 90%;
    margin: 0 auto;
    color: #fff;
  }
  
  .hero-text h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  }
  
  .hero-text p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  }
  
  /* CTAボタン */
  .btn-cta {
    padding: 10px 20px;
    background: #ffa500;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    font-weight: bold;
    color: #2c2a40;
    transition: background 0.3s;
  }
  
  .btn-cta:hover {
    background: #ffcc00;
  }
  
  /* +--------------------------------------------+
     5) Common Frame / Sections
     +--------------------------------------------+ */
  
  /* 共通フレーム: .rpg-frame */
  .rpg-frame {
    position: relative;
    background: url('../images/parchment-texture.webp') center/cover no-repeat;
    margin: 40px 5%;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    border: 2px solid #ccc;
    border-radius: 8px;
  }
  
  /* 古文書風オーバーレイ */
  .rpg-frame::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.7);
    z-index: 1;
  }
  
  /* 内側の要素を最前面 */
  .rpg-frame > * {
    position: relative;
    z-index: 2;
  }
  
  /* 動画セクション */
  .video-section p {
    text-align: center;
  }
  
  .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px,1fr));
    gap: 20px;
    margin-top: 20px;
  }
  
  .video-item {
    text-align: center;
  }
  
  .video-title {
    margin-top: 10px;
    font-weight: bold;
  }
  
  /* サイトイントロ (世界観) */
  .site-intro p {
    line-height: 1.7;
  }
  
  .highlight {
    color: #c00;
    font-weight: bold;
  }
  
  /* 診断フォーム周辺 */
  .diagnosis-intro p {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .diagnosis-intro form {
    text-align: center;
  }
  
  .diagnosis-intro label {
    display: block;
    margin: 0 auto 10px;
    font-weight: bold;
  }
  
  .diagnosis-intro input {
    padding: 8px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  .diagnosis-intro button {
    padding: 8px 16px;
    background: #ffcc00;
    border: none;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
  }
  
  .diagnosis-intro button:hover {
    background: #ffa500;
  }
  
  /* キャラクター導線 */
  .characters-link p {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
    gap: 20px;
  }
  
  .char-box {
    background: #eee;
    padding: 10px;
    text-align: center;
    color: #333;
    border-radius: 6px;
    transition: transform 0.3s;
  }
  
  .char-box:hover {
    transform: scale(1.03);
  }
  
  .char-box img {
    width: 100%;
    height: auto;
    border-radius: 4px;
  }
  
  .char-box span {
    display: block;
    margin-top: 5px;
    font-weight: bold;
  }
  
  /* 会員ページ案内 */
  .members-info p {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .btn-cta.red {
    background: #c00;
    color: #fff;
    display: block;
    width: 200px;
    margin: 0 auto;
    text-align: center;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
  }
  
  .btn-cta.red:hover {
    background: #ff3322;
  }
  
  /* フッター */
  .rpg-footer {
    background: #2c2a40;
    color: #ccc;
    text-align: center;
    padding: 20px;
  }
  
  .rpg-footer a {
    color: #ccc;
    text-decoration: none;
    margin: 0 5px;
  }
  
  .rpg-footer a:hover {
    color: #ffcc00;
  }
  
  /* アクセント付きセクション */
  .accent-section {
    position: relative;
    border-left: 8px solid rgba(204,0,0,0.4);
    padding-left: 20px;
    margin-bottom: 40px;
  }
  
  .accent-section h3 {
    font-size: 1.8rem;
    text-align: left;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(204,0,0,0.2);
  }
  
  /* 浮動するTOPへ戻るボタン */
  .back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: block;
    transition: opacity 0.3s;
    opacity: 0.7;
  }
  .back-to-top:hover {
    opacity: 1;
  }
  
  /* +--------------------------------------------+
     6) Responsive (max-width: 768px)
     +--------------------------------------------+ */
  @media (max-width: 768px) {
    .hero-section {
      height: 50vh;
    }
  
    .hero-text h2 {
      font-size: 1.6rem;
    }
  
    .hero-text p {
      font-size: 1rem;
    }
  
    .rpg-frame {
      margin: 20px 5%;
      padding: 20px;
    }
  
    .characters-link .char-grid {
      grid-template-columns: repeat(auto-fill, minmax(120px,1fr));
    }
  
    .video-grid {
      grid-template-columns: 1fr; /* 1列縦並び */
    }
  
    .video-item iframe {
      width: 100%;
      height: auto;
    }
  
    .btn-cta {
      font-size: 0.9rem;
      padding: 8px 16px;
    }
  
    /* ハンバーガーメニュー: モバイルで切り替え */
    .menu-toggle {
      display: flex;
      flex-direction: column;
      margin-left: auto;
      color: #fff;
      z-index: 999;
    }
  
    .main-nav {
      position: absolute;
      top: 60px;
      right: 0;
      background: #2c2a40;
      width: 60%; 
      max-height: 0;
      overflow: hidden;
      display: block; /* 追加: navは存在する */
      transition: max-height 0.3s ease;
    }
  
    .main-nav ul {
      flex-direction: column;
      padding: 10px;
    }
  
    .main-nav li a {
      padding: 10px 0;
      display: block;
      color: #fff;
      border-bottom: 1px solid rgba(255,255,255,0.2);
    }
  
    .main-nav.open {
      max-height: 300px;
    }
  }
  