@font-face {
  font-family: "Zabars";
  src: url("fonts/Zabars.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
}

html:not(.legal-document) {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 16px;
  background-image: url("img/desert.jpg");
  background-size: cover;
  background-position: center;
  font-family: "Zabars", Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

body:not(.legal-page) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

h1 {
  margin: 16px 0 24px;
  font-size: 90px;
  letter-spacing: 9px;
  line-height: 1;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.orientation-warning {
  display: none;
}

.orientation-warning-content {
  max-width: 360px;
  padding: 24px;
  border: 2px solid #ffcf43;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.62);
  color: white;
  text-align: center;
  text-shadow: 2px 2px 4px black;
}

.orientation-warning-content p {
  margin: 0 0 10px;
  font-size: 40px;
  line-height: 1;
}

.orientation-warning-content span {
  display: block;
  font-size: 28px;
  line-height: 1;
}

canvas {
  background-color: black;
  display: block;
  background-position: center;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

.game-container {
  position: relative;
  width: min(720px, calc(100vw - 32px), 150vh);
  aspect-ratio: 3 / 2;
  background-color: black;
  overscroll-behavior: contain;
  touch-action: none;
}

.game-container:fullscreen {
  width: min(100vw, 150vh);
  height: auto;
  aspect-ratio: 3 / 2;
  margin: auto;
}

.game-container:-webkit-full-screen {
  width: min(100vw, 150vh);
  height: auto;
  aspect-ratio: 3 / 2;
  margin: auto;
}

.start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background-image: url("img/9_intro_outro_screens/start/startscreen_1.png");
  background-size: cover;
  background-position: center;
}

.mobile-start-impressum {
  display: none;
}

.start-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 48px;
  color: white;
  font-size: 44px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px black;
}

.start-controls b {
  color: #ffcf43;
}

.win-screen {
  background-image: url("img/You won, you lost/You Win A.png");
}

.final-screen {
  z-index: 10;
  background-color: black;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.final-screen .start-controls {
  display: none;
}

.final-screen .start-actions {
  margin-top: auto;
  margin-bottom: 24px;
}

.final-screen .start-button {
  padding: 8px 16px;
  font-size: 18px;
}

.lose-screen {
  background-image: url("img/You won, you lost/You lost.png");
}

.game-over-screen {
  background-image: url("img/You won, you lost/Game Over.png");
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.start-button {
  padding: 12px 28px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: #ffcf43;
  color: #4a1d00;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
}

.how-to-play-button {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 30;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #7a2f00;
  border-radius: 50%;
  background-color: rgba(255, 207, 67, 0.9);
  color: #4a1d00;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
  touch-action: manipulation;
}

.start-button:hover,
.how-to-play-button:hover {
  background-color: #ffb72b;
}

.how-to-play-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.64);
  font-family: Arial, Helvetica, sans-serif;
}

.how-to-play-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: rgba(255, 246, 214, 0.96);
  color: #23150a;
}

.how-to-play-dialog h2 {
  margin: 0 44px 12px 0;
  font-size: 32px;
}

.how-to-play-dialog p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.4;
}

.how-to-play-dialog ul {
  margin: 0;
  padding-left: 22px;
}

.how-to-play-dialog li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.35;
}

.how-to-play-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: #ffcf43;
  color: #4a1d00;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
}

.how-to-play-close-button:hover {
  background-color: #ffb72b;
}

