/* ==========================================================================
   1. 全体の共通設定（背景に流れる水玉アニメーションを追加）
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* メインカラー：トモコレのイエロー */
    background-color: #f8ea6d; 
    /* ▼ アニメーションする水玉背景を設定 ▼ */
    background-image: radial-gradient(#a2dded 20%, transparent 20%);
    background-size: 30px 30px;
    animation: moveBackground 8s linear infinite; /* 8秒かけて背景が1ループ動く */
    
    font-family: 'Noto Sans JP', sans-serif;
    color: #4A3B00; 
    line-height: 1.6;
    padding-bottom: 40px;
}

/* 背景が斜めにゆっくり流れるアニメーションの定義 */
@keyframes moveBackground {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

/* ゲームポップ体 */
h1, h2, h3, h4, .menu-btn, .badge {
    font-family: 'Mochiy Pop One', sans-serif;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   2. ヘッダー：おもちゃのパッケージ風
   ========================================================================== */
.game-header {
    background-color: #c0fef2; 
    color: white;
    text-align: center;
    padding: 35px 20px;
    border-bottom: 6px solid #4A3B00; 
    box-shadow: inset 0 -8px 0 rgba(0,0,0,0.1); 
}

.game-title {
    font-size: 2.2rem;
    text-shadow: 3px 3px 0px #4A3B00, -1px -1px 0px #4A3B00, 1px -1px 0px #4A3B00, -1px 1px 0px #4A3B00, 1px 1px 0px #4A3B00;
    line-height: 1.3;
}

.game-title .subtitle {
    font-size: 1.1rem;
    color: #e3dd6a;
    background: rgba(224, 225, 150, 0.15);
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 5px;
}

.catchphrase {
    margin-top: 18px;
    font-size: 0.95rem;
    font-weight: bold;
    background: #FFF;
    color: #9dcb67;
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    border: 3px solid #4A3B00;
    box-shadow: 2px 2px 0px #4A3B00;
}

/* ==========================================================================
   3. ナビゲーション：ぷるぷる動くお菓子風ボタン
   ========================================================================== */
.game-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: #FFF; 
    padding: 12px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 4px solid #4A3B00;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.menu-btn {
    background-color: #FFF;
    color: #4A3B00;
    border: 3px solid #4A3B00;
    padding: 10px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 15px; 
    box-shadow: 0 5px 0 #4A3B00;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* ▼ ボタンにマウスを乗せた時に「ぷるぷる」震えるアニメーション ▼ */
.menu-btn:hover:not(.active) {
    background-color: #FFFDE6;
    animation: purupuru 0.4s linear infinite;
}

@keyframes purupuru {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 1px) rotate(-1deg); }
    75% { transform: translate(1px, 1px) rotate(0deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* ボタンを押したときのぷにっとした沈み込み */
.menu-btn:active {
    transform: translateY(5px) !important;
    box-shadow: 0 0px 0 #4A3B00 !important;
    animation: none; /* クリック時は震えを止める */
}

/* 現在選ばれているボタン（パステルパープル） */
.menu-btn.active {
    background-color: #B26BFF;
    color: white;
    box-shadow: 0 5px 0 #7A33CC;
}

/* ▼ JSでクリックしたときに一瞬ピカッと光らせる用のクラス ▼ */
.menu-btn.flash::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    opacity: 0.6;
    animation: flashEffect 0.2s ease-out;
}
@keyframes flashEffect {
    from { opacity: 0.7; }
    to { opacity: 0; }
}

/* ==========================================================================
   4. メインコンテナとゲームの液晶画面風エリア（ポヨンと出現）
   ========================================================================== */
.game-container {
    max-width: 900px;
    margin: 25px auto;
    padding: 0 15px;
}

.page-content {
    display: none;
    background: #FFF;
    border: 4px solid #4A3B00;
    border-radius: 25px; 
    padding: 30px;
    box-shadow: 0 8px 0px #4A3B00; 
}

/* ▼ ページ切り替え時にポヨン！と弾んで飛び出すアニメーション ▼ */
.page-content.active {
    display: block;
    animation: poyon 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

@keyframes poyon {
    0% { opacity: 0; transform: scale(0.85) translateY(20px); }
    70% { transform: scale(1.03) translateY(-2px); } /* ちょっと行き過ぎてから戻る */
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

h2 {
    font-size: 1.6rem;
    color: #FF5A52;
    text-align: center;
    background: #FFF0F0;
    display: inline-block;
    padding: 5px 20px;
    border-radius: 15px;
    border: 3px solid #4A3B00;
    margin: 0 auto 25px auto;
    display: table; 
}

/* ==========================================================================
   5. カラフルで可愛いカードパーツ
   ========================================================================== */
.card {
    color: #4A3B00; 
    padding: 20px;
    border-radius: 18px;
    border: 3px solid #4A3B00;
    box-shadow: 4px 4px 0px #4A3B00;
}
.card h3 { 
    margin-bottom: 10px; 
    font-size: 1.2rem;
    border-bottom: 2px dashed #4A3B00;
    padding-bottom: 3px;
}

.bg-purple { background-color: #E2CDFF; } 
.bg-red    { background-color: #FFC0BD; } 
.bg-green  { background-color: #C3F3C1; } 
.bg-blue   { background-color: #BCE2FF; } 

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

ul { padding-left: 20px; }
li { margin-bottom: 5px; }

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 20px;
    margin-top: 20px;
}

.feature-item {
    background: #FFFDEB; 
    border: 3px solid #4A3B00;
    padding: 25px 20px 20px 20px;
    border-radius: 18px;
    position: relative;
}

.badge {
    position: absolute;
    top: -15px;
    left: 15px;
    color: white;
    padding: 1px 12px;
    border-radius: 10px;
    border: 2px solid #4A3B00;
    font-size: 1rem;
    box-shadow: 2px 2px 0 #4A3B00;
}
.badge-purple { background: #B26BFF; }
.badge-red { background: #FF5A52; }
.badge-green { background: #34C759; }
.badge-blue { background: #007AFF; }

/* ==========================================================================
   6. 島比較コーナー（横長ボックスと左右分離ギャラリー構造）
   ========================================================================== */
.intro-text {
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center;
    background: #FFF6C2;
    padding: 8px;
    border-radius: 10px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 15px;
    border: 3px solid #4A3B00;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.compare-table th, .compare-table td {
    border: 1px solid #E0D5C1;
    border-bottom: 3px solid #4A3B00; 
    padding: 14px;
    text-align: left;
    font-size: 0.95rem;
}

.compare-table th {
    color: white;
    border-bottom: 4px solid #4A3B00;
}

.compare-table tr:nth-child(even) {
    background-color: #FFFDF5;
}

.compare-table th:first-child { background-color: #6C5A4B; }
.my-island-head { background-color: #7b4aac; }      
.friend-island-head { background-color: #da72c3; }  

/* 画像エリア全体 */
.media-section {
    margin-top: 40px;
    border-top: 4px dashed #E0D5C1;
    padding-top: 25px;
}

/* 緑のボックスを横長にする設定 */
.wide-comment-box {
    width: 100%;
    margin-bottom: 35px;
    text-align: left;
}

/* 私と友達のエリアを縦に2つ、またはPCなら左右に並べるコンテナ */
.islands-flex-container {
    display: flex;
    flex-direction: column; /* スマホや基本は縦に並べて見やすく */
    gap: 40px;
}

/* それぞれの島の独立したブロック */
.island-block {
    background: #FFFDF5;
    border: 3px solid #4A3B00;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 4px 4px 0px #4A3B00;
}

/* ブロック内のタイトルリボン */
.island-header-title {
    font-family: 'Mochiy Pop One', sans-serif;
    color: white;
    font-size: 1.2rem;
    padding: 8px 15px;
    border-radius: 12px;
    border: 2px solid #4A3B00;
    margin-bottom: 20px;
    display: inline-block;
}

.island-block h5 {
    font-size: 0.95rem;
    margin: 15px 0 8px 0;
    color: #6C5A4B;
    border-left: 4px solid #4A3B00;
    padding-left: 8px;
}

/* 相関図用の大きなボックス */
.main-chart-box {
    width: 100%;
    max-width: 500px; /* 大きくなりすぎないようにストッパー */
    aspect-ratio: 16 / 9;
    margin-bottom: 20px;
}

/* 5枚の画像を綺麗に並べるグリッド（2列×3列っぽく並ぶ） */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 4 / 3;
}

/* 画像・動画共通の丸角プレースホルダーベース */
.photo-placeholder {
    background-color: #FFFDEB;
    background-image: radial-gradient(#EADFA7 20%, transparent 20%); 
    background-size: 16px 16px;
    border: 3px dashed #A89B7A;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7A6655;
    font-size: 0.8rem;
    padding: 10px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.photo-placeholder .sub-text {
    font-size: 0.7rem;
    font-weight: normal;
    color: #9A8A6A;
}

/* 画像や自動再生動画が入った時の引き締めスタイル */
.photo-placeholder img,
.photo-placeholder video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 縦横比を崩さず枠いっぱいに表示 */
    border-radius: 10px;
}

/* PCなどの広い画面のとき、島を左右に2分割して並べる */
@media (min-width: 900px) {
    .islands-flex-container {
        flex-direction: row; /* 左右並び */
    }
    .island-block {
        flex: 1; /* 同じ幅で引き伸ばす */
    }
}
/* ==========================================================================
   7. フッター ＆ スマホ対応
   ========================================================================== */
.game-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8rem;
    color: #7A6655;
    font-weight: bold;
}

@media (max-width: 768px) {
    .grid, .feature-grid, .media-grid {
        grid-template-columns: 1fr;
    }
    .game-title {
        font-size: 1.5rem;
    }
    .page-content {
        padding: 20px 15px;
        border-radius: 20px;
    }
    .menu-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    /* スマホはホバーのぷるぷるを無効化（誤作動防止） */
    .menu-btn:hover:not(.active) {
        animation: none;
    }
}
/* ==========================================================================
   追加：h2タイトルをトモコレの「セリフ吹き出し風」にするツノの装飾
   ========================================================================== */
h2 {
    position: relative;
    /* 影の付き方を少し調整 */
    box-shadow: 3px 3px 0px #4A3B00;
}

/* 吹き出しの「ちょこんとした三角のツノ」を下に付け加える */
h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: #FFF0F0 transparent;
    display: block;
    width: 0;
    z-index: 2;
}

/* ツノの茶色いフチ線用 */
h2::before {
    content: '';
    position: absolute;
    bottom: -19px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 16px 16px 0;
    border-style: solid;
    border-color: #4A3B00 transparent;
    display: block;
    width: 0;
    z-index: 1;
}
/* ==========================================================================
   追加：トップ画面のスポット10選用のおしゃれなスタイル
   ========================================================================== */
.spot-section {
    border-top: 4px dashed #E0D5C1;
    padding-top: 30px;
}

/* 10個のスポットを綺麗に並べるグリッド（PC時は2列、スマホ時は1列） */
.spot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

/* スポットカード全体（トモコレ風の太フチとぷっくりした影） */
.spot-card {
    background: #FFFDF5;
    border: 3px solid #4A3B00;
    border-radius: 20px;
    box-shadow: 4px 4px 0px #4A3B00;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease;
}

/* マウスを乗せるとちょっと浮き上がる楽しいエフェクト */
.spot-card:hover {
    transform: translateY(-3px);
}

/* 画像が入るプレースホルダー部分（ギャラリーと同じ水玉模様） */
.spot-img-box {
    width: 100%;
    aspect-ratio: 16 / 7; /* 横長のすっきりした写真枠 */
    background-color: #FFFDEB;
    background-image: radial-gradient(#EADFA7 20%, transparent 20%);
    background-size: 16px 16px;
    border-bottom: 3px solid #4A3B00;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A89B7A;
    font-size: 0.85rem;
    font-weight: bold;
    position: relative;
}

/* 実際に img タグを中に入れたとき用の調整 */
.spot-img-box img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 説明テキストのエリア（余白をしっかり取る） */
.spot-info {
    padding: 15px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* スポットの名前 */
.spot-info h4 {
    font-size: 1.1rem;
    color: #4A3B00;
    border-bottom: 2px dashed #EADFA7;
    padding-bottom: 5px;
    margin: 0;
}

/* スポットの解説文 */
.spot-info p {
    font-size: 0.88rem;
    color: #6C5A4B;
    line-height: 1.5;
    margin: 0;
}

/* 📱 スマホ画面（幅768px以下）での見え方調整 */
@media (max-width: 768px) {
    .spot-grid {
        grid-template-columns: 1fr; /* スマホでは縦1列にしてスクロールしやすく */
        gap: 20px;
    }
    
    .spot-img-box {
        aspect-ratio: 16 / 6; /* スマホでは画像枠を少し浅くして文章を読みやすく */
    }
}