/**
 * Live2D看板娘ウィジェット スタイル
 */

/* ウィジェットコンテナ - モバイルでは非表示 */
#live2d-widget {
    /*position: fixed;*/
    bottom: -60px; /* キャラクターの頭が見えるように調整 */
    z-index: 999;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

/* 読み込み中のプレースホルダー */
#live2d-widget.loading {
    opacity: 0.7;
}

#live2d-widget.loaded {
    opacity: 1;
}

/* モバイルでは完全に非表示 */
@media (max-width: 768px) {
    #live2d-widget {
        display: none !important;
        visibility: hidden !important;
    }
}

/* 右下配置 */
.live2d-widget-right {
    right: 0;
}

/* 左下配置 */
.live2d-widget-left {
    left: 0;
}

/* キャンバス */
#live2d {
    pointer-events: auto;
    cursor: pointer;
}

/* メッセージボックス - モバイルでは非表示 */
.live2d-message {
    position: fixed;
    bottom: 220px; /* キャラクターの位置に合わせて調整 */
    right: 20px;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 12px 18px;
    max-width: 300px;
    min-width: 200px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

/* モバイルでは完全に非表示 */
@media (max-width: 768px) {
    .live2d-message {
        display: none !important;
        visibility: hidden !important;
    }
}

/* 左下配置の場合 */
.live2d-message.position-left {
    right: auto;
    left: 20px;
}

/* 吹き出しの三角形（下向き） */
.live2d-message::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #667eea;
}

.live2d-message.position-left::after {
    right: auto;
    left: 50px;
}

/* メッセージ内のHTML要素 */
.live2d-message strong {
    color: #667eea;
    font-weight: 600;
}

.live2d-message br {
    margin: 4px 0;
}

.live2d-message::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #667eea;
}

/* ツールボックス */
.live2d-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.live2d-tool {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.live2d-tool:hover {
    background: #667eea;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* モバイル対応 - 完全に非表示（上記で設定済み） */

/* アニメーション */
@keyframes live2d-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#live2d-widget {
    animation: live2d-fade-in 0.5s ease-out;
}

/* ローディング状態 */
#live2d.loading {
    opacity: 0.5;
}

/* ホバー効果 */
#live2d:hover {
    filter: brightness(1.1);
}

/* ツールチップ */
.live2d-tool[title]:hover::before {
    content: attr(title);
    position: absolute;
    right: 45px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
}

/* 非表示状態 */
#live2d-widget.hidden {
    display: none;
}

/* 表示復帰ボタン - モバイルでは非表示 */
#live2d-show-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 998;
    display: none;
}

/* モバイルでは完全に非表示 */
@media (max-width: 768px) {
    #live2d-show-button {
        display: none !important;
        visibility: hidden !important;
    }
}

#live2d-show-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#live2d-show-button.visible {
    display: block;
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    #live2d-widget,
    .live2d-tool,
    .live2d-message {
        animation: none;
        transition: none;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .live2d-message {
        background: rgba(40, 40, 40, 0.95);
        color: #fff;
        border-color: #764ba2;
    }
    
    .live2d-message::after {
        border-top-color: #764ba2;
    }
    
    .live2d-tool {
        background: rgba(40, 40, 40, 0.9);
        border-color: #764ba2;
    }
    
    .live2d-tool:hover {
        background: #764ba2;
    }
}
