* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #1a1a2e;
    color: #fff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    background: #0f0f1e;
    cursor: crosshair;
    position: relative;
    z-index: 1;
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.stats {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    min-width: 200px;
}

.stats h3 {
    margin-bottom: 10px;
    color: #4ecdc4;
}

.stats div {
    margin: 5px 0;
    font-size: 14px;
}

.special-effects {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(78, 205, 196, 0.3);
}

.special-effects-title {
    font-size: 12px;
    color: #4ecdc4;
    margin-bottom: 5px;
    font-weight: bold;
}

.special-effect-item {
    font-size: 11px;
    color: #ffd700;
    margin: 3px 0;
    padding-left: 10px;
    position: relative;
}

.special-effect-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ffd700;
}

#gameInfo {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    align-self: flex-start;
}

#gameInfo div {
    margin: 5px 0;
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
}

.controls-hint {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 10px;
    color: #ccc;
    line-height: 1.4;
    pointer-events: none;
    z-index: 10;
    text-align: center;
}

.controls-hint div {
    margin: 2px 0;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow: visible; /* 确保不裁剪子元素的悬停效果 */
}

/* 菜单内容容器 - 玻璃拟态效果 */
.menu-content {
    position: relative;
    z-index: 2;
    background: rgba(20, 20, 35, 0.6);
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 20px;
    padding: 40px 50px;
    max-width: 800px;
    width: 90%;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(78, 205, 196, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: menuFadeIn 0.5s ease-out;
}

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

/* 菜单内容内的标题样式调整 */
.menu-content h1 {
    margin-bottom: 25px;
}

/* 菜单内容内的段落样式调整 */
.menu-content p {
    margin: 8px 0;
    text-align: center;
}

/* 菜单内容内的按钮样式增强 */
.menu-content button {
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.menu-content button:hover {
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.6), 0 4px 20px rgba(78, 205, 196, 0.4);
}

.screen > * {
    position: relative;
    z-index: 2;
}

#menuBackground {
    z-index: 1 !important;
}

#menuAnimation {
    z-index: 3 !important;
}

.screen.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* 游戏结束界面 - 确保显示在最上层 */
#gameOver {
    z-index: 1000 !important;
}

#gameOver:not(.hidden) {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.screen h1 {
    font-size: 48px;
    margin-bottom: 30px;
    color: #4ecdc4;
    text-shadow: 0 0 20px #4ecdc4;
}

/* 金色红色中国风格效果 */
.rainbow-text {
    background: linear-gradient(
        90deg,
        #ffd700 0%,
        #ffed4e 20%,
        #ff6b35 40%,
        #c41e3a 60%,
        #8b0000 80%,
        #ffd700 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gold-red-shift 3s linear infinite;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 107, 53, 0.4);
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes gold-red-shift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.screen p {
    font-size: 18px;
    margin: 10px 0;
    color: #ccc;
}

.screen button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 20px;
    background: #4ecdc4;
    color: #1a1a2e;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.screen button:hover {
    background: #45b7b8;
    transform: scale(1.05);
    box-shadow: 0 0 20px #4ecdc4;
}

/* Credits Modal */
#credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.credits-modal-content {
    background: rgba(5, 5, 5, 0.98);
    border: 2px solid #4ecdc4;
    box-shadow: 0 0 18px rgba(78, 205, 196, 0.9), 0 0 36px rgba(0, 0, 0, 0.9);
    padding: 24px 26px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    color: #fff;
    font-family: 'Arial', sans-serif;
    text-align: center;
}

.credits-modal-content h2 {
    margin: 0 0 16px;
    font-size: 24px;
    color: #4ecdc4;
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.9);
}

.credits-modal-content p {
    margin: 12px 0;
    font-size: 16px;
    color: #ccc;
    line-height: 1.6;
}

.credits-website {
    margin: 16px 0;
    font-size: 14px;
    color: #bbb;
}

.credits-website a {
    color: #4ecdc4;
    text-decoration: underline;
}

.credits-website a:hover {
    color: #45b7b8;
}

#credits-close {
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 16px;
    background: #4ecdc4;
    color: #1a1a2e;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#credits-close:hover {
    background: #45b7b8;
    transform: scale(1.05);
    box-shadow: 0 0 20px #4ecdc4;
}

