.page.discover {
  height: 100%;
  min-height: 100dvh;
  display: flex;
  overflow: hidden;
}

.discover-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  height: 100%;
  margin: 0 auto;
  padding: 22px 28px 28px;
}

.discover-shell > .link {
  flex-shrink: 0;
  width: fit-content;
  margin-bottom: 18px;
  opacity: 0;
  animation: fade-in 180ms ease forwards;
}

.module-list {
  flex: 1;
  min-height: 0;
  display: grid;
  place-content: center;
  grid-template-columns: repeat(3, auto);
  gap: 28px 56px;
  justify-items: center;
  transition: opacity 180ms ease;
}

.page.is-open .module-list {
  opacity: 0;
  pointer-events: none;
}

.module-title {
  margin: 0;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-shadow:
    0 0 8px rgba(152, 129, 255, 0.75),
    0 0 18px rgba(152, 129, 255, 0.45),
    0 0 32px rgba(152, 129, 255, 0.28);
  opacity: 0;
  animation: fade-in 200ms ease forwards;
  animation-delay: calc(var(--i, 0) * 40ms + 60ms);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.module-title:hover,
.module-title:focus-visible {
  color: #b8a4ff;
  text-shadow:
    0 0 10px rgba(152, 129, 255, 0.95),
    0 0 22px rgba(152, 129, 255, 0.65),
    0 0 40px rgba(152, 129, 255, 0.4);
}

.module-title:focus-visible {
  outline: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
}

.overlay[hidden] {
  display: none;
}

.overlay-dim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(10, 11, 14, 0.55);
  opacity: 0;
  cursor: pointer;
  transition: opacity 180ms ease;
}

.overlay.is-dim .overlay-dim {
  opacity: 1;
}

.fly-title {
  position: fixed;
  z-index: 5;
  margin: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 8px rgba(152, 129, 255, 0.75),
    0 0 18px rgba(152, 129, 255, 0.45);
  transition: left 220ms ease, top 220ms ease, transform 220ms ease;
}

.fly-title[hidden] {
  display: none;
}

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100% - 40px));
  max-height: min(72vh, 560px);
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #15161a;
  box-shadow:
    0 0 0 1px rgba(152, 129, 255, 0.12),
    0 0 28px rgba(152, 129, 255, 0.28);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  pointer-events: none;
  transition: opacity 180ms ease, transform 200ms ease;
}

.panel.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(152, 129, 255, 0.35);
}

.panel-title {
  margin: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 8px rgba(152, 129, 255, 0.75),
    0 0 18px rgba(152, 129, 255, 0.45);
}

.panel-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 18px;
}

.panel-scroll::-webkit-scrollbar {
  width: 8px;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(152, 129, 255, 0.35);
  border-radius: 8px;
}

.panel-group + .panel-group {
  margin-top: 16px;
}

.panel-group-name {
  margin: 0 0 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.panel-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-items li {
  color: #7c8090;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .discover-shell {
    padding: 16px 16px 24px;
  }

  .module-list {
    grid-template-columns: repeat(2, auto);
    gap: 22px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .discover-shell > .link,
  .module-title,
  .overlay-dim,
  .fly-title,
  .panel {
    animation: none;
    transition: none;
    opacity: 1;
  }

  .page.is-open .module-list {
    opacity: 0;
  }
}
