* {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 0; margin: 0;
  box-sizing: border-box;
  outline: none;
  border: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  width: 100dvw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(to bottom right, #faf5ff, #eff6ff);
}

.container {
  width: 42rem;
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 25px 20px -5px rgba(0, 0, 0, 0.10),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.header p {
  color: #718096;
}

.field {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.input{
  position: relative;
}

.input input {
  width: 100%;
  padding: 1rem;
  border-radius: 0.5rem;
  color: #334155;
  font-weight: 600;
  outline: none;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease-in-out;
}

.input input:focus{
  border: 2px solid #a855f7;
}

.input label {
  position: absolute;
  color: #334155;
  top: 50%;
  transform: translateY(-50%);
  left: 1rem;
  pointer-events: none;
}

.input input::placeholder {
  color: #334155;
  opacity: 0;
}

.input input:focus::placeholder{
  opacity: 1;
}

.input input:focus + label, 
.input input:not(:placeholder-shown) + label{
  top: -30%;
  transform: translateY(50%);
  left: 0.5rem;
  font-size: .75rem;
  padding: 0 .5rem;
  background-color: #a855f7;
  border-radius: .25rem;
  color: #FFF;
  transition: all .3s ease-in-out;
}

.buttons {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.buttons .btn{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem; 
  border-radius: 0.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  cursor: pointer;
}

.btn-generate {
  color: #fff;
  background-color: #805ad5;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-generate:hover {
  background-color: #6b46c1; 
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-clear{
  color: #334155;
  background-color: #e2e8f0;
}

.btn-clear:hover{
  background-color: #cbd5e1; 
}

.current-num{
  display: none;
  width: 100%;
  background: linear-gradient(to right, #a855f7, #3b82f6);
  margin-bottom: 2rem;
  padding: 2rem;
  text-align: center;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
              0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.current-num p{
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.25rem; 
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.current-num #current-num {
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1;
}

.history {
  display: none;
  width: 100%;
}

.history h2{
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 1rem;
}

.gen-history {
  width: 100%;
  background-color:#f9fafb; 
  border-radius: 0.5rem;
  padding: 1rem; 
  max-height: 16rem;
  overflow-y: auto;
  flex-wrap: wrap;
}

.num-history {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.num{
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.num:hover{
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#past-number{
  color: #2d3748;
  font-weight: 600;
}

.no-history{
  text-align: center;
  padding: 2rem 0;
}

.no-history p{
  color: #9ca3af;
}