* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url(../images/green_board.webp);
    image-rendering: optimizeQuality;
    background-color: rgb(84, 122, 135);
    background-size: cover;
    font-family: 'Caveat Brush', cursive, sans-serif;
    color: #f5f5f5;
    text-shadow: 2px 3px #3C3F42;
    text-align: center;
    height: 100%;
    width: 100%;
}

:focus-visible {
    outline: #f5f5f5 solid 3px;
}

h1 {
    width: 100%;
    font-size: clamp(2rem, 1rem + 10vw, 5rem);
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* Main container inside the body */

#container {
    display: flex;
    flex-flow: column wrap;
    min-height: calc(100vh - 14.5rem);
    align-items: center;
    gap: 2rem;
}

#container a {
    text-decoration: none;
    color: inherit;
}

/* Draw game board and boxes on the screen */

.gameBoard {
    display: flex;
    flex-flow: row wrap;
    align-content: flex-start;
    justify-content: center;
    width: 510px;
    height: 510px;
}

.box {
    width: 165px;
    height: 165px;
    font-size: 120px;
}

[id="0"] {
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}

[id="1"] {
    border-bottom: 2px solid white;
}

[id="2"] {
    border-left: 2px solid white;
    border-bottom: 2px solid white;
}

[id="3"] {
    border-right: 2px solid white;
}

[id="5"] {
    border-left: 2px solid white;
}

[id="6"] {
    border-top: 2px solid white;
    border-right: 2px solid white;
}

[id="7"] {
    border-top: 2px solid white;
}

[id="8"] {
    border-left: 2px solid white;
    border-top: 2px solid white;
}

/* Game board media query for screens smaller than 500px */

@media screen and (max-width: 510px) {
    .gameBoard {
        width: 310px;
        height: 310px;
    }

    .box {
        width: 100px;
        height: 100px;
        font-size: 80px;
    }
}

/* Game rules area */

.rules {
    text-align: center;
    letter-spacing: 2px;
}

.rules ul {
    display: flex;
    flex-flow: column wrap;
    justify-content: space-between;
    background-color: rgba(71, 71, 71, 0.9);
    padding: 0.5rem 0.5rem 14rem;
    font-size: clamp(1rem, 2vw, 2.5rem);
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    max-width: 100%;
    list-style: none;
}

.rules ul li {
    padding: 10px;
}

#rulesBtn {
    position: relative;
    margin: 1rem;
    width: 18rem;
    z-index: 9999;
}

/* Main buttons with wooden background */

.woodButton {
    font-size: 2rem;
    font-weight: bolder;
    border-radius: 1rem;
    text-transform: uppercase;
    font-family: inherit;
    width: 18rem;
    height: 3.5rem;
    padding: 5px 20px;
    letter-spacing: 5px;
    background: url(../images/wood_board.webp);
    background-color: burlywood;
    color: #f5f5f5;
    border: 2px solid rgba(78, 53, 36, 0.5);
    text-shadow: inherit;
    cursor: pointer;
    box-shadow: 0px 3px #3C3F42;
    white-space: nowrap;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0px 5px #3C3F42;
    transition: 200ms;
}

button:active {
    box-shadow: 0px 3px #3C3F42;
    transform: translateY(4px);
}

/* Game options area */

.optionArea {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.optionArea h2 {
    letter-spacing: 3px;
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-transform: uppercase;
}

.blink {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.pleaseSelect {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    background-color: rgba(255, 0, 0, 0.5);
    letter-spacing: 3px;
    text-transform: uppercase;
    border: #f5f5f5 solid 1px;
    border-radius: 1rem;
    padding: 5px 15px;
}

.optBtn {
    width: 10rem;
    border: 1px solid #f5f5f5;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    border-radius: 1rem;
    letter-spacing: 3px;
    background-color: rgba(177, 181, 247, 0.2);
    cursor: pointer;
    text-shadow: inherit;
    font-family: inherit;
    color: #f5f5f5;
}

.optBtn:hover {
    background-color: rgba(78, 53, 36, 0.5);
    transform: scale(1.05);
    box-shadow: 0px 5px #3C3F42;
    transition: 200ms;
}

/* game over area (displayed after game won, loose or draw) */

.gameOver h1 {
    font-size: clamp(1.5rem, 4vw, 10rem);
    padding-bottom: 2rem;
}

.gameOver h2 {
    font-size: clamp(1.5rem, 10vw, 30rem);
    padding-bottom: 2rem;
}

.play {
    font-size: 2rem;
    font-weight: bolder;
    border-radius: 1rem;
    text-transform: uppercase;
    font-family: inherit;
    width: 18rem;
    padding: 5px 20px;
    letter-spacing: 5px;
    background: url(../images/wood_board.webp);
    background-color: burlywood;
    color: #f5f5f5;
    border: 2px solid rgba(78, 53, 36, 0.5);
    text-shadow: inherit;
    cursor: pointer;
    box-shadow: 0px 3px #3C3F42;
    white-space: nowrap;
    text-align: center;
    margin: 0 auto;
}

.play:hover {
    background-color: rgba(78, 53, 36, 0.5);
    transform: scale(1.05);
    box-shadow: 0px 5px #3C3F42;
    transition: 200ms;
}

/* onclick classes to show/hide elements using javascript */

.active {
    background-color: rgba(78, 53, 36, 0.5);
}

.hide {
    display: none;
}

.visible {
    visibility: hidden;
}

.noSelect {
    background-color: rgba(255, 0, 0, 0.5);
}

/* Footer area */

#footer {
    width: 100vw;
    height: 9rem;
    background: url(../images/wood_board.webp);
    background-color: burlywood;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(40px, 6vw, 60px);
    border-top: 5px solid rgba(78, 53, 36, 0.7);
    text-decoration: none;
}

footer>div>a {
    padding: 10px 25px;
    text-decoration: none;
    color: #f5f5f5;
}

footer>div>a :hover {
    text-shadow: 5px 5px #3C3F42;
    transition: 200ms;
    transform: scale(1.1);
}

/* 404.html */
#error {
    min-height: calc(100vh - 9rem);
    display: flex;
    flex-flow: column wrap;
    justify-content: center;
}

#error h1 {
    margin-bottom: 2rem;
}

#error span {
    color: rgba(243, 247, 10, 1);
}

#error p {
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-decoration: none;
    margin: 1rem;
}

#error p a {
    text-decoration: none;
    color: #f5f5f5;
}