/* 道具系统样式 */

/* 道具工具栏 */
.item-toolbar {
    position: absolute;
    bottom: 100px;  /* 在步数计数器上方，留出足够空间 */
    right: -105px;  /* 与步数计数器对齐 */
    display: flex;
    flex-direction: column;
    align-items: center;  /* 居中对齐所有道具按钮 */
    gap: 10px;
    z-index: 100;
}

.item-button {
    width: 64px;
    height: 64px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.item-button:hover:not(.disabled) {
    transform: scale(1.1);
}

.item-button:active:not(.disabled) {
    transform: scale(0.95);
}

.item-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.item-button.selected {
    animation: itemPulse 1s ease-in-out infinite;
}

@keyframes itemPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1));
    }
}

.item-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* 炸弹和刷新道具尺寸为86x86，并保持居中对齐 */
#item-bomb .item-icon,
#item-refresh .item-icon {
    width: 86px;
    height: 86px;
}

#item-bomb .item-icon img,
#item-refresh .item-icon img {
    width: 86px;
    height: 86px;
}

#item-bomb,
#item-refresh {
    width: 86px;
    height: 86px;
}

.item-count {
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    bottom: 4px;
    right: 4px;
}

.item-count.zero {
    background: rgba(255, 0, 0, 0.7);
}

/* 道具使用通知 */
.item-used-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    animation: slideDownIn 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.95), rgba(33, 150, 243, 0.95));
    padding: 15px 25px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.item-used-notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.item-used-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-used-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-used-text {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

/* 时间暂停特效 */
.time-pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(100, 181, 246, 0.3);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: pulseOverlay 1s ease-in-out infinite;
}

@keyframes pulseOverlay {
    0%, 100% {
        background: rgba(100, 181, 246, 0.2);
    }
    50% {
        background: rgba(100, 181, 246, 0.4);
    }
}

.time-pause-text {
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: floatText 2s ease-in-out infinite;
}

@keyframes floatText {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 提示高亮效果 */
.hint-highlight {
    animation: hintPulse 0.5s ease-in-out 3;
    box-shadow: 0 0 0 4px rgba(255, 235, 59, 0.8) !important;
}

@keyframes hintPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(255, 235, 59, 0.8) !important;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 235, 59, 1) !important;
    }
}

/* 变换特效 */
.transform-effect {
    animation: transformSpin 0.5s ease-in-out;
}

@keyframes transformSpin {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

/* 道具仓库面板 */
.item-inventory-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.item-inventory-panel.active {
    display: flex;
}

.item-inventory-container {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 40, 0.95));
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

.item-inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.item-inventory-header h2 {
    font-size: 32px;
    margin: 0;
    background: linear-gradient(135deg, #64B5F6, #42A5F5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.item-inventory-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-inventory-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.item-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.item-inventory-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.item-inventory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.item-inventory-card.disabled {
    opacity: 0.5;
    filter: grayscale(1);
}

.item-inventory-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
    width: 64px;
    height: 64px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-inventory-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-inventory-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 8px;
}

.item-inventory-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.4;
}

.item-inventory-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.item-inventory-stock {
    font-size: 14px;
    color: #81C784;
    font-weight: bold;
}

.item-inventory-stock.zero {
    color: #E57373;
}

.item-inventory-usage {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* 道具使用说明 */
.item-help-text {
    background: rgba(255, 193, 7, 0.2);
    border-left: 4px solid #FFC107;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    color: #FFF9C4;
    font-size: 14px;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移动端道具栏样式已在 style.css 中定义 */
    /* 这里只保留道具面板的响应式样式 */

    .item-inventory-container {
        padding: 20px;
        width: 95%;
    }

    .item-inventory-header h2 {
        font-size: 24px;
    }

    .item-inventory-grid {
        grid-template-columns: 1fr;
    }

    .time-pause-text {
        font-size: 32px;
    }
}
