html,
body {
  margin: 0;
}

body {
  background-image: url("../img/background.png");
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  background-repeat: no-repeat; /* Do not repeat the image */
  background-size: cover; /* Resize the background image to cover the entire container */
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 999;
  padding: 8px 10px;
  background: #000;
  color: #fff;
}

.skip-link:focus {
  top: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.grid-container {
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto auto auto auto auto;

  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

canvas {
  max-width: 600px;
}

#lights,
#base,
#screen,
#controls {
  pointer-events: none;
}

.grid-container > div {
  z-index: 4;
}

div.screen {
  grid-area: 1/1 / span 1 / span 6;
  height: 300px;
  text-align: center;
  padding-left: 20px;
}

.screen-ui {
  padding: 10%;
}

.selection-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

div.black_screen {
  margin: 8%;
  margin-bottom: 15%;
  grid-area: 1/1 / span 1 / span 6;
  top: 0px;
  background-color: black;
  max-width: 100%;
  max-height: 100%;
  color: white;
}

#screen {
  position: relative;
  max-height: 100%;
}

.controls-overlay {
  grid-area: 2 / 1 / span 1 / span 6;
  width: 100%;
  height: 130px;
  position: relative;
  top: 0px;
  display: grid;
  grid-gap: 0px 10px;
  padding-top: 5px;
}

.button_a {
  grid-area: 1 / 1 / span 3 / span 1;
}
.button_red {
  grid-area: 1 / 2 / span 1 / span 1;
}
.button_blue {
  grid-area: 1 / 3 / span 1 / span 1;
}
.button_arrows {
  grid-area: 1 / 4 / span 3 / span 2;
  grid-template-columns: 30px 20px 30px;
  grid-template-rows: 60px 30px 60px;
  display: grid;
}

.button_up {
  grid-area: 1 / 1 / span 1 / span 3;
}
.button_left {
  grid-area: 2 / 1 / span 1 / span 1;
}
.button_right {
  grid-area: 2 / 3 / span 1 / span 1;
}
.button_down {
  grid-area: 3 / 1 / span 1 / span 3;
}

.controls-overlay button {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  z-index: 50;
  background: transparent;
  border: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.controls-overlay button:focus-visible {
  outline: 3px solid #ffd54f;
  outline-offset: 2px;
  background: rgba(255, 213, 79, 0.2);
}

.button-pressed {
  transform: scale(0.96);
}

#controls {
  top: 0px;
  max-height: 100%;
}

div.controls {
  position: relative;
  z-index: 0;
  text-align: center;
  grid-area: 2 / 1 / span 1 / span 6;
  height: 150px;
}

#base {
  width: 100%;
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  bottom: 0;
  z-index: 0;
}

#lights {
  width: 100%;
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  top: 0;
  z-index: 1;
}

@media screen and (max-width: 320px) {
  #camera {
    max-width: 270px!important;
    max-height: 220px;
  }
  div.screen {
    height: 225px;
    padding-left: 10px;
  }

  div.controls {
    height: 110px;
  }

  .grid-container {
    margin-top: 30px;
  }
}

@media (min-width: 321px) and (max-width: 415px) {
  #camera {
    max-width: 270px!important;
    max-height: 220px;
  }

  div.screen {
    height: 300px;
    padding-left: 10px;
  }

  .grid-container {
    margin-top: 30px;
  }
}

@media (min-width: 415px) and (max-width: 767px) {
  #camera {
    max-width: 270px!important;
    max-height: 220px;
  }

}

@media (min-width: 800px) and (max-width: 1980px) {
  div.screen {
    height: 450px;
  }
  div.controls {
    height: 250px;
  }
  #controls {
    max-height: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1980px) and (max-height: 1080px) {
  .grid-container {
    margin-top: 60px;
  }
  div.screen {
    height: 350px;
  }
  div.controls {
    height: 200px;
  }
}

@media (width: 768px) and (height: 1024px) {
  .grid-container {
    margin-top: 60px;
  }
  div.screen {
    height: 450px;
  }
  div.controls {
    height: 200px;
  }
}

.camera-selected {
  background-color: #b00000;
  color: #fff;
  font-weight: bold;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
