@charset "UTF-8";

/* ─── 【CSSデザイン（スマホ＆PC 完全ハイブリッド）】 ─── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Kiwi Maru', 'Mochiy Pop One', 'Helvetica Neue', Arial, sans-serif;
    background-color: #FFFDF9;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 40px 15px;
    }
}

.bg-light {
    background-color: #FFF5E6;
}

/* ① タイトルトップ（背景画像と文字を完全に切り分けた超・視認性MAXデザイン） */
.hero-wrapper {
    background-color: #FFE200; /* 公式イエロー */
    border-bottom: 10px solid #FF8C00;
    display: flex;
    flex-direction: column;
}

.hero-text-container {
    text-align: center;
    padding: 50px 20px 40px;
    background-color: #FFE200;
}

.hero-sub {
    font-size: 1.4rem;
    background-color: #4CAF50;
    color: white;
    padding: 10px 30px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 25px;
    transform: rotate(-2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    font-weight: 900;
    border: 4px solid #FFFFFF;
    letter-spacing: 0.08em;
}

.hero-title {
    font-size: 5.0rem;
    font-weight: 900;
    margin-bottom: 20px;
    color: #E60012; /* 美しいチェリーレッド（赤） */
    letter-spacing: 0.06em;
    text-shadow: 
        -4px -4px 0 #FFFFFF,
         4px -4px 0 #FFFFFF,
        -4px  4px 0 #FFFFFF,
         4px  4px 0 #FFFFFF,
        -4px  0px 0 #FFFFFF,
         4px  0px 0 #FFFFFF,
         0px -4px 0 #FFFFFF,
         0px  4px 0 #FFFFFF,
         0px  6px 12px rgba(230, 0, 18, 0.25);
    transition: font-size 0.3s;
}

.hero-tagline {
    font-size: 1.8rem;
    font-weight: 900;
    color: #E60012;
    letter-spacing: 0.08em;
    text-shadow: 
        -2px -2px 0 #FFFFFF,
         2px -2px 0 #FFFFFF,
        -2px  2px 0 #FFFFFF,
         2px  2px 0 #FFFFFF,
         0px  4px 10px rgba(0,0,0,0.1);
    transition: font-size 0.3s;
}

.hero-visual-banner {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    background-color: #FFF;
}

.banner-img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    border-top: 6px solid #FF8C00;
}

@media (max-width: 768px) {
    .hero-text-container {
        padding: 40px 15px 30px;
    }
    .hero-sub {
        font-size: 1.1rem;
        padding: 8px 20px;
    }
    .hero-title {
        font-size: 3.2rem;
    }
    .hero-tagline {
        font-size: 1.3rem;
    }
}
@media (max-width: 480px) {
    .hero-title {
        font-size: 2.3rem;
    }
    .hero-tagline {
        font-size: 1.0rem;
    }
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #FF8C00;
    margin-bottom: 20px;
    position: relative;
    font-weight: 900;
    transition: font-size 0.3s;
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.6rem;
    }
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: #4CAF50;
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-desc {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    color: #666;
}

/* キャラクターカード */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.char-card {
    background: white;
    border: 3px solid #FF8C00;
    border-radius: 20px;
    padding: 35px 20px;
    text-align: center;
    transition: transform 0.3s;
}

.char-card:hover { transform: translateY(-5px); }

.char-icon {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 25px;
    border: 6px solid #FF8C00;
    background-color: #FFFDF9;
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
    display: flex;             
    align-items: center;       
    justify-content: center;   
}

.char-img {
    width: 100%;                
    height: 100%;               
    object-fit: contain;       
}

.char-card h3 {
    font-size: 1.6rem;
    margin-bottom: 5px;
    color: #333;
}

.char-role {
    display: inline-block;
    font-size: 0.9rem;
    background-color: #FF8C00;
    color: white;
    padding: 3px 15px;
    border-radius: 15px;
    margin-bottom: 20px;
}

