@media only screen and (max-width: 1440px) {
  canvas {
    width: 100%;
  }
}

@media only screen and (max-width: 1370px) {
  h1 {
    display: none;
  }

  .canvas-section {
    max-height: 100dvh;
    margin: 0 auto;
  }

  canvas {
    height: 100%;
    max-height: 100dvh;
    border-width: 5px;
  }

  .ingame-mute {
    top: 10px;
    right: 10px;
  }

  .info-overlay > img {
    max-height: 95dvh;
    width: auto;
  }

  .options-card {
    width: 80%;
    padding: 10px 20px;
    max-height: 90dvh;
    overflow-y: auto;
  }

  .options-card h2 {
    font-size: 28px;
    margin-bottom: 10px;
    padding-bottom: 5px;
  }

  .option-row {
    font-size: 16px;
    margin: 5px 0;
    gap: 5px;
  }

  .menu-icon-button,
  .close-button {
    font-size: 16px;
    padding: 5px 15px;
    gap: 10px;
  }

  .close-button {
    margin-top: 10px;
  }

  .mute-button {
    width: 16px;
    height: 16px;
  }
}

@media only screen and (max-width: 1024px) and (orientation: portrait) {
  #rotate-device {
    display: flex;
  }

  #fullscreen {
    display: none;
  }
}

@media only screen and (max-width: 920px) and (orientation: landscape) and (max-height: 480px) {
  .options-card {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    width: 90%;
    padding: 10px;
    overflow-y: hidden;
  }

  .options-card h2 {
    width: 100%;
    font-size: 22px;
    margin-bottom: 5px;
    padding-bottom: 2px;
    border-bottom: 1px dashed #5c3a21;
  }

  .option-row {
    width: 48%;
    margin: 2px 0;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  input[type='range'] {
    margin-top: 0;
    height: 10px;
  }

  .menu-icon-button {
    padding: 4px 10px;
    font-size: 14px;
  }

  .option-row:nth-last-of-type(2) {
    display: none;
  }

  .close-button {
    width: 100%;
    margin-top: 5px;
    padding: 5px;
    font-size: 16px;
  }

  .mobile-buttons-container {
    display: flex;
  }

  .ingame-mute {
    top: 10px;
    right: 10px;
  }
}

@media only screen and (max-width: 1024px) and (orientation: landscape) and (max-height: 480px) {
  .touch-btn {
    width: 48px;
    height: 48px;
  }

  .touch-btn img {
    width: 60%;
  }

  .btn-group-left,
  .btn-group-right {
    gap: 12px;
  }
}

@media (max-width: 920px) {
  #fullscreen {
    width: 100%;
    height: 100svh;
    max-height: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    position: fixed;
    top: 0;
    left: 0;
  }

  body {
    height: 100svh;
    overflow: hidden;
    position: fixed;
  }

  canvas {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
  }

  .canvas-section {
    max-height: none;
    height: 100%;
  }
}

@media only screen and (max-width: 720px) {
  .explanation {
    display: none;
  }

  .start-button {
    width: 80px;
  }

  .small-button {
    width: 50px;
  }

  .menu-container {
    top: 10px;
    right: 10px;
    gap: 8px;
  }

  .button-area {
    padding: 10px 20px;
    justify-content: space-between;
  }

  .options-card {
    width: 95%;
    padding: 20px;
  }

  .options-card h2 {
    font-size: 42px;
  }

  .option-row {
    font-size: 28px;
  }

  .menu-icon-button,
  .close-button {
    font-size: 20px;
    padding: 10px 20px;
  }

  .impressum-text {
    margin-bottom: 0px;
  }

  .impressum-text p {
    font-size: 18px;
  }
}

@media only screen and (max-height: 700px) {
  .options-card {
    padding: 12px 15px;
  }

  .options-card h2 {
    font-size: 26px;
    margin-bottom: 8px;
    padding-bottom: 4px;
  }

  .impressum-text {
    max-height: 38dvh;
  }
}

@media (min-aspect-ratio: 16/9) {
  .start-image-wrapper {
    height: 100dvh;
    width: auto;
  }
}

@media (pointer: coarse) and (orientation: landscape) {
  .mobile-buttons-container {
    display: flex;
  }
}

.impressum-link {
  position: absolute;
  bottom: 10px;
  right: 14px;
  background: none;
  border: none;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.65;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
  transition: opacity 0.2s ease;
}

.impressum-link:hover {
  opacity: 1;
}

.d-none {
  display: none;
}
