#chain {
  flex-shrink: 0;
  position: relative;

  --min-gap: calc(var(--cube-size) * -1);
  --max-gap: calc(var(--cube-size) * 6);
  --min-block-interval: 0;
  --max-block-interval: 10800;

  @container aside (max-width: 767px) {
    --min-gap: 0rem;
  }
  @container aside (min-width: 768px) {
    height: 100%;
  }

  .scroll {
    padding: 0 var(--main-padding);
    scrollbar-width: none;

    @container aside (max-width: 767px) {
      padding-bottom: 1rem;
      overflow-x: auto;
    }

    @container aside (min-width: 768px) {
      padding: var(--main-padding) calc(var(--main-padding) / 2) 6rem
        var(--main-padding);
      height: 100%;
      overflow-y: auto;
    }

    .blocks {
      display: flex;
      flex-direction: column-reverse;

      @container aside (max-width: 767px) {
        flex-direction: row-reverse;
        width: max-content;
      }

      .cube {
        --cube-fall-off: pow(
          clamp(
            0,
            (var(--block-interval, 600) - var(--min-block-interval)) /
              (var(--max-block-interval) - var(--min-block-interval)),
            1
          ),
          0.7
        );
        --block-gap: calc(
          var(--min-gap) + var(--cube-fall-off) *
            (var(--max-gap) - var(--min-gap))
        );

        & + & {
          margin-bottom: var(--block-gap);

          @container aside (max-width: 767px) {
            margin-bottom: 0;
            margin-right: var(--block-gap);
          }
        }

        .face-text .height {
          font-size: var(--font-size-sm);
          font-weight: normal;
        }
        .face-text .fees {
          display: flex;
          flex-direction: column;
          height: 100%;
          justify-content: center;
          align-items: center;
        }
        .face-text .pool {
          display: flex;
          align-items: center;
          justify-content: center;
          gap: 0.1em;
          width: 100%;

          img {
            width: 1.25em;
            height: 1.25em;
            flex-shrink: 0;
          }
          span {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 1;
          }
        }
      }
    }
  }

  .edge {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.1em;
    font-weight: 500;

    @container aside (max-width: 767px) {
      height: 100%;
      width: var(--main-padding);
      writing-mode: vertical-lr;
      text-orientation: upright;
    }

    @container aside (min-width: 768px) {
      width: 100%;
      height: var(--main-padding);
      padding-left: calc(var(--main-padding) / 2);
    }

    &.tip {
      top: 0;
      left: 0;
    }
    &.gen {
      bottom: 0;
      right: 0;
    }
  }
}
