* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

#game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 屏幕切换 */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 主菜单 */
#main-menu {
    text-align: center;
    padding-top: 100px;
}

#main-menu h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    background: linear-gradient(45deg, #e94560, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #888;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto 30px;
}

.high-score {
    color: #ffd700;
    font-size: 1.2em;
    margin-top: 20px;
}

.save-info {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-size: 0.9em;
}

.save-info p {
    margin: 0;
}

/* 按钮样式 */
button {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* 继续游戏按钮 - 金色（强调继续进度） */
#continue-game {
    background: linear-gradient(45deg, #ffd700, #ffb347);
    color: #1a1a2e;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

#continue-game:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
    animation: goldGlow 1.5s infinite;
}

@keyframes goldGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(255, 215, 0, 0.7); }
}

/* 开始游戏按钮 - 主红色（主要行动） */
#start-game {
    background: linear-gradient(45deg, #e94560, #ff6b6b);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

#start-game:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(233, 69, 96, 0.6);
}

/* 游戏统计按钮 - 蓝色（信息类） */
#view-stats {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

#view-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.6);
}

/* 清除进度按钮 - 危险红色 */
.btn-danger {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 职业选择 */
#class-select {
    text-align: center;
}

#class-select h2 {
    margin-bottom: 30px;
    font-size: 2em;
}

.class-list {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.class-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.class-card:hover,
.class-card.selected {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
    transform: translateY(-5px);
}

.class-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.class-card h3 {
    margin-bottom: 10px;
    color: #e94560;
}

.class-card p {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.class-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9em;
}

/* 地图界面 */
#map-screen {
    padding: 20px 0;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-info span {
    font-size: 1.1em;
}

.map-nodes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px 0;
    position: relative;
}

.map-row {
    display: flex;
    justify-content: center;
    gap: 40px; /* 从 50px 减小到 40px，适应 4 列布局 */
    position: relative;
}

/* 添加路径连线 */
.map-row {
    position: relative;
}

/* 动态生成的连线（SVG 不需要额外样式） */
.map-line {
    pointer-events: none;
    z-index: 1;
}

.map-info {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    text-align: center;
}

.path-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.path-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hint {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 5px;
}

.map-node {
    width: 80px; /* 从 90px 减小到 80px，适应 4 列布局 */
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 2.2em;
    position: relative;
    z-index: 2;
}

.map-node.battle {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.map-node.shop {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.map-node.rest {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.map-node.event {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.map-node.boss {
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    animation: pulse 2s infinite;
}

.map-node.elite {
    background: linear-gradient(135deg, #e74c3c, #ff6b6b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    border: 3px solid #ffd700;
}

/* 已完成节点 - 绿色边框 + 对勾 + 发光 */
.map-node.completed {
    border: 3px solid #2ecc71 !important;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5), inset 0 0 10px rgba(46, 204, 113, 0.2);
    filter: grayscale(0.3) brightness(0.9);
    position: relative;
    cursor: not-allowed;
    opacity: 1 !important;
}

.map-node.completed::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    color: #2ecc71;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(46, 204, 113, 0.8);
    z-index: 10;
}

/* 可用节点 - 金色脉冲发光动画 */
@keyframes availablePulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 35px rgba(255, 215, 0, 1), 0 0 50px rgba(255, 215, 0, 0.7);
        transform: scale(1.05);
    }
}

.map-node.available {
    border: 3px solid #ffd700 !important;
    animation: availablePulse 2s ease-in-out infinite;
    position: relative;
    z-index: 5;
}

.map-node.available::before {
    content: '▶';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffd700;
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.map-node.available:hover {
    transform: scale(1.12) !important;
    z-index: 10;
    animation: none;
    box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.8);
}

/* 锁定节点 - 完全灰化 + 锁图标 */
.map-node.locked {
    filter: grayscale(100%) brightness(0.4) !important;
    opacity: 0.25 !important;
    cursor: not-allowed;
    position: relative;
}

.map-node.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    z-index: 20;
    filter: grayscale(100%) opacity(0.5);
}

/* 事件节点在锁定时保持紫色调 */
.map-node.event.locked {
    filter: grayscale(0.5) brightness(0.5) !important;
}

.map-node.event.locked::after {
    filter: hue-rotate(240deg) opacity(0.5);
}

/* Boss 节点特殊效果 */
.map-node.boss.available {
    border: 4px solid #e74c3c !important;
    animation: bossPulse 1.5s ease-in-out infinite;
}

@keyframes bossPulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(231, 76, 60, 0.8), 0 0 40px rgba(231, 76, 60, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 50px rgba(231, 76, 60, 1), 0 0 70px rgba(231, 76, 60, 0.8);
        transform: scale(1.08);
    }
}

