/* Font declarations */
@font-face {
    font-family: 'Starjedi';
    src: url('../fonts/Starjedi.woff') format('woff'),
        url('../fonts/Starjedi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background-color: #0d0d26;
    overflow: hidden;
    height: 100vh;
    width: 100vw;

    
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

.header {
    position: relative;
    width: 100%;
    height: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    /* Alinha verticalmente */
    justify-content: space-between;
    /* Espaço entre título e user-name no desktop */
    padding: 0 10px;
    /* Adiciona padding */
}

.header-title {
    display: none;
    /* Visível no desktop */
    color: #fff73b;
    font-family: 'StarJedi', 'Orbitron', monospace;
    font-size: 25px;
    flex-grow: 1;
    /* Permite que o título ocupe o espaço */
    text-align: left;
    /* Alinha à esquerda */
    line-height: 50px;
    /* Centraliza verticalmente */
}

.home {
    color: #fff73b;
    cursor: pointer;
    line-height: 50px;
    margin-right: 15px;
    /* Adiciona margem */
    position: static;
    /* Remove posicionamento absoluto */
}

.user-area {
    display: flex;
    align-items: center;
}

.user-name {
    display: flex;
    color: #fff73b;
    font-family: 'Orbitron', 'monospace';
    font-weight: bold;
    line-height: 30px;
    cursor: pointer;
    margin: 5px;
}

.profile {
    cursor: pointer;
    position: relative;
    width: 34px;
    height: 34px;
    margin: auto 5px;
    padding: 5px;
    color: #fff73b;
    font-size: 20px;
    border: 2px solid #fff73b;
    border-radius: 50%;
    padding: 1px 5px;
}

.profile img {
    color: #fff73b;
    width: 18px;
    height: 18px;
    margin: 5px 0px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    z-index: 1;
}

/* Estilo para o ícone de troféu no header */
.profile .fa-trophy {
    font-size: 18px;
    color: #fff73b;
    /* Cor amarela do título */
    transition: transform 0.2s ease-in-out;
}

.profile .fa-trophy:hover {
    transform: scale(1.1);
}

/* Main app container with proper stacking layout */
#app {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Header styles */
header#header-container {
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
}

/* Content area - takes up remaining space */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

/* Footer styles */
.footer {
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
    height: 50px;
}

/* Mobile View Styles (default) */
.mobile-view {
    width: 100vw;
    height: 100vh;
    position: relative;
    background-color: #0d0d26;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.desktop-view {
    width: 100vw;
    height: 100vh;
    position: relative;
    background-color: #0d0d26;
    display: none;
    align-items: center;
    justify-content: center;
}

.desktop-content {
    position: absolute;
    width: 100%;
    bottom: 0px;
    background-color: #0d0d26;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    overflow: hidden;
    top: 0px;
}

/* Starfield */
.starfield-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.starfield-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.starfield-container-desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.starfield-canvas-desktop {
    width: 100%;
    height: 100%;
    display: block;
}

/* Title Styles */
.title-container {
    position: absolute;
    top: 16.5%;
    /* 200/1212 */
    z-index: 10;
}

.game-title {
    font-size: 6.67vw;
    /* 48/720 */
    color: #fff73b;
    font-family: 'Starjedi', 'Orbitron', monospace;
    font-weight: 900;
    margin-bottom: 30px;
    /* text-shadow: 0 0 5px #fff73b, 0 0 5px #fff73b, 0 0 5px #fff73b; */
    text-align: center;
}

.title-container-desktop {
    position: absolute;
    top: 16.5%;
    /* 200/1212 */
    z-index: 10;
}

.game-title-desktop {
    font-size: 48px;
    color: #fff73b;
    font-family: 'Starjedi', 'Orbitron', monospace;
    font-weight: 900;
    margin-bottom: 30px;
    /* text-shadow: 0 0 10px #fff73b, 0 0 20px #fff73b, 0 0 30px #fff73b; */
    text-align: center;
}

/* Rocket Styles */
.rocket-container {
    position: absolute;
    top: 48.7%;
    /* 590/1212 */
    z-index: 5;
}

.rocket-svg {
    width: 30vh;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.rocket-container-desktop {
    position: absolute;
    top: 48.7%;
    /* 590/1212 */
    z-index: 5;
}

.rocket-svg-desktop {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

/* Button Styles */
.button-container {
    position: absolute;
    bottom: 100px;
    z-index: 10;
}

.dual-button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.game-mode-button {
    background-color: #4a8fe7;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Orbitron', monospace;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(74, 143, 231, 0.5);
    transition: all 0.3s ease;
    min-width: 100px;
}

.game-mode-button:hover {
    background-color: #3a7bd5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 143, 231, 0.7);
    transform: translateY(-2px);
}

.game-mode-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(74, 143, 231, 0.7);
}

.casual-button {
    background-color: #3a7bd5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(74, 143, 231, 0.7);
}

.casual-button:hover {
    background-color: #3a7bd5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 143, 231, 0.7);
    transform: translateY(-2px);
}

.ranked-button {
    background-color: #e23c0a;
    color: #212529;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 36, 7, 0.5);
}

.ranked-button:hover {
    background-color: #e23c0a;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 36, 7, 0.5);
    transform: translateY(-2px);
}

.launch-button {
    background-color: #4a8fe7;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Orbitron', monospace;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(74, 143, 231, 0.5);
    transition: all 0.3s ease;
}

.launch-button:hover {
    background-color: #3a7bd5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 143, 231, 0.7);
    transform: translateY(-2px);
}

.launch-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(74, 143, 231, 0.4);
}

.button-container-desktop {
    position: absolute;
    bottom: 100px;
    z-index: 10;
}

.dual-button-container-desktop {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.game-mode-button-desktop {
    background-color: #4a8fe7;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Orbitron', monospace;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(74, 143, 231, 0.5);
    transition: all 0.3s ease;
    min-width: 120px;
}

.game-mode-button-desktop:hover {
    background-color: #3a7bd5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 143, 231, 0.7);
    transform: translateY(-2px);
}

.game-mode-button-desktop:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(74, 143, 231, 0.4);
}

.launch-button-desktop {
    background-color: #4a8fe7;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Orbitron', monospace;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(74, 143, 231, 0.5);
    transition: all 0.3s ease;
}

.launch-button-desktop:hover {
    background-color: #3a7bd5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 143, 231, 0.7);
    transform: translateY(-2px);
}

.launch-button-desktop:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(74, 143, 231, 0.4);
}

