/*
 Copyright (C) 2018 Jan-Dirk van Dingenen
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/  

@import url('https://fonts.googleapis.com/css?family=Press+Start+2P');

:root {
}

::selection, button::selection {
  background: transparent;
}
::-moz-selection, button::-moz-selection {
  background: transparent; 
}

#tracking::selection, #tracking *::selection  {
    background: #ddd;
}

body {
    margin: 0px;
    background: #000;
}

img {
     -webkit-user-drag: none;
     -moz-user-drag: none
}

#game, #intro {
    width: 100vw;
    height: 100vh;   
    overflow:hidden;
    display:none;
}

#tracking {
    position: absolute;
    right: 15px;
    top: 15px;
    background-color: #fff;
    box-shadow: 2px 3px 5px 4px #000;
    min-width: 100px;
    min-height: 50px;
    padding: 5px 20px;
}

#guns {
    position: absolute;
    right: 1vw;
    top: 0px;
    display: flex;
    justify-content: right;
    flex-direction: column;
    pointer-events:none;
}

#guns .gun {
    width: 8vw;
    height: 4vw;
    text-align: center;
    vertical-align: middle;
    line-height: 4vw;
    position: relative;
    margin-top: 5px;
    border-radius: 2px;
    transition: 0.5s all;
}

#lives {
    height: 6vw;
    right: unset;
    left: 0px;
    flex-direction: row;
    justify-content: space-evenly;
    position: absolute;
    pointer-events: none;
    top: 5px;
    width: 21vw;
    display: flex;
}

#lives .life {
    width: 6vw;
    height: 6vw;
    text-align: center;
    vertical-align: middle;
    line-height: 4vw;
    position: relative;
    border-radius: 2px;
    background-image:url(img/aliveMonkey.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

#lives .life.lost {
    background-image:url(img/deadMonkey.png);    
}

.moreLives {
    height: 6vw;
    line-height: 6vw;
    font-size: 2vw;
    font-weight: bold;
    color: #fff;
    background-color: rgba(0,0,0,0.3);
}

#guns .gun img {
    width: 4vw;
    filter: drop-shadow(0 0 1px #000);
}

#guns .gun .ammo {
    font-size: 3vw;
    font-weight: bold;
    font-family: monospace;
    color: #fff;
    width: 4vw;
    position: absolute;
    left: -4.5vw;
    text-shadow: 0 0 1px #000;
}

#guns .gun .gunBack {
    position:absolute;
    top:0px;
    left:0px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    width: 8vw;
    height: 4vw;
}

.gun.active {
    box-shadow: inset 0 0 10px #ffffff, 0 0 2px 2px #ffffff;
}

#guns .gun.active .gunBack {
    opacity:1;
}

#guns .gun.gun_shotgun .gunBack {
    background-image:url(img/shotgun.png);
}

#guns .gun.gun_uzi .gunBack {
    background-image:url(img/uzi.png);
}

#guns .gun.gun_pistol .gunBack {
    background-image:url(img/pistol.png);
}

#guns .gun.gun_automatic .gunBack {
    background-image:url(img/automatic.png);
}

#guns .gun.gun_rifle .gunBack {
    background-image:url(img/sniper.png);
}

#guns .gun.gun_minigun .gunBack {
    background-image:url(img/mini.png);
}

#volume {
    height: 2vw;
    right: unset;
    left: 0px;
    flex-direction: row;
    justify-content: space-evenly;
    position: absolute;
    bottom: 1vh;
    width: 21vw;
    display: flex;
}

#volume .volLevel {
    box-shadow: 0 0 0 1px #fff;
    background-color: rgba(255,255,255,0.2);
    width: 1vw;
    cursor:pointer;
}

#volume .volLevel.active {
    background-color: rgba(255,255,255,1);
}

#volume .soundIcon {
    position: relative;
    color: #fff;
    border: 7px solid;
    border-left: none;
    border-top-color: transparent;
    border-bottom-color: transparent;
    padding: 6px 3px;
    box-shadow: inset 4px 0;
    margin-right: 18px;
    cursor:pointer;
}

#volume .soundIcon:hover {
    color:#000;
}

#volume .soundIcon:before {
    left: -2px;
    width: 15px;
    height: 15px;
    position: absolute;
    content: '';
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid;
    border-bottom-color: rgba(0, 0, 0, 0);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    border-bottom-style: double;
    border-bottom-width: 6px;
    border-collapse: separate;
    border-left-color: rgba(0, 0, 0, 0);
    border-left-width: 6px;
    border-right-style: double;
    border-right-width: 6px;
    border-top-color: rgba(0, 0, 0, 0);
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
    border-top-width: 6px;
}

#volume .soundIcon:after {
    width: 32px;
    height: 32px;
    left: -7px;
    top:50%;
    position: absolute;
    border-radius: 50%;
    transform: translateY(-50%);
    border: 2px solid;
    content: '';
    border-bottom-color: rgba(0, 0, 0, 0);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    border-left-color: rgba(0, 0, 0, 0);
    border-top-color: rgba(0, 0, 0, 0);
}

#volume .soundIcon.nosound:before {
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 2px;
    left: 17px;
    box-shadow: inset 0 0 0 32px;
    position: absolute;
    top: 50%;
    border:none;
}

#volume .soundIcon.nosound:after {
    transform: translateY(-50%) rotate(45deg);
    height: 10px;
    width: 2px;
    left: 21px;
    box-shadow: inset 0 0 0 32px;
    position: absolute;
    top: 50%;
    border:none;
}

#volume .volLevel:hover {
    box-shadow: 0 0 2px 1px #000;
}

#starScore {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
    width:457px;    
}

#starScore button {
    font-family: 'Press Start 2P', cursive;
    padding: 15px;
    margin-right: 61px;
    border: none;
    border-radius: 5px;
    color: #000000;
    background: linear-gradient(to bottom, rgba(172,173,193,1) 0%,rgba(255,255,255,1) 100%);
    cursor: pointer;
    margin-left: 6px;
}

#starScore button:hover {
    box-shadow: 0px 0px 20px #5469ff !important;
}

#starScore #starAnimation {
    --showAnimation : 0;
    width: 396px;
    height: 572px;
    background-image: url(img/starAnimation.png);
    background-repeat: no-repeat;
    background-position-x: calc(-396px * var(--showAnimation));
    margin-bottom:20px;
}

#starScore #starSpeech {
    position: absolute;
    width: 317px;
    height: 300px;
    top: 8px;
    right: 0px;
    text-align: left;
    padding-top: 100px;
    font-size: 23px;
    padding-left: 10px;
    box-sizing: border-box;
}

#starScore #starSpeech .award {
    color: #aaaa;
    height: 24px;
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    line-height: 24px;
    text-transform: uppercase;
}

#starScore #starSpeech .award.success {
    color: #138d00;
}

#starScore #starSpeech .award.yourTime {
    color: #000;
}

#starScore #starSpeech .star {
    position: absolute;
    width: 60px;
    height: 56px;
    background-image: url(img/star.png);
    background-repeat: no-repeat;
    top: 0px;
}

#starScore #starSpeech .star.star_1 {   
    left: 44px;
}

#starScore #starSpeech .star.star_2 {
    left: 100px;
}

#starScore #starSpeech .star.star_3 {
    left: 156px;
}

#starScore #starSpeech .star.star_4 {
    left: 212px;
}

#starScore #starSpeech .star.star_5 {
    top: 43px;
    left: 72px;
}

#starScore #starSpeech .star.star_6 {
    top: 43px;
    left: 128px;
}

#starScore #starSpeech .star.star_7 {
    top: 43px;
    left: 184px;
}

#starScore #smiles {
    background-image: url(img/monkeySmile.png);
    position: absolute;
    width: 176px;
    height: 176px;
    top: 288px;
    display:none;
}

#intro {
    background-color: #f42015;
    color:#000;
    font-family: 'Press Start 2P', cursive;
}

#intro #introGrass {
    width: 100vw;
    height: 263px;
    overflow: hidden;    
    position: absolute;
    bottom: 0px;
    left: 0px;
    background-position-x: -0px;
    background-repeat-x: repeat;
}

#intro #introGrass {
    background-image: url(img/shadowGrass.png);
     animation: grass 2s linear infinite; 
}

@keyframes grass {
    0%   {background-position-x: -0px;}
    100%   {background-position-x: -1328px;}
}


#intro #introName {
    position: absolute;
    top: 36.5vh;
    right: 4vw;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    padding: 10px;
}

#intro input#playerName {
    margin-top: 2vh;
    font-family: 'Press Start 2P', cursive;
    font-size: 2vh;
    padding: 5px;
    background: #f42015;
    border: solid 3px #000;
    text-align: center;
    outline:none;
    transition: 1s all;
    border-radius: 4px;
}

input#playerName:focus {
     border: solid 3px #fff;
}

input::selection {
  background: #fff;
}
input::-moz-selection {
  background: #fff;
}

#intro #viewHigh {
    padding-top: 3.5vh;
    cursor: pointer;
    border-bottom: solid 3px #000;
    transition: 1s all;
    display: inline-block;
}

#intro #viewHigh:hover {
    color: #fff;
    border-bottom: solid 3px #fff;
}

#intro #introTitle {
    height: 12vh;
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 12vh;
    text-transform: uppercase;
    font-size: 5vh;
    font-stretch: ultra-condensed;
}

#intro #introLevels {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

#intro .level {
    padding: 2vh 1vh;
    position:relative;
}

#intro .level.achieved {
    cursor:pointer;
}

#intro .levelData {
    display: none;
}

#intro  .levelName {
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0.5vh;
}

#intro #introLevels .level.achieved:hover .levelData {
    display: block;
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translate(-50%,100%);
    background-color: #fff;
    box-shadow: 0.5vh 0.5vh 1vh rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    padding: 10px;
    border-radius: 3px;
    z-index: 1
        
}

#intro .levelImage {
    filter: saturate(0);
    mix-blend-mode: multiply;
    height: 20vh;
    width: 15vh;
    display: inline-block;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: #234b0f;
    float: left;
    margin-right: 1vh;
    box-shadow: 0 0 2px rgba(0,0,0,0.75);
}

#intro .levelImage.levelImage_0 {
    background-image: url(img/moviePoster1.png);
}

#intro .levelImage.levelImage_1 {
    background-image: url(img/moviePoster2.png);
}


#intro .levelImage.levelImage_2 {
    background-image: url(img/moviePoster3.png);
}


#intro .levelImage.levelImage_3 {
    background-image: url(img/moviePoster4.png);
}

#intro .levelImage.levelImage_4 {
    background-image: url(img/moviePoster5b.png);
}

#intro .levelstars {
    display: flex;
    justify-content: space-between;
}

#intro .levelstar {
    width: 3vh;
    height: 3vh;
    display: inline-block;
    background-image: url(img/star.png);
    filter: saturate(0);
    background-size: cover;
}

#intro .levelImage.achieved, #intro .levelstar.achieved {
    filter: unset;
    mix-blend-mode: unset;
}

#intro .level.achieved:hover .levelImage {
    filter: brightness(125%);
}

#intro .leveltime {
    margin-top: 2vh;
}

#intro #introCanvas {
    position: absolute;
    bottom: 0px;
    width: 100vw;
    z-index: 10;
}

#intro #introStart {
    position: absolute;
    top: 10vh;
    left: 50%;
    transform: translate(-50%,0);
    z-index: 15;
    font-size: 2vh;
    white-space: nowrap;
}

div#other {
    position: absolute;
    top: -1px;
    right: 10px;
    font-size: 75%;
    color: rgb(0, 0, 0);
}

div#other a {
    color: rgb(0, 0, 0);
    opacity: 0.75;
    transition: 1s;
    text-decoration: none;
    font-family: monospace;
}

div#other a:hover {
    opacity: 1;
    color: rgb(255, 255, 255);
}

#credits {
    display:none;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
}

#credits #creditsCar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 305px;
    height: 490px;
    background-image: url(img/creditCar.png);
    background-size: cover;
    animation: car 200ms infinite; 
}

@keyframes car {
    0%   {left:50%; top:50%;}
    24%   {left:50%; top:50%;}
    25%   {left:calc(50% + 2px)}
    50%   {left:50%;}
    74%   {left:50%; top:50%;}
    75%   {left:calc(50% - 2px)}
    100%   {left:50%}
}

#credits  #creditsDirt {
    position: absolute;
    top: 161px;
    left: 50px;
    width: 200px;
    height: 280px;
    background-image: url(img/carDirt.png);
    background-size: 600px 280px;
    animation: dirt 400ms infinite;
    z-index: -1;
}

@keyframes dirt {
    0%      {background-position-x:0px;}
    32%     {background-position-x:0px;}
    33%     {background-position-x:-200px;}
    65%     {background-position-x:-200px;}
    66%     {background-position-x:-400px;}
    99%     {background-position-x:-400px;}
    100%    {background-position-x:0px;}
}

#credits  #creditsDriver {
    width: 40px;
    height: 40px;
    background-image: url(img/monkeyDrive.png);
    position: absolute;
    top: 240px;
    left: 94px;
    background-size: 160px 240px;
    background-position-x: 0px;
    background-position-y: -200px;
    background-repeat: no-repeat;
    animation: driver 1000ms infinite;
}

@keyframes driver {
    0%      {background-position-x:0px;}
    24.9%     {background-position-x:0px;}
    25%     {background-position-x:-40px;}
    49.9%     {background-position-x:-40px;}
    50%     {background-position-x:-80px;}
    74.9%     {background-position-x:-80px;}
    75%     {background-position-x:-120px;}
    99.9%     {background-position-x:-120px;}
    100%    {background-position-x:0px;}
}

#credits #creditsSleeper {
    width: 80px;
    height: 40px;
    background-image: url(img/monkeySleep.png);
    position: absolute;
    top: 370px;
    left: 109px;
    background-size: 480px 240px;
    background-position-x: 0px;
    background-position-y: -200px;
    background-repeat: no-repeat;
    animation: sleeper 15000ms infinite;
}

@keyframes sleeper {
    0%      {background-position-x:0px;}
    15.9%     {background-position-x:0px;}
    16%     {background-position-x:-80px;}
    31.9%     {background-position-x:-80px;}
    32%     {background-position-x:-160px;}
    47.9%     {background-position-x:-160px;}
    48%     {background-position-x:-240px;}
    63.9%     {background-position-x:-240px;}
    64%     {background-position-x:-320px;}
    79.9%     {background-position-x:-320px;}
    80%     {background-position-x:-400px;}    
    99.9%     {background-position-x:-400px;}   
    100%    {background-position-x:0px;}
}

#credits #creditsGorilla {
    height: 128px;
    background-image: url(img/monkeySprites.png);
    position: absolute;
    top: 180px;
    left: 170px;
    background-size: 1550px 2232px;
    background-repeat: no-repeat;
    width: 62px;
}

#credits #creditsTitle {
    position: absolute;
    font-size: 3vw;
    text-align: center;
    top: 2vh;
    width: 100%;
    text-transform: uppercase;
}

#credits #creditsPart1 {
    position: absolute;
    top: 50%;
    left: 25%;
    text-align: center;
    font-size: 1.5vw;
    line-height: 3vw;
    text-transform: uppercase;
    transform: translate(-60%,-60%);
}

#credits #creditsPart2 {
    position: absolute;
    top: 50%;
    left: 75%;
    text-align: center;
    font-size: 1.5vw;
    line-height: 3vw;
    text-transform: uppercase;
    transform: translate(-60%,-60%);
}

#help {
    position: absolute;
    top: 36.5vh;
    left: 4vw;
    padding: 10px;
    border-radius: 5px;
    color: #000;
    font-family: 'Press Start 2P', cursive;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: 40px auto;
    grid-column-gap: 20px;
    line-height: 3vh;
    z-index: 0;
}

#help .helpTitle {
    grid-area: 1 /1 / auto / span 2;
    grid-row-start: 1;
    grid-column-start: 1;
    grid-row-end: auto;
    grid-column-end: span 2;
    text-transform: uppercase;
}


#intro #highScores {
    position: absolute;
    top: 9.5vh;
    left: 50%;
    transform: translate(-50%,0);
    background: hsla(3, 91%, 52%, 0.95);
    width: 90vw;
    justify-content: start;
    padding: 1vw;
    border: solid 3px #000;
    height: 46vh;
    z-index: 100;
    white-space: nowrap;
    overflow: auto;
    cursor: default;
}

#intro #highScores .scoreDiv {
    color: #f42015;
    font-family: 'Press Start 2P', cursive;
    display: inline-grid;
    grid-template-columns: 25px auto auto;
    grid-template-rows: 40px auto;
    grid-column-gap: 20px;
    line-height: 3vh;
    width: 40vw;
    background: #000;
    padding: 1vw;
    margin-right: 1vw;
}

#intro #highScores .scoreDiv div {
    line-height: 3vh;
    height:3vh;
}

#intro #highScores .scoreDiv .score {
    text-align: right;
    position:relative;
}

#intro #highScores .scoreDiv .scoreHead {
    grid-area: 1 /1 / auto / span 2;
    grid-row-start: 1;
    grid-column-start: 1;
    grid-row-end: auto;
    grid-column-end: span 3;
    text-transform: uppercase;
    text-align: center;
}

#intro #highScores::-webkit-scrollbar {
}
#intro #highScores::-webkit-scrollbar-thumb {
    background-color: rgb(0, 0, 0);
}
#intro #highScores::-webkit-scrollbar-track {
    background-color: transparent;
    border-top: solid 1px #000;
}

#intro #closeHigh {
    position: absolute;
    top: 7.4vh;
    right: 3vw;
    z-index: 200;
    background: #f12715;
    color:#000;
    border: solid 3px #000;
    padding: 5px;
    cursor: pointer;
    transition:  1s all;
    text-transform: uppercase;
}

#intro #closeHigh:hover {
    background: #000;
    color:#f12715;
}

#intro .scorePop {
    background: #fff;
    color: #000;
    position: absolute;
    right: 0px;
    top: 3vh;
    z-index: 100;
    padding: 10px;
    border-radius: 4px;
    height:auto !important;
}

#intro .scorePop .leveltime {
    margin-top: 0 !important;
}
