@font-face {
  font-family: "Bungee";
  src: url("../fonts/Bungee-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 14px;
  background: url('../img/bg/wüste.png') center/cover no-repeat fixed;
  font-family: "Bungee", sans-serif;
}

h1{
  margin: 0;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 6px 18px rgba(0,0,0,.25);
  font-size: clamp(36px, 6vw, 84px);
}

.game-wrap{
  position: relative;
  width: min(92vw, 720px);
  aspect-ratio: 3 / 2;
  max-height: calc(100vh - 140px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  background: rgba(0,0,0,.18);
}

#canvas{
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}


.hud{
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  z-index: 95;
}

.hud-btn{
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
}

.hud .fs-btn,
.hud .sound-btn{
  position: static !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
}

.hud .sound-btn img{
  width: 24px;
  height: 24px;
  display: block;
}

.hud .fs-btn{
  position: static !important;
}

.sound-btn img{
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

.sound-btn.is-off{
  opacity: .6;
  filter: grayscale(1);
}


.overlay{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
}

.overlay--show{ display: flex; }

.overlay-card{
  width: min(680px, 92%);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  background: rgba(0,0,0,.55);
  position: relative;
}

.overlay-preview{
  width: 100%;
  display: block;
}

.overlay-actions{
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  background: rgba(0,0,0,.35);
}

.overlay-actions--top{
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 0;
  background: transparent;
  z-index: 5;
}

.ui-btn{
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 800;
  background: #f5c400;
  color: #2b1d00;
  box-shadow: 0 6px 0 rgba(0,0,0,.25);
  transition: transform .08s ease, filter .12s ease;
}

.ui-btn:active{ transform: translateY(1px); }

.ui-btn--ghost{
  background: rgba(255,255,255,.14);
  color: #fff;
}

.mobile-controls{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: none; 
  justify-content: space-between;
  padding: 0 16px;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: .2s ease;
}

.mobile-controls--show{
  display: flex;     
  opacity: 1;
  transform: translateY(0);
}

.ctrl-left,
.ctrl-right{
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.ctrl-btn{
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(20, 12, 6, .45);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  user-select: none;
  touch-action: none;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease;
}

.ctrl-btn:active{
  transform: translateY(1px) scale(.98);
  background: rgba(20, 12, 6, .62);
}

#btnJump, #btnThrow{
  width: 62px;
  height: 62px;
  font-size: 26px;
  border-radius: 18px;
}

#legal-notice .topnav{ display: none; }

#legal-notice .bottomnav{
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

#legal-notice a{
  text-decoration: none;
  color: rgba(0,0,0,.9);
  font-family: "Bungee", sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  font-weight: 700;
}

#legal-notice a:hover{ transform: translateY(-1px); }

#legal-notice .burger{
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.85);
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  cursor: pointer;
  padding: 0;
}

#legal-notice .burger img{
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

#rotate-screen{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  margin: 0;
  padding: 0;
}

#rotate-screen .rotate-icon{
  width: 100vw;
  height: 100vh;
  display: block;
  object-fit: cover;
}

#startScreen .overlay-actions--top{
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;     
  gap: 10px;
  padding-right: 110px;
}

#startScreen .overlay-actions--top .ui-btn{
  flex: 0 1 auto;
  min-width: 0;
  padding: clamp(7px, 1.6vw, 10px) clamp(12px, 2.6vw, 16px);
  font-size: clamp(12px, 2.8vw, 14px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 420px){
  #startScreen .overlay-actions--top{
    gap: 8px;
    padding-right: 100px;
  }
  #startScreen .overlay-actions--top .ui-btn{
    padding: 6px 10px;
    font-size: 12px;
  }
}

.hud{
  top: clamp(8px, 2vw, 12px);
  right: clamp(8px, 2vw, 12px);
  gap: clamp(6px, 1.4vw, 10px);
}

.hud-btn{
  width: clamp(34px, 5vw, 46px);
  height: clamp(34px, 5vw, 46px);
  border-radius: clamp(10px, 1.8vw, 12px);
  padding: 0;
}

.hud .fs-btn,
.hud .sound-btn{
  position: static !important;
  inset: auto !important;
  margin: 0 !important;

  width: clamp(34px, 5vw, 46px) !important;
  height: clamp(34px, 5vw, 46px) !important;
}

#btnFullscreen{
  font-size: clamp(14px, 2.8vw, 20px);
  line-height: 1;
}

#btnSound img{
  width: clamp(16px, 3.2vw, 24px);
  height: clamp(16px, 3.2vw, 24px);
}

#legal-notice .topnav{ display: none; }
#legal-notice .bottomnav{
  display: flex;
  justify-content: center;
  padding: 12px 0;
}