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

:root {
  --season-color: #ffc0cb; /* デフォルトは桜色 */
}

body, html {
  width: 100vw;
  height: 100vh;
  font-family: 'Yuji Boku', serif;
}

/* トップページのみスクロール禁止 */
body.index, html.index {
  overflow: hidden;
}

.main {
  font-family: "Yuji Boku", serif;
  font-size: 1.2rem;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #bc002d, #800020);
  position: relative;
  color: white;
  overflow: hidden; /* スクロール禁止 */
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
}

.overlay {
  width: 0;
  height: 0;
  border-top: 550px solid #ffffff;       /* 上端：白 */
  border-right: 550px solid transparent; /* 右：透明 */
  border-bottom: 550px solid #ffffff;    /* 下端：白 */
  border-left: 550px solid #ffffff;      /* 左：白 */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4; /* circle要素より上に表示 */
  pointer-events: none; /* クリックイベントを通過させる */
}

nav {
  display: flex;
  align-items: center;
  padding: 20px;
  position: relative; /* これが必要！ */
  z-index: 2; /* 上に出す */
  top: 0;
  left: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  z-index: 2;
}

.logo {
  width: 60px;
  margin-right: 10px;
}

nav h2 {
  font-size: 1.6rem;
  color: #bc002d; /* 一時的にロゴテキストが見えるように */
}

.infomation {
  width: 1000px;
  height: 1000px;
  position: absolute;
  top: 50%;
  left: -5%;
  transform: translateY(-50%);
}

#circle {
  width: 1000px;
  height: 1000px;
  position: absolute;
  border-radius: 50%;
  top: 0;
  left: 0;
  transform: rotate(0deg);
  transition: 1s;
  z-index: 3; /* オーバーレイより下、他の要素より上 */
  pointer-events: auto;
}

.feature {
  display: flex;
  position: absolute;
  color: white;
  z-index: 10; /* クリック判定向上 */
  text-align: center;
  cursor: pointer;
  width: 250px; /* 固定幅を追加 */
  height: 150px; /* 固定高さを追加 */
  pointer-events: auto !important; /* クリックイベントを必ず有効に */
  transition: all 0.3s ease-in-out;
}

.feature a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: white;
  width: 100%;
  height: 100%;
  z-index: 10; /* 追加 */
  padding: 10px; /* パディングを追加 */
  pointer-events: auto !important; /* リンクのクリックを確実に有効化 */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: rgba(188, 0, 45, 0.1);
  backdrop-filter: blur(2px);
  transition: all 0.3s ease;
}

.feature a:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  background: rgba(188, 0, 45, 0.2);
}

.feature img {
  width: 70px;
  height: 70px; /* 高さを固定 */
  object-fit: contain; /* アスペクト比を保持 */
  margin-bottom: 10px;
  pointer-events: auto; /* 念のため明示 */
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.feature:hover img {
  transform: scale(1.1);
}

.feature div {
  margin-left: 0; /* 中央揃えのため左マージンを削除 */
  text-align: center;
  width: 100%; /* 幅を固定 */
}

.feature h1 {
  font-size: 1.4rem;
  margin-bottom: 5px;
  text-shadow: none; /* 影を削除 */
  height: 30px; /* 高さを固定 */
  line-height: 30px; /* 行の高さを固定 */
}

.feature p {
  text-shadow: none; /* 影を削除 */
  height: 25px; /* 高さを固定 */
  line-height: 25px; /* 行の高さを固定 */
}

/* 位置を調整して円周上に均等配置 */
.one { 
  top: 50%; 
  right: 50px; 
  transform: translateY(-50%); /* 中央揃え */
}
.two { 
  top: 80px; 
  left: 50%; 
  transform: translateX(-50%) rotate(-90deg); /* 中央揃えと回転 */
}
.three { 
  bottom: 50%; 
  left: 50px; 
  transform: translateY(50%) rotate(-180deg); /* 中央揃えと回転 */
}
.four { 
  bottom: 80px; 
  right: 50%; 
  transform: translateX(50%) rotate(-270deg); /* 中央揃えと回転 */
}

/* 各フィーチャー要素のポインターイベントを明示的に許可 */
.one *, .two *, .three *, .four * {
  pointer-events: auto !important;
}

/* 回転ナビの余分なテキスト表示を防止 */
.feature > div:not(a) {
  display: none;
}

/* より強力に余分なテキストを非表示 */
.feature > :not(a) {
  display: none !important;
  visibility: hidden;
  opacity: 0;
}

/* 回転ナビの外側にある不要なテキストを非表示 */
.feature:not(.one):not(.two):not(.three):not(.four) {
  display: none;
}

.jinja {
  width: 400px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 27%;
  z-index: 1;
  opacity: 0.15;
  filter: brightness(1.2) contrast(1.1);
  animation: subtle-pulse 4s ease-in-out infinite;
}

.control {
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  text-align: center;
  z-index: 10;
}

.control img {
  width: 40px;
  cursor: pointer;
  display: block;
  margin: 10px auto;
}

#downBtn {
  transform: rotate(180deg);
}

