article {
  width: 680px;
  margin: 0 auto;
}

article h1 {
  font-size: var(--font-size-m);
  margin-bottom: 40px;
}

.race_list {
  display: flex;
  flex-direction: column;
}

.race_list_container {
  margin-bottom: 80px;
}

.past_events_container {
  margin-bottom: 80px;
}

.race_item {
  padding: 24px;
  margin-bottom: 8px;
  border: 1px solid #dfdfdf;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.race_item--past {
  border-color: #d7d9de;
  background: linear-gradient(180deg, #f4f5f7 0%, #eceef1 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #6b7280;
  opacity: 0.66;
  filter: grayscale(0.9);
}

.race_item--past .race_name,
.race_item--past .race_round,
.race_item--past .race_date {
  color: #6b7280;
}

.race_item--next {
  border-color: #d4aa2a;
  background: linear-gradient(180deg, #fff8dd 0%, #fff1ba 100%);
  box-shadow: 0 10px 22px rgba(180, 134, 0, 0.18);
}

.race_item--next .race_name {
  color: #6f4d00;
}

.race_item--next .race_round,
.race_item--next .race_date {
  color: #9a6700;
}

.race_horse_status {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-size-s);
  line-height: 1.5;
  vertical-align: middle;
}

.race_horse_status--ready {
  background: #eaf6ee;
  color: #24713b;
}

.race_horse_status--empty {
  background: #f3f3f3;
  color: #666666;
}

/* 同日開催カレンダー */
.past_events_container h2,
.display_events_container h2 {
  display: block;
  margin: 0 auto 1rem;
  text-align: center;
}

.past_events,
.display_events {
  display: flex;
  flex-direction: column;
}

.past_event_item,
.display_event_item {
  padding: 24px;
  margin-bottom: 8px;
  border: 1px solid #dfdfdf;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.past_event_item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.past_event_venues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.past_event_venue_link {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #d7dbe2;
  background: #f7f9fc;
  font-size: var(--font-size-s);
  line-height: 1.5;
}

@media (max-width: 767px) {
  article {
    width: calc(100% - 16px);
  }

  article h1 {
    margin-bottom: 24px;
  }

  .race_list_container,
  .past_events_container {
    margin-bottom: 48px;
  }

  .race_item,
  .past_event_item,
  .display_event_item {
    padding: 16px 14px;
  }

  .race_item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
  }

  .race_name {
    flex: 1 1 100%;
    line-height: 1.5;
  }

  .race_horse_status {
    margin-left: auto;
  }

  .past_event_item,
  .display_event_item {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .past_event_venues {
    gap: 6px;
  }
}
