/**
 * Game Fonts
 */
@font-face {
    font-family: "Equilibrium";
    font-style: normal;
    font-weight: normal;
    src: local("Equilibrium"), url("../fonts/equilibrium.ttf") format("TrueType");
}
@font-face {
    font-family: "Bauhaus 93";
    font-style: normal;
    font-weight: normal;
    src: local("Bauhaus 93"), url("../fonts/bauhs93.ttf") format("truetype");
}



/**
 * Main Styles
 */
html, body {
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: transparent;
    font-size: 15px;
}
html, body, input {
    color: black;
    font-family: "Bauhaus 93";
}

a {
    color: #333333;
    text-shadow: #666666 0.05em 0.05em 0.05em;
    text-decoration: none;
    outline: none;
}
a:hover {
    color: black;
    text-shadow: #333333 0.05em 0.05em 0.05em;
}



/**
 * Modes Display
 */
.starting .messages,
.playing  .messages {
    display: none;
}

.mainScreen .main,
.paused     .pause,
.continuing .pause,
.gameOver   .input,
.highScores .high,
.help       .controls {
    display: block;
}

.starting .game,
.playing  .game,
.paused   .game,
.gameOver .game {
    display: block;
}

.starting .food {
    display: none;
}

.paused     .game,
.continuing .game,
.gameOver   .game {
    opacity: 0.5;
}



/**
 * Game Design
 */
#container {
    position: absolute;
    top: 50%;
    left: 50%;
    right: 50%;
    bottom: 50%;
    margin-left: -18.5em;
    margin-top: -15em;
    width: 37em;
    height: 30em;
    background-color: #AACC99;
    background-image: linear-gradient(110deg, #AACC99 25%, #b7d3a8 25%, #b7d3a8 50%, #AACC99 50%, #AACC99);
    border-radius: 1em;
    box-shadow: 0 0 0 1em #272727, 0 0 0 1.2em #121212;
}

.board {
    position: absolute;
    top: 1.8em;
    left: 1.8em;
    bottom: 3.8em;
    right: 1.8em;
    border: 0.1em solid #333333;
    box-shadow: inset -0.2em 0.2em 0 #7C9774, -0.2em 0.2em 0 #7C9774;
}


.game {
    position: absolute;
    display: none;
    top: 1.8em;
    left: 1.8em;
    bottom: 0;
    right: 1.8em;
}
.start {
    position: absolute;
    top: 0.5em;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10em;
    text-shadow: 0.01em 0.01em 0.01em black, -0.01em -0.01em 0.01em black, 0.04em 0.04em 0.01em #333333;
}

