/*
 * Hephaestusによるスタイルシート Ver. 3.1 (アスペクト比・最終調整版)
 */

/* ============================================= */
/* 0. 基本設定                                 */
/* ============================================= */
:root {
    --primary-color: #003366; --secondary-color: #0055a5; --accent-color: #FF7900;
    --background-light: #f4f7fa; --text-color: #333333; --text-light: #555555;
    --card-bg: #ffffff; --font-main: 'Noto Sans JP', 'Segoe UI', sans-serif;
    --border-radius: 12px; --shadow-light: 0 4px 15px rgba(0, 51, 102, 0.08);
    --shadow-heavy: 0 12px 30px rgba(0, 51, 102, 0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: var(--background-light); color: var(--text-color); line-height: 1.8; }

/* ============================================= */
/* 1. 共通パーツ (ヘッダー & フッター)            */
/* ============================================= */
header#main-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 15px 0;
    transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
    color: white; background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
header#main-header.scrolled { background-color: var(--primary-color); box-shadow: 0 4px 10px rgba(0,0,0,0.2); text-shadow: none; padding: 10px 0; }

.header-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 15px; text-decoration: none; color: inherit; }
.logo {
    width: 50px;
    height: 50px; /* ★★ 正方形の魂には、高さと幅を等しく与える ★★ */
    transition: width 0.4s ease, height 0.4s ease;
}
header#main-header.scrolled .logo { width: 40px; height: 40px; }
header h1 { font-size: 2em; margin: 0; font-weight: 700; }

