body {
    margin: 0;
    background: #f2f2f2;
}

#gameHolder {
    position: relative; /* fix to allow #gameEnd absolute left translate work */
    /*margin: 10;*/
    /*width: 640px;
    height: 640px;*/
    /*border: 1px solid black;*/
}

#gameCanvas {
    z-index: 1;
    /*border: 1px solid red;*/
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #878888;
}

#gameEnd {
    min-width: 100%;
}

#gameEnd:nth-child(1) {
    margin-top: 2vh;
}

/*
    Interstitial font colours
 */
.gameEnd-win { 
    color: rgba(0,255,0,0.8);
}

.gameEnd-lose { 
    color: rgba(255,0,0,0.8);
}

.gameEnd-flavour, .gameEnd-time { 
    color: rgba(0,0,0,0.8);
}

.gameEnd-blank {
    display:none;
}

.gameStart {
    font: serif;
    margin-bottom: 1vh;
}

#gameScoreHolder {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%,0);
    /*border: 1px solid purple;*/
}

#gameScore {
    position: absolute;
    right: 2vh;
    top: 2vh;
    /*border: 1px solid black;*/
    /*padding: 1vh;*/
    text-align: center;    
}

#gameScore p {
    background-color: rgba(255,255,255,0.9);
    line-height: 200%;
}

.interstitial {
    border-top: 1px solid rgba(0,0,0,0.6);
    border-bottom: 1px solid rgba(0,0,0,0.6);
    padding: 2vh 0 2vh 0;
}

.interstitial > section {
    /*margin-bottom: 2vh;*/
    padding: 1vh 0 1vh 0;
}

.fade {
    animation: fadeInAnimation ease 1s;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}

@keyframes fadeInAnimation {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
     }
}

#load, #start /*#controls*/ {
    padding: 0;
    min-width: 100%;
    min-height: 20%;
}

.overlay {
    z-index: 100;
    /*width: 98%;*/
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
    padding: 2vh 0 2vh 0;
    overflow: hidden;
}

.opaque {
    background-color: rgba(255,255,255,0.9); /* should this just be a generic bearboarding background @ 200% zoom? */
}

#controls {
    z-index: 1000; /* so it shows above even after level screen */
    min-width: 100%;
}

.screen {
    display: none;
}

.start { 
    display: block;
}

form {
    margin: 10px;
}

button, select {
    padding: 0.5vh;
    margin: 0.5vh;
    cursor: pointer;
}

form button:nth-child(n+2) {
    margin-left: 10px;
}

form label {
    margin-left: 10px;
}

#controls section {
    width: 90%;
    margin: auto;
    padding: 1vh 0 1vh 0;
}

#controls nav {
	width: 90%;
    margin: auto;
}

#controls nav ul {
	list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 2%;
    justify-content: center;
	margin: 0;
    padding: 0;
}

#controls nav ul li {
    padding: 10px;
}

#controls .hidden {
    display: none;
}

#gameControls {
    margin-top: 2vh;
}

#gameJoystick {
    position: relative;
    left: 50%;
    translate: -50%;
    touch-action: none;
}


table {
    table-layout: fixed;
    width: 60%;
    border-collapse: collapse;
    border: 1px solid purple;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

th, td {
    padding: 10px;
    text-align: center;
}

thead th:nth-child(1) {
    width: 20%;
}

table .inAir {
    color: purple;
}

.purple {
    border: 1px solid #ca00e8;
    background-color: #ca00e8;
    color: rgba(0,0,0,0.8);
}

.teal {
    border: 1px solid #5fcde4;
    background-color: #5fcde4;
    color: rgba(0,0,0,0.8);
}

li:hover {
    background-color: white;
    cursor: pointer;
}

@media screen and (max-device-width: 600px) {
	h1, h2, h3, h4, h5, h6, p {
        margin: 0.5vh 0 0 0;
    }
    
    h1 {
        font-size: 160px;
    }
    
    h2 {
        font-size: 120px;
    }

    h3, h4, h5, h6 {
        font-size: 60px;
    }

    .interstitial {
        border-top: 3px solid rgba(0,0,0,0.6);
        border-bottom: 3px solid rgba(0,0,0,0.6);
    }

    p, ul {
        font-size: 40px;
    }

    #gameScore p {
        font-size: 30px;
    }

    button, select {
        font-size: 40px;
        padding: 1vh;
        border: 3px solid rgba(0,0,0,0.6);
    }

    #smallButtons button, select {
        font-size: 30px;
    }

    optgroup {
        font-size: 12px;
    }

    table {
        font-size: 4vw;
        padding-top: 0.5vw;
        margin: 1vw 0 1vw 0;
        width: 100%;

    }

    table th, td {
        padding: 20px;
    }
}

@media screen and (min-device-width: 600px) {
	h1, h2, h3, h4, h5, h6, p {
        margin: 0.5vh 0 0 0;
    }
    
    h1 {
        font-size: 8vw;
    }
    
    h2 {
        font-size: 6vw;
    }

    h3, h4, h5, h6 {
        font-size: 4vw;
    }

    p {
        font-size: 2vw;
    }

    button, select {
        font-size: 2vw;
    }

    #smallButtons button, select {
        font-size: 1vw;
    }

    optgroup {
        font-size: 2vw;
    }
}

@media screen and (min-device-width: 1000px) {
	h1, h2, h3, h4, h5, h6, p {
        margin: 0.5vh 0 0 0;
    }
    
    h1 {
        font-size: 100px;
    }
    
    h2 {
        font-size: 60px;
    }

    h3, h4, h5, h6 {
        font-size: 40px;
    }

    p {
        font-size: 14px;
    }

    button, select {
        font-size: 14px;
    }

    #smallButtons button, select {
        font-size: 10px;
    }

    optgroup {
        font-size: 12px;
    }
}