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

:root {
  --color-primary: #ba6f2a;
  --color-primary: #ba6f2a;
  --color-secondary: #333;
  --color-tertiary: #ffd700;
  --color-white: #f1e2d4;
  --color-white-darker: #e3c5aa;
}

::selection {
  background-color: transparent;
  color: var(--color-secondary);
}

body {
  background-color: var(--color-primary);
  font-family: 'Audiowide', sans-serif;
  color: var(--color-white);
}

/* Border around the game box */
.border {
  position: relative;
  padding: 3rem 4rem;
  height: 110vh;
  width: 100%;
  /* background-color: #BA6F2A; */
  background-color: var(--color-primary);
  z-index: 2;
}

/* Main game box area */
.game-box {
  background-color: var(--color-secondary);
  height: 85vh;
  width: 95%;
  margin: 0 auto;
  border-radius: 2rem;
  padding: 1rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
}

.game-box__group--1 {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 5rem;
  margin-left: 3rem;
}

/* Game balls */

.ball {
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 50%;
  transition: all 500ms cubic-bezier(0.53, -0.13, 0.36, 1.25);
  /* transition: all 500ms ease-in-out; */
  cursor: pointer;
  box-shadow: 0 0 0.4rem rgba(0, 0, 0, 0.3);

  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.ball--1 {
  background-color: #3c3aa9;
}
.ball--2 {
  background-color: #8f15a3;
}
.ball--3 {
  background-color: #edcb54;
}
.ball--4 {
  background-color: #e90101;
}

/* The target ball */
.target {
  position: relative;
  z-index: 1;
}

/* Halo over ball to mark the "target" ball */
.marked {
  box-shadow: 0rem 0 3rem var(--color-tertiary);
}

/* Additional styling for the target ball at the beginning of the game. */
.spin {
  border: 2px dashed var(--color-tertiary);
  transition: all 200ms;
  animation: rotate 3000ms infinite linear;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Button to begin the game */
.start-game {
  display: flex;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #333;
  justify-content: center;
}

.start-game__button {
  background-color: var(--color-tertiary);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 250ms;
  box-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.4);
}

.start-game__button:hover {
  background-color: #e0c005;
  box-shadow: 0 0.1rem 0.4rem rgba(0, 0, 0, 0.3);
}

/* Added to start button while game is in motion */
.initialized.start-game__button:hover {
  box-shadow: none;
}

.initialized {
  opacity: 0.6;
  background-color: #e0c005;
  cursor: default;
  box-shadow: none;
}

/* Win/Lose message */
.main {
  position: relative;
}

/* General styling for modal */
.winning-page__box,
.reset-page__box {
  border: 0.5rem solid var(--color-primary);
}

/* Red losing styling for modal */
.losing-page__box {
  border: 0.5rem solid #8b0000;
}

/* Modal overlay */
.results {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 250ms;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Modal box */
.results__box {
  background-color: #333;
  padding: 8rem 16rem;
  display: block;
  border-radius: 3rem;
  transform: scale(0.25);
  transition: transform 400ms;
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Modal text */
.results__message {
  font-size: 5rem;
  text-transform: uppercase;
}

.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Logo */
.logo-box {
  display: flex;
  align-items: center;
}

.logo-box__img {
  width: 10%;
  margin-left: 3rem;
}

.logo {
  width: 100%;
}

.logo-box__title {
  font-size: 2rem;
  text-transform: uppercase;
  margin-left: 2rem;
}

.logo-box__level {
  justify-self: flex-end;
  margin-left: auto;
  margin-right: 5rem;
  font-size: 1.6rem;
  text-transform: uppercase;
}

/* Footer */

.footer {
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  gap: 2rem;
}

.footer a:link,
.footer a:visited {
  /* margin-left: 2rem; */
  text-decoration: none;
  color: inherit;
  transition: color 250ms;
  display: inline-block;
}

.footer a:hover,
.footer a:active {
  color: var(--color-white-darker);
}

/* Reset highscore */

.reset-highscore {
  font-family: 'Audiowide', sans-serif;
  /* margin-left: 2rem; */
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 250ms;
  display: inline-block;
}

.reset-highscore:hover {
  color: var(--color-white-darker);
}
