.demo-experience-wrap {
  position: sticky;
  top: 0;
  z-index: 90;
  width: min(100% - 1rem, 68rem);
  margin: 0.7rem auto 0;
}

.demo-experience-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 0.25rem;
  background: rgba(27, 27, 27, 0.94);
  border: 1px solid var(--line);
  backdrop-filter: blur(0.75rem);
}

.demo-experience-bar button {
  min-height: 2.85rem;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 0.18rem solid transparent;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.demo-experience-bar button:hover {
  color: var(--ink);
  background: rgba(195, 216, 197, 0.06);
}

.demo-experience-bar button.active,
.demo-experience-bar button[aria-selected="true"] {
  color: #1e211f;
  background: var(--lime);
  border-bottom-color: var(--signal);
}

/* Team page: let the live tab bar fit Challenges / Gallery / Rules in one row. */
.hunt-tabs {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.gallery-demo-root {
  width: min(100% - 1rem, 68rem);
  margin: 0 auto;
  padding: 1rem 0 max(6.5rem, env(safe-area-inset-bottom));
}

.gallery-demo-shell {
  display: grid;
  gap: 1rem;
}

.recap-hero {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.15rem, 4vw, 2.4rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 114, 71, 0.21), transparent 30%),
    linear-gradient(135deg, #232323, #303430);
  border: 1px solid var(--line);
  border-top: 0.28rem solid var(--signal);
}

.recap-hero h1 {
  max-width: 14ch;
  margin-bottom: 0.45rem;
  color: var(--paper);
  font-size: clamp(2rem, 7vw, 4.2rem);
  letter-spacing: -0.045em;
}

.recap-hero p {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
}

.recap-hero .gallery-live-status {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.55rem;
  color: var(--lime);
}

.gallery-live-status > span {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 0.28rem rgba(255, 114, 71, 0.16);
}

.gallery-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.25rem;
  background: #202220;
  border: 1px solid var(--line);
}

.gallery-switcher button {
  min-height: 3.2rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 0.18rem solid transparent;
  font-weight: 900;
}

.gallery-switcher button span {
  display: inline-grid;
  min-width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  place-items: center;
  color: var(--ink);
  background: rgba(195, 216, 197, 0.12);
  border: 1px solid var(--line);
  font-size: 0.72rem;
}

.gallery-switcher button.active {
  color: #202220;
  background: var(--lime);
  border-bottom-color: var(--signal);
}

.gallery-switcher button.active span {
  color: var(--paper);
  background: var(--graphite);
}

.gallery-switcher.three-up {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-switcher.three-up button {
  padding: 0 0.2rem;
  font-size: 0.86rem;
}

.gallery-team-filter {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  background: #202220;
  border: 1px solid var(--line);
}

.gallery-team-filter label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.gallery-team-filter select {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
  color: var(--ink);
  background: #1d1e1d;
  border: 1px solid var(--line);
  font: inherit;
  font-weight: 800;
}

.gallery-heading {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  padding: 0.5rem 0.15rem 0;
}

.gallery-heading h2 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(1.5rem, 5vw, 2.4rem);
}

.gallery-heading > p {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

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

.gallery-photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #1d1e1d;
  border: 1px solid rgba(195, 216, 197, 0.16);
}

.gallery-photo-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border: 0.16rem solid transparent;
}

.gallery-photo-card.is-favorite::after {
  border-color: var(--signal);
}

.gallery-photo-open {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: #1d1e1d;
  border: 0;
  text-align: left;
}

.gallery-photo-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.gallery-photo-open:hover img {
  transform: scale(1.025);
}

.gallery-photo-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  padding: 2.5rem 0.65rem 0.6rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(18, 18, 18, 0.92));
}

.gallery-photo-label strong {
  overflow: hidden;
  font-size: 0.77rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-photo-label small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
}

.best-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.38rem 0.5rem;
  color: #1d1e1d;
  background: var(--lime);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery-card-actions {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}

.gallery-icon-button {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  color: var(--paper);
  background: rgba(28, 30, 29, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.26);
  text-decoration: none;
  backdrop-filter: blur(0.5rem);
}

