* {
    margin: 0;
    padding: 0;
}
body {
    background-color: burlywood;
}


.header-bar {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 24px 32px 0 32px;
}
#games {
    font-size: 40px;
    margin-left: 40px
}
#reset,
#continue {
    font-size: 18px;
    padding: 4px 9px;
    border-radius: 15px;
    border: 2px dotted #333;
    background: #fffbe7;
    cursor: pointer;
}
/* button styling */
.value {
    width: 100px;
    height: 100px;
    font-size: 80px;
    margin: 3px;
    background-color: rgb(221, 217, 217);
    border-radius: 15px;
    border: 0px;
}

td {
    border: 10px solid black;
    border-radius: 30px;
}

table {
    border-collapse: collapse;
}
/* removes outside border */
.left-top-corner {
    border-width: 0px 10px 10px 0px;
}

.top-mid {
    border-width: 0px 10px 10px 10px;
}

.right-top-corner {
    border-width: 0 0 10px 10px;
}

.left-mid {
    border-width: 10px 10px 10px 0;
}

td:not([class]) {
    border-width: 10px;
}

.right-mid {
    border-width: 10px 0 10px 10px;
}

.left-bottom-corner {
    border-width: 10px 10px 0 0;
}

.bottom-mid {
    border-width: 10px 10px 0 10px;
}

.right-bottom-corner {
    border-width: 10px 0 0 10px;
}
.game-board {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
    /* border: 1px solid black; */
}
.the{
    position:absolute;
    right:10px;
    top:70px;
    font-size:22px;
    text-decoration:none;
    color:black;
    border:2px solid black;
    padding:5px;
    background-color:#fffbe7;
    border-radius:10px;
}
.fou{
    position:absolute;
    right:10px;
    top:120px;
    font-size:22px;
    text-decoration:none;
    color:black;
    border:2px solid black;
    padding:5px;
    background-color:#fffbe7;
    border-radius:10px;
}
.fou:hover ,.the:hover{
    background-color:#d3d1c7
}
.gamesnumber {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: right;
    font-size: 30px;
    padding:0px 10px 0px 10px;
}


/* score board style */
.score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
#scoreX,
#scoreO {
    font-size: 50px;
    border: 4px solid rgb(133, 133, 133);
    border-width: 0px 0px 4px 0px;
    padding: 0px 20px 0px 20px;
}
.next-turn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 24px;
    gap: 8px;
}
@keyframes flash-turn {
    0%, 100% { color: #228B22; text-shadow: 0 0 8px #746161, 0 0 16px #228B22; }
    50% { color: #39372e; text-shadow: 0 0 16px #228B22, 0 0 32px #7d7a6c; }
}
.flash-turn ,#nxttrn {
    animation: flash-turn 3s linear infinite;
}
#nxttrn {
    font-size: 3rem;
    font-weight: bold;
    margin-left: 4px;
}
.scoreX,
.scoreO {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0px;
    width: 50%;
}

@media (max-width: 600px) {
    .header-bar {
        flex-direction: column;
        gap: 12px;
        padding: 18px 4vw 0 4vw;
    }

    .score {
        flex-direction: row;
        gap: 16px;
        margin-top: 18px;
    }

    .scoreX,
    .scoreO {
        min-width: 0;
        width: 100%;
        padding: 30px 0px;
    }

    .game-board {
        margin-top: 12px;
        min-height: 0;
    }

    .value {
       width: 10vw;
        height: 10vw;
        min-width: 54px;
        min-height: 54px;
        font-size: 3rem;
    }

    table.game-board {
        padding: 2vw;
    }
    #section-rules{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
}
.rules{
    position:absolute;
    top:100px;
    left:20px;
    a{
        color:#7d7a6c;
        text-decoration:none;
    }
}
}
.highlighted-cell{
    border:2px solid green;
}
@keyframes flash-green {
    0%, 100% { box-shadow: 0 0 0 2px #00ff00, 0 0 16px 4px #00ff0080; }
    50% { box-shadow: 0 0 0 3px #00ff00, 0 0 32px 8px #00ff00cc; }
}
.winner-flash {
    animation: flash-green 0.7s linear infinite;
    border: 3px solid #00ff00 !important;
    z-index: 2;
}
#winner {
    position: absolute;
    left: 15px;
    top: 70px;
    font-size: 1.6rem;
    font-weight: bold;
    color: #228B22;
    background: #fffbe7;
    padding: 8px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px #0001;
    border: 2px solid #228B22;
    z-index: 10;
    max-width: 100px;
    text-align: left;
}
.hide-winner{
    display:none;
}
img{
    height:200px;
    width:200px;
    margin:20px;
}
#section-rules{
    display:flex;
    align-items:center;
    justify-content:center;
}
.rules{
    position:absolute;
    top:100px;
    left:20px;
    a{
        color:#7d7a6c;
        text-decoration:none;
    }
}