/* Animation classes */
.fade-out {
    animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.rocket-launch {
    animation: rocketLaunch 1.5s ease-in-out forwards;
}

@keyframes rocketLaunch {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100vh);
    }
}

.flame-flicker {
    animation: flameFlicker 0.1s ease-in-out infinite alternate;
}

@keyframes flameFlicker {
    0% {
        opacity: 0.7;
        transform: scaleY(1);
    }

    100% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

/* Responsive breakpoints */
@media (min-width: 768px) {
    .mobile-view {
        display: none;
    }

    .desktop-view {
        display: flex;
    }

    /* Desktop specific content sizing */
    .content {
        min-height: calc(100vh - 100px);
        /* Account for header height */
    }
}

/* Mobile specific styles */
@media (max-width: 767px) {
    .content {
        min-height: calc(100vh - 100px);
        /* Account for header height */
    }
}

/* Ensure content doesn't exceed viewport */
.content {
    max-height: 100vh;
    overflow: hidden;
}

/* Star styles for canvas */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    border-radius: 50%;
}

/* Loading animation */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.lang-btn {
    background: rgba(255, 247, 59, 0.1);
    border: 2px solid #fff73b;
    border-radius: 6px;
    color: #fff73b;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(255, 247, 59, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 247, 59, 0.3);
}

