/* ============================================
   XPuzzle Game - 道具条 & 使用反馈
   ============================================ */

/* ---------- 道具条 ---------- */
.props-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 0 auto 12px;
    padding: 8px 12px;
    background: rgba(180, 100, 30, .08);
    border: 1px solid rgba(180, 120, 60, .28);
    border-radius: 12px;
    max-width: 400px;
}

.props-bar.locked {
    opacity: .5;
    pointer-events: none;
}

.prop-btn {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0;
    background: linear-gradient(135deg, #fef3c7 0%, #fbeacb 100%);
    border: 1px solid rgba(180, 120, 60, .5);
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    box-shadow: 0 3px 10px rgba(180, 100, 30, .2);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.prop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200, 130, 40, .4);
}

.prop-btn:active {
    transform: translateY(0) scale(.96);
}

.prop-btn.disabled {
    filter: grayscale(.9) brightness(.9);
    cursor: not-allowed;
    box-shadow: none;
}

.prop-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

.prop-btn .prop-icon {
    font-size: 1.5em;
    line-height: 1;
    pointer-events: none;
}

.prop-btn .prop-name {
    font-size: .68em;
    color: #7c3a10;
    font-weight: 700;
    letter-spacing: .5px;
    margin-top: 2px;
    line-height: 1;
    pointer-events: none;
}

.prop-btn .prop-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: linear-gradient(135deg, #c9184a, #ff4d6d);
    color: #fff;
    font-size: .75em;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.25);
    pointer-events: none;
}

.prop-btn.disabled .prop-count {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

/* ---------- 画布容器(用来定位预览 overlay) ---------- */
.canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- 预览 overlay(全图透视) ---------- */
.preview-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    pointer-events: none;
    opacity: 0;
    transition: opacity .4s ease;
    box-shadow: 0 0 20px 4px rgba(255, 220, 100, .8);
    border: 2px solid rgba(255, 200, 60, .9);
    display: none;
}

.preview-overlay.show {
    display: block;
    opacity: 1;
    animation: previewPulse 1.6s ease-in-out infinite;
}

.preview-overlay.fading {
    opacity: 0;
    animation: none;
}

@keyframes previewPulse {
    0%, 100% { box-shadow: 0 0 20px 4px rgba(255, 220, 100, .7); }
    50%      { box-shadow: 0 0 32px 8px rgba(255, 200, 60, .95); }
}

/* ---------- 加时飘字 ---------- */
.time-float {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translate(-50%, 0);
    font-weight: 900;
    color: #16a34a;
    font-size: 1.2em;
    text-shadow: 0 2px 4px rgba(0,0,0,.25);
    pointer-events: none;
    opacity: 0;
    animation: timeFloatUp 1.2s ease-out forwards;
    white-space: nowrap;
}

@keyframes timeFloatUp {
    0%   { transform: translate(-50%, 10px); opacity: 0; }
    20%  { transform: translate(-50%, 0);    opacity: 1; }
    100% { transform: translate(-50%, -28px); opacity: 0; }
}

/* 倒计时数字加时闪光 */
#timer.time-flash {
    animation: timeFlash .6s ease-out;
}
@keyframes timeFlash {
    0%   { color: #16a34a; text-shadow: 0 0 8px rgba(22, 163, 74, .8); }
    100% { color: inherit; text-shadow: none; }
}

/* ---------- 道具获得提示(完成页/游戏内) ---------- */
.props-gain-tip {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px auto 0;
    flex-wrap: wrap;
    font-size: .9em;
    color: #7c3a10;
    font-weight: 700;
}

.props-gain-tip .gain-item {
    background: rgba(255, 220, 100, .5);
    border: 1px solid rgba(180, 120, 60, .5);
    border-radius: 8px;
    padding: 4px 10px;
    animation: floatUp .4s ease-out;
}

/* ---------- Toast ---------- */
.game-toast {
    position: fixed;
    left: 50%;
    top: 30%;
    transform: translate(-50%, 0);
    background: rgba(60, 30, 10, .9);
    color: #fff8ec;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    animation: toastInOut 1.6s ease-out forwards;
    pointer-events: none;
}

@keyframes toastInOut {
    0%   { opacity: 0; transform: translate(-50%, 10px); }
    15%  { opacity: 1; transform: translate(-50%, 0); }
    80%  { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -12px); }
}

/* ---------- 响应式(移动端) ---------- */
@media (max-width: 640px) {
    .props-bar {
        gap: 10px;
        padding: 6px 8px;
        margin-bottom: 8px;
        border-radius: 10px;
    }
    .prop-btn {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }
    .prop-btn .prop-icon { font-size: 1.25em; }
    .prop-btn .prop-name {
        font-size: .58em;
        margin-top: 1px;
    }
    .prop-btn .prop-count {
        min-width: 18px;
        height: 18px;
        font-size: .68em;
        top: -5px;
        right: -5px;
    }
}

/* 特小屏 */
@media (max-width: 380px) {
    .props-bar { gap: 8px; padding: 4px 6px; }
    .prop-btn { width: 42px; height: 42px; }
    .prop-btn .prop-icon { font-size: 1.1em; }
}