.market-mat {
  max-width: 690px;
  margin: 14px auto;
  padding: 10px;
  border-block: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--tint);
  text-align: center;
}

.mat-tip { margin: 0 0 8px; font-size: 1rem; }
.mat-items, .mat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 13px);
}

.mat-item {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(45px, 8vw, 70px);
  height: clamp(48px, 8vw, 66px);
  padding: 3px;
  border: 1.5px solid #9b7455;
  border-radius: 14px;
  background: #fffaf0;
  font-size: clamp(25px, 4vw, 39px);
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.mat-item[aria-disabled="true"] { background: #f2f4d7; border-color: #365745; cursor: default; }
.mat-number:not(:empty) {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid #fffaf0;
  border-radius: 50%;
  background: #244c35;
  color: white;
  font: 800 15px/1 var(--body);
}

.mat-tools { margin-top: 5px; gap: 12px; font-size: .9rem; }
.mat-total { color: #37463b; font-variant-numeric: tabular-nums; }
.mat-reset {
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 800 .9rem/1.2 var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.mat-item:focus-visible, .mat-reset:focus-visible { outline: 3px solid #135890; outline-offset: 3px; }
