/* ========================================
   组件样式 - 卡片、按钮等UI组件
   ======================================== */

/* 主题切换按钮组 */
.theme-btn {
    transition: all 0.3s;
}

.theme-btn:hover {
    transform: scale(1.05);
}

/* 游戏信息文字样式 */
.game-info-title {
    font-size: 3.5rem;
    line-height: 1.3;
    text-shadow: 
        0 0 2px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(0, 0, 0, 0.95),
        0 0 20px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6);
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}

.game-info-description {
    font-size: 1.15rem;
    line-height: 1.6;
    text-shadow: 
        0 0 2px rgba(0, 0, 0, 0.85),
        0 0 8px rgba(0, 0, 0, 0.9),
        0 0 14px rgba(0, 0, 0, 0.7),
        0 1px 3px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

/* 配置面板样式 */
.config-panel {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-tab {
    transition: all 0.2s;
}

.config-tab.active {
    background: rgba(255, 255, 255, 0.2);
}

.config-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 粒子动画 */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

.night-particle {
    pointer-events: none;
}

/* 玩家卡片入场动画 */
.player-card-animate {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 玩家名称样式 */
.player-name {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* 角色徽章样式 */
.role-badge {
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.role-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px currentColor;
}

.role-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.role-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 投票徽章样式 */
.vote-badge {
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 已淘汰徽章 */
.dead-badge {
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

/* 头像容器样式 */
.avatar-container {
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.avatar-container:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* 统计栏样式 */
#statsBar {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 输入框焦点效果 */
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* 按钮点击效果 */
button:active {
    transform: scale(0.98);
}

/* 模态框背景模糊 */
#configModal,
#statsModal {
    backdrop-filter: blur(4px);
}

/* 角色标签样式 */
.role-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 淘汰玩家覆盖层 */
.dead-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 警长SVG星星徽章 */
.sheriff-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 20;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.9));
    animation: sheriffGlow 2s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s;
}

.sheriff-badge:hover {
    transform: scale(1.15);
}

@keyframes sheriffGlow {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1));
    }
}

/* 死亡标记 × */
.dead-mark {
    font-size: 3rem;
    color: #ef4444;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 40px rgba(239, 68, 68, 0.4);
    font-weight: bold;
    line-height: 1;
}

/* 发言板样式 */
.speech-board {
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    animation: fadeInUp 0.3s ease;
    max-width: 100%;
}

.speech-content {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 65vh;
    overflow-y: auto;
    font-size: 1.35rem;
    line-height: 1.8;
}

.speech-avatar {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* 投票公告栏样式 */
.voting-board {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 28px;
    animation: fadeInUp 0.3s ease;
    max-width: 100%;
}

.vote-record {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.vote-record:hover {
    background: rgba(255, 255, 255, 0.1);
}

.vote-arrow {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
}

/* 玩家卡片相对定位（用于放置警徽） */
.role-card {
    position: relative;
}

/* 阶段历史样式 */
#phaseHistoryContainer {
    min-width: 80px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .config-panel {
        max-width: 95vw;
    }
    
    #statsBar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #statsBar > div {
        flex: 1;
        min-width: 200px;
    }
}

/* ========================================
   视觉效果动画
   ======================================== */

/* 雪花飘落 */
@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(25vh) translateX(30px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(-20px) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(25px) rotate(270deg);
    }
    100% {
        transform: translateY(100vh) translateX(40px) rotate(360deg);
    }
}

/* 雨滴下落 */
@keyframes rainfall {
    0% {
        transform: translateY(0) scaleY(1);
    }
    50% {
        transform: translateY(50vh) scaleY(1.2);
    }
    100% {
        transform: translateY(100vh) scaleY(1);
    }
}

/* 星星闪烁 */
@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* 萤火虫漂浮 */
@keyframes fireflyFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    20% {
        transform: translate(40px, -30px) scale(1.2);
        opacity: 1;
    }
    40% {
        transform: translate(-30px, 40px) scale(0.9);
        opacity: 0.6;
    }
    60% {
        transform: translate(30px, 30px) scale(1.1);
        opacity: 0.9;
    }
    80% {
        transform: translate(-20px, -20px) scale(1);
        opacity: 0.7;
    }
}