.snake {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.score, .time, .level {
    position: absolute;
    bottom: 0.25em;
    left: 0.25em;
    right: 0.25em;
    height: 1.5em;
    font-size: 2em;
    text-shadow: #333333 0.05em 0.05em 0.05em;
}
    .score { text-align: left;   }
    .time  { text-align: center; }
    .level { text-align: right;  }



/**
 * Messages Panel
 */
.messages {
    position: absolute;
    top: -1.2em;
    left: -1.2em;
    bottom: -1.2em;
    right: -1.2em;
    z-index: 5;
}
.messages .text {
    position: absolute;
    top: 5em;
    left: 0;
    right: 0;
    height: 8em;
    background-color: black;
    opacity: 0.8;
}
    .messages .text h2 {
        position: absolute;
        top: 0.1em;
        left: 0;
        right: 0;
        margin: 0;
        font: 6.5em Equilibrium;
        text-align: center;
        text-transform: lowercase;
        color: white;
    }
    .messages .text p {
        position: absolute;
        top: 4.8em;
        left: 0;
        right: 0;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        text-align: center;
        color: white;
    }



/**
 * Main Screen
 */
.main { display: none; }
.demo {
    position: absolute;
    top: 14.5em;
    left: 4em;
    height: 7.5em;
    width: 4.5em;
}
    .demo1 { left: 4.6em; }
    .demo2 { left: 13em; }
    .demo3 { left: 21.7em; }
    .demo4 { left: 30.4em; }

.main ul {
    position: absolute;
    top: 11.25em;
    left: 1em;
    right: 1em;
    margin: 0;
    padding: 0;
    font-size: 2em;
    text-align: center;
    list-style: none;
}
    .main li {
        display: inline-block;
        width: 4em;
    }
    .main li:nth-last-child(-n+3) {
        position: absolute;
        top: 2.7em;
        width: auto;
    }
    .main li:nth-last-child(3)    { left: 0.5em;  }
    .main li:nth-last-child(-n+2) { right: 0.5em; }
    
.main.help li:nth-last-child(1),
.main.continue li:nth-last-child(2) { display: none; }



/**
 * Game Over
 */
.input {
    display: none;
    position: absolute;
    top: 7.5em;
    left: 1em;
    right: 1em;
    font-size: 2em;
    text-align: center;
}
    .input input {
        position: absolute;
        top: 0;
        left: 4.5em;
        width: 6em;
        padding: 0.2em 0 0 0.2em;
        background: none;
        border: 0.1em solid #333333;
        border-radius: 0.25em;
        box-shadow: inset -0.1em 0.1em 0 #7C9774, -0.1em 0.1em 0 #7C9774;
        font-size: 1em;
        z-index: 2;
    }
    .input input:focus { outline: none; }
    .input input::-webkit-input-placeholder { 
        color: #999;
        text-shadow: #CCC 0.1em 0.1em 0.1em;
    }
    .input input:-moz-placeholder {
        color: #999;
        text-shadow: #CCC 0.1em 0.1em 0.1em;
    }
    
    .submit {
        position: absolute;
        top: 0.45em;
        left: 11.25em;
    }
    .restart {
        position: absolute;
        top: 3em;
        left: 1em;
        right: 1em;
        text-align: center;
    }



/**
 * High Scores
 */
.high {
    display: none;
    font-size: 2em;
    text-shadow: #333333 0.05em 0.05em 0.05em;
}
.high ul {
    position: absolute;
    bottom: 0.8em;
    left: 1.4em;
    right: 0;
    height: 1.5em;
    margin: 0;
    padding: 0;
    list-style: none;
    
}
    .high li {
        display: inline-block;
        padding-right: 0.8em;
    }

.scores {
    position: absolute;
    top: 6.5em;
    left: 3em;
    right: 3em;
    bottom: 2.5em;
}
.high .highScore {
    float: left;
    clear: both;
    width: 100%;
}
    .hsName  { float: left;  }
    .hsScore { float: right; }

.none {
    position: absolute;
    display: none;
    top: 7.5em;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
}



/**
 * Pause / Help
 */
.pause {
    display: none;
    position: absolute;
    top: 9em;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    text-align: center;
    list-style: none;
    font-size: 2em;
}
    .pause li {
        display: inline;
        padding: 0 0.5em;
    }


.controls { display: none; }
.controls ol {
    margin: 7.5em 1.9em 0 1.7em;
    font-size: 1.7em;
}
.controls a {
    padding-left: 15.5em;
    font-size: 2em;
}



/**
 * Audio Button
 */
.audio {
    position: absolute;
    bottom: 1.8em;
    left: 18em;
    cursor: pointer;
}
.audio .triangle {
    position: absolute;
    bottom: 0.2em;
    left: 0.2em;
    border: 1em solid transparent;
    border-right-color: #333;
}
    .audio .triangle:after {
        content: "";
        position: absolute;
        top: -0.8em;
        left: -1.2em;
        border: 1em solid transparent;
        border-right-color: #666;
        z-index: -1;
    }
    .audio:hover .triangle       { border-right-color: #000; }
    .audio:hover .triangle:after { border-right-color: #333; }

.audio .box {
    position: absolute;
    bottom: 0.9em;
    left: 1.1em;
    height: 0.6em;
    width: 0.5em;
    background-color: #333;
}
    .audio .box:after {
        content: "";
        position: absolute;
        top: 0.2em;
        left: -0.2em;
        height: 0.6em;
        width: 0.5em;
        background-color: #666;
        z-index: -1;
    }
    .audio:hover .box       { background-color: #000; }
    .audio:hover .box:after { background-color: #333; }

.waves {
    position: absolute;
    bottom: 0;
    left: 2em;
}
    .waves div {
        position: absolute;
        left: 0;
        background-color: #333333;
        border-radius: 0 20em 20em 0;
    }
    .waves div:nth-child(1) {
        bottom: 0.3em;
        width:  1.8em;
        height: 1.8em;
    }
    .waves div:nth-child(2) {
        bottom: 0.5em;
        width:  1.4em;
        height: 1.4em;
    }
    .waves div:nth-child(3) {
        bottom: 0.7em;
        width:  1em;
        height: 1em;
    }
    .waves div:nth-child(4) {
        bottom: 0.9em;
        width:  0.6em;
        height: 0.6em;
    }
    
    .audio:hover .waves div { 
        background-color: black;
    }
    .waves div:before {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        right: 0.1em;
        top: 0;
        background-color: #AACC99;
        border-radius: 0 20em 20em 0;
    }



/**
 * Snake Design
 */
.link {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.7em;
    height: 1.7em;
}
    .snakeBody {
        position: absolute;
        top: 0;
        left: 0.2em;
        bottom: 0.2em;
        right: 0;
        background-color: black;
        border-radius: 0.4em;
        z-index: 2;
    }
    .snakeShadow {
        position: absolute;
        top: 0.2em;
        left: 0;
        bottom: 0;
        right: 0.2em;
        background-color: #7C9774;
        border-radius: 0.4em;
        z-index: 1;
    }



/**
 * Food Design
 */
@keyframes spin {
    from { transform: rotate(0deg);    }
    20%  { transform: rotate(360deg);  }
    50%  { transform: rotate(720deg);  }
    to   { transform: rotate(1080deg); }
}

.spin {
    animation: spin 5s linear;
}

.food {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.7em;
    height: 1.7em;
}
    .foodBody {
        position: absolute;
        top: 0;
        left: 0.2em;
        width: 1.5em;
        height: 1.5em;
        z-index: 2;
    }
    .foodShadow {
        position: absolute;
        top: 0.2em;
        left: 0;
        width: 1.5em;
        height: 1.5em;
        z-index: 1;
    }

    .foodBody div {
        position: absolute;
        background-color: black;
    }
    .foodShadow div {
        position: absolute;
        background-color: #7C9774;
    }
    
    .foodBody div:nth-child(1),
    .foodShadow div:nth-child(1) {
        top: 0;
        left: 0.4em;
        width: 0.7em;
        height: 0.6em;
        border-radius: 0.3em 0.3em 0 0;
    }
    .foodBody div:nth-child(2),
    .foodShadow div:nth-child(2) {
        top: 0.4em;
        right: 0;
        width: 0.6em;
        height: 0.7em;
        border-radius: 0 0.3em 0.3em 0;
    }
    .foodBody div:nth-child(3),
    .foodShadow div:nth-child(3) {
        bottom: 0;
        left: 0.4em;
        width: 0.7em;
        height: 0.6em;
        border-radius: 0 0 0.3em 0.3em;
    }
    .foodBody div:nth-child(4),
    .foodShadow div:nth-child(4) {
        top: 0.4em;
        left: 0;
        width: 0.6em;
        height: 0.7em;
        border-radius: 0.3em 0 0 0.3em;
    }
