@font-face {
  font-family: "Orbitron regular";
  src: url(./fonts/Orbitron/static/Orbitron-Regular.ttf);
  font-display: swap;
}

@font-face {
  font-family: "Orbitron bold";
  src: url(./fonts/Orbitron/static/Orbitron-Bold.ttf);
}

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

body {
  font-family: "Orbitron regular", sans-serif;
  text-align: center;
  color: white;
  background: url(./images/rover-bg.jpg) no-repeat center/cover;
}

#app {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  gap: 20px;
  padding: 10px;
}

.grid-arrows-container {
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
}

.board-grid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50%;
}

h1 {
  width: 100%;
  color: orangered;
  font-family: "Orbitron bold";
}

/* Timer display */
.timer-display {
  display: flex;
  align-items: center;
  font-size: 30px;
  margin-bottom: 10px;
  gap: 5px;
}

#timer {
  font-size: 30px;
}

/* Game board and commands */
#board-grid {
  display: grid;
  font-family: "Orbitron bold";
  gap: 3px;
  width: 80vw; /* Responsive */
  max-width: 500px; /* For larger screens */
  aspect-ratio: 1 / 1; /* Keep a square shape */
}

.cell {
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  /* font-size: 30px; */
  /* color: darkred; */ /* When we had letters instead of rover image */
}

/* Rover or alien */
.cell img {
  width: 80%;
  height: auto;
  object-fit: contain;
}

.alien {
  z-index: 10;
}

.arrows-rover-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50%;
  gap: 50px;
}

.start-game {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 25px;
  cursor: pointer;
}

#start {
  width: 250px;
  height: 70px;
  border: none;
  font-family: "Orbitron bold";
  font-size: 25px;
  background-color: rgba(255, 255, 255, 0.8);
  color: darkred;
  cursor: pointer;
}

/* To add a 'pressed effect' */
#start:active {
  transform: translateY(2px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#arrow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  font-family: "Orbitron bold";
}

.arrow {
  width: 80px;
  height: 80px;
  cursor: pointer;
}

.forward {
  grid-column: 2;
  grid-row: 1;
}

.backward {
  grid-column: 2;
  grid-row: 3;
}

.left {
  grid-column: 1;
  grid-row: 2;
}

.right {
  grid-column: 3;
  grid-row: 2;
}

.reset {
  grid-column: 2;
  grid-row: 2;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  background-color: orangered;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
}

.arrow:active,
.reset:active {
  transform: translateY(2px);
}

.reset:active {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#rover-info {
  display: flex;
  flex-direction: column;
  font-size: 25px;
  text-align: left;
  padding: 10px;
  gap: 5px;
}

#rover-info p:nth-child(1),
#rover-info span {
  font-family: "Orbitron bold";
}

/* Footer */
footer {
  width: 100%;
  font-size: 20px;
  padding: 10px;
}

/* Alert message */
#modal-container {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  color: black;
  background-color: #fefefe;
  padding: 20px;
  border-radius: 10px;
  opacity: 0.9;
}

.alert-message {
  font-size: 20px;
}

.close-button {
  font-family: "Orbitron bold";
  cursor: pointer;
}

.ok {
  font-size: 18px;
  color: white;
  background-color: darkred;
  border: none;
  padding: 7px;
  margin: 0 auto;
}

.ok:active {
  transform: translateY(1px);
}

.sign {
  float: right;
  font-size: 30px;
  color: #aaa;
}

.sign:hover,
.sign:focus {
  color: darkred;
}

/* Game rules alert message */
.alert-message span {
  font-weight: bold;
}

.ux {
  font-style: italic;
  font-size: 18px;
}

/* Game rules */
#game-rules {
  position: absolute;
  top: 10px;
  right: 50px;
  font-family: "Orbitron bold";
  font-size: 50px;
  cursor: pointer;
}

.tooltip {
  visibility: hidden;
  position: absolute;
  right: 50px;
  height: 70px;
  font-size: 22px;
  background-color: rgba(255, 255, 255, 0.8);
  color: darkred;
  padding: 5px 15px;
}

#game-rules:active {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#game-rules:hover .tooltip {
  visibility: visible;
}

/* Background music */
#toggle {
  position: absolute;
  top: 15px;
  left: 10px;
  cursor: pointer;
}

#toggle-music {
  width: 48px;
  height: 48px;
}

figcaption {
  font-size: 16px;
}
