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

body {
    font-family: 'Orbitron', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    z-index: 10;
}

.hud-left, .hud-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hud-item {
    background: linear-gradient(145deg, rgba(20, 25, 45, 0.92), rgba(12, 15, 30, 0.95));
    padding: 10px 18px;
    border-radius: 25px;
    border: 1px solid rgba(78, 204, 163, 0.35);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 20px rgba(78, 204, 163, 0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.hud-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(78, 204, 163, 0.3), transparent);
}

.hud-item:hover {
    border-color: #4ecca3;
    box-shadow: 
        0 6px 20px rgba(78, 204, 163, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 30px rgba(78, 204, 163, 0.1);
    transform: translateY(-2px);
}

.hud-item .hud-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
}

.hud-item .hud-value {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#health, #shield, #level, #exp, #exp-max, #score, #kills, #combo, #wave, #online-players {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

#health {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

#shield {
    color: #64b5f6;
    text-shadow: 0 0 10px rgba(100, 181, 246, 0.5);
}

#level {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#score {
    color: #4ecca3;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
}

#kills {
    color: #ff9800;
    text-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

#combo {
    color: #e91e63;
    text-shadow: 0 0 10px rgba(233, 30, 99, 0.5);
}

#wave {
    color: #9c27b0;
    text-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.label {
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#health {
    color: #ef4444;
    font-weight: bold;
    font-size: 16px;
}

#shield {
    color: #3b82f6;
    font-weight: bold;
    font-size: 16px;
}

#level, #exp, #exp-max, #score, #kills {
    color: #22c55e;
    font-weight: bold;
    font-size: 16px;
}

#combo {
    color: #f59e0b;
    font-weight: bold;
    font-size: 16px;
}

#wave {
    color: #f97316;
    font-weight: bold;
    font-size: 16px;
}

.hud-icon {
    font-size: 14px;
}

#game-canvas {
    display: block;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 100%);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#start-screen, #game-over-screen, #upgrade-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.98) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(20px);
}

#start-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(78, 204, 163, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33, 150, 243, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 152, 0, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 42px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #4ecca3, #2196f3, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(78, 204, 163, 0.3);
    letter-spacing: 5px;
    animation: glow 2s ease-in-out infinite alternate;
}

h2 {
    font-size: 20px;
    color: #8892b0;
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 20px rgba(78, 204, 163, 0.3)); }
    to { filter: drop-shadow(0 0 40px rgba(78, 204, 163, 0.6)); }
}

