* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Barriecito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

@font-face {
  font-family: 'Barriecito';
  src: url('assets/font/Barriecito-Regular.ttf') format('truetype');
}

body{
  align-items: center;
  min-height: 100dvh;
  background-image: url('assets/img/5_background/dessert.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.loading_screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading_content {
  text-align: center;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.loading_bar {
  width: 300px;
  height: 30px;
  background: #333;
  border-radius: 15px;
  overflow: hidden;
  margin: 20px auto;
}

.loading_bar_fill {
  height: 100%;
  background: linear-gradient(90deg, #ca8831, #c39d4a);
  width: 0%;
  transition: width 0.3s;
}

main {
  margin: 0 auto;
  max-width: 1440px;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 48px;
  padding: 16px 0;
}

.d_none {
  display: none !important;
}

.invisible {
  visibility: hidden !important;
  pointer-events: none !important;
}


.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 3px solid black;
  border-radius: 24px;
  background-color: #f5ac2f;
  padding: 16px;
  transition: all 0.3s;
  cursor: pointer;
  min-width: 64px;
}

.btn:hover {
  background-color: #FFDF00;
}

.close_btn {
  position: absolute;
  top: 16px;
  right: 24px;
  background: transparent;
  border: none;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer !important;
  color: #333333;
  transition: color 0.3s;
  z-index: 10;
}

.close_btn:hover {
  color: #000;
}

h1 {
  text-align: center;
  font-size: 2.5rem;
}

h2 {
  font-size: 1.5rem;
}

canvas,
#menu {
  width: 720px;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: fill;
}

#youWin, 
#youLost {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 720px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

#menu img {
  width: 100%;
  height: 100%;
}

#youWin img, 
#youLost img {
  max-width: 80%;
  max-height: 60vh;
  object-fit: contain;
}

.settings_container {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  z-index: 999;
  position: relative;
}

.settings_container img {
  width: 32px;
  height: 32px;
}

#keyboardBtnInfo,
#impressumBtnInfo {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

#keyboardBtnInfo.show,
#impressumBtnInfo.show {
  display: flex !important;
}

.instructions_modal {
  position: relative;
  background: #ffc107;
  padding: 24px;
  border-radius: 30px;
  width: 75dvw;
  height: 70dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow-y: auto;
  gap: 80px;
}

.instructions_container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.impressum_container {
  display: flex;
  flex-direction: column;
  color: black;
  width: 100%;
  overflow-y: auto;
  padding: 16px;
}

.impressum_container p,
.instructions_container p {
  margin-bottom: 8px;
  line-height: 1.4;
  font-size: 1rem;
}

.impressum_content,
.instructions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 2rem;
}

.impressum_content {
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.instruction_key {
  display: flex;
  align-items: center;
  gap: 16px;
}

.instructions img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.endgame_btns {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 30;
}

.restart_btn,
.go_back_to_menu {
  padding: 10px 20px;
  font-weight: bold;
}

.rotate_phone {
  height: 100%;
  width: 100%;
  position: fixed;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  background-color: rgba(200, 200, 200, 0.8);
  z-index: 999;
}

.rotate_phone img {
  width: 150px;
  height: 150px;
  margin-bottom: 20px;
}

.mobile_btn_container {
  display: none;
  width: 720px;
  max-width: 100%;
  margin: 24px auto 0;
  padding: 0 8px;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
}

.mobile_btn_container img {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border: none;
  padding: 0;
}

.mobile_btn_container img:hover {
  opacity: 1;
  cursor: pointer;
}

.mobile_btn_left,
.mobile_btn_right {
  display: flex;
  gap: 16px;
}

.mobile_btn_left button, 
.mobile_btn_right button {
  background-color: rgba(245, 172, 47, 0.8);
  border: 3px solid #000;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile_btn_left button:active, 
.mobile_btn_right button:active {
  transform: scale(0.9);
  background-color: #FFDF00;
}

button, 
#mobileBtnLeft, 
#mobileBtnRight {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

#fullscreen:-webkit-full-screen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#fullscreen:fullscreen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#fullscreen:fullscreen canvas {
  width: 100%;
  height: 100vh;
  max-width: 100vw;
}

#fullscreen:fullscreen .mobile_btn_container,
#fullscreen:-webkit-full-screen .mobile_btn_container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  background: transparent;
}