* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b3d 50%, #1a0a2e 100%);
    min-height: 100vh;
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    color: #f0d78c;
    overflow-x: hidden;
}
.game-title {
    text-align: center;
    padding: 20px;
    font-size: 28px;
    color: #d4af37;
    text-shadow: 0 0 20px rgba(212,175,55,0.5);
    letter-spacing: 4px;
}
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    gap: 10px;
}
.top-bar {
    display: flex;
    gap: 20px;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #d4af37;
    flex-wrap: wrap;
    justify-content: center;
}
.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.stat-bar {
    width: 100px;
    height: 16px;
    background: #333;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d4af37;
}
.stat-fill {
    height: 100%;
    transition: width 0.3s;
}
.hp-fill { background: linear-gradient(90deg, #8b0000, #ff4444); }
.food-fill { background: linear-gradient(90deg, #8b4513, #ffa500); }
.shield-fill { background: linear-gradient(90deg, #4a90d9, #87ceeb); }
.energy-pips {
    display: flex;
    gap: 4px;
}
.energy-pip {
    width: 20px;
    height: 20px;
    background: #333;
    border: 1px solid #d4af37;
    border-radius: 50%;
}
.energy-pip.active {
    background: radial-gradient(circle, #ffd700, #ff8c00);
    box-shadow: 0 0 10px rgba(255,215,0,0.8);
}
.main-area {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.map-container {
    position: relative;
}
#gameCanvas {
    border: 3px solid #d4af37;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(212,175,55,0.3);
    cursor: pointer;
}
.info-panel {
    background: rgba(0,0,0,0.6);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    min-width: 300px;
    max-width: 350px;
}
.info-title {
    color: #d4af37;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 8px;
}
.event-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
    min-height: 60px;
}
.enemy-info {
    text-align: center;
    margin: 10px 0;
}
.enemy-hp-bar {
    width: 200px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    margin: 10px auto;
    overflow: hidden;
    border: 1px solid #8b0000;
}
.enemy-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b0000, #ff4444);
    transition: width 0.3s;
}
.cards-container {
    margin-top: 15px;
}
.cards-title {
    color: #d4af37;
    font-size: 14px;
    margin-bottom: 8px;
}
.cards-hand {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.card {
    width: 70px;
    height: 100px;
    background: linear-gradient(145deg, #2d1b3d, #1a0a2e);
    border: 2px solid #d4af37;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: all 0.2s;
    position: relative;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(212,175,55,0.5);
}
.card.attack { border-color: #ff4444; }
.card.defense { border-color: #4a90d9; }
.card.skill { border-color: #44ff44; }
.card-name {
    font-size: 11px;
    color: #f0d78c;
    text-align: center;
    margin-bottom: 3px;
}
.card-cost {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle, #ffd700, #ff8c00);
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
}
.card-effect {
    font-size: 9px;
    color: #aaa;
    text-align: center;
}
.buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, #d4af37, #b8960c);
    border: none;
    border-radius: 5px;
    color: #1a0a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(212,175,55,0.5);
}
.btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
}
.btn.danger { background: linear-gradient(145deg, #8b0000, #5a0000); color: #fff; }
.btn.success { background: linear-gradient(145deg, #228b22, #1a6b1a); color: #fff; }
.log-container {
    background: rgba(0,0,0,0.4);
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 12px;
}
.log-entry { margin: 3px 0; padding: 2px 0; border-bottom: 1px solid #333; }
.log-damage { color: #ff4444; }
.log-heal { color: #44ff44; }
.log-gold { color: #ffd700; }
.log-event { color: #d4af37; }
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: linear-gradient(145deg, #2d1b3d, #1a0a2e);
    border: 3px solid #d4af37;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
}
.modal h2 { color: #d4af37; margin-bottom: 20px; font-size: 24px; }
.modal p { margin: 10px 0; line-height: 1.6; }
.hidden { display: none !important; }
.status-effects {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    justify-content: center;
}
.status-icon {
    padding: 3px 8px;
    background: rgba(139,0,0,0.5);
    border-radius: 5px;
    font-size: 11px;
    border: 1px solid #8b0000;
}
.status-icon.poison { background: rgba(0,100,0,0.5); border-color: #006400; }
.status-icon.weak { background: rgba(128,128,128,0.5); border-color: #808080; }
.status-icon.shield { background: rgba(74,144,217,0.5); border-color: #4a90d9; }
.gold-display { color: #ffd700; font-size: 16px; }