.map-node.boss.available::before {
    content: '👑';
}

/* 移除所有默认的竖直连线，只保留 SVG 动态生成的路径连线 */
.map-node::before {
    display: none;
}

/* Boss 节点不需要特殊处理，因为所有节点的::before 都已经隐藏 */
.map-node.boss::before {
    display: none;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(20px);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(233, 69, 96, 0.6), 0 4px 15px rgba(233, 69, 96, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(233, 69, 96, 0.9), 0 4px 15px rgba(233, 69, 96, 0.3);
    }
}

.node-label {
    font-size: 0.3em;
    margin-top: 5px;
    color: white;
}

/* 战斗界面 */
#battle-screen {
    padding: 10px 0;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.battle-area {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 20px;
}

/* 敌人区域 */
.enemy-area {
    display: flex;
    justify-content: center;
}

.enemy {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px 40px;
    text-align: center;
    border: 2px solid rgba(231, 76, 60, 0.5);
}

.enemy-sprite {
    font-size: 4em;
    margin-bottom: 10px;
}

.enemy-name {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #e74c3c;
}

.enemy-hp-bar {
    width: 150px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    transition: width 0.3s ease;
}

.enemy-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9em;
}

#enemy-intent {
    color: #f39c12;
}

/* 玩家区域 */
.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.player-avatar {
    font-size: 4em;
}

.player-stats {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 30px;
    border-radius: 10px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
}

.stat-icon {
    font-size: 1.3em;
}

/* 手牌区域 */
.hand-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.hand-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #888;
    font-size: 0.9em;
}

.hand-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.card {
    width: 110px;
    min-width: 110px;
    height: 150px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* 添加 title 属性支持悬停提示 */
    position: relative;
}

/* 卡牌悬停时显示完整描述的提示 */
.card:hover::after {
    content: attr(data-desc);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card.selected {
    border-color: #27ae60;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.6);
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(0.95);
}

/* 卡牌视觉增强 */
.card:hover {
    transform: translateY(-15px) scale(1.05);
    border-color: #e94560;
    box-shadow: 
        0 15px 40px rgba(233, 69, 96, 0.4),
        0 0 20px rgba(233, 69, 96, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.card.attack:hover {
    box-shadow: 0 15px 40px rgba(231, 76, 60, 0.5);
}

.card.defense:hover {
    box-shadow: 0 15px 40px rgba(52, 152, 219, 0.5);
}

.card.skill:hover {
    box-shadow: 0 15px 40px rgba(155, 89, 182, 0.5);
}

.card.unplayable {
    opacity: 0.4;
    filter: grayscale(0.7);
    cursor: not-allowed;
}

.card.unplayable:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* 卡牌出牌动画 */
@keyframes playCard {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(20deg);
        opacity: 0;
    }
}

.card.playing {
    animation: playCard 0.4s ease forwards;
}

/* 卡牌费用显示增强 */
.card-cost {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 
        0 2px 8px rgba(52, 152, 219, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.card-cost.energy-sufficient {
    animation: energyGlow 2s infinite;
}

@keyframes energyGlow {
    0%, 100% { box-shadow: 0 2px 8px rgba(52, 152, 219, 0.5); }
    50% { box-shadow: 0 2px 12px rgba(52, 152, 219, 0.8); }
}

.card.unplayable {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-cost {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.card-icon {
    font-size: 1.8em;
    margin: 8px 0 5px;
    flex-shrink: 0;
}

.card-name {
    font-size: 0.75em;
    font-weight: bold;
    margin-bottom: 3px;
    flex-shrink: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-desc {
    font-size: 0.65em;
    color: #aaa;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
    flex: 1;
    width: 100%;
    padding: 0 2px;
}

.card.attack {
    border-color: rgba(231, 76, 60, 0.5);
}

.card.defense {
    border-color: rgba(52, 152, 219, 0.5);
}

.card.skill {
    border-color: rgba(155, 89, 182, 0.5);
}

#end-turn {
    width: 100%;
}

/* 奖励界面 */
#reward-screen {
    text-align: center;
    padding: 40px 20px;
}

#reward-screen h2 {
    color: #27ae60;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.rewards {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.reward-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
}

.reward-section h3 {
    margin-bottom: 15px;
    color: #888;
}

.reward-gold {
    font-size: 2em;
    color: #ffd700;
}

.reward-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.reward-cards .card {
    cursor: pointer;
    flex-shrink: 0;
}

.reward-cards .card:hover {
    border-color: #27ae60;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.4);
}

.reward-relic {
    display: inline-block;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
}

/* 商店界面 */
#shop-screen {
    padding: 20px;
}

#shop-screen h2 {
    text-align: center;
    margin-bottom: 10px;
}

.shop-gold {
    text-align: center;
    font-size: 1.5em;
    color: #ffd700;
    margin-bottom: 30px;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.shop-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
}

.shop-section h3 {
    margin-bottom: 15px;
    color: #f39c12;
}

.shop-cards,
.shop-relics,
.shop-potions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 5px;
}

.shop-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shop-item .price {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f39c12;
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8em;
}

.shop-item .card {
    margin-bottom: 10px;
}

.relic-item {
    width: 80px;
    height: 80px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 2em;
}

.relic-item:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

.potion-item {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 0 0 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5em;
    position: relative;
}

.potion-item:hover {
    transform: translateY(-5px);
}

/* 休息处 */
#rest-screen {
    text-align: center;
    padding: 60px 20px;
}