.fullscreen-button {
  padding: 8px 14px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: #ffcf43;
  color: #4a1d00;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

.fullscreen-exit-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  padding: 8px 14px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: #ffcf43;
  color: #4a1d00;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

.fullscreen-button:hover,
.fullscreen-exit-button:hover {
  background-color: #ffb72b;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.back-link,
.legal-content a {
  color: #98312C;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a,
.site-footer .fullscreen-button {
  display: inline-block;
  padding: 6px 14px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: #ffcf43;
  color: #4a1d00;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
  text-decoration: none;
  touch-action: manipulation;
}

.site-footer a:hover,
.site-footer a:active,
.site-footer .fullscreen-button:hover {
  background-color: #ffb72b;
}

.mute-button {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #7a2f00;
  border-radius: 50%;
  background-color: rgba(255, 207, 67, 0.26);
  color: #7a2f00;
  cursor: pointer;
  backdrop-filter: blur(2px);
  touch-action: manipulation;
}

.mute-button.is-muted {
  background-color: rgba(152, 49, 44, 0.28);
  color: #98312c;
}

.mute-button-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.mute-button-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.mute-button-icon-off {
  display: none;
}

.mute-button.is-muted .mute-button-icon-on {
  display: none;
}

.mute-button.is-muted .mute-button-icon-off {
  display: block;
}

.legal-page {
  align-items: stretch;
  padding: 32px 16px;
  font-family: Arial, Helvetica, sans-serif;
}

.legal-content {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #23150a;
  line-height: 1.5;
}

.legal-content h1 {
  margin: 24px 0;
  font-family: "Zabars", Arial, Helvetica, sans-serif;
  font-size: 72px;
  letter-spacing: 4px;
}

.legal-content h2 {
  margin: 28px 0 8px;
  font-size: 24px;
}

.legal-content p {
  margin: 0;
  font-size: 16px;
}

.back-link {
  display: inline-block;
  font-size: 15px;
}

.fullscreen-exit-icon {
  width: 20px;
  height: 20px;
  display: none;
}

.fullscreen-exit-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.mobile-fullscreen-button {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  display: none;
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: rgba(255, 207, 67, 0.86);
  color: #4a1d00;
  cursor: pointer;
  touch-action: manipulation;
}

.mobile-fullscreen-button:active {
  background-color: #ffb72b;
}

.mobile-fullscreen-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.mobile-fullscreen-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.game-container:fullscreen .mobile-fullscreen-button,
.game-container:-webkit-full-screen .mobile-fullscreen-button {
  display: none;
}

.mobile-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 15;
  display: none;
  justify-content: space-between;
  pointer-events: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.mobile-control-group {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.mobile-control-button {
  min-width: 58px;
  min-height: 42px;
  padding: 8px 10px;
  border: 2px solid #7a2f00;
  border-radius: 8px;
  background-color: rgba(255, 207, 67, 0.86);
  color: #4a1d00;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  display: grid;
  place-items: center;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-control-button:active {
  background-color: #ffb72b;
}

.mobile-control-icon {
  width: 28px;
  height: 28px;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

.mobile-control-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.mobile-control-icon-bottle {
  object-fit: contain;
}

.start-screen:not(.d-none) ~ .mobile-controls {
  display: none;
}

.d-none {
  display: none;
}

body.touch-layout .how-to-play-button {
  display: grid;
}

body.touch-layout .mobile-controls {
  display: flex;
}

body.touch-layout .mobile-control-button {
  min-width: 70px;
  min-height: 52px;
  padding: 10px 14px;
}

body.touch-layout .mobile-control-icon {
  width: 32px;
  height: 32px;
}

body.touch-layout #startControls {
  display: none;
}

body.touch-layout .site-footer .fullscreen-button {
  display: none;
}

body.touch-layout .mobile-fullscreen-button {
  display: grid;
  place-items: center;
}

body.touch-layout .start-screen:not(.d-none) ~ .mobile-fullscreen-button {
  top: auto;
  bottom: 8px;
  left: 48px;
}

body.touch-layout .start-screen.d-none ~ .mobile-fullscreen-button {
  top: 8px;
  bottom: auto;
  left: calc(50% + 24px);
}

body.touch-layout .start-screen.d-none ~ .mute-button {
  top: 8px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
}

body.touch-layout .fullscreen-exit-button:not(.d-none) {
  top: 8px;
  right: auto;
  bottom: auto;
  left: calc(50% + 24px);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 4px;
}

body.touch-layout .start-screen:not(.d-none) ~ .fullscreen-exit-button:not(.d-none) {
  top: auto;
  right: auto;
  bottom: 8px;
  left: 48px;
}

body.touch-layout .fullscreen-exit-text {
  display: none;
}

body.touch-layout .fullscreen-exit-icon {
  display: block;
  width: 16px;
  height: 16px;
}

@media (max-width: 760px), (min-aspect-ratio: 1/1) and (max-height: 760px) {
  .how-to-play-button {
    display: grid;
  }

  body.touch-layout .mobile-control-button {
    min-width: 50px;
    min-height: 38px;
    padding: 6px 8px;
  }

  body.touch-layout .mobile-control-icon {
    width: 24px;
    height: 24px;
  }

  .start-screen:not(.final-screen) {
    justify-content: flex-start;
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .start-screen:not(.final-screen) .start-actions {
    margin-top: 0;
  }

  .start-screen:not(.d-none):not(.final-screen) .mobile-start-impressum {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 30;
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid #7a2f00;
    border-radius: 8px;
    background-color: #ffcf43;
    color: #4a1d00;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.2;
    text-decoration: none;
    touch-action: manipulation;
  }

  .start-screen:not(.d-none):not(.final-screen) .mobile-start-impressum:hover,
  .start-screen:not(.d-none):not(.final-screen) .mobile-start-impressum:active {
    background-color: #ffb72b;
  }

  .start-screen.d-none ~ .mute-button {
    top: 8px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .start-screen.d-none ~ .mobile-fullscreen-button {
    top: 8px;
    left: calc(50% + 22px);
  }

  .fullscreen-exit-button:not(.d-none) {
    top: 8px;
    right: 8px;
    bottom: auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 5px;
    background-color: rgba(255, 207, 67, 0.86);
    touch-action: manipulation;
  }

  .fullscreen-exit-text {
    display: none;
  }

  .fullscreen-exit-icon {
    display: block;
  }

  .mobile-fullscreen-button {
    display: grid;
    place-items: center;
  }

  .mobile-controls {
    display: flex;
  }
}

@media (hover: none) and (pointer: coarse) and (max-aspect-ratio: 999/1000) and (max-width: 1366px) {
  html:not(.legal-document),
  body:not(.legal-page) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body:not(.legal-page) {
    justify-content: center;
    padding: 24px;
  }

  body:not(.legal-page) h1,
  .game-container,
  .start-controls,
  .fullscreen-button {
    display: none;
  }

  .orientation-warning {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 24px 88px;
    background-image: url("img/desert.jpg");
    background-position: center;
    background-size: cover;
  }

  body:not(.legal-page) .site-footer {
    position: fixed;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    z-index: 110;
    margin-top: 0;
  }

  body:not(.legal-page) .site-footer .fullscreen-button {
    display: none;
  }

  body:not(.legal-page) .site-footer a {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    padding: 12px;
  }

  h1 {
    margin: 8px 0 16px;
    font-size: 56px;
    letter-spacing: 4px;
  }

  .game-container {
    width: min(calc(100vw - 24px), 130vh);
  }

  .start-controls {
    gap: 10px 14px;
    margin-top: 24px;
    font-size: 30px;
    letter-spacing: 1px;
  }

  .start-actions {
    margin-top: 14px;
  }

  .start-button {
    padding: 10px 20px;
    font-size: 20px;
  }

  .final-screen .start-button {
    padding: 7px 14px;
    font-size: 16px;
  }

  .how-to-play-button {
    top: 8px;
    left: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 22px;
  }

  .fullscreen-button {
    font-size: 16px;
  }

  .site-footer {
    margin-top: 8px;
  }

  .site-footer a {
    padding: 6px 14px;
    font-size: 15px;
  }

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

  .mute-button-icon {
    width: 20px;
    height: 20px;
  }

  .mobile-fullscreen-button {
    width: 32px;
    height: 32px;
  }

  .mobile-control-button {
    min-width: 54px;
    min-height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  .fullscreen-exit-button:not(.d-none) {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 42px;
    letter-spacing: 2px;
  }

  .legal-page {
    padding: 12px;
  }

  .legal-content {
    padding: 16px;
  }

  .legal-content h1 {
    margin: 16px 0;
    font-size: 44px;
    letter-spacing: 2px;
    overflow-wrap: anywhere;
  }

  .legal-content h2 {
    margin: 20px 0 8px;
    font-size: 20px;
  }

  .legal-content p,
  .back-link {
    font-size: 14px;
  }

  .game-container {
    width: calc(100vw - 24px);
  }

  .start-controls {
    flex-direction: column;
    gap: 6px;
    margin-top: 18px;
    font-size: 26px;
  }

  .how-to-play-dialog {
    padding: 18px;
  }

  .how-to-play-dialog h2 {
    font-size: 28px;
  }

  .mobile-controls {
    right: 6px;
    bottom: 6px;
    left: 6px;
  }

  .mobile-control-group {
    gap: 6px;
  }

  .mobile-fullscreen-button {
    top: 44px;
    left: 6px;
  }

  .mobile-fullscreen-button {
    width: 30px;
    height: 30px;
    padding: 4px;
  }

  .mobile-fullscreen-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-control-button,
  body.touch-layout .mobile-control-button {
    min-width: 48px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 15px;
  }

  .mobile-control-icon,
  body.touch-layout .mobile-control-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 520px) {
  .fullscreen-exit-button:not(.d-none) {
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    padding: 4px;
  }

  .fullscreen-exit-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-height: 560px) {
  .start-screen.d-none ~ .mute-button {
    top: 6px;
    bottom: auto;
  }

  .start-screen.d-none ~ .mobile-fullscreen-button {
    top: 6px;
  }

  body {
    padding: 8px;
  }

  h1 {
    margin: 0 0 8px;
    font-size: 42px;
    letter-spacing: 2px;
  }

  .game-container {
    width: min(calc(100vw - 16px), 120vh);
  }

  .start-controls {
    margin-top: 8px;
    font-size: 24px;
  }

  .start-actions {
    margin-top: 8px;
  }

  .start-button {
    padding: 8px 16px;
    font-size: 18px;
  }

  .final-screen .start-button {
    padding: 6px 12px;
    font-size: 15px;
  }

  .how-to-play-button {
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 20px;
  }

  .how-to-play-dialog {
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .how-to-play-dialog h2 {
    font-size: 26px;
  }

  .site-footer a {
    padding: 5px 12px;
    font-size: 14px;
  }

  .mute-button {
    bottom: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
  }

  .mute-button-icon {
    width: 18px;
    height: 18px;
  }

  .fullscreen-button {
    margin-top: 8px;
  }

  .mobile-fullscreen-button {
    top: 42px;
    left: 6px;
  }

  .mobile-fullscreen-button {
    width: 30px;
    height: 30px;
    padding: 4px;
  }

  .mobile-fullscreen-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-control-button,
  body.touch-layout .mobile-control-button {
    min-width: 48px;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 15px;
  }

  .mobile-control-icon,
  body.touch-layout .mobile-control-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-height: 560px) {
  .fullscreen-exit-button:not(.d-none) {
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    padding: 4px;
  }

  .fullscreen-exit-icon {
    width: 18px;
    height: 18px;
  }
}

@media (min-aspect-ratio: 1/1) and (max-height: 760px) {
  html:not(.legal-document),
  body:not(.legal-page) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body:not(.legal-page) {
    justify-content: flex-start;
    padding: 8px;
  }

  body:not(.legal-page) h1,
  .start-controls,
  .fullscreen-button {
    display: none;
  }

  .game-container {
    width: min(calc(100vw - 16px), calc(150vh - 90px));
  }

  .site-footer {
    margin-top: 6px;
  }
}

@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  html:not(.legal-document),
  body:not(.legal-page) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body:not(.legal-page) {
    justify-content: flex-start;
    padding: 4px;
  }

  body:not(.legal-page) h1,
  .start-controls,
  .fullscreen-button {
    display: none;
  }

  .game-container {
    width: min(calc(100vw - 8px), calc(150vh - 66px));
  }

  .site-footer {
    margin-top: 4px;
  }

  .site-footer a {
    padding: 4px 10px;
    font-size: 13px;
  }

  .mobile-controls {
    right: 6px;
    bottom: 6px;
    left: 6px;
  }

  .mobile-fullscreen-button {
    top: 40px;
    left: 6px;
  }

  .mobile-fullscreen-button {
    width: 28px;
    height: 28px;
    padding: 4px;
  }

  .mobile-fullscreen-icon {
    width: 16px;
    height: 16px;
  }

  .mobile-control-button {
    min-width: 46px;
    min-height: 34px;
    padding: 5px 7px;
    font-size: 14px;
  }

  .mobile-control-icon {
    width: 22px;
    height: 22px;
  }
}

@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .fullscreen-exit-button:not(.d-none) {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 4px;
  }

  .fullscreen-exit-icon {
    width: 16px;
    height: 16px;
  }
}

body.phone-immersive:not(.legal-page) {
  justify-content: flex-start;
  padding: 0;
  background: black;
}

body.phone-immersive h1,
body.phone-immersive .site-footer,
body.phone-immersive #startControls {
  display: none;
}

body.phone-immersive .game-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

body.phone-immersive canvas,
body.phone-immersive .start-screen {
  width: 100%;
  height: 100%;
}

body.phone-immersive .start-screen:not(.final-screen) {
  justify-content: flex-start;
  padding-top: max(16px, env(safe-area-inset-top));
}

body.phone-immersive .start-screen:not(.final-screen) .start-actions {
  margin-top: 0;
}

body.phone-immersive .start-screen.d-none ~ .mute-button {
  top: 8px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
}

body.phone-immersive .start-screen.d-none ~ .mobile-fullscreen-button {
  top: 8px;
  left: 48px;
}

body.phone-immersive .fullscreen-exit-button:not(.d-none) {
  top: 8px;
  right: 8px;
  bottom: auto;
}

body.phone-immersive .mobile-controls {
  right: 10px;
  bottom: 10px;
  left: 10px;
}

@supports (height: 100dvh) {
  body.phone-immersive .game-container {
    height: 100dvh;
  }

  @media (min-aspect-ratio: 1/1) and (max-height: 760px) {
    .game-container {
      width: min(calc(100vw - 16px), calc(150dvh - 90px));
    }
  }

  @media (min-aspect-ratio: 1/1) and (max-height: 560px) {
    .game-container {
      width: min(calc(100vw - 8px), calc(150dvh - 66px));
    }
  }
}
