.recent-activity {
  position: relative;
  z-index: 4;
  max-width: 1180px;
  margin: -46px auto 84px;
  padding: 0 24px;
}

.recent-activity__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 27px 30px 25px;
  border: 1px solid #3972aa;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(circle at 88% 12%, rgb(255 115 134 / 18%), transparent 30%),
    linear-gradient(135deg, #123f72, #071a34 70%);
  box-shadow: 0 24px 65px rgb(0 0 0 / 24%);
}

.recent-activity__heading h2 {
  max-width: 810px;
  margin: 5px 0 8px;
  color: #fff;
  font-size: clamp(28px, 3.6vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.recent-activity__heading > div > p:last-child {
  max-width: 720px;
  margin: 0;
  color: #c7d8eb;
  font-size: 14px;
}

.recent-activity__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #ff9bab;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.recent-activity__eyebrow span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ff7386;
  box-shadow: 0 0 0 6px rgb(255 115 134 / 14%);
}

.recent-activity__pause {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 17px;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.recent-activity__pause:hover {
  border-color: #ff9bab;
  background: rgb(255 115 134 / 13%);
}

.recent-activity__pause[aria-pressed="true"] {
  border-color: #ff9bab;
  background: #7c2034;
}

.recent-activity__shell {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 132px;
  padding: 22px 28px;
  overflow: hidden;
  border: 1px solid rgb(11 35 68 / 16%);
  border-top: 0;
  border-radius: 0 0 26px 26px;
  background: #fff;
  box-shadow: 0 25px 65px rgb(4 19 38 / 18%);
}

.recent-activity__flag {
  display: grid;
  width: 88px;
  height: 66px;
  overflow: hidden;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 16px;
  background: #e7f0fb;
  box-shadow: 0 0 0 1px rgb(11 35 68 / 15%), 0 12px 24px rgb(11 35 68 / 17%);
}

.recent-activity__flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-activity__flag img[hidden],
.recent-activity__flag span[hidden] {
  display: none;
}

.recent-activity__flag span {
  font-size: 36px;
}

.recent-activity__viewport {
  min-width: 0;
  perspective: 900px;
}

.recent-activity__card {
  min-width: 0;
  transform-origin: center;
  backface-visibility: hidden;
}

.recent-activity__card.is-leaving {
  animation: recent-activity-out 240ms ease-in forwards;
}

.recent-activity__card.is-entering {
  animation: recent-activity-in 360ms cubic-bezier(.2, .7, .2, 1) forwards;
}

.recent-activity__kicker {
  display: block;
  margin-bottom: 3px;
  color: #d31633;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.recent-activity__name {
  display: -webkit-box;
  overflow: hidden;
  color: #0b2344;
  font-size: clamp(24px, 3vw, 39px);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 1.06;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recent-activity__meta {
  display: block;
  margin-top: 6px;
  color: #617087;
  font-size: 13px;
  font-weight: 650;
}

.recent-activity__status {
  justify-self: end;
  padding: 8px 12px;
  border: 1px solid #f2bdc5;
  border-radius: 999px;
  background: #fff1f3;
  color: #8b1e2d;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.recent-activity[data-event="lucky_draw"] .recent-activity__status {
  border-color: #b8d7f4;
  background: #eaf5ff;
  color: #174879;
}

.recent-activity[data-event="country_first"] .recent-activity__status,
.recent-activity[data-event="notable_number"] .recent-activity__status {
  border-color: #ead08b;
  background: #fff8df;
  color: #725000;
}

.recent-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 13px;
}

.recent-stats__item {
  position: relative;
  min-width: 0;
  min-height: 118px;
  padding: 19px 20px;
  overflow: hidden;
  border: 1px solid #315d8e;
  border-radius: 19px;
  background: linear-gradient(145deg, #123f72, #0b2344);
  box-shadow: 0 13px 28px rgb(4 19 38 / 18%);
}

.recent-stats__item::after {
  position: absolute;
  right: -24px;
  bottom: -42px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgb(255 115 134 / 9%);
  content: "";
}

.recent-stats__icon {
  position: absolute;
  top: 14px;
  right: 15px;
  display: grid;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 10px;
  background: rgb(255 255 255 / 8%);
  color: #ff9bab;
  font-size: 13px;
  font-weight: 950;
}

.recent-stats__label {
  display: block;
  max-width: calc(100% - 35px);
  margin-bottom: 9px;
  color: #b9cbe0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.recent-stats__value {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: clamp(28px, 3vw, 39px);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-stats__value--text {
  padding-top: 5px;
  font-size: clamp(16px, 2vw, 21px);
}

.recent-activity[data-state="loading"] .recent-activity__card,
.recent-activity[data-state="loading"] .recent-stats__value {
  animation: recent-activity-loading 1.5s ease-in-out infinite;
}

.recent-activity[data-state="empty"] .recent-activity__eyebrow span,
.recent-activity[data-state="error"] .recent-activity__eyebrow span {
  background: #9fb0c4;
  box-shadow: 0 0 0 6px rgb(159 176 196 / 13%);
}

@keyframes recent-activity-loading {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

@keyframes recent-activity-out {
  from { opacity: 1; transform: translateY(0) rotateX(0); }
  to { opacity: 0; transform: translateY(-9px) rotateX(52deg); }
}

@keyframes recent-activity-in {
  from { opacity: 0; transform: translateY(12px) rotateX(-45deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

@media (max-width: 860px) {
  .recent-activity__heading {
    align-items: center;
  }

  .recent-activity__heading h2 {
    font-size: clamp(28px, 5vw, 39px);
  }

  .recent-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .recent-activity {
    margin-top: -30px;
    margin-bottom: 68px;
    padding: 0 16px;
  }

  .recent-activity__heading {
    display: grid;
    gap: 18px;
    padding: 23px 21px;
  }

  .recent-activity__heading h2 {
    margin-top: 7px;
  }

  .recent-activity__pause {
    justify-self: start;
  }

  .recent-activity__shell {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px 17px;
    min-height: 150px;
    padding: 20px;
  }

  .recent-activity__flag {
    width: 72px;
    height: 54px;
  }

  .recent-activity__status {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 440px) {
  .recent-activity__heading,
  .recent-activity__shell {
    border-radius: 20px 20px 0 0;
  }

  .recent-activity__shell {
    border-radius: 0 0 20px 20px;
  }

  .recent-activity__heading h2 {
    font-size: 29px;
  }

  .recent-activity__heading > div > p:last-child {
    font-size: 13px;
  }

  .recent-activity__name {
    font-size: 23px;
  }

  .recent-stats {
    gap: 9px;
    margin-top: 9px;
  }

  .recent-stats__item {
    min-height: 105px;
    padding: 16px 14px;
    border-radius: 16px;
  }

  .recent-stats__icon {
    top: 11px;
    right: 11px;
  }

  .recent-stats__value {
    font-size: 26px;
  }

  .recent-stats__value--text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recent-activity[data-state="loading"] .recent-activity__card,
  .recent-activity[data-state="loading"] .recent-stats__value,
  .recent-activity__card.is-leaving,
  .recent-activity__card.is-entering {
    animation: none !important;
  }
}
