/* ============================================================
   格斗游戏风格 · 街机对战
   只替换CSS，HTML结构不变
   设计方向：街机格斗 / 角色选择 / 打击感
   ============================================================ */

/* 卡片容器 —— 格斗游戏对战面板 */
.topic_wrap {
    position: relative;
    /* 深红黑到暗紫的渐变，像格斗游戏对战背景 */
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 40, 0, 0.15) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 80%, rgba(200, 0, 80, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(80, 0, 40, 0.15) 0%, transparent 65%),
        linear-gradient(175deg, #0e0508 0%, #1a0a10 40%, #12060c 70%, #080304 100%);

    /* 火焰红 + 暗金双层边框，像格斗游戏的UI框 */
    border: 2px solid #ff3020;
    box-shadow:
        inset 0 0 40px rgba(255, 40, 0, 0.08),
        inset 0 0 100px rgba(0, 0, 0, 0.85);
    margin: 0 auto;
    transition: all 0.3s ease;
    perspective: 1000px;
}

/* 标题 —— 格斗游戏标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 10px;
    /* 超粗黑体，像街机格斗游戏的标题 */
    font-family: 'Impact', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-style: italic;
    color: #f0f0f0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(255, 60, 20, 0.8),
        0 0 20px rgba(255, 40, 0, 0.4),
        3px 3px 0 #1a0808,
        4px 4px 0 #b08020,
        0 2px 4px rgba(0, 0, 0, 0.9);
    /* 底部火焰红线 */
    padding-bottom: 8px;
    border-bottom: 3px solid #ff3020;
    position: relative;
    transform: skewX(-6deg);
    animation: fight-title-pulse 1.8s ease-in-out infinite;
}

/* 标题下方的金色装饰线，像冠军腰带 */
.topic_wrap .title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffd040, #ffe880, #ffd040, transparent);
    opacity: 0.9;
    box-shadow: 0 0 12px rgba(255, 208, 64, 0.7);
}

@keyframes fight-title-pulse {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(255, 60, 20, 0.8),
            0 0 20px rgba(255, 40, 0, 0.4),
            3px 3px 0 #1a0808,
            4px 4px 0 #b08020,
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
    50% {
        text-shadow:
            0 0 14px rgba(255, 80, 40, 1),
            0 0 30px rgba(255, 40, 0, 0.6),
            3px 3px 0 #1a0808,
            4px 4px 0 #b08020,
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
}

/* 打字机容器 */
.typewriter-container {
    width: fit-content;
    margin: 0 auto;
    position: relative;
}

/* 顶部装饰 —— 血条/能量条纹理 */
.typewriter-container::before {
    content: '';
    display: block;
    height: 6px;
    /* 红黄渐变，像血条 */
    background: linear-gradient(90deg,
        #ff2020 0%,
        #ff4020 25%,
        #ff8020 50%,
        #ffd040 75%,
        #ffe880 100%);
    margin-bottom: 10px;
    border-radius: 2px;
    opacity: 0.9;
    box-shadow:
        0 0 10px rgba(255, 60, 20, 0.6),
        0 0 20px rgba(255, 160, 20, 0.3);
    border: 1px solid #1a0808;
}

/* 打字机核心 —— 格斗游戏对话文字 */
.typewriter {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    /* 超粗黑体，打击感 */
    font-family: 'Impact', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-style: italic;
    color: #f0f0f0;
    text-shadow:
        0 0 5px rgba(255, 60, 20, 0.7),
        0 0 15px rgba(255, 40, 0, 0.35),
        2px 2px 0 #1a0808,
        0 2px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid #ff3020; /* 火焰红光标 */
    width: 0;
    transform: skewX(-4deg);

    animation:
        typing 2.5s steps(10, end) forwards,
        blink-caret 0.5s step-end infinite,
        fight-flicker 3s ease-in-out infinite;
}

/* 打字动画 */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* 光标闪烁 —— 火焰红 */
@keyframes blink-caret {
    from, to { border-right-color: transparent; }
    50% { border-right-color: #ff3020; }
}

/* 打击闪烁 —— 像格斗游戏的hitstop */
@keyframes fight-flicker {
    0%, 100% {
        opacity: 1;
    }
    2% { opacity: 0.75; }
    4% { opacity: 1; }
    48% { opacity: 1; }
    49% { opacity: 0.7; }
    50% { opacity: 1; }
    51% { opacity: 0.85; }
    52% { opacity: 1; }
    84% { opacity: 1; }
    85% { opacity: 0.8; }
    86% { opacity: 1; }
}

/* 伪元素 —— 右上角"ROUND 3"回合标识 */
.topic_wrap::before {
    content: 'ROUND 3';
    position: absolute;
    top: 10px;
    right: 16px;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #ffd040;
    transform: skewX(-6deg);
    pointer-events: none;
    z-index: 0;
    border: 2px solid #b08020;
    padding: 2px 8px;
    background: rgba(14, 5, 8, 0.85);
    box-shadow:
        0 0 10px rgba(255, 208, 64, 0.3),
        inset 0 0 10px rgba(255, 208, 64, 0.1);
    text-shadow: 0 0 8px rgba(255, 208, 64, 0.9);
}

/* 伪元素 —— 左下角"FIGHT!"状态 */
.topic_wrap::after {
    content: 'FIGHT! · K.O.';
    position: absolute;
    bottom: 10px;
    left: 16px;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-style: italic;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: rgba(255, 60, 20, 0.6);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 8px rgba(255, 60, 20, 0.7);
    animation: fight-blink 1.2s step-end infinite;
}

@keyframes fight-blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* 确保内容在伪元素之上 */
.topic_wrap > * {
    position: relative;
    z-index: 1;
}