@font-face {
  font-family: 'Roboto Mono';
  src: url('Roboto_Mono.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 700;
}

* {
  font-family: 'Roboto Mono', monospace;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #191919;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

.title,
.text {
  display: block;
  text-align: center;
  width: 90%;
  font-size: 1.1rem;
}

.title {
  color: #4095bf;
}

.text {
  color: #dddddd;
}

.icon {
  width: 32px;
  height: 32px;
}

.translator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 90%;
}

.textarea-container {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.6rem;
  align-items: start;
  flex: 1;
  width: 100%;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #dddddd;
  font-size: 0.9rem;
  width: 100%;
  justify-content: space-between;
}

.controls-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.control-box {
  border: 2px solid #dddddd;
  color: #dddddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1 1 0;
  background: #151515;
  padding: 0.45rem 0.6rem;
  min-height: 2.6rem;
}

.counter {
  justify-content: flex-end;
  min-width: 6rem;
  text-align: right;
}

.controls input,
.controls label {
  align-self: center;
}

.control-box > * {
  display: flex;
  align-items: center;
  height: auto;
}

.control-box label {
  line-height: 1;
}

input[type="range"] {
  height: 14px;
  margin: 0 0 0 0.5rem;
}

input[type="checkbox"] {
  transform: none;
  margin-right: 0.5rem;
}

.counter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

label[for], .control-box label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  vertical-align: middle;
}

input[type="range"] {
  -moz-appearance: none;
  appearance: none;
  height: 10px;
  margin: 0 0 0 0.5rem;
}

.counter span {
  display: inline-block;
  line-height: 1;
}

.counter-content {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
}

.counter-label {
  margin-left: 0.5rem;
}

.count-warning { color: #bf9540; }
.count-danger { color: #bf4040; }

.control-box label,
.counter-content {
  line-height: 1.2rem;
}

.control-box input[type="checkbox"], .control-box input[type="range"], .control-box label, .counter-content {
  margin: 0;
  padding: 0;
}

.control-box {
  min-height: 2.8rem;
}

.control-box label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .control-box label { white-space: normal; }
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: auto;
  height: 6px;
  background: #333;
  border-radius: 4px;
}

.control-box input[type="range"] {
  flex: 1 1 0;
  width: auto;
  min-width: 6rem;
  max-width: 100%;
  margin-left: 0.5rem;
}

.control-box label {
  flex: 0 0 auto;
  margin-right: 0.5rem;
}

@media (max-width: 420px) {
  .control-box input[type="range"] { min-width: 4.2rem; }
}

.range-wrap {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}
.range-wrap input[type="range"] {
  width: 100%;
  margin-left: 0.5rem;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #4095bf;
  border-radius: 50%;
  cursor: pointer;
}

textarea {
  flex: 1;
  width: 100%;
  min-height: 200px;
  padding: 12px;
  font-size: 1rem;
  background: #151515;
  color: #dddddd;
  border: 2px solid #dddddd;
  resize: none;
  transition: border-color 0.25s ease;
}

textarea:focus {
  outline: none;
  border-color: #4095bf;
}

.copy-btn {
  margin: 0;
  width: 100%;
  height: 2.5rem;
  font-size: 1rem;
  background-color: #151515;
  color: #dddddd;
  border: 2px solid #dddddd;
  cursor: pointer;
  transition: border-color 0.25s ease;
}

.copy-btn:hover {
  border-color: #4095bf;
}

.link-btn {
  margin-top: 0.5rem;
  width: 10rem;
  height: 2.5rem;
  font-size: 1rem;
  background-color: #151515;
  color: #dddddd;
  border: 2px solid #dddddd;
  cursor: pointer;
  transition: border-color 0.25s ease;
}

.link-btn:hover {
  border-color: #4095bf;
}

a {
  color: #666666;
  transition: color 0.25s ease;
}

a:hover {
  color: #4095bf;
}

footer {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  color: #666666;
  font-size: 0.8rem;
}

@media (max-width: 1000px) {
  .translator {
    flex-direction: column;
    align-items: center;
  }
  .textarea-container {
    grid-template-rows: auto auto auto;
    width: 100%;
  }
}

@media (max-height: 880px) {
  footer {
    position: static;
    transform: none;
    margin-top: 0.5rem;
  }
}