/* 競賽組別內頁 */
.competition-page {
  --competition-page-accent-gradient: linear-gradient(
    90deg,
    #0997f7 0%,
    #029ef5 7.14%,
    #00a4f2 14.29%,
    #00abf0 21.43%,
    #00b1ed 28.57%,
    #00b8ea 35.71%,
    #00bee8 42.86%,
    #00c4e5 50%,
    #00cae2 57.14%,
    #00d0de 64.29%,
    #00d6db 71.43%,
    #00dcd8 78.57%,
    #00e2d4 85.71%,
    #00e8d0 92.86%,
    #09eecc 100%
  );
  position: relative;
  width: 100%;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 5rem)
    clamp(4rem, 8vw, 6rem);
  overflow-x: clip;
}

.competition-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 14% 20%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 82% 16%, rgba(120, 180, 255, 0.4), transparent),
    radial-gradient(1px 1px at 48% 78%, rgba(255, 255, 255, 0.28), transparent);
}

.competition-page__inner {
  position: relative;
  z-index: 1;
  max-width: 80rem;
  margin: 0 auto;
}

.competition-page__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.45);
}

.competition-page__breadcrumb a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s ease;
}

.competition-page__breadcrumb a:hover {
  color: #fff;
}

.competition-page__breadcrumb [aria-current="page"] {
  color: rgba(255, 255, 255, 0.75);
}

.competition-page__head {
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  text-align: left;
}

.competition-page__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  color: #63c0ae;
}

.competition-page__title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.competition-page__line {
  display: block;
  width: min(7.5rem, 40%);
  height: 3px;
  margin: 0 0 1rem;
  border: none;
  border-radius: 999px;
  background: var(--competition-page-accent-gradient);
}

.competition-page__intro {
  margin: 0 0 clamp(1.5rem, 4vw, 2rem);
  max-width: 40rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
}

.competition-page__groups-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.competition-page__groups-label {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: #9fa0a3;
}

.competition-page__groups {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0;
  min-width: min(100%, 20rem);
  border-bottom: 1px solid #0997f733;
}

.competition-page__group {
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  background: transparent;
  color: #9fa0a3;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.competition-page__group:hover:not(.is-active) {
  color: #ecf2f7;
}

.competition-page__group.is-active {
  margin-bottom: -1px;
  border-width: 1px 1px 0 1px;
  border-style: solid;
  border-color: #0997f766;
  background: #0997f733;
  color: #ecf2f7;
}

.competition-page__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.875rem, 2vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.competition-page__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  border: 1px solid #0997f733;
  border-radius: 0.875rem;
  background: #15324e4d;
  overflow: hidden;
}

.competition-page__card[hidden] {
  display: none;
}

.competition-page__visual {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.competition-page__visual--comic {
  background: linear-gradient(90deg, #f6339a 0%, #ff2056 100%);
}

.competition-page__visual--image {
  background: linear-gradient(90deg, #2b7fff 0%, #00b8db 100%);
}

.competition-page__visual--video {
  background: linear-gradient(90deg, #ff6900 0%, #fe9a00 100%);
}

.competition-page__visual--music {
  background: linear-gradient(90deg, #615fff 0%, #2b7fff 100%);
}

.competition-page__icon {
  display: block;
  max-width: 72%;
  max-height: 72%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.competition-page__badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  padding: 0.5rem 1rem;
  border-radius: 0.875rem;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  box-shadow: 0 8px 10px -6px #0000001a, 0 20px 25px -5px #0000001a;
}

.competition-page__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem 1rem 1rem;
}

.competition-page__card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: #ecf2f7;
}

.competition-page__desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #9fa0a3;
}

.competition-page__view {
  display: inline-flex;
  align-self: flex-end;
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0997f7;
  text-decoration: none;
  transition: color 0.2s ease;
}

.competition-page__view:hover {
  color: #ecf2f7;
}

.competition-page__back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: min(100%, 14rem);
  margin: clamp(1.75rem, 4vw, 2.5rem) auto 0;
  padding: 0.65rem 1.25rem;
  border: 1px solid #0997f74d;
  border-radius: 999px;
  background: #0997f71a;
  color: #fff;
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.competition-page__back:hover {
  color: #ecf2f7;
  border-color: #0997f766;
  background: #0997f733;
}

.competition-page__back:focus-visible {
  outline: 2px solid rgba(9, 151, 247, 0.55);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .competition-page__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .competition-page__head {
    text-align: center;
  }

  .competition-page__intro {
    margin-inline: auto;
  }

  .competition-page__line {
    margin-inline: auto;
  }

  .competition-page__groups-row {
    justify-content: center;
  }

  .competition-page__groups {
    justify-content: center;
  }

  .competition-page__grid {
    grid-template-columns: 1fr;
    max-width: 22rem;
    margin-inline: auto;
  }
}
