.ui {
    position: absolute; top: 20px; left: 20px; color: var(--cyan); font-size: 16px; text-shadow: var(--glow-cyan); z-index: 10; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}

.top-ui-row { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 10px; }
.stats-area { display: flex; flex-direction: column; gap: 8px; }
.stat-bar { display: flex; align-items: center; gap: 10px; }

.bar-container { width: 200px; height: 20px; border: 2px solid var(--cyan); border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, 0.5); }
.health-bar { height: 100%; background: linear-gradient(90deg, var(--red), var(--green)); transition: width 0.3s; box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
.energy-bar { height: 100%; background: linear-gradient(90deg, #0066ff, var(--cyan)); transition: width 0.3s; box-shadow: 0 0 10px rgba(0, 100, 255, 0.5); }
.exp-bar { height: 100%; background: linear-gradient(90deg, #ff00ff, var(--yellow)); transition: width 0.3s; box-shadow: 0 0 10px rgba(255, 255, 0, 0.5); }

.consumable-ui { position: static !important; bottom: auto !important; left: auto !important; z-index: 10; }
.consumable-ui-slot { width: 50px; height: 50px; border: 2px solid #666; border-radius: 6px; background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.6)); display: flex; align-items: center; justify-content: center; position: relative; transition: all 0.3s ease; }
.consumable-ui-slot.has-item { border-color: var(--yellow); box-shadow: 0 0 10px rgba(255, 255, 0, 0.3); background: linear-gradient(135deg, rgba(255, 255, 0, 0.1), rgba(255, 200, 0, 0.1)); }
.consumable-ui-slot .quantity-display { position: absolute; bottom: 1px; right: 1px; background: rgba(255, 255, 255, 0.9); color: var(--black); font-size: 9px; font-weight: bold; min-width: 12px; height: 12px; border-radius: 6px; display: flex; align-items: center; justify-content: center; border: 1px solid #666; }

.wave-info { position: absolute !important; top: 20px !important; right: 20px !important; color: var(--yellow) !important; font-size: 22px !important; font-weight: bold !important; text-shadow: var(--glow-yellow) !important; z-index: 10 !important; pointer-events: none !important; background: rgba(0, 0, 0, 0.5) !important; padding: 8px 12px !important; border-radius: 8px !important; border: 2px solid var(--yellow) !important; }

.passive-indicator { position: absolute; top: 80px; right: 20px; background: rgba(0, 0, 0, 0.8); border: 2px solid var(--orange); border-radius: 10px; padding: 10px; color: var(--orange); font-size: 12px; max-width: 250px; z-index: 10; animation: passiveGlow 2s ease-in-out infinite; pointer-events: none; }
.passive-item { margin: 3px 0; text-shadow: 0 0 5px var(--orange); padding: 2px 0; border-bottom: 1px solid rgba(255, 170, 0, 0.3); }
.passive-item:last-child { border-bottom: none; }

@keyframes passiveGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 170, 0, 0.3); border-color: var(--orange); }
    50% { box-shadow: 0 0 20px rgba(255, 170, 0, 0.6); border-color: var(--yellow); }
}

.skill-bar { position: static !important; bottom: auto !important; left: auto !important; transform: none !important; display: flex !important; gap: 10px; pointer-events: none; }
.skill { width: 50px; height: 50px; border: 2px solid var(--cyan); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--cyan); background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(0, 150, 200, 0.1)); position: relative; overflow: hidden; transition: all 0.3s; pointer-events: none; }
.skill span:first-child { font-size: 14px; font-weight: bold; line-height: 1; }
.skill-name { font-size: 7px; margin-top: 2px; text-align: center; line-height: 1; }
.skill-energy { font-size: 8px; margin-top: 1px; color: var(--yellow); opacity: 0.8; }
.skill.ready { box-shadow: 0 0 15px rgba(0, 255, 255, 0.8); animation: skillPulse 1.5s infinite; }
.skill.cooldown { opacity: 0.5; border-color: #666; color: #666; box-shadow: none; }
.skill-cooldown { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(255, 0, 0, 0.7); transition: height 0.1s linear; }
.cooldown-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 12px; color: var(--white); text-shadow: 0 0 5px var(--black); font-weight: bold; z-index: 2; }

@keyframes skillPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.8); transform: scale(1); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 255, 1); transform: scale(1.02); }
}

