:root {
    --primary: #22c55e;
    --secondary: #84cc16;
    --accent: #ef4444;
    --bg: #bbf7d0;
    --card-bg: rgba(6, 78, 59, 0.85);
    --text: #f8fafc;
    --font-main: 'Outfit', 'Noto Sans SC', sans-serif;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    user-select: none;
}

.hidden { display: none !important; }

/* Lobby & UI remains similar but with green theme */
#lobby-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #065f46 0%, #064e3b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lobby-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 2rem;
    width: 800px;
    max-width: 95vw;
}

/* Kill Feed */
#kill-feed {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    pointer-events: none;
}

.kill-msg {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: #fff;
    font-size: 20px; /* 加大字体 */
    font-weight: bold;
    animation: slideIn 0.3s ease-out forwards;
    border-left: 5px solid #fbbf24;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

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

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-20px); }
    10% { opacity: 1; transform: translateX(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* 设置菜单 */
#settings-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

#settings-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    backdrop-filter: blur(5px);
}

#settings-menu {
    position: absolute;
    top: 50px;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    width: 180px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.menu-header {
    color: #fbbf24;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}

.menu-item {
    color: #eee;
    font-size: 14px;
    margin-bottom: 10px;
}

#settings-menu #leave-btn {
    width: 100%;
    margin: 0;
    margin-top: 10px;
    background: #f87171;
    padding: 10px;
    font-size: 14px;
}

#settings-menu #leave-btn:hover {
    background: #ef4444;
}

/* 排行榜样式 */
#leaderboard-container {
    position: absolute;
    top: 160px; /* 在小地图下方 */
    right: 20px;
    width: 120px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    z-index: 100;
    pointer-events: none;
}

.leaderboard-header {
    font-size: 14px;
    font-weight: bold;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}

.leaderboard-item.me {
    color: #4ade80;
    font-weight: bold;
}

.leaderboard-rank {
    width: 18px;
    color: #94a3b8;
}

.leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 5px;
}

.leaderboard-score {
    font-weight: bold;
    color: #fbbf24;
}

/* Respawn Overlay */
#respawn-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.respawn-content {
    text-align: center;
    animation: pulse 1s infinite alternate;
}

.respawn-content h2 { font-size: 3rem; color: var(--accent); }

/* 摇杆直接定位 */
#joystick-base {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#joystick-stick {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Skill Button */
#skill-wrapper {
    position: absolute;
    bottom: 60px;
    right: 60px;
    z-index: 100;
}

#skill-btn {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: all 0.1s;
}

#skill-btn:active { transform: scale(0.9); }
.skill-icon { font-size: 2rem; }
.skill-name { font-size: 0.7rem; font-weight: bold; }

/* Existing UI adjustments */
.stats-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 1rem;
    pointer-events: auto;
}

#gameCanvas { display: block; background: #bbf7d0; }

/* Utility Buttons */
.room-list { 
    background: rgba(0, 0, 0, 0.3); 
    height: 250px; 
    overflow-y: auto; 
    padding: 15px; 
    border-radius: 12px; 
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.room-item { 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 15px 20px; 
    border-radius: 12px; 
    margin-bottom: 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    cursor: pointer; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.room-item:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.2);
}

.room-item span {
    font-weight: 600;
    color: #fff;
    font-size: 16px;
}

.room-item .player-count-tag {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-primary { background: var(--primary); color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; width: 100%; }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; width: 100%; }
.btn-leave { background: var(--accent); color: white; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; margin-top: 10px; }

.input-group input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.2); color: white; margin-top: 5px; }

/* 更衣室样式 */
.dressing-room {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.skin-list {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    justify-content: center;
}

.skin-item {
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    width: 100px;
}

.skin-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 5px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.skin-item span {
    display: block;
    font-size: 12px;
    color: #cbd5e1;
}

.skin-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.skin-item.active {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.skin-item.active span {
    color: #fbbf24;
    font-weight: bold;
}
