.rules-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}

.rules-gallery a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: zoom-in;
}

.rules-gallery a:hover,
.rules-gallery a:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  outline: none;
}

.rules-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4.2;
  object-fit: contain;
  object-position: top center;
  background: #f4f7f9;
}

.rules-gallery span {
  display: block;
  padding: 10px 12px 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--teal);
  border-top: 1px solid var(--line);
}

.rules-highlight {
  max-width: 820px;
  margin: 40px auto 0;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fafc;
  text-align: center;
}

.rules-highlight p {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.65;
}

.rules-highlight p:last-child {
  margin-bottom: 0;
}

.rules-accommodation {
  max-width: 820px;
  margin: 36px auto 0;
}

.rules-accommodation h3 {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rules-accommodation .rules-intro {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.lightbox {
  border: 0;
  padding: 0;
  max-width: min(920px, 96vw);
  max-height: 94vh;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(10, 18, 24, 0.78);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox img {
  display: block;
  max-width: min(920px, 96vw);
  max-height: calc(94vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lightbox-caption {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
}

@media (max-width: 991px) {
  .rules-gallery {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .rules-gallery {
    grid-template-columns: 1fr;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}
