/* =========================================
   Rules Modal Styles (Custom "rules-" classes)
   Mimics Bootstrap 4 Modal behavior without conflicts
   ========================================= */

.rules-modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
  background-color: rgba(0, 0, 0, 0.5); /* Backdrop */
  opacity: 0;
  transition: opacity 0.15s linear;
}

/* Logic for JS .show class */
.rules-modal.show {
  opacity: 1;
}

.rules-modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}

.contest-card ul {
  margin: 0;
  padding-left: 25px; 
  list-style-type: disc !important; 
}

.contest-card li {
  margin: 6px 0;
  display: list-item !important;
}

@media (min-width: 576px) {
  .rules-modal-dialog {
    max-width: 800px; /* Modal LG width */
    margin: 1.75rem auto;
  }
}

.rules-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.rules-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: calc(0.3rem - 1px);
  border-top-right-radius: calc(0.3rem - 1px);
  background-color: #856404b3;
  color: white;
}

.rules-modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 1.25rem;
  font-weight: 500;
  color: white;
}

.rules-close-btn {
  padding: 1rem 1rem;
  margin: -1rem -1rem -1rem auto;
  background-color: transparent;
  border: 0;
  float: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: white;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.75;
  cursor: pointer;
  appearance: none;
}

.rules-close-btn:hover {
  color: #fff;
  opacity: 1;
  text-decoration: none;
}

.rules-modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
  max-height: 80vh;
}

.rules-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
  border-bottom-right-radius: calc(0.3rem - 1px);
  border-bottom-left-radius: calc(0.3rem - 1px);
}

.rules-btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  background-color: #dab33f;
  border: 1px solid #dab33f;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  color: #fff;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.rules-btn:hover {
  background-color: #c4a138;
  border-color: #c4a138;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}