.npc-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin: 30px auto;
    max-width: 600px;
    padding: 0 15px;
    box-sizing: border-box;
}

.npc-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.npc-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ec4899;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    background: #1e293b;
}

.npc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.npc-name-tag {
    margin-top: -10px;
    background: #ec4899;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    z-index: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.npc-bubble {
    position: relative;
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid #475569;
    border-radius: 16px;
    padding: 16px 20px;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.7;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.npc-bubble::before {
    content: "";
    position: absolute;
    top: 20px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(30, 41, 59, 0.92);
}

.npc-bubble::after {
    content: "";
    position: absolute;
    top: 20px;
    left: -9px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #475569;
    z-index: -1;
}

.npc-bubble a {
    color: #f9a8d4;
    text-decoration: underline;
    font-weight: bold;
}

.npc-container.is-hidden {
    display: none;
}

.npc-container.is-visible {
    display: flex;
}

/* トップページ用：上マージンのみ詰める（下は他セクションと統一） */
.npc-container--top {
    margin-top: 10px;
}

/* スマホ：縦積みレイアウトに切り替え */
@media (max-width: 599px) {
    .npc-container {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    /* アイコンと名前タグを横並びに（LINEのトーク画面風） */
    .npc-profile {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    /* 縦ずらし（オーバーラップ）を解除 */
    .npc-name-tag {
        margin-top: 0;
    }

    /* 吹き出しの左向き尻尾を上向きに切り替え */
    .npc-bubble::before {
        top: -8px;
        left: 20px;
        border-top: none;
        border-bottom: 8px solid rgba(30, 41, 59, 0.92);
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
    }

    .npc-bubble::after {
        top: -9px;
        left: 20px;
        border-top: none;
        border-bottom: 8px solid #475569;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
    }

    .npc-bubble {
        padding: 14px 16px;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 768px) {
    .npc-avatar {
        width: 70px;
        height: 70px;
    }

    .npc-bubble {
        font-size: 1rem;
        padding: 20px 25px;
    }

    .npc-bubble::before,
    .npc-bubble::after {
        top: 25px;
    }
}
