/* Global Styles */
:root {
  --clr-bg: #cfeffc;
  --clr-bee-yellow: #ffcc00;
  --clr-cell: #a06d3d;
}

body {
  margin: 0;
  background-color: var(--clr-bg);
  font-family: Arial, sans-serif;
  overflow: hidden;
  min-height: 100vh;
}

body.grid-shown {
  background-image: url(../img/bg.svg?v=0.1.10);
  background-size: auto 40%;
  background-position: bottom left;
  background-repeat: repeat-x;
}

img {
  pointer-events: none;
  user-select: none;
}

#game-container {
  position: relative;
  container-type: size;
  aspect-ratio: 9 / 11; /* 2 extra vertically for the header,footer */
  max-width: min(calc(100vw - 20px), calc(9 / 11 * (100vh - 20px)));
  max-height: min(calc(11 / 9 * (100vw - 20px)), calc(100vh - 20px));
  width: min(calc(100vw - 20px), calc(9 / 11 * (100vh - 20px)));
  height: min(calc(11 / 9 * (100vw - 20px)), calc(100vh - 20px));
  min-width: 300px;
  min-height: calc(11 / 9 * 300px);
  margin: 10px auto;
}

#grid-container, .welcome-container, .level-complete-container, .game-complete-container {
  aspect-ratio: 1 / 1;
}

#game-header {
  width: 100%;
}

#grid-container {
  padding-top: 10cqh;
}
#game-footer {
  position: absolute;
  width: 100%;
  padding-top: 0;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
}
#game-header {
  position: absolute;
  padding-top: 0;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  z-index: -1;
}
#level-display {
  display: flex;
  align-items: center;
  margin-left: auto;
  height: 5cqw;
}
.level-dot {
  display: inline-block;
  width: 1.5cqw;
  height: 1.5cqw;
  border-radius: 50%;
  background-color: #ffffff;
  margin: 0 0.4cqw;
}
.level-dot.queen {
  width: 2.4cqw;
  height: 2.4cqw;
}
.level-dot.completed {
  background-color: var(--clr-bee-yellow);
}
#grid-container {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
}
.welcome-container, .level-complete-container, .game-complete-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.grid-cell {
  position: relative;
  background-color: transparent;
  aspect-ratio: 1/1;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  cursor: pointer;
}
.grid-cell.active {
  cursor: default;
}
.grid-cell > img {
  width: 100%;
}
img.grid-cell-icon {
  position: absolute;
  width: 50%;
}
.grid-cell.active > img.grid-cell-icon {
  display: none;
}

.bee {
  pointer-events: none;
  position: absolute;
  background-image: url(../img/bee.svg?v=0.1.10);
  background-size: cover;
  animation: flap 0.1s steps(2) infinite;
}
.queen-bee {
  pointer-events: none;
  position: absolute;
  background-image: url(../img/queen.svg?v=0.1.10);
  background-size: cover;
  animation: flap 0.1s steps(2) infinite;
}
@keyframes flap {
  0% { background-position: 0%; }
  100% { background-position: 200%; }
}
.level-complete-container > p, .game-complete-container > p {
  color: #964B00;
  font-size: 24px;
  margin-bottom: 20px;
}
.level-complete-container > button, .welcome-container > button {
  border: none;
  border-radius: 10%;
  background-color: var(--clr-cell);
  color: #FFFFFF;
  cursor: pointer;
  height: 20%;
  width: 20%;
  aspect-ratio: 1/1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}
.play-icon, .next-icon {
  width: 60%;
  filter: invert(99%) sepia(0%) saturate(7498%) hue-rotate(227deg) brightness(102%) contrast(102%);
}
.great-icon {
  width: 50%;
}
.start-icon {
  width: 50cqw;
  margin-bottom: 5cqw;
}
.end-icon {
  width: 50%;
}
#volume-control-container,
.level-complete-container > button:hover, .welcome-container > button:hover {
  background-color: #946538;
}

#volume-control-container {
  padding: 1cqw;
  border-radius: 1cqw;
  display: none;
}
#volume-icon {
  height: 6cqw;
  pointer-events: all;
}
#volume-control {
  margin-left: 1cqw;
  display: none;
}
body.grid-shown #volume-control-container {
  display: flex;
  align-items: center;
}
#volume-control {
  -webkit-appearance: none; /* Override default CSS styles */
  appearance: none;
  width: 100%;
  height: 3cqh;
  background: transparent;
  outline: none;
}
/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) */
#volume-control::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  width: 2cqh;
  height: 3cqh;
  background: #ffffff;
  cursor: pointer;
}
#volume-control::-moz-range-thumb {
  width: 2cqh;
  height: 3cqh;
  background: #ffffff;
  cursor: pointer;
  border: none;
}
#volume-control::-webkit-slider-runnable-track {
  width: 100%;
  height: 1cqh;
  background: #ffffff;
  border-radius: 5px;
}
#volume-control::-moz-range-track {
  width: 100%;
  height: 1cqh;
  background: #ffffff;
  border-radius: 5px;
}