html,
body {
  margin: 0;
  padding: 0;

  width: 100%;
  height: 100%;

  background: #08140d;

  overflow: hidden;

  font-family: Arial, sans-serif;

  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* =========================================
   MAIN PAGE
========================================= */

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-wrapper {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;
}

h1 {
  margin: 6px 0;

  color: white;

  font-size: 24px;

  text-align: center;
}

/* =========================================
   GAME CONTAINER
========================================= */

#game-container {
  position: relative;

  width: min(100vw, 1600px);

  aspect-ratio: 16 / 9;

  max-height: calc(100vh - 45px);

  display: flex;

  justify-content: center;
  align-items: center;
}

/* =========================================
   CANVAS
========================================= */

#gameCanvas {
  display: block;

  width: 100%;
  height: 100%;

  background: #2d8a45;

  border: 3px solid #8cff9b;

  border-radius: 12px;

  box-sizing: border-box;

  touch-action: none;
}

/* =========================================
   MOBILE CONTROLS
========================================= */

#mobile-controls {
  position: absolute;

  left: 0;
  right: 0;

  bottom: 18px;

  width: 100%;

  box-sizing: border-box;

  padding-left: 22px;
  padding-right: 22px;

  display: flex;

  justify-content: space-between;
  align-items: flex-end;

  pointer-events: none;
}

/* =========================================
   CONTROL GROUPS
========================================= */

.control-group {
  display: flex;

  align-items: center;

  gap: 12px;

  pointer-events: auto;
}

/* =========================================
   GENERAL BUTTON
========================================= */

.game-button {
  border: 3px solid rgba(255, 255, 255, 0.85);

  background: rgba(5, 20, 10, 0.72);

  color: white;

  font-weight: bold;

  text-align: center;

  cursor: pointer;

  touch-action: none;

  user-select: none;
  -webkit-user-select: none;

  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35);

  transition:
    transform 0.05s ease,
    background 0.05s ease;
}

/* =========================================
   BUTTON PRESS EFFECT
========================================= */

.game-button:active,
.game-button.active {
  transform: scale(0.92);

  background: rgba(50, 230, 105, 0.85);
}

/* =========================================
   LEFT / RIGHT BUTTONS
========================================= */

.movement-button {
  width: 88px;
  height: 88px;

  border-radius: 50%;

  font-size: 34px;
}

/* =========================================
   ACTION BUTTONS
========================================= */

.action-button {
  width: 90px;
  height: 70px;

  border-radius: 18px;

  font-size: 17px;
}

/* JUMP slightly larger */

.jump-button {
  height: 82px;
}

/* LOW */

.low-button {
  border-color: #8cff9b;
}

/* HIGH */

.high-button {
  border-color: #ffd75e;
}

/* =========================================
   DESKTOP
========================================= */

@media (hover: hover) and (pointer: fine) {

  /*
    Hide touch controls when using
    normal desktop mouse/keyboard.
  */

  #mobile-controls {
    display: none;
  }
}

/* =========================================
   MOBILE / TELEGRAM
========================================= */

@media (hover: none), (pointer: coarse) {

  h1 {
    font-size: 18px;

    margin: 3px 0;
  }

  #game-container {
    width: 100vw;

    max-height: calc(100vh - 28px);
  }

  #mobile-controls {
    bottom: 14px;

    padding-left: 14px;
    padding-right: 14px;
  }

  .control-group {
    gap: 8px;
  }

  .movement-button {
    width: 72px;
    height: 72px;

    font-size: 28px;
  }

  .action-button {
    width: 70px;
    height: 60px;

    font-size: 14px;

    border-radius: 15px;
  }

  .jump-button {
    height: 70px;
  }
}

/* =========================================
   VERY SMALL MOBILE SCREENS
========================================= */

@media (max-width: 700px) {

  #mobile-controls {
    bottom: 8px;

    padding-left: 8px;
    padding-right: 8px;
  }

  .control-group {
    gap: 5px;
  }

  .movement-button {
    width: 58px;
    height: 58px;

    font-size: 23px;
  }

  .action-button {
    width: 58px;
    height: 50px;

    font-size: 11px;

    border-width: 2px;
  }

  .jump-button {
    height: 58px;
  }
}