p {
    font-size: 16px;
    margin-bottom: 30px;
    color: #a8b2d1;
    text-align: center;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.game-hint {
    font-size: 13px;
    color: #555;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.copyright {
    font-size: 12px;
    color: #667085;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-top: 20px;
    text-align: center;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.copyright:hover {
    opacity: 1;
    color: #8892b0;
}

.logo-container {
    text-align: center;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.menu-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    padding: 15px 20px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 100px;
}

.btn-icon {
    font-size: 22px;
}

.btn-text {
    font-size: 11px;
}

.btn-main {
    background: linear-gradient(135deg, #4ecca3, #3db591);
    color: #0f0f1a;
    box-shadow: 
        0 3px 14px rgba(78, 204, 163, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-main:hover {
    background: linear-gradient(135deg, #5decc9, #4ecca3);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 22px rgba(78, 204, 163, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-main.btn-alt {
    background: linear-gradient(135deg, #495670, #3d475c);
    color: #a8b2d1;
    box-shadow: 
        0 3px 14px rgba(73, 86, 112, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-main.btn-alt:hover {
    background: linear-gradient(135deg, #5a6782, #495670);
    box-shadow: 
        0 8px 22px rgba(73, 86, 112, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(78, 204, 163, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: transparent;
    color: #a8b2d1;
    border: 2px solid rgba(78, 204, 163, 0.35);
    min-width: 100px;
}

.btn-secondary:hover {
    background: rgba(78, 204, 163, 0.1);
    border-color: #4ecca3;
    color: #4ecca3;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(78, 204, 163, 0.18);
}

.btn-logout {
    background: transparent;
    color: #ff6b6b;
    border: 1.5px solid rgba(255, 107, 107, 0.3);
    min-width: 100px;
}

.btn-logout:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: #ff6b6b;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(255, 107, 107, 0.18);
}

#upgrade-options {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 40px;
}

.upgrade-option {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.15), rgba(78, 204, 163, 0.05));
    border: 2px solid rgba(78, 204, 163, 0.3);
    padding: 25px 35px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 220px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    animation: upgradeAppear 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes upgradeAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upgrade-option:nth-child(1) { animation-delay: 0.1s; }
.upgrade-option:nth-child(2) { animation-delay: 0.2s; }
.upgrade-option:nth-child(3) { animation-delay: 0.3s; }

.upgrade-option::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(78, 204, 163, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.upgrade-option:hover {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.35), rgba(78, 204, 163, 0.2));
    border-color: #4ecca3;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 20px 50px rgba(78, 204, 163, 0.35),
        0 0 30px rgba(78, 204, 163, 0.2);
}

.upgrade-option:hover::before {
    animation-duration: 1s;
}

.upgrade-option:active {
    transform: translateY(-4px) scale(1.02);
}

.upgrade-option h3 {
    color: #4ecca3;
    margin-bottom: 12px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
    position: relative;
    z-index: 1;
}

.upgrade-option p {
    font-size: 14px;
    margin: 0;
    color: #a8b2d1;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

#chat-container {
    position: absolute;
    bottom: 80px;
    left: 20px;
    z-index: 10;
    width: 350px;
}

#chat-messages {
    background: rgba(15, 15, 35, 0.9);
    border: 2px solid rgba(78, 204, 163, 0.3);
    border-radius: 10px 10px 0 0;
    padding: 15px;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: -2px;
}

.chat-message {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(78, 204, 163, 0.1);
    border-radius: 8px;
    font-size: 14px;
}

.chat-message .sender {
    color: #4ecca3;
    font-weight: bold;
    margin-right: 8px;
}

.chat-message .content {
    color: #a8b2d1;
}

#chat-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(78, 204, 163, 0.3);
    border-radius: 0 0 10px 10px;
    background: rgba(15, 15, 35, 0.9);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input:focus {
    border-color: #4ecca3;
    box-shadow: 0 0 15px rgba(78, 204, 163, 0.3);
}

#chat-input::placeholder {
    color: #555;
}

#room-input-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.98) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(20px);
}

#room-input-screen h2 {
    color: #4ecca3;
    margin-bottom: 25px;
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#room-id-input {
    width: 350px;
    padding: 18px;
    border: 2px solid rgba(78, 204, 163, 0.3);
    border-radius: 12px;
    background: rgba(15, 15, 35, 0.8);
    color: #fff;
    font-size: 22px;
    text-align: center;
    outline: none;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

#room-id-input:focus {
    border-color: #4ecca3;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.3);
}

#online-players {
    color: #4ecca3;
    font-weight: bold;
    font-size: 20px;
}

#multiplayer-status {
    border-color: rgba(33, 150, 243, 0.5);
}

#start-screen button + button {
    margin-left: 15px;
}

#create-room-screen, #room-list-screen, #lobby-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.98) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(20px);
}

#create-room-screen h2, #room-list-screen h2 {
    color: #4ecca3;
    margin-bottom: 30px;
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#rooms-list {
    width: 80%;
    max-width: 650px;
    max-height: 450px;
    overflow-y: auto;
    margin-bottom: 25px;
}

.room-item {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.1), rgba(78, 204, 163, 0.05));
    border: 2px solid rgba(78, 204, 163, 0.2);
    padding: 20px 25px;
    margin-bottom: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-item:hover {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.2), rgba(78, 204, 163, 0.1));
    border-color: #4ecca3;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(78, 204, 163, 0.2);
}

.room-item h3 {
    color: #4ecca3;
    margin-bottom: 8px;
    font-size: 20px;
    letter-spacing: 1px;
}

.room-item p {
    color: #8892b0;
    font-size: 15px;
    margin: 0;
}

.room-item .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 8px;
}

.room-item .status.waiting {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.room-item .status.ready {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
}

.room-item .status.playing {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

#custom-room-id {
    width: 350px;
    padding: 18px;
    border: 2px solid rgba(78, 204, 163, 0.3);
    border-radius: 12px;
    background: rgba(15, 15, 35, 0.8);
    color: #fff;
    font-size: 20px;
    text-align: center;
    outline: none;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

#custom-room-id:focus {
    border-color: #4ecca3;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.3);
}

#lobby-players {
    margin-bottom: 25px;
    width: 300px;
}

