.flash-review {
  position: fixed;
  z-index: 100;
  left: 16px;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 32px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 320ms ease, transform 380ms cubic-bezier(.22,1,.36,1);
  pointer-events: none;   /* never blocks the buttons underneath */
}

.flash-review.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* stepping aside from a button, field or footer text it would otherwise cover */
.flash-review.is-dodging {
  opacity: 0;
  transform: translateY(14px);
}

/* stay out of the way while the quiz's own toast is up */
body:has(.toast.is-visible) .flash-review {
  opacity: 0;
}

.flash-review__card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px 11px 14px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(11, 42, 56, 0.16), 0 1px 3px rgba(11, 42, 56, 0.08);
  color: #1f2a30;
  font-family: "Exo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
}

.flash-review__g {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.flash-review__rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f2b01e;
}

.flash-review__number {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.flash-review__stars {
  display: inline-flex;
  gap: 1px;
}

.flash-review__star {
  width: 15px;
  height: 15px;
}

.flash-review__person {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid #e6ecef;
}

.flash-review__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: #e9eef1;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.flash-review__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flash-review__name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  color: #1f2a30;
}

@media (max-width: 600px) {
  .flash-review {
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
  }

  .flash-review__card {
    gap: 11px;
    padding: 10px 14px 10px 12px;
  }

  .flash-review__person {
    padding-left: 11px;
  }

  .flash-review__name {
    font-size: 13px;
  }
}

/* narrow phones: tighter card so the longest name still fits in full */
.flash-review__card {
  min-width: 0;
  max-width: 100%;
}

.flash-review__person {
  min-width: 0;
}

.flash-review__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;   /* room for descenders inside the clipped box; the avatar still sets the row height */
}

@media (max-width: 360px) {
  .flash-review__card {
    gap: 8px;
    padding: 9px 10px 9px 10px;
  }

  .flash-review__g {
    width: 18px;
    height: 18px;
  }

  .flash-review__number {
    font-size: 13px;
  }

  .flash-review__star {
    width: 12px;
    height: 12px;
  }

  .flash-review__person {
    gap: 7px;
    padding-left: 8px;
  }

  .flash-review__avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .flash-review__name {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash-review {
    transform: none;
    transition: opacity 200ms ease;
  }

  .flash-review.is-visible,
  .flash-review.is-dodging {
    transform: none;
  }
}

