/* 游戏界面样式 */

#game-view {
    padding: 10px;
    box-sizing: border-box;
}

#game-view.active {
    display: flex !important;
    flex-direction: column;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-panel);
    border: 2px solid var(--accent-gold);
    margin-bottom: 15px;
}

.team-info {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-gold);
}

.turn-info {
    font-size: 18px;
    color: var(--text-primary);
    text-align: center;
}

#turn-timer {
    animation: pulse 1s ease-in-out infinite;
}

#turn-timer.warning {
    color: var(--accent-red) !important;
    animation: pulse-fast 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-fast {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.game-board {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 15px;
    flex: 1;
    margin-bottom: 15px;
}

.team-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-card {
    background-color: rgba(0, 0, 0, 0.5); /* 50%透明度 */
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.player-card.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px var(--accent-gold);
}

.player-card.dead {
    opacity: 0.5;
    filter: grayscale(100%);
}

.player-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-card .avatar {
    width: 50px;
    height: 50px;
}

.player-card .nickname {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-gold);
}

.player-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.stat-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
    font-weight: bold;
}

.stat-progress {
    width: 100%;
    height: 8px;
    background-color: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.stat-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.stat-progress-bar.hp {
    background-color: #ff4444;
}

.stat-progress-bar.defense {
    background-color: #4444ff;
}

.stat-progress-bar.spirit {
    background-color: #44ff44;
}

.stat-progress-bar.sanity {
    background-color: #ffaa00;
}

.player-buffs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.buff-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

/* Buff图标图片 */
.buff-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* 激活状态的Buff */
.buff-icon.active {
    border-color: var(--buff-color);
    box-shadow: 0 0 15px var(--buff-color);
    animation: buff-glow 2s ease-in-out infinite;
}

.buff-icon.active .buff-icon-img {
    opacity: 1;
    filter: brightness(1.2) drop-shadow(0 0 5px var(--buff-color));
}

/* 未激活状态的Buff */
.buff-icon.inactive {
    border-color: rgba(128, 128, 128, 0.3);
    opacity: 0.4;
}

.buff-icon.inactive .buff-icon-img {
    filter: grayscale(100%) brightness(0.5);
}

/* Buff悬停效果 */
.buff-icon:hover {
    transform: scale(1.2);
    z-index: 10;
}

.buff-icon.active:hover {
    box-shadow: 0 0 20px var(--buff-color);
}

/* Buff提示框 */
.buff-icon::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: var(--bg-panel);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid var(--accent-gold);
    font-size: 12px;
    white-space: pre-line;
    min-width: 180px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.buff-icon:hover::after {
    opacity: 1;
}

/* Buff发光动画 */
@keyframes buff-glow {
    0%, 100% {
        box-shadow: 0 0 10px var(--buff-color);
    }
    50% {
        box-shadow: 0 0 20px var(--buff-color), 0 0 30px var(--buff-color);
    }
}

.game-center {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-log {
    background-color: var(--bg-panel);
    border: 2px solid var(--accent-gold);
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
}

.event-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: var(--bg-darker);
    border-left: 4px solid var(--accent-gold);
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 500;
}

.event-item.turn-start {
    background-color: rgba(212, 175, 55, 0.1);
    border-left-color: var(--accent-gold);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.event-item.attack {
    border-left-color: var(--accent-red);
    background-color: rgba(139, 0, 0, 0.1);
}

.event-item.defense {
    border-left-color: #4444ff;
    background-color: rgba(68, 68, 255, 0.1);
}

.event-item.damage {
    border-left-color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
    font-weight: bold;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hand-area {
    background-color: rgba(0, 0, 0, 0.5); /* 50%透明度 */
    border: 2px solid var(--accent-gold);
    padding: 20px;
    min-height: 280px;
    max-height: 350px;
    overflow-y: auto;
}

.hand-area h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    text-align: center;
}

.card-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    width: 120px;
    height: 180px;
    background-color: var(--bg-darker);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    /* 添加半透明遮罩层提升文字可读性 */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px var(--shadow-dark);
}

.card.selected {
    border-color: var(--accent-gold);
    transform: translateY(-15px);
}

.card.special {
    border-color: var(--accent-red);
    box-shadow: 0 0 15px var(--accent-red);
}

.card-power {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    color: var(--accent-gold);
    margin-bottom: 10px;
    /* 增强文字可视性 */
    text-shadow: 
        0 0 10px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 1),
        -1px -1px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
}

.card-element {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 5px;
    /* 增强文字可视性 */
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(0, 0, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 1),
        -1px -1px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
}

.card-level {
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: var(--text-primary);
    /* 增强文字可视性 */
    text-shadow: 
        0 0 6px rgba(0, 0, 0, 0.9),
        0 0 12px rgba(0, 0, 0, 0.8),
        2px 2px 3px rgba(0, 0, 0, 1),
        -1px -1px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
}

.card-name {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-red);
    margin-bottom: 10px;
}

.card-description {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

/* 卡牌详情提示 */
.card-tooltip {
    position: absolute;
    background-color: var(--bg-panel);
    border: 2px solid var(--accent-gold);
    padding: 15px;
    border-radius: 8px;
    z-index: 100;
    min-width: 200px;
    box-shadow: 0 4px 12px var(--shadow-dark);
    pointer-events: none;
}


/* 攻击模式样式 */
.player-card.attackable {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--accent-red);
    }
    50% {
        box-shadow: 0 0 30px var(--accent-red);
    }
}

.player-card.attackable:hover {
    transform: scale(1.05);
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px var(--accent-gold);
}

/* 游戏中心区域 */
.game-center {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 事件日志 */
.event-log {
    background-color: rgba(0, 0, 0, 0.3); /* 降低透明度，让背景壁纸更清晰 */
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    padding: 15px;
    height: 300px;
    overflow-y: scroll;
    overflow-x: hidden;
    backdrop-filter: blur(5px); /* 添加轻微模糊效果 */
}

/* 自定义滚动条 */
.event-log::-webkit-scrollbar {
    width: 8px;
}

.event-log::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.event-log::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

.event-log::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

.event-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent-gold);
    background: rgba(0, 0, 0, 0.2); /* 降低透明度 */
    border-radius: 4px;
    font-size: 14px;
    color: #ffffff; /* 白色文字 */
    font-weight: bold; /* 加粗 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* 添加文字阴影增强可读性 */
}

/* 游戏操作按钮区域 */
.game-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
