* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Splash", cursive;
}

body {
  background-image: url("./img/assets/desert-5385998_640.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
}

.d_flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.d_none {
  display: none;
}

.dblock {
  display: block;
}

.start-screen {
  position: relative;
  background-image: url("./img/9_intro_outro_screens/start/startscreen_1.png");
  background-repeat: round;
  justify-content: space-between;
  width: 720px;
  height: 480px;
  padding-top: 50px;
  padding-bottom: 30px;
}

.canvas-wrapper {
  position: relative;
  display: none;
}

.fullscreen,
.canvas-fullscreen {
  position: absolute;
  right: 12px;
  bottom: 12px;
  cursor: pointer;
  z-index: 20;
  width: 32px;
  height: 32px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease,
    opacity 150ms ease;
  will-change: transform, box-shadow;
}

:fullscreen canvas,
:fullscreen .start-screen {
  width: 960px;
  height: 560px;
}

.fullscreen:hover,
.fullscreen:focus,
.canvas-fullscreen:hover,
.canvas-fullscreen:focus {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  filter: brightness(1.06);
  opacity: 1;
}

.fullscreen:focus,
.canvas-fullscreen:focus {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

.start-screen h2 {
  position: relative;
  display: inline-block;
  color: white;
  font-size: 24px;
  text-align: center;
  text-shadow: 2px 2px 4px #000000;
}

.win-screen {
  background-image: url("./img/You won, you lost/You Win A.png");
  background-size: contain;
  background-repeat: no-repeat;
  justify-content: flex-end;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding-top: 50px;
  padding-bottom: 30px;
  background-position: center;
}

.end-screen {
  background-image: url("./img/You won, you lost/You lost.png");
  background-size: contain;
  background-repeat: no-repeat;
  justify-content: flex-end;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding-top: 50px;
  padding-bottom: 30px;
}

#controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 102;
}

#controls.d_none {
  display: none;
}

canvas {
  background-color: black;
  display: block;
}

h1 {
  font-weight: 800;
  font-style: normal;
  font-size: 50px;
}

.control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 200ms ease;
}

.control:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.control img {
  width: 60px;
  height: 60px;
}

.control span {
  font-size: 20px;
  font-weight: bold;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 500px;
  width: calc(100% - 40px);
  margin: 0 20px;
  gap: 20px;
}

@font-face {
  font-family: "splash";
  src: url("./fonts/Splash-Regular.ttf");
}

.close-btn-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid white;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
  font-family: "Splash", cursive;
  transition: all 200ms ease;
  z-index: 101;
}

.close-btn-controls:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.close-btn-controls:active {
  transform: scale(0.95);
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
}

.canvas-arrow-left,
.canvas-arrow-right,
.canvas-arrow-up,
.canvas-arrow-throw {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  width: 60px;
  height: 80px;
  font-size: 24px;
  font-weight: bold;
  color: black;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  user-select: none;
}

.canvas-arrow-left:active,
.canvas-arrow-right:active,
.canvas-arrow-up:active,
.canvas-arrow-throw:active {
  transform: scale(0.8);
  background-color: rgba(0, 0, 0, 0.5);
}

.canvas-arrow-left {
  left: 10px;
  bottom: 0;
}

.canvas-arrow-right {
  left: 100px;
  bottom: 0;
}

.canvas-arrow-up {
  right: 180px;
  bottom: 0;
}

.canvas-arrow-throw {
  right: 100px;
  bottom: 0;
}

#canvas-controls {
  display: none;
}

#rotate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 1);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#rotate img {
  position: fixed;
  top: 50%;
  left: 50%;
  height: 100vh;
  width: 100vw;
  object-fit: contain;
  transform: translate(-50%, -50%);
  z-index: 999;
}

@media (orientation: portrait) {
  #rotate img {
    transform: translate(-50%, -50%);
    max-width: 90vmin;
    max-height: 90vmin;
    width: auto;
    height: auto;
  }
}

@media only screen and (max-width: 1440px) {
  canvas,
  .start-screen {
    width: 960px;
    height: 560px;
  }

  .fullscreen,
  .canvas-fullscreen {
    display: none;
  }

  #canvasWrapper #canvas-controls.active {
    display: block;
  }

  #canvas-controls img {
    width: 50px;
    height: 50px;
  }

  #canvas-arrow-left,
  #canvas-arrow-right,
  #canvas-arrow-up,
  #canvas-arrow-throw {
    width: 80px;
    height: 70px;
    font-size: 18px;
    border-radius: 8px;
  }

  .canvas-arrow-left {
    left: 8px;
    bottom: 10px;
  }

  .canvas-arrow-right {
    left: 120px;
    bottom: 10px;
  }

  .canvas-arrow-up {
    right: 120px;
    bottom: 10px;
  }

  .canvas-arrow-throw {
    right: 8px;
    bottom: 10px;
  }
}

@media only screen and (max-width: 1000px) {
  canvas {
    width: 100%;
    height: auto;
  }

  h1 {
    display: none;
  }

  .start-screen {
    width: 100%;

    height: 100vh;
  }

  #canvasWrapper #canvas-controls.active {
    display: block;
  }

  #canvas-arrow-left,
  #canvas-arrow-right,
  #canvas-arrow-up,
  #canvas-arrow-throw {
    width: 50px;
    height: 50px;
    font-size: 18px;
    border-radius: 8px;
  }

  .canvas-arrow-left {
    left: 8px;
    bottom: 8px;
  }

  .canvas-arrow-right {
    left: 65px;
    bottom: 8px;
  }

  .canvas-arrow-up {
    right: 65px;
    bottom: 8px;
  }

  .canvas-arrow-throw {
    right: 8px;
    bottom: 8px;
  }

  .fullscreen,
  .canvas-fullscreen {
    display: none;
  }
}

