@font-face {
    font-family: 'Jersey 25';
    src: url('../assets/Jersey25-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    height: 100vh;
    margin: 0;
    font-family: "Jersey 25", sans-serif;
    display: flex;
    flex-direction: column;
    background-color: black;
}

header {
    display: flex;
    justify-content: space-between;
}

nav {
    z-index: 101;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.img-button {
    background: none;
    border: solid 3px white;
    border-radius: 10%;
    cursor: pointer;
    padding: 8px;
    margin: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.img-button svg {
    color: white;
    width: 48px;
    height: 48px;
}

.img-button:hover, .img-button:hover svg {
    color: black;
    background-color: white;
    transition: background-color 0.3s, color 0.3s;
}

main {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 600px;
    height: 600px;
    background-color: white;
}

.square {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    background-color: black;
}

.win svg {
    color: red;
}

.irrelevant svg {
    opacity: 0.5;
}

footer {
    display: flex;
    justify-content: center;
    margin-bottom: 7vh;
}

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

.scores div {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: white;
}

#x-name::after {
    content: "\00a0(X)";
}

#o-name::after {
    content: "\00a0(O)";
}

#leaderboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 100;
}

#leaderboard h1 {
    font-size: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#leaderboard table {
    font-size: 4rem;
    width: 20vw;
    border-collapse: collapse;
}

#leaderboard table td {
    border-bottom: 4px solid white;
}

#leaderboard table td:first-child {
    text-align: left;
}

#leaderboard table td:last-child {
    text-align: right;
}

#leaderboard table tr:last-child td {
    border-bottom: 0;
}

dialog {
    width: 300px;
    padding: 20px;
    border-radius: 5%;
    color: black;
    background: white;
}

dialog form {
    display: flex;
    flex-direction: column;
    font-size: 1rem;
}

dialog label {
    margin: 10px 0;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

dialog input {
    padding: 10px;
    border: 2px solid black;
}

dialog button {
    margin-top: 20px;
    padding: 10px 0px;
    color: white;
    border: 2px solid black;
    background-color: black;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

dialog button:hover {
    color: black;
    background-color: white;
}

@media (max-width: 480px) {
    dialog {
        width: 80vw;
    }

    .game {
        width: 80vw;
        height: 80vw;
    }

    .square {
        width: 26.666666666666668vw;
        height: 26.666666666666668vw;
    }

    #leaderboard {
        padding-top: 10vh;
    }

    #leaderboard h1 {
        font-size: 12vw;
    }
    
    #leaderboard table {
        font-size: 10vw;
        width: 50vw;
    }
}