.big-picture-toast-host {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: visible;

  &__confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  &__toast {
    position: absolute;
    right: calc(var(--spacing-unit) * 6);
    bottom: calc(var(--spacing-unit) * 6);
    display: flex;
    justify-content: flex-end;
  }
}

.big-picture-toast {
  position: relative;
  width: min(32rem, calc(100vw - calc(var(--spacing-unit) * 12)));
  overflow: hidden;
  border-radius: calc(var(--spacing-unit) * 3);
  border-top: 1px solid var(--secondary-border);
  background: rgba(14, 14, 14, 1);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  z-index: 2;

  &__content {
    display: grid;
    grid-template-columns: 56px 1px minmax(0, 1fr) 36px;
    align-items: center;
    column-gap: 16px;
    padding: 16px;
  }

  &--with-action &__content {
    grid-template-columns: 56px 1px minmax(0, 1fr) auto 36px;
  }

  &__media {
    grid-column: 1;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    overflow: hidden;
    border-radius: 6px;
  }

  &__media-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 6px;
  }

  &__fallback-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--toast-fallback-icon-color, rgba(255, 255, 255, 0.5));
  }

  &__fallback-image,
  &__fallback-symbol {
    width: 32px;
    height: 32px;
    display: block;
  }

  &__fallback-image {
    object-fit: contain;
    opacity: 0.5;
  }

  &__divider {
    grid-column: 2;
    width: 1px;
    height: 40px;
    min-height: 40px;
    background-color: rgba(255, 255, 255, 0.16);
  }

  &__text {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
    min-height: 52px;
    align-self: center;
  }

  &__title {
    min-width: 0;
    max-width: 100%;
    color: var(--primary);
    display: -webkit-box;
    font-size: 14px;
    line-height: 18px;
    font-weight: 700;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  &__description {
    min-width: 0;
    max-width: 100%;
    color: var(--text);
    font-size: 14px;
    line-height: 15px;
    opacity: 0.65;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  &__action {
    grid-column: 4;
    justify-self: end;
    height: 45px;
    padding: 0 calc(var(--spacing-unit) * 4);
    gap: calc(var(--spacing-unit) * 4);

    .button__text {
      width: auto;
      color: rgba(255, 255, 255, 0.8);
      font-size: 14px;
      line-height: normal;
      padding: 0;
    }
  }

  &__close {
    grid-column: 4;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition:
      background-color 0.2s ease,
      color 0.2s ease;

    &:hover {
      background-color: rgba(255, 255, 255, 0.08);
      color: rgba(255, 255, 255, 0.8);
    }
  }

  &--with-action &__close {
    grid-column: 5;
  }

  &__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
  }

  &__progress-fill {
    height: 100%;
    min-width: 0;
    background: #cecece;
    transform-origin: left center;
    will-change: transform;
  }

  @media (max-width: 720px) {
    width: calc(100vw - calc(var(--spacing-unit) * 6));
  }

  @media (max-width: 640px) {
    &__content {
      grid-template-columns: 56px 1px minmax(0, 1fr) 36px;
      grid-template-areas:
        "media divider text close"
        "media divider actions actions";
      row-gap: calc(var(--spacing-unit) * 2);
    }

    &--with-action &__content {
      grid-template-columns: 56px 1px minmax(0, 1fr) 36px;
      grid-template-areas:
        "media divider text close"
        "media divider actions actions";
    }

    &__media {
      grid-area: media;
    }

    &__divider {
      grid-area: divider;
      align-self: stretch;
      height: auto;
      min-height: 56px;
    }

    &__text {
      grid-area: text;
      max-width: 100%;
    }

    &__action {
      grid-area: actions;
      justify-self: start;
    }

    &__close {
      grid-area: close;
      justify-self: end;
      align-self: start;
    }
  }
}