.control h3 {
  margin: 20px 0;
}

/* サブページ共通スタイル */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header .logo {
  width: 100px;
  margin-bottom: 15px;
}

h1 {
  color: #fff;
  text-shadow: 1px 1px 3px #bc002d;
  margin-bottom: 10px;
}

.back-btn {
  display: inline-block;
  background: #c21807;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.3s;
}

.back-btn:hover {
  background: #8b0000;
}

/* 共通の影スタイル */
.shadow-red {
  text-shadow: 1px 1px 3px #bc002d;
}

/* 和歌表示用のスタイル */
#waka-box {
  font-size: 1.1rem;
  text-align: center;
  line-height: 1.8;
  margin-bottom: 10px;
}

.waka-title {
  font-weight: bold;
  color: #bc002d;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.waka-poem {
  font-style: italic;
  margin-bottom: 5px;
}

.waka-author {
  color: #666;
  margin-bottom: 5px;
}

/* 和歌詳細表示のスタイル */
#waka-detail {
  background-color: #fdfdf6;
  border: 1px solid #a10000;
  border-radius: 10px;
  padding: 15px;
  margin: 20px auto;
  width: 90%;
  max-width: 600px;
  text-align: center;
  line-height: 1.6;
  color: #333;
}

#waka-detail p {
  margin: 0.5em 0;
}

#waka-detail p:nth-child(1) {
  font-weight: bold;
  font-size: 1.2rem;
  color: #a10000;
}

#waka-detail p:nth-child(2),
#waka-detail p:nth-child(3),
#waka-detail p:nth-child(4) {
  font-size: 0.95rem;
}

.omikuji-box-item {
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 8px;
}
#kotowaza-box strong {
  font-weight: bold;
  font-size: 1.3rem;
  color: #b71c1c;
}

#norito-box {
  font-style: italic;
  font-size: 1.05rem;
  text-align: center;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.6;
}

.section-label {
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 10px;
  text-align: center;
  color: #a10000;
}

/* 共通ボックス */
.omikuji-box {
  background-color: #fdfdf6;
  border: 1px solid #a10000;
  border-radius: 10px;
  padding: 15px;
  margin: 20px auto;
  width: 90%;
  max-width: 600px;
  text-align: center;
  color: #333;
  line-height: 1.6;
}

/* 祝詞 */
#norito-box {
  font-size: 1rem;
  color: #a10000;
  font-weight: bold;
  margin-top: 10px;
}

/* 学業アドバイス */
#advice-box {
  font-size: 1rem;
  color: #a10000;
  font-weight: bold;
  margin-top: 10px;
}

/* 癒しの一言 */
#iyashi-box {
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 10px;
  color: #444;
}

/* 四字熟語 */
#kotowaza-box {
  margin-top: 10px;
}
#kotowaza-box .word {
  font-size: 1.1rem;
  font-weight: bold;
  color: #a10000;
}
#kotowaza-box .meaning {
  font-size: 0.95rem;
  margin-top: 5px;
}

/* アニメーション用クラス */
.omikuji-content {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 1s ease, transform 1s ease;
}

/* 表示時に適用される */
.omikuji-content.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* 初期非表示 */
.hidden {
  display: none;
}

