.rcm-gallery {
  --rcm-red: #e02020;
  --rcm-ink: #111;
  --rcm-muted: #666;
  box-sizing: border-box;
  margin: 1.5rem auto 4rem;
  max-width: 1440px;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  width: 100%;
}

.rcm-intro {
  max-width: 840px;
  margin-bottom: 2rem;
}

.rcm-kicker {
  color: var(--rcm-red);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  margin: 0 0 .45rem;
  text-transform: uppercase;
}

.rcm-intro h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  margin: 0 0 .85rem;
}

.rcm-controls {
  background: linear-gradient(135deg, #431c53, #1b0824);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 35%);
  margin-bottom: 1.5rem;
  padding: 1.1rem;
}

.rcm-controls label {
  color: #fff;
  display: block;
  font-size: .85rem;
  font-weight: 750;
  margin-bottom: .45rem;
}

.rcm-search-row {
  align-items: center;
  display: flex;
  gap: 1rem;
}

#rcm-search {
  background: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  color: #431c53;
  flex: 1;
  font-size: 1rem;
  min-height: 48px;
  padding: .7rem .85rem;
}

#rcm-search:focus {
  border-color: #ffcc00;
  outline: 3px solid rgb(255 204 0 / 24%);
}

#rcm-count {
  color: #ffcc00;
  font-size: .9rem;
  min-width: 110px;
  text-align: right;
}

.rcm-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rcm-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  color: var(--rcm-ink);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.rcm-card:hover,
.rcm-card:focus-visible {
  border-color: var(--rcm-red);
  box-shadow: 0 10px 26px rgb(0 0 0 / 13%);
  transform: translateY(-2px);
}

.rcm-image-wrap {
  align-items: center;
  aspect-ratio: 2 / 1;
  background: #151515;
  display: flex;
  justify-content: center;
  padding: .65rem;
}

.rcm-image-wrap img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.rcm-name {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  overflow: hidden;
  padding: .75rem .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rcm-status {
  background: #fff3f3;
  border: 1px solid #efb4b4;
  border-radius: 10px;
  margin: 1rem 0;
  padding: 1rem;
  text-align: center;
}

.rcm-more {
  background: var(--rcm-red);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: block;
  font-weight: 800;
  margin: 2rem auto 0;
  padding: .85rem 1.5rem;
}

.rcm-more[hidden] {
  display: none;
}

.rcm-dialog {
  background: #111;
  border: 0;
  border-radius: 14px;
  color: #fff;
  max-height: 90vh;
  max-width: min(1100px, 94vw);
  padding: 2.5rem 1rem 1rem;
}

.rcm-dialog::backdrop {
  background: rgb(0 0 0 / 82%);
}

.rcm-dialog img {
  display: block;
  max-height: 72vh;
  max-width: 100%;
  object-fit: contain;
}

.rcm-dialog p {
  font-weight: 700;
  margin: .8rem 0 0;
  text-align: center;
}

.rcm-close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  position: absolute;
  right: .65rem;
  top: .35rem;
}

@media (max-width: 980px) {
  .rcm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .rcm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rcm-search-row { align-items: stretch; flex-direction: column; gap: .5rem; }
  #rcm-count { min-width: 0; text-align: left; }
}

@media (max-width: 520px) {
  .rcm-grid { grid-template-columns: 1fr; }
}
