/* ===================================================
   电子鞭炮工具 - 样式文件
   =================================================== */

/* ---------- 整体容器 ---------- */
.efc-container {
    max-width: 680px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---------- 舞台区 ---------- */
.efc-stage-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #06060f;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    margin-bottom: 12px;
    cursor: pointer;
}

#efcCanvas {
    display: block;
    width: 100%;
    /* 高度由 JS 动态设置，不要用 CSS 固定，避免内部分辨率与显示大小不一致 */
}

/* 运行中状态：禁用点击光标 + 燃烧感发光 */
.efc-stage-wrap.running {
    cursor: default;
    box-shadow: 0 4px 28px rgba(220, 60, 0, 0.52), 0 0 0 1px rgba(255, 120, 0, 0.18);
}

/* ---------- 进度条（舞台底部） ---------- */
.efc-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #FF4400, #FFD700, #FF6600);
    border-radius: 0 2px 0 12px;
    display: none;
    transition: width 0.12s linear;
    pointer-events: none;
}

.efc-progress-bar.active {
    display: block;
}

/* ---------- 覆层（欢迎/庆祝） ---------- */
.efc-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.efc-overlay-content {
    text-align: center;
    user-select: none;
}

.efc-overlay-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 12px rgba(255, 60, 0, 0.7));
    animation: efcIconFloat 2.6s ease-in-out infinite;
}

@keyframes efcIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.efc-overlay-text {
    font-size: 14px;
    color: rgba(255, 220, 160, 0.8);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.efc-overlay-hint {
    font-size: 11px;
    color: rgba(255, 200, 120, 0.45);
    margin-top: 6px;
    letter-spacing: 0.03em;
    user-select: none;
}

/* 庆祝文字 */
.efc-celebrate {
    animation: efcCelebFadeIn 0.6s ease;
}

@keyframes efcCelebFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.efc-celebrate-text {
    font-size: 30px;
    font-weight: 700;
    color: #FFD700;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.9), 0 2px 6px rgba(0,0,0,0.7);
    margin-bottom: 6px;
    animation: efcCelebPulse 1.2s ease-in-out infinite;
}

@keyframes efcCelebPulse {
    0%, 100% { text-shadow: 0 0 20px rgba(255,215,0,0.9), 0 2px 6px rgba(0,0,0,0.7); }
    50%       { text-shadow: 0 0 32px rgba(255,120,0,1),   0 2px 6px rgba(0,0,0,0.7); }
}

/* ---------- 进度计数 ---------- */
.efc-counter {
    position: absolute;
    top: 10px;
    right: 12px;
    display: none;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 180, 60, 0.5);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #FFD080;
    letter-spacing: 0.03em;
    user-select: none;
    pointer-events: none;
}

.efc-counter-sep {
    margin: 0 2px;
    opacity: 0.6;
}

/* ---------- 控制区 ---------- */
.efc-controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: #fffaf7;
    border: 1px solid rgba(210, 110, 30, 0.15);
    border-radius: 10px;
    padding: 9px 12px 10px;
}

.efc-ctrl-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.efc-ctrl-label {
    font-size: 12px;
    font-weight: 600;
    color: #777;
    min-width: 30px;
    user-select: none;
    letter-spacing: 0.02em;
}

/* ---------- Chip 选择器 ---------- */
.efc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.efc-chip {
    padding: 4px 13px;
    border: 1.5px solid #dde3ec;
    border-radius: 14px;
    background: #f7f9fb;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
    user-select: none;
}

.efc-chip:hover {
    background: #fff4ec;
    border-color: #e06030;
    color: #c04020;
    transform: translateY(-1px);
}

