* { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            height: 100vh;
            color: #fff;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .game-container { 
            width: 100vw; 
            height: 100vh; 
            display: flex; 
            flex-direction: column; 
            padding: 5px 10px;
            box-sizing: border-box;
            overflow: hidden;
        }
        }
        h1 { 
            text-align: center; font-size: 1.2em; margin-bottom: 5px; line-height: 1.2;
            background: linear-gradient(135deg, #e94560, #ff6b6b, #ffd700);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            background-clip: text;
            filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.5));
            animation: titleShimmer 3s infinite;
        }
        @keyframes titleShimmer {
            0%, 100% { filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.5)); }
            50% { filter: drop-shadow(0 0 20px rgba(233, 69, 96, 0.8)); }
        }

        .player-status {
            display: flex; justify-content: space-between; align-items: center;
            padding: 4px 8px; border-radius: 10px; margin-bottom: 4px; gap: 8px;
            background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px);
            font-size: 0.75em;
            flex-wrap: wrap;
        }
        .player-status.enemy { background: rgba(233, 69, 96, 0.15); border: 1px solid rgba(233, 69, 96, 0.4); }
        .player-status.player { background: rgba(76, 201, 240, 0.15); border: 1px solid rgba(76, 201, 240, 0.4); }
        .status-item { display: flex; align-items: center; gap: 4px; font-size: 0.75em; }
        .status-icon { font-size: 1.1em; }
        .health-bar, .shield-bar { height: 10px; background: #222; border-radius: 5px; overflow: hidden; min-width: 60px; }
        .health-fill { height: 100%; background: linear-gradient(90deg, #e94560, #ff6b6b); transition: width 0.3s; }
        .health-fill.hp-high { background: linear-gradient(90deg, #4cc9f0, #72efdd); }
        .health-fill.hp-mid { background: linear-gradient(90deg, #ffd700, #ffb347); }
        .health-fill.hp-low { background: linear-gradient(90deg, #e94560, #ff6b6b); animation: pulseHealth 0.5s infinite; }
        @keyframes pulseHealth { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
        .shield-fill { height: 100%; background: linear-gradient(90deg, #4cc9f0, #72efdd); transition: width 0.3s; }
        .health-num { font-size: 0.85em; font-weight: bold; }
        .buffs-container { display: flex; gap: 3px; margin-left: 6px; }
        .buff-icon { font-size: 1em; }

        /* ===== 法力水晶 ===== */
        .mana-container {
            display: flex; align-items: center; gap: 3px; margin-left: 6px;
        }
        .mana-crystals {
            display: flex; gap: 2px;
        }
        .mana-crystal {
            width: 14px; height: 14px; border-radius: 50%;
            border: 1px solid rgba(100, 149, 237, 0.5);
            transition: all 0.3s; flex-shrink: 0;
        }
        .mana-crystal.filled {
            background: radial-gradient(circle at 30% 30%, #87ceeb, #4169e1);
            box-shadow: 0 0 6px rgba(65, 105, 225, 0.6);
        }
        .mana-crystal.empty {
            background: rgba(255,255,255,0.08);
        }
        .mana-text {
            font-size: 0.8em; color: #87ceeb; font-weight: bold; margin-left: 2px;
        }

        .game-info { text-align: center; padding: 4px; background: rgba(255, 255, 255, 0.05); border-radius: 8px; margin-bottom: 4px; }
        .turn-badge { font-size: 0.85em; color: #ffd700; margin-bottom: 2px; }
        .turn-indicator { font-size: 0.9em; font-weight: bold; color: #ffd700; }
        .turn-timer { font-size:1.2em; font-weight:bold; color:#4cc9f0; margin-left:10px; display:inline-block; min-width: 30px; text-align: center; }
        .turn-timer.warning { color:#e94560; animation:pulse 0.5s infinite; }
        .combo-display { font-size: 0.85em; margin-top: 2px; min-height: 1.2em; line-height: 1.4; }
        .combo-display.active { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.5); animation: comboPulse 0.5s infinite; }
        .combo-display .combo-bonus { color: #ff6b6b; font-weight: bold; }
        .combo-display .combo-hint { color: #888; font-size: 0.85em; }
        @keyframes comboPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
        .ai-thinking { text-align: center; padding: 8px; background: rgba(233, 69, 96, 0.2); border-radius: 8px; margin: 8px 0; animation: pulse 1s infinite; display: none; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        .game-log { margin-top: 4px; font-size: 0.78em; color: #aaa; max-height: 60px; overflow-y: auto; text-align: left; padding: 4px; background: rgba(0,0,0,0.2); border-radius: 5px; }

        /* ===== 效果面板 ===== */
        .effects-panel {
            margin-top: 4px; padding: 6px; background: rgba(123, 44, 191, 0.15);
            border: 1px solid rgba(123, 44, 191, 0.4); border-radius: 6px;
            display: none;
        }
        .effects-panel.show { display: block; animation: fadeIn 0.5s ease-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
        .effects-title { font-size: 0.8em; color: #b388ff; margin-bottom: 4px; font-weight: bold; }
        .effects-content { display: flex; flex-wrap: wrap; gap: 4px; }
        .effect-item {
            display: flex; align-items: center; gap: 3px; padding: 2px 6px;
            background: rgba(123, 44, 191, 0.25); border-radius: 10px; font-size: 0.75em;
        }
        .effect-item.buff { border: 1px solid rgba(76, 201, 240, 0.5); }
        .effect-item.debuff { border: 1px solid rgba(233, 69, 96, 0.5); }
        .effect-turns { color: #ffd700; font-weight: bold; }

        /* ===== 合成模态框 ===== */
        .craft-modal {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.8); display: flex; align-items: center;
            justify-content: center; z-index: 3000;
        }
        .craft-modal.hidden { display: none; }
        .craft-modal-content {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid rgba(255,215,0,0.5); border-radius: 16px;
            width: 90%; max-width: 500px; padding: 20px; box-shadow: 0 0 40px rgba(255,215,0,0.3);
        }
        .craft-modal-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 15px; font-size: 1.2em; color: #ffd700; font-weight: bold;
        }
        .craft-modal-close {
            background: none; border: none; color: #fff; font-size: 1.5em; cursor: pointer;
        }
        .craft-modal-body p { color: #aaa; margin-bottom: 15px; font-size: 0.9em; }
        .craft-preview { min-height: 100px; display: flex; justify-content: center; align-items: center; }
        .craft-modal-footer { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }

        /* ===== Hearthstone Style Layout ===== */
        .game-layout {
            display: flex;
            flex-direction: column;
            height: 100%;
            width: 100%;
            justify-content: space-between;
            align-items: center;
        }
        .enemy-zone {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }
        .battlefield-zone {
            flex: 1;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            perspective: 1000px;
        }
        .player-zone {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding-bottom: 10px;
        }

        /* Refined Battlefield Table Look */
        .battlefield {
            width: 95%;
            max-width: 1200px;
            height: 240px;
            background: radial-gradient(circle, rgba(60,40,30,0.8) 0%, rgba(30,20,10,0.9) 100%);
            border: 15px solid #5d4037;
            box-shadow: inset 0 0 60px #000, 0 15px 40px rgba(0,0,0,0.8);
            border-radius: 80px / 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            padding: 0 40px;
            gap: 20px;
        }
        .game-guide {
            font-size: 0.8em; color: #aaa; margin: 4px 0; font-style: italic; text-align: center;
        }

        .played-cards-container {
            flex: 1;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 8px;
            height: 140px;
            overflow-x: auto;
            overflow-y: hidden;
        }

        .played-card {
            width: 80px; height: 120px;
            background: rgba(255,255,255,0.1);
            border: 2px solid rgba(255,255,255,0.3);
            border-radius: 8px;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            font-size: 0.7em; text-align: center;
            position: relative; transition: all 0.3s;
        }
        .played-card.skipped {
            background: rgba(255, 165, 0, 0.1);
            border: 2px dashed rgba(255, 165, 0, 0.5);
            color: #ffa500;
            font-weight: bold;
        }
        .played-card.card-back {
            background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
            border: 2px solid rgba(255, 255, 255, 0.2);
        }

        .played-card img { width: 40px; height: 40px; margin-bottom: 5px; object-fit: contain; }
        .played-card .card-name { font-weight: bold; color: #fff; }
        .played-card .card-val { color: #ffd700; font-weight: bold; }
            background: rgba(0, 0, 0, 0.2); border-radius: 30px 30px 0 0; padding: 20px;
        }

        /* AI Selection Page Enhancements */
        .identity-select-overlay {
            position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
            background: radial-gradient(circle, #2c3e50 0%, #000000 100%);
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            z-index: 3000; padding: 40px;
            animation: fadeInOverlay 0.5s ease-out;
        }
        .identity-cards {
            display: flex; gap: 30px; justify-content: center; align-items: stretch;
            margin-bottom: 40px;
        }
        .identity-card {
            width: 260px; height: 400px; border-radius: 20px; padding: 30px;
            cursor: pointer; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex; flex-direction: column; align-items: center; justify-content: space-between;
            background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(15px);
            border: 4px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 15px 35px rgba(0,0,0,0.5);
        }
        .identity-card:hover {
            transform: translateY(-20px) scale(1.05);
            background: rgba(255, 255, 255, 0.12);
        }

        .card {
            width: 130px; height: 190px; border-radius: 7px; padding: 8px; cursor: pointer;
            transition: all 0.2s; display: flex; flex-direction: column; align-items: center;
            position: relative; background: rgba(255, 255, 255, 0.95); color: #333; box-shadow: 0 3px 10px rgba(0,0,0,0.3);
        }
        .card:hover { transform: translateY(-10px) scale(1.05); box-shadow: 0 8px 25px rgba(233, 69, 96, 0.5); z-index: 10; }
        .card.disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(50%); }
        .card.disabled:hover { transform: none; }
        .card.selected { border:2px solid #4cc9f0 !important; transform:scale(1.05); box-shadow: 0 0 20px rgba(76,201,240,0.6); }
        .card.attack { border: 3px solid #e94560; }
        .card.recovery { border: 3px solid #4cc9f0; }
        .card.defense { border: 3px solid #ffd700; }
        .card.effect { border: 3px solid #7b2cbf; }
        /* 稀有度边框 */
        .card.rarity-common {} 
        .card.rarity-uncommon { box-shadow: 0 3px 10px rgba(0,0,0,0.3), 0 0 8px rgba(76,175,80,0.4); }
        .card.rarity-rare { box-shadow: 0 3px 10px rgba(0,0,0,0.3), 0 0 8px rgba(33,150,243,0.5); }
        .card.rarity-epic { box-shadow: 0 3px 10px rgba(0,0,0,0.3), 0 0 10px rgba(156,39,176,0.5); }
        .card.rarity-legendary { box-shadow: 0 3px 10px rgba(0,0,0,0.3), 0 0 12px rgba(255,215,0,0.6); }
        .card-icon {
            width: 64px; height: 64px; margin-bottom: 4px;
            object-fit: contain; image-rendering: auto;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
        }
        .card-icon-emoji { font-size: 2.6em; margin-bottom: 2px; }
        .card-name { font-size: 1em; font-weight: bold; text-align: center; margin-bottom: 2px; }
        .card-desc { font-size: 0.8em; text-align: center; color: #666; line-height: 1.15; }
        .card-value { position: absolute; bottom: 6px; right: 6px; font-size: 1.2em; font-weight: bold; color: #e94560; }
        /* 法力消耗显示 */
        .card-mana {
            position: absolute; top: 6px; left: 6px;
            width: 24px; height: 24px; border-radius: 50%;
            background: radial-gradient(circle at 30% 30%, #87ceeb, #4169e1);
            color: #fff; font-size: 0.85em; font-weight: bold;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 0 6px rgba(65,105,225,0.5);
        }
        .card-mana.free { background: radial-gradient(circle at 30% 30%, #aaa, #666); }
        /* 稀有度标记 */
        .card-rarity-dot {
            position: absolute; top: 6px; right: 6px;
            width: 10px; height: 10px; border-radius: 50%;
        }
        .rarity-common .card-rarity-dot { background: #999; }
        .rarity-uncommon .card-rarity-dot { background: #4caf50; }
        .rarity-rare .card-rarity-dot { background: #2196f3; }
        .rarity-epic .card-rarity-dot { background: #9c27b0; }
        .rarity-legendary .card-rarity-dot { background: #ffd700; box-shadow: 0 0 4px #ffd700; }

        .btn { padding: 8px 20px; font-size: 0.9em; border: none; border-radius: 16px; cursor: pointer; transition: all 0.3s; font-weight: bold; }
        .btn-primary { background: linear-gradient(135deg, #e94560, #ff6b6b); color: #fff; }
        .btn-primary:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(233, 69, 96, 0.5); }
        .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
        .btn-secondary { background: rgba(255, 255, 255, 0.1); color: #fff; border: 2px solid rgba(255, 255, 255, 0.3); }
        .btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }
        .btn-craft { background: linear-gradient(135deg, #ffd700, #ffb347); color: #333; box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
        .btn-craft:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(255, 215, 0, 0.8); }
        .btn-craft:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
        .card.golden { border:3px solid gold !important; box-shadow:0 0 15px gold; }
        .card.golden .card-name { color: #b8860b !important; text-shadow: 0 0 2px #fff; }
        .game-controls { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }

        .hand {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            width: 100%;
            margin: 5px 0;
            flex-wrap: wrap;
            perspective: 1000px;
        }

        .deck-area { display: flex; justify-content: space-between; margin-top: 10px; padding: 8px 16px; background: rgba(0, 0, 0, 0.2); border-radius: 8px; font-size: 0.85em; }

        .game-over { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; }
        .game-over.show { display: flex; }
        .game-over h2 { font-size: 3em; margin-bottom: 30px; text-shadow: 0 0 20px currentColor; }
        .game-over.victory h2 { color: #4cc9f0; }
        .game-over.defeat h2 { color: #e94560; }

        .tooltip { position: fixed; background: rgba(0,0,0,0.95); color: #fff; padding: 12px; border-radius: 8px; font-size: 0.85em; max-width: 280px; z-index: 2000; pointer-events: none; display: none; border: 1px solid rgba(255,255,255,0.2); }
        .tooltip .tip-name { font-weight: bold; color: #ffd700; margin-bottom: 4px; }
        .tooltip .tip-desc { color: #ccc; line-height: 1.4; }

        .float-number {
            position: fixed; font-size: 1.5em; font-weight: bold; pointer-events: none;
            animation: floatUp 1s ease-out forwards; z-index: 999;
        }
        .float-number.damage { color: #e94560; }
        .float-number.heal { color: #4cc9f0; }
        .float-number.combo { color: #ffd700; font-size: 2em; }
        .float-number.synergy { color: #b388ff; font-size: 1.8em; }
        @keyframes floatUp { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-40px); } }

        .bg-particle {
            position: fixed; width: 6px; height: 6px; border-radius: 50%; pointer-events: none;
            animation: floatParticle 8s infinite ease-in-out;
        }
        @keyframes floatParticle {
            0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
            50% { transform: translateY(-100px) translateX(30px); opacity: 0.6; }
        }

        /* 音乐控制按钮 */
        .music-toggle {
            position: fixed; top: 15px; right: 15px; z-index: 500;
            width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,215,0,0.5);
            background: rgba(0,0,0,0.5); color: #ffd700; font-size: 1.3em; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.3s;
        }
        .music-toggle:hover { background: rgba(255,215,0,0.2); transform: scale(1.1); }
        .music-toggle.muted { opacity: 0.5; border-color: rgba(255,255,255,0.3); color: #666; }

        /* ===== AI身份选择界面 ===== */
        .identity-select-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            z-index: 2000; padding: 15px;
            animation: fadeInOverlay 0.5s ease-out;
            overflow-y: auto;
        }
        .identity-select-overlay.hidden { display: none; }
        @keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

        .identity-title {
            font-size: clamp(1.4em, 3vw, 2.2em); margin-bottom: 5px;
            background: linear-gradient(135deg, #e94560, #ff6b6b, #ffd700);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            background-clip: text;
            filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.5));
        }
        .identity-subtitle {
            font-size: clamp(0.75em, 1.5vw, 0.95em); color: #aaa; margin-bottom: 18px;
        }

        .identity-cards {
            display: flex; gap: clamp(10px, 2vw, 20px); flex-wrap: wrap; justify-content: center;
            margin-bottom: 18px; max-width: 100%;
        }
        .identity-card {
            width: clamp(150px, 20vw, 200px); height: auto; min-height: 260px; border-radius: 14px; padding: 14px;
            cursor: pointer; transition: all 0.3s;
            display: flex; flex-direction: column; align-items: center; justify-content: space-between;
            background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px);
            border: 3px solid rgba(255, 255, 255, 0.15);
            position: relative; overflow: hidden; flex-shrink: 0;
        }
        .identity-card:hover {
            transform: translateY(-8px) scale(1.04);
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        }
        .identity-card.selected {
            transform: translateY(-8px) scale(1.06);
            border-color: #ffd700 !important;
            box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
        }
        .identity-card.gcd { border-color: rgba(233, 69, 96, 0.4); }
        .identity-card.gcd:hover, .identity-card.gcd.selected { border-color: #e94560; box-shadow: 0 0 40px rgba(233, 69, 96, 0.6); }
        .identity-card.wdd { border-color: rgba(76, 201, 240, 0.4); }
        .identity-card.wdd:hover, .identity-card.wdd.selected { border-color: #4cc9f0; box-shadow: 0 0 40px rgba(76, 201, 240, 0.6); }
        .identity-card.tdd { border-color: rgba(255, 215, 0, 0.4); }
        .identity-card.tdd:hover, .identity-card.tdd.selected { border-color: #ffd700; box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); }

        .identity-icon {
            font-size: clamp(2.2em, 4vw, 3em); margin-bottom: 6px;
            filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
            animation: floatIcon 3s infinite ease-in-out;
        }
        @keyframes floatIcon {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }
        .identity-name {
            font-size: clamp(1em, 2vw, 1.3em); font-weight: bold; color: #fff; margin-bottom: 3px;
        }
        .identity-tag {
            font-size: clamp(0.65em, 1.2vw, 0.8em); padding: 2px 10px; border-radius: 10px; margin-bottom: 6px;
        }
        .gcd .identity-tag { background: rgba(233, 69, 96, 0.3); color: #ff6b6b; }
        .wdd .identity-tag { background: rgba(76, 201, 240, 0.3); color: #4cc9f0; }
        .tdd .identity-tag { background: rgba(255, 215, 0, 0.3); color: #ffd700; }
        .identity-desc {
            font-size: clamp(0.6em, 1.1vw, 0.78em); color: #aaa; text-align: center; line-height: 1.35;
        }
        .identity-stats {
            width: 100%; font-size: clamp(0.55em, 1vw, 0.72em); color: #888; margin-top: 6px;
        }
        .identity-stats div {
            display: flex; justify-content: space-between; padding: 2px 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .identity-stats .stat-val { font-weight: bold; }
        .gcd .stat-val { color: #e94560; }
        .wdd .stat-val { color: #4cc9f0; }
        .tdd .stat-val { color: #ffd700; }

        .identity-start-btn {
            padding: 10px 40px; font-size: clamp(0.9em, 1.8vw, 1.1em); border: none; border-radius: 22px;
            cursor: pointer; font-weight: bold; transition: all 0.3s;
            background: linear-gradient(135deg, #e94560, #ff6b6b); color: #fff;
            box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
        }
        .identity-start-btn:hover { transform: scale(1.08); box-shadow: 0 8px 30px rgba(233, 69, 96, 0.6); }
        .identity-start-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.hidden { display: none !important; }