.player-item {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.1), rgba(78, 204, 163, 0.05));
    border: 1px solid rgba(78, 204, 163, 0.2);
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 10px;
    color: #a8b2d1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-item.current {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.2);
}

.player-item.current::after {
    content: 'YOU';
    font-size: 12px;
    color: #4ecca3;
    font-weight: bold;
    background: rgba(78, 204, 163, 0.3);
    padding: 4px 10px;
    border-radius: 10px;
}

#connection-status {
    position: absolute;
    top: 70px;
    right: 15px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 10;
    background: rgba(15, 15, 35, 0.85);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(78, 204, 163, 0.3);
    backdrop-filter: blur(15px);
}

#connection-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    animation: pulse-red 1s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 5px #ff6b6b; }
    50% { box-shadow: 0 0 15px #ff6b6b; }
}

#connection-indicator.connected {
    background: #4ecca3;
    animation: pulse-green 1s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 5px #4ecca3; }
    50% { box-shadow: 0 0 15px #4ecca3; }
}

#connection-text {
    color: #a8b2d1;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#login-screen, #register-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.99) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    backdrop-filter: blur(20px);
}

#login-screen::before, #register-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(78, 204, 163, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33, 150, 243, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 152, 0, 0.05) 0%, transparent 70%);
}

.auth-container {
    background: rgba(20, 20, 40, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(78, 204, 163, 0.2);
    backdrop-filter: blur(15px);
    padding: 20px 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.35),
        0 0 50px rgba(78, 204, 163, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 16px;
}

.auth-logo {
    font-size: 32px;
    margin-bottom: 6px;
    animation: bounce 2s ease-in-out infinite;
}

.auth-subtitle {
    font-size: 10px;
    color: #555;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-size: 12px;
    color: #778899;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.form-input {
    padding: 10px 14px;
    border: 1.5px solid rgba(78, 204, 163, 0.2);
    border-radius: 10px;
    background: rgba(15, 15, 26, 0.8);
    color: #e6f1ff;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #4ecca3;
    box-shadow: 
        0 0 0 2px rgba(78, 204, 163, 0.1),
        0 0 15px rgba(78, 204, 163, 0.15);
}

.form-input::placeholder {
    color: #444;
}

.btn-auth-primary {
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4ecca3, #3db591);
    color: #0f0f1a;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 3px 12px rgba(78, 204, 163, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-auth-primary:hover {
    background: linear-gradient(135deg, #5decc9, #4ecca3);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(78, 204, 163, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-auth-secondary {
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #495670, #3d475c);
    color: #a8b2d1;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 3px 12px rgba(73, 86, 112, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-auth-secondary:hover {
    background: linear-gradient(135deg, #5a6782, #495670);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(73, 86, 112, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-auth-outline {
    padding: 10px;
    border: 1.5px solid rgba(78, 204, 163, 0.35);
    border-radius: 10px;
    background: transparent;
    color: #a8b2d1;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-auth-outline:hover {
    background: rgba(78, 204, 163, 0.1);
    border-color: #4ecca3;
    color: #4ecca3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.15);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.auth-divider span {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#leaderboard-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.98) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 25;
    backdrop-filter: blur(20px);
}

#leaderboard-screen h2 {
    color: #4ecca3;
    margin-bottom: 30px;
    font-size: 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#leaderboard-list {
    width: 80%;
    max-width: 600px;
    max-height: 500px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.1), rgba(78, 204, 163, 0.05));
    border: 1px solid rgba(78, 204, 163, 0.2);
    padding: 18px 25px;
    margin-bottom: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(78, 204, 163, 0.15);
    border-color: rgba(78, 204, 163, 0.4);
}

.leaderboard-item .rank {
    font-size: 28px;
    font-weight: bold;
    width: 50px;
    text-align: center;
}

