/* ============================================================
   多人同屏游戏风格 · 派对大乱斗
   只替换CSS，HTML结构不变
   设计方向：分屏对战 / 玩家色块 / 派对游戏
   ============================================================ */

/* 卡片容器 —— 多人同屏对战面板 */
.topic_wrap {
    position: relative;
    /* 深紫蓝到炭黑渐变，像派对游戏的分屏背景 */
    background:
        radial-gradient(ellipse at 10% 15%, rgba(255, 60, 120, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 15%, rgba(60, 180, 255, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 10% 85%, rgba(255, 200, 40, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 85%, rgba(60, 255, 140, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(40, 40, 70, 0.5) 0%, transparent 70%),
        linear-gradient(175deg, #0a0a18 0%, #141428 40%, #0e0e1e 70%, #050510 100%);

    /* 四色玩家边框：粉、蓝、黄、绿 */
    border: 3px solid #ff3c78;
    box-shadow:
        inset 0 0 50px rgba(255, 60, 120, 0.05),
        inset 0 0 120px rgba(0, 0, 0, 0.8);
    margin: 0 auto;
    transition: all 0.35s ease;
    perspective: 1000px;
    /* 背景中隐约的像素点 */
    background-image:
        radial-gradient(circle at 10% 10%, rgba(255, 60, 120, 0.06) 0%, transparent 15%),
        radial-gradient(circle at 90% 10%, rgba(60, 180, 255, 0.06) 0%, transparent 15%),
        radial-gradient(circle at 10% 90%, rgba(255, 200, 40, 0.06) 0%, transparent 15%),
        radial-gradient(circle at 90% 90%, rgba(60, 255, 140, 0.06) 0%, transparent 15%);
}

/* 标题 —— 多人同屏标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    /* 圆润粗体，像派对游戏标题 */
    font-family: 'Nunito', 'Quicksand', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #ffffff;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(255, 60, 120, 0.7),
        0 0 20px rgba(60, 180, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.9);
    /* 底部四色渐变线 */
    padding-bottom: 8px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #ff3c78, #3cb4ff, #ffc828, #3cff8c) 1;
    position: relative;
    animation: party-title-glow 3s ease-in-out infinite;
}

@keyframes party-title-glow {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(255, 60, 120, 0.7),
            0 0 20px rgba(60, 180, 255, 0.4),
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
    50% {
        text-shadow:
            0 0 12px rgba(255, 80, 140, 0.9),
            0 0 30px rgba(60, 200, 255, 0.6),
            0 0 50px rgba(255, 200, 40, 0.3),
            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,
        #ff3c78 0%,
        #ff3c78 25%,
        #3cb4ff 25%,
        #3cb4ff 50%,
        #ffc828 50%,
        #ffc828 75%,
        #3cff8c 75%,
        #3cff8c 100%);
    margin-bottom: 10px;
    border-radius: 3px;
    opacity: 0.9;
    box-shadow:
        0 0 8px rgba(255, 60, 120, 0.4),
        0 0 16px rgba(60, 180, 255, 0.3),
        0 0 24px rgba(60, 255, 140, 0.2);
    animation: party-energy-flow 3s linear infinite;
    background-size: 200% 100%;
}

@keyframes party-energy-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* 打字机核心 —— 多人同屏文字 */
.typewriter {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    /* 圆润粗体，像派对游戏字体 */
    font-family: 'Nunito', 'Quicksand', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #ffffff;
    text-shadow:
        0 0 5px rgba(255, 60, 120, 0.6),
        0 0 15px rgba(60, 180, 255, 0.3),
        0 0 30px rgba(60, 255, 140, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid #ff3c78; /* 粉红光标，像玩家1 */
    width: 0;

    animation:
        typing 2.5s steps(10, end) forwards,
        blink-caret 0.6s step-end infinite,
        party-flicker 4s 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: #ff3c78; }
}

/* 派对闪烁 —— 像屏幕上的彩色光效 */
@keyframes party-flicker {
    0%, 100% {
        opacity: 1;
    }
    2% { opacity: 0.85; }
    4% { opacity: 1; }
    52% { opacity: 1; }
    53% { opacity: 0.8; }
    54% { opacity: 1; }
}

/* 伪元素 —— 右上角"4 PLAYERS"玩家标识 */
.topic_wrap::before {
    content: '4 PLAYERS';
    position: absolute;
    top: 10px;
    right: 16px;
    font-family: 'Nunito', 'Quicksand', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #ffc828;
    pointer-events: none;
    z-index: 0;
    border: 2px solid rgba(255, 200, 40, 0.6);
    padding: 2px 8px;
    background: rgba(10, 10, 24, 0.85);
    border-radius: 12px;
    box-shadow:
        0 0 10px rgba(255, 200, 40, 0.3),
        inset 0 0 10px rgba(255, 200, 40, 0.1);
    text-shadow: 0 0 8px rgba(255, 200, 40, 0.8);
}

/* 伪元素 —— 左下角"PRESS START"开始提示 */
.topic_wrap::after {
    content: 'PRESS START';
    position: absolute;
    bottom: 10px;
    left: 16px;
    font-family: 'Nunito', 'Quicksand', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(60, 255, 140, 0.6);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 8px rgba(60, 255, 140, 0.5);
    animation: party-blink 1.5s step-end infinite;
}

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

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