/* ─── 🕹️ 大冒険クエストシステム共通 ─── */
.adventure-section {
    padding: 80px 20px;
    background: linear-gradient(180deg, #FFFDF9 0%, #FFFDF0 100%);
    position: relative;
}

.adventure-navigator {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.nav-step {
    background: #E0E0E0;
    color: #666;
    font-size: 0.95rem;
    font-weight: 900;
    padding: 10px 20px;
    border-radius: 30px;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    cursor: not-allowed;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.nav-step.active {
    background: #FF8C00;
    color: white;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.3);
}

.nav-step.cleared {
    background: #4CAF50;
    color: white;
    cursor: pointer;
    opacity: 0.8;
}

/* クエストボード */
.quest-card {
    background: white;
    border: 5px solid #FF8C00;
    border-radius: 35px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(255, 140, 0, 0.08);
    margin-bottom: 30px;
    display: none; /* JSで切り替え */
}

.quest-card.active {
    display: block;
    animation: card-bounce 0.5s ease-out;
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px dashed #FFD1A4;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.quest-title-box h3 {
    font-size: 1.8rem;
    color: #FF8C00;
    font-weight: 900;
}

.quest-badge {
    background: #E60012;
    color: white;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 10px;
    margin-right: 10px;
}

.story-intro-box {
    background: #FFF9F2;
    border-left: 6px solid #FF8C00;
    padding: 18px;
    border-radius: 15px;
    margin-bottom: 25px;
    font-size: 1.05rem;
    color: #555;
}

/* 各ステージ個別の要素 */

/* ─── STEP 3のデータテーブル ─── */
.quiz-table-box {
    margin: 20px 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #FFB300;
}

.quiz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    text-align: center;
}

.quiz-table th {
    background: #FFB300;
    color: white;
    padding: 12px;
    font-weight: 900;
}

.quiz-table td {
    padding: 12px;
    border-bottom: 1px solid #FFE082;
    color: #333;
    font-weight: bold;
}

.calc-formula-box {
    background: #FFF;
    border: 2px dashed #FF9800;
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
}

.calc-title {
    font-size: 1rem;
    font-weight: 900;
    color: #FF9800;
    margin-bottom: 5px;
}

.calc-body {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

/* 🕹️ ゲームコンソール */
.sim-box {
    background: #FFF9F0;
    border: 6px solid #FF8C00;
    border-radius: 40px;
    padding: 45px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: stretch;
    box-shadow: 0 15px 35px rgba(255, 140, 0, 0.12), inset 0 0 25px rgba(255, 255, 255, 0.8);
    position: relative;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

@media (max-width: 900px) {
    .sim-box {
        grid-template-columns: 1fr;
        padding: 30px 20px;
        gap: 30px;
    }
}

.arcade-label {
    align-self: flex-start;
    font-family: 'Mochiy Pop One', sans-serif;
    font-size: 0.8rem;
    color: #FFF;
    background: #333;
    padding: 4px 12px;
    border-radius: 8px;
    letter-spacing: 0.15em;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}

.sim-controls {
    display: flex;
    flex-direction: column;
}

.sim-controls h3 {
    font-size: 1.4rem;
    color: #FF8C00;
    margin-bottom: 15px;
    font-weight: 900;
}

/* ゲームコントローラー風ラジオボタン */
.quiz-options-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.quiz-option-label {
    background: white;
    border: 3px solid #FFE0CC;
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-weight: 900;
    font-size: 1.4rem; /* 22.4px相当に拡大！ */
    color: #444;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.quiz-option-label:hover {
    border-color: #FF8C00;
    background: #FFFDFB;
    transform: translateY(-2px);
}

.quiz-option-label input[type="radio"],
.quiz-option-label input[type="checkbox"] {
    display: none;
}

.custom-radio-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #FF8C00;
    background: white;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.quiz-option-label input[type="radio"]:checked + .custom-radio-button {
    background: #FF5500;
    border-color: #FF5500;
    box-shadow: 0 0 8px rgba(255, 85, 0, 0.5);
}

.quiz-option-label input[type="radio"]:checked + .custom-radio-button::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.quiz-option-label.selected-active {
    border-color: #FF5500;
    background: #FFF5F0;
    box-shadow: 0 6px 15px rgba(255, 85, 0, 0.1);
}

/* 決定ボタン */
.quiz-submit-btn {
    font-family: 'Mochiy Pop One', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    background: linear-gradient(180deg, #FF6F00 0%, #E65100 100%);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 8px 0 #B33600, 0 10px 20px rgba(0,0,0,0.15);
    transition: all 0.1s ease;
    display: inline-block;
    text-align: center;
    width: 100%;
    margin-top: 10px;
    letter-spacing: 0.05em;
    border: 3px solid white;
}

.quiz-submit-btn:hover {
    background: linear-gradient(180deg, #FF8F00 0%, #F57C00 100%);
}

.quiz-submit-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #B33600, 0 4px 10px rgba(0,0,0,0.1);
}

.hint {
    font-size: 0.95rem;
    color: #4CAF50;
    background-color: #E8F5E9;
    padding: 12px 18px;
    border-radius: 15px;
    border-left: 6px solid #4CAF50;
    margin-top: 20px;
    font-weight: 900;
}

/* カエルのトコトコ行列エリア */
.frog-queue-box {
    margin-top: 25px;
    background: #FFF;
    border: 3px solid #FFD1A4;
    border-radius: 20px;
    padding: 15px;
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.05);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
    border-bottom: 2px dashed #FFD1A4;
    padding-bottom: 5px;
}

.queue-count {
    color: #4CAF50;
    font-weight: 900;
    font-size: 1.1rem;
}

.frog-line {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 48px;
    align-items: center;
    padding: 5px;
}

.jumping-frog {
    font-size: 2.2rem;
    display: inline-block;
    animation: frog-bounce 0.8s infinite ease-in-out;
}

@keyframes frog-bounce {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-16px) scaleY(1.05); }
}

/* 📊 スコアボード */
/* 📊 スコアボード */
.sim-results {
  display: flex;
  flex-direction: column;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* 幅に合わせて自動折り返し */
  gap: 10px;
  margin-bottom: 20px;
}

.metric-card {
  background: white;
  border: 3px solid #E0D3C5;
  border-radius: 20px;
  padding: 12px 6px;       /* パディングを少し詰めて領域確保 */
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  position: relative;
  word-break: break-word;  /* 長いテキストの自動改行 */
  transition: all 0.3s ease;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 6px;
  font-weight: bold;
  line-height: 1.3; /* 🟢 追記しておくとルビの表示高さを綺麗に保てます */
}

.metric-val {
  font-size: 1.1rem;       /* 枠収まりの良いフォントサイズ */
  font-weight: 900;
  color: #444;
  line-height: 1.3;
}

/* マスク */
.metric-card.metric-masked {
    background-color: #ECEFF1;
    border-color: #B0BEC5;
}

.metric-card.metric-masked .metric-val {
    color: #78909C;
    font-family: 'Mochiy Pop One', sans-serif;
    letter-spacing: 0.05em;
}

/* 大成功カード */
.metric-card.highlight.best-sparkle {
    background: linear-gradient(135deg, #FFFDE0 0%, #FFF59D 100%);
    border: 4px solid #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
    animation: gold-pulse 1.2s infinite ease-in-out, card-bounce 0.5s ease-out;
}

.metric-card.highlight.best-sparkle .metric-val {
    color: #FF5500;
    font-size: 1.8rem;
    text-shadow: 1px 1px 0px #FFF;
}

.crown-badge {
    position: absolute;
    top: -15px;
    right: -10px;
    background: #FFD700;
    color: #7A4F00;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 12px;
    border: 2px solid white;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    display: none;
    transform: rotate(10deg);
}

/* 失敗 */
.metric-card.fail-danger {
    background: #FFEBEE;
    border-color: #EF5350;
    animation: shake-error 0.5s ease-out;
}
.metric-card.fail-danger .metric-val { color: #C62828; }

/* 吹き出しコメ */
.bubble {
    position: relative;
    background: white;
    border: 4px solid #FF8C00;
    padding: 22px;
    border-radius: 25px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    border-bottom: 2px dashed #EEE;
    padding-bottom: 8px;
}

.bubble-avatar {
  width: 40px;            /* 画像の横幅を40pxに固定 */
  height: 40px;           /* 画像の高さを40pxに固定 */
  object-fit: contain;    /* 画像の縦横比を綺麗に維持 */
  flex-shrink: 0;         /* 枠が狭まった時の画像潰れを防止 */
  font-size: 1.8rem;      /* 画像読み込み失敗（SVG表示）時のフォントサイズ */
}
.bubble-speaker { font-weight: 900; color: #FF8C00; }

.bubble.status-best { border-color: #4CAF50; background: #FFFDF0; }
.bubble.status-best .bubble-speaker { color: #4CAF50; }

.bubble.status-zero { border-color: #2196F3; background: #F0F8FF; }
.bubble.status-zero .bubble-speaker { color: #2196F3; }

/* 次へ進むナビゲーションボタン（アンロック時に輝く） */
.stage-clear-banner {
    display: none;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 3px solid #4CAF50;
    border-radius: 25px;
    padding: 25px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
    animation: gold-pulse 1.5s infinite ease-in-out;
}

.clear-btn {
    font-family: 'Mochiy Pop One', sans-serif;
    font-size: 1.4rem;
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 40px;
    border: 3px solid white;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
    display: inline-block;
    max-width: 100%;        /* 追記: 枠外あふれ防止 */
    word-break: break-word; /* 追記: テキストの折り返し対応 */
    white-space: normal;    /* 追記: スマホでの自然な改行 */

}
.clear-btn:hover {
    background: linear-gradient(180deg, #66BB6A 0%, #388E3C 100%);
}
.clear-btn:active {
    transform: translateY(4px);
}

/* ─── 💳 ステージ2 独自のスタイル ─── */
.name-input-box {
    background: #FFF5E6;
    border: 3px dashed #FF8C00;
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
}

.name-input {
    font-size: 1.25rem;
    padding: 12px 20px;
    border-radius: 15px;
    border: 3px solid #FF8C00;
    width: 80%;
    max-width: 350px;
    text-align: center;
    font-family: 'Kiwi Maru', sans-serif;
    font-weight: bold;
    margin-bottom: 15px;
}

/* 金ピカの株券証明書 */
.stock-certificate-container {
    display: none;
    perspective: 1000px;
    margin: 30px auto;
    max-width: 500px;
}

.stock-certificate {
    background: linear-gradient(135deg, #BF953F 0%, #FCF6BA 25%, #B38728 50%, #FBF5B7 75%, #AA771C 100%);
    border: 10px double #AA771C;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: #4A3000;
    box-shadow: 0 15px 35px rgba(170, 119, 28, 0.4);
    animation: gold-pulse 2s infinite ease-in-out;
}

.cert-header {
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    border-bottom: 2px solid #4A3000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.cert-title {
    font-family: 'Mochiy Pop One', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #4A3000;
}

.cert-name {
    font-size: 1.6rem;
    font-weight: 900;
    text-decoration: underline;
    margin: 15px 0;
    /* 👇 折り返し対策 */
    word-break: break-all;      /* 枠の端に達したら自動で改行する */
    overflow-wrap: break-word;  /* 単語の途中で綺麗に折り返す */
}

/* ─── ⚔️ ステージ3 神経衰弱 ─── */
.memory-game-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 30px auto;
}

@media (max-width: 480px) {
    .memory-game-box {
        grid-template-columns: repeat(2, 1fr); /* 🟢 追記: スマホで2列表示に変更して潰れを防止 */
        gap: 10px;
    }
    .stage-clear-banner {
        padding: 16px 12px;
    }
    .stage-clear-banner h3 {
        font-size: 1.25rem;
    }
    .stage-clear-banner p {
        font-size: 0.88rem;
    }
    .clear-btn {
        font-size: 0.95rem;
        padding: 10px 14px;
        width: 100%; /* スマホ画面いっぱいに広げて押しやすく＆溢れ防止 */
        display: block;
    }
}
.memory-card {
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    cursor: pointer;
    
     /* 伏せたカード */
    width: 100%;        /* 基本はグリッドに合わせる */
    max-width: 80px;    /* カードの最大横幅を好みの細さに制限します（例: 80px） */
    margin: 0 auto;     /* 細くしたカードをグリッドの枠内で「中央寄せ」にします */
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.card-front {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    border: 3px solid white;
    color: white;
    font-size: 2.2rem;
}

.card-back {
    background: #FFF3E0;
    border: 3px solid #FF8C00;
    color: #E65100;
    transform: rotateY(180deg);
    font-size: 0.95rem;
    padding: 5px;
    text-align: center;
}

.card-back-emoji {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

/* ─── 🌪️ ステージ4 円安スロット & 税金パズル ─── */
.slot-machine-wrapper {
    background: #333;
    border: 8px solid #FFD700;
    border-radius: 25px;
    padding: 25px;
    text-align: center;
    color: white;
    max-width: 450px;
    margin: 25px auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.slot-reels {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.slot-reel {
    background: #FFF;
    border: 4px solid #555;
    border-radius: 15px;
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
}

.slot-lever-btn {
    font-family: 'Mochiy Pop One', sans-serif;
    font-size: 1.4rem; /* 22.4px相当に拡大！ */
    background: linear-gradient(180deg, #FFEB3B 0%, #FBC02D 100%);
    color: #5D4037;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 4px 0 #F57F17;
    transition: all 0.1s;
}

.slot-lever-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* 税金分配パズル */
.tax-dashboard {
    background: #E8F5E9;
    border: 4px solid #4CAF50;
    border-radius: 25px;
    padding: 30px;
    margin: 30px 0;
}

.tax-progressbar-container {
    background: #DDD;
    border-radius: 20px;
    height: 25px;
    overflow: hidden;
    margin: 15px 0 25px;
    border: 2px solid white;
}

.tax-progressbar {
    background: linear-gradient(90deg, #4CAF50 0%, #81C784 100%);
    width: 0%;
    height: 100%;
    transition: width 0.4s ease;
}

.tax-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tax-btn {
    background: white;
    border: 3px solid #81C784;
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.tax-btn:hover {
    border-color: #4CAF50;
    background: #F1F8E9;
    transform: translateY(-2px);
}

.tax-btn.purchased {
    background: #C8E6C9;
    border-color: #4CAF50;
    cursor: default;
}

/* マップイラスト風おまけエリア */
.tax-town-visual {
    background: #FFF;
    border: 3px solid #C8E6C9;
    border-radius: 20px;
    padding: 15px;
    margin-top: 20px;
    min-height: 120px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.town-building {
    font-size: 2.5rem;
    opacity: 0.15;
    transition: opacity 0.5s ease, transform 0.5s;
    transform: scale(0.8);
}

.town-building.active {
    opacity: 1;
    transform: scale(1.1);
    animation: pop-bounce 0.5s ease-out;
}

@keyframes pop-bounce {
    0% { transform: scale(0.3); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* ─── 🤖 ステージ5 DX放置タップ & クリア画面 ─── */
.dx-upgrades-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.dx-upgrade-card {
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dx-upgrade-card:hover {
    border-color: #2196F3;
    transform: translateY(-3px);
}

.dx-upgrade-card.unlocked {
    background: #E3F2FD;
    border-color: #2196F3;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.2);
}

.dx-badge {
    background: #2196F3;
    color: white;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 10px;
}

.dx-upgrade-card.unlocked .dx-badge {
    background: #4CAF50; /* 有効化されたら緑 */
}

/* タップゲーム */
.tap-game-container {
    background: #FFFDE7;
    border: 4px dashed #FBC02D;
    border-radius: 25px;
    padding: 30px;
    text-align: center;
    margin-top: 25px;
}

.dx-counter {
    font-family: 'Mochiy Pop One', sans-serif;
    font-size: 2.5rem;
    color: #F57F17;
    text-shadow: 2px 2px 0px white;
    margin: 15px 0;
}

.giant-potato-btn {
    font-size: 4rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    outline: none;
}

.giant-potato-btn:active {
    transform: scale(0.85);
}

/* 👑 経済マスター認定証 */
.graduation-container {
    display: none;
    perspective: 1000px;
    margin: 30px auto;
    max-width: 600px;
    text-align: center;
}

.graduation-certificate {
    background: linear-gradient(135deg, #FFFDF0 0%, #FFF9C4 100%);
    border: 12px double #D4AF37;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(212, 175, 55, 0.35);
    color: #5D4037;
    animation: gold-pulse 3s infinite ease-in-out;
}

.grad-stamp {
    font-size: 4.5rem;
    margin: 20px 0;
}

/* アニメーション定義 */
@keyframes gold-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(255,215,0,0.15); }
    50% { transform: scale(1.02); box-shadow: 0 15px 40px rgba(255,215,0,0.3); }
}

@keyframes card-bounce {
    0% { transform: scale(0.4); opacity: 0; }
    50% { transform: scale(1.05); opacity: 0.8; }
    70% { transform: scale(0.98); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* アコーディオン */
.accordion-list { max-width: 800px; margin: 0 auto; }
.accordion-item { background: white; border-radius: 15px; margin-bottom: 15px; box-shadow: 0 3px 10px rgba(0,0,0,0.05); overflow: hidden; }

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 20px;
    padding-right: 50px;       /* 🟢 右端の「+」マークと文字が重ならないように余白を確保 */
    text-align: left;
    font-size: 1.1rem;
    font-weight: bold;
    color: #FF8C00;
    cursor: pointer;
    
    display: block;            /* 🟢 flexから通常のブロック要素に変更し、文字の一体感を守ります */
    position: relative;        /* 🟢 右端の「+」マークを自由自在に配置するための基準点にします */
    transition: background 0.3s;
}

/* 🟢 右端の「+」または「－」マーク（span）を綺麗に右端に固定する記述を追加します */
.accordion-header span {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.accordion-header:hover { background-color: #FFF9F0; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; padding: 0 20px; }
.accordion-content p { padding-bottom: 20px; color: #555; font-size: 0.95rem; }

/* フッター */
.footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9rem;
    border-top: 5px solid #FF8C00;
}


/* ─── 📕 書籍PRプロモーションセクション ─── */
.book-pr-section {
    background: linear-gradient(135deg, #FFFDF0 0%, #FFF5CC 100%);
    border: 4px solid #FF8C00;
    border-radius: 35px;
    padding: 35px;
    margin: 40px auto 25px;
    max-width: 900px;
    box-shadow: 0 12px 30px rgba(255, 140, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.book-pr-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 35px;
    align-items: center;
}

@media (max-width: 768px) {
    .book-pr-container {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }
}

/* 本の3D立体デザイン */
.book-cover-3d-box {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px; /* 3D奥行き */
    padding: 20px 0;
}

.book-3d {
    width: 200px;
    height: 285px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-18deg) rotateX(10deg);
    transition: transform 0.5s ease;
    box-shadow: 15px 15px 30px rgba(0, 0, 0, 0.25);
    border-radius: 4px 15px 15px 4px;
}

.book-3d:hover {
    transform: rotateY(-8deg) rotateX(5deg) scale(1.03);
}

.book-cover-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #FFE200; /* 公式イエロー */
    border: 3px solid #E60012; /* 赤フチ */
    border-radius: 4px 12px 12px 4px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    backface-visibility: hidden;
    z-index: 2;
}

.cover-series {
    font-size: 0.75rem;
    font-weight: 900;
    color: white;
    background: #4CAF50; /* カエルグリーン */
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid white;
}

.cover-main-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #E60012;
    text-shadow: 2px 2px 0 white, -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white;
    line-height: 1.2;
    margin: 5px 0;
}

.cover-sub-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
}

.cover-author {
    font-size: 0.75rem;
    color: #666;
    font-weight: bold;
}

.cover-publisher {
    font-size: 0.85rem;
    font-weight: 900;
    color: #00bcd4; /* 青色ロゴ風 */
}

/* 背表紙 */
.book-spine {
    position: absolute;
    width: 25px;
    height: 285px;
    background: #E60012;
    left: -12.5px;
    top: 0;
    transform: rotateY(-90deg) translateZ(12.5px);
    border-radius: 4px 0 0 4px;
    box-shadow: inset -3px 0 10px rgba(0,0,0,0.2);
}

/* 本の詳細テキストエリア */
.book-details-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pr-badge {
  display: inline-flex;       /* 🟢 flex化により絵文字とルビテキストを縦中央に固定 */
  align-items: center;        /* 🟢 縦方向の中央揃え */
  justify-content: center;
  white-space: nowrap;        /* 途中の改行を防止 */
  max-width: 100%;
  line-height: 1.2;          /* 🟢 ルビによる縦の膨らみを制御 */
  background: #FF5500;
  color: white;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 6px 12px 4px;     /* 🟢 ルビの厚みに合わせて上パディングを微調整 */
  border-radius: 15px;
  align-self: flex-start;
  border: 2px solid white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 🟢 追記: バッジ内のルビ（rt）のサイズと高さを専用補正 */
.pr-badge ruby {
  line-height: 1;
}

.pr-badge rt {
  font-size: 0.55rem;        /* ルビのフォントサイズを枠内に収まるよう調整 */
  line-height: 1;
}


.book-pr-title {
    font-size: 1.8rem;
    color: #FF5500;
    font-weight: 900;
    margin: 0;
}

.book-intro-text {
    font-size: 1.0rem;
    color: #444;
    line-height: 1.6;
    text-align: left;
}

/* スペックテーブル */
.book-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin: 10px 0;
}

.book-specs-table th {
    background-color: #FF8C00;
    color: white;
    font-weight: bold;
    padding: 8px 12px;
    text-align: left;
    width: 90px;
    border-radius: 5px 0 0 5px;
    border: 1px solid #FFE0B2;
}

.book-specs-table td {
    background-color: white;
    color: #444;
    padding: 8px 12px;
    border: 1px solid #FFE0B2;
    border-radius: 0 5px 5px 0;
    text-align: left;
}

/* 購入ボタン共通 */
.purchase-buttons-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.buy-btn {
    text-decoration: none;
    font-family: 'Mochiy Pop One', sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    border: 3px solid white;
    text-align: center;
}

.buy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.22);
}

.buy-btn:active {
    transform: translateY(2px);
}

.amazon-btn {
    background: linear-gradient(180deg, #FF9900 0%, #E67E22 100%);
}

.rakuten-btn {
    background: linear-gradient(180deg, #BF0000 0%, #900000 100%);
}

/* きらきら拍動エフェクト */
.pulsing-btn {
    animation: btn-pulse 1.5s infinite ease-in-out;
}

@keyframes btn-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 🎓 卒業PRボックスの追加スタイル */
.grad-pr-box {
    background: #FFFDF0;
    border: 3px dashed #D4AF37;
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
}

.grad-pr-box h4 {
    color: #AA771C;
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.grad-pr-box p {
    font-size: 0.95rem;
    color: #5D4037;
    line-height: 1.6;
}

/* フッターのPR免責事項スタイル */
.footer-pr-notes {
    max-width: 800px;
    margin: 0 auto;
    font-size: 0.8rem;
    color: #999;
    line-height: 1.5;
    border-bottom: 1px dashed #555;
    padding-bottom: 15px;
    text-align: center;
}


/* ─── 📖 各章の扉（章トップ：はじまりのお話 ＆ この章でわかること） ─── */
.chapter-intro-gate {
    background: linear-gradient(135deg, #F9FBE7 0%, #FFFDE7 100%); /* 温かみのあるライム・ライトイエロー背景 */
    border: 3px solid #CDDC39; /* 親しみやすい優しい黄緑ボーダー */
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0 25px 0;
    box-shadow: 0 8px 20px rgba(205, 220, 57, 0.12);
    position: relative;
    overflow: hidden;
}

.chapter-gate-header {
    border-bottom: 2px dashed #CDDC39;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.chapter-gate-header h4 {
    font-family: 'Kiwi Maru', sans-serif;
    font-size: 2.0rem; /* 32px相当に大幅拡大！ */
    font-weight: 900;
    color: #33691E; /* 濃いカエルグリーン */
    margin-bottom: 4px;
}

.chapter-gate-header h5 {
    font-size: 1.35rem; /* 21.6px相当に拡大！ */
    color: #558B2F;
    font-weight: bold;
    letter-spacing: 0.03em;
}

.chapter-gate-story {
    font-size: 1.35rem; /* 21.6px相当に拡大！ */
    color: #4E342E;
    line-height: 1.8; /* 行間を広げてさらに読みやすく！ */
    margin-bottom: 20px;
    background: #FFF;
    padding: 20px; /* パディングも広げてゆったりと */
    border-radius: 12px;
    border-left: 5px solid #FF8C00; /* オレンジのアクセント */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}

.chapter-gate-targets {
    background: #FFF;
    border: 2px dashed #8BC34A;
    border-radius: 15px;
    padding: 18px;
}

.targets-title {
    display: block;
    font-size: 1.4rem; /* 22.4px相当に拡大！ */
    font-weight: 900;
    color: #33691E;
    margin-bottom: 10px;
    font-family: 'Mochiy Pop One', sans-serif;
}

.chapter-gate-targets ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-gate-targets li {
    font-size: 1.25rem; /* 20px相当に拡大！ */
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
    font-weight: bold;
}

.chapter-gate-targets li:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .chapter-intro-gate {
        padding: 18px;
    }
    .chapter-gate-header h4 {
        font-size: 1.5rem;
    }
    .chapter-gate-story {
        font-size: 1.15rem;
        padding: 15px;
    }
    .chapter-gate-targets {
        padding: 12px;
    }
    .chapter-gate-targets li {
        font-size: 1.05rem;
    }
}

/* 🟢 ファイルの最末尾に追記：極小スマホ（320px〜480px端末）向け崩れ防止 */
@media (max-width: 480px) {
    .graduation-certificate .cert-title {
        font-size: 1.4rem !important;
    }
    .graduation-certificate,
    .stock-certificate {
        padding: 20px 12px;
    }
    .slot-machine-wrapper {
        padding: 18px 12px;
        border-width: 5px;
    }
    .slot-reel {
        height: 75px;
        font-size: 1.8rem;
    }
    .tax-dashboard {
        padding: 20px 12px;
    }
    .tax-options-grid {
        grid-template-columns: 1fr;
    }
    .dx-counter {
        font-size: 1.8rem;
    }
    .dx-upgrades-group {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
.pr-badge {
    font-size: 0.7rem;
    padding: 4px 8px 2px;
  }
  .pr-badge rt {
    font-size: 0.5rem;
  }
}

@media (max-width: 768px) {
  .quest-card {
    padding: 20px 15px; /* カード内余白を左右15pxに縮小して領域を確保 */
    border-radius: 20px;
  }
  .pr-badge {
    align-self: center;
    font-size: 0.75rem;
    padding: 5px 10px 3px;   /* 🟢 スマホ表示時の余白最適化 */
  }
    .stage-clear-banner {
        padding: 20px 15px; /* カード内の余白を縮小 */
        border-radius: 20px;
        margin-top: 20px;
    }
    .stage-clear-banner h3 {
        font-size: 1.4rem; /* タイトルの文字サイズをスマホ用に調整 */
        line-height: 1.3;
    }
    .stage-clear-banner p {
        font-size: 0.95rem; /* 解説テキストの可読性を確保 */
        line-height: 1.6;
        margin: 10px 0;
    }
    .clear-btn {
        font-size: 1.05rem; /* ボタンの文字サイズを調整 */
        padding: 12px 20px; /* 左右余白を40pxから20pxへ削減 */
        border-radius: 30px;
        max-width: 100%;
        word-break: break-word; /* テキストの枠外溢れを防止 */
        white-space: normal;    /* 自然な折り返しを許可 */
    }
 /* 🟢 以下を追記：クイズ選択肢 & ボタンのスマホ最適化 */
    .quiz-option-label {
       font-size: 1.05rem;
       padding: 12px 15px;
    }
    .quiz-submit-btn {
       font-size: 1.05rem;
       padding: 14px 20px;
       white-space: normal;
       word-break: break-word;
    }
    .book-pr-section {
       padding: 20px 15px;
       border-radius: 20px;
    }
    .purchase-buttons-group {
       flex-direction: column;
       gap: 10px;
    }
    .buy-btn {
       width: 100%;
       display: block;
       padding: 12px 15px;
       font-size: 0.95rem;
    }
}

/* ==================================================
   🌸 全画面共通 ルビ（ふりがな）表示の完全最適化CSS
   ================================================== */

/* 1. 全体的なふりがなの文字サイズ・高さを統一（ブラウザ間の表示ブレ防止） */
ruby {
  font-style: normal;
}
rt {
  font-size: 0.55em;      /* 親文字に対するふりがなの最適な比率 */
  line-height: 1.1;       /* 行高を詰めて縦の不要な伸びを防止 */
  font-weight: normal;   /* ふりがなをスッキリ読みやすく */
}

/* 2. 大タイトル（.hero-title / .hero-tagline）の白い太縁取りによる文字潰れ防止 */
.hero-title rt,
.hero-tagline rt {
  text-shadow: none !important; /* 太い縁取りがふりがなに被るのを解除 */
  font-size: 0.4em;
  font-weight: bold;
  color: #E60012;
}

/* 3. キャラクター役職バッジ（.char-role）の上下中央揃え */
.char-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding: 6px 15px 4px; /* 上余白を広げてルビの天井当たりを防止 */
}

/* 4. DXバッジ（.dx-badge）等の混在テキスト縦位置調整 */
.dx-badge {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  padding: 5px 10px 3px;
}

/* 5. ボタン類（.nav-step, .quiz-submit-btn, .clear-btn 等）のルビ詰まり防止 */
.nav-step,
.quiz-submit-btn,
.clear-btn,
.tax-btn,
.slot-lever-btn {
  line-height: 1.3;
}

/* 第4章 SOCIAL BUBBLE & TOWN METRICS 崩れ完全防止CSS */
.bubble-avatar {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

#gameConsole4 {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  padding: 25px 20px !important;
}

#gameConsole4 .sim-controls,
#gameConsole4 .sim-results {
  width: 100% !important;
}

#gameConsole4 .result-metrics {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
  gap: 10px !important;
}

#gameConsole4 .metric-card {
  padding: 10px 4px !important;
  word-break: break-word !important;
}

#gameConsole4 .metric-val {
  font-size: 1.05rem !important;
  line-height: 1.3 !important;
}