/* Newsletter Modal */
#newsletter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.newsletter-modal-content {
    background: rgba(5, 5, 5, 0.98);
    border: 2px solid #4ecdc4;
    box-shadow: 0 0 18px rgba(78, 205, 196, 0.9), 0 0 36px rgba(0, 0, 0, 0.9);
    padding: 24px 26px;
    border-radius: 10px;
    max-width: 420px;
    width: 90%;
    color: #fff;
    font-family: 'Arial', sans-serif;
}

.newsletter-modal-content h2 {
    margin: 0 0 8px;
    font-size: 22px;
    text-align: center;
    color: #4ecdc4;
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.9);
}

.newsletter-subtitle {
    margin: 0 0 16px;
    font-size: 13px;
    color: #cccccc;
    text-align: center;
}

.newsletter-website {
    margin: 10px 0 0;
    font-size: 12px;
    color: #bbbbbb;
    text-align: center;
}

.newsletter-website a {
    color: #4ecdc4;
    text-decoration: underline;
}

.newsletter-website a:hover {
    color: #45b7b8;
}

.newsletter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.newsletter-field label {
    font-size: 13px;
    color: #e0e0e0;
}

.newsletter-field input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #111;
    color: #fff;
    font-size: 14px;
    outline: none;
    font-family: 'Arial', sans-serif;
}

.newsletter-field input:focus {
    border-color: #4ecdc4;
    box-shadow: 0 0 0 1px rgba(78, 205, 196, 0.4);
}

.newsletter-status {
    min-height: 18px;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.newsletter-status.error {
    color: #ff6b6b;
}

.newsletter-status.success {
    color: #4caf50;
}

.newsletter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.newsletter-actions button {
    padding: 8px 16px;
    border-radius: 5px;
    border: 1px solid #4ecdc4;
    background: #1a1a2e;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: 'Arial', sans-serif;
}

.newsletter-actions button:hover {
    background: #4ecdc4;
    color: #1a1a2e;
}

.newsletter-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .newsletter-modal-content {
        padding: 20px 18px;
        max-width: 340px;
    }

    .newsletter-modal-content h2 {
        font-size: 18px;
    }

    .newsletter-subtitle {
        font-size: 12px;
    }
}

/* Upgrade Card Selection UI - 科幻风格 */
#upgradeCardScreen {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    overflow: visible; /* 确保不裁剪卡牌悬停效果 */
}

.upgrade-card-container {
    width: 100%;
    max-width: 1400px;
    padding: 40px 20px;
    overflow: visible; /* 确保不裁剪子元素的悬停效果 */
}

.upgrade-title {
    font-size: 36px;
    text-align: center;
    margin: 0 0 30px 0;
    padding: 0;
    color: #4ecdc4;
    text-shadow: 0 0 20px #4ecdc4, 0 0 40px #4ecdc4;
    font-weight: bold;
    letter-spacing: 2px;
    position: relative;
    z-index: 10;
    display: block;
    width: 100%;
}

.upgrade-subtitle {
    font-size: 20px;
    text-align: center;
    margin: 0 0 40px 0;
    padding: 0;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    font-weight: normal;
    position: relative;
    z-index: 5;
    display: block;
    width: 100%;
}

.upgrade-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible; /* 确保垂直方向不裁剪悬停效果 */
    padding: 30px 0; /* 增加垂直padding以容纳向上移动15px + 放大效果 */
    width: 100%;
}

.upgrade-card {
    position: relative;
    min-width: 180px;
    max-width: 280px;
    width: 280px;
    height: 400px;
    flex: 1 1 auto;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 40, 0.95));
    border: 3px solid;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 稀有度边框颜色 */
.upgrade-card.common {
    border-color: #cccccc;
    box-shadow: 0 0 20px rgba(204, 204, 204, 0.3);
}

.upgrade-card.rare {
    border-color: #4a9eff;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.5);
}

.upgrade-card.epic {
    border-color: #b347d9;
    box-shadow: 0 0 40px rgba(179, 71, 217, 0.6);
    animation: epic-glow 2s ease-in-out infinite;
}

.upgrade-card.legendary {
    border-color: #ffaa00;
    box-shadow: 0 0 50px rgba(255, 170, 0, 0.7);
    animation: legendary-glow 1.5s ease-in-out infinite;
}

@keyframes epic-glow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(179, 71, 217, 0.6);
    }
    50% {
        box-shadow: 0 0 60px rgba(179, 71, 217, 0.8);
    }
}

