:root {
  --red: #E00024;
  --yellow: #ffdf00;
  --black: #000000;
  --white: #ffffff;
  --neutral: #f2f2f2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--red);
  color: var(--black);
  font-family: "Montserrat", Arial, sans-serif;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow-x: hidden;
}

button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

.dialer {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
}

.display {
  min-height: 112px;
  border: 4px solid var(--black);
  background: var(--white);
  box-shadow: 8px 8px 0 var(--black);
  padding: 18px 64px 18px 18px;
  display: flex;
  align-items: center;
  position: relative;
}

.number {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(1.8rem, 9vw, 2.7rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.055em;
}

.backspace {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 2px solid var(--black);
  background: var(--yellow);
  color: var(--black);
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--black);
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.key {
  min-height: 76px;
  border: 4px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  box-shadow: 5px 5px 0 var(--black);
  display: grid;
  place-content: center;
  gap: 1px;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease, background-color 90ms ease;
}

.key span {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
}

.key small {
  min-height: 11px;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .18em;
}

.key:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--black);
  background: var(--yellow);
}

.call {
  width: 82px;
  height: 68px;
  justify-self: center;
  border: 4px solid var(--black);
  border-radius: 0;
  background: var(--yellow);
  color: var(--black);
  box-shadow: 6px 6px 0 var(--black);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease, opacity 90ms ease;
}

.call svg { width: 30px; fill: currentColor; }
.call:disabled { opacity: .38; cursor: default; }
.call:not(:disabled):active { transform: translate(5px, 5px); box-shadow: 1px 1px 0 var(--black); }

.result {
  border: 4px solid var(--black);
  background: var(--yellow);
  box-shadow: 8px 8px 0 var(--black);
  padding: 20px;
}

.result-status {
  margin: 0;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.result-text {
  margin: 12px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 7vw, 2.3rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

.result-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-button {
  min-height: 48px;
  border: 3px solid var(--black);
  border-radius: 0;
  background: var(--red);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--black);
  display: grid;
  place-items: center;
  padding: 10px 14px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .12em;
  cursor: pointer;
}

.result-button-secondary { background: var(--white); color: var(--black); }
.result-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--black); }

button:focus-visible, a:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.result button:focus-visible, .result a:focus-visible {
  outline-color: var(--red);
}

@media (max-width: 370px) {
  body { padding-inline: 12px; }
  .dialer { gap: 14px; }
  .display { min-height: 92px; padding-block: 14px; }
  .pad { gap: 9px; }
  .key { min-height: 68px; box-shadow: 4px 4px 0 var(--black); }
  .key span { font-size: 1.6rem; }
  .call { height: 60px; width: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