.efc-chip.active {
    background: linear-gradient(135deg, #ff4a1a, #cc2200);
    border-color: #cc2200;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(200, 30, 0, 0.3);
}

.efc-chip:active {
    transform: scale(0.95);
}

.efc-chip:disabled,
.efc-chip.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 燃放中禁用数量选择 */
.efc-chips.running .efc-chip {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

.efc-chips.running .efc-chip.active {
    opacity: 0.55;
}

/* ---------- 操作按钮行 ---------- */
.efc-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 2px;
}

/* 快捷键提示 */
.efc-shortcut-hint {
    font-size: 0.78em;
    color: #bbb;
    opacity: 0.7;
    white-space: nowrap;
    user-select: none;
    transition: opacity 0.15s, transform 0.15s;
    cursor: default;
    margin-left: auto;
}

.efc-shortcut-hint:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* 音效切换按钮 */
.efc-sound-btn {
    padding: 7px 14px;
    border: 1.5px solid #dde3ec;
    border-radius: 8px;
    background: #f7f9fb;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.efc-sound-btn:hover {
    background: #eef3ff;
    border-color: #5590ff;
    color: #3366cc;
}

.efc-sound-btn.muted {
    color: #aaa;
    border-color: #e0e5ec;
    background: #f5f5f7;
}

/* 点燃按钮闲置脉冲光效 */
@keyframes efcIgniteIdle {
    0%, 100% { box-shadow: 0 3px 14px rgba(200, 30, 0, 0.45); }
    50%       { box-shadow: 0 4px 22px rgba(230, 70, 0, 0.70), 0 0 0 2px rgba(255, 110, 0, 0.14); }
}

/* 点燃按钮（主按钮） */
.efc-ignite-btn {
    padding: 7px 18px;
    background: linear-gradient(135deg, #ff4a1a, #cc1100);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 2px 10px rgba(200, 30, 0, 0.4);
    white-space: nowrap;
    user-select: none;
    animation: efcIgniteIdle 2.5s ease-in-out infinite;
}

.efc-ignite-btn:hover:not(:disabled) {
    opacity: 0.93;
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 6px 20px rgba(200, 30, 0, 0.55);
    animation: none;
}

.efc-ignite-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.efc-ignite-btn:disabled {
    background: linear-gradient(135deg, #e08070, #c06050);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
    animation: none;
}

/* 重置按钮 */
.efc-reset-btn {
    padding: 7px 14px;
    border: 1.5px solid #dde3ec;
    border-radius: 8px;
    background: #f7f9fb;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.efc-reset-btn:hover {
    background: #fff8e8;
    border-color: #e8b030;
    color: #a06010;
    transform: rotate(-15deg);
}

.efc-reset-btn:active {
    transform: rotate(-15deg) scale(0.95);
}

/* 全屏切换按钮 */
.efc-fullscreen-btn {
    padding: 7px 14px;
    border: 1.5px solid #dde3ec;
    border-radius: 8px;
    background: #f7f9fb;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.efc-fullscreen-btn:hover {
    background: #eef3ff;
    border-color: #5590ff;
    color: #3366cc;
    transform: scale(1.05);
}

.efc-fullscreen-btn.active {
    background: linear-gradient(135deg, #3366cc, #1a44aa);
    border-color: #1a44aa;
    color: #fff;
    font-weight: 600;
}

/* ---------- 全屏模式 ---------- */
.efc-container.fullscreen-mode {
    max-width: none;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #06060f;
    padding: 0;
}

.fullscreen-mode .efc-stage-wrap {
    flex: 1;
    border-radius: 0;
    margin-bottom: 0;
}

.fullscreen-mode #efcCanvas {
    width: 100% !important;
    height: 100% !important;
}

.fullscreen-mode .efc-controls {
    border-radius: 0;
    background: rgba(255, 250, 247, 0.95);
    border: none;
    border-top: 1px solid rgba(210, 110, 30, 0.2);
    padding: 12px 20px;
}

.fullscreen-mode .efc-counter {
    top: 20px;
    right: 24px;
    font-size: 14px;
    padding: 5px 14px;
}

.fullscreen-mode .efc-overlay-icon {
    font-size: 72px;
}

.fullscreen-mode .efc-overlay-text {
    font-size: 18px;
}

.fullscreen-mode .efc-celebrate-text {
    font-size: 48px;
}

/* ---------- Toast 通知 ---------- */
@keyframes efcToastIn {
    from { opacity: 0; transform: translateY(10px) translateX(-50%) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)  translateX(-50%) scale(1); }
}

@keyframes efcToastOut {
    from { opacity: 1; transform: translateY(0)  translateX(-50%) scale(1); }
    to   { opacity: 0; transform: translateY(8px) translateX(-50%) scale(0.95); }
}

.efc-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 22px;
    background: rgba(30, 10, 5, 0.92);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    cursor: pointer;
    display: none;
    white-space: nowrap;
    max-width: 300px;
    text-align: center;
    box-sizing: border-box;
    border-left: 3px solid transparent;
    transition: background 0.2s;
}

.efc-toast.success {
    background: rgba(5, 42, 12, 0.93);
    border-left-color: #52c41a;
    border-radius: 8px 20px 20px 8px;
}

.efc-toast.error {
    background: rgba(50, 5, 5, 0.93);
    border-left-color: #ff4d4f;
    border-radius: 8px 20px 20px 8px;
}

.efc-toast.show {
    display: block;
    animation: efcToastIn 0.2s ease forwards;
}

.efc-toast.hide {
    animation: efcToastOut 0.2s ease forwards;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .efc-shortcut-hint {
        display: none;
    }

    .efc-celebrate-text {
        font-size: 24px;
    }

    .efc-overlay-icon {
        font-size: 40px;
    }
}

@media (max-width: 400px) {
    .efc-action-row {
        flex-direction: column;
        align-items: stretch;
    }
}