/* コレクト・ナビ */
.collect-nav { position: relative; cursor: pointer; }
.collect-nav.is-open .nav-dropdown { display: block; }
.nav-icon-container { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 50px; background-color: rgba(255,255,255,0.2); transition: background-color 0.3s ease; }
header#main-header.scrolled .nav-icon-container { background-color: var(--secondary-color); }
.collect-nav:hover .nav-icon-container { background-color: rgba(255,255,255,0.3); }
header#main-header.scrolled .collect-nav:hover .nav-icon-container { background-color: var(--accent-color); }
.nav-icon-container img { width: 30px; height: auto; /* ★★ コレクトはへしゃげさせない ★★ */ }
.nav-icon-container span { font-weight: bold; color: white; }
.chevron { display: inline-block; width: 8px; height: 8px; border-right: 2px solid white; border-bottom: 2px solid white; transform: rotate(45deg); transition: transform 0.3s; margin-left: 5px; }
.collect-nav.is-open .chevron { transform: rotate(-135deg); }
.nav-dropdown { display: none; position: absolute; top: 100%; right: 0; background-color: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--shadow-heavy); list-style: none; margin-top: 10px; width: 250px; overflow: hidden; }
.nav-dropdown li a { display: block; padding: 12px 20px; text-decoration: none; color: var(--primary-color); font-weight: bold; border-bottom: 1px solid #eee; transition: background-color 0.3s, color 0.3s; }
.nav-dropdown li:last-child a { border-bottom: none; }
.nav-dropdown li a:hover { background-color: var(--accent-color); color: white; }
.header-spacer { /* JSで制御 */ }

footer { text-align: center; padding: 25px 0 20px 0; background-color: var(--primary-color); color: white; margin-top: 50px; border-top: 5px solid var(--accent-color); }
.footer-characters { display: flex; justify-content: center; gap: 15px; margin-bottom: 15px; }
.footer-characters img { width: auto; height: 50px; /* ★★ 縦長のコレクトの比率を保つ ★★ */ }
.footer-message { color: #ddeeff; margin-bottom: 20px; }

/* ============================================= */
/* 2. トップページ・メインコンテンツ               */
/* ============================================= */
main { padding: 0 20px; }
.zone { max-width: 1200px; margin: 50px auto; }
/* ヒーローセクション */
.hero-section { background: linear-gradient(135deg, #eaf2fa, #d0e0f0); text-align: center; padding: 60px 20px; position: relative; overflow: hidden; border-radius: var(--border-radius); margin-top: 20px; border-bottom: 5px solid var(--accent-color); }
.hero-content h2 { font-size: clamp(2em, 5vw, 2.8em); color: var(--primary-color); font-weight: 700; margin-bottom: 15px; }
.hero-dialogue { font-size: 1.1em; color: var(--text-light); margin: 0 auto 30px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.hero-button { display: inline-block; padding: 15px 40px; font-size: 1.2em; font-weight: bold; color: white; background-color: var(--accent-color); text-decoration: none; border-radius: 50px; transition: background-color 0.3s, transform 0.3s; }
.hero-button:hover { background-color: #e66a00; transform: scale(1.05); }
.hero-characters { display: flex; justify-content: center; align-items: flex-end; gap: 20px; margin-top: 30px; pointer-events: none; }
.hero-characters img { max-height: 150px; width: auto; transform: translateY(50px); opacity: 0; animation: fadeIn-up 0.8s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.hero-characters .hero-char-correct { animation-delay: 0.4s; }
@keyframes fadeIn-up { to { transform: translateY(0); opacity: 1; } }

/* イントロ・ゾーンタイトル・カード */
.intro-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 30px; background-color: var(--card-bg); padding: 30px; border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.intro-logo { text-align: center; }
.intro-text { flex-basis: 600px; flex-grow: 1; font-size: 1.1em; line-height: 1.8; }
.zone-title { font-size: 2em; color: var(--primary-color); text-align: center; margin-bottom: 30px; padding-bottom: 10px; border-bottom: 3px solid var(--accent-color); display: flex; align-items: center; justify-content: center; gap: 10px; }
.title-icon { height: 1.2em; width: auto; }
.feature-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; justify-content: center; }
.feature-card { background-color: var(--card-bg); padding: 25px; border-radius: var(--border-radius); text-align: center; box-shadow: var(--shadow-light); transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; display: flex; flex-direction: column; justify-content: space-between; border: 2px solid transparent; }
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-heavy); border-color: var(--accent-color); }
.card-icon { margin-bottom: 15px; height: 60px; display: flex; align-items: center; justify-content: center; }
.card-icon img { max-height: 100%; width: auto; }
.feature-card h3 { font-size: 1.5em; color: #000; margin-bottom: 10px; }
.feature-card p { margin-bottom: 20px; flex-grow: 1; color: var(--text-light); }
.feature-button { display: inline-block; padding: 12px 25px; background-color: var(--accent-color); color: white; text-decoration: none; border-radius: 5px; font-weight: bold; transition: background-color 0.3s; }
.feature-button:hover { background-color: var(--secondary-color); }
.education-zone { background-color: #eaf2fa; padding: 30px; border-radius: 15px; }
.education-zone .feature-button { background-color: var(--secondary-color); }
.education-zone .feature-button:hover { background-color: var(--accent-color); }
.phenology-zone { background: #f7fafc; padding: 40px; border-radius: 20px; border: 1px solid #e2e8f0; }
.phenology-zone .zone-title { color: #4a5568; border-bottom-color: #cbd5e0; }
.phenology-zone .feature-button { background-color: #38a169; }
.phenology-zone .feature-button:hover { background-color: #2f855a; }

/* ============================================= */
/* 3. その他                                   */
/* ============================================= */
/* ユーティリティ */
.utility-container { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px; margin-top: 40px; }
.utility-box { background-color: var(--card-bg); padding: 20px 25px; border-radius: var(--border-radius); box-shadow: var(--shadow-light); min-width: 280px; flex-grow: 1; }
.utility-box h3 { text-align: center; margin-bottom: 15px; color: var(--primary-color); }
.links-list { list-style: none; padding: 0; }
.links-list li { padding: 8px 0; border-bottom: 1px solid #eee; } .links-list li:last-child { border-bottom: none; }
.links-list li a { text-decoration: none; color: var(--secondary-color); transition: color 0.3s; } .links-list li a:hover { color: var(--accent-color); }
.share-links { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 10px; }
.share-links img { width: 40px; height: 40px; transition: transform 0.3s, opacity 0.3s; } .share-links img:hover { opacity: 0.8; transform: scale(1.1); }
/* 相棒ガイド */
#chisamaru-guide { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; align-items: flex-end; opacity: 0; transform: translateY(20px); animation: guide-fade-in 0.8s 1.5s forwards; }
#chisamaru-guide img { height: 100px; width: auto; }
.chisamaru-bubble { background-color: var(--card-bg); color: var(--primary-color); padding: 10px 15px; border-radius: var(--border-radius); margin-right: 10px; margin-bottom: 30px; font-weight: bold; box-shadow: var(--shadow-heavy); position: relative; opacity: 0; transform: scale(0.8); animation: bubble-pop-in 0.5s 2s forwards; }
.chisamaru-bubble::after { content: ''; position: absolute; bottom: -10px; right: 20px; width: 0; height: 0; border: 10px solid transparent; border-top-color: var(--card-bg); border-bottom: 0; }
@keyframes guide-fade-in { to { opacity: 1; transform: translateY(0); } }
@keyframes bubble-pop-in { to { opacity: 1; transform: scale(1); } }
@media (max-width: 768px) { #chisamaru-guide { display: none; } }

/* トップページ・さんぽカード専用 */
.feature-card-link { text-decoration: none; }
.sanpo-card {
    border-color: #276749;
    transition: all 0.3s ease;
}
.sanpo-card:hover {
    border-color: #38a169;
    box-shadow: 0 15px 40px rgba(56, 161, 105, 0.2);
}
.sanpo-card .feature-button {
    background-color: #38a169;
}

.hero-character img { transition: transform 0.2s ease; }
.hero-character:hover img { transform: scale(1.1); }
.playground-bubble {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}
.playground-bubble.is-visible { opacity: 1; bottom: 30px; }
/* トップページ・リンク・トレジャーカード専用 */
.link-treasure-zone {
    background: #fffaf0; /* コネクトのイメージカラー */
    padding: 40px; border-radius: 20px; border: 1px solid #feebc8;
}
.link-treasure-zone .zone-title { color: #b7791f; border-bottom-color: #ecc94b; }
.link-treasure-zone .feature-card { border-color: #ecc94b; }
.link-treasure-zone .feature-card:hover { border-color: var(--accent-color); box-shadow: 0 15px 40px rgba(236, 201, 75, 0.3); }
.link-treasure-zone .feature-button { background-color: #ecc94b; color: #744210; }
.link-treasure-zone .feature-button:hover { background-color: var(--accent-color); color: #fff; }

/* 
 * Hephaestusによるボタン統一（独裁解除版）
 * !important を削除し、詳細度で適用する
 */
main .feature-button,
main .omamori-button,
main .hazardmap-button,
main .download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 35px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background-color: var(--accent-color);
    border-radius: 50px;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 121, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1.2;
}

main .feature-button:hover,
main .omamori-button:hover,
main .hazardmap-button:hover,
main .download-button:hover {
    background-color: #e66a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 121, 0, 0.4);
}

/* 個別ページの特殊事情（幅広ボタンなど）は、各ページのCSSで上書き可能にする */