/* Page display */
html {
    height: 100%;
}

body {
    /* Removing user agent stylesheet margin */
    margin: inherit;
    background-image: url("../images/race-track.webp");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    background-color: #BC4A3C;
}

.side-area-left,
.side-area-right {
    display: none;
}

#game-area {
    background-color: #D3D3D3;
    margin: 20% auto auto auto;
    /* Prevents overflow */
    width: inherit;
}

#game-window {
    width: inherit;
    background-color: #D3D3D3;
    padding: 5% 0;
    border: 3px solid #000001;
}

/* Headings */
h1 {
    text-align: center;
    padding-left: 2.5%;
    background-color: #D3D3D3;
    /* Adding 1% margin to prevent h1 from covering external border */
    margin: 0 1%;
}

h2 {
    text-align: center;
    padding: 10px 0;
    line-height: 0px;
    font-size: large;
}

h1, h2 {
    font-family: "Kanit", "Courier New", monospace;
}

#error-title {
    margin-bottom: 5%;
}

/* Buttons & icons */
.main-screen-button,
.new-game-screen-button {
    padding: 10px;
    font-size: larger;
}

.in-game-screen-button {
    margin: 7px auto;
    padding: 6px 4px;
}

.main-screen-button,
.new-game-screen-button,
.in-game-screen-button {
    box-shadow: 3px 3px 2px #808080;
    border: 1px solid #000001;
    color: #000001;
    display: block;
    margin: 7px auto;
    background-color: #F5F5F5;
}

.hidden {
   visibility: hidden;
}

#game-button-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: sticky;
    top: 0;
    background-color: #D3D3D3;
    margin: 0 1px;
}

.fa-solid {
    color: #000001;
    font-size: xx-large;
    margin-left: 30%;
    background-color: #F5F5F5;
}

#quit-confirm, #quit-close {
    display: inline;
}

#quit-close {
    margin-left: 57%;
}

/* Pages and paragraph appearance */
#initial-menu,
#difficulty-menu,
#rules-page,
#about-page,
#controls-page {
    padding-top: 10px;
}

#game-window > section {
    width: 90%;
    margin: 0 auto;
}

.text-block {
    border: 2px solid #000001;
    margin: 5px auto;
    background-color: #F5F5F5;
    border-radius: 1rem;
    padding: 15px;
    text-align: justify;
    font-family: 'Courier New', Courier, monospace;
}

#computer-controls {
    display: none;
}

.general-controls-icons {
    margin-left: 0;
}

.image-display {
    margin: 5px auto;
    border: 2px solid #000001;
    display: block;
    max-width: 275px;
}

#error-container {
    background-color: #D3D3D3;
    margin: 5% auto;
    border: 2px solid #000001;
    padding-bottom: 15px;
}

#error-container > nav {
    margin: 5%;
}

nav > a {
    color: #000001;
}

.hide {
    display: none;
}

/* In-game content */
#game-table {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
}

span {
    background-color: #F5F5F5;
    border: 1px solid #000001;
    padding: 10px 0;
    text-align: center;
    font-size: large;
    /* Added to combat span height changing when span is empty */
    line-height: 0.9;
}

.hint {
    background-color: #F4C430;
    border: 1px dotted #808080;
    font-weight: 600;
}

.choice {
    background-color: #E5E619;
    border: 1px dotted #808080;
    font-weight: 600;
    transition: all 0.2s ease-in;
}

.removed-choice {
    background-color: #000001;
    /* Sets height of the last row when empty to match remaining rows */
    min-height: 1rem;
    /* Overrides choice border */
    border: 1px solid #000001;
    transition: all 0.4s ease-out;
}

/* Score appearance */
#score {
    margin: 0 auto 5px;
    width: auto;
    padding: 5px 5px 1px 5px;
    height: 23px;
    color: #000001;
    display: block;
    background-color: #F5F5F5;
    border: 2px solid #000001;
    text-align: center;
}

/* Modals */
dialog {
    /* z-index and border-radius were taken from Webdevsimplified noted in the Content section of the README */
    z-index: 10;
    margin-top: 10px;
    background: #F5F5F5;
    border: 1px solid #000001;
    border-radius: 1rem;
  }

/* Media query organising display of screens wider than 750px */
@media (min-width: 750px) {
    /* In-game content appearance */
    span {
        padding: 12px 0;
    }
}

/* Media query organising display of screens wider than 950px */
@media (min-width: 950px) {
    /* Page display */
    #grid-container {
        display: grid;
        grid-template-columns: 25% auto 25%;
    }

    .side-area-left,
    .side-area-right {
        display: grid;
    }

    #game-area {
        width: 100%;
        height: auto;
    }

    #flex {
        display: flex;
        flex-direction: row-reverse;
        width: 100%;
        min-height: 500px;
    }

    /* Heading */
    h2 {
        margin-bottom: 15px;
    }

    /* In-game content display */
    #game-button-container {
        display: block;
        padding-top: 5%;
        margin: 0 auto;
        /* Adding to ensure button container remains on the screen, otherwise it doesn't remain sticky */
        max-height: 50px;
    }

    #game-table {
        min-width: 75%;
        margin: 0 auto 0 10px;
        height: 100%;
        padding-top: 10px;
    }

    /* Buttons & icons */
    .fa-solid {
        margin-left: 1vw;
    }

    #phone-controls {
        display: none;
    }

    #computer-controls {
        display: block;
    }
}

/* Media query organising display of screens wider than 1500px */
@media (min-width: 1500px) {
    /* Page display */
    body {
        background-size: cover;
    }
}

/* Media query organising display of screens wider than 1800px */
@media (min-width: 1800px) {
    /* In-game content */
    span {
        padding: 16px 0;
        font-size: x-large;
        line-height: 2;
    }

    /* Score appearance */
    #score {
        aspect-ratio: unset;
        height: auto;
        padding: 5px 1px;
    }

    /* In-game content */
    .removed-choice {
        /* Sets height of the last row when empty to match remaining rows */
        min-height: 3rem;
    }
}
