/* ========================================
   練習頁 - 道具欄
   ======================================== */

/* 道具袋按鈕（收起狀態） */
.item-bag-btn {
    position: absolute;
    bottom: 20px;
    right: 0px;
    width: 55px;
    height: 55px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.item-bag-btn:hover {
    transform: scale(1.1);
}

.item-bag-btn img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

/* 道具數量徽章 */
.item-bag-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: #c41e3a;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* 道具選單（展開狀態） */
.item-menu {
    position: absolute;
    bottom: 80px;
    right: 0px;
    background: rgba(30, 20, 10, 0.95);
    border: 2px solid #d4a574;
    border-radius: 12px;
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 101;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: menu-appear 0.2s ease-out;
}

.item-menu.show {
    display: flex;
}

@keyframes menu-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 道具項目 */
.item-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.item-menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.item-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.item-menu-item.disabled:hover {
    background: rgba(255, 255, 255, 0.1);
}

.item-menu-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.item-menu-info {
    flex: 1;
}

.item-menu-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
}

.item-menu-count {
    color: #aaa;
    font-size: 0.75rem;
}

/* 沒有道具時的提示 */
.item-menu-empty {
    color: #888;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px 10px;
}

.item-menu-empty a {
    color: #fbbf24;
    text-decoration: none;
}

.item-menu-empty a:hover {
    text-decoration: underline;
}

/* 道具選單項目啟用狀態 */
.item-menu-item.active {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #ffd700;
}

.item-menu-item.active .item-menu-count {
    color: #ffd700;
}

/* 守護中圖示 */
.shield-indicator {
    position: absolute;
    top: 20px;
    right: -50px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 180, 0, 0.9));
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: shield-glow 2s ease-in-out infinite;
    z-index: 100;
}

.shield-indicator img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.shield-indicator span {
    color: #5d3a00;
    font-size: 0.8rem;
    font-weight: bold;
}

@keyframes shield-glow {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(255, 215, 0, 0.8); }
}

/* ========================================
   御守離開確認對話框
   ======================================== */

.leave-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.leave-confirm-dialog {
    background: linear-gradient(135deg, #fffef5 0%, #fff8e1 100%);
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.leave-confirm-avatar {
    width: 120px;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
}

.leave-confirm-content {
    text-align: center;
}

.leave-confirm-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #5d3a00;
    margin-bottom: 8px;
}

.leave-confirm-message {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

.leave-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.leave-confirm-cancel {
    padding: 10px 24px;
    background: linear-gradient(135deg, #ffd700, #ffb300);
    border: none;
    border-radius: 8px;
    color: #5d3a00;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.leave-confirm-cancel:hover {
    transform: scale(1.05);
}

.leave-confirm-ok {
    padding: 10px 24px;
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    transition: background 0.2s;
}

.leave-confirm-ok:hover {
    background: #d0d0d0;
}

/* 響應式 */
@media (max-width: 768px) {
    .item-bag-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
    
    .item-bag-btn img {
        width: 28px;
        height: 28px;
    }
    
    .item-menu {
        bottom: 70px;
        right: 15px;
    }
    
    .item-menu-item {
        min-width: 130px;
    }
}
