:root {
  --fundo-1: #fdf4ff;
  --fundo-2: #d825f4;
  --corpo: #16121c;
  --tecla: #262030;
  --tecla-hover: #332a40;
  --funcao: #3d3350;
  --operador: #b81fd0;
  --operador-hover: #cf35e8;
  --texto: #f7f2fb;
  --texto-suave: #b9adc7;
  --sombra: 0 24px 60px rgba(70, 10, 90, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--fundo-1), var(--fundo-2));
  color: var(--texto);
}

.pagina {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
}

.calculadora {
  width: 100%;
  max-width: 340px;
  padding: 20px;
  border-radius: 28px;
  background: var(--corpo);
  box-shadow: var(--sombra);
}

.cabecalho h1 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--texto-suave);
  margin-bottom: 12px;
}

.tela {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  min-height: 112px;
  padding: 16px 12px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  text-align: right;
}

.tela__expressao {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
}

.tela__resultado {
  min-height: 1.5rem;
  font-size: 1.125rem;
  color: var(--texto-suave);
}

.teclado {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tecla {
  aspect-ratio: 1;
  border: none;
  border-radius: 18px;
  background: var(--tecla);
  color: var(--texto);
  font: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.08s;
}

.tecla:hover {
  background: var(--tecla-hover);
}

.tecla:active {
  transform: scale(0.95);
}

.tecla:focus-visible {
  outline: 3px solid var(--operador-hover);
  outline-offset: 2px;
}

.tecla--funcao {
  background: var(--funcao);
}

.tecla--operador,
.tecla--igual {
  background: var(--operador);
}

.tecla--operador:hover,
.tecla--igual:hover {
  background: var(--operador-hover);
}

.tecla--igual {
  grid-row: span 2;
  aspect-ratio: auto;
}

.tecla--zero {
  grid-column: span 2;
  aspect-ratio: auto;
}

.dica {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--texto-suave);
  text-align: center;
}

.rodape {
  font-size: 0.875rem;
  color: var(--corpo);
}

.rodape a {
  color: inherit;
  font-weight: 600;
}
