:root {
  --juniora-h: 56px
}
* {
  box-sizing: border-box
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--jn-font);
  font-size: 14px;
  color: white;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent
}
body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  inset: 0
}
#game {
  display: block;
  position: absolute;
  top: 0;
  left: 0
}
button {
  cursor: pointer;
  border: none;
  color: white;
  background: transparent;
  font-family: inherit;
  padding: 10px;
  font-size: 1em;
  touch-action: manipulation
}
button:hover {
  background-color: rgba(255, 255, 255, 0.1)
}
#info-left,
#info-right {
  position: absolute;
  top: 12px;
  z-index: 5;
  line-height: 1.2
}
#info-left h3,
#info-right h3 {
  margin: 0 0 4px;
  font-size: 15px
}
#info-left p,
#info-right p {
  margin: 2px 0;
  font-size: 12px
}

#info-left {
  left: 14px;
  text-align: left;
  direction: rtl
}
#info-right {
  right: 14px;
  text-align: right;
  direction: rtl
}
#bomb-grab-area {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: transparent;
  cursor: grab;
  touch-action: none;
  z-index: 4
}
#instructions,
#congratulations {
  position: absolute;
  transition: visibility 0s,opacity 0.5s linear;
  z-index: 10
}
#instructions {
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: min(92vw, 480px);
  padding: 0 10px
}
#instructions h3 {
  margin: 4px 0;
  font-size: 14px;
  opacity: 0.9
}
#instructions h1 {
  margin: 4px 0;
  font-size: clamp(18px, 4vw, 28px)
}
#congratulations {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.9);
  color: black;
  padding: 30px 40px;
  opacity: 0;
  visibility: hidden;
  max-width: 90vw;
  width: max-content;
  text-align: center;
  backdrop-filter: blur(5px);
  border-radius: 8px
}
#congratulations h1 {
  margin: 0 0 16px;
  font-size: clamp(22px, 5vw, 32px)
}
#congratulations button {
  border: 1px solid rgba(0, 0, 0, 0.9);
  color: inherit
}
#settings {
  position: absolute;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  right: 50%;
  transform: translateX(50%);
  z-index: 5
}
#settings,
#info-left,
#info-right {
  opacity: 1
}

.dropdown {
  position: relative;
  display: inline-block
}
.dropbtn:after {
  content: "\25BC";
  margin-left: 6px;
  font-size: 0.8em;
  vertical-align: text-top
}
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f9f9f9;
  min-width: 130px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 20
}
.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  font-size: 0.9em
}
.dropdown-content a:hover,
.dropdown-content a:active {
  background-color: #f1f1f1
}
.dropdown:hover .dropdown-content,
.dropdown.open .dropdown-content {
  display: block
}
#windmill {
  position: absolute;
  right: 0;
  bottom: var(--juniora-h);
  fill: rgba(255, 255, 255, 0.5);
  transform-origin: bottom;
  pointer-events: none;
  z-index: 1
}
#windmill-head {
  animation-name: rotate;
  animation-duration: 4s;
  animation-iteration-count: infinite;
  animation-timing-function: linear
}
@keyframes rotate {
  from {
    transform: rotate(0deg)
  }
  to {
    transform: rotate(360deg)
  }
}
#wind-info {
  position: absolute;
  width: 100px;
  text-align: center;
  margin-bottom: 30px;
  z-index: 2;
  font-size: 12px
}

#aim-controls {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--juniora-h) + 8px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 10px;
  z-index: 50;
  max-width: calc(100vw - 16px);
  flex-wrap: wrap;
  justify-content: center
}
#aim-controls .aim-row {
  display: flex;
  align-items: center;
  gap: 6px
}
#aim-controls label {
  font-size: 13px;
  min-width: 46px
}

@media (max-width: 600px) {
  #aim-controls {
    inset-inline: 8px;
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
    gap: 8px;
    padding: 10px
  }
  #aim-controls .aim-row {
    width: 100%
  }
  #aim-controls input[type="range"] {
    flex: 1;
    width: auto;
    height: 28px
  }
  #aim-controls #launch-btn {
    width: 100%;
    min-height: 48px
  }
}
#aim-controls input[type="range"] {
  width: 130px;
  accent-color: #A0E747;
  touch-action: manipulation
}
#aim-controls input[type="number"] {
  width: 56px;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: inherit;
  -moz-appearance: textfield
}
#aim-controls input[type="number"]::-webkit-outer-spin-button,
#aim-controls input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0
}
#aim-controls .unit {
  font-size: 12px;
  opacity: 0.8
}
#aim-controls #launch-btn {
  background: #A0E747;
  color: #1a1a1a;
  padding: 8px 18px;
  font-weight: bold;
  border-radius: 6px;
  font-size: 14px
}
#aim-controls #launch-btn:hover {
  background: #b3f060
}
#aim-controls #launch-btn:disabled {
  background: #5a6a45;
  color: rgba(255,255,255,0.5);
  cursor: not-allowed
}
#fullscreen {
  all: unset;
  cursor: pointer;
  position: absolute;
  right: 10px;
  bottom: calc(var(--juniora-h) + 10px);
  z-index: 60;
  padding: 4px
}