.leaderboard-item .rank:nth-child(-n+3) {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-item .name {
    flex: 1;
    color: #fff;
    font-size: 18px;
    margin-left: 20px;
}

.leaderboard-item .score {
    color: #4ecca3;
    font-size: 20px;
    font-weight: bold;
    margin-left: 20px;
}

.leaderboard-item .kills {
    color: #ff9800;
    font-size: 16px;
    margin-left: 15px;
}

#admin-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.98) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 25;
    padding: 30px;
    overflow-y: auto;
}

#admin-panel h1 {
    margin-bottom: 30px;
}

.admin-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(20, 20, 40, 0.6);
    padding: 8px;
    border-radius: 12px;
}

.tab-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    background: rgba(78, 204, 163, 0.1);
    color: #8892b0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-btn.active {
    background: linear-gradient(135deg, #4ecca3, #3db591);
    color: #0f0f1a;
}

.tab-content {
    width: 90%;
    max-width: 1000px;
}

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

.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.1), rgba(78, 204, 163, 0.05));
    border: 1px solid rgba(78, 204, 163, 0.2);
    padding: 20px 25px;
    margin-bottom: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.admin-user-item:hover {
    background: rgba(78, 204, 163, 0.15);
    border-color: rgba(78, 204, 163, 0.4);
}

.admin-user-item .user-info {
    flex: 1;
}

.admin-user-item .user-info h4 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.admin-user-item .user-info p {
    color: #8892b0;
    margin: 5px 0 0 0;
    font-size: 14px;
}

.admin-user-item .user-stats {
    display: flex;
    gap: 25px;
    color: #4ecca3;
    font-size: 14px;
}

.admin-user-item .user-actions {
    display: flex;
    gap: 12px;
}

.admin-user-item .user-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-promote {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: #fff;
}

