@import url('https://fonts.googleapis.com/css?family=Lato|Press+Start+2P');
@import url('http://db.onlinewebfonts.com/c/487390d5558cff7a17ce35d7d92a0540?family=Pretendo');

/* Layout */
body {
  background-color: #000;
  background-image: 
    repeating-linear-gradient(
      132deg, #000 0% 10%, transparent 10% 11%, #000 11% 21%, 
      transparent 21% 22%),
    linear-gradient(50deg, #7e2e52 30%, #513a8d 60%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;  
  height: 98vh;
}

h1 {
  font-family: 'Press Start 2P', sans-serif;
  margin-bottom: 2em;
  text-align: center;
  max-width: 800px;
  line-height: 130%;
  color: #8bac0f;
  text-shadow: 1px 1px 0 #fff;
  margin: 0;  
}

h1 + p {
  font-family: Lato, sans-serif;
  font-size: 16px;
  color: #fff;
  margin-bottom: 2em;
}
p a { color: #c78dff; }

.wrapper {
  --gameboy-width: 375px;
  --gameboy-height: 625px;

  width: var(--gameboy-width);
  height: var(--gameboy-height);
  position: relative;
}

/* GameBoy console body */
.gameboy {
  background: #d3ccd3 linear-gradient(#d3ccd3 95%, #999 98%, #777 99%);
  overflow: hidden;
  border-radius: 12px 12px 75px 12px;
  box-shadow: 0 0 10px rgba(0,0,0, 0.5), 0 0 15px rgba(0,0,0, 0.75) inset;
  
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  
  position: relative;
}

.power {
  width: 30px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(to right, #eee 10%, #d3ccd3 30% 70%, #eee 90%);
  box-shadow: 0 0 4px rgba(0,0,0, 0.5) inset;
  position: absolute;
  top: -7px;
  left: 50px;
  cursor: pointer;
}

.power.on { left: 75px; }

.gameboy > .top {
  display: flex;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.gameboy > .top .corner { 
    width: 25px;
    height: 20px;
  }

.gameboy > .top .corner.left { margin-right: 5px; }

.gameboy > .top .corner.right { margin-left: 5px; }

.gameboy > .top .top { 
    width: 100%;
  }

.gameboy > .top > div {
    border-radius: 0 0 2px 2px;
    border: 1px solid rgba(0,0,0, 0.1);
    box-shadow: 1px 1px 3px rgba(0,0,0, 0.25);
  }

.gameboy > .top > div span {
      font-family: Arial, sans-serif;
      font-size: 12px;
      box-shadow: 2px 2px 2px rgba(0,0,0, 0.5) inset;
      text-shadow: 2px 1px 2px rgba(0,0,0, 1);     
      color: #eee;
      border-radius: 15px;
      margin: 0 6px;
      padding: 2px 5px;
      opacity: 0.25;
    }

/* GameBoy complete screen (gray + green) */
.screen {
  background: #767189;
  width: calc(var(--gameboy-height) / 2);
  box-shadow: 0 0 2px #514c65;
  border-radius: 10px 10px 35px 10px;  
  height: 250px;
  margin: 0.1em auto;  
}
.screen span {
    font-family: Arial, sans-serif;
    font-size: 10px;
    color: #fff;    
  }
.screen .top {
    margin: 0 15px;
    height: 30px;
    background: linear-gradient(
      transparent 10px, #7d1a4a 10px 12px, transparent 12px 16px, 
      #35224e 16px 18px, transparent 18px);
    position: relative;
  }
.screen .top span {
      padding: 0 8px;
      background: #767189;
      
      position: absolute;
      right: 30px;
      top: 8px;
    }
.screen .bottom {
    display: flex;
  }
.screen .bottom .led {
      width: 10px;
      height: 10px;
      background: #4a4748;
      border-radius: 50%;
      margin: 6px;
    }
.screen .bottom .led.on {
        background: #d81e07;    
        box-shadow: 0 0 5px #d81e07;      
      }
.screen .bottom .battery {
      padding: 0 10px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
    }

/* Game Screen (only green screen) */
.gamescreen {
  background: #9ca04c;
  width: 200px;
  height: 190px;
  box-shadow: 5px 5px 10px rgba(0,0,0, 0.5) inset, -2px -2px 10px rgba(0,0,0, 0.25) inset;
  
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;  
}
.gamescreen span {    
    display: none;
    font-family: 'Press Start 2P';
    font-weight: bold;
    font-size: 18px;
    letter-spacing: -1px;
    color: #0f380f;    
  }
.gamescreen span sup {
      font-weight: normal;
      font-size: 12px;
    }
.gamescreen.startup span {
    display: block;
    -webkit-animation: startup 2s linear forwards;
            animation: startup 2s linear forwards;    
    -webkit-transform: translate(0, -25px);    
            transform: translate(0, -25px);
  }

@-webkit-keyframes startup {
  0% { -webkit-transform: translate(0, -25px); transform: translate(0, -25px); }
  100% { -webkit-transform: translate(0, 80px); transform: translate(0, 80px); }
}

@keyframes startup {
  0% { -webkit-transform: translate(0, -25px); transform: translate(0, -25px); }
  100% { -webkit-transform: translate(0, 80px); transform: translate(0, 80px); }
}

/* Brand Nintendo GameBoy text */
.brand {
  margin: 5px 30px;
}
.brand span {
    font-family: Pretendo, sans-serif;
    font-size: 15px;
    color: #302058;
  }
.brand span:nth-child(2) {
    font-family: Lato, sans-serif;
    font-weight: bold;
    font-style: italic;
    font-size: 22px;
  }

/* Main controls: Cross and A/B buttons */
.controls {
  display: flex;
  justify-content: space-between;
}

.cross {
  background: linear-gradient(to bottom, #c4bfc6 -10%, #e2e0eb 130%);
  border-radius: 50%;
  padding: 10px;
  width: 100px;
  height: 100px;
  margin: 30px;
  display: grid;
  grid-template-areas: ". up ." "left center right" ". down .";
}

.cross .cursor { 
    background: #040308;
    border: 3px solid #040308;
    box-shadow: 2px 4px 3px rgba(0,0,0, 0.6);
    display: flex;
  }

.cross .cursor.up,
  .cross .cursor.left,
  .cross .cursor.right {
    border-top-color: #c5d8e1;    
  }

.cross .cursor .circle {
    border: 1px solid #111;
    border-left: 0;
    border-bottom: 0;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    background: conic-gradient(transparent 0 30%, rgba(255,255,255, 0.5) 40% 60%, transparent 70%);
  }

.cross .cursor.up { grid-area: up; }

.cross .cursor.left { grid-area: left; }

.cross .cursor.center { grid-area: center; }

.cross .cursor.right { grid-area: right; }

.cross .cursor.down { grid-area: down; }

.cross .cursor:active { 
    box-shadow: none;
    border-color: #111;
  }

.cross .cursor.center:active { border-color: #040308; }

.buttons {
  background: linear-gradient(#b7acb1 -10%, #f1f3f2 130%);
  border-radius: 40px;
  padding: 5px;
  height: 60px;
  display: flex;
  align-items: center;
  margin: 50px 30px 0 0;
  -webkit-transform: rotate(-30deg);
          transform: rotate(-30deg);
}

.buttons .button {
    width: 50px;
    height: 50px;
    box-shadow: -2px 3px 5px rgba(0,0,0, 1), -3px 4px 3px rgba(255, 255, 255, 0.25) inset;
    margin: 0 6px;
    border-radius: 50%;
    background: #6f001a;
  }

.buttons .button:active {
      box-shadow: -3px 4px 3px rgba(0,0,0, 0.25) inset, 2px -2px 3px rgba(0,0,0, 0.25) inset;
    }

.buttons .button::after {
    font-family: Pretendo, sans-serif;
    font-size: 16px;
    color: #302058;
    content: attr(data-button);
    position: relative;
    right: -15px;
    bottom: -65px;
  }

/* Secondary controls: Select & Start */
.gamecontrols {
  display: flex;
  justify-content: center;
  margin-bottom: 50px;  
}
.gamecontrols .gap {
    background: linear-gradient(#b7acb1 -10%, #f1f3f2 130%);
    -webkit-transform: rotate(-28deg);
            transform: rotate(-28deg);
    margin: 0 5px;
    border-radius: 15px;
  }
.gamecontrols .button {
    background: #9e9baf;
    border-radius: 10px;
    box-shadow: 
      -2px -2px 5px rgba(0,0,0, 0.4) inset, 
      2px 2px 5px rgba(255,255,255, 0.7) inset, 
      2px 2px 6px rgba(0,0,0, 0.8);
    width: 50px;
    height: 12px;
    margin: 6px 8px;    
  }
.gamecontrols .button:active {
      box-shadow: 
        -2px -2px 5px rgba(0,0,0, 0.4) inset, 
        2px 2px 5px rgba(0,0,0, 0.7) inset;
    }
.gamecontrols .button::after {
    font-family: Pretendo, sans-serif;
    font-size: 12px;
    color: #302058;
    content: attr(data-button);
    position: relative;
    right: 0;
    bottom: -20px;
  }

/* Gameboy bottom body part */
.gameboy > .bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  left: -20px;
}

.speaker {
  display: flex;
  width: 120px;
  justify-content: space-around;
  position: absolute;
  right: 15px;
  bottom: 35px;
  -webkit-transform: rotate(-30deg);
          transform: rotate(-30deg);
}

.speaker::after {
    content: "";
    width: 200px;
    height: 60px;
    position: absolute;
    background: rgba(0,0,0, 0.1);
    top: 50px;
  }

.speaker .band {
    width: 8px;
    height: 60px;
    border-radius: 8px;
    box-shadow: 3px 6px 1px rgba(0,0,0, 0.6) inset;
    background: rgba(0,0,0, 0.35);
  }

.phones {
  font-family: Arial, sans-serif;
  font-size: 10px;
  opacity: 0.5;
  text-align: center;
  border: 1px solid #aaa;
  border-radius: 40px;
  padding: 2px 6px;
  box-shadow: 0 0 5px rgba(0,0,0, 0.5) inset;
  margin-bottom: 10px;
}