/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #121212;
    color: #ffffff;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.hidden {
    display: none;
}

/* Login Screen */
.login-box {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.5);
    border: 1px solid #3333ff;
}

.login-box h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #9370DB;
}

.login-box h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #7B68EE;
}

.form-group {
    margin-bottom: 1.5rem;
}

#player-name {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid #7B68EE;
    background-color: #333;
    color: #fff;
    font-size: 1rem;
}

#start-button {
    width: 100%;
    padding: 0.8rem;
    background-color: #7B68EE;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

#start-button:hover {
    background-color: #9370DB;
}

.menu-buttons {
    margin: 1rem 0;
}

.leaderboard-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: #FFD700;
    color: #000;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s;
    border: 2px solid #FFD700;
}

.leaderboard-button:hover {
    background-color: #FFA500;
    border-color: #FFA500;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.game-over-buttons .leaderboard-button {
    width: 100%;
    text-align: center;
}

.game-info {
    margin-top: 1.5rem;
    line-height: 1.5;
    color: #aaa;
}

/* Game Screen */
#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    touch-action: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    padding: 1rem;
}

/* Player Stats */
#player-stats {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 300px;
}

.health-bar, .exp-bar {
    height: 20px;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #666;
}

.health-fill {
    height: 100%;
    width: 100%; /* Will be adjusted by JS */
    background-color: #ff3333;
}

.exp-fill {
    height: 100%;
    width: 0; /* Will be adjusted by JS */
    background-color: #33cc33;
}

.stats-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    margin-bottom: 0.8rem;
}

/* 玩家能力状态栏样式 */
.player-abilities {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 0.6rem;
    border: 1px solid #7B68EE;
    margin-top: 0.2rem;
}

.ability-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: #ddd;
}

.ability-item:last-child {
    margin-bottom: 0;
}

.ability-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.ability-name {
    flex: 1;
}

.ability-value {
    font-weight: bold;
    color: #7B68EE;
    margin-right: 0.2rem;
}

.ability-unit {
    color: #aaa;
    font-size: 0.8rem;
}

/* Online Players */
#online-players {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid #3333ff;
}

/* 击杀消息公屏 */
#kill-feed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    max-height: 200px;
    overflow-y: auto;
    pointer-events: none;
    z-index: 10;
}

.kill-feed-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.kill-message {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    animation: fadeInOut 3s ease-in-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 隐藏滚动条但保持滚动功能 */
#kill-feed::-webkit-scrollbar {
    display: none;
}

#kill-feed {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.kill-message .kill-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.kill-message.system-kill {
    border-left: 4px solid #FFD700;
    background-color: rgba(0, 0, 0, 0.85);
}

.kill-message .killer {
    font-weight: bold;
    color: #7B68EE;
    margin-right: 4px;
}

.kill-message .kill-text {
    color: #ffffff;
    margin: 0 4px;
}

.kill-message .victim {
    color: #FF6347;
    margin-left: 4px;
}

.kill-message .system-message {
    color: #FFD700; /* 系统消息使用金色 */
    font-style: italic;
}

/* 添加进入动画 */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(30px); }
    10% { opacity: 1; transform: translateX(0); }
    20% { transform: scale(1.05); }
    30% { transform: scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Mobile Styles */
@media (max-width: 768px) {
    #player-stats {
        width: 200px;
    }
    
    .stats-text {
        font-size: 0.8rem;
    }
    
    .player-abilities {
        padding: 0.4rem;
    }
    
    .ability-item {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
    
    .ability-icon {
        font-size: 0.9rem;
        margin-right: 0.3rem;
    }
    
    #kill-feed {
        width: 250px;
        bottom: 100px;
    }
    
    .kill-message {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .kill-message .kill-icon {
        font-size: 16px;
    }
}

/* Upgrade Screen */
.upgrade-box {
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.5);
    border: 1px solid #3333ff;
}

.upgrade-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #9370DB;
    font-size: 2rem;
}

.upgrade-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.upgrade-option {
    background-color: rgba(50, 50, 80, 0.7);
    border-radius: 5px;
    padding: 1rem;
    border: 1px solid #7B68EE;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.upgrade-option:hover {
    background-color: rgba(70, 70, 100, 0.9);
    transform: scale(1.05);
}

.upgrade-option h3 {
    margin-bottom: 0.5rem;
    color: #ddd;
}

.upgrade-option p {
    color: #aaa;
    font-size: 0.9rem;
}

/* Game Over Screen */
.game-over-box {
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    border: 1px solid #ff3333;
}

.game-over-box h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ff3333;
}

#final-stats {
    margin: 1.5rem 0;
    line-height: 1.8;
    font-size: 1.1rem;
}

#restart-button {
    width: 100%;
    padding: 0.8rem;
    background-color: #7B68EE;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

#restart-button:hover {
    background-color: #9370DB;
}

/* 断开连接提示样式 */
.disconnect-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #ff3333;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 1000;
    border: 2px solid #ff3333;
    text-align: center;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

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