body {
  background: #fff8e7;
}

.competition-page {
  padding: 50px 8%;
  color: #17324d;
}

.competition-hero,
.leader-card,
.enter-card,
.entry-card,
.features-strip,
.empty-message {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.competition-hero {
  padding: 38px;
  margin-bottom: 34px;
  text-align: center;
}

.competition-hero h1 {
  font-size: 48px;
  margin: 0 0 12px;
}

.competition-hero p {
  color: #52677a;
  margin: 0;
}

.feature-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 44px;
}

.leader-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #fffdf6 60%,
    #fff3d8 100%
  );
}

.leader-card .entry-image-btn {
  height: 100%;
}

.leader-card img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  border-radius: 0;
}

.leader-content {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.leader-badge {
  display: inline-block;
  width: fit-content;
  background: #ffb703;
  color: #17324d;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: bold;
  margin-bottom: 18px;
}

.leader-content h2 {
  margin: 0 0 10px;
  font-size: 36px;
  color: #17324d;
}

.leader-content h3 {
  margin-bottom: 10px;
}

.leader-family {
  color: #52677a;
  font-weight: 600;
  margin-bottom: 16px;
}

.leader-description {
  margin: 16px 0 22px;
  line-height: 1.6;
  color: #52677a;
}

.leader-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.leader-stat {
  background: #fff;
  border: 2px solid #e6f5ff;
  padding: 12px 18px;
  border-radius: 16px;
  text-align: center;
}

.leader-stat strong {
  display: block;
  color: #0077cc;
  font-size: 24px;
}

.leader-stat span {
  font-size: 13px;
  color: #52677a;
}

.leader-content p,
.leader-card p,
.enter-card p,
.entry-content p {
  color: #52677a;
  line-height: 1.5;
}

.enter-card {
  overflow: hidden;
}

.enter-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.enter-content {
  padding: 26px;
  text-align: center;
}

.vote-count {
  display: inline-block;
  background: #e6f5ff;
  color: #0077cc;
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: bold;
  margin: 10px 0 18px;
}

.vote-btn,
.enter-btn {
  border: none;
  display: inline-block;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

.vote-btn {
  background: #0077cc;
  color: #fff;
}

.enter-btn {
  background: #ffb703;
  color: #17324d;
}

.share-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.share-btn {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  background: #e6f5ff;
  color: #0077cc;
  transition: .25s;
}

.share-btn:hover {
  background: #0077cc;
  color: #fff;
}

.section-heading {
  margin: 0 0 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.section-heading p {
  margin: 0;
  color: #52677a;
}

.entries-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.entry-card {
  overflow: hidden;
}

.entry-image-btn {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  display: block;
}

.entry-image-btn img {
  transition: transform .35s ease, filter .35s ease;
}

.entry-image-btn:hover img {
  transform: scale(1.06);
  filter: brightness(.8);
}

.entry-image-btn::after {
  content: "🔍 View Entry";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: bold;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
}

.entry-image-btn:hover::after {
  opacity: 1;
}

.gallery-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: #0077cc;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.image-hint {
  text-align: center;
  font-size: 13px;
  color: #6b7d8d;
  margin: 10px 0 0;
}

.entry-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.entry-content {
  padding: 20px;
}

.entry-content h3 {
  margin: 0 0 8px;
}

.features-strip {
  margin-top: 44px;
  padding: 26px;
}

.features-strip h2 {
  margin: 0 0 18px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.feature-item {
  background: #e6f5ff;
  padding: 14px;
  border-radius: 16px;
  color: #17324d;
  font-weight: bold;
  text-align: center;
}

.pagination {
  margin-top: 35px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a {
  background: #fff;
  color: #17324d;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
}

.pagination a.active {
  background: #0077cc;
  color: #fff;
}

.empty-message {
  padding: 28px;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gallery-modal.open {
  display: flex;
}

.gallery-box {
  background: #fff;
  color: #17324d;
  border-radius: 28px;
  max-width: 1100px;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  position: relative;
}

.gallery-image-wrap {
  position: relative;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-image-wrap img {
  width: 100%;
  height: 80vh;
  object-fit: contain;
}

.gallery-info {
  padding: 28px;
  overflow-y: auto;
}

.gallery-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #ff4d4d;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: bold;
  cursor: pointer;
  z-index: 30;
}

.gallery-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.gallery-nav button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  background: rgba(0,0,0,.72);
  color: #fff;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
  font-weight: bold;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav button:first-child {
  left: 14px;
}

.gallery-nav button:last-child {
  right: 14px;
}

.gallery-nav button:hover {
  background: rgba(0,0,0,.9);
}

.gallery-count {
  color: #52677a;
  margin-bottom: 12px;
}

.gallery-mobile-hint {
  display: none;
}

@media(max-width: 1200px) {
  .feature-layout,
  .leader-card {
    grid-template-columns: 1fr;
  }

  .leader-card img {
    min-height: 240px;
  }

  .entries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width: 800px) {
  .gallery-modal {
    padding: 10px;
    align-items: stretch;
  }

  .gallery-box {
    grid-template-columns: 1fr;
    max-height: 96vh;
    overflow-y: auto;
  }

  .gallery-image-wrap img {
    height: 42vh;
  }

  .gallery-info {
    padding: 18px;
    overflow-y: visible;
  }

  .gallery-mobile-hint {
    display: block;
    background: #ffb703;
    color: #17324d;
    text-align: center;
    font-weight: bold;
    padding: 10px 14px;
    border-radius: 14px;
    margin: 0 0 14px;
  }

  #galleryVoteForm {
    position: relative;
    bottom: auto;
    background: #fff;
    padding: 8px 0 4px;
    z-index: 5;
  }

  #galleryVoteForm .vote-btn {
    width: 100%;
    font-size: 16px;
    padding: 15px 20px;
  }

  .gallery-nav button {
    width: 48px;
    height: 48px;
    font-size: 26px;
  }

  .gallery-nav button:first-child {
    left: 10px;
  }

  .gallery-nav button:last-child {
    right: 10px;
  }

  .gallery-close {
    top: 8px;
    right: 8px;
  }
}

@media(max-width: 700px) {
  .competition-page {
    padding: 30px 5%;
  }

  .competition-hero h1 {
    font-size: 34px;
  }

  .section-heading {
    display: block;
  }

  .entries-grid,
  .feature-list {
    grid-template-columns: 1fr;
  }

  .leader-card img,
  .enter-card img,
  .entry-card img {
    height: 210px;
  }

  .leader-content {
    padding: 26px;
  }

  .leader-content h2 {
    font-size: 30px;
  }
}
