/* --- EGIC防災大社2026 専用スタイルシート v2.3 --- */

/* --- 基本設定 --- */
:root {
    --shrine-red: #c0392b;
    --pure-white: #ffffff;
    --dark-wood: #2c3e50;
    --gold-accent: #f1c40f;
    --light-bg: #fdfaf5;
    --twitter-blue: #1DA1F2;
    --tights-green: #98cb00;
    --bluesky-blue: #0085FF;
}

body {
    background-color: var(--light-bg);
    font-family: 'Noto Serif JP', serif;
    color: var(--dark-wood);
    margin: 0;
    text-align: center;
    background-image: url('assets/bg_winter.jpg');
    background-size: cover;
    background-attachment: fixed;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(253, 250, 245, 0.95); /* 和紙背景なので少し透明度を上げる */
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* --- ヘッダー --- */
.main-header {
    padding: 30px 20px;
    color: var(--pure-white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    border-bottom: 4px solid var(--gold-accent);
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.2)), url('assets/shimenawa_bg.png');
    background-size: cover;
    margin-bottom: 30px;
}
.torii-gate { width: 150px; margin-bottom: -20px; }
h1 { font-size: 3em; margin: 0; color: var(--gold-accent); letter-spacing: 3px; }
.subtitle { font-size: 1.2em; margin-top: 5px; }

/* --- コンテンツボックス --- */
.content-box {
    background-color: var(--pure-white);
    border-top: 5px solid var(--shrine-red);
    border-bottom: 5px solid var(--shrine-red);
    padding: 40px;
    margin-bottom: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.section-title {
    font-size: 2em;
    color: var(--shrine-red);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 30px;
    background: url('assets/brush_line.svg') no-repeat bottom center;
    background-size: 100% auto;
}

/* --- おみくじセクション v2.3 --- */
.shrine-area {
    background-image: url('assets/washi_texture.png');
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #eee;
    min-height: 400px;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.main-character { max-width: 180px; object-fit: contain; filter: drop-shadow(5px 5px 5px rgba(0,0,0,0.2)); }
.result-wrapper, .intro-wrapper, .shaking-wrapper, .purge-wrapper { animation: fadeIn 0.5s; width: 100%; text-align: center; }

.result-header { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 20px; }
.result-main-image { max-width: 100px; max-height: 120px; object-fit: contain; }
.result-header h2 { font-size: 2.8em; color: var(--shrine-red); margin: 0; }
.result-body .sougou-un { font-size: 1.2em; text-align: left; border-bottom: 1px solid #ddd; padding-bottom: 15px; margin-bottom: 15px; line-height: 1.8; }
.result-body ul { list-style: none; padding: 0; margin: 0; text-align: left; }
.result-body ul li { padding: 12px 0; display: flex; align-items: center; font-size: 1.1em; }
.result-body ul li strong { color: var(--shrine-red); margin-right: 10px; }
.item-icon { width: 32px; height: 32px; margin-left: 10px; object-fit: contain; }

.result-footer { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--shrine-red); text-align: left; overflow: hidden; }
.correct-commentator { max-width: 100px; max-height: 100px; object-fit: contain; float: left; margin-right: 15px; }
.correct-text { font-size: 1em; color: #555; font-style: italic; }

/* --- ボタン類 --- */
.shine-button {
    background-color: var(--gold-accent); color: var(--dark-wood); font-family: 'Noto Serif JP', serif; font-size: 1.5em;
    font-weight: bold; padding: 15px 40px; border: none; border-radius: 50px; cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: all 0.3s ease; position: relative; overflow: hidden;
}
.shine-button:hover { transform: translateY(-3px); box-shadow: 0 6px 10px rgba(0,0,0,0.3); }
.shine-button::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 20%; height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(45deg); transition: none;
}
.shine-button:hover::after { left: 130%; transition: left 0.8s ease-in-out; }

.purge-button {
    display: block; width: 80%; max-width: 400px; margin: 20px auto 0; padding: 15px; font-size: 1.2em;
    font-weight: bold; background-color: var(--dark-wood); color: var(--pure-white); border: none;
    border-radius: 10px; cursor: pointer; transition: background-color 0.3s;
}
.purge-button:hover { background-color: var(--shrine-red); }

/* --- シェアボタン --- */
.share-buttons { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.action-button {
    display: inline-block; padding: 10px 20px; border-radius: 5px; color: var(--pure-white);
    font-weight: bold; text-decoration: none; transition: opacity 0.3s; border: none; cursor: pointer;
    font-family: sans-serif; font-size: 0.9em;
}
.action-button:hover { opacity: 0.8; }
#save-image-button { background-color: #34495e; }
.twitter { background-color: var(--twitter-blue); }
.tights { background-color: var(--tights-green); }
.bluesky { background-color: var(--bluesky-blue); }

/* --- アニメーション --- */
.shaking { font-size: 1.5em; font-weight: bold; animation: shake 0.5s infinite; }
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); } 10% { transform: translate(-1px, -2px) rotate(-1deg); } 20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); } 40% { transform: translate(1px, -1px) rotate(1deg); } 50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); } 70% { transform: translate(3px, 1px) rotate(-1deg); } 80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); } 100% { transform: translate(1px, -2px) rotate(-1deg); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.purge-animation { animation: purge 1s forwards; }
@keyframes purge { from { transform: scale(1); opacity: 1; } to { transform: scale(0); opacity: 0; } }

/* --- 絵馬セクション --- */
.ema-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.ema-item {
    background-image: url('assets/ema_template.png'); background-size: contain; background-repeat: no-repeat;
    background-position: center center; border: none; padding: 15%; aspect-ratio: 5/4;
    color: #4a2c00; font-weight: bold; display: flex; align-items: center; justify-content: center;
}

/* --- フッター --- */
.main-footer { padding: 20px; color: var(--pure-white); text-shadow: 1px 1px 2px rgba(0,0,0,0.7); }

/* ... (既存のv2.3 CSSはすべてそのまま) ... */

/* --- おみくじセクション v2.4 (画像保存範囲調整) --- */
#omikuji-capture-area {
    padding: 30px; /* ★重要：コンテンツの周りに余白を追加 */
}