#rest-screen h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.rest-desc {
    color: #888;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.rest-options {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.rest-options button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 40px;
}

.option-icon {
    font-size: 2em;
}

/* 事件界面 */
#event-screen {
    text-align: center;
    padding: 60px 20px;
}

#event-screen h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.event-sprite {
    font-size: 5em;
    margin-bottom: 20px;
}

#event-description {
    color: #ccc;
    font-size: 1.1em;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.event-choices {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.event-choices button {
    text-align: left;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.event-choices button:hover {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
}

.deck-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.deck-list .card {
    cursor: default;
    transform: scale(0.9);
}

.deck-list .card:hover {
    transform: scale(0.95);
}

.relics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 20px;
}

.relic-item-small {
    width: 80px;
    height: 80px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.relic-item-small:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

.relic-item-small .relic-name {
    font-size: 0.4em;
    margin-top: 5px;
    text-align: center;
    padding: 0 2px;
}

.relic-item-small .relic-desc {
    font-size: 0.25em;
    color: #ffd700;
    text-align: center;
    padding: 3px;
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #ffd700;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 100;
}

.relic-item-small:hover .relic-desc {
    display: block;
}

/* 游戏结束 */
#game-over {
    text-align: center;
    padding: 80px 20px;
}

#game-over h1 {
    font-size: 3em;
    margin-bottom: 30px;
}

#game-over h1.victory {
    color: #27ae60;
}

#game-over h1.defeat {
    color: #e74c3c;
}

.game-over-stats {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.game-over-stats p {
    margin: 10px 0;
    font-size: 1.2em;
}

.game-over-stats span {
    color: #e94560;
    font-weight: bold;
}

/* 伤害数字系统升级 */
.damage-number {
    position: absolute;
    color: #e74c3c;
    font-size: 1.5em;
    font-weight: bold;
    animation: floatUp 1s ease forwards;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.damage-number.critical {
    color: #ff6b6b;
    font-size: 2em;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    animation: floatUpCritical 1.2s ease forwards;
}

.heal-number.big {
    color: #2ecc71;
    font-size: 1.8em;
    text-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

@keyframes floatUpCritical {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.8);
        filter: blur(0px);
    }
    20% {
        transform: translateY(-10px) scale(1.2);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
        filter: blur(0px);
    }
}

/* 敌人受击反馈 */
@keyframes hitFlash {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5); 
        filter: brightness(1);
    }
    20% { 
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.9), 0 4px 15px rgba(231, 76, 60, 0.5); 
        filter: brightness(1.5);
    }
}

.enemy.hit {
    animation: hitFlash 0.3s ease;
}

.enemy.hit-small {
    animation: shake 0.3s ease;
}

.enemy.hit-medium {
    animation: shake 0.5s ease;
}

.enemy.hit-large {
    animation: shake-heavy 0.6s ease;
}

@keyframes shake-heavy {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-15px) rotate(-2deg); }
    35% { transform: translateX(15px) rotate(2deg); }
    55% { transform: translateX(-15px) rotate(-2deg); }
    75% { transform: translateX(15px) rotate(2deg); }
}

@keyframes hpDecrease {
    0% { 
        box-shadow: inset 0 0 0 rgba(231, 76, 60, 0); 
    }
    30% { 
        box-shadow: inset 0 0 40px rgba(231, 76, 60, 0.5); 
    }
    100% { 
        box-shadow: inset 0 0 0 rgba(231, 76, 60, 0); 
    }
}

.enemy.hp-decrease {
    animation: hpDecrease 0.5s ease;
}

