@font-face {
    font-family: GochiHand;
    src: url("./fonts/GochiHand-Regular.ttf");
}

:root{
    height: 100%;
    --cell-size: max(2.2vw, 30px); 
}

body{
    font-family: GochiHand;
    background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), url("./pictures/background.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.welcomeMessage{
    font-size: 5rem;
    margin-top: 5vh;
    letter-spacing: 3px;
    text-align: center;
    color: rgb(121, 41, 9);
    text-shadow: 2px 2px 0px white;
    padding: 0px 20px;
}

#rule{
    margin: 0;
    margin-top: 10px;
    background: white;
    padding: 5px 30px;
}

.content{
    margin-top: 5vh;
    display: flex;
    align-items: self-start;
    justify-content: center;
    gap: 50px;
}

.container{
    flex: 1;
}


.gameboard{
    width: max(25vw, 300px);
    margin-right: auto;
    display: grid;
    grid-template-columns: repeat(10, max(2.5vw, 30px));
    grid-template-rows: repeat(10, max(2.5vw, 30px));
    background: rgb(252, 245, 245);
    border-radius: 10px;
    border: 2px solid black;
    box-shadow: 0px 5px 15px 2px;
}

.gameboard>*{
    border: 1px solid rgba(149, 149, 156, 0.615);
    padding: auto auto;
    font-family: inherit;
    font-size: 2rem;
    opacity: 0.5;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.gameboard>*:first-child{
    border-radius: 10px 0px 0px 0px;
}


.gameboard>*:nth-child(10){
    border-radius: 0px 10px 0px 0px;
}

.gameboard>*:nth-child(91){
    border-radius: 0px 0px 0px 10px;
}

.gameboard>*:last-child{
    border-radius: 0px 0px 10px 0px;
}


.shipsSettings{
    flex: 1;
    display: flex;
    flex-direction: column;
    height: max(25vw, 300px);
}

.buttons{
    margin-top: auto;
    align-self: flex-end;
    display: flex;
    gap: 10px;
}

.buttons>*{
    font-size: 1.3rem;
    border: 2px solid black;
    color: white;
    text-shadow: 0px 3px 2px rgb(5, 85, 25);
    padding: 5px 30px;
    cursor: pointer;
    box-shadow: 0px 10px 10px black;
}

#random{
    background: rgb(56,87,120);
    background: linear-gradient(0deg, rgba(56,87,120,1) 0%, rgba(34,221,169,1) 100%);
    display: flex;
    align-items: center;
}

#random>img{
    width: 23px;
    vertical-align: center;
}
#reset{
    background: rgb(56,87,120);
    background: linear-gradient(0deg, rgba(56,87,120,1) 0%, rgba(34,221,169,1) 100%);
}

.ships{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.ships>div{
    display: flex;
    gap: 20px;
}

.ships>div>div{
    display: flex;
}

.cell{
    width: var(--cell-size);
    height: var(--cell-size);
    background-color: white;
    text-align: center;
}

.patrolBoat>.cell{
    border: 2px solid orange;
}

._3Cell>*>.cell{
    border: 2px solid green;
}


._4Cell>*>.cell{
    border: 2px solid purple;
}

._5Cell>*>.cell{
    border: 2px solid red;
}


.startGame{
    flex: 1;
    width: 600px;
}

#startGame{
    display: block;
    background-color: rgb(50, 160, 50);
    font-size: 1.7rem;
    color: white;
    border: none;
    padding: 10px 50px;
    box-shadow: 6px 7px 2px black;
    border-radius: 5px;
    cursor: pointer;
    transition: box-shadow 0.25s ease;
}

#startGame:hover{
    box-shadow: 0px 0px 2px 1px black;
    transform: scale(1.01);
}

.ship{
    border: 2px solid black;
    opacity: 1;
}

.ship.notRightSide{
    border-right: 1px solid rgba(149, 149, 156, 0.15);;
}

.ship.notLeftSide{
    border-left: 1px solid rgba(149, 149, 156, 0.15);;
}

.ship.notTopSide{
    border-top: 1px solid rgba(149, 149, 156, 0.15);;
}

.ship.notBottomSide{
    border-bottom: 1px solid rgba(149, 149, 156, 0.15);;
}


.hit{
    opacity: 1;
    animation: shot 0.5s ease-out 1;
}

@keyframes shot {
    from{
        font-size: 5rem;
    }
    to{
        font-size: 2rem;
    }
}

.hit.rightSide{
    border-right: 2px solid red;
}

.hit.leftSide{
    border-left: 2px solid red;
}
.hit.topSide{
    border-top: 2px solid red;
}
.hit.bottomSide{
    border-bottom: 2px solid red;
}

.missed{
    opacity: 0.8;
    color: rgba(0,0,0,1);
    animation: shot 0.3s ease-in 1;
}

.message{
    font-size: 1.5rem; 
    background: rgba(0,0,0,0.6);
    color: red;
    padding: 2px 10px;
}


.gameboard > button{
    background: none;
    padding: 0;
}

.back{
    background: linear-gradient(rgb(60, 123, 201), rgba(54, 12, 205));
    color: white;
    font-size: 1.3rem;
    padding: 5px 20px;
    border-radius: 20px;
    margin-top: auto;
    cursor: pointer;
    box-shadow: 0px 5px 4px black;
    position: absolute;
    left: 3%;
    top: 6%;
}

.back:hover{
    box-shadow: 0px 2px 5px 0px black;
}

button{
    font-family: inherit;
}