/* 背景切替ボタンの和風スタイル */
#toggle-bg {
  display: block;
  margin: 10px auto 20px auto;
  background-color: #bc002d;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  font-size: 0.95rem;
  transition: background-color 0.3s, opacity 0.5s ease;
}

#toggle-bg:hover {
  background-color: #a30025;
}

/* お守り画像にフェードイン効果 */
#omamori-img {
  transition: opacity 0.5s ease-in-out;
}

/* 季節の装飾 - 共通 */
.seasonal-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  width: 15px;
  height: 15px;
  opacity: 0.8;
  top: -10%;
  animation: falling linear infinite;
}

/* 桜の花びら */
.petal.sakura {
  background: #ffc0cb;
  border-radius: 150% 0 150% 0;
  box-shadow: 0 0 5px rgba(255, 192, 203, 0.5);
}

.petal.sakura span {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #ffb7c5;
  border-radius: 150% 0 150% 0;
  transform: rotate(45deg);
}

/* 紅葉 */
.petal.momiji {
  background: #ff6347;
  clip-path: polygon(
    50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 
    50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%
  );
  transform-origin: center;
}

/* 雪 */
.petal.snow {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 10px 2px white;
  opacity: 0.9;
}

/* 水滴 */
.petal.water {
  width: 8px;
  height: 12px;
  background: transparent;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 1px solid #66b7ec;
  box-shadow: 0 0 5px #a0d8ef;
  opacity: 0.7;
}

/* 落下アニメーション */
@keyframes falling {
  0% {
    top: -10%;
    transform: rotate(0deg) translateX(0);
  }
  25% {
    transform: rotate(90deg) translateX(25px);
  }
  50% {
    transform: rotate(180deg) translateX(0);
  }
  75% {
    transform: rotate(270deg) translateX(-25px);
  }
  100% {
    top: 110%;
    transform: rotate(360deg) translateX(0);
  }
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* メインビジュアルの強化 */
.main {
  background: linear-gradient(135deg, #bc002d, #800020);
  overflow: hidden;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
}

.jinja {
  filter: brightness(1.2) contrast(1.1);
  animation: subtle-pulse 4s ease-in-out infinite;
}

@keyframes subtle-pulse {
  0% { opacity: 0.15; }
  50% { opacity: 0.2; }
  100% { opacity: 0.15; }
}

/* 回転ナビの強化 */
.feature {
  transition: all 0.3s ease-in-out;
}

.feature a {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: rgba(188, 0, 45, 0.1);
  backdrop-filter: blur(2px);
  transition: all 0.3s ease;
}

.feature a:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  background: rgba(188, 0, 45, 0.2);
}

.feature img {
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.feature:hover img {
  transform: scale(1.1);
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  /* タブレット向け */
  .title-welcome-container {
    margin: 15px auto;
    width: 80%;
  }
  
  .banner-top {
    width: 200px;
    margin: 0 auto;
  }
  
  .welcome-message h1 {
    font-size: 1.8rem;
  }
  
  .welcome-message p {
    font-size: 1.1rem;
  }
  
  .infomation {
    width: 900px;
    height: 900px;
    left: -10%;
  }
  
  #circle {
    width: 900px;
    height: 900px;
  }
  
  .feature {
    width: 220px;
    height: 130px;
  }
  
  .feature img {
    width: 60px;
    height: 60px;
  }
  
  .center-icon {
    left: 30%;
  }
  
  .center-icon a {
    width: 90px;
    height: 90px;
  }
  
  .center-icon img {
    width: 60px;
    height: 60px;
  }
  
  .control {
    right: 3%;
  }
}

@media (max-width: 768px) {
  /* 中型タブレット向け */
  .title-welcome-container {
    margin: 10px auto;
    width: 90%;
    left: 0;
  }
  
  .banner-top {
    width: 180px;
  }
  
  .welcome-message h1 {
    font-size: 1.6rem;
    padding: 8px 12px;
  }
  
  .welcome-message p {
    font-size: 1rem;
    padding: 6px 10px;
  }
  
  .infomation {
    width: 700px;
    height: 700px;
    left: -25%;
  }
  
  #circle {
    width: 700px;
    height: 700px;
  }
  
  .feature {
    width: 190px;
    height: 120px;
  }
  
  .feature img {
    width: 50px;
    height: 50px;
  }
  
  .feature h1 {
    font-size: 1.2rem;
  }
  
  .feature p {
    font-size: 0.9rem;
  }
  
  .center-icon {
    top: 80%;
    left: 40%;
  }
  
  .control {
    right: 2%;
  }
  
  .control img {
    width: 35px;
  }
  
  .control h3 {
    font-size: 1rem;
  }
  
  .petal {
    width: 10px;
    height: 10px;
  }
  
  .petal.snow {
    width: 8px;
    height: 8px;
  }
  
  .petal.water {
    width: 6px;
    height: 9px;
  }
}