.charge-bar { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); width: 300px; height: 15px; border: 3px solid #ff00ff; border-radius: 10px; overflow: hidden; display: none; z-index: 10; background: rgba(0, 0, 0, 0.7); pointer-events: none; }
.charge-fill { height: 100%; background: linear-gradient(90deg, #ff00ff, var(--cyan)); width: 0%; box-shadow: 0 0 15px #ff00ff; transition: none; }
.charge-text { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); color: #ff00ff; font-size: 14px; text-shadow: 0 0 10px #ff00ff; }

.game-over { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--red); font-size: 48px; text-shadow: 0 0 30px var(--red); display: none; z-index: 20; text-align: center; }
.restart-btn { margin-top: 20px; padding: 15px 40px; font-size: 24px; background: linear-gradient(45deg, #ff00ff, var(--cyan)); border: none; border-radius: 30px; color: var(--white); cursor: pointer; transition: all 0.3s; }
.restart-btn:hover { transform: scale(1.1); box-shadow: var(--glow-cyan); }

.wave-announcement { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 60px; color: var(--yellow); text-shadow: 0 0 30px var(--yellow); display: none; z-index: 15; animation: waveAnnounce 2s ease-in-out; pointer-events: none; }

@keyframes waveAnnounce {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.inventory-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); z-index: 3000; display: flex; justify-content: center; align-items: center; }
.inventory-panel { background: var(--gradient-dark); border: 3px solid var(--cyan); border-radius: 15px; padding: 20px; width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: var(--glow-cyan); }
.inventory-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--cyan); position: relative; padding-right: 60px; }
.inventory-panel .close-btn { position: absolute; background: var(--red); border: none; color: white; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 10; }
.inventory-panel .close-btn:hover { background: #ff6666; transform: scale(1.1); }
.inventory-header h2 { color: var(--cyan); margin: 0; text-shadow: var(--glow-cyan); }

.status-section { margin-bottom: 20px; padding: 15px; background: rgba(0, 255, 255, 0.1); border: 1px solid var(--cyan); border-radius: 8px; }
.gold-display { color: var(--yellow); font-size: 18px; font-weight: bold; margin-bottom: 10px; text-shadow: var(--glow-yellow); }
.crystal-levels { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.crystal-levels > div { color: var(--cyan); text-shadow: 0 0 5px var(--cyan); }

.equipment-slots, .consumable-slots { margin-bottom: 20px; }
.equipment-slots h3, .consumable-slots h3, .treasure-slots h3, .inventory-slots h3 { 
  color: var(--cyan); 
  margin-bottom: 10px; 
  text-shadow: 0 0 5px var(--cyan); 
}
.equipment-grid, .consumable-grid { display: flex; gap: 10px; margin-bottom: 20px; }

.equipment-slot, .consumable-slot { width: 80px; height: 80px; border: 2px solid #666; border-radius: 10px; background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.6)); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; transition: all 0.3s ease; }
.equipment-slot.has-item { border-color: var(--cyan); box-shadow: 0 0 15px #00ffff44; background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(0, 100, 150, 0.1)); }
.consumable-slot.has-item { border-color: var(--yellow); box-shadow: 0 0 15px #ffff0044; background: linear-gradient(135deg, rgba(255, 255, 0, 0.1), rgba(255, 200, 0, 0.1)); }
.equipment-slot:hover, .consumable-slot:hover { border-color: var(--cyan); transform: scale(1.05); box-shadow: 0 0 20px #00ffff33; cursor: pointer; }
.consumable-slot:hover { border-color: var(--yellow); box-shadow: 0 0 20px #ffff0033; }

.inventory-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 60px; gap: 5px; max-height: 300px; overflow-y: auto; }
.inventory-slot { width: 60px; height: 60px; border: 2px solid #444; border-radius: 5px; background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.6)); display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.inventory-slot.has-item { border-color: #666; }
.inventory-slot:hover { border-color: var(--cyan); transform: scale(1.05); box-shadow: 0 0 15px #00ffff33; cursor: pointer; }

.item { user-select: none; transition: transform 0.2s; }
.item:hover { transform: scale(1.1); }
.drag-preview { transform: scale(1.2); opacity: 0.8; }

.context-menu { position: absolute; background: rgba(0, 0, 0, 0.9); border: 2px solid var(--cyan); border-radius: 8px; padding: 5px; z-index: 1001; min-width: 120px; }
.context-item { padding: 8px 12px; color: var(--cyan); cursor: pointer; border-radius: 4px; transition: background 0.3s; }
.context-item:hover { background: rgba(0, 255, 255, 0.2); }

.merge-effect { animation: mergeGlow 1.5s ease-out; }

@keyframes mergeGlow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.shop-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); z-index: 3000; display: flex; justify-content: center; align-items: center; }
.shop-panel { background: var(--gradient-dark); border: 3px solid var(--yellow); border-radius: 15px; padding: 20px; width: 800px; max-height: 100vh; overflow-y: hidden; box-shadow: var(--glow-yellow); }
.shop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--yellow); }
.shop-header h2 { color: var(--yellow); margin: 0; text-shadow: var(--glow-yellow); }

.shop-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 15px; background: rgba(255, 221, 0, 0.1); border: 1px solid var(--yellow); border-radius: 8px; }
.redemption-section { display: flex; gap: 10px; }
#redemptionInput { padding: 8px 12px; border: 2px solid #666; border-radius: 6px; background: rgba(0, 0, 0, 0.7); color: var(--white); font-size: 14px; width: 150px; }
#redemptionInput:focus { border-color: var(--yellow); outline: none; }
#redemptionBtn { padding: 8px 16px; background: var(--gradient-yellow); border: none; border-radius: 6px; color: var(--black); font-weight: bold; cursor: pointer; transition: all 0.3s; }
#redemptionBtn:hover { transform: scale(1.05); box-shadow: var(--glow-yellow); }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; max-height: 400px; overflow-y: auto; }
.shop-item { background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.6)); border: 2px solid #666; border-radius: 10px; padding: 15px; text-align: center; transition: all 0.3s ease; }
.shop-item:hover { border-color: var(--yellow); transform: scale(1.02); box-shadow: 0 0 15px rgba(255, 221, 0, 0.3); }
.item-icon { font-size: 32px; margin-bottom: 8px; }
.item-name { color: var(--cyan); font-weight: bold; margin-bottom: 5px; text-shadow: 0 0 5px var(--cyan); }
.item-price { color: var(--yellow); font-size: 14px; margin-bottom: 10px; }
.buy-btn { width: 100%; padding: 8px; background: var(--gradient-green); border: none; border-radius: 6px; color: var(--black); font-weight: bold; cursor: pointer; transition: all 0.3s; }
.buy-btn:hover:not(.disabled) { transform: scale(1.05); box-shadow: var(--glow-green); }
.buy-btn.disabled { background: #666; color: #999; cursor: not-allowed; }

@keyframes qualityGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

@keyframes bloodPulse {
    0%, 100% { box-shadow: 0 0 12px var(--red); }
    50% { box-shadow: 0 0 20px var(--red), 0 0 30px var(--red); }
}

@keyframes titanHeartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes cosmicPulse {
    0%, 100% { box-shadow: 0 0 8px var(--orange); transform: scale(1); }
    50% { box-shadow: 0 0 16px var(--orange), 0 0 24px #ff6600; transform: scale(1.1); }
}

@keyframes pickupFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

@keyframes reviveEffect {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@keyframes itemLostEffect {
    0% { opacity: 0; transform: translateX(100%); }
    20% { opacity: 1; transform: translateX(0); }
    80% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}

@keyframes goldFade {
    0% { opacity: 0; transform: translateX(100%) scale(0.8); }
    20% { opacity: 1; transform: translateX(0) scale(1.1); }
    80% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(50%) scale(0.9); }
}

@keyframes immunityEffect {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@keyframes notificationSlide {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

@keyframes inventoryFullShake {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    25% { transform: translate(-50%, -50%) scale(1.05) rotate(-1deg); }
    75% { transform: translate(-50%, -50%) scale(1.05) rotate(1deg); }
}

.asura-effect { animation: bloodPulse 1s infinite; }
.hades-effect { background: radial-gradient(circle, rgba(0, 0, 0, 0.8), rgba(50, 0, 50, 0.4)); animation: darkPulse 2s infinite; }

@keyframes darkPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.8); }
    50% { box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 45px rgba(50, 0, 50, 0.6); }
}

.titan-effect { animation: titanHeartbeat 1.5s infinite; box-shadow: 0 0 20px var(--orange); }

.item[data-quality="5"] { animation: artifactGlow 2s ease-in-out infinite; box-shadow: 0 0 15px var(--red), 0 0 25px #ff6666, inset 0 1px 0 rgba(255,255,255,0.2); }

@keyframes artifactGlow {
    0%, 100% { box-shadow: 0 0 15px var(--red), 0 0 25px #ff6666, inset 0 1px 0 rgba(255,255,255,0.2); border-color: var(--red); }
    50% { box-shadow: 0 0 20px #ff6666, 0 0 35px #ff8888, inset 0 1px 0 rgba(255,255,255,0.3); border-color: #ff6666; }
}

.item[data-quality="4"] { box-shadow: 0 0 12px var(--orange), 0 0 20px #ffcc44, inset 0 1px 0 rgba(255,255,255,0.15); }
.item[data-quality="3"] { box-shadow: 0 0 10px var(--purple), 0 0 18px #aa55ff, inset 0 1px 0 rgba(255,255,255,0.1); }
.item[data-quality="2"] { box-shadow: 0 0 8px #0066ff, 0 0 15px #3388ff, inset 0 1px 0 rgba(255,255,255,0.1); }
.item[data-quality="1"] { box-shadow: 0 0 6px var(--green), 0 0 12px #44ff44, inset 0 1px 0 rgba(255,255,255,0.05); }
.item[data-quality="0"] { box-shadow: 0 0 4px var(--white), inset 0 1px 0 rgba(255,255,255,0.05); }

.controls-row { display: flex; align-items: flex-start; gap: 15px; margin-top: 15px; }

@media (max-width: 768px) {
    .top-ui-row { flex-direction: column; gap: 8px; }
    .skill-bar { gap: 8px; }
    .skill, .consumable-ui-slot { width: 40px; height: 40px; }
    .skill span:first-child { font-size: 12px; }
    .skill-name { font-size: 6px; }
    .wave-info { font-size: 18px !important; padding: 6px 10px !important; }
    .bar-container { width: 150px; height: 18px; }
    .ui { font-size: 14px; }
    .consumable-ui-slot { width: 40px; height: 40px; }
    .inventory-panel, .shop-panel { width: 90vw; padding: 15px; }
    .controls-hint { font-size: 10px; bottom: 10px; right: 10px; }
    .passive-indicator { top: 40px; right: 10px; max-width: 200px; font-size: 10px; }
    .items-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.shortcut-icons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 15;
    pointer-events: none;
}

.shortcut-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--cyan);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--cyan);
    font-size: 14px;
    text-shadow: var(--glow-cyan);
    opacity: 0.8;
}

.shortcut-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.main-menu-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-menu-confirm-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--cyan);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: var(--white);
    box-shadow: var(--glow-cyan);
}

.main-menu-confirm-content h3 {
    color: var(--cyan);
    margin-bottom: 15px;
    text-shadow: var(--glow-cyan);
}

.main-menu-confirm-content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.main-menu-confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.main-menu-confirm-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

#confirmMainMenuBtn {
    background: linear-gradient(45deg, #ff4444, #ff6666);
    color: white;
}

#confirmMainMenuBtn:hover {
    background: linear-gradient(45deg, #ff6666, #ff8888);
    transform: scale(1.05);
}

#cancelMainMenuBtn {
    background: linear-gradient(45deg, var(--cyan), #00aaff);
    color: white;
}

#cancelMainMenuBtn:hover {
    background: linear-gradient(45deg, #00aaff, #00ccff);
    transform: scale(1.05);
}

:root {
    --cyan:#00ffff;--yellow:#ffdd00;--orange:#ffaa00;--red:#ff4444;--green:#00ff00;--blue:#0088ff;--purple:#9933ff;--white:#ffffff;--black:#000000;
    --gradient-dark:linear-gradient(135deg,#1a1a2e,#16213e);--gradient-blue:linear-gradient(45deg,#0088ff,#0066ff);--gradient-green:linear-gradient(45deg,#00ff00,#00aa00);
    --gradient-red:linear-gradient(45deg,#ff4444,#cc2222);--gradient-yellow:linear-gradient(45deg,#ffdd00,#ffa500);--gradient-canvas:linear-gradient(180deg,#000428 0%,#004e92 100%);
    --glow-cyan:0 0 15px #00ffff;--glow-yellow:0 0 15px #ffdd00;--glow-orange:0 0 15px #ffaa00;--glow-red:0 0 15px #ff4444;--glow-green:0 0 15px #00ff00;--glow-blue:0 0 15px #0088ff;
    --gap-xs:5px;--gap-sm:10px;--gap-md:20px;--gap-lg:30px;--gap-xl:40px
}
*{margin:0;padding:0;box-sizing:border-box}
body{background:var(--black);overflow:hidden;position:relative}
canvas{display:block;background:var(--gradient-canvas)}
.btn{padding:12px 24px;border:none;border-radius:8px;font-weight:bold;cursor:pointer;transition:all .3s}
.btn-primary{background:var(--gradient-blue);color:var(--white)}
.btn-primary:hover{transform:scale(1.05);box-shadow:var(--glow-blue)}
.btn-success{background:var(--gradient-green);color:var(--black)}
.btn-success:hover{transform:scale(1.05);box-shadow:var(--glow-green)}
.btn-danger{background:var(--gradient-red);color:var(--white)}
.btn-danger:hover{transform:scale(1.05);box-shadow:var(--glow-red)}
.btn-warning{background:var(--gradient-yellow);color:var(--black)}
.btn-warning:hover{transform:scale(1.05);box-shadow:var(--glow-yellow)}
.btn:disabled{background:#666;color:#999;cursor:not-allowed;transform:none;box-shadow:none}
.modal{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:1000}
.modal-content{background:var(--gradient-dark);border:3px solid var(--cyan);border-radius:15px;padding:var(--gap-lg);box-shadow:var(--glow-cyan)}
.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--gap-md);padding-bottom:var(--gap-sm);border-bottom:2px solid var(--cyan)}
.modal-title{color:var(--cyan);margin:0;text-shadow:var(--glow-cyan)}
.close-btn{background:var(--red);border:none;color:var(--white);width:30px;height:30px;border-radius:50%;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;position: absolute;top: 20px; right: 25px; z-index: 10;}
.close-btn:hover{background:#ff6666;transform:scale(1.1)}
.form-input{padding:12px;border:2px solid #666;border-radius:8px;background:rgba(0,0,0,.7);color:var(--white);font-size:16px}
.form-input:focus{border-color:var(--cyan);outline:none;box-shadow:0 0 10px rgba(0,255,255,.3)}
.card{background:var(--gradient-dark);border:2px solid #666;border-radius:10px;padding:15px;transition:all .3s ease}
.card:hover{border-color:var(--cyan);transform:scale(1.02);box-shadow:0 0 15px rgba(0,255,255,.3)}
.card-header{color:var(--cyan);font-weight:bold;margin-bottom:var(--gap-sm);text-shadow:0 0 5px var(--cyan)}
.grid{display:grid;gap:var(--gap-md)}
.grid-2{grid-template-columns:1fr 1fr}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-auto{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
.flex{display:flex}
.flex-col{flex-direction:column}
.flex-center{align-items:center;justify-content:center}
.flex-between{justify-content:space-between}
.flex-gap{gap:var(--gap-sm)}
.start-container{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:2000;display:flex;align-items:center;justify-content:center}
.start-overlay{width:100%;height:100%;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center}
.start-content{text-align:center;color:var(--white);text-shadow:0 0 20px var(--black)}
.game-title{font-size:72px;font-weight:bold;margin-bottom:50px;color:var(--cyan);text-shadow:0 0 30px var(--cyan),0 0 60px #0088ff;animation:titleGlow 3s ease-in-out infinite alternate}
@keyframes titleGlow{0%{text-shadow:0 0 30px var(--cyan),0 0 60px #0088ff}100%{text-shadow:0 0 40px var(--cyan),0 0 80px #0088ff,0 0 120px #0066ff}}
.start-btn{font-size:24px;padding:20px 40px;background:linear-gradient(45deg,var(--cyan),#0088ff);border:none;border-radius:15px;color:var(--black);font-weight:bold;cursor:pointer;transition:all .3s;box-shadow:0 0 20px rgba(0,255,255,.5)}
.start-btn:hover{transform:scale(1.1);box-shadow:0 0 30px rgba(0,255,255,.8);background:linear-gradient(45deg,var(--cyan),#00aaff)}
.main-container{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1500;display:flex;align-items:center;justify-content:center}
.main-overlay{width:100%;height:100%;background:linear-gradient(135deg,rgba(0,20,40,.9),rgba(20,0,40,.9));display:flex;align-items:center;justify-content:center}
.main-content{text-align:center;color:var(--white);max-width:800px;padding:var(--gap-xl)}
.main-title{font-size:64px;font-weight:bold;margin-bottom:50px;color:var(--cyan);text-shadow:0 0 30px var(--cyan),0 0 60px #0088ff;animation:titleGlow 3s ease-in-out infinite alternate}
.main-grid{display:grid;grid-template-columns:1fr 1fr;gap:60px;margin-top:var(--gap-xl)}
.game-modes,.main-actions{display:flex;flex-direction:column;align-items:center}
.game-modes h2,.main-actions h2{color:var(--orange);font-size:28px;margin-bottom:var(--gap-lg);text-shadow:0 0 15px var(--orange)}
.mode-btn,.action-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;width:200px;height:200px;margin:var(--gap-sm);background:linear-gradient(135deg,rgba(0,0,0,.8),rgba(30,30,60,.8));border:3px solid;border-radius:20px;cursor:pointer;transition:all .3s ease;text-decoration:none;color:inherit}
.endless-btn{border-color:#ff6600;color:#ff6600}
.endless-btn:hover{border-color:#ff8833;color:#ff8833;box-shadow:0 0 25px rgba(255,102,0,.6);transform:scale(1.05)}
.inventory-btn{border-color:var(--cyan);color:var(--cyan)}
.inventory-btn:hover{border-color:#33ffff;color:#33ffff;box-shadow:0 0 25px rgba(0,255,255,.6);transform:scale(1.05)}
.shop-btn{border-color:var(--orange);color:var(--orange)}
.shop-btn:hover{border-color:#ffcc33;color:#ffcc33;box-shadow:0 0 25px rgba(255,170,0,.6);transform:scale(1.05)}
.mode-btn img,.action-btn img{width:80px;height:80px;margin-bottom:15px;opacity:.8;transition:opacity .3s ease}
.mode-btn:hover img,.action-btn:hover img{opacity:1}
.mode-btn span,.action-btn span{font-size:18px;font-weight:bold;text-shadow:0 0 10px currentColor}
.save-modal{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,.8);z-index:2001;display:flex;align-items:center;justify-content:center}
.save-modal-content{ background:var(--gradient-dark); border:3px solid var(--cyan); border-radius:15px; padding:var(--gap-lg); width:600px; max-height:80vh; overflow-y:auto; box-shadow:var(--glow-cyan); position: relative; }
.save-modal-content .close-btn { position: absolute; top: 0px; right: 0px; z-index: 10; }
.save-modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--gap-md);padding-bottom:var(--gap-sm);border-bottom:2px solid var(--cyan)}
.save-modal-header h2{color:var(--cyan);margin:0;text-shadow:var(--glow-cyan)}
.save-actions{margin-bottom:var(--gap-md)}
.new-game-btn{padding:12px 24px;background:var(--gradient-green);border:none;border-radius:8px;color:var(--black);font-weight:bold;cursor:pointer;transition:all .3s}
.new-game-btn:hover{transform:scale(1.05);box-shadow:var(--glow-green)}
.save-list{max-height:400px;overflow-y:auto}
.no-saves{text-align:center;color:#888;padding:var(--gap-xl);font-style:italic}
.save-item{display:flex;justify-content:space-between;align-items:center;padding:15px;margin-bottom:var(--gap-sm);background:rgba(0,0,0,.3);border:1px solid #333;border-radius:8px;transition:all .3s}
.save-item:hover{border-color:var(--cyan);box-shadow:0 0 10px rgba(0,255,255,.3)}
.save-info{flex:1}
.save-name{font-size:18px;font-weight:bold;color:var(--cyan);margin-bottom:var(--gap-xs)}
.save-details{font-size:14px;color:#aaa;margin-bottom:3px}
.save-details span{margin-right:15px}
.save-date{font-size:12px;color:#666}
.save-actions{display:flex;gap:var(--gap-sm)}
.load-btn,.delete-btn{padding:8px 16px;border:none;border-radius:6px;font-weight:bold;cursor:pointer;transition:all .3s}
.load-btn{background:var(--gradient-blue);color:var(--white)}
.load-btn:hover{transform:scale(1.05);box-shadow:var(--glow-blue)}
.delete-btn{background:var(--gradient-red);color:var(--white)}
.delete-btn:hover{transform:scale(1.05);box-shadow:var(--glow-red)}
.name-modal,.confirm-modal{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,.8);z-index:2002;display:flex;align-items:center;justify-content:center}
.name-modal-content,.confirm-modal-content{background:var(--gradient-dark);border:3px solid var(--cyan);border-radius:15px;padding:var(--gap-lg);text-align:center;box-shadow:var(--glow-cyan)}
.name-modal-content h3,.confirm-modal-content h3{color:var(--cyan);margin-bottom:var(--gap-md);text-shadow:var(--glow-cyan)}
#saveNameInput{width:300px;padding:12px;margin-bottom:var(--gap-md);border:2px solid #666;border-radius:8px;background:rgba(0,0,0,.7);color:var(--white);font-size:16px}
#saveNameInput:focus{border-color:var(--cyan);outline:none;box-shadow:0 0 10px rgba(0,255,255,.3)}
.name-modal-buttons,.confirm-modal-buttons{display:flex;gap:15px;justify-content:center}
.name-modal-buttons button,.confirm-modal-buttons button{padding:12px 24px;border:none;border-radius:8px;font-weight:bold;cursor:pointer;transition:all .3s}
#confirmNameBtn,#confirmDeleteBtn{background:var(--gradient-green);color:var(--black)}
#confirmNameBtn:hover,#confirmDeleteBtn:hover{transform:scale(1.05);box-shadow:var(--glow-green)}
#cancelNameBtn,#cancelDeleteBtn{background:linear-gradient(45deg,#666,#444);color:var(--white)}
#cancelNameBtn:hover,#cancelDeleteBtn:hover{transform:scale(1.05);box-shadow:0 0 15px #666}
@keyframes slideInRight{0%{transform:translateX(100%);opacity:0}100%{transform:translateX(0);opacity:1}}
@keyframes slideOutRight{0%{transform:translateX(0);opacity:1}100%{transform:translateX(100%);opacity:0}}
@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}
@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}
@keyframes glow{0%,100%{opacity:.8}50%{opacity:1}}
@media(max-width:768px){
    .game-title{font-size:48px}
    .save-modal-content{width:90vw;padding:var(--gap-md)}
    .save-item{flex-direction:column;align-items:flex-start;gap:var(--gap-sm)}
    .save-actions{align-self:flex-end}
    .main-grid{grid-template-columns:1fr;gap:var(--gap-lg)}
}

.treasure-grid { display: flex; gap: 10px; margin-bottom: 20px; }
.treasure-slot { width: 80px; height: 80px; border: 2px solid #666; border-radius: 10px; background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.6)); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; transition: all 0.3s ease; }
.treasure-slot.has-item { border-color: var(--purple); box-shadow: 0 0 15px #9933ff44; background: linear-gradient(135deg, rgba(153, 51, 255, 0.1), rgba(100, 0, 200, 0.1)); }
.treasure-slot:hover { border-color: var(--purple); transform: scale(1.05); box-shadow: 0 0 20px #9933ff33; cursor: pointer; }

/* 法宝UI样式 */
.treasure-ui {
    position: static !important;
    z-index: 10;
}

.treasure-ui-slot {
    width: 50px;
    height: 50px;
    border: 2px solid #666;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(40, 0, 80, 0.6));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    pointer-events: none;
}

.treasure-ui-slot.has-treasure {
    border-color: var(--purple);
    box-shadow: 0 0 15px rgba(153, 51, 255, 0.5);
    background: linear-gradient(135deg, rgba(153, 51, 255, 0.2), rgba(100, 0, 200, 0.2));
}

.treasure-ui-slot.ready {
    box-shadow: 0 0 15px rgba(153, 51, 255, 0.8);
    animation: treasurePulse 1.5s infinite;
}

.treasure-ui-slot.cooldown {
    opacity: 0.6;
    border-color: #999;
    box-shadow: none;
}

.treasure-key {
    font-size: 14px;
    font-weight: bold;
    color: var(--purple);
    line-height: 1;
}

.treasure-name {
    font-size: 7px;
    margin-top: 2px;
    text-align: center;
    line-height: 1;
    color: var(--purple);
}

.treasure-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(153, 51, 255, 0.7);
    transition: height 0.1s linear;
    border-radius: 0 0 6px 6px;
}

.treasure-cooldown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: white;
    text-shadow: 0 0 5px black;
    font-weight: bold;
    z-index: 2;
}

@keyframes treasurePulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(153, 51, 255, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(153, 51, 255, 1);
        transform: scale(1.02);
    }
}

/* 响应式设计更新 */
@media (max-width: 768px) {
    .treasure-ui-slot {
        width: 40px;
        height: 40px;
    }
    .treasure-key {
        font-size: 12px;
    }
    .treasure-name {
        font-size: 6px;
    }
}

@keyframes frostSkillEffect {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(0.3); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
}

@keyframes frostCrystal {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) translate(0px, 0px) rotate(0deg) scale(0); 
    }
    30% { 
        opacity: 1; 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) translate(var(--end-x, 0px), var(--end-y, 0px)) rotate(360deg) scale(1.5); 
    }
}

@keyframes frostRing {
    0% { 
        width: 0px; 
        height: 0px; 
        opacity: 1; 
        border-width: 5px;
    }
    50% { 
        width: 350px; 
        height: 350px; 
        opacity: 0.8; 
        border-width: 3px;
    }
    100% { 
        width: 400px; 
        height: 400px; 
        opacity: 0; 
        border-width: 1px;
    }
}

.miracle-realm-btn {
    border-color: #66aaff;
    color: #66aaff;
}

.miracle-realm-btn:hover {
    border-color: #88ccff;
    color: #88ccff;
    box-shadow: 0 0 25px rgba(102, 170, 255, 0.6);
    transform: scale(1.05);
}

.dungeon-status .status-item {
    font-size: 12px;
    color: #aaccdd;
    margin: 2px 0;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 改为3列以容纳新的副本按钮 */
    gap: 40px;
    margin-top: var(--gap-xl);
}

.daily-dungeons {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.daily-dungeons h2 {
    color: var(--orange);
    font-size: 28px;
    margin-bottom: var(--gap-lg);
    text-shadow: 0 0 15px var(--orange);
}

.dungeon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 160px;
    margin: var(--gap-sm);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(30, 30, 60, 0.8));
    border: 3px solid;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.dungeon-btn img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.dungeon-btn:hover img {
    opacity: 1;
}

.dungeon-info span {
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px currentColor;
    margin-bottom: 5px;
}

/* 敌人冰冻特效 - 完整版本 */
.enemy-frost-effect {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 80px !important;
    height: 80px !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: none !important;
    z-index: 100 !important;
}

.enemy-frost-crystal {
    position: absolute !important;
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.9), rgba(255, 255, 255, 0.9)) !important;
    border: 1px solid rgba(0, 255, 255, 0.8) !important;
    border-radius: 2px !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8), inset 0 0 5px rgba(255, 255, 255, 0.5) !important;
    animation: enemyFrostFloat 2s ease-in-out infinite !important;
    pointer-events: none !important;
}

.enemy-frost-ring {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 60px !important;
    height: 60px !important;
    border: 3px solid rgba(0, 255, 255, 0.6) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3) !important;
    transform: translate(-50%, -50%) !important;
    animation: enemyFrostPulse 1.5s ease-in-out infinite !important;
    pointer-events: none !important;
}

@keyframes enemyFrostFloat {
    0%, 100% { 
        opacity: 0.9;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
    }
}

@keyframes enemyFrostPulse {
    0% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
        box-shadow: 0 0 30px rgba(0, 255, 255, 1), inset 0 0 15px rgba(255, 255, 255, 0.5);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
}

.costume-slots { margin-bottom: 20px; }
.costume-grid { display: flex; gap: 10px; margin-bottom: 20px; }
.costume-slot { width: 80px; height: 80px; border: 2px solid #666; border-radius: 10px; background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 40, 0.6)); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; transition: all 0.3s ease; }
.costume-slot.has-item { border-color: var(--cyan); box-shadow: 0 0 15px rgba(0, 255, 255, 0.5); }

/* 角色选择界面样式 */
.character-selection {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
}

.character-selection-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* .character-selection-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--cyan);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--glow-cyan);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
} */

.selection-title {
    color: var(--cyan);
    font-size: 32px;
    margin-bottom: 30px;
    text-shadow: var(--glow-cyan);
}

.character-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.character-card {
    background: linear-gradient(135deg, #0a0a1a, #1a1a2e);
    border: 2px solid var(--cyan);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.character-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
}

.character-preview {
    margin-bottom: 20px;
}

.character-image {
    width: 80px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px var(--cyan));
}

.character-info h3 {
    color: var(--cyan);
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: var(--glow-cyan);
}

/* .character-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
} */

/* .stat-row {
    color: var(--white);
    font-size: 14px;
    margin-bottom: 5px;
    padding: 3px 0;
} */

.character-skills {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.skill-desc {
    color: var(--cyan);
    font-size: 12px;
    margin-bottom: 3px;
    text-shadow: 0 0 5px var(--cyan);
}

.select-character-btn {
    background: linear-gradient(45deg, var(--cyan), #0088cc);
    border: none;
    border-radius: 10px;
    padding: 12px 25px;
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: var(--glow-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.select-character-btn:hover {
    background: linear-gradient(45deg, #00aaff, var(--cyan));
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .character-selection-content {
        padding: 20px;
    }
    
    .selection-title {
        font-size: 24px;
    }
}

/* 确保各界面面板有正确的相对定位 */
.inventory-panel,
.shop-panel,
.factory-panel,
.fleet-panel,
.save-modal-content,
.achievement-panel,
.miracle-realm-panel {
    position: relative;
}

/* 界面头部样式调整，为关闭按钮留出空间 */
.inventory-header,
.shop-header,
.factory-header,
.fleet-header,
.save-modal-header,
.achievement-header,
.realm-header {
    padding-right: 70px !important;
}

/* 特定界面的关闭按钮样式覆盖 */
.fleet-panel .close-btn {
    background: rgba(255, 0, 0, 0.7);
    width: 40px;
    height: 40px;
    font-size: 24px;
}

.fleet-panel .close-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.achievement-panel .close-btn {
    background: linear-gradient(135deg, #ff4444, #cc0000) !important;
    border: 2px solid #ff6666 !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 22px !important;
    font-weight: bold !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 
        0 4px 15px rgba(255, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.achievement-panel .close-btn:hover {
    background: linear-gradient(135deg, #ff6666, #ff0000) !important;
    border-color: #ff8888 !important;
    transform: scale(1.15) rotate(90deg) !important;
    box-shadow: 
        0 0 25px rgba(255, 0, 0, 0.6),
        0 0 40px rgba(255, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* ===== 优化后的主界面样式 ===== */
.main-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-overlay {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 30, 60, 0.95), rgba(0, 10, 30, 0.98)),
                url('assets/space-bg.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.main-overlay::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, transparent 30%, rgba(0, 255, 255, 0.03) 70%);
    animation: rotateGradient 20s linear infinite;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.main-content-wrapper {
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 顶部标题区域 */
.main-header {
    text-align: center;
    margin-bottom: 40px;
    animation: slideDown 0.8s ease-out;
}

.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.title-text {
    font-size: 72px;
    font-weight: 900;
    background: linear-gradient(135deg, #00ffff, #0088ff, #00ffff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
    letter-spacing: 8px;
    animation: titlePulse 3s ease-in-out infinite;
}

.title-subtitle {
    font-size: 18px;
    color: rgba(0, 255, 255, 0.7);
    letter-spacing: 12px;
    font-weight: 300;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.95; }
}

/* 主体内容区域 */
.main-body {
    flex: 1;
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
}

/* 游戏模式区块 */
.main-modes-section,
.main-dungeons-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
}

.section-icon {
    font-size: 32px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.section-header h2 {
    font-size: 28px;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin: 0;
}

/* 模式和副本容器 */
.modes-container,
.dungeons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* 卡片通用样式 */
.mode-card,
.dungeon-card {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.9), rgba(20, 0, 40, 0.9));
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    min-height: 140px;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.mode-card:hover .card-glow,
.dungeon-card:hover .card-glow {
    opacity: 1;
}

.card-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-content img {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 10px currentColor);
    transition: all 0.3s;
}

.card-content h3 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: #00ffff;
    text-shadow: 0 0 15px currentColor;
}

.mode-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* 特定卡片样式 */
.endless-card {
    border-color: #ff6600;
}

.endless-card:hover {
    border-color: #ff8833;
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.5);
    transform: translateY(-5px) scale(1.02);
}

.endless-card .card-content h3 {
    color: #ff8833;
}

.time-vortex-card {
    border-color: #9933ff;
}

.time-vortex-card:hover {
    border-color: #bb55ff;
    box-shadow: 0 0 30px rgba(153, 51, 255, 0.5);
    transform: translateY(-5px) scale(1.02);
}

.time-vortex-card .card-content h3 {
    color: #bb55ff;
}

.miracle-card {
    border-color: #ffaa00;
}

.miracle-card:hover {
    border-color: #ffcc33;
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.5);
    transform: translateY(-5px) scale(1.02);
}

.miracle-card .card-content h3 {
    color: #ffcc33;
}

/* 副本状态信息 */
.dungeon-status-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-tag.available {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.5);
    color: #00ff00;
}

.status-tag.locked {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff6666;
}

/* 底部快捷操作栏 */
.main-footer {
    position: relative;
    padding: 20px 0;
    border-top: 2px solid rgba(0, 255, 255, 0.2);
    animation: slideUp 0.8s ease-out;
}

.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    padding: 0 20px;
}

.quick-action-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, rgba(0, 30, 60, 0.8), rgba(0, 20, 40, 0.8));
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.quick-action-btn:hover::before {
    animation: shimmer 0.6s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.quick-action-btn img {
    width: 40px;
    height: 40px;
    filter: brightness(0.9) drop-shadow(0 0 5px rgba(0, 255, 255, 0.5));
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.quick-action-btn span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.quick-action-btn:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #00ffff;
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.3);
}

.quick-action-btn:hover img {
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(0, 255, 255, 0.8));
    transform: scale(1.1);
}

.quick-action-btn:hover span {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* 工具提示 */
.quick-action-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #00ffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid rgba(0, 255, 255, 0.5);
    animation: tooltipFade 0.3s ease-in-out;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 动画效果 */
@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-body {
        flex-direction: column;
    }
    
    .modes-container,
    .dungeons-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .mode-card,
    .dungeon-card {
        flex: 1 1 300px;
    }
}

@media (max-width: 768px) {
    .title-text {
        font-size: 48px;
        letter-spacing: 4px;
    }
    
    .title-subtitle {
        font-size: 14px;
        letter-spacing: 8px;
    }
    
    .main-body {
        gap: 20px;
    }
    
    .quick-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quick-action-btn {
        width: 70px;
        height: 70px;
    }
    
    .quick-action-btn img {
        width: 30px;
        height: 30px;
    }
    
    .quick-action-btn span {
        font-size: 10px;
    }
    
    .card-content img {
        width: 60px;
        height: 60px;
    }
    
    .card-content h3 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
  .shop-item {
    height: 250px;
  }
  
  .item-icon {
    padding: 15px;
    height: 70px;
  }
  
  .item-icon > * {
    width: 40px !important;
    height: 40px !important;
    font-size: 30px;
  }
  
  .item-name {
    font-size: 14px;
  }
  
  .item-price {
    font-size: 16px;
  }
  
  .buy-btn {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* 商店滚动条美化 */
.shop-content::-webkit-scrollbar {
  width: 12px;
}

.shop-content::-webkit-scrollbar-track {
  background: linear-gradient(180deg, 
    rgba(0, 20, 40, 0.8), 
    rgba(10, 30, 50, 0.8)
  );
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 255, 0.1);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

.shop-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(0, 255, 255, 0.8), 
    rgba(0, 200, 255, 0.6),
    rgba(0, 150, 255, 0.8)
  );
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  box-shadow: 
    0 0 8px rgba(0, 255, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.shop-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(255, 221, 0, 0.9), 
    rgba(255, 165, 0, 0.7),
    rgba(255, 100, 0, 0.9)
  );
  border-color: rgba(255, 221, 0, 0.5);
  box-shadow: 
    0 0 12px rgba(255, 221, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scaleX(1.1);
}

.shop-content::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.9), 
    rgba(0, 255, 255, 0.8),
    rgba(255, 255, 255, 0.9)
  );
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* 商品网格滚动条 - 如果有独立滚动 */
.items-grid::-webkit-scrollbar {
  width: 10px;
}

.items-grid::-webkit-scrollbar-track {
  background: rgba(0, 20, 40, 0.6);
  border-radius: 5px;
  border: 1px solid rgba(0, 255, 255, 0.1);
}

.items-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(0, 255, 255, 0.7), 
    rgba(0, 180, 255, 0.5)
  );
  border-radius: 5px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.items-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(255, 221, 0, 0.8), 
    rgba(255, 165, 0, 0.6)
  );
  border-color: rgba(255, 221, 0, 0.4);
  transform: scaleX(1.1);
}

/* Firefox 滚动条样式 */
.shop-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 255, 0.6) rgba(0, 20, 40, 0.8);
}

.items-grid {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 255, 0.6) rgba(0, 20, 40, 0.6);
}

.shop-panel {
  overflow: hidden !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
}

.stat-value {
    color: #00ff00;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 8px #00ff00;
    /* 新增：让数值居中显示 */
    text-align: center;
    display: block;
    width: 100%;
}

.achievement-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 221, 0, 0.1);
    border: 1px solid #ffdd00;
    border-radius: 8px;
}

.achievement-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    flex: 1;
    /* 确保每个stat-item都有相等的宽度 */
    min-width: 0;
}

/* 成就界面的标签样式 */
.achievement-stats .stat-label {
    color: #ffdd00;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    display: block;
}

/* 成就界面的数值样式 - 关键修改 */
.achievement-stats .stat-value {
    color: #00ff00;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 8px #00ff00;
    text-align: center;
    width: 100%;
    display: block;
    /* 确保span元素居中显示 */
    margin: 0 auto;
}

/* 额外的强制居中样式，以防其他CSS干扰 */
#achievementPoints,
#achievementMedals {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    margin: 0 auto !important;
}

.shop-notification,
.inventory-notification, 
.treasure-notification,
.achievement-notification,
.factory-notification,
.item-drop-notification {
    z-index: 99999 !important;
}

.save-details .combat-power {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

/* 悬停效果 */
.save-item:hover .combat-power {
    color: #ff9999;
    text-shadow: 0 0 10px rgba(255, 153, 153, 0.8);
}

/* 战斗力显示样式 */
.save-combat-power {
   font-size: 16px;
   font-weight: bold;
   color: #FFD700;
   margin: 6px 0;
   text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
   background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
   background-size: 200% 200%;
   background-clip: text;
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   animation: combatPowerGlow 3s ease-in-out infinite;
}

@keyframes combatPowerGlow {
   0%, 100% {
       background-position: 0% 50%;
       filter: brightness(1);
   }
   50% {
       background-position: 100% 50%;
       filter: brightness(1.2);
   }
}
/* 角色选择界面修复 - 覆盖之前的样式 */
.character-selection-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--cyan);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--glow-cyan);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.selection-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
}

