:root {
  --juniora-h: 56px;
  --mc-reserve: 0px;
  --canvas-max: 800px;
  --background-color: #7f7fd5;
  --background-secondary-color: #91eae4;
  --canvas-color: #f0f0f0;
  --text-color: rgba(255, 255, 255, 0.87);
  --sidebar-color: #343457;
  --button-color: #86a8e7;
  --hover-color: #7db3e3
}
* {
  box-sizing: border-box
}
html,
body {
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent
}
body {
  background-color: var(--background-color);
  background: linear-gradient(
    to right,
    var(--background-color),
    var(--button-color),
    var(--background-secondary-color)
  );
  font-family: var(--jn-font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 12px calc(var(--juniora-h) + 24px);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none
}
.game-wrap {
  width: 100%;
  max-width: var(--canvas-max);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center
}
h1 {
  font-size: clamp(1.8rem, 6vw, 2.75rem);
  color: var(--text-color);
  margin: 8px 0 12px;
  text-align: center
}
canvas {
  background-color: var(--canvas-color);
  display: block;
  border-radius: 5px;
  width: min(96vw, var(--canvas-max));
  height: auto;
  max-width: 100%;
  touch-action: none
}
.btn {
  cursor: pointer;
  border: 0;
  padding: 0.625rem 1.25rem;
  background-color: var(--button-color);
  color: var(--text-color);
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem
}
.btn:focus {
  outline: 0
}
.btn:hover {
  background-color: var(--hover-color)
}
.btn:active {
  transform: scale(0.98)
}
.rules-btn {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 50
}
.rules {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  background-color: var(--sidebar-color);
  color: var(--text-color);
  min-height: 100vh;
  min-height: 100dvh;
  width: min(400px, 90vw);
  padding: 2rem;
  line-height: 1.5;
  transform: translateX(110%);
  transition: transform 0.6s ease-in-out;
  z-index: 200;
  overflow-y: auto
}
.rules.show {
  transform: translateX(0)
}

html[dir="ltr"] .rules {
  transform: translateX(-110%)
}

.mobile-controls {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--juniora-h) + 14px);
  display: none;
  grid-template-columns: 80px 80px;
  grid-template-rows: 64px;
  gap: 16px;
  z-index: 90;
  user-select: none;
  direction: ltr
}
.mc-btn {
  background: rgba(52, 52, 87, 0.85);
  color: #f9f6f2;
  border: none;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  height: 64px
}
.mc-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25)
}
.mc-left {
  grid-column: 1;
  grid-row: 1
}
.mc-right {
  grid-column: 2;
  grid-row: 1
}
@media (max-width: 720px),
(hover: none) and (pointer: coarse) {
  .mobile-controls {
    display: grid
  }

  :root {
    --mc-reserve: 110px
  }
  body {
    padding-bottom: calc(var(--juniora-h) + var(--mc-reserve))
  }
}

@media (max-height: 520px) {
  :root {
    --mc-reserve: 0px
  }
  body {
    padding-bottom: calc(var(--juniora-h) + 8px);
    padding-top: 6px
  }
  h1 {
    font-size: 1.25rem;
    margin: 2px 0 6px
  }
  .mobile-controls {
    left: 12px;
    transform: none;
    bottom: calc(var(--juniora-h) + 6px);
    grid-template-columns: 66px 66px;
    grid-template-rows: 52px;
    gap: 10px
  }
  .mc-btn {
    height: 52px
  }
}

.juniora-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--juniora-h);
  background: #292929;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 0 16px
}
.juniora-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--jn-font);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.9
}
.juniora-logo {
  width: 28px;
  height: auto;
  display: block
}
.juniora-text {
  letter-spacing: normal
}
@media (max-width: 480px) {
  :root {
    --juniora-h: 52px
  }
  .juniora-link {
    font-size: 12.5px
  }
  body {
    padding: 12px 10px calc(var(--juniora-h) + 100px)
  }
  .rules-btn {
    top: 0.5rem;
    inset-inline-start: 0.5rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem
  }
}

.juniora-overlay {
  height: var(--juniora-h)
}
.juniora-link {
  font-family: var(--jn-font);
  font-size: clamp(12px, 3.4vw, 15px);
  font-weight: 700;
  line-height: 1.9;
  letter-spacing: normal;
  gap: 8px;
  white-space: nowrap
}
.juniora-logo {
  width: 22px;
  height: auto
}
.juniora-text {
  letter-spacing: normal
}
@media (max-height: 520px) {
  .juniora-link {
    font-size: 12px
  }
  .juniora-logo {
    width: 18px
  }
}

.mc-btn, .jump-btn, #jumpBtn, #controls button, .mc-fire {
  font-family: var(--jn-font);
  font-weight: 700;
}