@media (max-width: 480px) {
  /* スマートフォン向け */
  .title-welcome-container {
    width: 95%;
    margin: 5px auto;
  }
  
  .banner-top {
    width: 150px;
  }
  
  .welcome-message h1 {
    font-size: 1.3rem;
    padding: 5px 8px;
    margin-bottom: 5px;
  }
  
  .welcome-message p {
    font-size: 0.9rem;
    padding: 4px 8px;
  }
  
  .infomation {
    width: 500px;
    height: 500px;
    left: -35%;
  }
  
  #circle {
    width: 500px;
    height: 500px;
  }
  
  .feature {
    width: 150px;
    height: 100px;
  }
  
  .feature img {
    width: 40px;
    height: 40px;
  }
  
  .feature h1 {
    font-size: 1rem;
    margin-bottom: 2px;
    height: 20px;
    line-height: 20px;
  }
  
  .feature p {
    font-size: 0.8rem;
    height: 20px;
    line-height: 20px;
  }
  
  .one { 
    right: 20px; 
  }
  
  .two { 
    top: 40px; 
  }
  
  .three { 
    left: 20px; 
  }
  
  .four { 
    bottom: 40px; 
  }
  
  .center-icon {
    top: 75%;
    left: 50%;
  }
  
  .center-icon a {
    width: 70px;
    height: 70px;
  }
  
  .center-icon img {
    width: 45px;
    height: 45px;
  }
  
  .control {
    right: 5px;
  }
  
  .control img {
    width: 30px;
  }
  
  .control h3 {
    font-size: 0.9rem;
    margin: 10px 0;
  }
  
  .petal {
    width: 8px;
    height: 8px;
  }
  
  .petal.snow {
    width: 6px;
    height: 6px;
  }
  
  .petal.water {
    width: 5px;
    height: 7px;
  }
}

@media (max-width: 320px) {
  /* 小型スマートフォン向け */
  .banner-top {
    width: 120px;
  }
  
  .welcome-message h1 {
    font-size: 1.1rem;
  }
  
  .welcome-message p {
    font-size: 0.8rem;
  }
  
  .infomation {
    width: 400px;
    height: 400px;
    left: -40%;
  }
  
  #circle {
    width: 400px;
    height: 400px;
  }
  
  .feature {
    width: 120px;
    height: 90px;
  }
  
  .feature img {
    width: 35px;
    height: 35px;
  }
  
  .feature h1 {
    font-size: 0.9rem;
  }
  
  .feature p {
    font-size: 0.7rem;
  }
  
  .center-icon a {
    width: 60px;
    height: 60px;
  }
  
  .center-icon img {
    width: 40px;
    height: 40px;
  }
}

