/* Root */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Press+Start+2P&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root{
    --font-press2p: "Press Start 2P", system-ui;
    --pacifo: "Pacifico", cursive;
    --roboto: "Roboto", serif;
    --x-dark-green: #228B22;
    --o-gold: #FFD700 ;
    --background: #F4F4F4;
    --text:#000000;
    --box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.1);
}

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
box-sizing: border-box;
/* Set Font */
font-family: var(--roboto);
color: var(--text);
/* Set Transition */
transition: all .3s ease-in-out;
}

/* 2. Remove default margin */
* {
margin: 0;
padding: 0;
}

body {
/* 3. Add accessible line-height */
line-height: 1.5;
/* 4. Improve text rendering */
-webkit-font-smoothing: antialiased;
/* Set BG Color */
background-color: var(--background);
}

/* 5. Improve media defaults */
img, picture, video, canvas, svg {
display: block;
max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input, button, textarea, select {
font: inherit;
}

/* 7. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
text-wrap: balance;
}

/*
9. Create a root stacking context
*/
#root, #__next {
isolation: isolate;
}

/* Layout */
body{
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}


/* Header Title */
header{
    box-shadow: var(--box-shadow);
    background-color: var(--o-gold);
    padding: 15px 15px 0px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#header-title{
    text-align: center;
}

/* scoreboard */
#scoreboard{
    background-color: var(--background);
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 0px 5px;
    box-shadow: var(--box-shadow) inset;
    border-bottom: 5px solid var(--o-gold);
}

.score{
    font-weight: 900;
    font-size: large;     
    background-color: var(--x-dark-green);   
    color: white;
    padding: 5px;
    display: inline-block;
}

#x-score{
    margin-left: 20px;
    margin-right: 10px;
}

#o-score{
    margin-right: 20px;
    margin-left: 10px;
}

.vert-line{
    /* height: 50px; */
    width: 2.5px;
    /* margin: 0px 10px; */
    background-color: var(--o-gold);
}

/* Main */
main{
    padding: 5px;
}
#gameboard{
    box-shadow: var(--box-shadow);
    width: 350px;
    height: 365px;
    margin: 15px auto;
    display: grid;
    grid-template-rows: 1fr 1fr 1fr;
    border-radius: 10px;
    overflow: hidden;
}

.row{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.cell, .cell-disable{
    border: 2.5px solid rgba(0, 0, 0, 0.1);    
    font-size: 5rem;
    text-align: center;    
}

.cell:hover{    
    background-color: rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.cell-disable:hover{
    cursor: default;
}


.mark{
    display: block;        
    /* animation: pop 0.4s ease-in-out 1 forwards; */
    /* background-color: red; */
    /* transition: all .5s ease-in-out; */
}

.remove-cursor{
    cursor: default;
}
/* Form Gameplay Setup */
#form-gameplay{
    box-shadow: var(--box-shadow) inset;
    min-width: 300px;
    max-width: 500px;    
    margin: 25px auto;
    border: 5px solid black;
    border-radius: 15px;
    text-align: center;
    animation: pop 0.4s ease-in-out 0s 1 forwards;
    overflow: hidden;            
}

.btn-container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

button{
    outline: none;
    border: none;
    background-color: #228B22;
    height: 50px;
    color: wheat;
    font-weight: 900;
    cursor: pointer;    
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5)inset;
}

button:hover{
    background-color: #112911;
    font-size: 1.5rem;
    color: #FFD700;
}

#opponent-gameplay h1, #choose-mark h1{
    padding: 15px;
    position: relative;
}

#player-turns{
    text-align: center;
    animation: pop 0.4s ease-in-out 0s 1 forwards;
}

.hide-game-control{
    transform: scale(0);
    position: absolute;
    left: 0;
    right: 0;
}

.show-game-control{
    transform: scale(1);
    position: relative;    
}

/* Game Over Panel */
#game-over{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0);
    padding: 10px;
    z-index: 100;
    min-width: 360px;
}

#game-over-form{
    min-width: 300px;
    width: 500px; 
    background-color: white;
    text-align: center;
    border-radius: 10px;
    padding-top: 10px;
}

#game-over h1, #game-over h3{
margin: 0px 10px;
}

.bg-close-color{
    background-color: rgb(185, 109, 109);
}

.btn-container{
    margin-top: 10px;
}

a{
    text-decoration: none;
}

.inline{
    display: inline-block;
    width: 100%;
}

#restart-game-btn{        
    display: none;
    margin: 10px auto;   
    padding: 0px 15px;
    border-radius: 5px;
}
/* footer */
footer{
    /* position: fixed;
    right: 0;
    left: 0;
    bottom: 0; */
    padding: 5px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    /* box-shadow: var(--box-shadow-default) inset; */
}

a[href*="About-Me"]:hover + p, a[href*="About-Me"]:hover{
    transform: scale(1.08) translateY(-10px);  
    box-shadow: var(--box-shadow-default);
}

img[alt*="logo"]{
    height: 50px;
}

footer p {
    padding: 5px;
    border-radius: 5px;
}

@keyframes pop {
    0%{
        transform: scale(0);
    }

    100%{
        transform: scale(1);
    }
}

@keyframes fade {
    0%{
        opacity: 0;
    }

    100%{
        opacity: 1;
    }
}