/* 花瓣飘落 */
@keyframes petalFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) translateX(60px) rotate(180deg);
    }
    50% {
        transform: translateY(50vh) translateX(-40px) rotate(360deg);
    }
    75% {
        transform: translateY(75vh) translateX(50px) rotate(540deg);
    }
    100% {
        transform: translateY(100vh) translateX(80px) rotate(720deg);
        opacity: 0;
    }
}

/* 气泡上升 */
@keyframes bubbleRise {
    0% {
        transform: translateY(0) scale(1) translateX(0);
        opacity: 0.9;
    }
    25% {
        transform: translateY(-25vh) scale(1.1) translateX(15px);
    }
    50% {
        transform: translateY(-50vh) scale(1) translateX(-10px);
    }
    75% {
        transform: translateY(-75vh) scale(0.9) translateX(12px);
    }
    100% {
        transform: translateY(-100vh) scale(0.6) translateX(0);
        opacity: 0;
    }
}

/* 彩纸飘落 */
@keyframes confettiFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) translateX(40px) rotate(180deg);
    }
    50% {
        transform: translateY(50vh) translateX(-30px) rotate(360deg);
    }
    75% {
        transform: translateY(75vh) translateX(35px) rotate(540deg);
    }
    100% {
        transform: translateY(100vh) translateX(50px) rotate(720deg);
        opacity: 0;
    }
}

/* 矩阵下落 */
@keyframes matrixFall {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(100vh + 200px));
    }
}

/* 爱心上升 */
@keyframes heartFloat {
    0% {
        transform: translateY(0) scale(1) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(-25vh) scale(1.1) translateX(20px);
    }
    50% {
        transform: translateY(-50vh) scale(0.95) translateX(-15px);
    }
    75% {
        transform: translateY(-75vh) scale(1.05) translateX(18px);
    }
    100% {
        transform: translateY(-100vh) scale(0.6) translateX(0);
        opacity: 0;
    }
}

/* 波浪容器 */
.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    animation: waveMove linear infinite;
}

.wave svg {
    width: 100%;
    height: 100%;
}

.wave1 {
    animation-duration: 7s;
    opacity: 0.9;
    z-index: 4;
}

.wave2 {
    animation-duration: 9s;
    animation-direction: reverse;
    opacity: 0.7;
    z-index: 3;
    bottom: 10px;
}

.wave3 {
    animation-duration: 11s;
    opacity: 0.5;
    z-index: 2;
    bottom: 20px;
}

.wave4 {
    animation-duration: 13s;
    animation-direction: reverse;
    opacity: 0.4;
    z-index: 1;
    bottom: 30px;
}

@keyframes waveMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 效果开关按钮样式 */
.effect-toggle {
    transition: all 0.3s ease;
}

.effect-toggle.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.effect-toggle:hover {
    transform: scale(1.02);
}

/* ========================================
   新增 UI 组件样式
   ======================================== */

/* 事件公告 */
.event-announcement {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px 28px;
    animation: fadeInUp 0.3s ease;
}

.announce-content {
    text-align: center;
}

.announce-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

.announce-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    margin-bottom: 12px;
}

.announce-message {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.7;
}

/* 计时器 */
.timer-display {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px 28px;
    animation: fadeInUp 0.3s ease;
}

.timer-time {
    font-size: 3.5rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 6px;
}

.timer-progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.timer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
    border-radius: 3px;
    transition: width 1s linear;
    width: 100%;
}

.timer-btn {
    padding: 6px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    cursor: pointer;
}

.timer-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.timer-btn-stop {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.timer-btn-stop:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* 游戏日志列表 */
.game-log-list {
    scrollbar-width: thin;
}

.game-log-list::-webkit-scrollbar {
    width: 4px;
}

.game-log-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
