:root {
  --juniora-h: 56px
}
* {
  box-sizing: border-box
}
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--jn-font);
  -webkit-tap-highlight-color: transparent
}
.game-stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--juniora-h);
  overflow: hidden
}
.leftSide,
.rightSide {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden
}
.leftSide {
  left: 0
}
.rightSide {
  left: 50%
}
.leftSide svg,
.rightSide svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: block
}

@media (max-width: 768px) and (orientation: portrait) {
  .leftSide,
  .rightSide {
    width: 100%;
    height: 50%
  }
  .leftSide {
    top: 0;
    left: 0
  }
  .rightSide {
    top: 50%;
    left: 0
  }
}

.mobile-controls {
  direction: ltr;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--juniora-h) + 14px);
  display: none;
  grid-template-columns: 64px 64px 64px;
  grid-template-rows: 64px 64px;
  gap: 6px;
  z-index: 90;
  user-select: none
}
.mc-btn {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0
}
.mc-btn:active {
  transform: translateY(2px)
}
.mc-up {
  grid-column: 2;
  grid-row: 1
}
.mc-left {
  grid-column: 1;
  grid-row: 2
}
.mc-down {
  grid-column: 2;
  grid-row: 2
}
.mc-right {
  grid-column: 3;
  grid-row: 2
}
@media (hover: none) and (pointer: coarse) {
  .mobile-controls {
    display: grid
  }
}

.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-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;
}
.mobile-controls {
  position: fixed;
  bottom: calc(var(--juniora-h) + 10px + var(--jn-safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-auto-rows: 50px;
  gap: 8px;
  z-index: 95;
  direction: ltr;
  left: auto;
  right: auto;
  transform: none;
}
.mobile-controls .pad-tag {
  grid-column: 1 / -1;
  font-family: var(--jn-font);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  direction: rtl;
  line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.pad-p1 { left: calc(10px + var(--jn-safe-left)); }
.pad-p2 { right: calc(10px + var(--jn-safe-right)); }
.pad-p1 .pad-tag { color: #ff2d95; }
.pad-p2 .pad-tag { color: #29b6f6; }
.mobile-controls .mc-btn {
  width: 50px;
  height: 50px;
  font-size: 17px;
  border-radius: 12px;
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .mobile-controls { display: none; }
}
.mobile-controls .pad-tag { grid-column: 1 / 4; grid-row: 1; }
.mobile-controls .mc-left  { grid-column: 1; grid-row: 2; }
.mobile-controls .mc-up    { grid-column: 2; grid-row: 2; }
.mobile-controls .mc-right { grid-column: 3; grid-row: 2; }
.mobile-controls .mc-down  { display: none; }
@media (max-width: 380px) {
  .mobile-controls { grid-template-columns: repeat(3, 44px); grid-auto-rows: 44px; gap: 6px; }
  .mobile-controls .mc-btn { width: 44px; height: 44px; }
}
.mobile-controls { bottom: calc(var(--juniora-h) + 34px + var(--jn-safe-bottom)); }
.mobile-controls .pad-tag { font-size: 10px; }
