* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a0a12;
  color: #cfe6ff;
  font-family: "Courier New", monospace;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

#screen-wrap {
  border: 4px solid #26263a;
  border-radius: 10px;
  background: #000;
  padding: 6px;
  box-shadow: 0 0 0 2px #0e0e18, 0 8px 30px rgba(0, 0, 0, .7);
}

#screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: min(78vw, 390px, 78vh);
  height: min(78vw, 390px, 78vh);
  background: #000;
}

#softkeys {
  display: flex;
  gap: 8px;
}

#softkeys .soft {
  min-width: 162px;
  padding: 8px 14px;
  background: #1b1b2c;
  color: #9fd0ff;
  border: 1px solid #343452;
  border-radius: 6px;
  font: bold 13px "Courier New", monospace;
  cursor: pointer;
}

#keypad {
  display: grid;
  grid-template-columns: repeat(3, 107px);
  gap: 6px;
  justify-content: center;
}

#keypad .k {
  height: 50px;
  background: #17172a;
  color: #b9d8ff;
  border: 1px solid #2e2e4a;
  border-radius: 7px;
  font: bold 14px "Courier New", monospace;
  cursor: pointer;
}

#keypad .k.center {
  background: #22304e;
  border-color: #3d5a8a;
}

#keypad .k:active,
#softkeys .soft:active,
#keypad .k.on,
#softkeys .soft.on {
  background: #2c4374;
}

#hint {
  max-width: 380px;
  font-size: 11px;
  color: #6d7fa3;
  text-align: center;
  margin: 0;
}

@media (pointer: fine) {
  #keypad {
    opacity: .55;
  }
}