* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #a8e063, #56ab2f);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

.app {
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 20px;
  width: 95%;
  max-width: 380px;
  text-align: center;
  color: white;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.display input {
  width: 100%;
  padding: 15px;
  font-size: 1.8rem;
  border: 2px solid #fff;
  border-radius: 10px;
  text-align: right;
  background: white;
  color: #222;
  outline: none;
}

.display input::placeholder {
  text-align: center;
}

.display input:focus {
  text-align: right;
}

.selectors {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  width: 100%;
  align-items: flex-end;
}

.field {
  flex: 1;
  min-width: 0;
}

.swap-field {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid white;
  background: white;
  color: #222;
}

.convert-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #ffffff;
  color: #333;
  font-weight: bold;
  cursor: pointer;
}

.swap-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 1.2rem;
  align-self: center;
}

#result {
  display: none;
  margin-top: 15px;
  padding: 12px;
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.highlight {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.keypad {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.keypad button {
  padding: 15px;
  font-size: 1.2rem;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
}

.keypad button:active {
  background: rgba(255,255,255,0.4);
}

@media (max-width: 500px) {

  body {
    display: block;
    padding: 0;
  }

  .app {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .selectors {
    flex-direction: column;
    gap: 15px;
  }

  .swap-btn {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }

  .display input {
    font-size: 2.2rem;
    padding: 20px;
  }

  select {
    padding: 14px;
    font-size: 1rem;
  }

  .keypad {
    flex: 1;
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
  }

  .keypad button {
    height: 100%;
    min-height: 65px;
    font-size: 1.4rem;
  }

  #result {
    font-size: 1.4rem;
    padding: 15px;
  }

  input, select {
    font-size: 16px;
  }
}