/*
 * 基本的なリセットとサイト全体の変数定義
 * 色やフォントの基本情報です。これは必ず必要です。
 */
:root {
  --cocoon-twitter-color: #000000;
  --cocoon-facebook-color: #3b5998;
  /* ...（中略）... 他の色定義も全て残します ... */
  --cocoon-text-color: #333;
  --cocoon-basic-border-color: #ccc;
  /* ...（以下、:root内の変数は全て残してください）... */
}

/*
 * 基本的なHTMLタグのスタイル
 * body, a, h1, ul, li などの基本的な見た目を定義します。
 */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  word-wrap: break-word;
}

body {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 18px;
  line-height: 1.8;
  background-color: #f4f5f7; /* WordPressの背景色を継承 */
  color: #fffaf0; /* 子テーマの文字色 */
  background: linear-gradient(135deg, #1e1f3a 0%, #4b1d3f 50%, #ffb6c1 100%); /* 子テーマの背景グラデーション */
}

/* 背景画像用の疑似要素（子テーマのスタイル） */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-image: url("https://life-fun.net/wp-content/uploads/2025/07/Copilot_20250721_162714.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}


h1, h2, h3, h4, h5, h6 {
  font-family: 'Yomogi', cursive;
  line-height: 1.25;
  font-weight: bold;
}

a {
  color: #1967d2;
  text-decoration: none;
}
a:hover {
  color: #e53900;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/*
 * サイトの主要なレイアウト構造
 * ヘッダー、フッター、メイン、サイドバーなどの配置を定義します。
 */
#container, .header-container, #footer, #main, .main, .content {
  background-color: transparent; /* 子テーマのスタイルを優先 */
}

.wrap {
  width: 1256px;
  margin: 0 auto;
}

.content-in {
  display: flex;
  justify-content: space-between;
}

.main {
  width: 860px;
  padding: 36px 29px;
}

.sidebar {
  width: 376px;
  padding: 19px;
}

/* 子テーマのレイアウト強制修正（固定ページ用） */
.page #main {
  float: left;
  width: calc(100% - 320px);
}
.page #sidebar {
  float: right;
  width: 300px;
}

/*
 * ヘッダーとナビゲーションのスタイル
 */
.header-in {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.logo {
  text-align: center;
}
.logo-image a {
  display: inline-block;
}
.site-name-text-link {
  color: #333;
}

.navi-in > ul {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.navi-in > ul li {
  width: 176px;
  position: relative;
}
.navi-in a {
  color: #333;
  display: flex;
  width: 100%;
  height: 100%;
  padding: 1em;
}
/* サブメニューの基本スタイル */
.navi-in .sub-menu {
  display: none; /* ホバーで表示させるため最初は非表示 */
  position: absolute;
  list-style: none;
  padding: 0;
  background-color: #fafbfc;
  z-index: 99;
}
.navi-in li:hover > .sub-menu {
  display: block;
}


/*
 * コンテンツエリアのスタイル
 * 記事タイトル、本文、ヒーローボックスなど
 */
.entry-title {
  font-size: 26px;
  margin: 16px 0;
}

.entry-content {
  margin-top: 1em;
  margin-bottom: 3em;
}

/* ヒーローボックスのスタイル（子テーマから）*/
.hero-box {
  text-align: center; /* 中央揃えを追加 */
}
.hero-box h1 {
  /* h1のスタイル */
}
.hero-box .hero-button {
  display: inline-block; /* ボタンらしく見せる */
  padding: 10px 20px;
  background-color: #ff69b4; /* 例の色 */
  color: white;
  border-radius: 5px;
  margin-top: 1em;
}


/*
 * 広告エリアの基本スタイル
 */
.ad-area {
  text-align: center;
  margin-bottom: 1.8em;
}
.ad-label {
  font-size: 12px;
  color: #777;
  margin-bottom: 5px;
}


/*
 * フッターのスタイル
 */
.footer {
  margin-top: 20px;
  padding: 8px 0;
}
.footer-bottom-content {
  text-align: center; /* 中央揃えに変更 */
}
.navi-footer-in > .menu-footer {
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1em;
}
.copyright {
  margin-top: 8px;
  font-size: 14px;
}


/*
 * レスポンシブデザイン（スマホ表示など）
 * 横幅が狭いデバイス向けのスタイル調整
 */

/* タブレット（横幅1023px以下） */
@media screen and (max-width: 1023px){
  .content-in {
    display: block;
  }
  .main, .sidebar {
    width: auto;
    margin: 10px;
  }
}

/* スマホ（横幅768px以下） */
@media screen and (max-width: 768px) {
  .wrap {
    width: auto !important;
    padding: 0 15px;
  }
  .page #main {
    width: 100% !important; /* メインカラムを100%幅に */
    float: none;
  }
  .page #sidebar {
      display: none; /* スマホではサイドバーを非表示にする例 */
  }
}
/* ===== 運勢ルーレット関連のスタイル（修正版）===== */

/* モーダルウィンドウの背景 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

/* モーダルのコンテンツ部分 */
.modal-content {
  background-color: #fff;
  color: #333;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  /* ★修正点1: 最初から高さを確保してガタツキを防ぐ */
  min-height: 520px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

/* ★修正点2: ルーレット全体を囲むコンテナを追加 */
.roulette-container {
    position: relative;
    width: 260px; /* ルーレット盤の直径+枠線 */
    height: 260px;
    margin: 20px auto;
}

/* ルーレット盤 */
.roulette-wheel {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  position: relative; /* containerからの相対位置に */
  border: 5px solid #333;
  background: conic-gradient(
    #ffadad 0 60deg,
    #ffd6a5 60deg 120deg,
    #fdffb6 120deg 180deg,
    #caffbf 180deg 240deg,
    #9bf6ff 240deg 300deg,
    #a0c4ff 300deg 360deg
  );
  transition: transform 3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ルーレットの針 */
.roulette-pointer {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid red;
  position: absolute;
  /* ★修正点3: 針の位置をルーレットコンテナ基準で中央上部に固定 */
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10; /* ルーレット盤より手前に表示 */
}

/* ルーレットの回転アニメーション */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(3600deg); }
}

.is-spinning {
  animation: spin 5s linear infinite;
}

/* ボタンのスタイル調整 */
#spinBtn, #stopBtn {
    margin: 5px;
}

#resultArea {
  margin-top: 20px;
  font-size: 1.2em;
  /* ★修正点4: 結果表示エリアの高さも確保 */
  min-height: 100px;
}
#resultArea .lucky-item {
  margin-top: 10px;
  font-size: 0.8em;
  color: #555;
}
/* 「今日の運勢を試す！」ボタンを中央に配置する */
.roulette-section {
  text-align: center;
  margin: 2em 0; /* ボタンの上下に余白を追加 */
}