/* --- 絵馬セクション v2.4 --- */
.ema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 少し大きめに */
    gap: 30px;
}
.ema-item {
    background-image: url('assets/ema_template.png');
    background-size: 100% 100%; /* 比率をコンテナに合わせる */
    background-repeat: no-repeat;
    background-position: center center;
    border: none;
    padding: 0; /* 内側のpaddingは子要素で制御 */
    aspect-ratio: 5/4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.ema-item:hover {
    transform: scale(1.05); /* ホバーで少し拡大 */
}
.ema-content {
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: space-around; /* 中身を均等配置 */
    align-items: center;
    text-align: center;
}
.ema-character {
    max-height: 50%;
    max-width: 50%;
    object-fit: contain;
}
.ema-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 1em;
    font-weight: bold;
    color: #4a2c00;
    line-height: 1.6;
    margin: 10px 0;
}
.ema-author {
    font-size: 0.8em;
    color: #6a4c20;
}

/* ... (既存のv2.4 CSSはすべてそのまま) ... */

/* --- 1月1日限定ギミック --- */
.new-year-surprise {
    display: none; /* 普段は隠しておく */
}

/* 鏡餅ちさまる */
#new-year-chisamaru {
    position: absolute;
    top: 60px;
    left: 20px;
    cursor: pointer;
}
#new-year-chisamaru img {
    width: 80px;
}
.speech-bubble {
    position: absolute;
    bottom: 90%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pure-white);
    color: var(--dark-wood);
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    width: max-content; /* 文字量に合わせる */
    text-shadow: none;
}
#new-year-chisamaru:hover .speech-bubble {
    opacity: 1;
    visibility: visible;
    bottom: 100%;
}

/* お年玉セクション */
.otoshidama-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}
.otoshidama-text {
    text-align: left;
}