.character-card {
    background: linear-gradient(135deg, #0a0a1a, #1a1a2e);
    border: 2px solid var(--cyan);
    border-radius: 15px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.character-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.character-stats .stat-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.character-stats .stat-label {
    font-size: 12px;
    color: #ccc;
    width: 40px;
    text-align: left;
    flex-shrink: 0;
}

.character-stats .stat-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-left: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}


.character-stats .stat-bar.survival {
    background: linear-gradient(90deg, #ff4757, #ff6b7a);
}

.character-stats .stat-bar.damage {
    background: linear-gradient(90deg, #ffa502, #ffb830);
}

.character-stats .stat-bar.skill {
    background: linear-gradient(90deg, #3742fa, #5352ed);
}

.character-skills {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

.character-skills .skill-desc {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 2px;
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--cyan);
    text-shadow: 0 0 5px var(--cyan);
}
.character-stats .stat-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 2px;
    /* 添加这行来确保宽度能正确应用 */
    width: inherit !important;
}

/* 角色选择界面 - 属性点样式 */
.character-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.character-stats .stat-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.character-stats .stat-label {
    font-size: 12px;
    color: #ccc;
    width: 40px;
    text-align: left;
    flex-shrink: 0;
}

/* 属性点容器 */
.stat-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 基础点样式 */
.stat-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

/* 激活状态的点 - 根据属性类型不同颜色 */
.stat-dots .dot.active {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

/* 为不同属性设置不同颜色 */
.stat-item:nth-child(1) .dot.active { /* 生存 - 红色系 */
    background: #ff6b7a;
    border-color: #ff4757;
    box-shadow: 0 0 8px #ff4757;
}

.stat-item:nth-child(2) .dot.active { /* 伤害 - 橙色系 */
    background: #ffb830;
    border-color: #ffa502;
    box-shadow: 0 0 8px #ffa502;
}

.stat-item:nth-child(3) .dot.active { /* 技能 - 蓝色系 */
    background: #5352ed;
    border-color: #3742fa;
    box-shadow: 0 0 8px #3742fa;
}

/* 悬停效果 */
.character-card:hover .stat-dots .dot.active {
    transform: scale(1.2);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.2);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.8;
    }
}

/* 或者使用进度条样式（备选方案） */
.stat-bar-alt {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.stat-bar-alt .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.stat-bar-alt .fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 生存属性条 */
.stat-item:nth-child(1) .stat-bar-alt .fill {
    background: linear-gradient(90deg, #ff4757, #ff6b7a);
}

/* 伤害属性条 */
.stat-item:nth-child(2) .stat-bar-alt .fill {
    background: linear-gradient(90deg, #ffa502, #ffb830);
}

/* 技能属性条 */
.stat-item:nth-child(3) .stat-bar-alt .fill {
    background: linear-gradient(90deg, #3742fa, #5352ed);
}

@keyframes slideInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}