/ *============CSS reset - Start=============*/
/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}


/* Remove list styles & padding on ul & ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'],
ul {
  list-style: none;
  padding: 0;
}


/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
}


/* removes default underline from links */
a {
  text-decoration: none;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* ============
CSS reset - End
============= */

/* Fonts */
/* overlock-italic - latin */
@font-face {
  font-family: 'Overlock';
  font-style: italic;
  font-weight: 400;
  src: local(''),
    url('fonts/overlock-v10-latin-italic.woff2') format('woff2'),
    /* Chrome 26+, Opera 23+, Firefox 39+ */
    url('fonts/overlock-v10-latin-italic.woff') format('woff');
  /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* overlock-700italic - latin */
@font-face {
  font-family: 'Overlock';
  font-style: italic;
  font-weight: 700;
  src: local(''),
    url('fonts/overlock-v10-latin-700italic.woff2') format('woff2'),
    /* Chrome 26+, Opera 23+, Firefox 39+ */
    url('fonts/overlock-v10-latin-700italic.woff') format('woff');
  /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* overlock-900 - latin */
@font-face {
  font-family: 'Overlock';
  font-style: normal;
  font-weight: 900;
  src: local(''),
    url('fonts/overlock-v10-latin-900.woff2') format('woff2'),
    /* Chrome 26+, Opera 23+, Firefox 39+ */
    url('fonts/overlock-v10-latin-900.woff') format('woff');
  /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* overlock-900italic - latin */
@font-face {
  font-family: 'Overlock';
  font-style: italic;
  font-weight: 900;
  src: local(''),
    url('fonts/overlock-v10-latin-900italic.woff2') format('woff2'),
    /* Chrome 26+, Opera 23+, Firefox 39+ */
    url('fonts/overlock-v10-latin-900italic.woff') format('woff');
  /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* Body basics */

:root {
  --hot-pink: #FF5DF4;
  --happy-aqua: hsl(189, 100%, 50%);
  --happy-aqua-alt: hsl(189, 100%, 45%);
  --emoji-yellow: #FFDE34;
}


body {
  display: flex;
  flex-direction: column;

  background: url('images/rainbow-sm.jpg');
  color: var(--hot-pink);
  font-family: overlock, cursive;
  font-weight: 900;
  position: relative;
  text-align: center;
}

/* rainbow background opacity*/
#overlay {
  background-color: white;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: -1;
}

.half-opacity {
  opacity: .6
}

.no-opacity {
  opacity: 0;
  transition: opacity 2500ms ease-out;
}

/* typography */
h1 {
  font-size: 10vmin;
}

.header__title--accent {
  color: var(--emoji-yellow);
  font-style: italic;
  font-weight: 900;
}

h2 {
  color: var(--emoji-yellow);
  font-size: 4vmin;
  font-style: italic;
  font-weight: 900;
}

/* layout */
.flex {
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: var(--happy-aqua-alt);
  border-radius: 10px;
  margin: .75rem auto 0;
  padding: .5em 5vmin;
  width: 80vmin;
}

/* Buttons */
.buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  margin: 3vmin auto;
}

/* to rearrange directional buttons on tablet screens */
#upBtnTablet,
#rightBtnTablet,
#downBtnTablet,
#leftBtnTablet {
  display: none;
}

.buttons__middle {
  display: flex;
  align-items: center;
  justify-content: center;
}

#startBtn {
  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--emoji-yellow);
  border-radius: 10px;
  border: 3px solid var(--hot-pink);
  color: var(--hot-pink);
  font-size: 5vmin;
  margin: .25em;
  padding: 0 1em;
  height: 12vmin;
}

.directional-btn {
  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--hot-pink);
  border-radius: 10px;
  border: 3px solid var(--happy-aqua-alt);
  color: var(--emoji-yellow);
  font-size: 13vmin;
  height: 14vmin;
  width: 14vmin;
}

#startBtn:hover, #startBtn:active,
.directional-btn:hover, .directional-btn:active{
  border: 3px solid white;
  box-shadow: 0 0 6px 1px hsla(360, 100%, 100%, .5) inset;
  color: white;
  cursor: pointer;
}



/* Game */
.game {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  background: var(--happy-aqua-alt);
  border-radius: 10px;
  margin: 0 auto 2vmin;
  padding: 4vmin 5vmin 2vmin;
  width: 80vmin;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  border-radius: 10px;
  border: 1vmin solid var(--emoji-yellow);
  height: 80vmin;
  width: 80vmin;
}

.square {
  background: var(--hot-pink);
  height: 8vmin;
  width: 8vmin;
}

.snake {
  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--happy-aqua);
}

/* emojis */
.emoji {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 7vmin;
}

#scoreBoard,
#currentScore {
  font-size: 6vmin;
  margin-top: .25em;
}

#currentScore {
  color: var(--emoji-yellow);
}

/* media query - tablet */
@media (min-width: 43.75em) {
  h1 {
    font-size: 8vmin;
  }

  h2 {
    font-size: 3vmin;
  }

  .buttons {
    flex-direction: row;
  }

  #startBtn {
    font-size: 5vmin;
    height: 10vmin;
  }

  .directional-btn {
    width: 10vmin;
    height: 10vmin;
    font-size: 9vmin;
  }

  #upBtnTablet,
  #rightBtnTablet,
  #downBtnTablet,
  #leftBtnTablet {
    display: block;
  }

  #upBtn,
  #rightBtn,
  #downBtn,
  #leftBtn {
    display: none;
  }

  #downBtnTablet, #rightBtnTablet {
    margin-left: .05em;
  }

}


/* media query - desktop */
@media (min-width: 68.75em) {
  .flex {
    flex-direction: row;
    margin-top: 3rem;
  }

  header {
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  h1 {
    font-size: 9vmin;
  }

  h2 {
    font-size: 5vmin;
    margin-left: 4em;
  }

  .buttons {
    flex-direction: column;
  }

  #upBtnTablet,
  #rightBtnTablet,
  #downBtnTablet,
  #leftBtnTablet {
    display: none;
  }

  #upBtn,
  #rightBtn,
  #downBtn,
  #leftBtn {
    display: block;
  }

  #startBtn {
    font-size: 4vmin;
    height: 11vmin;
    padding: 0 .75em;
  }

  .directional-btn {
    width: 11vmin;
    height: 11vmin;
    font-size: 10vmin;
  }

  #startBtn:hover,
  .directional-btn:hover {
    border: 3px solid white;
    box-shadow: 0 0 6px 1px hsla(360, 100%, 100%, .5) inset;
    color: white;
    cursor: pointer;
  }

  .game {
    margin: 0 auto 2vmin;
    padding: 2vmin;
    width: 65vmin;
  }

  .grid {
    width: 60vmin;
    height: 60vmin;
  }

  .square {
    width: 6vmin;
    height: 6vmin;
  }

  #scoreBoard, #currentScore {
    font-size: 4vmin;
  }
  .emoji {
    font-size: 5vmin;
  }
}

/* design credit for background rainbow pattern */
.attributions {
  color: white;
  font-size: 12px;
  z-index: -2;
}