@keyframes legendary-glow {
    0%, 100% {
        box-shadow: 0 0 50px rgba(255, 170, 0, 0.7), 0 0 100px rgba(255, 170, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 70px rgba(255, 170, 0, 0.9), 0 0 140px rgba(255, 170, 0, 0.6);
    }
}

/* 悬停效果 */
.upgrade-card:hover {
    transform: translateY(-15px) scale(1.05);
    z-index: 10;
}

.upgrade-card.common:hover {
    box-shadow: 0 0 40px rgba(204, 204, 204, 0.6);
}

.upgrade-card.rare:hover {
    box-shadow: 0 0 50px rgba(74, 158, 255, 0.7);
}

.upgrade-card.epic:hover {
    box-shadow: 0 0 70px rgba(179, 71, 217, 0.8);
}

.upgrade-card.legendary:hover {
    box-shadow: 0 0 80px rgba(255, 170, 0, 0.9), 0 0 160px rgba(255, 170, 0, 0.6);
}

/* 卡牌图标 */
.card-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px currentColor);
}

/* 卡牌名称 */
.card-name {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 0 10px currentColor;
}

/* 稀有度标签 */
.card-rarity {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-rarity.common {
    background: rgba(204, 204, 204, 0.3);
    color: #cccccc;
}

.card-rarity.rare {
    background: rgba(74, 158, 255, 0.3);
    color: #4a9eff;
}

.card-rarity.epic {
    background: rgba(179, 71, 217, 0.3);
    color: #b347d9;
}

.card-rarity.legendary {
    background: rgba(255, 170, 0, 0.3);
    color: #ffaa00;
}

/* 卡牌描述 */
.card-description {
    font-size: 16px;
    color: #e0e0e0;
    text-align: center;
    line-height: 1.6;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 已拥有标记 */
.card-owned {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ff6b6b;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #ff6b6b;
    z-index: 5;
    pointer-events: none;
}

/* 能量流动效果（背景） */
.upgrade-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: energy-flow 3s linear infinite;
    pointer-events: none;
}

@keyframes energy-flow {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 统计和成就面板样式 */
#stats-modal, #achievements-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#stats-modal.active, #achievements-modal.active {
    opacity: 1;
    visibility: visible;
}

#stats-modal .modal-content, #achievements-modal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4ecdc4;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(78, 205, 196, 0.3);
}

#stats-modal h2, #achievements-modal h2 {
    color: #4ecdc4;
    text-align: center;
    margin-bottom: 25px;
    font-size: 28px;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.stats-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.stat-label {
    color: #ccc;
    font-size: 16px;
}

.stat-value {
    color: #4ecdc4;
    font-size: 20px;
    font-weight: bold;
}

.achievements-content {
    max-width: 800px;
}

.achievements-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-button {
    padding: 8px 20px;
    background: #2a2a3e;
    color: #fff;
    border: 2px solid #4ecdc4;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-button:hover {
    background: #3a3a4e;
}