.gallery-icon-button svg,
.gallery-download-note > span svg,
.gallery-empty > span svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gallery-icon-button.favorite.active {
  color: #fff;
  background: var(--signal);
  border-color: var(--signal);
}

.gallery-icon-button.favorite.active svg {
  fill: currentColor;
}

.gallery-download-note {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem;
  background: rgba(195, 216, 197, 0.07);
  border: 1px solid var(--line);
}

.gallery-download-note > span {
  display: grid;
  flex: 0 0 2.6rem;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  color: var(--graphite);
  background: var(--lime);
}

.gallery-download-note strong {
  color: var(--paper);
}

.gallery-download-note p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.gallery-empty {
  display: grid;
  min-height: 20rem;
  padding: 2rem;
  place-items: center;
  align-content: center;
  color: var(--muted);
  background: rgba(195, 216, 197, 0.05);
  border: 1px dashed var(--line);
  text-align: center;
}

.gallery-empty.compact {
  min-height: 12rem;
}

.gallery-empty > span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.75rem;
  place-items: center;
  color: var(--graphite);
  background: var(--lime);
}

.gallery-empty h2 {
  margin-bottom: 0.4rem;
  color: var(--paper);
}

.gallery-empty p {
  margin: 0;
}

.gallery-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  color: #fff;
  background: rgba(15, 15, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gallery-play-badge svg {
  width: 1.3rem;
  height: 1.3rem;
  margin-left: 0.18rem;
  fill: currentColor;
}

.gallery-play-badge.large {
  width: 4rem;
  height: 4rem;
}

.gallery-video-blank {
  display: block;
  width: 100%;
  height: 100%;
  background: #101110;
}

.gallery-processing-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #1d1e1d;
}

.processing-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(195, 216, 197, 0.05) 30%, rgba(195, 216, 197, 0.15) 50%, rgba(195, 216, 197, 0.05) 70%);
  background-size: 200% 100%;
  animation: gallery-shimmer 1.6s linear infinite;
}

@keyframes gallery-shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem max(0.5rem, env(safe-area-inset-bottom));
  place-items: center;
  background: rgba(10, 11, 10, 0.94);
  backdrop-filter: blur(0.65rem);
}

.gallery-lightbox {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 68rem);
  height: min(100%, 52rem);
  color: var(--paper);
  background: #151615;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-lightbox header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 3.4rem;
  padding: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.gallery-lightbox header > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.gallery-lightbox header > span:last-child {
  text-align: right;
}

.lightbox-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-video-poster {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: #000;
  border: 0;
}

.lightbox-video-poster img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-video-poster .gallery-video-blank {
  position: absolute;
  inset: 0;
}

.lightbox-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.lightbox-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(15, 15, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: translateY(-50%);
}

.lightbox-arrow.previous {
  left: 0.5rem;
}

.lightbox-arrow.next {
  right: 0.5rem;
}

.lightbox-arrow svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.gallery-lightbox footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.gallery-lightbox footer h2 {
  margin: 0.1rem 0;
  font-size: 1.15rem;
}

.gallery-lightbox footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.lightbox-actions {
  display: flex;
  gap: 0.45rem;
}

.gallery-text-action {
  min-height: 2.75rem;
  padding: 0.45rem 0.85rem;
  color: #1d1e1d;
  background: var(--lime);
  border: 1px solid var(--lime);
  font-weight: 900;
}

.gallery-toast {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1500;
  max-width: calc(100% - 2rem);
  padding: 0.8rem 1rem;
  color: #1d1e1d;
  background: var(--lime);
  border-left: 0.25rem solid var(--signal);
  font-weight: 900;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.gallery-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 44rem) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 42rem) {
  .gallery-lightbox footer {
    display: grid;
  }

  .lightbox-actions {
    width: 100%;
  }

  .gallery-text-action {
    flex: 1;
  }
}

@media (max-width: 27rem) {
  .gallery-heading {
    display: grid;
  }

  .gallery-heading > p {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-photo-open img,
  .gallery-toast {
    transition: none;
  }

  .processing-shimmer {
    animation: none;
  }
}