.btn-promote:hover {
    background: linear-gradient(135deg, #42a5f5, #2196f3);
}

.btn-demote {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
}

.btn-demote:hover {
    background: linear-gradient(135deg, #ffa726, #ff9800);
}

.btn-delete {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #ff8787, #ff6b6b);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.15), rgba(78, 204, 163, 0.05));
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(78, 204, 163, 0.2);
    border-color: #4ecca3;
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.stat-card .stat-value {
    font-size: 56px;
    font-weight: bold;
    background: linear-gradient(135deg, #4ecca3, #2196f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: #8892b0;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

.log-item {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.1), rgba(78, 204, 163, 0.05));
    border-left: 4px solid #4ecca3;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
}

.log-item:hover {
    background: rgba(78, 204, 163, 0.15);
    border-left-color: #5decc9;
}

.log-item .log-time {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.log-item .log-action {
    color: #4ecca3;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-item .log-details {
    color: #a8b2d1;
    margin-top: 10px;
    font-size: 14px;
}

.game-over-content {
    text-align: center;
}

.game-over-content h1 {
    font-size: 64px;
    margin-bottom: 10px;
}

.game-over-content p {
    font-size: 24px;
    margin: 15px 0;
}

.game-over-content .stats {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.game-over-content .stat {
    text-align: center;
}

.game-over-content .stat .value {
    font-size: 48px;
    font-weight: bold;
    color: #4ecca3;
}

.game-over-content .stat .label {
    font-size: 14px;
    color: #8892b0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.enemy-intro {
    position: absolute;
    top: 100px;
    right: 20px;
    transform: none;
    background: rgba(15, 15, 35, 0.9);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1.5px solid #4ecca3;
    text-align: left;
    z-index: 50;
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease;
    max-width: 280px;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.enemy-intro h3 {
    font-size: 16px;
    color: #4ecca3;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.enemy-intro p {
    font-size: 13px;
    color: #a8b2d1;
    line-height: 1.4;
    margin: 0;
}

.progress-bar {
    width: 200px;
    height: 10px;
    background: rgba(78, 204, 163, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecca3, #2196f3);
    border-radius: 5px;
    transition: width 0.3s ease;
}

#evolution-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(15, 15, 35, 0.98) 0%, rgba(10, 10, 25, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 35;
    backdrop-filter: blur(20px);
}

#evolution-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, var(--evolution-color, #ff9800)20%, transparent 70%);
    opacity: 0.15;
    animation: evolutionPulse 2s ease-in-out infinite;
}

@keyframes evolutionPulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.1); }
}

.evolution-container {
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.98));
    border: 2px solid var(--evolution-color, #ff9800);
    border-radius: 25px;
    padding: 50px 60px;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 0 60px rgba(255, 152, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: evolutionAppear 0.6s ease-out;
}

@keyframes evolutionAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.evolution-header {
    margin-bottom: 30px;
}

.evolution-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: evolutionFloat 3s ease-in-out infinite;
}

@keyframes evolutionFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#evolution-title {
    font-size: 42px;
    color: var(--evolution-color, #ff9800);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 30px var(--evolution-color, #ff9800);
    margin-bottom: 10px;
}

.evolution-name {
    font-size: 18px;
    color: #a8b2d1;
    letter-spacing: 2px;
}

.evolution-content {
    margin-bottom: 35px;
}

.evolution-desc {
    font-size: 18px;
    color: #cce5ff;
    line-height: 1.6;
    max-width: 400px;
}

.btn-evolution {
    padding: 16px 50px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--evolution-color, #ff9800), #ff6b35);
    color: #0f0f1a;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 5px 20px rgba(255, 152, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-evolution:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(255, 152, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mobile-controls {
    display: none;
}

@media (max-width: 768px), (max-height: 500px) {
    h1 {
        font-size: 36px;
    }
    
    .hud-item {
        padding: 6px 12px;
        font-size: 12px;
        min-width: auto;
    }
    
    .hud-item .hud-icon {
        font-size: 14px;
    }
    
    .hud-item .hud-value {
        font-size: 12px;
    }
    
    button {
        padding: 10px 20px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .btn-icon {
        font-size: 18px;
    }
    
    .btn-text {
        font-size: 10px;
    }
    
    .auth-container {
        width: 92%;
        padding: 20px 25px;
    }
    
    .auth-logo {
        font-size: 30px;
    }
    
    .form-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .btn-auth-primary,
    .btn-auth-secondary,
    .btn-auth-outline {
        padding: 11px;
        font-size: 13px;
    }
    
    .menu-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .upgrade-option {
        min-width: 140px;
        padding: 18px 20px;
    }
    
    .upgrade-option h3 {
        font-size: 15px;
    }
    
    .upgrade-option p {
        font-size: 12px;
    }
    
    #chat-container {
        width: calc(100% - 20px);
        bottom: 130px;
        left: 10px;
    }
    
    .mobile-controls {
        display: flex;
        position: absolute;
        bottom: 20px;
        left: 0;
        right: 0;
        justify-content: space-between;
        padding: 0 max(20px, 4vw);
        z-index: 50;
        touch-action: manipulation;
        -webkit-touch-action: manipulation;
        pointer-events: auto;
    }
    
    #movement-pad {
        position: relative;
        width: clamp(100px, 28vw, 150px);
        height: clamp(100px, 28vw, 150px);
        background: rgba(30, 30, 60, 0.85);
        border-radius: 50%;
        border: 2px solid rgba(78, 204, 163, 0.4);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        touch-action: none;
        cursor: pointer;
    }
    
    #joystick-inner {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: clamp(35px, 10vw, 55px);
        height: clamp(35px, 10vw, 55px);
        background: rgba(78, 204, 163, 0.4);
        border-radius: 50%;
        border: 2px solid rgba(78, 204, 163, 0.6);
        transition: all 0.05s ease;
    }
    
    .pad-btn {
        position: absolute;
        width: clamp(30px, 8vw, 50px);
        height: clamp(30px, 8vw, 50px);
        min-width: 30px;
        min-height: 30px;
        background: rgba(78, 204, 163, 0.25);
        border: 2px solid rgba(78, 204, 163, 0.5);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(14px, 4vw, 22px);
        color: #4ecca3;
        cursor: pointer;
        transition: all 0.15s ease;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto;
    }
    
    .pad-btn:active,
    .pad-btn.active {
        background: rgba(78, 204, 163, 0.5);
        transform: scale(0.92);
        box-shadow: 0 0 20px rgba(78, 204, 163, 0.4);
    }
    
    .up-btn { top: clamp(5px, 2vw, 10px); left: 50%; transform: translateX(-50%); }
    .down-btn { bottom: clamp(5px, 2vw, 10px); left: 50%; transform: translateX(-50%); }
    .left-btn { left: clamp(5px, 2vw, 10px); top: 50%; transform: translateY(-50%); }
    .right-btn { right: clamp(5px, 2vw, 10px); top: 50%; transform: translateY(-50%); }
    
    .pad-center {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: clamp(25px, 6vw, 35px);
        height: clamp(25px, 6vw, 35px);
        background: rgba(78, 204, 163, 0.15);
        border-radius: 50%;
    }
    
    .shoot-btn {
        width: clamp(70px, 18vw, 100px);
        height: clamp(70px, 18vw, 100px);
        min-width: 70px;
        min-height: 70px;
        background: rgba(255, 107, 107, 0.8);
        border: 2px solid rgba(255, 107, 107, 0.6);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        cursor: pointer;
        transition: all 0.15s ease;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto;
    }
    
    .shoot-btn:active,
    .shoot-btn.active {
        background: rgba(255, 107, 107, 0.95);
        transform: scale(0.94);
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    }
    
    .shoot-icon {
        font-size: clamp(22px, 8vw, 32px);
    }
    
    .evolution-container {
        padding: 35px 25px;
        margin: 0 20px;
    }
    
    #evolution-title {
        font-size: 28px;
    }
    
    .evolution-icon {
        font-size: 56px;
    }
    
    /* 防止移动端双击缩放和长按菜单 */
    body {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-text-size-adjust: none;
        text-size-adjust: none;
    }
    
    /* 横屏优化 */
    @media (orientation: landscape) and (max-height: 500px) {
        .mobile-controls {
            bottom: 10px;
        }
        
        #movement-pad {
            width: clamp(80px, 22vh, 120px);
            height: clamp(80px, 22vh, 120px);
        }
        
        .shoot-btn {
            width: clamp(60px, 16vh, 90px);
            height: clamp(60px, 16vh, 90px);
        }
    }
    
    /* 小屏幕优化 */
    @media (max-width: 480px) {
        .hud-item {
            padding: 4px 8px;
            font-size: 11px;
        }
        
        .hud-item .hud-icon {
            font-size: 13px;
        }
    }
    
    /* 性能优化 */
    .pad-btn,
    .shoot-btn,
    #joystick-inner {
        will-change: transform;
    }
}