.filter-button.active {
    background: #4ecdc4;
    color: #1a1a2e;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.achievement-item {
    background: rgba(78, 205, 196, 0.1);
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

.achievement-item.unlocked {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.achievement-item.locked {
    opacity: 0.6;
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.achievement-icon {
    font-size: 40px;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    color: #4ecdc4;
    margin-bottom: 5px;
}

.achievement-item.unlocked .achievement-name {
    color: #ffd700;
}

.achievement-description {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 10px;
}

.achievement-progress {
    margin-top: 10px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.achievement-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4 0%, #00ff88 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.achievement-item.unlocked .achievement-progress-bar {
    background: linear-gradient(90deg, #ffd700 0%, #ffaa00 100%);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4 0%, #00ff88 100%);
    transition: width 0.3s ease;
}

.achievement-item.unlocked .progress-fill {
    background: linear-gradient(90deg, #ffd700 0%, #ffaa00 100%);
}

.achievement-unlocked-badge {
    display: inline-block;
    background: #ffd700;
    color: #1a1a2e;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
}

.progress-text {
    font-size: 12px;
    color: #aaa;
    text-align: right;
}

.achievement-reward {
    margin-top: 10px;
    padding: 8px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 5px;
    font-size: 12px;
    color: #4ecdc4;
}

.achievement-item.unlocked .achievement-reward {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.modal-button-primary {
    padding: 12px 30px;
    background: #4ecdc4;
    color: #1a1a2e;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.modal-button-primary:hover {
    background: #5eddd4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

/* 成就解锁通知动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .upgrade-card {
        width: 240px;
        height: 360px;
    }
}

@media (max-width: 768px) {
    .upgrade-cards {
        gap: 20px;
    }
    
    .upgrade-card {
        width: 200px;
        height: 320px;
        padding: 20px;
    }
    
    .card-icon {
        font-size: 48px;
    }
    
    .card-name {
        font-size: 20px;
    }
    
    .card-description {
        font-size: 14px;
    }
}

/* Settings Modal */
#settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.settings-modal-content {
    background: rgba(5, 5, 5, 0.98);
    border: 2px solid #4ecdc4;
    box-shadow: 0 0 18px rgba(78, 205, 196, 0.9), 0 0 36px rgba(0, 0, 0, 0.9);
    padding: 24px 26px;
    border-radius: 10px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: #fff;
    font-family: 'Arial', sans-serif;
}

.settings-modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #4ecdc4;
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.9);
    text-align: center;
}

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(78, 205, 196, 0.3);
}

.settings-tab {
    padding: 10px 20px;
    background: transparent;
    color: #ccc;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.settings-tab:hover {
    color: #4ecdc4;
}

.settings-tab.active {
    color: #4ecdc4;
    border-bottom-color: #4ecdc4;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-tab-content h3 {
    margin: 20px 0 15px;
    font-size: 18px;
    color: #4ecdc4;
    text-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
}

.key-binding-list {
    margin-bottom: 30px;
}

.key-binding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(42, 42, 62, 0.5);
    border: 1px solid rgba(78, 205, 196, 0.2);
    border-radius: 5px;
    transition: all 0.3s;
}

.key-binding-item:hover {
    background: rgba(42, 42, 62, 0.7);
    border-color: rgba(78, 205, 196, 0.4);
}

.key-binding-item.waiting {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(78, 205, 196, 0.8);
    }
}

.key-binding-label {
    font-size: 14px;
    color: #e0e0e0;
    flex: 1;
}

.key-binding-key {
    padding: 6px 15px;
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid #4ecdc4;
    border-radius: 5px;
    color: #4ecdc4;
    font-size: 14px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.key-binding-key:hover {
    background: rgba(78, 205, 196, 0.3);
    transform: scale(1.05);
}

.key-binding-key.waiting {
    background: rgba(255, 170, 0, 0.3);
    border-color: #ffaa00;
    color: #ffaa00;
    animation: pulse 1s ease-in-out infinite;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(78, 205, 196, 0.3);
}

/* In-game Confirmation Dialog */
.in-game-confirm-dialog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    border-radius: 10px;
}

.in-game-confirm-dialog.hidden {
    display: none;
}

.confirm-dialog-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4ecdc4;
    border-radius: 10px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(78, 205, 196, 0.3);
}

.confirm-dialog-content h3 {
    color: #4ecdc4;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 20px;
}

.confirm-dialog-content p {
    color: #ccc;
    margin: 0 0 25px 0;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.confirm-button-ok,
.confirm-button-cancel {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.confirm-button-ok {
    background: #4ecdc4;
    color: #1a1a2e;
}

.confirm-button-ok:hover {
    background: #5eddd4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.confirm-button-cancel {
    background: #2a2a3e;
    color: #fff;
    border: 2px solid #4ecdc4;
}

.confirm-button-cancel:hover {
    background: #3a3a4e;
}

.settings-button-primary,
.settings-button-secondary {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #4ecdc4;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Arial', sans-serif;
}

.settings-button-primary {
    background: #4ecdc4;
    color: #1a1a2e;
}

.settings-button-primary:hover {
    background: #45b7b8;
    transform: scale(1.05);
}

.settings-button-secondary {
    background: transparent;
    color: #4ecdc4;
}

.settings-button-secondary:hover {
    background: rgba(78, 205, 196, 0.2);
}

/* 移动设备不支持提示 */
.mobile-not-supported-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.mobile-not-supported-content {
    text-align: center;
    background: rgba(20, 20, 35, 0.9);
    border: 2px solid #4ecdc4;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-not-supported-content h1 {
    font-size: 28px;
    color: #4ecdc4;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #4ecdc4;
    font-weight: bold;
}

.mobile-not-supported-content p {
    font-size: 16px;
    color: #ccc;
    line-height: 1.6;
    margin: 15px 0;
}

.mobile-icon {
    font-size: 80px;
    margin-top: 30px;
    animation: pulse 2s ease-in-out infinite;
}

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

/* 移动端样式（只在移动设备上生效） */
@media (max-width: 768px) and (pointer: coarse) {
    /* 隐藏玩家2面板 */
    #player2Stats {
        display: none !important;
    }
    
    /* 调整玩家1面板位置（居中显示） */
    #ui {
        justify-content: center;
    }
    
    /* 移动控制UI样式（已在mobile-controls.js中绘制） */
    /* 这里可以添加额外的移动端样式 */
}

