/* ============================================================
   手柄游戏风格 · 主机UI
   只替换CSS，HTML结构不变
   设计方向：主机手柄 / 圆润按键 / 客厅游戏
   ============================================================ */

/* 卡片容器 —— 主机游戏面板 */
.topic_wrap {
    position: relative;
    /* 深灰蓝到炭黑的渐变，像主机UI的深色主题 */
    background:
        radial-gradient(ellipse at 20% 15%, rgba(100, 180, 255, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 85%, rgba(80, 255, 160, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(40, 50, 70, 0.5) 0%, transparent 70%),
        linear-gradient(175deg, #14181f 0%, #1e242e 40%, #181c24 70%, #0e1016 100%);

    /* 圆润的蓝绿渐变边框，像手柄的彩色按键 */
    border: 3px solid transparent;
    background-clip: padding-box;
    box-shadow:
        inset 0 0 40px rgba(100, 180, 255, 0.05),
        inset 0 0 100px rgba(0, 0, 0, 0.7);
    margin: 0 auto;
    transition: all 0.35s ease;
    perspective: 1000px;
}

/* 标题 —— 主机游戏标题 */
.topic_wrap .title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    /* 圆润无衬线，像主机UI字体 */
    font-family: 'Nunito', 'Quicksand', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #e8f0f8;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(100, 180, 255, 0.5),
        0 0 20px rgba(100, 180, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.9);
    /* 底部蓝绿渐变线，像手柄的灯条 */
    padding-bottom: 8px;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, transparent, #4a90d9, #4ad98a, #4a90d9, transparent) 1;
    position: relative;
    animation: pad-title-glow 3s ease-in-out infinite;
}

@keyframes pad-title-glow {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(100, 180, 255, 0.5),
            0 0 20px rgba(100, 180, 255, 0.25),
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
    50% {
        text-shadow:
            0 0 12px rgba(120, 200, 255, 0.7),
            0 0 30px rgba(100, 180, 255, 0.4),
            0 0 50px rgba(80, 255, 160, 0.2),
            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: 5px;
    /* 蓝绿渐变，像手柄的彩色按键 */
    background: linear-gradient(90deg,
        #4a90d9 0%,
        #4ad98a 33%,
        #d94a90 66%,
        #d9d94a 100%);
    margin-bottom: 10px;
    border-radius: 4px;
    opacity: 0.9;
    box-shadow:
        0 0 8px rgba(100, 180, 255, 0.4),
        0 0 16px rgba(80, 255, 160, 0.3);
    background-size: 200% 100%;
    animation: pad-energy-flow 3s linear infinite;
}

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

/* 打字机核心 —— 主机游戏对话文字 */
.typewriter {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    /* 圆润无衬线，像主机UI字体 */
    font-family: 'Nunito', 'Quicksand', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #e8f0f8;
    text-shadow:
        0 0 5px rgba(100, 180, 255, 0.5),
        0 0 15px rgba(100, 180, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid #4a90d9; /* 蓝色光标，像手柄的A键 */
    width: 0;

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

/* 主机UI闪烁 —— 像手柄的呼吸灯 */
@keyframes pad-flicker {
    0%, 100% { opacity: 1; }
    2% { opacity: 0.85; }
    4% { opacity: 1; }
    52% { opacity: 1; }
    53% { opacity: 0.8; }
    54% { opacity: 1; }
}

/* 伪元素 —— 右上角"PLAYER 1"玩家标识 */
.topic_wrap::before {
    content: 'PLAYER 1';
    position: absolute;
    top: 10px;
    right: 16px;
    font-family: 'Nunito', 'Quicksand', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #4a90d9;
    pointer-events: none;
    z-index: 0;
    border: 1px solid rgba(74, 144, 217, 0.5);
    padding: 2px 8px;
    background: rgba(14, 16, 22, 0.85);
    border-radius: 12px;
    box-shadow:
        0 0 10px rgba(74, 144, 217, 0.25),
        inset 0 0 10px rgba(74, 144, 217, 0.1);
    text-shadow: 0 0 8px rgba(74, 144, 217, 0.8);
}

/* 伪元素 —— 左下角"PRESS A"按键提示 */
.topic_wrap::after {
    content: 'PRESS A · CONTINUE';
    position: absolute;
    bottom: 10px;
    left: 16px;
    font-family: 'Nunito', 'Quicksand', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: rgba(74, 217, 138, 0.6);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 6px rgba(74, 217, 138, 0.5);
    animation: pad-blink 2s step-end infinite;
}

@keyframes pad-blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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