* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #2a1838, #0b0710 70%);
  color: #fff;
  overflow: hidden;
  font-family: Impact, Haettenschweiler, "Arial Black", "Arial Narrow Bold", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#screen {
  position: relative;
  line-height: 0;
}

#game {
  display: block;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(124, 179, 66, 0.35), 0 0 0 3px #1d1326;
  cursor: crosshair;
  touch-action: none;
}

/* ---------- the text bar ---------- */
#textbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 320px;
  padding: 0 2px;
}

#textbar label { font-size: 26px; }

#textinput {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 20px;
  letter-spacing: 1px;
  padding: 8px 12px;
  color: #fff;
  background: #1a1222;
  border: 3px solid #7cb342;
  border-radius: 10px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

#textinput:focus {
  border-color: #ffd54f;
  box-shadow: 0 0 14px rgba(255, 213, 79, 0.6);
}

#textinput::placeholder { color: #8a7f96; }

#textbar button {
  font: inherit;
  font-size: 18px;
  padding: 8px 12px;
  color: #111;
  background: #ffd54f;
  border: 3px solid #111;
  border-radius: 10px;
  cursor: pointer;
}

#textbar button:hover { background: #ffe082; }
#textbar button.off { background: #555; color: #999; }
#textbar button:active { transform: translateY(2px); }

/* ---------- touch buttons ---------- */
/* --btn (the button size) is set by Game.resize() so the buttons always fit the screen */
#touch {
  --btn: 64px;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#touch .pad {
  position: absolute;
  bottom: 10px;
  display: flex;
  gap: calc(var(--btn) * 0.16);
  align-items: flex-end;
}

#touch .left { left: 10px; }
#touch .right { right: 10px; }

#touch button {
  pointer-events: auto;
  touch-action: none;
  width: var(--btn);
  height: var(--btn);
  padding: 0;
  font-size: calc(var(--btn) * 0.4);
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

#touch button.big {
  width: calc(var(--btn) * 1.3);
  height: calc(var(--btn) * 1.3);
  font-size: calc(var(--btn) * 0.53);
}

#touch button.on {
  background: rgba(255, 213, 79, 0.6);
}

/* phone held upright: the buttons sit underneath the game instead of on top of it */
#touch.below {
  position: static;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
}

#touch.below .pad { position: static; }

#touch.below .right {
  display: grid;
  align-items: center;
  justify-items: center;
}

#touch.below [data-code="TouchUp"] { grid-area: 1 / 1; }
#touch.below [data-code="TouchDown"] { grid-area: 2 / 1; }
#touch.below [data-code="TouchSpecial"] { grid-area: 1 / 2; }
#touch.below [data-code="TouchAttack"] { grid-area: 2 / 2; }

#touch[hidden] { display: none; }
