@import url('https://fonts.googleapis.com/css2?family=Tektur:wght@400..900&display=swap');

:root{
    --cor-de-fundo: rgb(19, 19, 124);
    --cor-de-letra: #fff;
    --letra-preta: #333;
}

* {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--cor-de-fundo);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

/*-------------------- Parte do titulo e descrição  ------------------*/
.areaDeRegras{
    margin-bottom: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header{
    .titulo {
        color: var(--cor-de-letra);
        text-align: center;
        font-size: 70px;
        font-family: "Tektur", sans-serif;
        padding: 20px;    
    }

    p {
        color: var(--cor-de-letra);
        text-align: center;
        padding-bottom: 10px;
    }
}

@media screen and (max-width: 440px){
    header .titulo{
        font-size: 50px;
        padding: 5px 0;
    }
    header p{
        padding: 10px;
        font-size: 18px;
    }
    .areaDeRegras{
        margin-bottom: 10%;
    }
}

/*----------------------------------- Parte do quadrado de regras -------------------------------------------*/
.regras{
    margin: 0 10%;
    width: 80%;
    max-width: 800px;
    padding: 2% 4%;
    background-color: aliceblue;
    border: 2px;
    border-radius: 20px;
    text-align: justify;
    list-style-position: inside ;
    h3 {
        font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
        color: var(--letra-preta);
        text-align: center;
        padding-bottom: 1%;
    }
}

.regras li, p{
    font-size: 18px;
    color: var(--letra-preta);
}

.navios, li{
    padding: 0;
    margin-left: 4%;
    text-decoration: none;
}

.listaNavios {
    abbr{
        text-decoration: none;
        em {
            color:rgb(186, 7, 7);
            cursor: pointer;
        }
    }
}

/* ------------------- Parte do Footer -------------------------*/
.rodape {
    background-color: aliceblue;
    text-align: center;
    font-size: 0.9em;
    width: 100vw;
    height: 5%;
    max-height: 30px;
    padding-top: 5px;
    position: fixed;
    bottom: 0;
}

/* ------------------- Parte do Botão Start ------------------- */
.botao{
    background-color: hsl(30, 100%, 50%);
    margin: 2% 10%;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    padding: .3em 1em;    
    width: 80%;
    max-width: 800px;
    outline: none;
    border: none;
    cursor: pointer;
    border-radius: .2rem;
    text-decoration: none;
    color: var(--letra-preta);
}

.botao:hover, .botao:focus{
    background-color: hsl(30, 100%, 40%);
    transition: 0.3s;
}

/* -------------- Janela Modal -------------- */ 
.janelaModal{
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.342);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal {
    width: 60%;
    min-height: 200px;
    min-width: 650px;
    background-color: #ffffff81;
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 30px;
}

.fechar {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background-color: red;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(145deg, #ffa500, #cc8400);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2em;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    color: #1e1e1e;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.btn:hover {
    background: linear-gradient(145deg, #ffd27f, #e69800);
    transform: scale(1.1);
    color: #000;
}

.janelaModal.abrir{
    display: flex;
}

@keyframes abrirmodal {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, -5px);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.abrir .modal {
    animation: abrirmodal 0.5s;
}

/* ------------------- Parte do Tabuleiro ------------------- */
.jogo{
    display: none;
    margin-bottom: 4%;
}

.container{
    display:flex;
    justify-content: center;
    width: 100%;
    align-items: center;
    height: 90vh;
}

.tabuleiro{     
    aspect-ratio: 1 / 1;
    margin: 2vmin;
    display: grid;
    background-color: hsl(200, 100%, 50%);
    grid-template-rows: repeat(10, 1fr);    /*Mudança para 1 frame para melhorar a responsividade*/
    grid-template-columns: repeat(10, 1fr);
    width: 85vmin;      /* Limita o tabuleiro a 90% da largura da tela */
    height: 85vmin;     /* Limita o tabuleiro a 90% da altura da tela */
    max-width: 600px;   /* Limita o tamanho máximo para telas grandes */
    max-height: 600px; 
}

.tabuleiro div{
    border: 1px solid var(--cor-de-fundo); 
    box-sizing: border-box;    
    cursor: pointer;
}

/* Cor dos barcos temporaria, apenas para fins de desenvolvimento 
.tabuleiro div.ocupado{
    background-color: rgb(255, 255, 255);    
}*/

.tabuleiro div.clicado{
    background-color: aqua;
}

.tabuleiro div.acerto {
    background-image: url('./img/alvoEncontrado.png');
    background-size: contain;       
    background-repeat: no-repeat;    
    background-position: center;     
   /*background-color: black;*/
}

/* ------------------- Parte das imagens dos barcos ------------------- */

.tabuleiro div.navio-revelado {
    background-repeat: repeat;
    background-color: transparent;
    background-size: cover;
    animation: revelarNavio 0.5s ease-in-out forwards;
}

@keyframes revelarNavio {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.navio-revelado {
    background-color: transparent;
    animation: vibrar 0.2s infinite alternate;
}

/* ------------------- Parte das Bombas ------------------- */
/* Cor das bombas temporaria, apenas para fins de desenvolvimento
.tabuleiro div.bomba{
    background-color: red; 
}*/

.tabuleiro div.explosao{
    /* Aqui será a imagem da bomba */
    background-image: url('./img/Bombas.png');
    background-size: contain;  
    background-repeat: no-repeat;
    background-position: center;
    /*background-color: rgb(255, 94, 0);*/
}

/* ------------------- Parte das Vidas ------------------- */
#vidas{
    display: flex;
    justify-content: center;
    gap: 5px;
    font-size: 20px;
    margin-top: 10px;
}

.vida{
    transition: filter 0.3s ease;
}

.vida.perdida{
    /* Deixa o coração de vida cinza */
    filter: grayscale(1) brightness(0.5);
}

/* ------------------- Parte do pop-up vitoria/derrota------------------- */
#gameResultModal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
  
#modalContent {
    background: var(--cor-de-letra);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}
  
#modalContent h2 {
    margin-bottom: 20px;
}
  
#modalContent button {
    background-color: var(--cor-de-fundo);
    color: var(--cor-de-letra);
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
}
  
