/* ==================== TPA Combo Key System ==================== */

/* 基礎資源樣式 - 垂直佈局，按鍵在下方 */
.falling-resource {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px;
    width: auto;
    max-width: 230px;
    /* 確保不超出範圍 */
    overflow: visible;
}

/* 雙鍵連擊樣式 */
.falling-resource.double-combo {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: 3px solid #fbbf24;
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
}

.falling-resource.double-combo .resource-logo {
    border-color: #fbbf24;
}

/* 三鍵連擊樣式 */
.falling-resource.triple-combo {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: 3px solid #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.9);
}

.falling-resource.triple-combo .resource-logo {
    border-color: #a855f7;
}

/* Logo 容器樣式 - 固定寬度可容納 3 個按鍵 */
.resource-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #67e8f9;
    margin-bottom: 12px;
    position: relative;
    flex-shrink: 0;
    display: block;
}

/* 組合鍵顯示容器 - 在 logo 下方，不超出範圍 */
.combo-keys {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    /* 允許換行避免超出 */
    width: 100%;
    max-width: 200px;
    /* 與 logo 同寬 */
    margin-top: 0;
    position: relative;
    z-index: 10;
    /* 確保在最上層 */
}

/* 單個組合鍵樣式 */
.combo-key {
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-weight: bold;
    font-size: 1.3rem;
    transition: all 0.2s ease;
    min-width: 36px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    position: relative;
    z-index: 11;
    /* 比容器更高 */
}

/* 按鍵高亮狀態 */
.combo-key.pressed {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 1);
    border-color: #fff;
}

/* 加號分隔符 */
.combo-plus {
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0 2px;
    flex-shrink: 0;
}

/* Perfect 效果動畫 */
@keyframes perfectPulse {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.2);
        filter: brightness(1.5) drop-shadow(0 0 20px #fbbf24);
    }
}

.perfect-effect {
    animation: perfectPulse 0.5s ease-out;
}

/* Perfect 文字浮動動畫 */
@keyframes perfectFloat {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }
}

/* 組合鍵失敗效果 */
.combo-failed {
    animation: shakeFail 0.3s ease;
    filter: brightness(0.5);
}

@keyframes shakeFail {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* 單鍵樣式 */
.falling-resource.single-combo {
    background: linear-gradient(135deg, rgba(103, 232, 249, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    border: 2px solid #67e8f9;
    box-shadow: 0 0 15px rgba(103, 232, 249, 0.5);
}

/* 資源計時器 - 確保在最下方 */
.resource-timer {
    margin-top: 8px;
    width: 100%;
}