/* 全屏按钮 */
.fullscreen-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #4ecdc4;
    border-radius: 5px;
    color: #4ecdc4;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    pointer-events: auto;
}

.fullscreen-button:hover {
    background: rgba(78, 205, 196, 0.3);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.6);
    transform: scale(1.1);
}

.fullscreen-button:active {
    transform: scale(0.95);
}

/* 重生倒计时样式 */
.respawn-timer {
    margin-top: 10px !important;
    padding: 8px !important;
    background: rgba(255, 0, 0, 0.8) !important;
    border: 2px solid #ff0000 !important;
    border-radius: 5px !important;
    color: #ffffff !important;
    font-weight: bold !important;
    text-align: center !important;
    font-size: 16px !important;
    position: relative !important;
    z-index: 1000 !important;
    animation: respawnPulse 1s ease-in-out infinite !important;
    min-height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5) !important;
}

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

/* 无敌时间指示器样式 */
.invulnerable-indicator {
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 215, 0, 0.3);
    border: 2px solid #ffd700;
    border-radius: 5px;
    color: #ffd700;
    font-weight: bold;
    text-align: center;
    animation: invulnerableGlow 0.5s ease-in-out infinite;
}

@keyframes invulnerableGlow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

/* 神龍幸运卡样式 */
.dragon-luck-card-container {
    width: 100%;
    max-width: 1400px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(30, 20, 10, 1) 0%, rgba(40, 25, 15, 1) 100%);
    border: 3px solid #ffd700;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: visible;
}

.dragon-luck-card-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 215, 0, 0.05) 10px, rgba(255, 215, 0, 0.05) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255, 140, 0, 0.05) 10px, rgba(255, 140, 0, 0.05) 20px);
    border-radius: 15px;
    pointer-events: none;
    z-index: 0;
}

.dragon-luck-title {
    font-size: 48px;
    text-align: center;
    margin: 0 0 20px 0;
    padding: 0;
    color: #ffd700;
    text-shadow: 
        0 0 20px #ffd700,
        0 0 40px #ffaa00,
        0 0 60px #ff8800;
    font-weight: bold;
    letter-spacing: 3px;
    position: relative;
    z-index: 10;
    animation: dragonTitleGlow 2s ease-in-out infinite;
}

.dragon-luck-reason {
    font-size: 20px;
    text-align: center;
    margin: 0 0 30px 0;
    padding: 15px;
    color: #ffaa00;
    text-shadow: 0 0 10px #ffaa00;
    background: rgba(30, 20, 10, 1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    position: relative;
    z-index: 10;
    font-style: italic;
}

.dragon-luck-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: nowrap;
    padding: 30px 0;
    width: 100%;
    position: relative;
    z-index: 10;
}

.dragon-luck-card {
    width: 300px;
    height: 430px;
    background: linear-gradient(135deg, rgba(25, 18, 10, 1) 0%, rgba(35, 22, 12, 1) 100%);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.dragon-luck-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: dragonCardRotate 10s linear infinite;
    pointer-events: none;
}

.dragon-luck-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.6), 0 0 100px rgba(255, 140, 0, 0.4);
    border-color: #ffaa00;
}

.dragon-luck-card .card-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 15px;
    background: rgba(255, 215, 0, 0.3);
    border: 2px solid #ffd700;
    border-radius: 20px;
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 10px #ffd700;
}

.dragon-luck-card .card-icon {
    font-size: 80px;
    text-align: center;
    margin: 20px 0;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    animation: dragonIconPulse 2s ease-in-out infinite;
}

.dragon-luck-card .card-name {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700, 0 0 30px #ffaa00;
}

.dragon-luck-card .card-description {
    font-size: 16px;
    text-align: center;
    color: #ffaa00;
    line-height: 1.6;
    margin-top: 15px;
}

@keyframes dragonTitleGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px #ffd700,
            0 0 40px #ffaa00,
            0 0 60px #ff8800;
    }
    50% {
        text-shadow: 
            0 0 30px #ffd700,
            0 0 60px #ffaa00,
            0 0 90px #ff8800,
            0 0 120px #ff6600;
    }
}

@keyframes dragonCardRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dragonIconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
}

