/* ページ全体のスタイル：めでたい感じに */
body {
    margin: 0;
    padding: 40px 20px;
    background-color: #fdfbf7; /* 和風の生成りっぽい色 */
    background-image: radial-gradient(#d3a3a3 1px, transparent 1px); /* ほんのりドットパターン */
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    /* フォントを明朝体ベースに変更して格式高い感じに */
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "HgMinchoE", "MS PMincho", "MS Mincho", serif;
}

/* タイトルエリア */
.title-area {
    text-align: center;
    margin-bottom: 40px;
}

.title-area h1 {
    font-size: 4rem;
    color: #b22222; /* 紅白の赤 */
    margin: 0;
    line-height: 1;
    letter-spacing: 0.2em; /* 文字間隔を広げてゆったりと */
    text-shadow: 2px 2px 0px white, 4px 4px 0px rgba(0,0,0,0.1);
}

.title-area .sub-title {
    font-family: "Helvetica Neue", Arial, sans-serif; /* 英字はゴシック系ですっきりと */
    color: #d4af37; /* ゴールド */
    font-size: 1.5rem;
    margin-top: 10px;
    margin-bottom: 0;
    letter-spacing: 0.1em;
    font-weight: bold;
}

/* 年賀状のコンテナ（枠）：豪華に */
.card-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    /* 影を濃く、金色の枠線を追加 */
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border: 8px solid #d4af37; /* ゴールドの枠 */
    border-radius: 4px; /* 角丸は少し控えめに */
    overflow: hidden;
    background-color: white;
    margin-bottom: 30px;
    flex-shrink: 0;
}

/* 背景画像 (main.png) */
.main-image {
    width: 100%;
    height: auto;
    display: block;
}

/* 上に乗せる画像 (seitaro.png) */
.overlay-image {
    position: absolute;
    /* 任意の場所に配置（例：左下） */
    bottom: 0;
    left: 0;
    /* サイズ調整：親要素(カード)の幅に対する割合にする */
    width: 30%; 
    height: auto; 
    aspect-ratio: 1 / 1; /* 正方形を維持 */
    
    object-fit: cover; /* 画像をトリミングして枠に合わせる */
    border-radius: 50%; /* 丸くする */
    border: 5px solid #ffffff; /* 白いフチをつける */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* 影をつけて浮き上がらせる */
    
    z-index: 5; /* 背景より手前 */
    pointer-events: none; /* クリック判定はSVGに任せる */
}
/* 当たり判定用のSVG */
.overlay-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* SVG内のパス */
.hit-area {
    pointer-events: auto;
    cursor: pointer;
}

/* 吹き出しの共通スタイル：和風テイストに */
.speech-bubble {
    position: absolute;
    background-color:rgba(221, 221, 221, 0.7); /* 白一色（不透明） */
    padding: 15px 25px;
    border-radius: 10px; /* 角丸を四角く */
    /* border: 2px solid rgba(239, 50, 50, 0.6); 赤い枠線は削除 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    font-weight: bold;
    color: #333;
    font-size: 1.2rem;
    white-space: nowrap;
    
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

/* 吹き出しの位置設定（個別） */
.kazune-pos {
    top: 15%;
    right: 32%;
}

.shinjiro-pos {
    top: 0%;
    right: 20%;
}

.yoshiyuki-pos {
    top: 0%;
    right: 50%;
}

.jinsiro-pos {
    top: 20%;
    left: 32%;
}

.kazumi-pos {
    top: 0%;
    left: 15%;
}
.seitaro-pos {
    top: 50%;
    left: 10%;
}

/* 吹き出しのしっぽ（共通） */
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px; /* 位置調整 */
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: rgba(230, 230, 230, 0.7) transparent; /* 本体と同じ白に */
    display: block;
    width: 0;
}
/* しっぽの内側（白抜き用のbeforeは不要になるので削除または非表示） */
.speech-bubble::before {
    display: none;
}

/* アクティブクラスがついた吹き出しを表示 */
.speech-bubble.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 説明文エリアのスタイル：和紙っぽい雰囲気に */
.description-container {
    width: 100%;
    max-width: 800px;
    background-color: #fffcf5; /* 生成り色 */
    /* 格子の色を薄く変更 (#e2d8c3 -> #f2efe9) */
    background-image: linear-gradient(0deg, transparent 24%, #f2efe9 25%, #f2efe9 26%, transparent 27%, transparent 74%, #f2efe9 75%, #f2efe9 76%, transparent 77%, transparent), linear-gradient(90deg, transparent 24%, #f2efe9 25%, #f2efe9 26%, transparent 27%, transparent 74%, #f2efe9 75%, #f2efe9 76%, transparent 77%, transparent);
    background-size: 50px 50px; /* 格子柄のような薄いパターン */
    
    padding: 30px;
    border: 4px double #b08d55; /* 二重線で高級感 */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    box-sizing: border-box;
    position: relative;

    /* エリア自体のアニメーション設定 */
    opacity: 0; /* 最初は隠しておく */
    transform: translateY(20px); /* 少し下に配置 */
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none; /* 見えていない時はクリック等を無効化 */
}

/* クラスがついたら表示 */
.description-container.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 飾り（説明文エリアの四隅に配置するようなイメージですが、今回はシンプルに） */

/* 説明用の画像 */
.desc-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: none;
    border: 3px solid #d4af37; /* 金色の枠 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.desc-img.show {
    display: block;
}

#description-text {
    margin: 0;
    font-size: 1.1rem;
    color: #4a3b32; /* こげ茶色 */
    font-weight: 500;
    /* テキスト単体のアニメーションは削除 */
    white-space: pre-wrap;
    line-height: 1.8; /* ゆったり読むために広げる */
}
