:root {
  --accent: #d79d18;
  --accent-dark: #75570f;
  --wash: #f1d98b;
}

.number-stage {
  width: min(100%, 560px);
}

.number-card {
  position: relative;
  display: grid;
  overflow: hidden;
  width: 100%;
  min-height: min(48vh, 390px);
  min-height: min(48dvh, 390px);
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.28)),
    var(--wash);
  box-shadow: var(--shadow);
  place-items: center;
  transition: background 300ms ease, border-color 300ms ease;
}

.number-card::before,
.number-card::after {
  position: absolute;
  border: 2px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 50%;
  content: "";
}

.number-card::before {
  top: -52px;
  right: -30px;
  width: 130px;
  height: 130px;
}

.number-card::after {
  bottom: -45px;
  left: -35px;
  width: 106px;
  height: 106px;
}

.number {
  z-index: 1;
  display: block;
  font-family: "Nunito", sans-serif;
  font-size: clamp(9rem, 43vw, 16.5rem);
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.78;
  transform-origin: center;
}

.number.is-changing {
  animation: number-pop 260ms cubic-bezier(0.2, 0.85, 0.35, 1.2);
}

.number-actions {
  display: grid;
  margin-top: 14px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.number-actions button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 19px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.number-actions button:hover {
  transform: translateY(-2px);
}

.number-actions button:active {
  transform: scale(0.98);
}

.hear-button {
  border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--surface);
  color: var(--accent-dark);
}

.hear-button span:first-child {
  font-size: 1.25rem;
}

.hear-button.is-playing {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--wash) 42%, white);
}

.next-button {
  border: 2px solid var(--accent-dark);
  background: var(--accent-dark);
  color: white;
}

@keyframes number-pop {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@media (min-width: 700px) {
  .number-card {
    min-height: min(52vh, 500px);
    min-height: min(52dvh, 500px);
    border-radius: 42px;
  }

  .number-actions {
    gap: 14px;
    margin-top: 18px;
  }

  .number-actions button {
    min-height: 66px;
    border-radius: 22px;
    font-size: 0.92rem;
  }
}

@media (max-width: 699px) {
  .number-stage {
    min-height: 0;
  }

  .number-card {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0 !important;
    padding: 14px;
  }

  .number {
    font-size: clamp(6.5rem, min(42vw, 34dvh), 13rem);
  }

  .number-actions {
    flex: 0 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
  }

  .number-actions button {
    min-height: 52px;
    padding: 10px 8px;
  }
}

@media (max-height: 650px) {
  .number-card {
    min-height: 260px;
  }

  .number {
    font-size: clamp(7.5rem, 34vh, 12rem);
  }
}
