/* --- キャラクターセクション (スマホ: 縦並び) --- */
.container#char-container {
    max-width: 1000px;
    margin: 50px auto 0;
    padding: 20px;

    /* PCの場合はmax-widthとwidthを設定 */
    @media (min-width: 768px) {
        max-width: 750px;
        width: 750px;
    }
}

.char-section {
    display: flex;
    flex-direction: column; /* スマホは縦 */
    align-items: center;
    text-align: center; /* SPは中央寄せ */
    position: relative;
    margin-bottom: 130px;
}

.char-section::after {
    opacity: 0;
    transform: scale(0.8);
    will-change: opacity, transform;
    content: '';
    display: block;
    position: absolute;
    top: -10%;
    left: -2.5%;
    width: 105%;
    height: 120%;
    background-color: #f9f9f9;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.8), 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.8), 2px, transparent 2px);
    background-size: 30px 30px;
    z-index: -1;
}
.char-section.is-visible::after {
    animation: char-bg-puni 0.75s cubic-bezier(0.44, 1.5, 0.66, 1.07) forwards;
}

/* ぽよん: ふわっと出て → 一度大きくなる → なめらかに元の大きさへ */
@keyframes char-bg-puni {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
    }
    45% {
        opacity: 1;
        transform: scale(1.07);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.char-section:nth-of-type(4n+1)::after {
    -webkit-clip-path: url(#clip_svgFrame1);
    clip-path: url(#clip_svgFrame1);
}

.char-section:nth-of-type(4n+2)::after {
    -webkit-clip-path: url(#clip_svgFrame2);
    clip-path: url(#clip_svgFrame2);
}

.char-section:nth-of-type(4n+3)::after {
    -webkit-clip-path: url(#clip_svgFrame3);
    clip-path: url(#clip_svgFrame3);
}

.char-section:nth-of-type(4n)::after {
    -webkit-clip-path: url(#clip_svgFrame4);
    clip-path: url(#clip_svgFrame4);
}

@media (min-width: 768px) {
    .char-section {
        flex-direction: row;      /* PC: 横並び */
        text-align: left;         /* デフォルトは左 */
        align-items: center;
        min-height: 350px;
        width: 100%;
        top: 0;
        left: 0;
    }
    .char-section:nth-of-type(even) {
        flex-direction: row-reverse; /* 偶数番目は左右反転 */
        text-align: right;           /* 偶数番目は右寄せ */
    }
}

.char-content{
    width: 100%;
}

@media (min-width: 768px) {
    .char-content {
        width: auto;
    }
}

.char-image {
    width: 80%;
    max-width: 300px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    /* PC: 奇数番目は右揃えに */
    .char-section:nth-of-type(odd) .char-image {
        justify-content: flex-end;
    }
    /* PC: 偶数番目は左揃えに */
    .char-section:nth-of-type(even) .char-image {
        justify-content: flex-start;
    }
}

.char-image img {
    width: 100%;
    height: auto;
}

/* miigo: width 70% */
.char-miigo .char-image img{
    width: 70%;
}


/* wanta, usapi: width 80% */
.char-wanta .char-image img,
.char-usapi .char-image img {
    width: 80%;
}

/* mike, tora, kashiwa: width 50% */
.char-mike .char-image img,
.char-tora .char-image img,
.char-kashiwa .char-image img {
    width: 50%;
}

/* teddy: width 100% */
.char-teddy .char-image img {
    width: 95%;
}

.char-name {
    font-size: 1.8rem;
    color: #333333;
    margin: 0 0 15px 0;
}

.char-desc {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.char-location {
    display: inline-flex;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    font-size: 0.9rem;
}

.loc-label {
    background: #c5c8d6;
    color: #fff;
    padding: 6px 15px;
}

.loc-value {
    padding: 6px 20px;
    background-color: #fff;
}

/* --- アニメーションの初期状態 --- */
.observe-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0.1s;
}

/* フェードイン実行時 */
.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 時間差ディレイ (PCのみ) */
@media (min-width: 768px) {
    .delay-1 { transition-delay: 0.3s; }
    .delay-2 { transition-delay: 0.5s; }
}


/* --- PCレイアウト設定 (768px以上) --- */
@media (min-width: 768px) {
    .char-section {
        flex-direction: row; /* 横並び */
        justify-content: space-around;
        text-align: left;
        margin-bottom: 120px;
        gap: 60px;
    }

    /* 偶数番目は左右反転 */
    .char-section:nth-child(even) {
        flex-direction: row-reverse;
    }

    .char-image {
        flex: 0 0 40%;
        max-width: 400px;
        margin-bottom: 0;
    }

    .char-content {
        flex: 0 0 50%;
    }

    .char-name {
        font-size: 2.2rem;
    }
}