@font-face {
  font-family: 'League Gothic';
  src: url('fonts/League_Gothic/LeagueGothic-Regular-VariableFont_wdth.ttf') format('truetype');
}

@font-face {
  font-family: 'Gugi';
  src: url('fonts/Gugi/Gugi-Regular.ttf') format('truetype');
  /* You can add additional font properties here, such as font-weight and font-style */
}

@font-face {
  font-family: 'Anton';
  src: url('fonts/Anton/Anton-Regular.ttf') format('truetype');
  /* You can add additional font properties here, such as font-weight and font-style */
}

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

body {
  font-family: 'Gugi', sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh; /* Set the body to fill the viewport height */
  color: darkgray;
  font-size: 13px;
}

header {
  background-color: #222;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
  border-bottom: 1px solid #222;
  padding: 0.34rem 0.67rem;
}

h1 {
  font-size: 1.5rem;
}

a {
  color: inherit;
}

a:hover {
  color: crimson;
}

.container {
  display: flex;
  flex-grow: 1;
}

.side-col {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black;
}

.side-col img {
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.main-col {
  flex: 6;
  position: relative;
  background-color: black;
  background-image: url("images/starsky-1.jpg");
  overflow: hidden;
}

footer {
  /* gradient vertical, lighter in the middle */
  background-color: #222;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
  padding: 0.67rem;
  border-top: 1px solid #111;
}

#ticks {
  padding: 1px;
  background-color: grey;
  width: 165px;
  color: black;
}

.hud-text {
  color: lime;
  position: absolute;
  font-size: 2rem;
  margin: 0.34rem;
  z-index: 110;
  opacity: 0.8;
  top: 0;
}

#score {
  right: 5px;
}

#timeremaining {
  left: 50%;
  transform: translateX(-50%);
}

#highscore {
  left: 5px;
}

#countdown,
#gameover {
  color: white;
  font-size: 3.5rem;
  font-weight: bold;
  position: absolute;
  background-color: red;
  padding: 0.67rem 1rem;
  text-align: center;
  line-height: 1;
  z-index: 999;
  opacity: 0.8;
}

#mainmenu h1 {
  text-align: center;
  color: red;
  margin-bottom: 12px;
}

#mainmenu ul {
  list-style: none;
  text-align: center;
}

#mainmenu li {
  background-image: url("images/selected-bg.png");
  background-position: center;
  background-repeat: no-repeat;
  font-size: 1.34rem;
  cursor: pointer;
  padding: 10px;
  color: white;
}

#mainmenu .selected {
  background-image: url("images/selected-h-bg.png");
  font-weight: bold;
}

#hiscores h1 {
  text-align: center;
  color: red;
  margin-bottom: 10px;
}

#hiscores ul {
  list-style: none;
  height: fit-content;
  display: block;
  overflow-y: auto;
}

#hiscores li {
  padding: 3px;
  cursor: pointer;
}

#topscore h1 {
  text-align: center;
  color: red;
  margin-bottom: 15px;
}

#topscore h2 {
  text-align: center;
  color: yellow;
  margin-bottom: 7px;
}

#topscore h3 {
  color: white;
  margin-bottom: 5px;
  text-align: center;
}

#topscore form {
  text-align: center;
}

#topscore input {
  color: black;
  width: 210px;
  text-align: center;
}

#topscore div {
  text-align: center;
}

#topscore button {
  margin: 18px 5px;
}

#instructions h1 {
  text-align: center;
  color: red;
  margin-bottom: 5px;
}

#instructions ul {
  list-style: none;
  text-align: center;
  height: fit-content;
}

#instructions li {
  padding: 10px;
  cursor: pointer;
}

#credits h1 {
  text-align: center;
  color: red;
  margin-bottom: 5px;
}

#credits ul {
  list-style: none;
  text-align: center;
  height: fit-content;
}

#credits li {
  padding: 10px;
  cursor: pointer;
}

.popup {
  position: absolute;
  background-color: black;
  border: solid 1px silver;
  min-height: 280px;
  padding: 1rem;
  color: white;
  z-index: 999;
}

.centered {
  left: 50%;
  top: 50%;
  width: min(320px, 80%);
  transform: translate(-50%, -50%);
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-gap {
  gap: 1rem;
}

.space-between {
  justify-content: space-between;
}

.space-around {
  justify-content: space-around;
}

.valign-middle {
  align-items: center;
}

.nowrap {
  white-space: nowrap;
}

.closebtn {
  position: absolute;
  background: url("images/close_red.png") no-repeat;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border: none;
  right: 1px;
  top: 1px;
}

.p0 {
  position: absolute;
  background-size: contain;
  background-image: url("images/ship-001.png");
  height: 55px;
  width: 42px;
  z-index: 100;
}

.life {
  opacity: 0.5;
  width: 33px;
  height: 40px;
}

.e0 {
  width: 28px;
  height: 13px;
  z-index: 100;
  position: absolute;
  background-image: url("images/009.png");
}

.e1 {
  width: 28px;
  height: 27px;
  z-index: 100;
  position: absolute;
  background-image: url("images/001.png");
}

.e2 {
  width: 28px;
  height: 25px;
  z-index: 100;
  position: absolute;
  background-image: url("images/002.png");
}

.e3 {
  width: 40px;
  height: 25px;
  z-index: 100;
  position: absolute;
  background-image: url("images/003.png");
}

.e4 {
  width: 50px;
  height: 36px;
  z-index: 100;
  position: absolute;
  background-image: url("images/004.png");
}

.e5 {
  width: 40px;
  height: 22px;
  z-index: 100;
  position: absolute;
  background-image: url("images/005.png");
}

.e6 {
  width: 70px;
  height: 38px;
  z-index: 100;
  position: absolute;
  background-image: url("images/006.png");
}

.e7 {
  width: 22px;
  height: 39px;
  z-index: 100;
  position: absolute;
  background-image: url("images/007.png");
}

.e8 {
  background-image: url("images/008.png");
  width: 60px;
  z-index: 100;
  position: absolute;
  height: 50px;
}

.e9 {
  background-image: url("images/010.png");
  width: 20px;
  z-index: 100;
  position: absolute;
  height: 19px;
}

.pbullet {
  position: absolute;
  z-index: 99;
  background-color: white;
  border: 1px solid;
}

.b1 {
  background-color: yellow;
}

.b2 {
  background-color: lime;
}

@media screen and (max-width: 1024px) {
  #ticks {
    display: none;
  }
  #bullets {
    display: none;
  }
}

@media screen and (max-width: 680px) {
  .main-col {
    flex: 7;
  }
  .hud-text {
    font-size: 1rem;
  }
  .menu {
    display: none;
  }
  #mainmenu {
    width: fit-content;
  }
  #mainmenu li {
    font-size: 1rem;
  }
  #countdown,
  #gameover {
    font-size: 2rem;
  }
  #msg-keydown, #msg-keyup {
    display: none;
  }
  .p0 {
    height: 45px;
    width: 36px;
  }  
  footer {
    justify-content: left !important;
    gap: 2rem !important;
  }
}