/* サブページ向けのレスポンシブ対応 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  header .logo {
    width: 80px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .back-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  #waka-box {
    font-size: 1rem;
  }
  
  .waka-title {
    font-size: 1.1rem;
  }
  
  #waka-detail {
    width: 95%;
    padding: 10px;
  }
  
  #waka-detail p:nth-child(1) {
    font-size: 1.1rem;
  }
  
  #waka-detail p:nth-child(2),
  #waka-detail p:nth-child(3),
  #waka-detail p:nth-child(4) {
    font-size: 0.9rem;
  }
  
  .omikuji-box {
    width: 95%;
    padding: 10px;
  }
  
  .section-label {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 5px;
  }
  
  header .logo {
    width: 60px;
  }
  
  h1 {
    font-size: 1.3rem;
  }
  
  .back-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  #waka-box {
    font-size: 0.9rem;
  }
  
  .waka-title {
    font-size: 1rem;
  }
  
  .omikuji-box-item {
    font-size: 0.9rem;
  }
  
  #kotowaza-box strong {
    font-size: 1.1rem;
  }
  
  #norito-box,
  #advice-box {
    font-size: 0.9rem;
  }
  
  #iyashi-box {
    font-size: 0.85rem;
  }
  
  #kotowaza-box .word {
    font-size: 1rem;
  }
  
  #kotowaza-box .meaning {
    font-size: 0.85rem;
  }
  
  #toggle-bg {
    padding: 8px 15px;
    font-size: 0.85rem;
  }
}

/* アニメーション */
@keyframes floating {
  0% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, -55%);
  }
  100% {
    transform: translate(-50%, -50%);
  }
}

/* サイトタイトル */
.site-title {
  font-size: 2.5rem;
  color: #bc002d; /* 日本国旗の赤色 */
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.6); /* 白の影 */
  margin-bottom: 20px;
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.7); /* 半透明の白背景 */
  padding: 5px 15px;
  border-radius: 8px;
}

/* バナー画像 */
.banner-top {
  width: 250px; /* 元の「合格神社」テキストと同じ幅に設定 */
  height: auto;
  display: block;
}

/* 歓迎メッセージのスタイル */
.welcome-message {
  text-align: center;
  position: relative;
  z-index: 10;
  width: 100%;
  margin: 0 auto;
}

.welcome-message h1 {
  font-size: 2rem;
  color: #bc002d; /* 日本国旗の赤色 */
  margin-bottom: 10px;
  text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.5); /* 白の影 */
  background-color: rgba(255, 255, 255, 0.7); /* 半透明の白背景 */
  padding: 5px 10px;
  border-radius: 5px;
  display: inline-block;
}

.welcome-message p {
  font-size: 1.2rem;
  color: #bc002d; /* 日本国旗の赤色 */
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5); /* 白の影 */
  background-color: rgba(255, 255, 255, 0.7); /* 半透明の白背景 */
  padding: 5px 10px;
  border-radius: 5px;
  display: inline-block;
}

/* SNSアイコン用スタイル */
.social-links {
    position: absolute;
    bottom: 120px;
    right: 30px;
    z-index: 10;
}

.social-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* 円の中央アイコン */
.center-icon {
    position: absolute;
    top: 75%;  /* 下半分に配置 */
    left: 25%; /* 左半分に配置 */
    transform: translate(-50%, -50%);
    z-index: 20; 
    pointer-events: auto;
    animation: floating 15s ease-in-out infinite; /* よりゆっくりとしたアニメーション */
}

.center-icon a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px; /* 大きくする */
    height: 100px; /* 大きくする */
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.center-icon a:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(188, 0, 45, 0.5);
}

.center-icon img {
    width: 70px; /* 大きくする */
    height: 70px; /* 大きくする */
    object-fit: contain;
}

/* よりゆっくりとした雲のような浮遊アニメーション */
@keyframes floating {
    0% {
        top: 75%;
        left: 25%;
    }
    12% {
        top: 77%;
        left: 20%;
    }
    23% {
        top: 79%;
        left: 17%;
    }
    35% {
        top: 82%;
        left: 13%;
    }
    46% {
        top: 85%;
        left: 10%;
    }
    58% {
        top: 83%;
        left: 14%;
    }
    69% {
        top: 81%;
        left: 18%;
    }
    81% {
        top: 78%;
        left: 21%;
    }
    92% {
        top: 76%;
        left: 23%;
    }
    100% {
        top: 75%;
        left: 25%;
    }
}

/* タイトルと歓迎メッセージのコンテナ */
.title-welcome-container {
  position: relative;
  margin: 20px auto 20px 20px;
  width: 60%;
  max-width: 500px;
  left: 5%;
  z-index: 10;
  text-align: center;
} 