body {
    margin: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0c0c0c, #1a1a2e, #16213e);
}

#top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 70px;
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(25,25,112,0.8));
    color: white;
    z-index: 100;
    padding: 0 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#nav-left {
    display: flex;
    align-items: center;
    flex: 1;
}

#nav-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    filter: brightness(1.2);
}

#nav-center {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.nav-btn {
    font-size: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
}

.nav-btn:hover {
    background: linear-gradient(135deg, #0b7dda, #0bc4e2);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(33, 150, 243, 0.5);
}

.start-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.start-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.5);
}

#nav-right {
    display: flex;
    align-items: center;
}

#nav-right #user-info {
    text-align: right;
}

.logout-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    box-shadow: 0 6px 15px rgba(244, 67, 54, 0.5);
}

#hero-section {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(25,25,112,0.5), rgba(0,0,0,0.9));
    overflow: hidden;
    z-index: 10;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.stars::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(2px 2px at 20px 30px, #eee, transparent),
                      radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
                      radial-gradient(1px 1px at 90px 40px, #fff, transparent),
                      radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
                      radial-gradient(2px 2px at 160px 30px, #eee, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    background: linear-gradient(135deg, #fff, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #ccc;
}

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

.setup-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.setup-section h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #2196F3;
}

.setup-btn, .difficulty-btn {
    font-size: 1.2rem;
    padding: 15px 30px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.setup-btn:hover, .difficulty-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.launch-btn {
    font-size: 1.5rem;
    padding: 20px 40px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.launch-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
}

.game-info {
    max-width: 600px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
}

.ranking-sidebar {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    z-index: 2;
}

#ranking {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    color: white;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#ranking h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #2196F3;
}

#ranking-list {
    font-size: 1rem;
    line-height: 1.4;
}

#ranking-list p {
    margin: 5px 0;
}

#speed-selector {
    margin-bottom: 20px;
    text-align: center;
}

#speed-selector p {
    font-size: 16px;
    margin-bottom: 10px;
    color: white;
    font-family: Arial, sans-serif;
}

#speedBtn {
    font-size: 18px;
    padding: 12px 24px;
    background-color: #2196F3;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#speedBtn:hover {
    background-color: #0b7dda;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 15;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #333, #555);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: white;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
}

.close-modal:hover {
    color: white;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #2196F3;
}

.speed-option {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.speed-option:hover {
    background: linear-gradient(135deg, #0b7dda, #0bc4e2);
    transform: translateY(-2px);
}

#nickname-input {
    margin-bottom: 20px;
    text-align: left;
}

#nickname-input p {
    font-size: 16px;
    margin-bottom: 10px;
    color: white;
    font-family: Arial, sans-serif;
}

#nicknameField {
    font-size: 18px;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    text-align: center;
    width: 200px;
}

#menu-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 33.33%;
    padding-right: 20px;
}

#menu-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 33.33%;
    padding-left: 20px;
    padding-right: 20px;
    text-align: center;
}

#menu-center p {
    font-size: 18px;
    line-height: 1.5;
    max-width: 400px;
    margin-bottom: 20px;
}

#menu-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    width: 33.33%;
    padding-left: 20px;
    padding-right: 20px;
    text-align: right;
}

#menu-right p {
    font-size: 18px;
    line-height: 1.5;
    max-width: 400px;
    margin-bottom: 20px;
    text-align: left;
}

#ranking {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    color: white;
    font-family: Arial, sans-serif;
    max-width: 400px;
}

#ranking h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

#ranking-list {
    font-size: 14px;
    line-height: 1.4;
}

#ranking-list p {
    margin: 0;
    font-size: 14px;
}

#menu h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

#menu h2 {
    font-size: 24px;
    margin-bottom: 40px;
}

#naves-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    background-image: url('assets/images/menu.png');
    background-size: cover;
    background-position: center;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 10;
    padding: 20px;
}

#naves-menu h2 {
    font-size: 36px;
    margin-bottom: 30px;
    text-align: center;
}

#ships-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.ship-item {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
}

.ship-item img {
    width: 300px;
    height: 300px;
    object-fit: contain;
    border-radius: 5px;
}

.ship-item h3 {
    font-size: 18px;
    margin: 10px 0;
}

.ship-item p {
    font-size: 14px;
    margin: 5px 0;
}

.ship-item.locked {
    opacity: 0.5;
}

.ship-item.locked h3 {
    color: grey;
}

.ship-item.locked p {
    color: grey;
}

#backToHomeBtn {
    font-size: 18px;
    padding: 12px 24px;
    background-color: #2196F3;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

#backToHomeBtn:hover {
    background-color: #0b7dda;
}

#menu button {
    font-size: 20px;
    padding: 15px 30px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    background-color: #2196F3;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#menu button:hover {
    background-color: #0b7dda;
}

/* Auth styles */
#login, #register {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('assets/images/menu.png');
    background-size: cover;
    background-position: center;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 10;
}

#login-content, #register-content {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

#login-content h1, #register-content h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

#login-content h2, #register-content h2 {
    font-size: 24px;
    margin-bottom: 30px;
}

#loginForm, #registerForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#loginForm input, #registerForm input {
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    text-align: center;
}

#loginForm button, #registerForm button {
    padding: 12px;
    font-size: 18px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#loginForm button:hover, #registerForm button:hover {
    background-color: #0b7dda;
}

#login-content p, #register-content p {
    margin-top: 20px;
    font-size: 14px;
}

#login-content a, #register-content a {
    color: #2196F3;
    text-decoration: none;
}

#login-content a:hover, #register-content a:hover {
    text-decoration: underline;
}

#error-message {
    margin-top: 15px;
    font-size: 14px;
    color: red;
}

/* User info styles */
#user-info {
    margin-bottom: 20px;
    text-align: center;
}

#welcome-message {
    font-size: 18px;
    margin-bottom: 10px;
}

#logoutBtn {
    font-size: 14px;
    padding: 8px 16px;
    background-color: #2196F3;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#logoutBtn:hover {
    background-color: #0b7dda;
}

#menu button.selected {
    background-color: #45a049;
}

canvas {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 70px);
    background-color: black;
    display: none;
}

.game-over-content {
    max-width: 500px;
}

.game-over-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.game-over-content button {
    font-size: 1.2rem;
    padding: 15px 30px;
    margin: 10px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-over-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

/* Responsive Styles */
@media (max-width: 768px) {
    #top-nav {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    #nav-center {
        margin-top: 10px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    #hero-section {
        top: 120px;
        height: calc(100vh - 120px);
        flex-direction: column;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .game-setup {
        flex-direction: column;
        gap: 20px;
    }

    .difficulty-buttons {
        flex-direction: column;
        width: 100%;
    }

    .ranking-sidebar {
        position: static;
        transform: none;
        margin-top: 20px;
        width: 90%;
    }

    #ranking {
        max-width: 100%;
    }
}
