/* 
colors:
orange: #fc7951
dark orange: #FF5733
black: #0A1B20
*/

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #0A1B20;
    width: 100%;
    height: 800px;
    font-family: 'Indie Flower', cursive;
}

/* =====================header======================= */
header { 
    width: 100%;
    background-color: #0A1B20;
    color: #fc7951;
    text-align: center;
}

header h1{
    margin: 0 !important;
    padding: 10px 0;
    font-family: 'Cedarville Cursive', cursive;
    font-size: 50px;  
    font-weight: 400;
}

#navigation a {
    text-decoration: none;
    color: #fc7951;
    font-weight: bold;
    font-size: 20px;
}

/* =====================score panel======================= */
#scorePanel {
    background-color: #0A1B20;
    color: white;
    text-align: center;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 20px auto;
}

#scorePanel > div > h3{
    font-size: 25px;
    text-decoration: underline;
}

#battleshipCounter {
    display: grid;
    justify-items: center;
    align-items: center;
    width: 60%;
    margin: auto;
    gap: 0;
    grid-template-columns: repeat(4, 1fr);
}

#battleshipCounter > div {
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 5px;
}

#battleshipCounter > div > img {
    width: inherit;
    height: inherit;
}

.destroyed {
    background:#FF5733 !important;
}

#time span {
    font-size: 25px;
    font-weight: 800;
}

#countScore {
    font-size: 25px;
    font-weight: 800;
}


/* =====================Card Grid======================= */
#grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 40%;
    gap: 3px;
    margin: 30px auto;
    background: url("../img/2.png");
    border-radius: 5px;
    justify-items: center;
    align-items: center;
    padding: 5px;
}

#grid > div {
    width: 70px;
    height: 70px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 5px;
}

div.card:active {
    animation: flip 0.2s ease-in forwards;
}

@keyframes flip{
    0% {transform: rotateY(0deg)}
    100% {transform: rotateY(90deg)}
}


.open {
     background-color: rgba(0,0,0,0) !important;
}

.battleship {
    background:#FF5733 !important;
}

.battleship img {
    height: inherit;
    width: inherit;
}

/* =====================Footer======================= */
footer p {
    color: white;
    text-align: center;
    padding: 10px 0;
}

footer > p > a{
    color: white;
}

/* =====================Instruction Window======================= */
#instruction {
    display: none; 
    position: fixed; 
    z-index: 1;
    left: 100px;
    top: 80px;
    width: 80%;
    height: 80%; 
    overflow: auto; 
    background-color: white;
    padding: 10px 20px;
    font-size: 18px;
}

#instruction li{
    font-family: Roboto;
}

#img1, #img2, #img3, #img4 {
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 5px;
}

#img1 > img, #img2 > img, #img3 > img, #img4 > img {
    width: inherit;
    height: inherit;
}

#scoreTable {
    width: 30%;
    margin: auto;
    text-align: left;
}

#instruction h1, #instruction th {
    color: #FF5733;
    text-decoration: underline;
}
#instruction h1{
 margin: 10px !important;
}

.close {
 color: #aaa;
 float: right;
 font-size: 28px;
 font-weight: bold;
 padding-right: 10px;
}

.close:hover,
.close:focus {
 color: black;
 text-decoration: none;
 cursor: pointer;
}

.start {
    border: none;
    background-color: #FF5733;
    height: 50px;
    position: absolute;
    right: 10px;
    bottom: 10px;
    color: white;
    font-weight: bold;
    border-radius: 5px;
}

/* =====================Win or lose massege======================= */

#winOrLose {
    display: none; 
    position: fixed; 
    z-index: 1;
    left: 250px;
    top: 100px;
    width: 60%;
    height: 40%; 
    overflow: auto; 
    background-color: white;
    padding: 30px 20px;
    font-size: 18px;
    text-align: center;
}

#winOrLose > p {
    font-family: Roboto;;
}

#heading {
    color: #FF5733;
}

@media (max-width: 1100px){
    #grid {
        width: 60%
    
    }
}

@media (max-width: 800px){
    #grid {
        width: 80%
    }

    #winOrLose {
    /* width: 100%; */
    left: 100px;
}   
}

@media (max-width:550px){
    #grid {
       width: 100%;
       grid-template-columns: repeat(4, 1fr);  
    }

    #winOrLose, #instruction{
        width: 100%;
        left: 0;
    }    
}