.btn-evolution {
    padding: 12px 35px;
    font-size: 15px;
}

#pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 25;
    backdrop-filter: blur(10px);
}

.pause-container {
    text-align: center;
    animation: pauseSlideIn 0.3s ease-out;
}

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

#pause-screen h1 {
    font-size: 48px;
    margin-bottom: 10px;
    animation: pausePulse 2s ease-in-out infinite;
}

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

.pause-hint {
    color: #a8b2d1;
    font-size: 16px;
    margin-bottom: 30px;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pause-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.pause-stat {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.15), rgba(78, 204, 163, 0.05));
    border: 2px solid rgba(78, 204, 163, 0.3);
    padding: 20px 30px;
    border-radius: 15px;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.pause-stat .stat-label {
    display: block;
    font-size: 14px;
    color: #a8b2d1;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pause-stat .stat-value {
    display: block;
    font-size: 28px;
    color: #4ecca3;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
}

.btn-pause {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.2), rgba(78, 204, 163, 0.1));
    border: 2px solid rgba(78, 204, 163, 0.5);
    color: #4ecca3;
    padding: 15px 50px;
    font-size: 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-pause:hover {
    background: linear-gradient(145deg, rgba(78, 204, 163, 0.4), rgba(78, 204, 163, 0.2));
    border-color: #4ecca3;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(78, 204, 163, 0.3);
}

.btn-pause:active {
    transform: translateY(-1px);
}

.btn-pause.btn-secondary {
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.2), rgba(255, 107, 107, 0.1));
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
}

.btn-pause.btn-secondary:hover {
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.4), rgba(255, 107, 107, 0.2));
    border-color: #ff6b6b;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

@media (max-width: 600px) {
    #pause-screen h1 {
        font-size: 32px;
    }
    
    .pause-stats {
        gap: 15px;
    }
    
    .pause-stat {
        padding: 15px 20px;
        min-width: 100px;
    }
    
    .pause-stat .stat-value {
        font-size: 22px;
    }
    
    .btn-pause {
        padding: 12px 30px;
        font-size: 16px;
        min-width: 160px;
    }
}