/* dvonn-tutorial.css - 纯 CSS 驱动的 DVONN 教学动效与弹窗布局 */

.dvonn-tutorial-card {
    max-width: 380px;
    width: 92vw;
    max-height: 85vh;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dvonn-tutorial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    line-height: 1;
}

/* 纵向滚动容器与极细滚动条 */
.dvonn-tutorial-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-right: 6px;
}

.dvonn-tutorial-body::-webkit-scrollbar {
    width: 4px;
}
.dvonn-tutorial-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* 规则原子卡片 */
.rule-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rule-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text, #0f172a);
}

.rule-text {
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
}

.rule-text strong {
    color: var(--text, #0f172a);
}

.rule-anim-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 4px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ====================================================
   流畅 SVG 循环动效 (3.2s ~ 3.6s 叙事节奏)
   ==================================================== */

/* --- 1. 开局布局：先放火种，再填棋子 --- */
.anim-d0-dvonn { animation: d0Drop 3.0s infinite; }
.anim-d0-p1    { animation: d0Drop 3.0s 0.5s infinite; }
.anim-d0-p2    { animation: d0Drop 3.0s 1.0s infinite; }

@keyframes d0Drop {
    0% { transform: scale(1.6); opacity: 0; }
    20%, 80% { transform: scale(1); opacity: 1; }
    92%, 100% { opacity: 0; }
}

/* --- 2. 高度定步：2层跳2格，压顶覆盖 --- */
/* 起跳节点（2层叠）沿抛物线跳跃 140px（跨过 1 格），盖在目标上 */
.anim-d1-jump-stack {
    animation: d1Jump 3.4s cubic-bezier(0.3, 0.9, 0.4, 1) infinite;
}
/* 目标节点原本是单层蓝子，被压后显示总数 3 */
.anim-d1-target-badge {
    transform-origin: 210px 38px;
    animation: d1Merged 3.4s ease infinite;
}

@keyframes d1Jump {
    0%, 20% { transform: translate(0, 0) scale(1); opacity: 1; }
    38%     { transform: translate(70px, -18px) scale(1.15); } /* 跃起弧顶 */
    52%, 82%{ transform: translate(140px, 0) scale(1); opacity: 1; } /* 落地压顶 */
    92%, 100%{ transform: translate(140px, 0); opacity: 0; }
}

@keyframes d1Merged {
    0%, 50% { opacity: 0; transform: scale(0.5); }
    54%, 82% { opacity: 1; transform: scale(1); }
    92%, 100% { opacity: 0; }
}

/* --- 3. 火种断连：中间棋子移走，孤立棋叠蒸发 --- */
/* 桥梁棋子滑开 */
.anim-d2-bridge {
    animation: d2Bridge 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
/* 孤立端受惊闪烁并淡出消除 */
.anim-d2-isolated {
    transform-origin: 210px 38px;
    animation: d2Disappear 3.6s ease infinite;
}
/* 断连警示虚线框 */
.anim-d2-alert {
    transform-origin: 210px 38px;
    animation: d2AlertBox 3.6s ease infinite;
}

@keyframes d2Bridge {
    0%, 20% { transform: translateY(0); opacity: 1; }
    38%, 80% { transform: translateY(28px); opacity: 0.3; } /* 移开断开连接 */
    92%, 100% { opacity: 0; }
}

@keyframes d2AlertBox {
    0%, 35% { opacity: 0; transform: scale(0.8); }
    42%, 55% { opacity: 1; transform: scale(1.1); stroke: #ef4444; }
    65%, 100% { opacity: 0; }
}

@keyframes d2Disappear {
    0%, 45% { opacity: 1; transform: scale(1); }
    55% { transform: scale(1.15); opacity: 0.7; }
    65%, 85% { opacity: 0; transform: scale(0.2); } /* 断连消除 */
    95%, 100% { opacity: 1; }
}

/* --- 4. 堆顶计分：顶端颜色独占整叠得分 --- */
.anim-d3-glow-orange {
    transform-origin: 90px 38px;
    animation: d3Pulse 2.8s ease-in-out infinite;
}
.anim-d3-glow-blue {
    transform-origin: 190px 38px;
    animation: d3Pulse 2.8s 0.7s ease-in-out infinite;
}

@keyframes d3Pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
    50%      { transform: scale(1.08); filter: drop-shadow(0 0 4px rgba(0,0,0,0.25)); }
}