.lang-btn.active {
    background: rgba(255, 247, 59, 0.3);
    border-color: #fff73b;
    box-shadow: 0 0 15px rgba(255, 247, 59, 0.4);
}


/* Modal do Ranking Completo */
.ranking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ranking-overlay.hidden {
    display: none;
}

.full-ranking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.full-ranking-modal.hidden {
    display: none;
}

.ranking-content {
    background: #0c0f1a;
    border: 2px solid #fff73b;
    border-radius: 12px;
    padding: 20px 30px;
    width: 90%;
    max-width: 500px;
    color: #fff73b;
    font-family: 'Orbitron', sans-serif;
    position: relative;
}


.ranking-content h2 {
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 20px;
}

#ranking-list,
#player-rank-container {
    list-style: none;
    padding: 0;
    margin: 0;
}

#ranking-list li,
#player-rank-container li {
    display: grid;
    grid-template-columns: 30px 1fr 40px 40px 40px;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 247, 59, 0.2);
    align-items: center;
}

/* Estilos específicos para as colunas do ranking completo */
#ranking-list li>*:nth-child(1),
#player-rank-container li>*:nth-child(1) {
    text-align: center;
    font-weight: bold;
}

#ranking-list li>*:nth-child(2),
#player-rank-container li>*:nth-child(2) {
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 200px;
}

#ranking-list li>*:nth-child(3),
#ranking-list li>*:nth-child(4),
#ranking-list li>*:nth-child(5),
#player-rank-container li>*:nth-child(3),
#player-rank-container li>*:nth-child(4),
#player-rank-container li>*:nth-child(5) {
    text-align: center;
    font-weight: bold;
}

.ranking-header {
    font-weight: bold;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Destaque para o jogador logado */
.player-highlight {
    color: #4ade80;
    /* Um verde brilhante */
    font-weight: 700;
}

#player-rank-container {
    margin-top: 15px;
    border-top: 2px solid #fff73b;
    padding-top: 10px;
}

/* Media Query para Desktop */
@media (min-width: 768px) {
    .desktop-ranking-preview {
        display: none;
        /* Mantido oculto mesmo no desktop */
    }
}

/* Media queries para dispositivos móveis no modal de ranking */
@media (max-width: 768px) {
    .ranking-content {
        padding: 15px 20px;
        margin: 20px;
    }

    .close-button {
        width: 5px !important;
        height: 5px !important;
        padding: 5px !important;
        font-size: 14px !important;
        min-width: 5px !important;
        min-height: 5px !important;
    }
}

@media (max-width: 480px) {
    .ranking-content {
        padding: 15px;
        margin: 15px;
        width: 95%;
    }

    .ranking-content h2 {
        font-size: 1.5rem;
    }

    #ranking-list li,
    #player-rank-container li {
        grid-template-columns: 30px 1fr 40px 40px 40px;
        gap: 5px;
        font-size: 0.8rem;
    }

    .close-button {
        width: 5px !important;
        height: 5px !important;
        padding: 5px !important;
        font-size: 14px !important;
        min-width: 5px !important;
        min-height: 5px !important;
    }
}


/* Garante que o container do modal seja a referência para o posicionamento do botão */
.modal-content,
.ranking-content {
    position: relative;
}

/* Estilo padronizado para o botão de fechar */
.close-button {
    position: absolute;
    top: 15px;
    /* Ajuste a distância do topo se necessário */
    right: 15px;
    /* Ajuste a distância da direita se necessário */
    width: 30px;
    /* Largura do quadrado */
    height: 30px;
    /* Altura do quadrado */
    border: 2px solid red;
    /* Borda vermelha */
    background-color: transparent;
    /* Fundo transparente */
    color: red;
    /* Cor do 'x' */
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;

    /* Centraliza o 'x' dentro do quadrado */
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 0;
}

.close-button:hover {
    /* Efeito opcional ao passar o mouse */
    background-color: rgba(255, 0, 0, 0.1);
}