/* --- レイアウト設定 --- */
#launcher-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    /*ボタンサイズの幅・高さ*/
    /*変更した際は、連動して変更する必要がある項目有*/
    width: 100px;
    height: 100px;
    background-color: transparent !important;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: all 0.3s ease;
    /* WebSite X5などの環境で不要な文字が表示されるのを防ぐ */
    font-size: 0;
}

#launcher-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#launcher-button:hover {
    transform: scale(1.1);
}

/* --- 吹き出し設定 --- */
.speech-bubble {
    position: absolute;
    /*ボタンサイズや位置を調整した際に、連動して必要な調整項目(right)*/
    right: 110px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 15px;
    background-color: #fff;
    color: #333;
    /*吹き出し内の文字の大きさ設定*/
    font-size: 16px;
    line-height: 1.5;
    white-space: nowrap;
    /* テキストを横並びに強制する */
    width: max-content;
    /* 文字数に合わせて幅を確保する */
    text-align: left;
    border-radius: 8px;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* 移動アニメーションを削除し、フェードのみにする */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* WebSite X5などの外部CSS干渉を防ぐためのリセット */
    margin: 0 !important;
    height: auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.speech-bubble::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 10px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;

    /* リセット */
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* メッセージ切り替え */
#msg-initial {
    opacity: 1;
    visibility: visible;
}

#msg-hover {
    opacity: 0;
    visibility: hidden;
    /* transform: translateY(-50%);  <-- 親の .speech-bubble で指定済みなので不要、上書きもしない */
}

#launcher-button:hover #msg-initial {
    opacity: 0;
    visibility: hidden;
}

#launcher-button:hover #msg-hover {
    opacity: 1;
    visibility: visible;
}

/* ウィジェット表示エリア */
#streamone-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 480px;
    aspect-ratio: 16 / 9;
    max-width: 90vw;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: none;
    z-index: 1000000;
}

#streamone-widget-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* モバイルレスポンシブ */
@media screen and (max-width: 600px) {
    .speech-bubble {
        /*吹き出し位置を調整した際に、連動して必要な調整項目(right)*/
        right: 0 !important;
        /* ボタンの右端に合わせる */
        top: -12px;
        transform: translateY(-100%);
        /* テキストを横並びに強制するが、改行は許可する */
        white-space: normal !important;
        width: max-content !important;
        max-width: 90vw !important;
        /* 画面幅を超えないように */
        /* 画面幅を超えないように */
    }

    .speech-bubble::after {
        right: 45px;
        /* ボタン(100px)の中央(50px)付近を指すように調整: 50px - 矢印半幅(10px) + 微調整 */
        top: 100%;
        border-width: 10px 10px 0 10px;
        border-color: #fff transparent transparent transparent;
    }
}