@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,500;0,700;1,300;1,500;1,700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&display=swap');

:root {
  --index: calc(1vw + 1vh);
  --bg-color: #A5511F;
  --bg-modal: #fff6b2;
  --blue: #3c485f;
  --green: #569400;
  --arrow-size: 45px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Caveat', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg-color);
  background-image: url('../img/sprites/background.png');
  background-size: cover;
}

.btn {
  background-color: var(--green);
  border: 1px solid transparent;
  color: white;
  outline: none;
  cursor: pointer;
  transition: opacity .3s;
}
.btn:hover {
  opacity: 0.9;
}
.btn:active {
  border: 1px solid var(--bg-color);
}

.btn__pushed {
  box-shadow: inset 0px 0px 10px var(--bg-color);
}

.container {
  margin: 0 auto;
  max-width: 700px;
}

.header {
  /*flex-shrink: 0;*/
  width: 100%;
  /*min-height: 10vh;*/
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 20px;
  /*padding: 10px;*/
  border-bottom: 1px solid white;
  color: #fff;
  text-align: center;
}
.header__title {
  text-shadow: 0 0 5px black;
  font-size: 2.5rem;
}

.score,
.high-score {
  font-size: 1.5rem;
  font-weight: bold;
}

.main {
  flex-grow: 1;
  display: flex;
  /*flex-wrap: wrap;*/
  gap: 20px;
  padding: 20px;
  text-align: center;
}

.controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-width: 150px;
  max-height: 500px;
  font-size: 1.3rem;
  color: white;
  /*border: 1px solid black;*/
}

.info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-weight: bold;
}
.help {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.3s;
}
.help:hover {
  color: var(--green);
}
.help__btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.play {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.play__game,
.play__sound,
.new-game__btn {
  padding: 5px 10px;
  border-radius: 15px;
}

.arrows {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px;
  max-width: 150px;
}
.arrow__btn {
  position: relative;
  width: var(--arrow-size);
  height: var(--arrow-size);
  border-radius: 5px;
}
.arrow-up,
.arrow-down {
  width: 100%;
}

.arrow__btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -25%);
  border: 10px solid transparent;
}

.up__btn::after {
  border-bottom: 10px solid white;
  transform: translate(-50%, -75%);
}
.left__btn::after {
  border-right: 10px solid white;
  transform: translate(-75%, -50%);
}
.right__btn::after {
  border-left: 10px solid white;
  transform: translate(-25%, -50%);
}
.down__btn::after {
  border-top: 10px solid white;
  transform: translate(-50%, -25%);
}

/* -----Canvas----- */
#my-canvas {
  /*aspect-ratio: 1/1;*/
  width: 500px;
  height: 500px;
  max-width: 500px;
  max-height: 500px;
  display: block;
  /*margin: 0 auto;*/
  padding: 0;
  border: 1px solid black;
}


.footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 5vh;
  color: #999;
  font-size: 1.3rem;
  text-align: center;
}

.footer__link {
  text-decoration: none;
  color: white;
}
.footer__link:hover {
  color: #eae38b;
}

/* -------------------- Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: .5s ease-in-out;
}
.modal__show {
  visibility: visible;
  opacity: 1;
}

.modal__overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .5);
  cursor: pointer;
}

.modal__content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50vw;
  max-height: 90vh;
  padding: 15px;
  background-color: var(--bg-modal);
  border-radius: 10px;
  overflow-y: auto;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  font-size: 2rem;
  cursor: pointer;
}

.modal__title {
  text-align: center;
  font-size: 2rem;
}

.key {
  display: inline-block;
  min-width: 25px;
  height: 25px;
  padding: 3px;
  border: 1px solid #999;
  border-radius: 3px;
  line-height: 15px;
  text-align: center;
  font-weight: bold;
  color: #999;
}

/*Help modal*/
.help-modal__list {
  list-style: none;
  font-size: 1.2rem;
}

.help-modal__item {
  position: relative;
  margin-top: 10px;
  padding-left: 15px;
}
.help-modal__item::before {
  content: '';
  position: absolute;
  top: 0.4rem;
  left: 0;
  width: 10px;
  height: 10px;
  background-color: var(--green);
  border-radius: 50%;
}

/*Finish modal*/
.modal__finish {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 30px 20px 20px;
  font-size: 1.5rem;
}