@import url('https://fonts.googleapis.com/css2?family=Sniglet&display=swap');

/* Tutorial for root variables followed from W3 Schools https://www.w3schools.com/css/css3_variables.asp */
:root {
    --on-colour: rgb(144,238,144);
    --on-border: rgb(0,128,0);
    --off-colour: rgb(255,0,0);
    --off-border: rgb(0,0,0);
}

html, body { 
    height: 100%;
}

body {
    font-family: 'Sniglet', cursive,'comic sans','arial';
    height: 100%;
    margin: 5px;
    background-image: url("../images/mobile_background.webp");
    background-position: center;
    background-repeat: repeat-y;
    background-size: cover;
    font-size: 16px;
}

header {
    text-align: center;
}

h1, h2 {
    color: var(--on-colour);
    text-shadow: 5px 5px black;
    margin: 10px;
}

#easy, #hard, #redgreen, #yellowblue {
    margin: 8px;
    padding: 6px;
}

/* Main game canvas */
#game {
    margin: 20px;
    display: grid;
    place-items: center;
    grid-template-columns: 1fr 1fr;
}

/* Styling for light button divs when 'off' */
.light {
    height: 5rem;
    width: 5rem;
    margin: 20px;
    padding: 10px;
    background-color: var(--off-colour);
    border: 3px solid var(--off-border);
    border-radius: 50%;
}

.light.disable {
    pointer-events: none;
}

/* Class for JS to use to turn light button divs to 'on' */
.light_on {
    background-color: var(--on-colour);
    border: 3px solid var(--on-border);
}

/* Styling for display of score and buttons */
.score_box {
    text-align: center;
}

.score_container {
    display: inline-block;
    background-color: var(--on-colour);
    border: 3px solid var(--on-border);
    padding: 20px;
    margin: 5px;
}

.game_buttons {
    margin: 10px;
    text-align: center;
}

button {
    padding: 10px;
    margin: 10px 20px;
}

/* Radio buttons */

#game_select, #colour_select {
    background-color: var(--on-colour);
    margin: 5px;
}

/* Footer containing image link */
footer {
    text-align: center;
    padding: 5px;
}

footer a, footer a:visited {
    color: black;
    background-color: var(--on-colour);
}

/* Stick footer to bottom of screen if less than 100% of viewing window height */
body > footer {
    position: sticky;
    top: 100vh;
  }

/* EXTERNAL CODE USED FROM https://www.w3schools.com/howto/howto_css_modals.asp */

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  }
  
  /* Modal Content/Box */
  .modal-content {
    background-color: var(--on-colour);
    margin: 15% auto; /* 15% from the top and centered */
    padding: 10px;
    border: 3px solid var(--on-border);
    width: 80%; /* Could be more or less, depending on screen size */
  }

  .modal-content ul {
    padding: 10px;
    list-style: none;
  }
  
  /* The Close Button */
  .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
  }
  
  .close:hover,
  .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }

/* EXTERNAL CODE ENDS HERE */

/* Mobile media query */
@media only screen and (max-width: 600px) {

    .light_tablet, .light_desktop {
        display: none;
    }
    
}

/* Tablet media query */
@media only screen and (min-width: 600px) {
    
    body {
        background-image: url("../images/tablet_background.webp");
    } 
    
    .light_mobile, .light_tablet {
        display: block;
    }

    .light_desktop {
        display: none;
    }
}

/* Desktop media query */
@media only screen and (min-width: 992px) {

    .light_mobile, .light_tablet, .light_desktop {
        display: block;
    }
    
    body {
        background-image: url("../images/desktop_background.webp");
    }
    #game {
        display: grid;
        place-items: center;
        grid-template-columns: 1fr 1fr 1fr;
    }

}