.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: 640px) {
  #info-left h3,
  #info-right h3 {
    font-size: 13px
  }
  #info-left p,
  #info-right p {
    font-size: 11px
  }
  #settings {
    gap: 4px
  }
  #settings button,
  #settings .dropbtn {
    padding: 6px 8px;
    font-size: 12px
  }
  #aim-controls {
    gap: 6px;
    padding: 6px 8px
  }
  #aim-controls label {
    min-width: 44px;
    font-size: 11px
  }
  #aim-controls input[type="range"] {
    width: 100px
  }
  #aim-controls input[type="number"] {
    width: 50px;
    font-size: 12px
  }
  #aim-controls #launch-btn {
    padding: 6px 14px;
    font-size: 13px
  }
  #windmill {
    transform: scale(0.7);
    transform-origin: bottom right
  }
}
@media (max-width: 480px) {
  :root {
    --juniora-h: 52px
  }
  .juniora-link {
    font-size: 12.5px
  }
  #aim-controls input[type="range"] {
    width: 80px
  }
  #aim-controls .aim-row {
    gap: 4px
  }
  #instructions h1 {
    font-size: 16px
  }
  #instructions h3 {
    font-size: 12px
  }
}
@media (max-height: 520px) {
  #instructions {
    top: 56px
  }
  #instructions h1 {
    font-size: 14px;
    margin: 2px 0
  }
}

.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;
}
@media (max-width: 600px) {
  #fullscreen {
    top: auto;
    bottom: auto;
    inset-block-start: calc(8px + var(--jn-safe-top));
    inset-inline-start: 8px;
    z-index: 60;
  }
  #instructions h1 { font-size: clamp(14px, 3.8vw, 18px); }
  #instructions h3 { font-size: 12px; }
}
@media (max-width: 700px) {
  #info-left, #info-right { top: 6px; line-height: 1.35; }
  #info-left h3, #info-right h3 { font-size: 12px; margin: 0 0 2px; }
  #info-left p, #info-right p { font-size: 10px; margin: 1px 0; }
  #info-left { left: 8px; }
  #info-right { right: 8px; }
  #settings {
    top: auto;
    bottom: auto;
    inset-block-start: 62px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 40;
  }
  #settings .dropbtn, #settings #color-mode {
    font-size: 11px;
    padding: 5px 9px;
    min-height: 30px;
  }
  #instructions { top: 104px; }
  #instructions h3 { font-size: 11px; margin: 2px 0; }
  #instructions h1 { font-size: 14px; margin: 2px 0; line-height: 1.7; }
  #wind-info { font-size: 11px; }
}
@media (max-width: 700px) {
  #settings {
    inset-block-start: calc(6px + var(--jn-safe-top));
    inset-inline: 0;
    left: 0;
    right: 0;
    transform: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 0 6px;
  }
  #settings .dropbtn,
  #settings #color-mode {
    font-size: 11px;
    line-height: 1.2;
    padding: 6px 10px;
    min-height: 32px;
    white-space: nowrap;
  }
  #info-left,
  #info-right {
    top: calc(46px + var(--jn-safe-top));
  }
  #instructions {
    top: calc(112px + var(--jn-safe-top));
    inset-inline: 8px;
    left: 8px;
    right: 8px;
  }
  #wind-info { margin-bottom: 12px; }
}
@media (max-width: 700px) and (max-height: 560px) {
  #info-left, #info-right { top: calc(42px + var(--jn-safe-top)); }
  #instructions { display: none; }
}
@media (max-width: 700px) {
  #instructions {
    transform: none;
    width: auto;
    max-width: none;
    padding: 0 8px;
    white-space: normal;
  }
  #fullscreen {
    top: auto;
    inset-block-start: auto;
    inset-inline-start: auto;
    left: 10px;
    right: auto;
    bottom: calc(var(--juniora-h) + 150px);
    z-index: 45;
    opacity: 0.75;
  }
  #fullscreen svg { width: 22px; height: 22px; }
}
#aim-controls input[type="range"],
#aim-controls input[type="number"] {
  direction: ltr;
}
.dropdown-content {
  z-index: 300;
}
#instructions {
  z-index: 5;
}
.jn-turn {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 20, 32, 0.96);
  color: #fff;
  font-family: var(--jn-font);
  text-align: center;
  direction: rtl;
}
.jn-turn strong { display: block; font-size: 20px; color: var(--jn-green); margin-bottom: 8px; }
.jn-turn p { margin: 0 0 18px; font-size: 14px; line-height: 2; color: #cfe0d6; }
.jn-turn button {
  font-family: var(--jn-font);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--jn-green);
  color: #10231f;
  cursor: pointer;
}
