/* ============================================================
   reward.css — 全局激励反馈系统样式 v1.0
   所有样式使用 reward- 前缀，避免与各游戏样式冲突
   ============================================================ */

/* ===== 星星条（右上角固定） ===== */
.reward-star-bar {
    position: fixed;
    top: 8px;
    right: 12px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-size: 16px;
    font-weight: 700;
    color: #f59e0b;
    pointer-events: none;
    transition: transform 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.reward-star-icon {
    font-size: 18px;
    line-height: 1;
}

.reward-star-num {
    font-size: 16px;
    min-width: 16px;
    text-align: center;
}

/* 星星增加时跳动 */
@keyframes reward-star-pop-anim {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.reward-star-pop {
    animation: reward-star-pop-anim 0.35s ease;
}

/* ===== 全屏特效层 ===== */
.reward-effect-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

/* ===== 答对：星星粒子 ===== */
.reward-particle {
    position: absolute;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.8s ease-out;
    will-change: transform, opacity;
    pointer-events: none;
    line-height: 1;
}

/* ===== 浮动鼓励语 ===== */
.reward-float-text {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    font-size: 26px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.reward-float-text.correct {
    color: #f59e0b;
}

.reward-float-text.wrong {
    color: #64748b;
    font-size: 20px;
    font-weight: 600;
}

.reward-float-text.show {
    opacity: 1;
    transform: translate(-50%, -120%) scale(1);
}

.reward-float-text.hide {
    opacity: 0;
    transform: translate(-50%, -180%) scale(0.9);
    transition: all 0.3s ease-in;
}

/* ===== Combo 连击 ===== */
.reward-combo {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, 0) scale(0.3);
    opacity: 0;
    font-size: 28px;
    font-weight: 900;
    white-space: nowrap;
    color: #f97316;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.5),
                 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.reward-combo.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.reward-combo.hide {
    opacity: 0;
    transform: translate(-50%, -30px) scale(0.8);
    transition: all 0.4s ease-in;
}

/* ===== 答错：温柔摇晃 ===== */
@keyframes reward-shake-anim {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.reward-shake {
    animation: reward-shake-anim 0.4s ease-in-out;
}

/* ===== 通关：撒花碎片 ===== */
@keyframes reward-confetti-fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotate(720deg);
        opacity: 0;
    }
}

.reward-confetti {
    position: absolute;
    top: 0;
    border-radius: 2px;
    animation-name: reward-confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
    pointer-events: none;
}

/* ===== 通关/会话结束 弹窗 ===== */
.reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.reward-overlay.show {
    opacity: 1;
}

.reward-overlay.hide {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reward-popup {
    background: #ffffff;
    border-radius: 24px;
    padding: 36px 32px 28px;
    text-align: center;
    max-width: 320px;
    width: 85%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: scale(0.7);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reward-overlay.show .reward-popup {
    transform: scale(1);
}

.reward-overlay.hide .reward-popup {
    transform: scale(0.85);
    transition: transform 0.3s ease-in;
}

.reward-popup-emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 12px;
    animation: reward-bounce 0.6s ease;
}

@keyframes reward-bounce {
    0% { transform: scale(0) rotate(-20deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

.reward-popup-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 18px;
}

.reward-popup-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.reward-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.reward-stat-val {
    font-size: 24px;
    font-weight: 800;
    color: #3b82f6;
}

.reward-stat-label {
    font-size: 12px;
    color: #94a3b8;
}

.reward-popup-stars {
    font-size: 28px;
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 22px;
    animation: reward-star-glow 1s ease infinite alternate;
}

@keyframes reward-star-glow {
    from { text-shadow: 0 0 5px rgba(245, 158, 11, 0.3); }
    to { text-shadow: 0 0 20px rgba(245, 158, 11, 0.6); }
}

.reward-popup-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.reward-popup-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.reward-popup-btn:active {
    transform: translateY(0);
}
