@font-face {
  font-family: "Tacobox";
  src: url("fonts/TACOBOX_.TTF") format("woff2");
  src: url("fonts/TACOBOX_.TTF") format("woff");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Locuras";
  src: url("fonts/Locuras.TTF") format("woff2");
  src: url("fonts/Locuras.TTF") format("woff");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Burrito";
  src: url("fonts/burrito.TTF") format("woff2");
  src: url("fonts/burrito.TTF") format("woff");
  font-weight: normal;
  font-style: normal;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Georgia, serif;
  background-image: url("img/random_pics/bgpic.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  touch-action: none;
}

.d_none {
  display: none !important;
}

.content-wrapper {
  max-width: 1440px;
  width: 100%;
  flex: 1 0 auto;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

h1 {
  color: #a0220a;
  margin: 0;
  padding: 18px;
  font-family: "Burrito", Arial, Helvetica, sans-serif;
  font-size: 5rem;
  text-shadow: 1px 1px 1px black;
  text-align: center;
}

canvas {
  border: 1px solid #a0220a;
  background-color: black;
  box-shadow: 1px 1px 61px rgba(0, 0, 0, 1);
  order: 1;
  display: block;
}

.game-explanation {
  max-width: 650px;
  margin: 10px auto;
  /* padding: 15px 25px; */
  color: #a0220a;
  text-align: center;
}

.game-explanation h2 {
  /* font-family: "Burrito", Arial, sans-serif; */
  font-size: 32px;
  text-shadow: 1px 1px 1px black;
  margin-bottom: 22px;
}

.game-explanation p {
  font-size: 18px;
  text-shadow: 1px 1px 1px black;
  margin: 8px;
}

.controls-overview {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.key {
  background-color: #8b451398;
  color: #fff8dc;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  margin-bottom: 5px;
}

.description {
  color: #71380e;
  font-size: 14px;
}

.game-container {
  position: relative;
  width: 720px;
  height: 480px;
  margin: 0 auto;
}

#win_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 720px;
  height: 480px;
  background-color: rgba(0, 0, 0, 0.5);
  transition: opacity 300ms ease-in-out;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0;
  box-sizing: border-box;
}

#game_over_image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.rotate_overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background: black;
  color: white;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.5rem;
  padding: 20px;
}

.rotate-icon {
  width: 150px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  animation: pulse 2s infinite ease-in-out;
}

.rotate_overlay p {
  font-family: "Burrito", Arial, sans-serif;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  max-width: 80%;
  line-height: 1.4;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.footer-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* .footer-imprint {
  
}

.footer-text {
  
} */

.footer-text p {
  color: white;
  font-size: 12px;
  margin: 0;
}

.footer-link {
  text-decoration: none;
  color: white;
}

footer {
  width: 100%;
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  box-sizing: border-box;
}

/* ----------------- */
/* RESPONIVE STYLES */
/* --------------- */

@media (max-width: 768px) {
  .game-explanation {
    margin: 15px 10px;
    padding: 10px 15px;
  }

  .controls-overview {
    gap: 10px;
  }
}

@media (max-width: 767px) {
  .game-container {
    width: 100%;
    height: auto;
  }

  canvas {
    width: 100%;
    height: auto;
  }
}

/* Mobile Landscape Fullscreen */
@media screen and (max-width: 1024px) and (orientation: landscape) {
  body {
    overflow: hidden;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    height: 100vh;
  }

  .content-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100vw;
    position: relative;
    z-index: 1;
  }

  h1 {
    display: none;
  }

  .game-container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  canvas {
    width: auto !important;
    height: 100vh !important;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    border: none;
    box-shadow: none;
    position: relative;
    top: 0;
    left: 0;
  }

  .game-explanation {
    display: none;
  }

  #win_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
  }

  footer {
    display: none;
  }

  #game-controls {
    display: none;
  }

  .controls-overview {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
  }

  .control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .key {
    background-color: rgba(139, 69, 19, 0.8);
    color: #fff8dc;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 12px;
  }

  .description {
    color: #ffffff;
    font-size: 11px;
  }
}

/* Portrait mode - show rotate message */
@media screen and (max-width: 1024px) and (orientation: portrait) {
  .rotate_overlay {
    display: flex !important;
  }
}

/* Hide fullscreen button on touch devices (including tablets) */
@media (pointer: coarse) {
  #fullscreenButton {
    display: none !important;
  }
}