/* 分层地牢背景系统 */
/* 第一层：废弃矿坑 - 灰蓝色调 */
#map-screen.floor-1 {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
}

.floor-1 .map-node.battle {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4);
}

/* 第二层：黑暗神殿 - 紫黑色调 */
#map-screen.floor-2 {
    background: linear-gradient(135deg, #2c1e4a 0%, #1a1a2e 50%, #2c1e4a 100%);
}

.floor-2 .map-node.battle {
    background: linear-gradient(135deg, #8e44ad, #6c3483);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.5);
}

.floor-2 .enemy {
    border-color: rgba(142, 68, 173, 0.6);
    box-shadow: 0 0 30px rgba(142, 68, 173, 0.3);
}

/* 第三层：龙巢深渊 - 红金色调 */
#map-screen.floor-3 {
    background: linear-gradient(135deg, #4a0404 0%, #2c0404 50%, #4a0404 100%);
}

.floor-3 .map-node.boss {
    background: linear-gradient(135deg, #c0392b, #8b0000);
    box-shadow: 0 0 40px rgba(192, 57, 43, 0.8), 0 4px 15px rgba(192, 57, 43, 0.5);
    animation: bossPulse 2s infinite;
}

.floor-3 .enemy {
    border-color: rgba(231, 76, 60, 0.8);
    box-shadow: 0 0 50px rgba(231, 76, 60, 0.4);
}

/* Boss 战特殊效果 */
@keyframes bossPulse {
    0%, 100% { 
        box-shadow: 0 0 40px rgba(192, 57, 43, 0.8), 0 4px 15px rgba(192, 57, 43, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 60px rgba(255, 69, 0, 1), 0 6px 20px rgba(255, 69, 0, 0.7);
        transform: scale(1.02);
    }
}

/* 战斗粒子背景 */
.battle-area {
    position: relative;
}

.battle-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(233, 69, 96, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, rgba(233, 69, 96, 0.1) 2px, transparent 2px);
    background-size: 100px 100px;
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes particleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

/* Boss 战特殊粒子 */
.floor-3 .battle-area::before {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(231, 76, 60, 0.2) 3px, transparent 3px),
        radial-gradient(circle at 60% 80%, rgba(255, 107, 107, 0.15) 2px, transparent 2px),
        radial-gradient(circle at 90% 20%, rgba(255, 215, 0, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: particleFloat 15s linear infinite;
}

/* 火花效果 */
.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: spark 1s ease forwards;
    pointer-events: none;
}

@keyframes spark {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

.heal-number {
    position: absolute;
    color: #27ae60;
    font-size: 1.5em;
    font-weight: bold;
    animation: floatUp 1s ease forwards;
    pointer-events: none;
}

.block-number {
    position: absolute;
    color: #3498db;
    font-size: 1.5em;
    font-weight: bold;
    animation: floatUp 1s ease forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 药水栏 */
.potion-bar {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.potion-slot {
    width: 40px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 0 0 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.potion-slot.filled {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-style: solid;
    border-color: #e74c3c;
}

.potion-slot:hover.filled {
    transform: scale(1.1);
}

/* 地图图例 */
.map-info {
    text-align: center;
    margin-bottom: 20px;
}

.map-info .legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.map-info .legend span {
    font-size: 0.9em;
    color: #888;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 15px;
}

.map-info .hint {
    color: #e94560;
    font-size: 0.95em;
    animation: pulse 2s infinite;
}

/* 浮动文字提示 */
.floating-text {
    position: absolute;
    font-size: 1.3em;
    font-weight: bold;
    animation: floatUp 1.5s ease forwards;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 响应式 */
@media (max-width: 600px) {
    .map-info .legend {
        gap: 10px;
    }
    
    .map-info .legend span {
        font-size: 0.8em;
        padding: 3px 8px;
    }
    
    .class-list {
        flex-direction: column;
        align-items: center;
    }
    
    .hand-cards {
        gap: 5px;
        padding: 0 5px;
    }
    
    .card {
        width: 85px;
        min-width: 85px;
        height: 120px;
        padding: 6px;
    }
    
    .card-icon {
        font-size: 1.5em;
        margin: 6px 0 4px;
    }
    
    .card-name {
        font-size: 0.7em;
        margin-bottom: 2px;
    }
    
    .card-desc {
        font-size: 0.6em;
        -webkit-line-clamp: 2;
    }
    
    .reward-cards {
        gap: 12px;
    }
    
    .shop-cards,
    .shop-relics,
    .shop-potions {
        gap: 10px;
    }
}