.unmute-button {
  position: fixed;
  top: 12px;
  left: 50%;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid white;
  color: white;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 101;
}

.unmute-button img {
  width: 30px;
  height: 30px;
}


#impressum {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 102;
  overflow-y: auto;
  padding: 20px;
}

#impressum.d_none {
  display: none;
}

.impressum-container {
  background: linear-gradient(
    135deg,
    rgba(210, 180, 140, 0.95) 0%,
    rgba(222, 184, 135, 0.95) 100%
  );
  border: 4px solid #8b6914;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  background-image:
    linear-gradient(90deg, transparent 1px, rgba(0, 0, 0, 0.03) 1px),
    linear-gradient(transparent 1px, rgba(0, 0, 0, 0.03) 1px);
  background-size: 4px 4px;
}

.impressum-container h2 {
  color: white;
  font-size: 36px;
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  border-bottom: 3px solid #ffd700;
  padding-bottom: 15px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
}

.impressum-content {
  margin-bottom: 30px;
}

.impressum-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.4);
}

.impressum-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.impressum-section h3 {
  color: #ffd700;
  font-size: 18px;
  margin-bottom: 12px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #ffd700;
  text-underline-offset: 5px;
}

.impressum-section p {
  color: white;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-weight: 400;
}

.impressum-section a {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  transition: color 150ms ease;
}

.impressum-section a:hover {
  color: white;
  text-decoration: underline;
}

.impressum-close-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: #8b6914;
  color: white;
  border: 2px solid #5c4033;
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: "Splash", cursive;
  font-weight: bold;
  margin-top: 10px;
}

.impressum-close-btn:hover {
  background-color: #5c4033;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.impressum-close-btn:active {
  transform: translateY(0);
}

.impressum-container::-webkit-scrollbar {
  width: 10px;
}

.impressum-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.impressum-container::-webkit-scrollbar-thumb {
  background: #8b6914;
  border-radius: 10px;
}

.impressum-container::-webkit-scrollbar-thumb:hover {
  background: #5c4033;
}

@media only screen and (max-width: 600px) {
  .impressum-container {
    padding: 25px;
    max-height: 90vh;
    border: 3px solid #8b6914;
  }

  .impressum-container h2 {
    font-size: 28px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .impressum-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }

  .impressum-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .impressum-section p {
    font-size: 13px;
  }

  #impressum {
    padding: 10px;
  }
}

@media only screen and (max-width: 1000px) and (orientation: landscape) {
  h1 {
    display: none;
  }

  .canvasWrapper,
  .canvas {
    width: 100%;
    height: 100vh;
  }

  #canvas-controls {
    display: none;
  }

  #canvas-controls.active {
    display: block;
  }

  .fullscreen,
  .canvas-fullscreen {
    display: none;
  }
}

@media only screen and (max-width: 720px) and (orientation: landscape) {
  #canvas-controls.active {
    display: block;
  }

  body {
    height: 100vh;
  }
}

@media only screen and (max-width: 480px) {
  canvas {
    width: 100%;
    height: auto;
  }

  .canvas-arrow-left,
  .canvas-arrow-right,
  .canvas-arrow-up,
  .canvas-arrow-throw {
    width: 45px;
    height: 45px;
    font-size: 16px;
    border-radius: 6px;
  }

  .canvas-arrow-left {
    left: 6px;
    bottom: 6px;
  }

  .canvas-arrow-right {
    left: 56px;
    bottom: 6px;
  }

  .canvas-arrow-up {
    right: 56px;
    bottom: 6px;
  }

  .canvas-arrow-throw {
    right: 6px;
    bottom: 6px;
  }
}

@media only screen and (max-width: 360px) {
  canvas {
    width: 100%;
    height: auto;
  }

  .canvas-arrow-left,
  .canvas-arrow-right,
  .canvas-arrow-up,
  .canvas-arrow-throw {
    width: 40px;
    height: 40px;
    font-size: 14px;
    border-radius: 5px;
  }

  .canvas-arrow-left {
    left: 4px;
    bottom: 4px;
  }

  .canvas-arrow-right {
    left: 48px;
    bottom: 4px;
  }

  .canvas-arrow-up {
    right: 48px;
    bottom: 4px;
  }

  .canvas-arrow-throw {
    right: 4px;
    bottom: 4px;
  }

  h1 {
    font-size: 24px;
  }
}


@media only screen and (orientation: landscape) and (max-height: 700px) {
  #controls {
    overflow-y: auto;
    padding: 20px;
  }

  .control-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    width: calc(100% - 40px);
    margin: 0 20px;
    gap: 15px;
  }

  .control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 1 calc(50% - 10px);
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 200ms ease;
  }

  .control img {
    width: 50px;
    height: 50px;
  }

  .control span {
    font-size: 16px;
    font-weight: bold;
  }

  .close-btn-controls {
    top: 15px;
    right: 15px;
    padding: 8px 15px;
    font-size: 16px;
  }
}

@media only screen and (orientation: landscape) and (max-height: 500px) {
  .control {
    flex: 0 1 calc(50% - 10px);
    padding: 12px;
  }

  .control img {
    width: 45px;
    height: 45px;
  }

  .control span {
    font-size: 14px;
  }

  .control-buttons {
    gap: 12px;
  }
}

@media only screen and (max-height: 480px) {
  canvas {
    height: 100vh;
    width: 100vw;
  }
}
